@walletconnect/ethereum-provider 2.11.2 → 2.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(fn,yr){typeof exports=="object"&&typeof module<"u"?yr(exports):typeof define=="function"&&define.amd?define(["exports"],yr):(fn=typeof globalThis<"u"?globalThis:fn||self,yr(fn["@walletconnect/ethereum-provider"]={}))})(this,function(fn){"use strict";var yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oy(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Pi(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var lr={exports:{}},ms=typeof Reflect=="object"?Reflect:null,Rd=ms&&typeof ms.apply=="function"?ms.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Ea;ms&&typeof ms.ownKeys=="function"?Ea=ms.ownKeys:Object.getOwnPropertySymbols?Ea=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ea=function(e){return Object.getOwnPropertyNames(e)};function $y(r){console&&console.warn&&console.warn(r)}var Nd=Number.isNaN||function(e){return e!==e};function pt(){pt.init.call(this)}lr.exports=pt,lr.exports.once=Ry,pt.EventEmitter=pt,pt.prototype._events=void 0,pt.prototype._eventsCount=0,pt.prototype._maxListeners=void 0;var Ld=10;function xa(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(pt,"defaultMaxListeners",{enumerable:!0,get:function(){return Ld},set:function(r){if(typeof r!="number"||r<0||Nd(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Ld=r}}),pt.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},pt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Nd(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 Md(r){return r._maxListeners===void 0?pt.defaultMaxListeners:r._maxListeners}pt.prototype.getMaxListeners=function(){return Md(this)},pt.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",a=this._events;if(a!==void 0)i=i&&a.error===void 0;else if(!i)return!1;if(i){var c;if(t.length>0&&(c=t[0]),c instanceof Error)throw c;var u=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw u.context=c,u}var f=a[e];if(f===void 0)return!1;if(typeof f=="function")Rd(f,this,t);else for(var h=f.length,m=kd(f,h),n=0;n<h;++n)Rd(m[n],this,t);return!0};function Ud(r,e,t,n){var i,a,c;if(xa(t),a=r._events,a===void 0?(a=r._events=Object.create(null),r._eventsCount=0):(a.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),a=r._events),c=a[e]),c===void 0)c=a[e]=t,++r._eventsCount;else if(typeof c=="function"?c=a[e]=n?[t,c]:[c,t]:n?c.unshift(t):c.push(t),i=Md(r),i>0&&c.length>i&&!c.warned){c.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=r,u.type=e,u.count=c.length,$y(u)}return r}pt.prototype.addListener=function(e,t){return Ud(this,e,t,!1)},pt.prototype.on=pt.prototype.addListener,pt.prototype.prependListener=function(e,t){return Ud(this,e,t,!0)};function Ay(){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 jd(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=Ay.bind(n);return i.listener=t,n.wrapFn=i,i}pt.prototype.once=function(e,t){return xa(t),this.on(e,jd(this,e,t)),this},pt.prototype.prependOnceListener=function(e,t){return xa(t),this.prependListener(e,jd(this,e,t)),this},pt.prototype.removeListener=function(e,t){var n,i,a,c,u;if(xa(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(a=-1,c=n.length-1;c>=0;c--)if(n[c]===t||n[c].listener===t){u=n[c].listener,a=c;break}if(a<0)return this;a===0?n.shift():Py(n,a),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this},pt.prototype.off=pt.prototype.removeListener,pt.prototype.removeAllListeners=function(e){var t,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 a=Object.keys(n),c;for(i=0;i<a.length;++i)c=a[i],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function Fd(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?Ty(i):kd(i,i.length)}pt.prototype.listeners=function(e){return Fd(this,e,!0)},pt.prototype.rawListeners=function(e){return Fd(this,e,!1)},pt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):Bd.call(r,e)},pt.prototype.listenerCount=Bd;function Bd(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}pt.prototype.eventNames=function(){return this._eventsCount>0?Ea(this._events):[]};function kd(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Py(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Ty(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Ry(r,e){return new Promise(function(t,n){function i(c){r.removeListener(e,a),n(c)}function a(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}qd(r,e,a,{once:!0}),e!=="error"&&Ny(r,i,{once:!0})})}function Ny(r,e,t){typeof r.on=="function"&&qd(r,"error",e,t)}function qd(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(a){n.once&&r.removeEventListener(e,i),t(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var Pl={},Ia={},Me={},zd={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(u,f){var h=u>>>16&65535,m=u&65535,w=f>>>16&65535,y=f&65535;return m*y+(h*y+m*w<<16>>>0)|0}r.mul=Math.imul||e;function t(u,f){return u+f|0}r.add=t;function n(u,f){return u-f|0}r.sub=n;function i(u,f){return u<<f|u>>>32-f}r.rotl=i;function a(u,f){return u<<32-f|u>>>f}r.rotr=a;function c(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}r.isInteger=Number.isInteger||c,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(u){return r.isInteger(u)&&u>=-r.MAX_SAFE_INTEGER&&u<=r.MAX_SAFE_INTEGER}})(zd),Object.defineProperty(Me,"__esModule",{value:!0});var Hd=zd;function Ly(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}Me.readInt16BE=Ly;function My(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}Me.readUint16BE=My;function Uy(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}Me.readInt16LE=Uy;function jy(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}Me.readUint16LE=jy;function Wd(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}Me.writeUint16BE=Wd,Me.writeInt16BE=Wd;function Kd(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}Me.writeUint16LE=Kd,Me.writeInt16LE=Kd;function Tl(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}Me.readInt32BE=Tl;function Rl(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}Me.readUint32BE=Rl;function Nl(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}Me.readInt32LE=Nl;function Ll(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}Me.readUint32LE=Ll;function Da(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}Me.writeUint32BE=Da,Me.writeInt32BE=Da;function Sa(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}Me.writeUint32LE=Sa,Me.writeInt32LE=Sa;function Fy(r,e){e===void 0&&(e=0);var t=Tl(r,e),n=Tl(r,e+4);return t*4294967296+n-(n>>31)*4294967296}Me.readInt64BE=Fy;function By(r,e){e===void 0&&(e=0);var t=Rl(r,e),n=Rl(r,e+4);return t*4294967296+n}Me.readUint64BE=By;function ky(r,e){e===void 0&&(e=0);var t=Nl(r,e),n=Nl(r,e+4);return n*4294967296+t-(t>>31)*4294967296}Me.readInt64LE=ky;function qy(r,e){e===void 0&&(e=0);var t=Ll(r,e),n=Ll(r,e+4);return n*4294967296+t}Me.readUint64LE=qy;function Vd(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Da(r/4294967296>>>0,e,t),Da(r>>>0,e,t+4),e}Me.writeUint64BE=Vd,Me.writeInt64BE=Vd;function Gd(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Sa(r>>>0,e,t),Sa(r/4294967296>>>0,e,t+4),e}Me.writeUint64LE=Gd,Me.writeInt64LE=Gd;function zy(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=r/8+t-1;a>=t;a--)n+=e[a]*i,i*=256;return n}Me.readUintBE=zy;function Hy(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=t;a<t+r/8;a++)n+=e[a]*i,i*=256;return n}Me.readUintLE=Hy;function Wy(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Hd.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=r/8+n-1;a>=n;a--)t[a]=e/i&255,i*=256;return t}Me.writeUintBE=Wy;function Ky(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Hd.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+r/8;a++)t[a]=e/i&255,i*=256;return t}Me.writeUintLE=Ky;function Vy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}Me.readFloat32BE=Vy;function Gy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}Me.readFloat32LE=Gy;function Yy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}Me.readFloat64BE=Yy;function Jy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}Me.readFloat64LE=Jy;function Zy(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}Me.writeFloat32BE=Zy;function Qy(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}Me.writeFloat32LE=Qy;function Xy(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}Me.writeFloat64BE=Xy;function ew(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}Me.writeFloat64LE=ew;var zr={};Object.defineProperty(zr,"__esModule",{value:!0});function tw(r){for(var e=0;e<r.length;e++)r[e]=0;return r}zr.wipe=tw,Object.defineProperty(Ia,"__esModule",{value:!0});var dr=Me,Ml=zr,rw=20;function nw(r,e,t){for(var n=1634760805,i=857760878,a=2036477234,c=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],f=t[7]<<24|t[6]<<16|t[5]<<8|t[4],h=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=t[15]<<24|t[14]<<16|t[13]<<8|t[12],w=t[19]<<24|t[18]<<16|t[17]<<8|t[16],y=t[23]<<24|t[22]<<16|t[21]<<8|t[20],x=t[27]<<24|t[26]<<16|t[25]<<8|t[24],S=t[31]<<24|t[30]<<16|t[29]<<8|t[28],P=e[3]<<24|e[2]<<16|e[1]<<8|e[0],U=e[7]<<24|e[6]<<16|e[5]<<8|e[4],j=e[11]<<24|e[10]<<16|e[9]<<8|e[8],A=e[15]<<24|e[14]<<16|e[13]<<8|e[12],T=n,C=i,$=a,E=c,d=u,b=f,H=h,F=m,V=w,se=y,ce=x,I=S,N=P,X=U,ee=j,Y=A,J=0;J<rw;J+=2)T=T+d|0,N^=T,N=N>>>32-16|N<<16,V=V+N|0,d^=V,d=d>>>32-12|d<<12,C=C+b|0,X^=C,X=X>>>32-16|X<<16,se=se+X|0,b^=se,b=b>>>32-12|b<<12,$=$+H|0,ee^=$,ee=ee>>>32-16|ee<<16,ce=ce+ee|0,H^=ce,H=H>>>32-12|H<<12,E=E+F|0,Y^=E,Y=Y>>>32-16|Y<<16,I=I+Y|0,F^=I,F=F>>>32-12|F<<12,$=$+H|0,ee^=$,ee=ee>>>32-8|ee<<8,ce=ce+ee|0,H^=ce,H=H>>>32-7|H<<7,E=E+F|0,Y^=E,Y=Y>>>32-8|Y<<8,I=I+Y|0,F^=I,F=F>>>32-7|F<<7,C=C+b|0,X^=C,X=X>>>32-8|X<<8,se=se+X|0,b^=se,b=b>>>32-7|b<<7,T=T+d|0,N^=T,N=N>>>32-8|N<<8,V=V+N|0,d^=V,d=d>>>32-7|d<<7,T=T+b|0,Y^=T,Y=Y>>>32-16|Y<<16,ce=ce+Y|0,b^=ce,b=b>>>32-12|b<<12,C=C+H|0,N^=C,N=N>>>32-16|N<<16,I=I+N|0,H^=I,H=H>>>32-12|H<<12,$=$+F|0,X^=$,X=X>>>32-16|X<<16,V=V+X|0,F^=V,F=F>>>32-12|F<<12,E=E+d|0,ee^=E,ee=ee>>>32-16|ee<<16,se=se+ee|0,d^=se,d=d>>>32-12|d<<12,$=$+F|0,X^=$,X=X>>>32-8|X<<8,V=V+X|0,F^=V,F=F>>>32-7|F<<7,E=E+d|0,ee^=E,ee=ee>>>32-8|ee<<8,se=se+ee|0,d^=se,d=d>>>32-7|d<<7,C=C+H|0,N^=C,N=N>>>32-8|N<<8,I=I+N|0,H^=I,H=H>>>32-7|H<<7,T=T+b|0,Y^=T,Y=Y>>>32-8|Y<<8,ce=ce+Y|0,b^=ce,b=b>>>32-7|b<<7;dr.writeUint32LE(T+n|0,r,0),dr.writeUint32LE(C+i|0,r,4),dr.writeUint32LE($+a|0,r,8),dr.writeUint32LE(E+c|0,r,12),dr.writeUint32LE(d+u|0,r,16),dr.writeUint32LE(b+f|0,r,20),dr.writeUint32LE(H+h|0,r,24),dr.writeUint32LE(F+m|0,r,28),dr.writeUint32LE(V+w|0,r,32),dr.writeUint32LE(se+y|0,r,36),dr.writeUint32LE(ce+x|0,r,40),dr.writeUint32LE(I+S|0,r,44),dr.writeUint32LE(N+P|0,r,48),dr.writeUint32LE(X+U|0,r,52),dr.writeUint32LE(ee+j|0,r,56),dr.writeUint32LE(Y+A|0,r,60)}function Yd(r,e,t,n,i){if(i===void 0&&(i=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<t.length)throw new Error("ChaCha: destination is shorter than source");var a,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),c=a.length-e.length,a.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,c=i}for(var u=new Uint8Array(64),f=0;f<t.length;f+=64){nw(u,a,r);for(var h=f;h<f+64&&h<t.length;h++)n[h]=t[h]^u[h-f];sw(a,0,c)}return Ml.wipe(u),i===0&&Ml.wipe(a),n}Ia.streamXOR=Yd;function iw(r,e,t,n){return n===void 0&&(n=0),Ml.wipe(t),Yd(r,e,t,t,n)}Ia.stream=iw;function sw(r,e,t){for(var n=1;t--;)n=n+(r[e]&255)|0,r[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Jd={},ni={};Object.defineProperty(ni,"__esModule",{value:!0});function ow(r,e,t){return~(r-1)&e|r-1&t}ni.select=ow;function aw(r,e){return(r|0)-(e|0)-1>>>31&1}ni.lessOrEqual=aw;function Zd(r,e){if(r.length!==e.length)return 0;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return 1&t-1>>>8}ni.compare=Zd;function cw(r,e){return r.length===0||e.length===0?!1:Zd(r,e)!==0}ni.equal=cw,function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ni,t=zr;r.DIGEST_LENGTH=16;var n=function(){function c(u){this.digestLength=r.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 f=u[0]|u[1]<<8;this._r[0]=f&8191;var h=u[2]|u[3]<<8;this._r[1]=(f>>>13|h<<3)&8191;var m=u[4]|u[5]<<8;this._r[2]=(h>>>10|m<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(m>>>7|w<<9)&8191;var y=u[8]|u[9]<<8;this._r[4]=(w>>>4|y<<12)&255,this._r[5]=y>>>1&8190;var x=u[10]|u[11]<<8;this._r[6]=(y>>>14|x<<2)&8191;var S=u[12]|u[13]<<8;this._r[7]=(x>>>11|S<<5)&8065;var P=u[14]|u[15]<<8;this._r[8]=(S>>>8|P<<8)&8191,this._r[9]=P>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return c.prototype._blocks=function(u,f,h){for(var m=this._fin?0:2048,w=this._h[0],y=this._h[1],x=this._h[2],S=this._h[3],P=this._h[4],U=this._h[5],j=this._h[6],A=this._h[7],T=this._h[8],C=this._h[9],$=this._r[0],E=this._r[1],d=this._r[2],b=this._r[3],H=this._r[4],F=this._r[5],V=this._r[6],se=this._r[7],ce=this._r[8],I=this._r[9];h>=16;){var N=u[f+0]|u[f+1]<<8;w+=N&8191;var X=u[f+2]|u[f+3]<<8;y+=(N>>>13|X<<3)&8191;var ee=u[f+4]|u[f+5]<<8;x+=(X>>>10|ee<<6)&8191;var Y=u[f+6]|u[f+7]<<8;S+=(ee>>>7|Y<<9)&8191;var J=u[f+8]|u[f+9]<<8;P+=(Y>>>4|J<<12)&8191,U+=J>>>1&8191;var Q=u[f+10]|u[f+11]<<8;j+=(J>>>14|Q<<2)&8191;var ie=u[f+12]|u[f+13]<<8;A+=(Q>>>11|ie<<5)&8191;var Ee=u[f+14]|u[f+15]<<8;T+=(ie>>>8|Ee<<8)&8191,C+=Ee>>>5|m;var ae=0,xe=ae;xe+=w*$,xe+=y*(5*I),xe+=x*(5*ce),xe+=S*(5*se),xe+=P*(5*V),ae=xe>>>13,xe&=8191,xe+=U*(5*F),xe+=j*(5*H),xe+=A*(5*b),xe+=T*(5*d),xe+=C*(5*E),ae+=xe>>>13,xe&=8191;var de=ae;de+=w*E,de+=y*$,de+=x*(5*I),de+=S*(5*ce),de+=P*(5*se),ae=de>>>13,de&=8191,de+=U*(5*V),de+=j*(5*F),de+=A*(5*H),de+=T*(5*b),de+=C*(5*d),ae+=de>>>13,de&=8191;var be=ae;be+=w*d,be+=y*E,be+=x*$,be+=S*(5*I),be+=P*(5*ce),ae=be>>>13,be&=8191,be+=U*(5*se),be+=j*(5*V),be+=A*(5*F),be+=T*(5*H),be+=C*(5*b),ae+=be>>>13,be&=8191;var K=ae;K+=w*b,K+=y*d,K+=x*E,K+=S*$,K+=P*(5*I),ae=K>>>13,K&=8191,K+=U*(5*ce),K+=j*(5*se),K+=A*(5*V),K+=T*(5*F),K+=C*(5*H),ae+=K>>>13,K&=8191;var W=ae;W+=w*H,W+=y*b,W+=x*d,W+=S*E,W+=P*$,ae=W>>>13,W&=8191,W+=U*(5*I),W+=j*(5*ce),W+=A*(5*se),W+=T*(5*V),W+=C*(5*F),ae+=W>>>13,W&=8191;var B=ae;B+=w*F,B+=y*H,B+=x*b,B+=S*d,B+=P*E,ae=B>>>13,B&=8191,B+=U*$,B+=j*(5*I),B+=A*(5*ce),B+=T*(5*se),B+=C*(5*V),ae+=B>>>13,B&=8191;var g=ae;g+=w*V,g+=y*F,g+=x*H,g+=S*b,g+=P*d,ae=g>>>13,g&=8191,g+=U*E,g+=j*$,g+=A*(5*I),g+=T*(5*ce),g+=C*(5*se),ae+=g>>>13,g&=8191;var L=ae;L+=w*se,L+=y*V,L+=x*F,L+=S*H,L+=P*b,ae=L>>>13,L&=8191,L+=U*d,L+=j*E,L+=A*$,L+=T*(5*I),L+=C*(5*ce),ae+=L>>>13,L&=8191;var le=ae;le+=w*ce,le+=y*se,le+=x*V,le+=S*F,le+=P*H,ae=le>>>13,le&=8191,le+=U*b,le+=j*d,le+=A*E,le+=T*$,le+=C*(5*I),ae+=le>>>13,le&=8191;var pe=ae;pe+=w*I,pe+=y*ce,pe+=x*se,pe+=S*V,pe+=P*F,ae=pe>>>13,pe&=8191,pe+=U*H,pe+=j*b,pe+=A*d,pe+=T*E,pe+=C*$,ae+=pe>>>13,pe&=8191,ae=(ae<<2)+ae|0,ae=ae+xe|0,xe=ae&8191,ae=ae>>>13,de+=ae,w=xe,y=de,x=be,S=K,P=W,U=B,j=g,A=L,T=le,C=pe,f+=16,h-=16}this._h[0]=w,this._h[1]=y,this._h[2]=x,this._h[3]=S,this._h[4]=P,this._h[5]=U,this._h[6]=j,this._h[7]=A,this._h[8]=T,this._h[9]=C},c.prototype.finish=function(u,f){f===void 0&&(f=0);var h=new Uint16Array(10),m,w,y,x;if(this._leftover){for(x=this._leftover,this._buffer[x++]=1;x<16;x++)this._buffer[x]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(m=this._h[1]>>>13,this._h[1]&=8191,x=2;x<10;x++)this._h[x]+=m,m=this._h[x]>>>13,this._h[x]&=8191;for(this._h[0]+=m*5,m=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=m,m=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=m,h[0]=this._h[0]+5,m=h[0]>>>13,h[0]&=8191,x=1;x<10;x++)h[x]=this._h[x]+m,m=h[x]>>>13,h[x]&=8191;for(h[9]-=8192,w=(m^1)-1,x=0;x<10;x++)h[x]&=w;for(w=~w,x=0;x<10;x++)this._h[x]=this._h[x]&w|h[x];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,y=this._h[0]+this._pad[0],this._h[0]=y&65535,x=1;x<8;x++)y=(this._h[x]+this._pad[x]|0)+(y>>>16)|0,this._h[x]=y&65535;return u[f+0]=this._h[0]>>>0,u[f+1]=this._h[0]>>>8,u[f+2]=this._h[1]>>>0,u[f+3]=this._h[1]>>>8,u[f+4]=this._h[2]>>>0,u[f+5]=this._h[2]>>>8,u[f+6]=this._h[3]>>>0,u[f+7]=this._h[3]>>>8,u[f+8]=this._h[4]>>>0,u[f+9]=this._h[4]>>>8,u[f+10]=this._h[5]>>>0,u[f+11]=this._h[5]>>>8,u[f+12]=this._h[6]>>>0,u[f+13]=this._h[6]>>>8,u[f+14]=this._h[7]>>>0,u[f+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(u){var f=0,h=u.length,m;if(this._leftover){m=16-this._leftover,m>h&&(m=h);for(var w=0;w<m;w++)this._buffer[this._leftover+w]=u[f+w];if(h-=m,f+=m,this._leftover+=m,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(h>=16&&(m=h-h%16,this._blocks(u,f,m),f+=m,h-=m),h){for(var w=0;w<h;w++)this._buffer[this._leftover+w]=u[f+w];this._leftover+=h}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},c.prototype.clean=function(){return t.wipe(this._buffer),t.wipe(this._r),t.wipe(this._h),t.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},c}();r.Poly1305=n;function i(c,u){var f=new n(c);f.update(u);var h=f.digest();return f.clean(),h}r.oneTimeAuth=i;function a(c,u){return c.length!==r.DIGEST_LENGTH||u.length!==r.DIGEST_LENGTH?!1:e.equal(c,u)}r.equal=a}(Jd),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Ia,t=Jd,n=zr,i=Me,a=ni;r.KEY_LENGTH=32,r.NONCE_LENGTH=12,r.TAG_LENGTH=16;var c=new Uint8Array(16),u=function(){function f(h){if(this.nonceLength=r.NONCE_LENGTH,this.tagLength=r.TAG_LENGTH,h.length!==r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(h)}return f.prototype.seal=function(h,m,w,y){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var x=new Uint8Array(16);x.set(h,x.length-h.length);var S=new Uint8Array(32);e.stream(this._key,x,S,4);var P=m.length+this.tagLength,U;if(y){if(y.length!==P)throw new Error("ChaCha20Poly1305: incorrect destination length");U=y}else U=new Uint8Array(P);return e.streamXOR(this._key,x,m,U,4),this._authenticate(U.subarray(U.length-this.tagLength,U.length),S,U.subarray(0,U.length-this.tagLength),w),n.wipe(x),U},f.prototype.open=function(h,m,w,y){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(m.length<this.tagLength)return null;var x=new Uint8Array(16);x.set(h,x.length-h.length);var S=new Uint8Array(32);e.stream(this._key,x,S,4);var P=new Uint8Array(this.tagLength);if(this._authenticate(P,S,m.subarray(0,m.length-this.tagLength),w),!a.equal(P,m.subarray(m.length-this.tagLength,m.length)))return null;var U=m.length-this.tagLength,j;if(y){if(y.length!==U)throw new Error("ChaCha20Poly1305: incorrect destination length");j=y}else j=new Uint8Array(U);return e.streamXOR(this._key,x,m.subarray(0,m.length-this.tagLength),j,4),n.wipe(x),j},f.prototype.clean=function(){return n.wipe(this._key),this},f.prototype._authenticate=function(h,m,w,y){var x=new t.Poly1305(m);y&&(x.update(y),y.length%16>0&&x.update(c.subarray(y.length%16))),x.update(w),w.length%16>0&&x.update(c.subarray(w.length%16));var S=new Uint8Array(8);y&&i.writeUint64LE(y.length,S),x.update(S),i.writeUint64LE(w.length,S),x.update(S);for(var P=x.digest(),U=0;U<P.length;U++)h[U]=P[U];x.clean(),n.wipe(P),n.wipe(S)},f}();r.ChaCha20Poly1305=u}(Pl);var Qd={},fo={},Ul={};Object.defineProperty(Ul,"__esModule",{value:!0});function lw(r){return typeof r.saveState<"u"&&typeof r.restoreState<"u"&&typeof r.cleanSavedState<"u"}Ul.isSerializableHash=lw,Object.defineProperty(fo,"__esModule",{value:!0});var _n=Ul,uw=ni,hw=zr,Xd=function(){function r(e,t){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);t.length>this.blockSize?this._inner.update(t).finish(n).clean():n.set(t);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()),hw.wipe(n)}return r.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},r.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()},r.prototype.update=function(e){return this._inner.update(e),this},r.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)},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.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()},r.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},r.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)},r}();fo.HMAC=Xd;function fw(r,e,t){var n=new Xd(r,e);n.update(t);var i=n.digest();return n.clean(),i}fo.hmac=fw,fo.equal=uw.equal,Object.defineProperty(Qd,"__esModule",{value:!0});var e0=fo,t0=zr,dw=function(){function r(e,t,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=e0.hmac(this._hash,n,t);this._hmac=new e0.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return r.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},r.prototype.expand=function(e){for(var t=new Uint8Array(e),n=0;n<t.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[n]=this._buffer[this._bufpos++];return t},r.prototype.clean=function(){this._hmac.clean(),t0.wipe(this._buffer),t0.wipe(this._counter),this._bufpos=0},r}(),pw=Qd.HKDF=dw,vs={},Ca={},Oa={};Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.BrowserRandomSource=void 0;const r0=65536;class gw{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 t=new Uint8Array(e);for(let n=0;n<t.length;n+=r0)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,r0)));return t}}Oa.BrowserRandomSource=gw;function mw(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $a={},vw={},yw=Object.freeze({__proto__:null,default:vw}),ww=Pi(yw);Object.defineProperty($a,"__esModule",{value:!0}),$a.NodeRandomSource=void 0;const bw=zr;class _w{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof mw<"u"){const e=ww;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 t=this._crypto.randomBytes(e);if(t.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]=t[i];return(0,bw.wipe)(t),n}}$a.NodeRandomSource=_w,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.SystemRandomSource=void 0;const Ew=Oa,xw=$a;class Iw{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Ew.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new xw.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)}}Ca.SystemRandomSource=Iw,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.randomStringForEntropy=r.randomString=r.randomUint32=r.randomBytes=r.defaultRandomSource=void 0;const e=Ca,t=Me,n=zr;r.defaultRandomSource=new e.SystemRandomSource;function i(h,m=r.defaultRandomSource){return m.randomBytes(h)}r.randomBytes=i;function a(h=r.defaultRandomSource){const m=i(4,h),w=(0,t.readUint32LE)(m);return(0,n.wipe)(m),w}r.randomUint32=a;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(h,m=c,w=r.defaultRandomSource){if(m.length<2)throw new Error("randomString charset is too short");if(m.length>256)throw new Error("randomString charset is too long");let y="";const x=m.length,S=256-256%x;for(;h>0;){const P=i(Math.ceil(h*256/S),w);for(let U=0;U<P.length&&h>0;U++){const j=P[U];j<S&&(y+=m.charAt(j%x),h--)}(0,n.wipe)(P)}return y}r.randomString=u;function f(h,m=c,w=r.defaultRandomSource){const y=Math.ceil(h/(Math.log(m.length)/Math.LN2));return u(y,m,w)}r.randomStringForEntropy=f}(vs);var Aa={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Me,t=zr;r.DIGEST_LENGTH=32,r.BLOCK_SIZE=64;var n=function(){function u(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},u.prototype.update=function(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var m=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&h>0;)this._buffer[this._bufferLength++]=f[m++],h--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(m=a(this._temp,this._state,f,m,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[m++],h--;return this},u.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,m=this._bufferLength,w=h/536870912|0,y=h<<3,x=h%64<56?64:128;this._buffer[m]=128;for(var S=m+1;S<x-8;S++)this._buffer[S]=0;e.writeUint32BE(w,this._buffer,x-8),e.writeUint32BE(y,this._buffer,x-4),a(this._temp,this._state,this._buffer,0,x),this._finished=!0}for(var S=0;S<this.digestLength/4;S++)e.writeUint32BE(this._state[S],f,S*4);return this},u.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},u.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}},u.prototype.restoreState=function(f){return this._state.set(f.state),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(f){t.wipe(f.state),f.buffer&&t.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},u}();r.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 a(u,f,h,m,w){for(;w>=64;){for(var y=f[0],x=f[1],S=f[2],P=f[3],U=f[4],j=f[5],A=f[6],T=f[7],C=0;C<16;C++){var $=m+C*4;u[C]=e.readUint32BE(h,$)}for(var C=16;C<64;C++){var E=u[C-2],d=(E>>>17|E<<32-17)^(E>>>19|E<<32-19)^E>>>10;E=u[C-15];var b=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;u[C]=(d+u[C-7]|0)+(b+u[C-16]|0)}for(var C=0;C<64;C++){var d=(((U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7))+(U&j^~U&A)|0)+(T+(i[C]+u[C]|0)|0)|0,b=((y>>>2|y<<32-2)^(y>>>13|y<<32-13)^(y>>>22|y<<32-22))+(y&x^y&S^x&S)|0;T=A,A=j,j=U,U=P+d|0,P=S,S=x,x=y,y=d+b|0}f[0]+=y,f[1]+=x,f[2]+=S,f[3]+=P,f[4]+=U,f[5]+=j,f[6]+=A,f[7]+=T,m+=64,w-=64}return m}function c(u){var f=new n;f.update(u);var h=f.digest();return f.clean(),h}r.hash=c})(Aa);var jl={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=vs,t=zr;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function n(C){const $=new Float64Array(16);if(C)for(let E=0;E<C.length;E++)$[E]=C[E];return $}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function c(C){let $=1;for(let E=0;E<16;E++){let d=C[E]+$+65535;$=Math.floor(d/65536),C[E]=d-$*65536}C[0]+=$-1+37*($-1)}function u(C,$,E){const d=~(E-1);for(let b=0;b<16;b++){const H=d&(C[b]^$[b]);C[b]^=H,$[b]^=H}}function f(C,$){const E=n(),d=n();for(let b=0;b<16;b++)d[b]=$[b];c(d),c(d),c(d);for(let b=0;b<2;b++){E[0]=d[0]-65517;for(let F=1;F<15;F++)E[F]=d[F]-65535-(E[F-1]>>16&1),E[F-1]&=65535;E[15]=d[15]-32767-(E[14]>>16&1);const H=E[15]>>16&1;E[14]&=65535,u(d,E,1-H)}for(let b=0;b<16;b++)C[2*b]=d[b]&255,C[2*b+1]=d[b]>>8}function h(C,$){for(let E=0;E<16;E++)C[E]=$[2*E]+($[2*E+1]<<8);C[15]&=32767}function m(C,$,E){for(let d=0;d<16;d++)C[d]=$[d]+E[d]}function w(C,$,E){for(let d=0;d<16;d++)C[d]=$[d]-E[d]}function y(C,$,E){let d,b,H=0,F=0,V=0,se=0,ce=0,I=0,N=0,X=0,ee=0,Y=0,J=0,Q=0,ie=0,Ee=0,ae=0,xe=0,de=0,be=0,K=0,W=0,B=0,g=0,L=0,le=0,pe=0,Ce=0,Ke=0,Je=0,ke=0,St=0,Ct=0,ze=E[0],Oe=E[1],Ue=E[2],je=E[3],He=E[4],Ae=E[5],Fe=E[6],Se=E[7],Te=E[8],Ve=E[9],$e=E[10],Ze=E[11],et=E[12],at=E[13],ct=E[14],nt=E[15];d=$[0],H+=d*ze,F+=d*Oe,V+=d*Ue,se+=d*je,ce+=d*He,I+=d*Ae,N+=d*Fe,X+=d*Se,ee+=d*Te,Y+=d*Ve,J+=d*$e,Q+=d*Ze,ie+=d*et,Ee+=d*at,ae+=d*ct,xe+=d*nt,d=$[1],F+=d*ze,V+=d*Oe,se+=d*Ue,ce+=d*je,I+=d*He,N+=d*Ae,X+=d*Fe,ee+=d*Se,Y+=d*Te,J+=d*Ve,Q+=d*$e,ie+=d*Ze,Ee+=d*et,ae+=d*at,xe+=d*ct,de+=d*nt,d=$[2],V+=d*ze,se+=d*Oe,ce+=d*Ue,I+=d*je,N+=d*He,X+=d*Ae,ee+=d*Fe,Y+=d*Se,J+=d*Te,Q+=d*Ve,ie+=d*$e,Ee+=d*Ze,ae+=d*et,xe+=d*at,de+=d*ct,be+=d*nt,d=$[3],se+=d*ze,ce+=d*Oe,I+=d*Ue,N+=d*je,X+=d*He,ee+=d*Ae,Y+=d*Fe,J+=d*Se,Q+=d*Te,ie+=d*Ve,Ee+=d*$e,ae+=d*Ze,xe+=d*et,de+=d*at,be+=d*ct,K+=d*nt,d=$[4],ce+=d*ze,I+=d*Oe,N+=d*Ue,X+=d*je,ee+=d*He,Y+=d*Ae,J+=d*Fe,Q+=d*Se,ie+=d*Te,Ee+=d*Ve,ae+=d*$e,xe+=d*Ze,de+=d*et,be+=d*at,K+=d*ct,W+=d*nt,d=$[5],I+=d*ze,N+=d*Oe,X+=d*Ue,ee+=d*je,Y+=d*He,J+=d*Ae,Q+=d*Fe,ie+=d*Se,Ee+=d*Te,ae+=d*Ve,xe+=d*$e,de+=d*Ze,be+=d*et,K+=d*at,W+=d*ct,B+=d*nt,d=$[6],N+=d*ze,X+=d*Oe,ee+=d*Ue,Y+=d*je,J+=d*He,Q+=d*Ae,ie+=d*Fe,Ee+=d*Se,ae+=d*Te,xe+=d*Ve,de+=d*$e,be+=d*Ze,K+=d*et,W+=d*at,B+=d*ct,g+=d*nt,d=$[7],X+=d*ze,ee+=d*Oe,Y+=d*Ue,J+=d*je,Q+=d*He,ie+=d*Ae,Ee+=d*Fe,ae+=d*Se,xe+=d*Te,de+=d*Ve,be+=d*$e,K+=d*Ze,W+=d*et,B+=d*at,g+=d*ct,L+=d*nt,d=$[8],ee+=d*ze,Y+=d*Oe,J+=d*Ue,Q+=d*je,ie+=d*He,Ee+=d*Ae,ae+=d*Fe,xe+=d*Se,de+=d*Te,be+=d*Ve,K+=d*$e,W+=d*Ze,B+=d*et,g+=d*at,L+=d*ct,le+=d*nt,d=$[9],Y+=d*ze,J+=d*Oe,Q+=d*Ue,ie+=d*je,Ee+=d*He,ae+=d*Ae,xe+=d*Fe,de+=d*Se,be+=d*Te,K+=d*Ve,W+=d*$e,B+=d*Ze,g+=d*et,L+=d*at,le+=d*ct,pe+=d*nt,d=$[10],J+=d*ze,Q+=d*Oe,ie+=d*Ue,Ee+=d*je,ae+=d*He,xe+=d*Ae,de+=d*Fe,be+=d*Se,K+=d*Te,W+=d*Ve,B+=d*$e,g+=d*Ze,L+=d*et,le+=d*at,pe+=d*ct,Ce+=d*nt,d=$[11],Q+=d*ze,ie+=d*Oe,Ee+=d*Ue,ae+=d*je,xe+=d*He,de+=d*Ae,be+=d*Fe,K+=d*Se,W+=d*Te,B+=d*Ve,g+=d*$e,L+=d*Ze,le+=d*et,pe+=d*at,Ce+=d*ct,Ke+=d*nt,d=$[12],ie+=d*ze,Ee+=d*Oe,ae+=d*Ue,xe+=d*je,de+=d*He,be+=d*Ae,K+=d*Fe,W+=d*Se,B+=d*Te,g+=d*Ve,L+=d*$e,le+=d*Ze,pe+=d*et,Ce+=d*at,Ke+=d*ct,Je+=d*nt,d=$[13],Ee+=d*ze,ae+=d*Oe,xe+=d*Ue,de+=d*je,be+=d*He,K+=d*Ae,W+=d*Fe,B+=d*Se,g+=d*Te,L+=d*Ve,le+=d*$e,pe+=d*Ze,Ce+=d*et,Ke+=d*at,Je+=d*ct,ke+=d*nt,d=$[14],ae+=d*ze,xe+=d*Oe,de+=d*Ue,be+=d*je,K+=d*He,W+=d*Ae,B+=d*Fe,g+=d*Se,L+=d*Te,le+=d*Ve,pe+=d*$e,Ce+=d*Ze,Ke+=d*et,Je+=d*at,ke+=d*ct,St+=d*nt,d=$[15],xe+=d*ze,de+=d*Oe,be+=d*Ue,K+=d*je,W+=d*He,B+=d*Ae,g+=d*Fe,L+=d*Se,le+=d*Te,pe+=d*Ve,Ce+=d*$e,Ke+=d*Ze,Je+=d*et,ke+=d*at,St+=d*ct,Ct+=d*nt,H+=38*de,F+=38*be,V+=38*K,se+=38*W,ce+=38*B,I+=38*g,N+=38*L,X+=38*le,ee+=38*pe,Y+=38*Ce,J+=38*Ke,Q+=38*Je,ie+=38*ke,Ee+=38*St,ae+=38*Ct,b=1,d=H+b+65535,b=Math.floor(d/65536),H=d-b*65536,d=F+b+65535,b=Math.floor(d/65536),F=d-b*65536,d=V+b+65535,b=Math.floor(d/65536),V=d-b*65536,d=se+b+65535,b=Math.floor(d/65536),se=d-b*65536,d=ce+b+65535,b=Math.floor(d/65536),ce=d-b*65536,d=I+b+65535,b=Math.floor(d/65536),I=d-b*65536,d=N+b+65535,b=Math.floor(d/65536),N=d-b*65536,d=X+b+65535,b=Math.floor(d/65536),X=d-b*65536,d=ee+b+65535,b=Math.floor(d/65536),ee=d-b*65536,d=Y+b+65535,b=Math.floor(d/65536),Y=d-b*65536,d=J+b+65535,b=Math.floor(d/65536),J=d-b*65536,d=Q+b+65535,b=Math.floor(d/65536),Q=d-b*65536,d=ie+b+65535,b=Math.floor(d/65536),ie=d-b*65536,d=Ee+b+65535,b=Math.floor(d/65536),Ee=d-b*65536,d=ae+b+65535,b=Math.floor(d/65536),ae=d-b*65536,d=xe+b+65535,b=Math.floor(d/65536),xe=d-b*65536,H+=b-1+37*(b-1),b=1,d=H+b+65535,b=Math.floor(d/65536),H=d-b*65536,d=F+b+65535,b=Math.floor(d/65536),F=d-b*65536,d=V+b+65535,b=Math.floor(d/65536),V=d-b*65536,d=se+b+65535,b=Math.floor(d/65536),se=d-b*65536,d=ce+b+65535,b=Math.floor(d/65536),ce=d-b*65536,d=I+b+65535,b=Math.floor(d/65536),I=d-b*65536,d=N+b+65535,b=Math.floor(d/65536),N=d-b*65536,d=X+b+65535,b=Math.floor(d/65536),X=d-b*65536,d=ee+b+65535,b=Math.floor(d/65536),ee=d-b*65536,d=Y+b+65535,b=Math.floor(d/65536),Y=d-b*65536,d=J+b+65535,b=Math.floor(d/65536),J=d-b*65536,d=Q+b+65535,b=Math.floor(d/65536),Q=d-b*65536,d=ie+b+65535,b=Math.floor(d/65536),ie=d-b*65536,d=Ee+b+65535,b=Math.floor(d/65536),Ee=d-b*65536,d=ae+b+65535,b=Math.floor(d/65536),ae=d-b*65536,d=xe+b+65535,b=Math.floor(d/65536),xe=d-b*65536,H+=b-1+37*(b-1),C[0]=H,C[1]=F,C[2]=V,C[3]=se,C[4]=ce,C[5]=I,C[6]=N,C[7]=X,C[8]=ee,C[9]=Y,C[10]=J,C[11]=Q,C[12]=ie,C[13]=Ee,C[14]=ae,C[15]=xe}function x(C,$){y(C,$,$)}function S(C,$){const E=n();for(let d=0;d<16;d++)E[d]=$[d];for(let d=253;d>=0;d--)x(E,E),d!==2&&d!==4&&y(E,E,$);for(let d=0;d<16;d++)C[d]=E[d]}function P(C,$){const E=new Uint8Array(32),d=new Float64Array(80),b=n(),H=n(),F=n(),V=n(),se=n(),ce=n();for(let ee=0;ee<31;ee++)E[ee]=C[ee];E[31]=C[31]&127|64,E[0]&=248,h(d,$);for(let ee=0;ee<16;ee++)H[ee]=d[ee];b[0]=V[0]=1;for(let ee=254;ee>=0;--ee){const Y=E[ee>>>3]>>>(ee&7)&1;u(b,H,Y),u(F,V,Y),m(se,b,F),w(b,b,F),m(F,H,V),w(H,H,V),x(V,se),x(ce,b),y(b,F,b),y(F,H,se),m(se,b,F),w(b,b,F),x(H,b),w(F,V,ce),y(b,F,a),m(b,b,V),y(F,F,b),y(b,V,ce),y(V,H,d),x(H,se),u(b,H,Y),u(F,V,Y)}for(let ee=0;ee<16;ee++)d[ee+16]=b[ee],d[ee+32]=F[ee],d[ee+48]=H[ee],d[ee+64]=V[ee];const I=d.subarray(32),N=d.subarray(16);S(I,I),y(N,N,I);const X=new Uint8Array(32);return f(X,N),X}r.scalarMult=P;function U(C){return P(C,i)}r.scalarMultBase=U;function j(C){if(C.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const $=new Uint8Array(C);return{publicKey:U($),secretKey:$}}r.generateKeyPairFromSeed=j;function A(C){const $=(0,e.randomBytes)(32,C),E=j($);return(0,t.wipe)($),E}r.generateKeyPair=A;function T(C,$,E=!1){if(C.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if($.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const d=P(C,$);if(E){let b=0;for(let H=0;H<d.length;H++)b|=d[H];if(b===0)throw new Error("X25519: invalid shared key")}return d}r.sharedKey=T})(jl);function Fl(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function n0(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Fl(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Bl(r,e){e||(e=r.reduce((i,a)=>i+a.length,0));const t=n0(e);let n=0;for(const i of r)t.set(i,n),n+=i.length;return Fl(t)}function Dw(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var a=r.charAt(i),c=a.charCodeAt(0);if(t[c]!==255)throw new TypeError(a+" is ambiguous");t[c]=i}var u=r.length,f=r.charAt(0),h=Math.log(u)/Math.log(256),m=Math.log(256)/Math.log(u);function w(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var P=0,U=0,j=0,A=S.length;j!==A&&S[j]===0;)j++,P++;for(var T=(A-j)*m+1>>>0,C=new Uint8Array(T);j!==A;){for(var $=S[j],E=0,d=T-1;($!==0||E<U)&&d!==-1;d--,E++)$+=256*C[d]>>>0,C[d]=$%u>>>0,$=$/u>>>0;if($!==0)throw new Error("Non-zero carry");U=E,j++}for(var b=T-U;b!==T&&C[b]===0;)b++;for(var H=f.repeat(P);b<T;++b)H+=r.charAt(C[b]);return H}function y(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var P=0;if(S[P]!==" "){for(var U=0,j=0;S[P]===f;)U++,P++;for(var A=(S.length-P)*h+1>>>0,T=new Uint8Array(A);S[P];){var C=t[S.charCodeAt(P)];if(C===255)return;for(var $=0,E=A-1;(C!==0||$<j)&&E!==-1;E--,$++)C+=u*T[E]>>>0,T[E]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");j=$,P++}if(S[P]!==" "){for(var d=A-j;d!==A&&T[d]===0;)d++;for(var b=new Uint8Array(U+(A-d)),H=U;d!==A;)b[H++]=T[d++];return b}}}function x(S){var P=y(S);if(P)return P;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:y,decode:x}}var Sw=Dw,Cw=Sw;const i0=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},Ow=r=>new TextEncoder().encode(r),$w=r=>new TextDecoder().decode(r);class Aw{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Pw{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.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 s0(this,e)}}class Tw{constructor(e){this.decoders=e}or(e){return s0(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 s0=(r,e)=>new Tw({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class Rw{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Aw(e,t,n),this.decoder=new Pw(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Pa=({name:r,prefix:e,encode:t,decode:n})=>new Rw(r,e,t,n),po=({prefix:r,name:e,alphabet:t})=>{const{encode:n,decode:i}=Cw(t,e);return Pa({prefix:r,name:e,encode:n,decode:a=>i0(i(a))})},Nw=(r,e,t,n)=>{const i={};for(let m=0;m<e.length;++m)i[e[m]]=m;let a=r.length;for(;r[a-1]==="=";)--a;const c=new Uint8Array(a*t/8|0);let u=0,f=0,h=0;for(let m=0;m<a;++m){const w=i[r[m]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<t|w,u+=t,u>=8&&(u-=8,c[h++]=255&f>>u)}if(u>=t||255&f<<8-u)throw new SyntaxError("Unexpected end of data");return c},Lw=(r,e,t)=>{const n=e[e.length-1]==="=",i=(1<<t)-1;let a="",c=0,u=0;for(let f=0;f<r.length;++f)for(u=u<<8|r[f],c+=8;c>t;)c-=t,a+=e[i&u>>c];if(c&&(a+=e[i&u<<t-c]),n)for(;a.length*t&7;)a+="=";return a},ur=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Pa({prefix:e,name:r,encode(i){return Lw(i,n,t)},decode(i){return Nw(i,n,t,r)}}),Mw=Pa({prefix:"\0",name:"identity",encode:r=>$w(r),decode:r=>Ow(r)});var Uw=Object.freeze({__proto__:null,identity:Mw});const jw=ur({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Fw=Object.freeze({__proto__:null,base2:jw});const Bw=ur({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var kw=Object.freeze({__proto__:null,base8:Bw});const qw=po({prefix:"9",name:"base10",alphabet:"0123456789"});var zw=Object.freeze({__proto__:null,base10:qw});const Hw=ur({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ww=ur({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Kw=Object.freeze({__proto__:null,base16:Hw,base16upper:Ww});const Vw=ur({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Gw=ur({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Yw=ur({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Jw=ur({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Zw=ur({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Qw=ur({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Xw=ur({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),eb=ur({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),tb=ur({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var rb=Object.freeze({__proto__:null,base32:Vw,base32upper:Gw,base32pad:Yw,base32padupper:Jw,base32hex:Zw,base32hexupper:Qw,base32hexpad:Xw,base32hexpadupper:eb,base32z:tb});const nb=po({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ib=po({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var sb=Object.freeze({__proto__:null,base36:nb,base36upper:ib});const ob=po({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ab=po({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var cb=Object.freeze({__proto__:null,base58btc:ob,base58flickr:ab});const lb=ur({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ub=ur({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),hb=ur({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),fb=ur({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var db=Object.freeze({__proto__:null,base64:lb,base64pad:ub,base64url:hb,base64urlpad:fb});const o0=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}"),pb=o0.reduce((r,e,t)=>(r[t]=e,r),[]),gb=o0.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function mb(r){return r.reduce((e,t)=>(e+=pb[t],e),"")}function vb(r){const e=[];for(const t of r){const n=gb[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}const yb=Pa({prefix:"\u{1F680}",name:"base256emoji",encode:mb,decode:vb});var wb=Object.freeze({__proto__:null,base256emoji:yb}),bb=c0,a0=128,_b=127,Eb=~_b,xb=Math.pow(2,31);function c0(r,e,t){e=e||[],t=t||0;for(var n=t;r>=xb;)e[t++]=r&255|a0,r/=128;for(;r&Eb;)e[t++]=r&255|a0,r>>>=7;return e[t]=r|0,c0.bytes=t-n+1,e}var Ib=kl,Db=128,l0=127;function kl(r,n){var t=0,n=n||0,i=0,a=n,c,u=r.length;do{if(a>=u)throw kl.bytes=0,new RangeError("Could not decode varint");c=r[a++],t+=i<28?(c&l0)<<i:(c&l0)*Math.pow(2,i),i+=7}while(c>=Db);return kl.bytes=a-n,t}var Sb=Math.pow(2,7),Cb=Math.pow(2,14),Ob=Math.pow(2,21),$b=Math.pow(2,28),Ab=Math.pow(2,35),Pb=Math.pow(2,42),Tb=Math.pow(2,49),Rb=Math.pow(2,56),Nb=Math.pow(2,63),Lb=function(r){return r<Sb?1:r<Cb?2:r<Ob?3:r<$b?4:r<Ab?5:r<Pb?6:r<Tb?7:r<Rb?8:r<Nb?9:10},Mb={encode:bb,decode:Ib,encodingLength:Lb},u0=Mb;const h0=(r,e,t=0)=>(u0.encode(r,e,t),e),f0=r=>u0.encodingLength(r),ql=(r,e)=>{const t=e.byteLength,n=f0(r),i=n+f0(t),a=new Uint8Array(i+t);return h0(r,a,0),h0(t,a,n),a.set(e,i),new Ub(r,t,e,a)};class Ub{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}}const d0=({name:r,code:e,encode:t})=>new jb(r,e,t);class jb{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?ql(this.code,t):t.then(n=>ql(this.code,n))}else throw Error("Unknown type, must be binary type")}}const p0=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),Fb=d0({name:"sha2-256",code:18,encode:p0("SHA-256")}),Bb=d0({name:"sha2-512",code:19,encode:p0("SHA-512")});var kb=Object.freeze({__proto__:null,sha256:Fb,sha512:Bb});const g0=0,qb="identity",m0=i0;var zb=Object.freeze({__proto__:null,identity:{code:g0,name:qb,encode:m0,digest:r=>ql(g0,m0(r))}});new TextEncoder,new TextDecoder;const v0={...Uw,...Fw,...kw,...zw,...Kw,...rb,...sb,...cb,...db,...wb};({...kb,...zb});function y0(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}const w0=y0("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),zl=y0("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=n0(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),b0={utf8:w0,"utf-8":w0,hex:v0.base16,latin1:zl,ascii:zl,binary:zl,...v0};function Tr(r,e="utf8"){const t=b0[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Fl(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function wr(r,e="utf8"){const t=b0[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var _0=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))},Hb=function(){function r(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"}return r}(),Wb=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return r}(),Kb=function(){function r(e,t,n,i){this.name=e,this.version=t,this.os=n,this.bot=i,this.type="bot-device"}return r}(),Vb=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Gb=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Yb=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Jb=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,E0=3,Zb=[["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",Yb]],x0=[["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 Qb(r){return r?I0(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Gb:typeof navigator<"u"?I0(navigator.userAgent):t2()}function Xb(r){return r!==""&&Zb.reduce(function(e,t){var n=t[0],i=t[1];if(e)return e;var a=i.exec(r);return!!a&&[n,a]},!1)}function I0(r){var e=Xb(r);if(!e)return null;var t=e[0],n=e[1];if(t==="searchbot")return new Vb;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<E0&&(i=_0(_0([],i,!0),r2(E0-i.length),!0)):i=[];var a=i.join("."),c=e2(r),u=Jb.exec(r);return u&&u[1]?new Kb(t,a,c,u[1]):new Hb(t,a,c)}function e2(r){for(var e=0,t=x0.length;e<t;e++){var n=x0[e],i=n[0],a=n[1],c=a.exec(r);if(c)return i}return null}function t2(){var r=typeof process<"u"&&process.version;return r?new Wb(process.version.slice(1)):null}function r2(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}var ye={};/*! *****************************************************************************
1
+ (function(dn,vr){typeof exports=="object"&&typeof module<"u"?vr(exports):typeof define=="function"&&define.amd?define(["exports"],vr):(dn=typeof globalThis<"u"?globalThis:dn||self,vr(dn["@walletconnect/ethereum-provider"]={}))})(this,function(dn){"use strict";var vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cy(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Pi(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var lr={exports:{}},vs=typeof Reflect=="object"?Reflect:null,Nd=vs&&typeof vs.apply=="function"?vs.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Sa;vs&&typeof vs.ownKeys=="function"?Sa=vs.ownKeys:Object.getOwnPropertySymbols?Sa=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Sa=function(e){return Object.getOwnPropertyNames(e)};function $y(r){console&&console.warn&&console.warn(r)}var Ld=Number.isNaN||function(e){return e!==e};function pt(){pt.init.call(this)}lr.exports=pt,lr.exports.once=Ry,pt.EventEmitter=pt,pt.prototype._events=void 0,pt.prototype._eventsCount=0,pt.prototype._maxListeners=void 0;var Md=10;function Oa(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(pt,"defaultMaxListeners",{enumerable:!0,get:function(){return Md},set:function(r){if(typeof r!="number"||r<0||Ld(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Md=r}}),pt.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},pt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Ld(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Ud(r){return r._maxListeners===void 0?pt.defaultMaxListeners:r._maxListeners}pt.prototype.getMaxListeners=function(){return Ud(this)},pt.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",a=this._events;if(a!==void 0)i=i&&a.error===void 0;else if(!i)return!1;if(i){var c;if(t.length>0&&(c=t[0]),c instanceof Error)throw c;var u=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw u.context=c,u}var f=a[e];if(f===void 0)return!1;if(typeof f=="function")Nd(f,this,t);else for(var h=f.length,m=qd(f,h),n=0;n<h;++n)Nd(m[n],this,t);return!0};function jd(r,e,t,n){var i,a,c;if(Oa(t),a=r._events,a===void 0?(a=r._events=Object.create(null),r._eventsCount=0):(a.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),a=r._events),c=a[e]),c===void 0)c=a[e]=t,++r._eventsCount;else if(typeof c=="function"?c=a[e]=n?[t,c]:[c,t]:n?c.unshift(t):c.push(t),i=Ud(r),i>0&&c.length>i&&!c.warned){c.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=r,u.type=e,u.count=c.length,$y(u)}return r}pt.prototype.addListener=function(e,t){return jd(this,e,t,!1)},pt.prototype.on=pt.prototype.addListener,pt.prototype.prependListener=function(e,t){return jd(this,e,t,!0)};function Ay(){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 Fd(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=Ay.bind(n);return i.listener=t,n.wrapFn=i,i}pt.prototype.once=function(e,t){return Oa(t),this.on(e,Fd(this,e,t)),this},pt.prototype.prependOnceListener=function(e,t){return Oa(t),this.prependListener(e,Fd(this,e,t)),this},pt.prototype.removeListener=function(e,t){var n,i,a,c,u;if(Oa(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(a=-1,c=n.length-1;c>=0;c--)if(n[c]===t||n[c].listener===t){u=n[c].listener,a=c;break}if(a<0)return this;a===0?n.shift():Py(n,a),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this},pt.prototype.off=pt.prototype.removeListener,pt.prototype.removeAllListeners=function(e){var t,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 a=Object.keys(n),c;for(i=0;i<a.length;++i)c=a[i],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function Bd(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?Ty(i):qd(i,i.length)}pt.prototype.listeners=function(e){return Bd(this,e,!0)},pt.prototype.rawListeners=function(e){return Bd(this,e,!1)},pt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):kd.call(r,e)},pt.prototype.listenerCount=kd;function kd(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}pt.prototype.eventNames=function(){return this._eventsCount>0?Sa(this._events):[]};function qd(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Py(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Ty(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Ry(r,e){return new Promise(function(t,n){function i(c){r.removeListener(e,a),n(c)}function a(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}zd(r,e,a,{once:!0}),e!=="error"&&Ny(r,i,{once:!0})})}function Ny(r,e,t){typeof r.on=="function"&&zd(r,"error",e,t)}function zd(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(a){n.once&&r.removeEventListener(e,i),t(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var Nl={},Ca={},Me={},Hd={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(u,f){var h=u>>>16&65535,m=u&65535,w=f>>>16&65535,y=f&65535;return m*y+(h*y+m*w<<16>>>0)|0}r.mul=Math.imul||e;function t(u,f){return u+f|0}r.add=t;function n(u,f){return u-f|0}r.sub=n;function i(u,f){return u<<f|u>>>32-f}r.rotl=i;function a(u,f){return u<<32-f|u>>>f}r.rotr=a;function c(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}r.isInteger=Number.isInteger||c,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(u){return r.isInteger(u)&&u>=-r.MAX_SAFE_INTEGER&&u<=r.MAX_SAFE_INTEGER}})(Hd),Object.defineProperty(Me,"__esModule",{value:!0});var Wd=Hd;function Ly(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}Me.readInt16BE=Ly;function My(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}Me.readUint16BE=My;function Uy(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}Me.readInt16LE=Uy;function jy(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}Me.readUint16LE=jy;function Kd(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}Me.writeUint16BE=Kd,Me.writeInt16BE=Kd;function Vd(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}Me.writeUint16LE=Vd,Me.writeInt16LE=Vd;function Ll(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}Me.readInt32BE=Ll;function Ml(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}Me.readUint32BE=Ml;function Ul(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}Me.readInt32LE=Ul;function jl(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}Me.readUint32LE=jl;function $a(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}Me.writeUint32BE=$a,Me.writeInt32BE=$a;function Aa(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}Me.writeUint32LE=Aa,Me.writeInt32LE=Aa;function Fy(r,e){e===void 0&&(e=0);var t=Ll(r,e),n=Ll(r,e+4);return t*4294967296+n-(n>>31)*4294967296}Me.readInt64BE=Fy;function By(r,e){e===void 0&&(e=0);var t=Ml(r,e),n=Ml(r,e+4);return t*4294967296+n}Me.readUint64BE=By;function ky(r,e){e===void 0&&(e=0);var t=Ul(r,e),n=Ul(r,e+4);return n*4294967296+t-(t>>31)*4294967296}Me.readInt64LE=ky;function qy(r,e){e===void 0&&(e=0);var t=jl(r,e),n=jl(r,e+4);return n*4294967296+t}Me.readUint64LE=qy;function Gd(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),$a(r/4294967296>>>0,e,t),$a(r>>>0,e,t+4),e}Me.writeUint64BE=Gd,Me.writeInt64BE=Gd;function Yd(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Aa(r>>>0,e,t),Aa(r/4294967296>>>0,e,t+4),e}Me.writeUint64LE=Yd,Me.writeInt64LE=Yd;function zy(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=r/8+t-1;a>=t;a--)n+=e[a]*i,i*=256;return n}Me.readUintBE=zy;function Hy(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=t;a<t+r/8;a++)n+=e[a]*i,i*=256;return n}Me.readUintLE=Hy;function Wy(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Wd.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=r/8+n-1;a>=n;a--)t[a]=e/i&255,i*=256;return t}Me.writeUintBE=Wy;function Ky(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Wd.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+r/8;a++)t[a]=e/i&255,i*=256;return t}Me.writeUintLE=Ky;function Vy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}Me.readFloat32BE=Vy;function Gy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}Me.readFloat32LE=Gy;function Yy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}Me.readFloat64BE=Yy;function Zy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}Me.readFloat64LE=Zy;function Jy(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}Me.writeFloat32BE=Jy;function Qy(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}Me.writeFloat32LE=Qy;function Xy(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}Me.writeFloat64BE=Xy;function ew(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}Me.writeFloat64LE=ew;var qr={};Object.defineProperty(qr,"__esModule",{value:!0});function tw(r){for(var e=0;e<r.length;e++)r[e]=0;return r}qr.wipe=tw,Object.defineProperty(Ca,"__esModule",{value:!0});var dr=Me,Fl=qr,rw=20;function nw(r,e,t){for(var n=1634760805,i=857760878,a=2036477234,c=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],f=t[7]<<24|t[6]<<16|t[5]<<8|t[4],h=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=t[15]<<24|t[14]<<16|t[13]<<8|t[12],w=t[19]<<24|t[18]<<16|t[17]<<8|t[16],y=t[23]<<24|t[22]<<16|t[21]<<8|t[20],_=t[27]<<24|t[26]<<16|t[25]<<8|t[24],S=t[31]<<24|t[30]<<16|t[29]<<8|t[28],P=e[3]<<24|e[2]<<16|e[1]<<8|e[0],j=e[7]<<24|e[6]<<16|e[5]<<8|e[4],U=e[11]<<24|e[10]<<16|e[9]<<8|e[8],A=e[15]<<24|e[14]<<16|e[13]<<8|e[12],T=n,O=i,$=a,x=c,d=u,b=f,H=h,F=m,V=w,se=y,ce=_,I=S,N=P,X=j,ee=U,Y=A,Z=0;Z<rw;Z+=2)T=T+d|0,N^=T,N=N>>>32-16|N<<16,V=V+N|0,d^=V,d=d>>>32-12|d<<12,O=O+b|0,X^=O,X=X>>>32-16|X<<16,se=se+X|0,b^=se,b=b>>>32-12|b<<12,$=$+H|0,ee^=$,ee=ee>>>32-16|ee<<16,ce=ce+ee|0,H^=ce,H=H>>>32-12|H<<12,x=x+F|0,Y^=x,Y=Y>>>32-16|Y<<16,I=I+Y|0,F^=I,F=F>>>32-12|F<<12,$=$+H|0,ee^=$,ee=ee>>>32-8|ee<<8,ce=ce+ee|0,H^=ce,H=H>>>32-7|H<<7,x=x+F|0,Y^=x,Y=Y>>>32-8|Y<<8,I=I+Y|0,F^=I,F=F>>>32-7|F<<7,O=O+b|0,X^=O,X=X>>>32-8|X<<8,se=se+X|0,b^=se,b=b>>>32-7|b<<7,T=T+d|0,N^=T,N=N>>>32-8|N<<8,V=V+N|0,d^=V,d=d>>>32-7|d<<7,T=T+b|0,Y^=T,Y=Y>>>32-16|Y<<16,ce=ce+Y|0,b^=ce,b=b>>>32-12|b<<12,O=O+H|0,N^=O,N=N>>>32-16|N<<16,I=I+N|0,H^=I,H=H>>>32-12|H<<12,$=$+F|0,X^=$,X=X>>>32-16|X<<16,V=V+X|0,F^=V,F=F>>>32-12|F<<12,x=x+d|0,ee^=x,ee=ee>>>32-16|ee<<16,se=se+ee|0,d^=se,d=d>>>32-12|d<<12,$=$+F|0,X^=$,X=X>>>32-8|X<<8,V=V+X|0,F^=V,F=F>>>32-7|F<<7,x=x+d|0,ee^=x,ee=ee>>>32-8|ee<<8,se=se+ee|0,d^=se,d=d>>>32-7|d<<7,O=O+H|0,N^=O,N=N>>>32-8|N<<8,I=I+N|0,H^=I,H=H>>>32-7|H<<7,T=T+b|0,Y^=T,Y=Y>>>32-8|Y<<8,ce=ce+Y|0,b^=ce,b=b>>>32-7|b<<7;dr.writeUint32LE(T+n|0,r,0),dr.writeUint32LE(O+i|0,r,4),dr.writeUint32LE($+a|0,r,8),dr.writeUint32LE(x+c|0,r,12),dr.writeUint32LE(d+u|0,r,16),dr.writeUint32LE(b+f|0,r,20),dr.writeUint32LE(H+h|0,r,24),dr.writeUint32LE(F+m|0,r,28),dr.writeUint32LE(V+w|0,r,32),dr.writeUint32LE(se+y|0,r,36),dr.writeUint32LE(ce+_|0,r,40),dr.writeUint32LE(I+S|0,r,44),dr.writeUint32LE(N+P|0,r,48),dr.writeUint32LE(X+j|0,r,52),dr.writeUint32LE(ee+U|0,r,56),dr.writeUint32LE(Y+A|0,r,60)}function Zd(r,e,t,n,i){if(i===void 0&&(i=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<t.length)throw new Error("ChaCha: destination is shorter than source");var a,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),c=a.length-e.length,a.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,c=i}for(var u=new Uint8Array(64),f=0;f<t.length;f+=64){nw(u,a,r);for(var h=f;h<f+64&&h<t.length;h++)n[h]=t[h]^u[h-f];sw(a,0,c)}return Fl.wipe(u),i===0&&Fl.wipe(a),n}Ca.streamXOR=Zd;function iw(r,e,t,n){return n===void 0&&(n=0),Fl.wipe(t),Zd(r,e,t,t,n)}Ca.stream=iw;function sw(r,e,t){for(var n=1;t--;)n=n+(r[e]&255)|0,r[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Jd={},ni={};Object.defineProperty(ni,"__esModule",{value:!0});function ow(r,e,t){return~(r-1)&e|r-1&t}ni.select=ow;function aw(r,e){return(r|0)-(e|0)-1>>>31&1}ni.lessOrEqual=aw;function Qd(r,e){if(r.length!==e.length)return 0;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return 1&t-1>>>8}ni.compare=Qd;function cw(r,e){return r.length===0||e.length===0?!1:Qd(r,e)!==0}ni.equal=cw,function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ni,t=qr;r.DIGEST_LENGTH=16;var n=function(){function c(u){this.digestLength=r.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 f=u[0]|u[1]<<8;this._r[0]=f&8191;var h=u[2]|u[3]<<8;this._r[1]=(f>>>13|h<<3)&8191;var m=u[4]|u[5]<<8;this._r[2]=(h>>>10|m<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(m>>>7|w<<9)&8191;var y=u[8]|u[9]<<8;this._r[4]=(w>>>4|y<<12)&255,this._r[5]=y>>>1&8190;var _=u[10]|u[11]<<8;this._r[6]=(y>>>14|_<<2)&8191;var S=u[12]|u[13]<<8;this._r[7]=(_>>>11|S<<5)&8065;var P=u[14]|u[15]<<8;this._r[8]=(S>>>8|P<<8)&8191,this._r[9]=P>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return c.prototype._blocks=function(u,f,h){for(var m=this._fin?0:2048,w=this._h[0],y=this._h[1],_=this._h[2],S=this._h[3],P=this._h[4],j=this._h[5],U=this._h[6],A=this._h[7],T=this._h[8],O=this._h[9],$=this._r[0],x=this._r[1],d=this._r[2],b=this._r[3],H=this._r[4],F=this._r[5],V=this._r[6],se=this._r[7],ce=this._r[8],I=this._r[9];h>=16;){var N=u[f+0]|u[f+1]<<8;w+=N&8191;var X=u[f+2]|u[f+3]<<8;y+=(N>>>13|X<<3)&8191;var ee=u[f+4]|u[f+5]<<8;_+=(X>>>10|ee<<6)&8191;var Y=u[f+6]|u[f+7]<<8;S+=(ee>>>7|Y<<9)&8191;var Z=u[f+8]|u[f+9]<<8;P+=(Y>>>4|Z<<12)&8191,j+=Z>>>1&8191;var Q=u[f+10]|u[f+11]<<8;U+=(Z>>>14|Q<<2)&8191;var ie=u[f+12]|u[f+13]<<8;A+=(Q>>>11|ie<<5)&8191;var Ee=u[f+14]|u[f+15]<<8;T+=(ie>>>8|Ee<<8)&8191,O+=Ee>>>5|m;var ae=0,xe=ae;xe+=w*$,xe+=y*(5*I),xe+=_*(5*ce),xe+=S*(5*se),xe+=P*(5*V),ae=xe>>>13,xe&=8191,xe+=j*(5*F),xe+=U*(5*H),xe+=A*(5*b),xe+=T*(5*d),xe+=O*(5*x),ae+=xe>>>13,xe&=8191;var de=ae;de+=w*x,de+=y*$,de+=_*(5*I),de+=S*(5*ce),de+=P*(5*se),ae=de>>>13,de&=8191,de+=j*(5*V),de+=U*(5*F),de+=A*(5*H),de+=T*(5*b),de+=O*(5*d),ae+=de>>>13,de&=8191;var be=ae;be+=w*d,be+=y*x,be+=_*$,be+=S*(5*I),be+=P*(5*ce),ae=be>>>13,be&=8191,be+=j*(5*se),be+=U*(5*V),be+=A*(5*F),be+=T*(5*H),be+=O*(5*b),ae+=be>>>13,be&=8191;var K=ae;K+=w*b,K+=y*d,K+=_*x,K+=S*$,K+=P*(5*I),ae=K>>>13,K&=8191,K+=j*(5*ce),K+=U*(5*se),K+=A*(5*V),K+=T*(5*F),K+=O*(5*H),ae+=K>>>13,K&=8191;var W=ae;W+=w*H,W+=y*b,W+=_*d,W+=S*x,W+=P*$,ae=W>>>13,W&=8191,W+=j*(5*I),W+=U*(5*ce),W+=A*(5*se),W+=T*(5*V),W+=O*(5*F),ae+=W>>>13,W&=8191;var B=ae;B+=w*F,B+=y*H,B+=_*b,B+=S*d,B+=P*x,ae=B>>>13,B&=8191,B+=j*$,B+=U*(5*I),B+=A*(5*ce),B+=T*(5*se),B+=O*(5*V),ae+=B>>>13,B&=8191;var g=ae;g+=w*V,g+=y*F,g+=_*H,g+=S*b,g+=P*d,ae=g>>>13,g&=8191,g+=j*x,g+=U*$,g+=A*(5*I),g+=T*(5*ce),g+=O*(5*se),ae+=g>>>13,g&=8191;var L=ae;L+=w*se,L+=y*V,L+=_*F,L+=S*H,L+=P*b,ae=L>>>13,L&=8191,L+=j*d,L+=U*x,L+=A*$,L+=T*(5*I),L+=O*(5*ce),ae+=L>>>13,L&=8191;var le=ae;le+=w*ce,le+=y*se,le+=_*V,le+=S*F,le+=P*H,ae=le>>>13,le&=8191,le+=j*b,le+=U*d,le+=A*x,le+=T*$,le+=O*(5*I),ae+=le>>>13,le&=8191;var pe=ae;pe+=w*I,pe+=y*ce,pe+=_*se,pe+=S*V,pe+=P*F,ae=pe>>>13,pe&=8191,pe+=j*H,pe+=U*b,pe+=A*d,pe+=T*x,pe+=O*$,ae+=pe>>>13,pe&=8191,ae=(ae<<2)+ae|0,ae=ae+xe|0,xe=ae&8191,ae=ae>>>13,de+=ae,w=xe,y=de,_=be,S=K,P=W,j=B,U=g,A=L,T=le,O=pe,f+=16,h-=16}this._h[0]=w,this._h[1]=y,this._h[2]=_,this._h[3]=S,this._h[4]=P,this._h[5]=j,this._h[6]=U,this._h[7]=A,this._h[8]=T,this._h[9]=O},c.prototype.finish=function(u,f){f===void 0&&(f=0);var h=new Uint16Array(10),m,w,y,_;if(this._leftover){for(_=this._leftover,this._buffer[_++]=1;_<16;_++)this._buffer[_]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(m=this._h[1]>>>13,this._h[1]&=8191,_=2;_<10;_++)this._h[_]+=m,m=this._h[_]>>>13,this._h[_]&=8191;for(this._h[0]+=m*5,m=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=m,m=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=m,h[0]=this._h[0]+5,m=h[0]>>>13,h[0]&=8191,_=1;_<10;_++)h[_]=this._h[_]+m,m=h[_]>>>13,h[_]&=8191;for(h[9]-=8192,w=(m^1)-1,_=0;_<10;_++)h[_]&=w;for(w=~w,_=0;_<10;_++)this._h[_]=this._h[_]&w|h[_];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,y=this._h[0]+this._pad[0],this._h[0]=y&65535,_=1;_<8;_++)y=(this._h[_]+this._pad[_]|0)+(y>>>16)|0,this._h[_]=y&65535;return u[f+0]=this._h[0]>>>0,u[f+1]=this._h[0]>>>8,u[f+2]=this._h[1]>>>0,u[f+3]=this._h[1]>>>8,u[f+4]=this._h[2]>>>0,u[f+5]=this._h[2]>>>8,u[f+6]=this._h[3]>>>0,u[f+7]=this._h[3]>>>8,u[f+8]=this._h[4]>>>0,u[f+9]=this._h[4]>>>8,u[f+10]=this._h[5]>>>0,u[f+11]=this._h[5]>>>8,u[f+12]=this._h[6]>>>0,u[f+13]=this._h[6]>>>8,u[f+14]=this._h[7]>>>0,u[f+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(u){var f=0,h=u.length,m;if(this._leftover){m=16-this._leftover,m>h&&(m=h);for(var w=0;w<m;w++)this._buffer[this._leftover+w]=u[f+w];if(h-=m,f+=m,this._leftover+=m,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(h>=16&&(m=h-h%16,this._blocks(u,f,m),f+=m,h-=m),h){for(var w=0;w<h;w++)this._buffer[this._leftover+w]=u[f+w];this._leftover+=h}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},c.prototype.clean=function(){return t.wipe(this._buffer),t.wipe(this._r),t.wipe(this._h),t.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},c}();r.Poly1305=n;function i(c,u){var f=new n(c);f.update(u);var h=f.digest();return f.clean(),h}r.oneTimeAuth=i;function a(c,u){return c.length!==r.DIGEST_LENGTH||u.length!==r.DIGEST_LENGTH?!1:e.equal(c,u)}r.equal=a}(Jd),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Ca,t=Jd,n=qr,i=Me,a=ni;r.KEY_LENGTH=32,r.NONCE_LENGTH=12,r.TAG_LENGTH=16;var c=new Uint8Array(16),u=function(){function f(h){if(this.nonceLength=r.NONCE_LENGTH,this.tagLength=r.TAG_LENGTH,h.length!==r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(h)}return f.prototype.seal=function(h,m,w,y){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var _=new Uint8Array(16);_.set(h,_.length-h.length);var S=new Uint8Array(32);e.stream(this._key,_,S,4);var P=m.length+this.tagLength,j;if(y){if(y.length!==P)throw new Error("ChaCha20Poly1305: incorrect destination length");j=y}else j=new Uint8Array(P);return e.streamXOR(this._key,_,m,j,4),this._authenticate(j.subarray(j.length-this.tagLength,j.length),S,j.subarray(0,j.length-this.tagLength),w),n.wipe(_),j},f.prototype.open=function(h,m,w,y){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(m.length<this.tagLength)return null;var _=new Uint8Array(16);_.set(h,_.length-h.length);var S=new Uint8Array(32);e.stream(this._key,_,S,4);var P=new Uint8Array(this.tagLength);if(this._authenticate(P,S,m.subarray(0,m.length-this.tagLength),w),!a.equal(P,m.subarray(m.length-this.tagLength,m.length)))return null;var j=m.length-this.tagLength,U;if(y){if(y.length!==j)throw new Error("ChaCha20Poly1305: incorrect destination length");U=y}else U=new Uint8Array(j);return e.streamXOR(this._key,_,m.subarray(0,m.length-this.tagLength),U,4),n.wipe(_),U},f.prototype.clean=function(){return n.wipe(this._key),this},f.prototype._authenticate=function(h,m,w,y){var _=new t.Poly1305(m);y&&(_.update(y),y.length%16>0&&_.update(c.subarray(y.length%16))),_.update(w),w.length%16>0&&_.update(c.subarray(w.length%16));var S=new Uint8Array(8);y&&i.writeUint64LE(y.length,S),_.update(S),i.writeUint64LE(w.length,S),_.update(S);for(var P=_.digest(),j=0;j<P.length;j++)h[j]=P[j];_.clean(),n.wipe(P),n.wipe(S)},f}();r.ChaCha20Poly1305=u}(Nl);var Xd={},mo={},Bl={};Object.defineProperty(Bl,"__esModule",{value:!0});function lw(r){return typeof r.saveState<"u"&&typeof r.restoreState<"u"&&typeof r.cleanSavedState<"u"}Bl.isSerializableHash=lw,Object.defineProperty(mo,"__esModule",{value:!0});var _n=Bl,uw=ni,hw=qr,e0=function(){function r(e,t){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);t.length>this.blockSize?this._inner.update(t).finish(n).clean():n.set(t);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()),hw.wipe(n)}return r.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},r.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()},r.prototype.update=function(e){return this._inner.update(e),this},r.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)},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.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()},r.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},r.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)},r}();mo.HMAC=e0;function fw(r,e,t){var n=new e0(r,e);n.update(t);var i=n.digest();return n.clean(),i}mo.hmac=fw,mo.equal=uw.equal,Object.defineProperty(Xd,"__esModule",{value:!0});var t0=mo,r0=qr,dw=function(){function r(e,t,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=t0.hmac(this._hash,n,t);this._hmac=new t0.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return r.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},r.prototype.expand=function(e){for(var t=new Uint8Array(e),n=0;n<t.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[n]=this._buffer[this._bufpos++];return t},r.prototype.clean=function(){this._hmac.clean(),r0.wipe(this._buffer),r0.wipe(this._counter),this._bufpos=0},r}(),pw=Xd.HKDF=dw,ys={},Pa={},Ta={};Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.BrowserRandomSource=void 0;const n0=65536;class gw{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 t=new Uint8Array(e);for(let n=0;n<t.length;n+=n0)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,n0)));return t}}Ta.BrowserRandomSource=gw;function mw(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ra={},vw={},yw=Object.freeze({__proto__:null,default:vw}),ww=Pi(yw);Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.NodeRandomSource=void 0;const bw=qr;class _w{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof mw<"u"){const e=ww;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 t=this._crypto.randomBytes(e);if(t.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]=t[i];return(0,bw.wipe)(t),n}}Ra.NodeRandomSource=_w,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.SystemRandomSource=void 0;const Ew=Ta,xw=Ra;class Iw{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Ew.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new xw.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)}}Pa.SystemRandomSource=Iw,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.randomStringForEntropy=r.randomString=r.randomUint32=r.randomBytes=r.defaultRandomSource=void 0;const e=Pa,t=Me,n=qr;r.defaultRandomSource=new e.SystemRandomSource;function i(h,m=r.defaultRandomSource){return m.randomBytes(h)}r.randomBytes=i;function a(h=r.defaultRandomSource){const m=i(4,h),w=(0,t.readUint32LE)(m);return(0,n.wipe)(m),w}r.randomUint32=a;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(h,m=c,w=r.defaultRandomSource){if(m.length<2)throw new Error("randomString charset is too short");if(m.length>256)throw new Error("randomString charset is too long");let y="";const _=m.length,S=256-256%_;for(;h>0;){const P=i(Math.ceil(h*256/S),w);for(let j=0;j<P.length&&h>0;j++){const U=P[j];U<S&&(y+=m.charAt(U%_),h--)}(0,n.wipe)(P)}return y}r.randomString=u;function f(h,m=c,w=r.defaultRandomSource){const y=Math.ceil(h/(Math.log(m.length)/Math.LN2));return u(y,m,w)}r.randomStringForEntropy=f}(ys);var Na={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Me,t=qr;r.DIGEST_LENGTH=32,r.BLOCK_SIZE=64;var n=function(){function u(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},u.prototype.update=function(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var m=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&h>0;)this._buffer[this._bufferLength++]=f[m++],h--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(m=a(this._temp,this._state,f,m,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[m++],h--;return this},u.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,m=this._bufferLength,w=h/536870912|0,y=h<<3,_=h%64<56?64:128;this._buffer[m]=128;for(var S=m+1;S<_-8;S++)this._buffer[S]=0;e.writeUint32BE(w,this._buffer,_-8),e.writeUint32BE(y,this._buffer,_-4),a(this._temp,this._state,this._buffer,0,_),this._finished=!0}for(var S=0;S<this.digestLength/4;S++)e.writeUint32BE(this._state[S],f,S*4);return this},u.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},u.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}},u.prototype.restoreState=function(f){return this._state.set(f.state),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(f){t.wipe(f.state),f.buffer&&t.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},u}();r.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 a(u,f,h,m,w){for(;w>=64;){for(var y=f[0],_=f[1],S=f[2],P=f[3],j=f[4],U=f[5],A=f[6],T=f[7],O=0;O<16;O++){var $=m+O*4;u[O]=e.readUint32BE(h,$)}for(var O=16;O<64;O++){var x=u[O-2],d=(x>>>17|x<<32-17)^(x>>>19|x<<32-19)^x>>>10;x=u[O-15];var b=(x>>>7|x<<32-7)^(x>>>18|x<<32-18)^x>>>3;u[O]=(d+u[O-7]|0)+(b+u[O-16]|0)}for(var O=0;O<64;O++){var d=(((j>>>6|j<<26)^(j>>>11|j<<21)^(j>>>25|j<<7))+(j&U^~j&A)|0)+(T+(i[O]+u[O]|0)|0)|0,b=((y>>>2|y<<32-2)^(y>>>13|y<<32-13)^(y>>>22|y<<32-22))+(y&_^y&S^_&S)|0;T=A,A=U,U=j,j=P+d|0,P=S,S=_,_=y,y=d+b|0}f[0]+=y,f[1]+=_,f[2]+=S,f[3]+=P,f[4]+=j,f[5]+=U,f[6]+=A,f[7]+=T,m+=64,w-=64}return m}function c(u){var f=new n;f.update(u);var h=f.digest();return f.clean(),h}r.hash=c})(Na);var kl={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=ys,t=qr;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function n(O){const $=new Float64Array(16);if(O)for(let x=0;x<O.length;x++)$[x]=O[x];return $}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function c(O){let $=1;for(let x=0;x<16;x++){let d=O[x]+$+65535;$=Math.floor(d/65536),O[x]=d-$*65536}O[0]+=$-1+37*($-1)}function u(O,$,x){const d=~(x-1);for(let b=0;b<16;b++){const H=d&(O[b]^$[b]);O[b]^=H,$[b]^=H}}function f(O,$){const x=n(),d=n();for(let b=0;b<16;b++)d[b]=$[b];c(d),c(d),c(d);for(let b=0;b<2;b++){x[0]=d[0]-65517;for(let F=1;F<15;F++)x[F]=d[F]-65535-(x[F-1]>>16&1),x[F-1]&=65535;x[15]=d[15]-32767-(x[14]>>16&1);const H=x[15]>>16&1;x[14]&=65535,u(d,x,1-H)}for(let b=0;b<16;b++)O[2*b]=d[b]&255,O[2*b+1]=d[b]>>8}function h(O,$){for(let x=0;x<16;x++)O[x]=$[2*x]+($[2*x+1]<<8);O[15]&=32767}function m(O,$,x){for(let d=0;d<16;d++)O[d]=$[d]+x[d]}function w(O,$,x){for(let d=0;d<16;d++)O[d]=$[d]-x[d]}function y(O,$,x){let d,b,H=0,F=0,V=0,se=0,ce=0,I=0,N=0,X=0,ee=0,Y=0,Z=0,Q=0,ie=0,Ee=0,ae=0,xe=0,de=0,be=0,K=0,W=0,B=0,g=0,L=0,le=0,pe=0,Oe=0,Ke=0,Ze=0,ke=0,Ot=0,Ct=0,ze=x[0],Ce=x[1],Ue=x[2],je=x[3],He=x[4],Ae=x[5],Fe=x[6],Se=x[7],Te=x[8],Ve=x[9],$e=x[10],Je=x[11],et=x[12],at=x[13],ct=x[14],nt=x[15];d=$[0],H+=d*ze,F+=d*Ce,V+=d*Ue,se+=d*je,ce+=d*He,I+=d*Ae,N+=d*Fe,X+=d*Se,ee+=d*Te,Y+=d*Ve,Z+=d*$e,Q+=d*Je,ie+=d*et,Ee+=d*at,ae+=d*ct,xe+=d*nt,d=$[1],F+=d*ze,V+=d*Ce,se+=d*Ue,ce+=d*je,I+=d*He,N+=d*Ae,X+=d*Fe,ee+=d*Se,Y+=d*Te,Z+=d*Ve,Q+=d*$e,ie+=d*Je,Ee+=d*et,ae+=d*at,xe+=d*ct,de+=d*nt,d=$[2],V+=d*ze,se+=d*Ce,ce+=d*Ue,I+=d*je,N+=d*He,X+=d*Ae,ee+=d*Fe,Y+=d*Se,Z+=d*Te,Q+=d*Ve,ie+=d*$e,Ee+=d*Je,ae+=d*et,xe+=d*at,de+=d*ct,be+=d*nt,d=$[3],se+=d*ze,ce+=d*Ce,I+=d*Ue,N+=d*je,X+=d*He,ee+=d*Ae,Y+=d*Fe,Z+=d*Se,Q+=d*Te,ie+=d*Ve,Ee+=d*$e,ae+=d*Je,xe+=d*et,de+=d*at,be+=d*ct,K+=d*nt,d=$[4],ce+=d*ze,I+=d*Ce,N+=d*Ue,X+=d*je,ee+=d*He,Y+=d*Ae,Z+=d*Fe,Q+=d*Se,ie+=d*Te,Ee+=d*Ve,ae+=d*$e,xe+=d*Je,de+=d*et,be+=d*at,K+=d*ct,W+=d*nt,d=$[5],I+=d*ze,N+=d*Ce,X+=d*Ue,ee+=d*je,Y+=d*He,Z+=d*Ae,Q+=d*Fe,ie+=d*Se,Ee+=d*Te,ae+=d*Ve,xe+=d*$e,de+=d*Je,be+=d*et,K+=d*at,W+=d*ct,B+=d*nt,d=$[6],N+=d*ze,X+=d*Ce,ee+=d*Ue,Y+=d*je,Z+=d*He,Q+=d*Ae,ie+=d*Fe,Ee+=d*Se,ae+=d*Te,xe+=d*Ve,de+=d*$e,be+=d*Je,K+=d*et,W+=d*at,B+=d*ct,g+=d*nt,d=$[7],X+=d*ze,ee+=d*Ce,Y+=d*Ue,Z+=d*je,Q+=d*He,ie+=d*Ae,Ee+=d*Fe,ae+=d*Se,xe+=d*Te,de+=d*Ve,be+=d*$e,K+=d*Je,W+=d*et,B+=d*at,g+=d*ct,L+=d*nt,d=$[8],ee+=d*ze,Y+=d*Ce,Z+=d*Ue,Q+=d*je,ie+=d*He,Ee+=d*Ae,ae+=d*Fe,xe+=d*Se,de+=d*Te,be+=d*Ve,K+=d*$e,W+=d*Je,B+=d*et,g+=d*at,L+=d*ct,le+=d*nt,d=$[9],Y+=d*ze,Z+=d*Ce,Q+=d*Ue,ie+=d*je,Ee+=d*He,ae+=d*Ae,xe+=d*Fe,de+=d*Se,be+=d*Te,K+=d*Ve,W+=d*$e,B+=d*Je,g+=d*et,L+=d*at,le+=d*ct,pe+=d*nt,d=$[10],Z+=d*ze,Q+=d*Ce,ie+=d*Ue,Ee+=d*je,ae+=d*He,xe+=d*Ae,de+=d*Fe,be+=d*Se,K+=d*Te,W+=d*Ve,B+=d*$e,g+=d*Je,L+=d*et,le+=d*at,pe+=d*ct,Oe+=d*nt,d=$[11],Q+=d*ze,ie+=d*Ce,Ee+=d*Ue,ae+=d*je,xe+=d*He,de+=d*Ae,be+=d*Fe,K+=d*Se,W+=d*Te,B+=d*Ve,g+=d*$e,L+=d*Je,le+=d*et,pe+=d*at,Oe+=d*ct,Ke+=d*nt,d=$[12],ie+=d*ze,Ee+=d*Ce,ae+=d*Ue,xe+=d*je,de+=d*He,be+=d*Ae,K+=d*Fe,W+=d*Se,B+=d*Te,g+=d*Ve,L+=d*$e,le+=d*Je,pe+=d*et,Oe+=d*at,Ke+=d*ct,Ze+=d*nt,d=$[13],Ee+=d*ze,ae+=d*Ce,xe+=d*Ue,de+=d*je,be+=d*He,K+=d*Ae,W+=d*Fe,B+=d*Se,g+=d*Te,L+=d*Ve,le+=d*$e,pe+=d*Je,Oe+=d*et,Ke+=d*at,Ze+=d*ct,ke+=d*nt,d=$[14],ae+=d*ze,xe+=d*Ce,de+=d*Ue,be+=d*je,K+=d*He,W+=d*Ae,B+=d*Fe,g+=d*Se,L+=d*Te,le+=d*Ve,pe+=d*$e,Oe+=d*Je,Ke+=d*et,Ze+=d*at,ke+=d*ct,Ot+=d*nt,d=$[15],xe+=d*ze,de+=d*Ce,be+=d*Ue,K+=d*je,W+=d*He,B+=d*Ae,g+=d*Fe,L+=d*Se,le+=d*Te,pe+=d*Ve,Oe+=d*$e,Ke+=d*Je,Ze+=d*et,ke+=d*at,Ot+=d*ct,Ct+=d*nt,H+=38*de,F+=38*be,V+=38*K,se+=38*W,ce+=38*B,I+=38*g,N+=38*L,X+=38*le,ee+=38*pe,Y+=38*Oe,Z+=38*Ke,Q+=38*Ze,ie+=38*ke,Ee+=38*Ot,ae+=38*Ct,b=1,d=H+b+65535,b=Math.floor(d/65536),H=d-b*65536,d=F+b+65535,b=Math.floor(d/65536),F=d-b*65536,d=V+b+65535,b=Math.floor(d/65536),V=d-b*65536,d=se+b+65535,b=Math.floor(d/65536),se=d-b*65536,d=ce+b+65535,b=Math.floor(d/65536),ce=d-b*65536,d=I+b+65535,b=Math.floor(d/65536),I=d-b*65536,d=N+b+65535,b=Math.floor(d/65536),N=d-b*65536,d=X+b+65535,b=Math.floor(d/65536),X=d-b*65536,d=ee+b+65535,b=Math.floor(d/65536),ee=d-b*65536,d=Y+b+65535,b=Math.floor(d/65536),Y=d-b*65536,d=Z+b+65535,b=Math.floor(d/65536),Z=d-b*65536,d=Q+b+65535,b=Math.floor(d/65536),Q=d-b*65536,d=ie+b+65535,b=Math.floor(d/65536),ie=d-b*65536,d=Ee+b+65535,b=Math.floor(d/65536),Ee=d-b*65536,d=ae+b+65535,b=Math.floor(d/65536),ae=d-b*65536,d=xe+b+65535,b=Math.floor(d/65536),xe=d-b*65536,H+=b-1+37*(b-1),b=1,d=H+b+65535,b=Math.floor(d/65536),H=d-b*65536,d=F+b+65535,b=Math.floor(d/65536),F=d-b*65536,d=V+b+65535,b=Math.floor(d/65536),V=d-b*65536,d=se+b+65535,b=Math.floor(d/65536),se=d-b*65536,d=ce+b+65535,b=Math.floor(d/65536),ce=d-b*65536,d=I+b+65535,b=Math.floor(d/65536),I=d-b*65536,d=N+b+65535,b=Math.floor(d/65536),N=d-b*65536,d=X+b+65535,b=Math.floor(d/65536),X=d-b*65536,d=ee+b+65535,b=Math.floor(d/65536),ee=d-b*65536,d=Y+b+65535,b=Math.floor(d/65536),Y=d-b*65536,d=Z+b+65535,b=Math.floor(d/65536),Z=d-b*65536,d=Q+b+65535,b=Math.floor(d/65536),Q=d-b*65536,d=ie+b+65535,b=Math.floor(d/65536),ie=d-b*65536,d=Ee+b+65535,b=Math.floor(d/65536),Ee=d-b*65536,d=ae+b+65535,b=Math.floor(d/65536),ae=d-b*65536,d=xe+b+65535,b=Math.floor(d/65536),xe=d-b*65536,H+=b-1+37*(b-1),O[0]=H,O[1]=F,O[2]=V,O[3]=se,O[4]=ce,O[5]=I,O[6]=N,O[7]=X,O[8]=ee,O[9]=Y,O[10]=Z,O[11]=Q,O[12]=ie,O[13]=Ee,O[14]=ae,O[15]=xe}function _(O,$){y(O,$,$)}function S(O,$){const x=n();for(let d=0;d<16;d++)x[d]=$[d];for(let d=253;d>=0;d--)_(x,x),d!==2&&d!==4&&y(x,x,$);for(let d=0;d<16;d++)O[d]=x[d]}function P(O,$){const x=new Uint8Array(32),d=new Float64Array(80),b=n(),H=n(),F=n(),V=n(),se=n(),ce=n();for(let ee=0;ee<31;ee++)x[ee]=O[ee];x[31]=O[31]&127|64,x[0]&=248,h(d,$);for(let ee=0;ee<16;ee++)H[ee]=d[ee];b[0]=V[0]=1;for(let ee=254;ee>=0;--ee){const Y=x[ee>>>3]>>>(ee&7)&1;u(b,H,Y),u(F,V,Y),m(se,b,F),w(b,b,F),m(F,H,V),w(H,H,V),_(V,se),_(ce,b),y(b,F,b),y(F,H,se),m(se,b,F),w(b,b,F),_(H,b),w(F,V,ce),y(b,F,a),m(b,b,V),y(F,F,b),y(b,V,ce),y(V,H,d),_(H,se),u(b,H,Y),u(F,V,Y)}for(let ee=0;ee<16;ee++)d[ee+16]=b[ee],d[ee+32]=F[ee],d[ee+48]=H[ee],d[ee+64]=V[ee];const I=d.subarray(32),N=d.subarray(16);S(I,I),y(N,N,I);const X=new Uint8Array(32);return f(X,N),X}r.scalarMult=P;function j(O){return P(O,i)}r.scalarMultBase=j;function U(O){if(O.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const $=new Uint8Array(O);return{publicKey:j($),secretKey:$}}r.generateKeyPairFromSeed=U;function A(O){const $=(0,e.randomBytes)(32,O),x=U($);return(0,t.wipe)($),x}r.generateKeyPair=A;function T(O,$,x=!1){if(O.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if($.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const d=P(O,$);if(x){let b=0;for(let H=0;H<d.length;H++)b|=d[H];if(b===0)throw new Error("X25519: invalid shared key")}return d}r.sharedKey=T})(kl);function ql(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function i0(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?ql(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function zl(r,e){e||(e=r.reduce((i,a)=>i+a.length,0));const t=i0(e);let n=0;for(const i of r)t.set(i,n),n+=i.length;return ql(t)}function Dw(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var a=r.charAt(i),c=a.charCodeAt(0);if(t[c]!==255)throw new TypeError(a+" is ambiguous");t[c]=i}var u=r.length,f=r.charAt(0),h=Math.log(u)/Math.log(256),m=Math.log(256)/Math.log(u);function w(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var P=0,j=0,U=0,A=S.length;U!==A&&S[U]===0;)U++,P++;for(var T=(A-U)*m+1>>>0,O=new Uint8Array(T);U!==A;){for(var $=S[U],x=0,d=T-1;($!==0||x<j)&&d!==-1;d--,x++)$+=256*O[d]>>>0,O[d]=$%u>>>0,$=$/u>>>0;if($!==0)throw new Error("Non-zero carry");j=x,U++}for(var b=T-j;b!==T&&O[b]===0;)b++;for(var H=f.repeat(P);b<T;++b)H+=r.charAt(O[b]);return H}function y(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var P=0;if(S[P]!==" "){for(var j=0,U=0;S[P]===f;)j++,P++;for(var A=(S.length-P)*h+1>>>0,T=new Uint8Array(A);S[P];){var O=t[S.charCodeAt(P)];if(O===255)return;for(var $=0,x=A-1;(O!==0||$<U)&&x!==-1;x--,$++)O+=u*T[x]>>>0,T[x]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");U=$,P++}if(S[P]!==" "){for(var d=A-U;d!==A&&T[d]===0;)d++;for(var b=new Uint8Array(j+(A-d)),H=j;d!==A;)b[H++]=T[d++];return b}}}function _(S){var P=y(S);if(P)return P;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:y,decode:_}}var Sw=Dw,Ow=Sw;const s0=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},Cw=r=>new TextEncoder().encode(r),$w=r=>new TextDecoder().decode(r);class Aw{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Pw{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.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 o0(this,e)}}class Tw{constructor(e){this.decoders=e}or(e){return o0(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 o0=(r,e)=>new Tw({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class Rw{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Aw(e,t,n),this.decoder=new Pw(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const La=({name:r,prefix:e,encode:t,decode:n})=>new Rw(r,e,t,n),vo=({prefix:r,name:e,alphabet:t})=>{const{encode:n,decode:i}=Ow(t,e);return La({prefix:r,name:e,encode:n,decode:a=>s0(i(a))})},Nw=(r,e,t,n)=>{const i={};for(let m=0;m<e.length;++m)i[e[m]]=m;let a=r.length;for(;r[a-1]==="=";)--a;const c=new Uint8Array(a*t/8|0);let u=0,f=0,h=0;for(let m=0;m<a;++m){const w=i[r[m]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<t|w,u+=t,u>=8&&(u-=8,c[h++]=255&f>>u)}if(u>=t||255&f<<8-u)throw new SyntaxError("Unexpected end of data");return c},Lw=(r,e,t)=>{const n=e[e.length-1]==="=",i=(1<<t)-1;let a="",c=0,u=0;for(let f=0;f<r.length;++f)for(u=u<<8|r[f],c+=8;c>t;)c-=t,a+=e[i&u>>c];if(c&&(a+=e[i&u<<t-c]),n)for(;a.length*t&7;)a+="=";return a},ur=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>La({prefix:e,name:r,encode(i){return Lw(i,n,t)},decode(i){return Nw(i,n,t,r)}}),Mw=La({prefix:"\0",name:"identity",encode:r=>$w(r),decode:r=>Cw(r)});var Uw=Object.freeze({__proto__:null,identity:Mw});const jw=ur({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Fw=Object.freeze({__proto__:null,base2:jw});const Bw=ur({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var kw=Object.freeze({__proto__:null,base8:Bw});const qw=vo({prefix:"9",name:"base10",alphabet:"0123456789"});var zw=Object.freeze({__proto__:null,base10:qw});const Hw=ur({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ww=ur({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Kw=Object.freeze({__proto__:null,base16:Hw,base16upper:Ww});const Vw=ur({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Gw=ur({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Yw=ur({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Zw=ur({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jw=ur({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Qw=ur({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Xw=ur({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),eb=ur({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),tb=ur({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var rb=Object.freeze({__proto__:null,base32:Vw,base32upper:Gw,base32pad:Yw,base32padupper:Zw,base32hex:Jw,base32hexupper:Qw,base32hexpad:Xw,base32hexpadupper:eb,base32z:tb});const nb=vo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ib=vo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var sb=Object.freeze({__proto__:null,base36:nb,base36upper:ib});const ob=vo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ab=vo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var cb=Object.freeze({__proto__:null,base58btc:ob,base58flickr:ab});const lb=ur({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ub=ur({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),hb=ur({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),fb=ur({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var db=Object.freeze({__proto__:null,base64:lb,base64pad:ub,base64url:hb,base64urlpad:fb});const a0=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}"),pb=a0.reduce((r,e,t)=>(r[t]=e,r),[]),gb=a0.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function mb(r){return r.reduce((e,t)=>(e+=pb[t],e),"")}function vb(r){const e=[];for(const t of r){const n=gb[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}const yb=La({prefix:"\u{1F680}",name:"base256emoji",encode:mb,decode:vb});var wb=Object.freeze({__proto__:null,base256emoji:yb}),bb=l0,c0=128,_b=127,Eb=~_b,xb=Math.pow(2,31);function l0(r,e,t){e=e||[],t=t||0;for(var n=t;r>=xb;)e[t++]=r&255|c0,r/=128;for(;r&Eb;)e[t++]=r&255|c0,r>>>=7;return e[t]=r|0,l0.bytes=t-n+1,e}var Ib=Hl,Db=128,u0=127;function Hl(r,n){var t=0,n=n||0,i=0,a=n,c,u=r.length;do{if(a>=u)throw Hl.bytes=0,new RangeError("Could not decode varint");c=r[a++],t+=i<28?(c&u0)<<i:(c&u0)*Math.pow(2,i),i+=7}while(c>=Db);return Hl.bytes=a-n,t}var Sb=Math.pow(2,7),Ob=Math.pow(2,14),Cb=Math.pow(2,21),$b=Math.pow(2,28),Ab=Math.pow(2,35),Pb=Math.pow(2,42),Tb=Math.pow(2,49),Rb=Math.pow(2,56),Nb=Math.pow(2,63),Lb=function(r){return r<Sb?1:r<Ob?2:r<Cb?3:r<$b?4:r<Ab?5:r<Pb?6:r<Tb?7:r<Rb?8:r<Nb?9:10},Mb={encode:bb,decode:Ib,encodingLength:Lb},h0=Mb;const f0=(r,e,t=0)=>(h0.encode(r,e,t),e),d0=r=>h0.encodingLength(r),Wl=(r,e)=>{const t=e.byteLength,n=d0(r),i=n+d0(t),a=new Uint8Array(i+t);return f0(r,a,0),f0(t,a,n),a.set(e,i),new Ub(r,t,e,a)};class Ub{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}}const p0=({name:r,code:e,encode:t})=>new jb(r,e,t);class jb{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Wl(this.code,t):t.then(n=>Wl(this.code,n))}else throw Error("Unknown type, must be binary type")}}const g0=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),Fb=p0({name:"sha2-256",code:18,encode:g0("SHA-256")}),Bb=p0({name:"sha2-512",code:19,encode:g0("SHA-512")});var kb=Object.freeze({__proto__:null,sha256:Fb,sha512:Bb});const m0=0,qb="identity",v0=s0;var zb=Object.freeze({__proto__:null,identity:{code:m0,name:qb,encode:v0,digest:r=>Wl(m0,v0(r))}});new TextEncoder,new TextDecoder;const y0={...Uw,...Fw,...kw,...zw,...Kw,...rb,...sb,...cb,...db,...wb};({...kb,...zb});function w0(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}const b0=w0("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Kl=w0("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=i0(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),_0={utf8:b0,"utf-8":b0,hex:y0.base16,latin1:Kl,ascii:Kl,binary:Kl,...y0};function Pr(r,e="utf8"){const t=_0[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ql(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function yr(r,e="utf8"){const t=_0[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var E0=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))},Hb=function(){function r(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"}return r}(),Wb=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return r}(),Kb=function(){function r(e,t,n,i){this.name=e,this.version=t,this.os=n,this.bot=i,this.type="bot-device"}return r}(),Vb=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Gb=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Yb=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Zb=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,x0=3,Jb=[["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",Yb]],I0=[["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 Qb(r){return r?D0(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Gb:typeof navigator<"u"?D0(navigator.userAgent):t2()}function Xb(r){return r!==""&&Jb.reduce(function(e,t){var n=t[0],i=t[1];if(e)return e;var a=i.exec(r);return!!a&&[n,a]},!1)}function D0(r){var e=Xb(r);if(!e)return null;var t=e[0],n=e[1];if(t==="searchbot")return new Vb;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<x0&&(i=E0(E0([],i,!0),r2(x0-i.length),!0)):i=[];var a=i.join("."),c=e2(r),u=Zb.exec(r);return u&&u[1]?new Kb(t,a,c,u[1]):new Hb(t,a,c)}function e2(r){for(var e=0,t=I0.length;e<t;e++){var n=I0[e],i=n[0],a=n[1],c=a.exec(r);if(c)return i}return null}function t2(){var r=typeof process<"u"&&process.version;return r?new Wb(process.version.slice(1)):null}function r2(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}var me={};/*! *****************************************************************************
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 Hl=function(r,e){return Hl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Hl(r,e)};function n2(r,e){Hl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Wl=function(){return Wl=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Wl.apply(this,arguments)};function i2(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function s2(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function o2(r,e){return function(t,n){e(t,n,r)}}function a2(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function c2(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function l2(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function u2(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function h2(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Kl(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function D0(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function f2(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(D0(arguments[e]));return r}function d2(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function go(r){return this instanceof go?(this.v=r,this):new go(r)}function p2(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(x){return new Promise(function(S,P){a.push([y,x,S,P])>1||u(y,x)})})}function u(y,x){try{f(n[y](x))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof go?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,x){y(x),a.shift(),a.length&&u(a[0][0],a[0][1])}}function g2(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:go(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function m2(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Kl=="function"?Kl(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function v2(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function y2(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function w2(r){return r&&r.__esModule?r:{default:r}}function b2(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function _2(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var E2=Object.freeze({__proto__:null,__extends:n2,get __assign(){return Wl},__rest:i2,__decorate:s2,__param:o2,__metadata:a2,__awaiter:c2,__generator:l2,__createBinding:u2,__exportStar:h2,__values:Kl,__read:D0,__spread:f2,__spreadArrays:d2,__await:go,__asyncGenerator:p2,__asyncDelegator:g2,__asyncValues:m2,__makeTemplateObject:v2,__importStar:y2,__importDefault:w2,__classPrivateFieldGet:b2,__classPrivateFieldSet:_2}),Ta=Pi(E2),Vl={},mo={},S0;function x2(){if(S0)return mo;S0=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return mo.delay=r,mo}var Ti={},Gl={},Ri={},C0;function I2(){return C0||(C0=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.ONE_THOUSAND=Ri.ONE_HUNDRED=void 0,Ri.ONE_HUNDRED=100,Ri.ONE_THOUSAND=1e3),Ri}var Yl={},O0;function D2(){return O0||(O0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(Yl)),Yl}var $0;function A0(){return $0||($0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ta;e.__exportStar(I2(),r),e.__exportStar(D2(),r)}(Gl)),Gl}var P0;function S2(){if(P0)return Ti;P0=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.fromMiliseconds=Ti.toMiliseconds=void 0;const r=A0();function e(n){return n*r.ONE_THOUSAND}Ti.toMiliseconds=e;function t(n){return Math.floor(n/r.ONE_THOUSAND)}return Ti.fromMiliseconds=t,Ti}var T0;function C2(){return T0||(T0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ta;e.__exportStar(x2(),r),e.__exportStar(S2(),r)}(Vl)),Vl}var ys={},R0;function O2(){if(R0)return ys;R0=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const n=this.get(t);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const i=Date.now()-n.started;this.timestamps.set(t,{started:n.started,elapsed:i})}get(t){const n=this.timestamps.get(t);if(typeof n>"u")throw new Error(`No timestamp found for label: ${t}`);return n}elapsed(t){const n=this.get(t);return n.elapsed||Date.now()-n.started}}return ys.Watch=r,ys.default=r,ys}var Jl={},vo={},N0;function $2(){if(N0)return vo;N0=1,Object.defineProperty(vo,"__esModule",{value:!0}),vo.IWatch=void 0;class r{}return vo.IWatch=r,vo}var L0;function A2(){return L0||(L0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Ta.__exportStar($2(),r)}(Jl)),Jl}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ta;e.__exportStar(C2(),r),e.__exportStar(O2(),r),e.__exportStar(A2(),r),e.__exportStar(A0(),r)})(ye);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.getLocalStorage=bt.getLocalStorageOrThrow=bt.getCrypto=bt.getCryptoOrThrow=M0=bt.getLocation=bt.getLocationOrThrow=Ql=bt.getNavigator=bt.getNavigatorOrThrow=Zl=bt.getDocument=bt.getDocumentOrThrow=bt.getFromWindowOrThrow=bt.getFromWindow=void 0;function Ni(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}bt.getFromWindow=Ni;function ws(r){const e=Ni(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}bt.getFromWindowOrThrow=ws;function P2(){return ws("document")}bt.getDocumentOrThrow=P2;function T2(){return Ni("document")}var Zl=bt.getDocument=T2;function R2(){return ws("navigator")}bt.getNavigatorOrThrow=R2;function N2(){return Ni("navigator")}var Ql=bt.getNavigator=N2;function L2(){return ws("location")}bt.getLocationOrThrow=L2;function M2(){return Ni("location")}var M0=bt.getLocation=M2;function U2(){return ws("crypto")}bt.getCryptoOrThrow=U2;function j2(){return Ni("crypto")}bt.getCrypto=j2;function F2(){return ws("localStorage")}bt.getLocalStorageOrThrow=F2;function B2(){return Ni("localStorage")}bt.getLocalStorage=B2;var Xl={};Object.defineProperty(Xl,"__esModule",{value:!0});var U0=Xl.getWindowMetadata=void 0;const j0=bt;function k2(){let r,e;try{r=j0.getDocumentOrThrow(),e=j0.getLocationOrThrow()}catch{return null}function t(){const w=r.getElementsByTagName("link"),y=[];for(let x=0;x<w.length;x++){const S=w[x],P=S.getAttribute("rel");if(P&&P.toLowerCase().indexOf("icon")>-1){const U=S.getAttribute("href");if(U)if(U.toLowerCase().indexOf("https:")===-1&&U.toLowerCase().indexOf("http:")===-1&&U.indexOf("//")!==0){let j=e.protocol+"//"+e.host;if(U.indexOf("/")===0)j+=U;else{const A=e.pathname.split("/");A.pop();const T=A.join("/");j+=T+"/"+U}y.push(j)}else if(U.indexOf("//")===0){const j=e.protocol+U;y.push(j)}else y.push(U)}}return y}function n(...w){const y=r.getElementsByTagName("meta");for(let x=0;x<y.length;x++){const S=y[x],P=["itemprop","property","name"].map(U=>S.getAttribute(U)).filter(U=>U?w.includes(U):!1);if(P.length&&P){const U=S.getAttribute("content");if(U)return U}}return""}function i(){let w=n("name","og:site_name","og:title","twitter:title");return w||(w=r.title),w}function a(){return n("description","og:description","twitter:description","keywords")}const c=i(),u=a(),f=e.origin,h=t();return{description:u,url:f,icons:h,name:c}}U0=Xl.getWindowMetadata=k2;var yo={},q2=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),F0="%[a-f0-9]{2}",B0=new RegExp("("+F0+")|([^%]+?)","gi"),k0=new RegExp("("+F0+")+","gi");function eu(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),n=r.slice(e);return Array.prototype.concat.call([],eu(t),eu(n))}function z2(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(B0)||[],t=1;t<e.length;t++)r=eu(e,t).join(""),e=r.match(B0)||[];return r}}function H2(r){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},t=k0.exec(r);t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{var n=z2(t[0]);n!==t[0]&&(e[t[0]]=n)}t=k0.exec(r)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),a=0;a<i.length;a++){var c=i[a];r=r.replace(new RegExp(c,"g"),e[c])}return r}var W2=function(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return r=r.replace(/\+/g," "),decodeURIComponent(r)}catch{return H2(r)}},K2=(r,e)=>{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},V2=function(r,e){for(var t={},n=Object.keys(r),i=Array.isArray(e),a=0;a<n.length;a++){var c=n[a],u=r[c];(i?e.indexOf(c)!==-1:e(c,u,r))&&(t[c]=u)}return t};(function(r){const e=q2,t=W2,n=K2,i=V2,a=A=>A==null,c=Symbol("encodeFragmentIdentifier");function u(A){switch(A.arrayFormat){case"index":return T=>(C,$)=>{const E=C.length;return $===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?C:$===null?[...C,[m(T,A),"[",E,"]"].join("")]:[...C,[m(T,A),"[",m(E,A),"]=",m($,A)].join("")]};case"bracket":return T=>(C,$)=>$===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?C:$===null?[...C,[m(T,A),"[]"].join("")]:[...C,[m(T,A),"[]=",m($,A)].join("")];case"colon-list-separator":return T=>(C,$)=>$===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?C:$===null?[...C,[m(T,A),":list="].join("")]:[...C,[m(T,A),":list=",m($,A)].join("")];case"comma":case"separator":case"bracket-separator":{const T=A.arrayFormat==="bracket-separator"?"[]=":"=";return C=>($,E)=>E===void 0||A.skipNull&&E===null||A.skipEmptyString&&E===""?$:(E=E===null?"":E,$.length===0?[[m(C,A),T,m(E,A)].join("")]:[[$,m(E,A)].join(A.arrayFormatSeparator)])}default:return T=>(C,$)=>$===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?C:$===null?[...C,m(T,A)]:[...C,[m(T,A),"=",m($,A)].join("")]}}function f(A){let T;switch(A.arrayFormat){case"index":return(C,$,E)=>{if(T=/\[(\d*)\]$/.exec(C),C=C.replace(/\[\d*\]$/,""),!T){E[C]=$;return}E[C]===void 0&&(E[C]={}),E[C][T[1]]=$};case"bracket":return(C,$,E)=>{if(T=/(\[\])$/.exec(C),C=C.replace(/\[\]$/,""),!T){E[C]=$;return}if(E[C]===void 0){E[C]=[$];return}E[C]=[].concat(E[C],$)};case"colon-list-separator":return(C,$,E)=>{if(T=/(:list)$/.exec(C),C=C.replace(/:list$/,""),!T){E[C]=$;return}if(E[C]===void 0){E[C]=[$];return}E[C]=[].concat(E[C],$)};case"comma":case"separator":return(C,$,E)=>{const d=typeof $=="string"&&$.includes(A.arrayFormatSeparator),b=typeof $=="string"&&!d&&w($,A).includes(A.arrayFormatSeparator);$=b?w($,A):$;const H=d||b?$.split(A.arrayFormatSeparator).map(F=>w(F,A)):$===null?$:w($,A);E[C]=H};case"bracket-separator":return(C,$,E)=>{const d=/(\[\])$/.test(C);if(C=C.replace(/\[\]$/,""),!d){E[C]=$&&w($,A);return}const b=$===null?[]:$.split(A.arrayFormatSeparator).map(H=>w(H,A));if(E[C]===void 0){E[C]=b;return}E[C]=[].concat(E[C],b)};default:return(C,$,E)=>{if(E[C]===void 0){E[C]=$;return}E[C]=[].concat(E[C],$)}}}function h(A){if(typeof A!="string"||A.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(A,T){return T.encode?T.strict?e(A):encodeURIComponent(A):A}function w(A,T){return T.decode?t(A):A}function y(A){return Array.isArray(A)?A.sort():typeof A=="object"?y(Object.keys(A)).sort((T,C)=>Number(T)-Number(C)).map(T=>A[T]):A}function x(A){const T=A.indexOf("#");return T!==-1&&(A=A.slice(0,T)),A}function S(A){let T="";const C=A.indexOf("#");return C!==-1&&(T=A.slice(C)),T}function P(A){A=x(A);const T=A.indexOf("?");return T===-1?"":A.slice(T+1)}function U(A,T){return T.parseNumbers&&!Number.isNaN(Number(A))&&typeof A=="string"&&A.trim()!==""?A=Number(A):T.parseBooleans&&A!==null&&(A.toLowerCase()==="true"||A.toLowerCase()==="false")&&(A=A.toLowerCase()==="true"),A}function j(A,T){T=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},T),h(T.arrayFormatSeparator);const C=f(T),$=Object.create(null);if(typeof A!="string"||(A=A.trim().replace(/^[?#&]/,""),!A))return $;for(const E of A.split("&")){if(E==="")continue;let[d,b]=n(T.decode?E.replace(/\+/g," "):E,"=");b=b===void 0?null:["comma","separator","bracket-separator"].includes(T.arrayFormat)?b:w(b,T),C(w(d,T),b,$)}for(const E of Object.keys($)){const d=$[E];if(typeof d=="object"&&d!==null)for(const b of Object.keys(d))d[b]=U(d[b],T);else $[E]=U(d,T)}return T.sort===!1?$:(T.sort===!0?Object.keys($).sort():Object.keys($).sort(T.sort)).reduce((E,d)=>{const b=$[d];return b&&typeof b=="object"&&!Array.isArray(b)?E[d]=y(b):E[d]=b,E},Object.create(null))}r.extract=P,r.parse=j,r.stringify=(A,T)=>{if(!A)return"";T=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},T),h(T.arrayFormatSeparator);const C=b=>T.skipNull&&a(A[b])||T.skipEmptyString&&A[b]==="",$=u(T),E={};for(const b of Object.keys(A))C(b)||(E[b]=A[b]);const d=Object.keys(E);return T.sort!==!1&&d.sort(T.sort),d.map(b=>{const H=A[b];return H===void 0?"":H===null?m(b,T):Array.isArray(H)?H.length===0&&T.arrayFormat==="bracket-separator"?m(b,T)+"[]":H.reduce($(b),[]).join("&"):m(b,T)+"="+m(H,T)}).filter(b=>b.length>0).join("&")},r.parseUrl=(A,T)=>{T=Object.assign({decode:!0},T);const[C,$]=n(A,"#");return Object.assign({url:C.split("?")[0]||"",query:j(P(A),T)},T&&T.parseFragmentIdentifier&&$?{fragmentIdentifier:w($,T)}:{})},r.stringifyUrl=(A,T)=>{T=Object.assign({encode:!0,strict:!0,[c]:!0},T);const C=x(A.url).split("?")[0]||"",$=r.extract(A.url),E=r.parse($,{sort:!1}),d=Object.assign(E,A.query);let b=r.stringify(d,T);b&&(b=`?${b}`);let H=S(A.url);return A.fragmentIdentifier&&(H=`#${T[c]?m(A.fragmentIdentifier,T):A.fragmentIdentifier}`),`${C}${b}${H}`},r.pick=(A,T,C)=>{C=Object.assign({parseFragmentIdentifier:!0,[c]:!1},C);const{url:$,query:E,fragmentIdentifier:d}=r.parseUrl(A,C);return r.stringifyUrl({url:$,query:i(E,T),fragmentIdentifier:d},C)},r.exclude=(A,T,C)=>{const $=Array.isArray(T)?E=>!T.includes(E):(E,d)=>!T(E,d);return r.pick(A,$,C)}})(yo);const G2={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"}},Y2=":";function J2(r){const[e,t]=r.split(Y2);return{namespace:e,reference:t}}function Z2(r,e=[]){const t=[];return Object.keys(r).forEach(n=>{if(e.length&&!e.includes(n))return;const i=r[n];t.push(...i.accounts)}),t}function q0(r,e){return r.includes(":")?[r]:e.chains||[]}const z0="base10",br="base16",tu="base64pad",ru="utf8",H0=0,Li=1,Q2=0,W0=1,nu=12,iu=32;function X2(){const r=jl.generateKeyPair();return{privateKey:wr(r.secretKey,br),publicKey:wr(r.publicKey,br)}}function su(){const r=vs.randomBytes(iu);return wr(r,br)}function e_(r,e){const t=jl.sharedKey(Tr(r,br),Tr(e,br),!0),n=new pw(Aa.SHA256,t).expand(iu);return wr(n,br)}function t_(r){const e=Aa.hash(Tr(r,br));return wr(e,br)}function bs(r){const e=Aa.hash(Tr(r,ru));return wr(e,br)}function r_(r){return Tr(`${r}`,z0)}function wo(r){return Number(wr(r,z0))}function n_(r){const e=r_(typeof r.type<"u"?r.type:H0);if(wo(e)===Li&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?Tr(r.senderPublicKey,br):void 0,n=typeof r.iv<"u"?Tr(r.iv,br):vs.randomBytes(nu),i=new Pl.ChaCha20Poly1305(Tr(r.symKey,br)).seal(n,Tr(r.message,ru));return s_({type:e,sealed:i,iv:n,senderPublicKey:t})}function i_(r){const e=new Pl.ChaCha20Poly1305(Tr(r.symKey,br)),{sealed:t,iv:n}=Ra(r.encoded),i=e.open(n,t);if(i===null)throw new Error("Failed to decrypt");return wr(i,ru)}function s_(r){if(wo(r.type)===Li){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return wr(Bl([r.type,r.senderPublicKey,r.iv,r.sealed]),tu)}return wr(Bl([r.type,r.iv,r.sealed]),tu)}function Ra(r){const e=Tr(r,tu),t=e.slice(Q2,W0),n=W0;if(wo(t)===Li){const u=n+iu,f=u+nu,h=e.slice(n,u),m=e.slice(u,f),w=e.slice(f);return{type:t,sealed:w,iv:m,senderPublicKey:h}}const i=n+nu,a=e.slice(n,i),c=e.slice(i);return{type:t,sealed:c,iv:a}}function o_(r,e){const t=Ra(r);return K0({type:wo(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?wr(t.senderPublicKey,br):void 0,receiverPublicKey:e?.receiverPublicKey})}function K0(r){const e=r?.type||H0;if(e===Li){if(typeof r?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof r?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r?.senderPublicKey,receiverPublicKey:r?.receiverPublicKey}}function V0(r){return r.type===Li&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}var a_=Object.defineProperty,G0=Object.getOwnPropertySymbols,c_=Object.prototype.hasOwnProperty,l_=Object.prototype.propertyIsEnumerable,Y0=(r,e,t)=>e in r?a_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,J0=(r,e)=>{for(var t in e||(e={}))c_.call(e,t)&&Y0(r,t,e[t]);if(G0)for(var t of G0(e))l_.call(e,t)&&Y0(r,t,e[t]);return r};const u_="ReactNative",Hr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},h_="js";function ou(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function _s(){return!Zl()&&!!Ql()&&navigator.product===u_}function Es(){return!ou()&&!!Ql()&&!!Zl()}function bo(){return _s()?Hr.reactNative:ou()?Hr.node:Es()?Hr.browser:Hr.unknown}function f_(){var r;try{return _s()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(r=global.Application)==null?void 0:r.applicationId:void 0}catch{return}}function d_(r,e){let t=yo.parse(r);return t=J0(J0({},t),e),r=yo.stringify(t),r}function p_(){return U0()||{name:"",description:"",url:"",icons:[""]}}function g_(){if(bo()===Hr.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:t,Version:n}=global.Platform;return[t,n].join("-")}const r=Qb();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function m_(){var r;const e=bo();return e===Hr.browser?[e,((r=M0())==null?void 0:r.host)||"unknown"].join(":"):e}function v_(r,e,t){const n=g_(),i=m_();return[[r,e].join("-"),[h_,t].join("-"),n,i].join("/")}function y_({protocol:r,version:e,relayUrl:t,sdkVersion:n,auth:i,projectId:a,useOnCloseEvent:c,bundleId:u}){const f=t.split("?"),h=v_(r,e,n),m={auth:i,ua:h,projectId:a,useOnCloseEvent:c||void 0,origin:u||void 0},w=d_(f[1]||"",m);return f[0]+"?"+w}function Mi(r,e){return r.filter(t=>e.includes(t)).length===r.length}function Z0(r){return Object.fromEntries(r.entries())}function Q0(r){return new Map(Object.entries(r))}function xs(r=ye.FIVE_MINUTES,e){const t=ye.toMiliseconds(r||ye.FIVE_MINUTES);let n,i,a;return{resolve:c=>{a&&n&&(clearTimeout(a),n(c))},reject:c=>{a&&i&&(clearTimeout(a),i(c))},done:()=>new Promise((c,u)=>{a=setTimeout(()=>{u(new Error(e))},t),n=c,i=u})}}function _o(r,e,t){return new Promise(async(n,i)=>{const a=setTimeout(()=>i(new Error(t)),e);try{const c=await r;n(c)}catch(c){i(c)}clearTimeout(a)})}function X0(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.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: ${r}`)}function w_(r){return X0("topic",r)}function b_(r){return X0("id",r)}function ep(r){const[e,t]=r.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")n.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))n.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return n}function Wr(r,e){return ye.fromMiliseconds((e||Date.now())+ye.toMiliseconds(r))}function ii(r){return Date.now()>=ye.toMiliseconds(r)}function qt(r,e){return`${r}${e?`:${e}`:""}`}function au(r=[],e=[]){return[...new Set([...r,...e])]}async function __({id:r,topic:e,wcDeepLink:t}){try{if(!t)return;const n=typeof t=="string"?JSON.parse(t):t;let i=n?.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const a=`${i}/wc?requestId=${r}&sessionTopic=${e}`,c=bo();c===Hr.browser?a.startsWith("https://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,"_self","noreferrer noopener"):c===Hr.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(a)}catch(n){console.error(n)}}async function E_(r,e){try{return await r.getItem(e)||(Es()?localStorage.getItem(e):void 0)}catch(t){console.error(t)}}const x_="irn";function cu(r){return r?.relay||{protocol:x_}}function Na(r){const e=G2[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var I_=Object.defineProperty,D_=Object.defineProperties,S_=Object.getOwnPropertyDescriptors,tp=Object.getOwnPropertySymbols,C_=Object.prototype.hasOwnProperty,O_=Object.prototype.propertyIsEnumerable,rp=(r,e,t)=>e in r?I_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$_=(r,e)=>{for(var t in e||(e={}))C_.call(e,t)&&rp(r,t,e[t]);if(tp)for(var t of tp(e))O_.call(e,t)&&rp(r,t,e[t]);return r},A_=(r,e)=>D_(r,S_(e));function P_(r,e="-"){const t={},n="relay"+e;return Object.keys(r).forEach(i=>{if(i.startsWith(n)){const a=i.replace(n,""),c=r[i];t[a]=c}}),t}function np(r){r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,n=r.substring(0,e),i=r.substring(e+1,t).split("@"),a=typeof t<"u"?r.substring(t):"",c=yo.parse(a);return{protocol:n,topic:T_(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:P_(c),expiryTimestamp:c.expiryTimestamp?parseInt(c.expiryTimestamp,10):void 0}}function T_(r){return r.startsWith("//")?r.substring(2):r}function R_(r,e="-"){const t="relay",n={};return Object.keys(r).forEach(i=>{const a=t+e+i;r[i]&&(n[a]=r[i])}),n}function N_(r){return`${r.protocol}:${r.topic}@${r.version}?`+yo.stringify(A_($_({symKey:r.symKey},R_(r.relay)),{expiryTimestamp:r.expiryTimestamp}))}function Is(r){const e=[];return r.forEach(t=>{const[n,i]=t.split(":");e.push(`${n}:${i}`)}),e}function L_(r){const e=[];return Object.values(r).forEach(t=>{e.push(...Is(t.accounts))}),e}function M_(r,e){const t=[];return Object.values(r).forEach(n=>{Is(n.accounts).includes(e)&&t.push(...n.methods)}),t}function U_(r,e){const t=[];return Object.values(r).forEach(n=>{Is(n.accounts).includes(e)&&t.push(...n.events)}),t}function lu(r){return r.includes(":")}function Eo(r){return lu(r)?r.split(":")[0]:r}const j_={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}},F_={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 ue(r,e){const{message:t,code:n}=F_[r];return{message:e?`${t} ${e}`:t,code:n}}function It(r,e){const{message:t,code:n}=j_[r];return{message:e?`${t} ${e}`:t,code:n}}function En(r,e){return Array.isArray(r)?typeof e<"u"&&r.length?r.every(e):!0:!1}function xo(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function _r(r){return typeof r>"u"}function ir(r,e){return e&&_r(r)?!0:typeof r=="string"&&!!r.trim().length}function uu(r,e){return e&&_r(r)?!0:typeof r=="number"&&!isNaN(r)}function B_(r,e){const{requiredNamespaces:t}=e,n=Object.keys(r.namespaces),i=Object.keys(t);let a=!0;return Mi(i,n)?(n.forEach(c=>{const{accounts:u,methods:f,events:h}=r.namespaces[c],m=Is(u),w=t[c];(!Mi(q0(c,w),m)||!Mi(w.methods,f)||!Mi(w.events,h))&&(a=!1)}),a):!1}function La(r){return ir(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function k_(r){if(ir(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&La(t)}}return!1}function q_(r){if(ir(r,!1))try{return typeof new URL(r)<"u"}catch{return!1}return!1}function z_(r){var e;return(e=r?.proposer)==null?void 0:e.publicKey}function H_(r){return r?.topic}function W_(r,e){let t=null;return ir(r?.publicKey,!1)||(t=ue("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function ip(r){let e=!0;return En(r)?r.length&&(e=r.every(t=>ir(t,!1))):e=!1,e}function K_(r,e,t){let n=null;return En(e)&&e.length?e.forEach(i=>{n||La(i)||(n=It("UNSUPPORTED_CHAINS",`${t}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):La(r)||(n=It("UNSUPPORTED_CHAINS",`${t}, 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 V_(r,e,t){let n=null;return Object.entries(r).forEach(([i,a])=>{if(n)return;const c=K_(i,q0(i,a),`${e} ${t}`);c&&(n=c)}),n}function G_(r,e){let t=null;return En(r)?r.forEach(n=>{t||k_(n)||(t=It("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):t=It("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function Y_(r,e){let t=null;return Object.values(r).forEach(n=>{if(t)return;const i=G_(n?.accounts,`${e} namespace`);i&&(t=i)}),t}function J_(r,e){let t=null;return ip(r?.methods)?ip(r?.events)||(t=It("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=It("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function sp(r,e){let t=null;return Object.values(r).forEach(n=>{if(t)return;const i=J_(n,`${e}, namespace`);i&&(t=i)}),t}function Z_(r,e,t){let n=null;if(r&&xo(r)){const i=sp(r,e);i&&(n=i);const a=V_(r,e,t);a&&(n=a)}else n=ue("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return n}function hu(r,e){let t=null;if(r&&xo(r)){const n=sp(r,e);n&&(t=n);const i=Y_(r,e);i&&(t=i)}else t=ue("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function op(r){return ir(r.protocol,!0)}function Q_(r,e){let t=!1;return e&&!r?t=!0:r&&En(r)&&r.length&&r.forEach(n=>{t=op(n)}),t}function X_(r){return typeof r=="number"}function Rr(r){return typeof r<"u"&&typeof r!==null}function e3(r){return!(!r||typeof r!="object"||!r.code||!uu(r.code,!1)||!r.message||!ir(r.message,!1))}function t3(r){return!(_r(r)||!ir(r.method,!1))}function r3(r){return!(_r(r)||_r(r.result)&&_r(r.error)||!uu(r.id,!1)||!ir(r.jsonrpc,!1))}function n3(r){return!(_r(r)||!ir(r.name,!1))}function ap(r,e){return!(!La(e)||!L_(r).includes(e))}function i3(r,e,t){return ir(t,!1)?M_(r,e).includes(t):!1}function s3(r,e,t){return ir(t,!1)?U_(r,e).includes(t):!1}function cp(r,e,t){let n=null;const i=o3(r),a=a3(e),c=Object.keys(i),u=Object.keys(a),f=lp(Object.keys(r)),h=lp(Object.keys(e)),m=f.filter(w=>!h.includes(w));return m.length&&(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces.
14
+ ***************************************************************************** */var Vl=function(r,e){return Vl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Vl(r,e)};function n2(r,e){Vl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Gl=function(){return Gl=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Gl.apply(this,arguments)};function i2(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function s2(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function o2(r,e){return function(t,n){e(t,n,r)}}function a2(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function c2(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function l2(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function u2(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function h2(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Yl(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function S0(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function f2(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(S0(arguments[e]));return r}function d2(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function yo(r){return this instanceof yo?(this.v=r,this):new yo(r)}function p2(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(_){return new Promise(function(S,P){a.push([y,_,S,P])>1||u(y,_)})})}function u(y,_){try{f(n[y](_))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof yo?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,_){y(_),a.shift(),a.length&&u(a[0][0],a[0][1])}}function g2(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:yo(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function m2(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Yl=="function"?Yl(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function v2(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function y2(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function w2(r){return r&&r.__esModule?r:{default:r}}function b2(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function _2(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var E2=Object.freeze({__proto__:null,__extends:n2,get __assign(){return Gl},__rest:i2,__decorate:s2,__param:o2,__metadata:a2,__awaiter:c2,__generator:l2,__createBinding:u2,__exportStar:h2,__values:Yl,__read:S0,__spread:f2,__spreadArrays:d2,__await:yo,__asyncGenerator:p2,__asyncDelegator:g2,__asyncValues:m2,__makeTemplateObject:v2,__importStar:y2,__importDefault:w2,__classPrivateFieldGet:b2,__classPrivateFieldSet:_2}),Ma=Pi(E2),Zl={},wo={},O0;function x2(){if(O0)return wo;O0=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return wo.delay=r,wo}var Ti={},Jl={},Ri={},C0;function I2(){return C0||(C0=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.ONE_THOUSAND=Ri.ONE_HUNDRED=void 0,Ri.ONE_HUNDRED=100,Ri.ONE_THOUSAND=1e3),Ri}var Ql={},$0;function D2(){return $0||($0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(Ql)),Ql}var A0;function P0(){return A0||(A0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ma;e.__exportStar(I2(),r),e.__exportStar(D2(),r)}(Jl)),Jl}var T0;function S2(){if(T0)return Ti;T0=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.fromMiliseconds=Ti.toMiliseconds=void 0;const r=P0();function e(n){return n*r.ONE_THOUSAND}Ti.toMiliseconds=e;function t(n){return Math.floor(n/r.ONE_THOUSAND)}return Ti.fromMiliseconds=t,Ti}var R0;function O2(){return R0||(R0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ma;e.__exportStar(x2(),r),e.__exportStar(S2(),r)}(Zl)),Zl}var ws={},N0;function C2(){if(N0)return ws;N0=1,Object.defineProperty(ws,"__esModule",{value:!0}),ws.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const n=this.get(t);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const i=Date.now()-n.started;this.timestamps.set(t,{started:n.started,elapsed:i})}get(t){const n=this.timestamps.get(t);if(typeof n>"u")throw new Error(`No timestamp found for label: ${t}`);return n}elapsed(t){const n=this.get(t);return n.elapsed||Date.now()-n.started}}return ws.Watch=r,ws.default=r,ws}var Xl={},bo={},L0;function $2(){if(L0)return bo;L0=1,Object.defineProperty(bo,"__esModule",{value:!0}),bo.IWatch=void 0;class r{}return bo.IWatch=r,bo}var M0;function A2(){return M0||(M0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Ma.__exportStar($2(),r)}(Xl)),Xl}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ma;e.__exportStar(O2(),r),e.__exportStar(C2(),r),e.__exportStar(A2(),r),e.__exportStar(P0(),r)})(me);var _t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.getLocalStorage=_t.getLocalStorageOrThrow=_t.getCrypto=_t.getCryptoOrThrow=U0=_t.getLocation=_t.getLocationOrThrow=tu=_t.getNavigator=_t.getNavigatorOrThrow=eu=_t.getDocument=_t.getDocumentOrThrow=_t.getFromWindowOrThrow=_t.getFromWindow=void 0;function Ni(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}_t.getFromWindow=Ni;function bs(r){const e=Ni(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}_t.getFromWindowOrThrow=bs;function P2(){return bs("document")}_t.getDocumentOrThrow=P2;function T2(){return Ni("document")}var eu=_t.getDocument=T2;function R2(){return bs("navigator")}_t.getNavigatorOrThrow=R2;function N2(){return Ni("navigator")}var tu=_t.getNavigator=N2;function L2(){return bs("location")}_t.getLocationOrThrow=L2;function M2(){return Ni("location")}var U0=_t.getLocation=M2;function U2(){return bs("crypto")}_t.getCryptoOrThrow=U2;function j2(){return Ni("crypto")}_t.getCrypto=j2;function F2(){return bs("localStorage")}_t.getLocalStorageOrThrow=F2;function B2(){return Ni("localStorage")}_t.getLocalStorage=B2;var ru={};Object.defineProperty(ru,"__esModule",{value:!0});var j0=ru.getWindowMetadata=void 0;const F0=_t;function k2(){let r,e;try{r=F0.getDocumentOrThrow(),e=F0.getLocationOrThrow()}catch{return null}function t(){const w=r.getElementsByTagName("link"),y=[];for(let _=0;_<w.length;_++){const S=w[_],P=S.getAttribute("rel");if(P&&P.toLowerCase().indexOf("icon")>-1){const j=S.getAttribute("href");if(j)if(j.toLowerCase().indexOf("https:")===-1&&j.toLowerCase().indexOf("http:")===-1&&j.indexOf("//")!==0){let U=e.protocol+"//"+e.host;if(j.indexOf("/")===0)U+=j;else{const A=e.pathname.split("/");A.pop();const T=A.join("/");U+=T+"/"+j}y.push(U)}else if(j.indexOf("//")===0){const U=e.protocol+j;y.push(U)}else y.push(j)}}return y}function n(...w){const y=r.getElementsByTagName("meta");for(let _=0;_<y.length;_++){const S=y[_],P=["itemprop","property","name"].map(j=>S.getAttribute(j)).filter(j=>j?w.includes(j):!1);if(P.length&&P){const j=S.getAttribute("content");if(j)return j}}return""}function i(){let w=n("name","og:site_name","og:title","twitter:title");return w||(w=r.title),w}function a(){return n("description","og:description","twitter:description","keywords")}const c=i(),u=a(),f=e.origin,h=t();return{description:u,url:f,icons:h,name:c}}j0=ru.getWindowMetadata=k2;var _o={},q2=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),B0="%[a-f0-9]{2}",k0=new RegExp("("+B0+")|([^%]+?)","gi"),q0=new RegExp("("+B0+")+","gi");function nu(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),n=r.slice(e);return Array.prototype.concat.call([],nu(t),nu(n))}function z2(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(k0)||[],t=1;t<e.length;t++)r=nu(e,t).join(""),e=r.match(k0)||[];return r}}function H2(r){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},t=q0.exec(r);t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{var n=z2(t[0]);n!==t[0]&&(e[t[0]]=n)}t=q0.exec(r)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),a=0;a<i.length;a++){var c=i[a];r=r.replace(new RegExp(c,"g"),e[c])}return r}var W2=function(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return r=r.replace(/\+/g," "),decodeURIComponent(r)}catch{return H2(r)}},K2=(r,e)=>{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},V2=function(r,e){for(var t={},n=Object.keys(r),i=Array.isArray(e),a=0;a<n.length;a++){var c=n[a],u=r[c];(i?e.indexOf(c)!==-1:e(c,u,r))&&(t[c]=u)}return t};(function(r){const e=q2,t=W2,n=K2,i=V2,a=A=>A==null,c=Symbol("encodeFragmentIdentifier");function u(A){switch(A.arrayFormat){case"index":return T=>(O,$)=>{const x=O.length;return $===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?O:$===null?[...O,[m(T,A),"[",x,"]"].join("")]:[...O,[m(T,A),"[",m(x,A),"]=",m($,A)].join("")]};case"bracket":return T=>(O,$)=>$===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?O:$===null?[...O,[m(T,A),"[]"].join("")]:[...O,[m(T,A),"[]=",m($,A)].join("")];case"colon-list-separator":return T=>(O,$)=>$===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?O:$===null?[...O,[m(T,A),":list="].join("")]:[...O,[m(T,A),":list=",m($,A)].join("")];case"comma":case"separator":case"bracket-separator":{const T=A.arrayFormat==="bracket-separator"?"[]=":"=";return O=>($,x)=>x===void 0||A.skipNull&&x===null||A.skipEmptyString&&x===""?$:(x=x===null?"":x,$.length===0?[[m(O,A),T,m(x,A)].join("")]:[[$,m(x,A)].join(A.arrayFormatSeparator)])}default:return T=>(O,$)=>$===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?O:$===null?[...O,m(T,A)]:[...O,[m(T,A),"=",m($,A)].join("")]}}function f(A){let T;switch(A.arrayFormat){case"index":return(O,$,x)=>{if(T=/\[(\d*)\]$/.exec(O),O=O.replace(/\[\d*\]$/,""),!T){x[O]=$;return}x[O]===void 0&&(x[O]={}),x[O][T[1]]=$};case"bracket":return(O,$,x)=>{if(T=/(\[\])$/.exec(O),O=O.replace(/\[\]$/,""),!T){x[O]=$;return}if(x[O]===void 0){x[O]=[$];return}x[O]=[].concat(x[O],$)};case"colon-list-separator":return(O,$,x)=>{if(T=/(:list)$/.exec(O),O=O.replace(/:list$/,""),!T){x[O]=$;return}if(x[O]===void 0){x[O]=[$];return}x[O]=[].concat(x[O],$)};case"comma":case"separator":return(O,$,x)=>{const d=typeof $=="string"&&$.includes(A.arrayFormatSeparator),b=typeof $=="string"&&!d&&w($,A).includes(A.arrayFormatSeparator);$=b?w($,A):$;const H=d||b?$.split(A.arrayFormatSeparator).map(F=>w(F,A)):$===null?$:w($,A);x[O]=H};case"bracket-separator":return(O,$,x)=>{const d=/(\[\])$/.test(O);if(O=O.replace(/\[\]$/,""),!d){x[O]=$&&w($,A);return}const b=$===null?[]:$.split(A.arrayFormatSeparator).map(H=>w(H,A));if(x[O]===void 0){x[O]=b;return}x[O]=[].concat(x[O],b)};default:return(O,$,x)=>{if(x[O]===void 0){x[O]=$;return}x[O]=[].concat(x[O],$)}}}function h(A){if(typeof A!="string"||A.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(A,T){return T.encode?T.strict?e(A):encodeURIComponent(A):A}function w(A,T){return T.decode?t(A):A}function y(A){return Array.isArray(A)?A.sort():typeof A=="object"?y(Object.keys(A)).sort((T,O)=>Number(T)-Number(O)).map(T=>A[T]):A}function _(A){const T=A.indexOf("#");return T!==-1&&(A=A.slice(0,T)),A}function S(A){let T="";const O=A.indexOf("#");return O!==-1&&(T=A.slice(O)),T}function P(A){A=_(A);const T=A.indexOf("?");return T===-1?"":A.slice(T+1)}function j(A,T){return T.parseNumbers&&!Number.isNaN(Number(A))&&typeof A=="string"&&A.trim()!==""?A=Number(A):T.parseBooleans&&A!==null&&(A.toLowerCase()==="true"||A.toLowerCase()==="false")&&(A=A.toLowerCase()==="true"),A}function U(A,T){T=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},T),h(T.arrayFormatSeparator);const O=f(T),$=Object.create(null);if(typeof A!="string"||(A=A.trim().replace(/^[?#&]/,""),!A))return $;for(const x of A.split("&")){if(x==="")continue;let[d,b]=n(T.decode?x.replace(/\+/g," "):x,"=");b=b===void 0?null:["comma","separator","bracket-separator"].includes(T.arrayFormat)?b:w(b,T),O(w(d,T),b,$)}for(const x of Object.keys($)){const d=$[x];if(typeof d=="object"&&d!==null)for(const b of Object.keys(d))d[b]=j(d[b],T);else $[x]=j(d,T)}return T.sort===!1?$:(T.sort===!0?Object.keys($).sort():Object.keys($).sort(T.sort)).reduce((x,d)=>{const b=$[d];return b&&typeof b=="object"&&!Array.isArray(b)?x[d]=y(b):x[d]=b,x},Object.create(null))}r.extract=P,r.parse=U,r.stringify=(A,T)=>{if(!A)return"";T=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},T),h(T.arrayFormatSeparator);const O=b=>T.skipNull&&a(A[b])||T.skipEmptyString&&A[b]==="",$=u(T),x={};for(const b of Object.keys(A))O(b)||(x[b]=A[b]);const d=Object.keys(x);return T.sort!==!1&&d.sort(T.sort),d.map(b=>{const H=A[b];return H===void 0?"":H===null?m(b,T):Array.isArray(H)?H.length===0&&T.arrayFormat==="bracket-separator"?m(b,T)+"[]":H.reduce($(b),[]).join("&"):m(b,T)+"="+m(H,T)}).filter(b=>b.length>0).join("&")},r.parseUrl=(A,T)=>{T=Object.assign({decode:!0},T);const[O,$]=n(A,"#");return Object.assign({url:O.split("?")[0]||"",query:U(P(A),T)},T&&T.parseFragmentIdentifier&&$?{fragmentIdentifier:w($,T)}:{})},r.stringifyUrl=(A,T)=>{T=Object.assign({encode:!0,strict:!0,[c]:!0},T);const O=_(A.url).split("?")[0]||"",$=r.extract(A.url),x=r.parse($,{sort:!1}),d=Object.assign(x,A.query);let b=r.stringify(d,T);b&&(b=`?${b}`);let H=S(A.url);return A.fragmentIdentifier&&(H=`#${T[c]?m(A.fragmentIdentifier,T):A.fragmentIdentifier}`),`${O}${b}${H}`},r.pick=(A,T,O)=>{O=Object.assign({parseFragmentIdentifier:!0,[c]:!1},O);const{url:$,query:x,fragmentIdentifier:d}=r.parseUrl(A,O);return r.stringifyUrl({url:$,query:i(x,T),fragmentIdentifier:d},O)},r.exclude=(A,T,O)=>{const $=Array.isArray(T)?x=>!T.includes(x):(x,d)=>!T(x,d);return r.pick(A,$,O)}})(_o);const G2={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"}},Y2=":";function Z2(r){const[e,t]=r.split(Y2);return{namespace:e,reference:t}}function J2(r,e=[]){const t=[];return Object.keys(r).forEach(n=>{if(e.length&&!e.includes(n))return;const i=r[n];t.push(...i.accounts)}),t}function z0(r,e){return r.includes(":")?[r]:e.chains||[]}const H0="base10",wr="base16",iu="base64pad",su="utf8",W0=0,Li=1,Q2=0,K0=1,ou=12,au=32;function X2(){const r=kl.generateKeyPair();return{privateKey:yr(r.secretKey,wr),publicKey:yr(r.publicKey,wr)}}function cu(){const r=ys.randomBytes(au);return yr(r,wr)}function e_(r,e){const t=kl.sharedKey(Pr(r,wr),Pr(e,wr),!0),n=new pw(Na.SHA256,t).expand(au);return yr(n,wr)}function t_(r){const e=Na.hash(Pr(r,wr));return yr(e,wr)}function _s(r){const e=Na.hash(Pr(r,su));return yr(e,wr)}function r_(r){return Pr(`${r}`,H0)}function Eo(r){return Number(yr(r,H0))}function n_(r){const e=r_(typeof r.type<"u"?r.type:W0);if(Eo(e)===Li&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?Pr(r.senderPublicKey,wr):void 0,n=typeof r.iv<"u"?Pr(r.iv,wr):ys.randomBytes(ou),i=new Nl.ChaCha20Poly1305(Pr(r.symKey,wr)).seal(n,Pr(r.message,su));return s_({type:e,sealed:i,iv:n,senderPublicKey:t})}function i_(r){const e=new Nl.ChaCha20Poly1305(Pr(r.symKey,wr)),{sealed:t,iv:n}=Ua(r.encoded),i=e.open(n,t);if(i===null)throw new Error("Failed to decrypt");return yr(i,su)}function s_(r){if(Eo(r.type)===Li){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return yr(zl([r.type,r.senderPublicKey,r.iv,r.sealed]),iu)}return yr(zl([r.type,r.iv,r.sealed]),iu)}function Ua(r){const e=Pr(r,iu),t=e.slice(Q2,K0),n=K0;if(Eo(t)===Li){const u=n+au,f=u+ou,h=e.slice(n,u),m=e.slice(u,f),w=e.slice(f);return{type:t,sealed:w,iv:m,senderPublicKey:h}}const i=n+ou,a=e.slice(n,i),c=e.slice(i);return{type:t,sealed:c,iv:a}}function o_(r,e){const t=Ua(r);return V0({type:Eo(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?yr(t.senderPublicKey,wr):void 0,receiverPublicKey:e?.receiverPublicKey})}function V0(r){const e=r?.type||W0;if(e===Li){if(typeof r?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof r?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r?.senderPublicKey,receiverPublicKey:r?.receiverPublicKey}}function G0(r){return r.type===Li&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}var a_=Object.defineProperty,Y0=Object.getOwnPropertySymbols,c_=Object.prototype.hasOwnProperty,l_=Object.prototype.propertyIsEnumerable,Z0=(r,e,t)=>e in r?a_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,J0=(r,e)=>{for(var t in e||(e={}))c_.call(e,t)&&Z0(r,t,e[t]);if(Y0)for(var t of Y0(e))l_.call(e,t)&&Z0(r,t,e[t]);return r};const u_="ReactNative",zr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},h_="js";function xo(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Es(){return!eu()&&!!tu()&&navigator.product===u_}function xs(){return!xo()&&!!tu()&&!!eu()}function Io(){return Es()?zr.reactNative:xo()?zr.node:xs()?zr.browser:zr.unknown}function f_(){var r;try{return Es()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(r=global.Application)==null?void 0:r.applicationId:void 0}catch{return}}function d_(r,e){let t=_o.parse(r);return t=J0(J0({},t),e),r=_o.stringify(t),r}function p_(){return j0()||{name:"",description:"",url:"",icons:[""]}}function g_(){if(Io()===zr.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:t,Version:n}=global.Platform;return[t,n].join("-")}const r=Qb();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function m_(){var r;const e=Io();return e===zr.browser?[e,((r=U0())==null?void 0:r.host)||"unknown"].join(":"):e}function v_(r,e,t){const n=g_(),i=m_();return[[r,e].join("-"),[h_,t].join("-"),n,i].join("/")}function y_({protocol:r,version:e,relayUrl:t,sdkVersion:n,auth:i,projectId:a,useOnCloseEvent:c,bundleId:u}){const f=t.split("?"),h=v_(r,e,n),m={auth:i,ua:h,projectId:a,useOnCloseEvent:c||void 0,origin:u||void 0},w=d_(f[1]||"",m);return f[0]+"?"+w}function Mi(r,e){return r.filter(t=>e.includes(t)).length===r.length}function Q0(r){return Object.fromEntries(r.entries())}function X0(r){return new Map(Object.entries(r))}function Is(r=me.FIVE_MINUTES,e){const t=me.toMiliseconds(r||me.FIVE_MINUTES);let n,i,a;return{resolve:c=>{a&&n&&(clearTimeout(a),n(c))},reject:c=>{a&&i&&(clearTimeout(a),i(c))},done:()=>new Promise((c,u)=>{a=setTimeout(()=>{u(new Error(e))},t),n=c,i=u})}}function Do(r,e,t){return new Promise(async(n,i)=>{const a=setTimeout(()=>i(new Error(t)),e);try{const c=await r;n(c)}catch(c){i(c)}clearTimeout(a)})}function ep(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.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: ${r}`)}function w_(r){return ep("topic",r)}function b_(r){return ep("id",r)}function tp(r){const[e,t]=r.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")n.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))n.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return n}function Hr(r,e){return me.fromMiliseconds((e||Date.now())+me.toMiliseconds(r))}function ii(r){return Date.now()>=me.toMiliseconds(r)}function gt(r,e){return`${r}${e?`:${e}`:""}`}function lu(r=[],e=[]){return[...new Set([...r,...e])]}async function __({id:r,topic:e,wcDeepLink:t}){try{if(!t)return;const n=typeof t=="string"?JSON.parse(t):t;let i=n?.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const a=`${i}/wc?requestId=${r}&sessionTopic=${e}`,c=Io();c===zr.browser?a.startsWith("https://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,"_self","noreferrer noopener"):c===zr.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(a)}catch(n){console.error(n)}}async function E_(r,e){try{return await r.getItem(e)||(xs()?localStorage.getItem(e):void 0)}catch(t){console.error(t)}}const x_="irn";function uu(r){return r?.relay||{protocol:x_}}function ja(r){const e=G2[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var I_=Object.defineProperty,D_=Object.defineProperties,S_=Object.getOwnPropertyDescriptors,rp=Object.getOwnPropertySymbols,O_=Object.prototype.hasOwnProperty,C_=Object.prototype.propertyIsEnumerable,np=(r,e,t)=>e in r?I_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$_=(r,e)=>{for(var t in e||(e={}))O_.call(e,t)&&np(r,t,e[t]);if(rp)for(var t of rp(e))C_.call(e,t)&&np(r,t,e[t]);return r},A_=(r,e)=>D_(r,S_(e));function P_(r,e="-"){const t={},n="relay"+e;return Object.keys(r).forEach(i=>{if(i.startsWith(n)){const a=i.replace(n,""),c=r[i];t[a]=c}}),t}function ip(r){r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,n=r.substring(0,e),i=r.substring(e+1,t).split("@"),a=typeof t<"u"?r.substring(t):"",c=_o.parse(a);return{protocol:n,topic:T_(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:P_(c),expiryTimestamp:c.expiryTimestamp?parseInt(c.expiryTimestamp,10):void 0}}function T_(r){return r.startsWith("//")?r.substring(2):r}function R_(r,e="-"){const t="relay",n={};return Object.keys(r).forEach(i=>{const a=t+e+i;r[i]&&(n[a]=r[i])}),n}function N_(r){return`${r.protocol}:${r.topic}@${r.version}?`+_o.stringify(A_($_({symKey:r.symKey},R_(r.relay)),{expiryTimestamp:r.expiryTimestamp}))}function Ds(r){const e=[];return r.forEach(t=>{const[n,i]=t.split(":");e.push(`${n}:${i}`)}),e}function L_(r){const e=[];return Object.values(r).forEach(t=>{e.push(...Ds(t.accounts))}),e}function M_(r,e){const t=[];return Object.values(r).forEach(n=>{Ds(n.accounts).includes(e)&&t.push(...n.methods)}),t}function U_(r,e){const t=[];return Object.values(r).forEach(n=>{Ds(n.accounts).includes(e)&&t.push(...n.events)}),t}function hu(r){return r.includes(":")}function So(r){return hu(r)?r.split(":")[0]:r}const j_={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}},F_={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 ue(r,e){const{message:t,code:n}=F_[r];return{message:e?`${t} ${e}`:t,code:n}}function xt(r,e){const{message:t,code:n}=j_[r];return{message:e?`${t} ${e}`:t,code:n}}function En(r,e){return Array.isArray(r)?typeof e<"u"&&r.length?r.every(e):!0:!1}function Oo(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function br(r){return typeof r>"u"}function ir(r,e){return e&&br(r)?!0:typeof r=="string"&&!!r.trim().length}function fu(r,e){return e&&br(r)?!0:typeof r=="number"&&!isNaN(r)}function B_(r,e){const{requiredNamespaces:t}=e,n=Object.keys(r.namespaces),i=Object.keys(t);let a=!0;return Mi(i,n)?(n.forEach(c=>{const{accounts:u,methods:f,events:h}=r.namespaces[c],m=Ds(u),w=t[c];(!Mi(z0(c,w),m)||!Mi(w.methods,f)||!Mi(w.events,h))&&(a=!1)}),a):!1}function Fa(r){return ir(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function k_(r){if(ir(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&Fa(t)}}return!1}function q_(r){if(ir(r,!1))try{return typeof new URL(r)<"u"}catch{return!1}return!1}function z_(r){var e;return(e=r?.proposer)==null?void 0:e.publicKey}function H_(r){return r?.topic}function W_(r,e){let t=null;return ir(r?.publicKey,!1)||(t=ue("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function sp(r){let e=!0;return En(r)?r.length&&(e=r.every(t=>ir(t,!1))):e=!1,e}function K_(r,e,t){let n=null;return En(e)&&e.length?e.forEach(i=>{n||Fa(i)||(n=xt("UNSUPPORTED_CHAINS",`${t}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):Fa(r)||(n=xt("UNSUPPORTED_CHAINS",`${t}, 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 V_(r,e,t){let n=null;return Object.entries(r).forEach(([i,a])=>{if(n)return;const c=K_(i,z0(i,a),`${e} ${t}`);c&&(n=c)}),n}function G_(r,e){let t=null;return En(r)?r.forEach(n=>{t||k_(n)||(t=xt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):t=xt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function Y_(r,e){let t=null;return Object.values(r).forEach(n=>{if(t)return;const i=G_(n?.accounts,`${e} namespace`);i&&(t=i)}),t}function Z_(r,e){let t=null;return sp(r?.methods)?sp(r?.events)||(t=xt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=xt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function op(r,e){let t=null;return Object.values(r).forEach(n=>{if(t)return;const i=Z_(n,`${e}, namespace`);i&&(t=i)}),t}function J_(r,e,t){let n=null;if(r&&Oo(r)){const i=op(r,e);i&&(n=i);const a=V_(r,e,t);a&&(n=a)}else n=ue("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return n}function du(r,e){let t=null;if(r&&Oo(r)){const n=op(r,e);n&&(t=n);const i=Y_(r,e);i&&(t=i)}else t=ue("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function ap(r){return ir(r.protocol,!0)}function Q_(r,e){let t=!1;return e&&!r?t=!0:r&&En(r)&&r.length&&r.forEach(n=>{t=ap(n)}),t}function X_(r){return typeof r=="number"}function Tr(r){return typeof r<"u"&&typeof r!==null}function e3(r){return!(!r||typeof r!="object"||!r.code||!fu(r.code,!1)||!r.message||!ir(r.message,!1))}function t3(r){return!(br(r)||!ir(r.method,!1))}function r3(r){return!(br(r)||br(r.result)&&br(r.error)||!fu(r.id,!1)||!ir(r.jsonrpc,!1))}function n3(r){return!(br(r)||!ir(r.name,!1))}function cp(r,e){return!(!Fa(e)||!L_(r).includes(e))}function i3(r,e,t){return ir(t,!1)?M_(r,e).includes(t):!1}function s3(r,e,t){return ir(t,!1)?U_(r,e).includes(t):!1}function lp(r,e,t){let n=null;const i=o3(r),a=a3(e),c=Object.keys(i),u=Object.keys(a),f=up(Object.keys(r)),h=up(Object.keys(e)),m=f.filter(w=>!h.includes(w));return m.length&&(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces.
15
15
  Required: ${m.toString()}
16
16
  Received: ${Object.keys(e).toString()}`)),Mi(c,u)||(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces.
17
17
  Required: ${c.toString()}
18
- Approved: ${u.toString()}`)),Object.keys(e).forEach(w=>{if(!w.includes(":")||n)return;const y=Is(e[w].accounts);y.includes(w)||(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${w}
18
+ Approved: ${u.toString()}`)),Object.keys(e).forEach(w=>{if(!w.includes(":")||n)return;const y=Ds(e[w].accounts);y.includes(w)||(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${w}
19
19
  Required: ${w}
20
- Approved: ${y.toString()}`))}),c.forEach(w=>{n||(Mi(i[w].methods,a[w].methods)?Mi(i[w].events,a[w].events)||(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${w}`)):n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${w}`))}),n}function o3(r){const e={};return Object.keys(r).forEach(t=>{var n;t.includes(":")?e[t]=r[t]:(n=r[t].chains)==null||n.forEach(i=>{e[i]={methods:r[t].methods,events:r[t].events}})}),e}function lp(r){return[...new Set(r.map(e=>e.includes(":")?e.split(":")[0]:e))]}function a3(r){const e={};return Object.keys(r).forEach(t=>{if(t.includes(":"))e[t]=r[t];else{const n=Is(r[t].accounts);n?.forEach(i=>{e[i]={accounts:r[t].accounts.filter(a=>a.includes(`${i}:`)),methods:r[t].methods,events:r[t].events}})}}),e}function c3(r,e){return uu(r,!1)&&r<=e.max&&r>=e.min}function up(){const r=bo();return new Promise(e=>{switch(r){case Hr.browser:e(l3());break;case Hr.reactNative:e(u3());break;case Hr.node:e(h3());break;default:e(!0)}})}function l3(){return Es()&&navigator?.onLine}async function u3(){if(_s()&&typeof global<"u"&&global!=null&&global.NetInfo){const r=await(global==null?void 0:global.NetInfo.fetch());return r?.isConnected}return!0}function h3(){return!0}function f3(r){switch(bo()){case Hr.browser:d3(r);break;case Hr.reactNative:p3(r);break}}function d3(r){!_s()&&Es()&&(window.addEventListener("online",()=>r(!0)),window.addEventListener("offline",()=>r(!1)))}function p3(r){_s()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>r(e?.isConnected))}const fu={};class Ma{static get(e){return fu[e]}static set(e,t){fu[e]=t}static delete(e){delete fu[e]}}const g3=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,m3=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,v3=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function y3(r,e){if(r==="__proto__"||r==="constructor"&&e&&typeof e=="object"&&"prototype"in e){w3(r);return}return e}function w3(r){console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)}function Ua(r,e={}){if(typeof r!="string")return r;const t=r.trim();if(r[0]==='"'&&r.at(-1)==='"'&&!r.includes("\\"))return t.slice(1,-1);if(t.length<=9){const n=t.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!v3.test(r)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return r}try{if(g3.test(r)||m3.test(r)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(r,y3)}return JSON.parse(r)}catch(n){if(e.strict)throw n;return r}}function b3(r){return!r||typeof r.then!="function"?Promise.resolve(r):r}function sr(r,...e){try{return b3(r(...e))}catch(t){return Promise.reject(t)}}function _3(r){const e=typeof r;return r===null||e!=="object"&&e!=="function"}function E3(r){const e=Object.getPrototypeOf(r);return!e||e.isPrototypeOf(Object)}function ja(r){if(_3(r))return String(r);if(E3(r)||Array.isArray(r))return JSON.stringify(r);if(typeof r.toJSON=="function")return ja(r.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function hp(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const du="base64:";function x3(r){if(typeof r=="string")return r;hp();const e=Buffer.from(r).toString("base64");return du+e}function I3(r){return typeof r!="string"||!r.startsWith(du)?r:(hp(),Buffer.from(r.slice(du.length),"base64"))}function Nr(r){return r?r.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function D3(...r){return Nr(r.join(":"))}function Fa(r){return r=Nr(r),r?r+":":""}function zT(r){return r}const S3="memory",C3=()=>{const r=new Map;return{name:S3,options:{},hasItem(e){return r.has(e)},getItem(e){return r.get(e)||null},getItemRaw(e){return r.get(e)||null},setItem(e,t){r.set(e,t)},setItemRaw(e,t){r.set(e,t)},removeItem(e){r.delete(e)},getKeys(){return Array.from(r.keys())},clear(){r.clear()},dispose(){r.clear()}}};function O3(r={}){const e={mounts:{"":r.driver||C3()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=h=>{for(const m of e.mountpoints)if(h.startsWith(m))return{base:m,relativeKey:h.slice(m.length),driver:e.mounts[m]};return{base:"",relativeKey:h,driver:e.mounts[""]}},n=(h,m)=>e.mountpoints.filter(w=>w.startsWith(h)||m&&h.startsWith(w)).map(w=>({relativeBase:h.length>w.length?h.slice(w.length):void 0,mountpoint:w,driver:e.mounts[w]})),i=(h,m)=>{if(e.watching){m=Nr(m);for(const w of e.watchListeners)w(h,m)}},a=async()=>{if(!e.watching){e.watching=!0;for(const h in e.mounts)e.unwatch[h]=await fp(e.mounts[h],i,h)}},c=async()=>{if(e.watching){for(const h in e.unwatch)await e.unwatch[h]();e.unwatch={},e.watching=!1}},u=(h,m,w)=>{const y=new Map,x=S=>{let P=y.get(S.base);return P||(P={driver:S.driver,base:S.base,items:[]},y.set(S.base,P)),P};for(const S of h){const P=typeof S=="string",U=Nr(P?S:S.key),j=P?void 0:S.value,A=P||!S.options?m:{...m,...S.options},T=t(U);x(T).items.push({key:U,value:j,relativeKey:T.relativeKey,options:A})}return Promise.all([...y.values()].map(S=>w(S))).then(S=>S.flat())},f={hasItem(h,m={}){h=Nr(h);const{relativeKey:w,driver:y}=t(h);return sr(y.hasItem,w,m)},getItem(h,m={}){h=Nr(h);const{relativeKey:w,driver:y}=t(h);return sr(y.getItem,w,m).then(x=>Ua(x))},getItems(h,m){return u(h,m,w=>w.driver.getItems?sr(w.driver.getItems,w.items.map(y=>({key:y.relativeKey,options:y.options})),m).then(y=>y.map(x=>({key:D3(w.base,x.key),value:Ua(x.value)}))):Promise.all(w.items.map(y=>sr(w.driver.getItem,y.relativeKey,y.options).then(x=>({key:y.key,value:Ua(x)})))))},getItemRaw(h,m={}){h=Nr(h);const{relativeKey:w,driver:y}=t(h);return y.getItemRaw?sr(y.getItemRaw,w,m):sr(y.getItem,w,m).then(x=>I3(x))},async setItem(h,m,w={}){if(m===void 0)return f.removeItem(h);h=Nr(h);const{relativeKey:y,driver:x}=t(h);x.setItem&&(await sr(x.setItem,y,ja(m),w),x.watch||i("update",h))},async setItems(h,m){await u(h,m,async w=>{w.driver.setItems&&await sr(w.driver.setItems,w.items.map(y=>({key:y.relativeKey,value:ja(y.value),options:y.options})),m),w.driver.setItem&&await Promise.all(w.items.map(y=>sr(w.driver.setItem,y.relativeKey,ja(y.value),y.options)))})},async setItemRaw(h,m,w={}){if(m===void 0)return f.removeItem(h,w);h=Nr(h);const{relativeKey:y,driver:x}=t(h);if(x.setItemRaw)await sr(x.setItemRaw,y,m,w);else if(x.setItem)await sr(x.setItem,y,x3(m),w);else return;x.watch||i("update",h)},async removeItem(h,m={}){typeof m=="boolean"&&(m={removeMeta:m}),h=Nr(h);const{relativeKey:w,driver:y}=t(h);y.removeItem&&(await sr(y.removeItem,w,m),(m.removeMeta||m.removeMata)&&await sr(y.removeItem,w+"$",m),y.watch||i("remove",h))},async getMeta(h,m={}){typeof m=="boolean"&&(m={nativeOnly:m}),h=Nr(h);const{relativeKey:w,driver:y}=t(h),x=Object.create(null);if(y.getMeta&&Object.assign(x,await sr(y.getMeta,w,m)),!m.nativeOnly){const S=await sr(y.getItem,w+"$",m).then(P=>Ua(P));S&&typeof S=="object"&&(typeof S.atime=="string"&&(S.atime=new Date(S.atime)),typeof S.mtime=="string"&&(S.mtime=new Date(S.mtime)),Object.assign(x,S))}return x},setMeta(h,m,w={}){return this.setItem(h+"$",m,w)},removeMeta(h,m={}){return this.removeItem(h+"$",m)},async getKeys(h,m={}){h=Fa(h);const w=n(h,!0);let y=[];const x=[];for(const S of w){const U=(await sr(S.driver.getKeys,S.relativeBase,m)).map(j=>S.mountpoint+Nr(j)).filter(j=>!y.some(A=>j.startsWith(A)));x.push(...U),y=[S.mountpoint,...y.filter(j=>!j.startsWith(S.mountpoint))]}return h?x.filter(S=>S.startsWith(h)&&!S.endsWith("$")):x.filter(S=>!S.endsWith("$"))},async clear(h,m={}){h=Fa(h),await Promise.all(n(h,!1).map(async w=>{if(w.driver.clear)return sr(w.driver.clear,w.relativeBase,m);if(w.driver.removeItem){const y=await w.driver.getKeys(w.relativeBase||"",m);return Promise.all(y.map(x=>w.driver.removeItem(x,m)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(h=>dp(h)))},async watch(h){return await a(),e.watchListeners.push(h),async()=>{e.watchListeners=e.watchListeners.filter(m=>m!==h),e.watchListeners.length===0&&await c()}},async unwatch(){e.watchListeners=[],await c()},mount(h,m){if(h=Fa(h),h&&e.mounts[h])throw new Error(`already mounted at ${h}`);return h&&(e.mountpoints.push(h),e.mountpoints.sort((w,y)=>y.length-w.length)),e.mounts[h]=m,e.watching&&Promise.resolve(fp(m,i,h)).then(w=>{e.unwatch[h]=w}).catch(console.error),f},async unmount(h,m=!0){h=Fa(h),!(!h||!e.mounts[h])&&(e.watching&&h in e.unwatch&&(e.unwatch[h](),delete e.unwatch[h]),m&&await dp(e.mounts[h]),e.mountpoints=e.mountpoints.filter(w=>w!==h),delete e.mounts[h])},getMount(h=""){h=Nr(h)+":";const m=t(h);return{driver:m.driver,base:m.base}},getMounts(h="",m={}){return h=Nr(h),n(h,m.parents).map(y=>({driver:y.driver,base:y.mountpoint}))}};return f}function fp(r,e,t){return r.watch?r.watch((n,i)=>e(n,t+i)):()=>{}}async function dp(r){typeof r.dispose=="function"&&await sr(r.dispose)}function Ui(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function pp(r,e){const t=indexedDB.open(r);t.onupgradeneeded=()=>t.result.createObjectStore(e);const n=Ui(t);return(i,a)=>n.then(c=>a(c.transaction(e,i).objectStore(e)))}let pu;function Io(){return pu||(pu=pp("keyval-store","keyval")),pu}function gp(r,e=Io()){return e("readonly",t=>Ui(t.get(r)))}function $3(r,e,t=Io()){return t("readwrite",n=>(n.put(e,r),Ui(n.transaction)))}function A3(r,e=Io()){return e("readwrite",t=>(t.delete(r),Ui(t.transaction)))}function P3(r=Io()){return r("readwrite",e=>(e.clear(),Ui(e.transaction)))}function T3(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Ui(r.transaction)}function R3(r=Io()){return r("readonly",e=>{if(e.getAllKeys)return Ui(e.getAllKeys());const t=[];return T3(e,n=>t.push(n.key)).then(()=>t)})}const N3=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),L3=r=>{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,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Do(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return L3(r)}catch{return r}}function ji(r){return typeof r=="string"?r:N3(r)||""}const M3="idb-keyval";var U3=(r={})=>{const e=r.base&&r.base.length>0?`${r.base}:`:"",t=i=>e+i;let n;return r.dbName&&r.storeName&&(n=pp(r.dbName,r.storeName)),{name:M3,options:r,async hasItem(i){return!(typeof await gp(t(i),n)>"u")},async getItem(i){return await gp(t(i),n)??null},setItem(i,a){return $3(t(i),a,n)},removeItem(i){return A3(t(i),n)},getKeys(){return R3(n)},clear(){return P3(n)}}};const j3="WALLET_CONNECT_V2_INDEXED_DB",F3="keyvaluestorage";class B3{constructor(){this.indexedDb=O3({driver:U3({dbName:j3,storeName:F3})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,ji(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ba={exports:{}};(function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,n){this[t]=String(n)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(n){t[n]=void 0,delete t[n]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof gu<"u"&&gu.localStorage?Ba.exports=gu.localStorage:typeof window<"u"&&window.localStorage?Ba.exports=window.localStorage:Ba.exports=new e})();function k3(r){var e;return[r[0],Do((e=r[1])!=null?e:"")]}class q3{constructor(){this.localStorage=Ba.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(k3)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return Do(t)}async setItem(e,t){this.localStorage.setItem(e,ji(t))}async removeItem(e){this.localStorage.removeItem(e)}}const z3="wc_storage_version",mp=1,H3=async(r,e,t)=>{const n=z3,i=await e.getItem(n);if(i&&i>=mp){t(e);return}const a=await r.getKeys();if(!a.length){t(e);return}const c=[];for(;a.length;){const u=a.shift();if(!u)continue;const f=u.toLowerCase();if(f.includes("wc@")||f.includes("walletconnect")||f.includes("wc_")||f.includes("wallet_connect")){const h=await r.getItem(u);await e.setItem(u,h),c.push(u)}}await e.setItem(n,mp),t(e),W3(r,c)},W3=async(r,e)=>{e.length&&e.forEach(async t=>{await r.removeItem(t)})};class K3{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new q3;this.storage=e;try{const t=new B3;H3(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var Ds={};/*! *****************************************************************************
20
+ Approved: ${y.toString()}`))}),c.forEach(w=>{n||(Mi(i[w].methods,a[w].methods)?Mi(i[w].events,a[w].events)||(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${w}`)):n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${w}`))}),n}function o3(r){const e={};return Object.keys(r).forEach(t=>{var n;t.includes(":")?e[t]=r[t]:(n=r[t].chains)==null||n.forEach(i=>{e[i]={methods:r[t].methods,events:r[t].events}})}),e}function up(r){return[...new Set(r.map(e=>e.includes(":")?e.split(":")[0]:e))]}function a3(r){const e={};return Object.keys(r).forEach(t=>{if(t.includes(":"))e[t]=r[t];else{const n=Ds(r[t].accounts);n?.forEach(i=>{e[i]={accounts:r[t].accounts.filter(a=>a.includes(`${i}:`)),methods:r[t].methods,events:r[t].events}})}}),e}function c3(r,e){return fu(r,!1)&&r<=e.max&&r>=e.min}function hp(){const r=Io();return new Promise(e=>{switch(r){case zr.browser:e(l3());break;case zr.reactNative:e(u3());break;case zr.node:e(h3());break;default:e(!0)}})}function l3(){return xs()&&navigator?.onLine}async function u3(){if(Es()&&typeof global<"u"&&global!=null&&global.NetInfo){const r=await(global==null?void 0:global.NetInfo.fetch());return r?.isConnected}return!0}function h3(){return!0}function f3(r){switch(Io()){case zr.browser:d3(r);break;case zr.reactNative:p3(r);break}}function d3(r){!Es()&&xs()&&(window.addEventListener("online",()=>r(!0)),window.addEventListener("offline",()=>r(!1)))}function p3(r){Es()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>r(e?.isConnected))}const pu={};class Co{static get(e){return pu[e]}static set(e,t){pu[e]=t}static delete(e){delete pu[e]}}const g3=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,m3=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,v3=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function y3(r,e){if(r==="__proto__"||r==="constructor"&&e&&typeof e=="object"&&"prototype"in e){w3(r);return}return e}function w3(r){console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)}function Ba(r,e={}){if(typeof r!="string")return r;const t=r.trim();if(r[0]==='"'&&r.at(-1)==='"'&&!r.includes("\\"))return t.slice(1,-1);if(t.length<=9){const n=t.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!v3.test(r)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return r}try{if(g3.test(r)||m3.test(r)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(r,y3)}return JSON.parse(r)}catch(n){if(e.strict)throw n;return r}}function b3(r){return!r||typeof r.then!="function"?Promise.resolve(r):r}function sr(r,...e){try{return b3(r(...e))}catch(t){return Promise.reject(t)}}function _3(r){const e=typeof r;return r===null||e!=="object"&&e!=="function"}function E3(r){const e=Object.getPrototypeOf(r);return!e||e.isPrototypeOf(Object)}function ka(r){if(_3(r))return String(r);if(E3(r)||Array.isArray(r))return JSON.stringify(r);if(typeof r.toJSON=="function")return ka(r.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function fp(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const gu="base64:";function x3(r){if(typeof r=="string")return r;fp();const e=Buffer.from(r).toString("base64");return gu+e}function I3(r){return typeof r!="string"||!r.startsWith(gu)?r:(fp(),Buffer.from(r.slice(gu.length),"base64"))}function Rr(r){return r?r.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function D3(...r){return Rr(r.join(":"))}function qa(r){return r=Rr(r),r?r+":":""}function zT(r){return r}const S3="memory",O3=()=>{const r=new Map;return{name:S3,options:{},hasItem(e){return r.has(e)},getItem(e){return r.get(e)||null},getItemRaw(e){return r.get(e)||null},setItem(e,t){r.set(e,t)},setItemRaw(e,t){r.set(e,t)},removeItem(e){r.delete(e)},getKeys(){return Array.from(r.keys())},clear(){r.clear()},dispose(){r.clear()}}};function C3(r={}){const e={mounts:{"":r.driver||O3()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=h=>{for(const m of e.mountpoints)if(h.startsWith(m))return{base:m,relativeKey:h.slice(m.length),driver:e.mounts[m]};return{base:"",relativeKey:h,driver:e.mounts[""]}},n=(h,m)=>e.mountpoints.filter(w=>w.startsWith(h)||m&&h.startsWith(w)).map(w=>({relativeBase:h.length>w.length?h.slice(w.length):void 0,mountpoint:w,driver:e.mounts[w]})),i=(h,m)=>{if(e.watching){m=Rr(m);for(const w of e.watchListeners)w(h,m)}},a=async()=>{if(!e.watching){e.watching=!0;for(const h in e.mounts)e.unwatch[h]=await dp(e.mounts[h],i,h)}},c=async()=>{if(e.watching){for(const h in e.unwatch)await e.unwatch[h]();e.unwatch={},e.watching=!1}},u=(h,m,w)=>{const y=new Map,_=S=>{let P=y.get(S.base);return P||(P={driver:S.driver,base:S.base,items:[]},y.set(S.base,P)),P};for(const S of h){const P=typeof S=="string",j=Rr(P?S:S.key),U=P?void 0:S.value,A=P||!S.options?m:{...m,...S.options},T=t(j);_(T).items.push({key:j,value:U,relativeKey:T.relativeKey,options:A})}return Promise.all([...y.values()].map(S=>w(S))).then(S=>S.flat())},f={hasItem(h,m={}){h=Rr(h);const{relativeKey:w,driver:y}=t(h);return sr(y.hasItem,w,m)},getItem(h,m={}){h=Rr(h);const{relativeKey:w,driver:y}=t(h);return sr(y.getItem,w,m).then(_=>Ba(_))},getItems(h,m){return u(h,m,w=>w.driver.getItems?sr(w.driver.getItems,w.items.map(y=>({key:y.relativeKey,options:y.options})),m).then(y=>y.map(_=>({key:D3(w.base,_.key),value:Ba(_.value)}))):Promise.all(w.items.map(y=>sr(w.driver.getItem,y.relativeKey,y.options).then(_=>({key:y.key,value:Ba(_)})))))},getItemRaw(h,m={}){h=Rr(h);const{relativeKey:w,driver:y}=t(h);return y.getItemRaw?sr(y.getItemRaw,w,m):sr(y.getItem,w,m).then(_=>I3(_))},async setItem(h,m,w={}){if(m===void 0)return f.removeItem(h);h=Rr(h);const{relativeKey:y,driver:_}=t(h);_.setItem&&(await sr(_.setItem,y,ka(m),w),_.watch||i("update",h))},async setItems(h,m){await u(h,m,async w=>{w.driver.setItems&&await sr(w.driver.setItems,w.items.map(y=>({key:y.relativeKey,value:ka(y.value),options:y.options})),m),w.driver.setItem&&await Promise.all(w.items.map(y=>sr(w.driver.setItem,y.relativeKey,ka(y.value),y.options)))})},async setItemRaw(h,m,w={}){if(m===void 0)return f.removeItem(h,w);h=Rr(h);const{relativeKey:y,driver:_}=t(h);if(_.setItemRaw)await sr(_.setItemRaw,y,m,w);else if(_.setItem)await sr(_.setItem,y,x3(m),w);else return;_.watch||i("update",h)},async removeItem(h,m={}){typeof m=="boolean"&&(m={removeMeta:m}),h=Rr(h);const{relativeKey:w,driver:y}=t(h);y.removeItem&&(await sr(y.removeItem,w,m),(m.removeMeta||m.removeMata)&&await sr(y.removeItem,w+"$",m),y.watch||i("remove",h))},async getMeta(h,m={}){typeof m=="boolean"&&(m={nativeOnly:m}),h=Rr(h);const{relativeKey:w,driver:y}=t(h),_=Object.create(null);if(y.getMeta&&Object.assign(_,await sr(y.getMeta,w,m)),!m.nativeOnly){const S=await sr(y.getItem,w+"$",m).then(P=>Ba(P));S&&typeof S=="object"&&(typeof S.atime=="string"&&(S.atime=new Date(S.atime)),typeof S.mtime=="string"&&(S.mtime=new Date(S.mtime)),Object.assign(_,S))}return _},setMeta(h,m,w={}){return this.setItem(h+"$",m,w)},removeMeta(h,m={}){return this.removeItem(h+"$",m)},async getKeys(h,m={}){h=qa(h);const w=n(h,!0);let y=[];const _=[];for(const S of w){const j=(await sr(S.driver.getKeys,S.relativeBase,m)).map(U=>S.mountpoint+Rr(U)).filter(U=>!y.some(A=>U.startsWith(A)));_.push(...j),y=[S.mountpoint,...y.filter(U=>!U.startsWith(S.mountpoint))]}return h?_.filter(S=>S.startsWith(h)&&!S.endsWith("$")):_.filter(S=>!S.endsWith("$"))},async clear(h,m={}){h=qa(h),await Promise.all(n(h,!1).map(async w=>{if(w.driver.clear)return sr(w.driver.clear,w.relativeBase,m);if(w.driver.removeItem){const y=await w.driver.getKeys(w.relativeBase||"",m);return Promise.all(y.map(_=>w.driver.removeItem(_,m)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(h=>pp(h)))},async watch(h){return await a(),e.watchListeners.push(h),async()=>{e.watchListeners=e.watchListeners.filter(m=>m!==h),e.watchListeners.length===0&&await c()}},async unwatch(){e.watchListeners=[],await c()},mount(h,m){if(h=qa(h),h&&e.mounts[h])throw new Error(`already mounted at ${h}`);return h&&(e.mountpoints.push(h),e.mountpoints.sort((w,y)=>y.length-w.length)),e.mounts[h]=m,e.watching&&Promise.resolve(dp(m,i,h)).then(w=>{e.unwatch[h]=w}).catch(console.error),f},async unmount(h,m=!0){h=qa(h),!(!h||!e.mounts[h])&&(e.watching&&h in e.unwatch&&(e.unwatch[h](),delete e.unwatch[h]),m&&await pp(e.mounts[h]),e.mountpoints=e.mountpoints.filter(w=>w!==h),delete e.mounts[h])},getMount(h=""){h=Rr(h)+":";const m=t(h);return{driver:m.driver,base:m.base}},getMounts(h="",m={}){return h=Rr(h),n(h,m.parents).map(y=>({driver:y.driver,base:y.mountpoint}))}};return f}function dp(r,e,t){return r.watch?r.watch((n,i)=>e(n,t+i)):()=>{}}async function pp(r){typeof r.dispose=="function"&&await sr(r.dispose)}function Ui(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function gp(r,e){const t=indexedDB.open(r);t.onupgradeneeded=()=>t.result.createObjectStore(e);const n=Ui(t);return(i,a)=>n.then(c=>a(c.transaction(e,i).objectStore(e)))}let mu;function $o(){return mu||(mu=gp("keyval-store","keyval")),mu}function mp(r,e=$o()){return e("readonly",t=>Ui(t.get(r)))}function $3(r,e,t=$o()){return t("readwrite",n=>(n.put(e,r),Ui(n.transaction)))}function A3(r,e=$o()){return e("readwrite",t=>(t.delete(r),Ui(t.transaction)))}function P3(r=$o()){return r("readwrite",e=>(e.clear(),Ui(e.transaction)))}function T3(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Ui(r.transaction)}function R3(r=$o()){return r("readonly",e=>{if(e.getAllKeys)return Ui(e.getAllKeys());const t=[];return T3(e,n=>t.push(n.key)).then(()=>t)})}const N3=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),L3=r=>{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,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Ao(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return L3(r)}catch{return r}}function ji(r){return typeof r=="string"?r:N3(r)||""}const M3="idb-keyval";var U3=(r={})=>{const e=r.base&&r.base.length>0?`${r.base}:`:"",t=i=>e+i;let n;return r.dbName&&r.storeName&&(n=gp(r.dbName,r.storeName)),{name:M3,options:r,async hasItem(i){return!(typeof await mp(t(i),n)>"u")},async getItem(i){return await mp(t(i),n)??null},setItem(i,a){return $3(t(i),a,n)},removeItem(i){return A3(t(i),n)},getKeys(){return R3(n)},clear(){return P3(n)}}};const j3="WALLET_CONNECT_V2_INDEXED_DB",F3="keyvaluestorage";class B3{constructor(){this.indexedDb=C3({driver:U3({dbName:j3,storeName:F3})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,ji(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var vu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},za={exports:{}};(function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,n){this[t]=String(n)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(n){t[n]=void 0,delete t[n]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof vu<"u"&&vu.localStorage?za.exports=vu.localStorage:typeof window<"u"&&window.localStorage?za.exports=window.localStorage:za.exports=new e})();function k3(r){var e;return[r[0],Ao((e=r[1])!=null?e:"")]}class q3{constructor(){this.localStorage=za.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(k3)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return Ao(t)}async setItem(e,t){this.localStorage.setItem(e,ji(t))}async removeItem(e){this.localStorage.removeItem(e)}}const z3="wc_storage_version",vp=1,H3=async(r,e,t)=>{const n=z3,i=await e.getItem(n);if(i&&i>=vp){t(e);return}const a=await r.getKeys();if(!a.length){t(e);return}const c=[];for(;a.length;){const u=a.shift();if(!u)continue;const f=u.toLowerCase();if(f.includes("wc@")||f.includes("walletconnect")||f.includes("wc_")||f.includes("wallet_connect")){const h=await r.getItem(u);await e.setItem(u,h),c.push(u)}}await e.setItem(n,vp),t(e),W3(r,c)},W3=async(r,e)=>{e.length&&e.forEach(async t=>{await r.removeItem(t)})};class K3{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new q3;this.storage=e;try{const t=new B3;H3(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var Ss={};/*! *****************************************************************************
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 mu=function(r,e){return mu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},mu(r,e)};function V3(r,e){mu(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var vu=function(){return vu=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},vu.apply(this,arguments)};function G3(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function Y3(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function J3(r,e){return function(t,n){e(t,n,r)}}function Z3(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Q3(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function X3(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function e5(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function t5(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function yu(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function r5(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(vp(arguments[e]));return r}function n5(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function So(r){return this instanceof So?(this.v=r,this):new So(r)}function i5(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(x){return new Promise(function(S,P){a.push([y,x,S,P])>1||u(y,x)})})}function u(y,x){try{f(n[y](x))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof So?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,x){y(x),a.shift(),a.length&&u(a[0][0],a[0][1])}}function s5(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:So(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function o5(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof yu=="function"?yu(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function a5(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function c5(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function l5(r){return r&&r.__esModule?r:{default:r}}function u5(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function h5(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var f5=Object.freeze({__proto__:null,__extends:V3,get __assign(){return vu},__rest:G3,__decorate:Y3,__param:J3,__metadata:Z3,__awaiter:Q3,__generator:X3,__createBinding:e5,__exportStar:t5,__values:yu,__read:vp,__spread:r5,__spreadArrays:n5,__await:So,__asyncGenerator:i5,__asyncDelegator:s5,__asyncValues:o5,__makeTemplateObject:a5,__importStar:c5,__importDefault:l5,__classPrivateFieldGet:u5,__classPrivateFieldSet:h5}),ka=Pi(f5),Co={},wu={},Oo={};class Fi{}var d5=Object.freeze({__proto__:null,IEvents:Fi}),p5=Pi(d5),yp;function g5(){if(yp)return Oo;yp=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.IHeartBeat=void 0;const r=p5;class e extends r.IEvents{constructor(n){super()}}return Oo.IHeartBeat=e,Oo}var wp;function bp(){return wp||(wp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),ka.__exportStar(g5(),r)}(wu)),wu}var bu={},Bi={},_p;function m5(){if(_p)return Bi;_p=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.HEARTBEAT_EVENTS=Bi.HEARTBEAT_INTERVAL=void 0;const r=ye;return Bi.HEARTBEAT_INTERVAL=r.FIVE_SECONDS,Bi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Bi}var Ep;function xp(){return Ep||(Ep=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),ka.__exportStar(m5(),r)}(bu)),bu}var Ip;function v5(){if(Ip)return Co;Ip=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.HeartBeat=void 0;const r=ka,e=lr.exports,t=ye,n=bp(),i=xp();class a extends n.IHeartBeat{constructor(u){super(u),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=u?.interval||i.HEARTBEAT_INTERVAL}static init(u){return r.__awaiter(this,void 0,void 0,function*(){const f=new a(u);return yield f.init(),f})}init(){return r.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(u,f){this.events.on(u,f)}once(u,f){this.events.once(u,f)}off(u,f){this.events.off(u,f)}removeListener(u,f){this.events.removeListener(u,f)}initialize(){return r.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),t.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return Co.HeartBeat=a,Co}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=ka;e.__exportStar(v5(),r),e.__exportStar(bp(),r),e.__exportStar(xp(),r)})(Ds);var Xe={};/*! *****************************************************************************
33
+ ***************************************************************************** */var yu=function(r,e){return yu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},yu(r,e)};function V3(r,e){yu(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var wu=function(){return wu=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},wu.apply(this,arguments)};function G3(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function Y3(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function Z3(r,e){return function(t,n){e(t,n,r)}}function J3(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Q3(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function X3(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function e5(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function t5(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function bu(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function yp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function r5(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(yp(arguments[e]));return r}function n5(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function Po(r){return this instanceof Po?(this.v=r,this):new Po(r)}function i5(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(_){return new Promise(function(S,P){a.push([y,_,S,P])>1||u(y,_)})})}function u(y,_){try{f(n[y](_))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof Po?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,_){y(_),a.shift(),a.length&&u(a[0][0],a[0][1])}}function s5(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:Po(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function o5(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof bu=="function"?bu(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function a5(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function c5(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function l5(r){return r&&r.__esModule?r:{default:r}}function u5(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function h5(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var f5=Object.freeze({__proto__:null,__extends:V3,get __assign(){return wu},__rest:G3,__decorate:Y3,__param:Z3,__metadata:J3,__awaiter:Q3,__generator:X3,__createBinding:e5,__exportStar:t5,__values:bu,__read:yp,__spread:r5,__spreadArrays:n5,__await:Po,__asyncGenerator:i5,__asyncDelegator:s5,__asyncValues:o5,__makeTemplateObject:a5,__importStar:c5,__importDefault:l5,__classPrivateFieldGet:u5,__classPrivateFieldSet:h5}),Ha=Pi(f5),To={},_u={},Ro={};class Fi{}var d5=Object.freeze({__proto__:null,IEvents:Fi}),p5=Pi(d5),wp;function g5(){if(wp)return Ro;wp=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.IHeartBeat=void 0;const r=p5;class e extends r.IEvents{constructor(n){super()}}return Ro.IHeartBeat=e,Ro}var bp;function _p(){return bp||(bp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Ha.__exportStar(g5(),r)}(_u)),_u}var Eu={},Bi={},Ep;function m5(){if(Ep)return Bi;Ep=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.HEARTBEAT_EVENTS=Bi.HEARTBEAT_INTERVAL=void 0;const r=me;return Bi.HEARTBEAT_INTERVAL=r.FIVE_SECONDS,Bi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Bi}var xp;function Ip(){return xp||(xp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Ha.__exportStar(m5(),r)}(Eu)),Eu}var Dp;function v5(){if(Dp)return To;Dp=1,Object.defineProperty(To,"__esModule",{value:!0}),To.HeartBeat=void 0;const r=Ha,e=lr.exports,t=me,n=_p(),i=Ip();class a extends n.IHeartBeat{constructor(u){super(u),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=u?.interval||i.HEARTBEAT_INTERVAL}static init(u){return r.__awaiter(this,void 0,void 0,function*(){const f=new a(u);return yield f.init(),f})}init(){return r.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(u,f){this.events.on(u,f)}once(u,f){this.events.once(u,f)}off(u,f){this.events.off(u,f)}removeListener(u,f){this.events.removeListener(u,f)}initialize(){return r.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),t.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return To.HeartBeat=a,To}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ha;e.__exportStar(v5(),r),e.__exportStar(_p(),r),e.__exportStar(Ip(),r)})(Ss);var Xe={};/*! *****************************************************************************
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 _u=function(r,e){return _u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},_u(r,e)};function y5(r,e){_u(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Eu=function(){return Eu=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Eu.apply(this,arguments)};function w5(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function b5(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function _5(r,e){return function(t,n){e(t,n,r)}}function E5(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function x5(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function I5(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function D5(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function S5(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function xu(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function C5(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Dp(arguments[e]));return r}function O5(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function $o(r){return this instanceof $o?(this.v=r,this):new $o(r)}function $5(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(x){return new Promise(function(S,P){a.push([y,x,S,P])>1||u(y,x)})})}function u(y,x){try{f(n[y](x))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof $o?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,x){y(x),a.shift(),a.length&&u(a[0][0],a[0][1])}}function A5(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:$o(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function P5(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof xu=="function"?xu(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function T5(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function R5(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function N5(r){return r&&r.__esModule?r:{default:r}}function L5(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function M5(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var U5=Object.freeze({__proto__:null,__extends:y5,get __assign(){return Eu},__rest:w5,__decorate:b5,__param:_5,__metadata:E5,__awaiter:x5,__generator:I5,__createBinding:D5,__exportStar:S5,__values:xu,__read:Dp,__spread:C5,__spreadArrays:O5,__await:$o,__asyncGenerator:$5,__asyncDelegator:A5,__asyncValues:P5,__makeTemplateObject:T5,__importStar:R5,__importDefault:N5,__classPrivateFieldGet:L5,__classPrivateFieldSet:M5}),j5=Pi(U5),Iu,Sp;function F5(){if(Sp)return Iu;Sp=1;function r(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}Iu=e;function e(t,n,i){var a=i&&i.stringify||r,c=1;if(typeof t=="object"&&t!==null){var u=n.length+c;if(u===1)return t;var f=new Array(u);f[0]=a(t);for(var h=1;h<u;h++)f[h]=a(n[h]);return f.join(" ")}if(typeof t!="string")return t;var m=n.length;if(m===0)return t;for(var w="",y=1-c,x=-1,S=t&&t.length||0,P=0;P<S;){if(t.charCodeAt(P)===37&&P+1<S){switch(x=x>-1?x:0,t.charCodeAt(P+1)){case 100:case 102:if(y>=m||n[y]==null)break;x<P&&(w+=t.slice(x,P)),w+=Number(n[y]),x=P+2,P++;break;case 105:if(y>=m||n[y]==null)break;x<P&&(w+=t.slice(x,P)),w+=Math.floor(Number(n[y])),x=P+2,P++;break;case 79:case 111:case 106:if(y>=m||n[y]===void 0)break;x<P&&(w+=t.slice(x,P));var U=typeof n[y];if(U==="string"){w+="'"+n[y]+"'",x=P+2,P++;break}if(U==="function"){w+=n[y].name||"<anonymous>",x=P+2,P++;break}w+=a(n[y]),x=P+2,P++;break;case 115:if(y>=m)break;x<P&&(w+=t.slice(x,P)),w+=String(n[y]),x=P+2,P++;break;case 37:x<P&&(w+=t.slice(x,P)),w+="%",x=P+2,P++,y--;break}++y}++P}return x===-1?t:(x<S&&(w+=t.slice(x)),w)}return Iu}var Du,Cp;function B5(){if(Cp)return Du;Cp=1;const r=F5();Du=i;const e=$().console||{},t={mapHttpRequest:S,mapHttpResponse:S,wrapRequestSerializer:P,wrapResponseSerializer:P,wrapErrorSerializer:P,req:S,res:S,err:y};function n(E,d){return Array.isArray(E)?E.filter(function(H){return H!=="!stdSerializers.err"}):E===!0?Object.keys(d):!1}function i(E){E=E||{},E.browser=E.browser||{};const d=E.browser.transmit;if(d&&typeof d.send!="function")throw Error("pino: transmit option must have a send function");const b=E.browser.write||e;E.browser.write&&(E.browser.asObject=!0);const H=E.serializers||{},F=n(E.browser.serialize,H);let V=E.browser.serialize;Array.isArray(E.browser.serialize)&&E.browser.serialize.indexOf("!stdSerializers.err")>-1&&(V=!1);const se=["error","fatal","warn","info","debug","trace"];typeof b=="function"&&(b.error=b.fatal=b.warn=b.info=b.debug=b.trace=b),E.enabled===!1&&(E.level="silent");const ce=E.level||"info",I=Object.create(b);I.log||(I.log=U),Object.defineProperty(I,"levelVal",{get:X}),Object.defineProperty(I,"level",{get:ee,set:Y});const N={transmit:d,serialize:F,asObject:E.browser.asObject,levels:se,timestamp:x(E)};I.levels=i.levels,I.level=ce,I.setMaxListeners=I.getMaxListeners=I.emit=I.addListener=I.on=I.prependListener=I.once=I.prependOnceListener=I.removeListener=I.removeAllListeners=I.listeners=I.listenerCount=I.eventNames=I.write=I.flush=U,I.serializers=H,I._serialize=F,I._stdErrSerialize=V,I.child=J,d&&(I._logEvent=w());function X(){return this.level==="silent"?1/0:this.levels.values[this.level]}function ee(){return this._level}function Y(Q){if(Q!=="silent"&&!this.levels.values[Q])throw Error("unknown level "+Q);this._level=Q,a(N,I,"error","log"),a(N,I,"fatal","error"),a(N,I,"warn","error"),a(N,I,"info","log"),a(N,I,"debug","log"),a(N,I,"trace","log")}function J(Q,ie){if(!Q)throw new Error("missing bindings for child Pino");ie=ie||{},F&&Q.serializers&&(ie.serializers=Q.serializers);const Ee=ie.serializers;if(F&&Ee){var ae=Object.assign({},H,Ee),xe=E.browser.serialize===!0?Object.keys(ae):F;delete Q.serializers,f([Q],xe,ae,this._stdErrSerialize)}function de(be){this._childLevel=(be._childLevel|0)+1,this.error=h(be,Q,"error"),this.fatal=h(be,Q,"fatal"),this.warn=h(be,Q,"warn"),this.info=h(be,Q,"info"),this.debug=h(be,Q,"debug"),this.trace=h(be,Q,"trace"),ae&&(this.serializers=ae,this._serialize=xe),d&&(this._logEvent=w([].concat(be._logEvent.bindings,Q)))}return de.prototype=this,new de(this)}return I}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=t,i.stdTimeFunctions=Object.assign({},{nullTime:j,epochTime:A,unixTime:T,isoTime:C});function a(E,d,b,H){const F=Object.getPrototypeOf(d);d[b]=d.levelVal>d.levels.values[b]?U:F[b]?F[b]:e[b]||e[H]||U,c(E,d,b)}function c(E,d,b){!E.transmit&&d[b]===U||(d[b]=function(H){return function(){const V=E.timestamp(),se=new Array(arguments.length),ce=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var I=0;I<se.length;I++)se[I]=arguments[I];if(E.serialize&&!E.asObject&&f(se,this._serialize,this.serializers,this._stdErrSerialize),E.asObject?H.call(ce,u(this,b,se,V)):H.apply(ce,se),E.transmit){const N=E.transmit.level||d.level,X=i.levels.values[N],ee=i.levels.values[b];if(ee<X)return;m(this,{ts:V,methodLevel:b,methodValue:ee,transmitLevel:N,transmitValue:i.levels.values[E.transmit.level||d.level],send:E.transmit.send,val:d.levelVal},se)}}}(d[b]))}function u(E,d,b,H){E._serialize&&f(b,E._serialize,E.serializers,E._stdErrSerialize);const F=b.slice();let V=F[0];const se={};H&&(se.time=H),se.level=i.levels.values[d];let ce=(E._childLevel|0)+1;if(ce<1&&(ce=1),V!==null&&typeof V=="object"){for(;ce--&&typeof F[0]=="object";)Object.assign(se,F.shift());V=F.length?r(F.shift(),F):void 0}else typeof V=="string"&&(V=r(F.shift(),F));return V!==void 0&&(se.msg=V),se}function f(E,d,b,H){for(const F in E)if(H&&E[F]instanceof Error)E[F]=i.stdSerializers.err(E[F]);else if(typeof E[F]=="object"&&!Array.isArray(E[F]))for(const V in E[F])d&&d.indexOf(V)>-1&&V in b&&(E[F][V]=b[V](E[F][V]))}function h(E,d,b){return function(){const H=new Array(1+arguments.length);H[0]=d;for(var F=1;F<H.length;F++)H[F]=arguments[F-1];return E[b].apply(this,H)}}function m(E,d,b){const H=d.send,F=d.ts,V=d.methodLevel,se=d.methodValue,ce=d.val,I=E._logEvent.bindings;f(b,E._serialize||Object.keys(E.serializers),E.serializers,E._stdErrSerialize===void 0?!0:E._stdErrSerialize),E._logEvent.ts=F,E._logEvent.messages=b.filter(function(N){return I.indexOf(N)===-1}),E._logEvent.level.label=V,E._logEvent.level.value=se,H(V,E._logEvent,ce),E._logEvent=w(I)}function w(E){return{ts:0,messages:[],bindings:E||[],level:{label:"",value:0}}}function y(E){const d={type:E.constructor.name,msg:E.message,stack:E.stack};for(const b in E)d[b]===void 0&&(d[b]=E[b]);return d}function x(E){return typeof E.timestamp=="function"?E.timestamp:E.timestamp===!1?j:A}function S(){return{}}function P(E){return E}function U(){}function j(){return!1}function A(){return Date.now()}function T(){return Math.round(Date.now()/1e3)}function C(){return new Date(Date.now()).toISOString()}function $(){function E(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 E(self)||E(window)||E(this)||{}}}return Du}var ki={},Op;function $p(){return Op||(Op=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 Er={},Ap;function k5(){if(Ap)return Er;Ap=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.generateChildLogger=Er.formatChildLoggerContext=Er.getLoggerContext=Er.setBrowserLoggerContext=Er.getBrowserLoggerContext=Er.getDefaultLoggerOptions=void 0;const r=$p();function e(u){return Object.assign(Object.assign({},u),{level:u?.level||r.PINO_LOGGER_DEFAULTS.level})}Er.getDefaultLoggerOptions=e;function t(u,f=r.PINO_CUSTOM_CONTEXT_KEY){return u[f]||""}Er.getBrowserLoggerContext=t;function n(u,f,h=r.PINO_CUSTOM_CONTEXT_KEY){return u[h]=f,u}Er.setBrowserLoggerContext=n;function i(u,f=r.PINO_CUSTOM_CONTEXT_KEY){let h="";return typeof u.bindings>"u"?h=t(u,f):h=u.bindings().context||"",h}Er.getLoggerContext=i;function a(u,f,h=r.PINO_CUSTOM_CONTEXT_KEY){const m=i(u,h);return m.trim()?`${m}/${f}`:f}Er.formatChildLoggerContext=a;function c(u,f,h=r.PINO_CUSTOM_CONTEXT_KEY){const m=a(u,f,h),w=u.child({context:m});return n(w,m,h)}return Er.generateChildLogger=c,Er}(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.pino=void 0;const e=j5,t=e.__importDefault(B5());Object.defineProperty(r,"pino",{enumerable:!0,get:function(){return t.default}}),e.__exportStar($p(),r),e.__exportStar(k5(),r)})(Xe);class q5 extends Fi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class z5 extends Fi{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class H5{constructor(e,t){this.logger=e,this.core=t}}class W5 extends Fi{constructor(e,t){super(),this.relayer=e,this.logger=t}}class K5 extends Fi{constructor(e){super()}}class V5{constructor(e,t,n,i){this.core=e,this.logger=t,this.name=n}}class G5 extends Fi{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Y5 extends Fi{constructor(e,t){super(),this.core=e,this.logger=t}}class J5{constructor(e,t){this.projectId=e,this.logger=t}}class Z5{constructor(e,t){this.projectId=e,this.logger=t}}class Q5{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class X5{constructor(e){this.client=e}}var Su={},Pp={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Me,t=zr;r.DIGEST_LENGTH=64,r.BLOCK_SIZE=128;var n=function(){function u(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},u.prototype.update=function(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var m=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<r.BLOCK_SIZE&&h>0;)this._buffer[this._bufferLength++]=f[m++],h--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(m=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,f,m,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[m++],h--;return this},u.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,m=this._bufferLength,w=h/536870912|0,y=h<<3,x=h%128<112?128:256;this._buffer[m]=128;for(var S=m+1;S<x-8;S++)this._buffer[S]=0;e.writeUint32BE(w,this._buffer,x-8),e.writeUint32BE(y,this._buffer,x-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var S=0;S<this.digestLength/8;S++)e.writeUint32BE(this._stateHi[S],f,S*8),e.writeUint32BE(this._stateLo[S],f,S*8+4);return this},u.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},u.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}},u.prototype.restoreState=function(f){return this._stateHi.set(f.stateHi),this._stateLo.set(f.stateLo),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(f){t.wipe(f.stateHi),t.wipe(f.stateLo),f.buffer&&t.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},u}();r.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 a(u,f,h,m,w,y,x){for(var S=h[0],P=h[1],U=h[2],j=h[3],A=h[4],T=h[5],C=h[6],$=h[7],E=m[0],d=m[1],b=m[2],H=m[3],F=m[4],V=m[5],se=m[6],ce=m[7],I,N,X,ee,Y,J,Q,ie;x>=128;){for(var Ee=0;Ee<16;Ee++){var ae=8*Ee+y;u[Ee]=e.readUint32BE(w,ae),f[Ee]=e.readUint32BE(w,ae+4)}for(var Ee=0;Ee<80;Ee++){var xe=S,de=P,be=U,K=j,W=A,B=T,g=C,L=$,le=E,pe=d,Ce=b,Ke=H,Je=F,ke=V,St=se,Ct=ce;if(I=$,N=ce,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=(A>>>14|F<<32-14)^(A>>>18|F<<32-18)^(F>>>41-32|A<<32-(41-32)),N=(F>>>14|A<<32-14)^(F>>>18|A<<32-18)^(A>>>41-32|F<<32-(41-32)),Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,I=A&T^~A&C,N=F&V^~F&se,Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,I=i[Ee*2],N=i[Ee*2+1],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,I=u[Ee%16],N=f[Ee%16],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,X=Q&65535|ie<<16,ee=Y&65535|J<<16,I=X,N=ee,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=(S>>>28|E<<32-28)^(E>>>34-32|S<<32-(34-32))^(E>>>39-32|S<<32-(39-32)),N=(E>>>28|S<<32-28)^(S>>>34-32|E<<32-(34-32))^(S>>>39-32|E<<32-(39-32)),Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,I=S&P^S&U^P&U,N=E&d^E&b^d&b,Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,L=Q&65535|ie<<16,Ct=Y&65535|J<<16,I=K,N=Ke,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=X,N=ee,Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,K=Q&65535|ie<<16,Ke=Y&65535|J<<16,P=xe,U=de,j=be,A=K,T=W,C=B,$=g,S=L,d=le,b=pe,H=Ce,F=Ke,V=Je,se=ke,ce=St,E=Ct,Ee%16===15)for(var ae=0;ae<16;ae++)I=u[ae],N=f[ae],Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=u[(ae+9)%16],N=f[(ae+9)%16],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,X=u[(ae+1)%16],ee=f[(ae+1)%16],I=(X>>>1|ee<<32-1)^(X>>>8|ee<<32-8)^X>>>7,N=(ee>>>1|X<<32-1)^(ee>>>8|X<<32-8)^(ee>>>7|X<<32-7),Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,X=u[(ae+14)%16],ee=f[(ae+14)%16],I=(X>>>19|ee<<32-19)^(ee>>>61-32|X<<32-(61-32))^X>>>6,N=(ee>>>19|X<<32-19)^(X>>>61-32|ee<<32-(61-32))^(ee>>>6|X<<32-6),Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,u[ae]=Q&65535|ie<<16,f[ae]=Y&65535|J<<16}I=S,N=E,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[0],N=m[0],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[0]=S=Q&65535|ie<<16,m[0]=E=Y&65535|J<<16,I=P,N=d,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[1],N=m[1],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[1]=P=Q&65535|ie<<16,m[1]=d=Y&65535|J<<16,I=U,N=b,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[2],N=m[2],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[2]=U=Q&65535|ie<<16,m[2]=b=Y&65535|J<<16,I=j,N=H,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[3],N=m[3],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[3]=j=Q&65535|ie<<16,m[3]=H=Y&65535|J<<16,I=A,N=F,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[4],N=m[4],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[4]=A=Q&65535|ie<<16,m[4]=F=Y&65535|J<<16,I=T,N=V,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[5],N=m[5],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[5]=T=Q&65535|ie<<16,m[5]=V=Y&65535|J<<16,I=C,N=se,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[6],N=m[6],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[6]=C=Q&65535|ie<<16,m[6]=se=Y&65535|J<<16,I=$,N=ce,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[7],N=m[7],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[7]=$=Q&65535|ie<<16,m[7]=ce=Y&65535|J<<16,y+=128,x-=128}return y}function c(u){var f=new n;f.update(u);var h=f.digest();return f.clean(),h}r.hash=c})(Pp),function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=vs,t=Pp,n=zr;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function i(K){const W=new Float64Array(16);if(K)for(let B=0;B<K.length;B++)W[B]=K[B];return W}const a=new Uint8Array(32);a[0]=9;const c=i(),u=i([1]),f=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),m=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),w=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),y=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(K,W){for(let B=0;B<16;B++)K[B]=W[B]|0}function S(K){let W=1;for(let B=0;B<16;B++){let g=K[B]+W+65535;W=Math.floor(g/65536),K[B]=g-W*65536}K[0]+=W-1+37*(W-1)}function P(K,W,B){const g=~(B-1);for(let L=0;L<16;L++){const le=g&(K[L]^W[L]);K[L]^=le,W[L]^=le}}function U(K,W){const B=i(),g=i();for(let L=0;L<16;L++)g[L]=W[L];S(g),S(g),S(g);for(let L=0;L<2;L++){B[0]=g[0]-65517;for(let pe=1;pe<15;pe++)B[pe]=g[pe]-65535-(B[pe-1]>>16&1),B[pe-1]&=65535;B[15]=g[15]-32767-(B[14]>>16&1);const le=B[15]>>16&1;B[14]&=65535,P(g,B,1-le)}for(let L=0;L<16;L++)K[2*L]=g[L]&255,K[2*L+1]=g[L]>>8}function j(K,W){let B=0;for(let g=0;g<32;g++)B|=K[g]^W[g];return(1&B-1>>>8)-1}function A(K,W){const B=new Uint8Array(32),g=new Uint8Array(32);return U(B,K),U(g,W),j(B,g)}function T(K){const W=new Uint8Array(32);return U(W,K),W[0]&1}function C(K,W){for(let B=0;B<16;B++)K[B]=W[2*B]+(W[2*B+1]<<8);K[15]&=32767}function $(K,W,B){for(let g=0;g<16;g++)K[g]=W[g]+B[g]}function E(K,W,B){for(let g=0;g<16;g++)K[g]=W[g]-B[g]}function d(K,W,B){let g,L,le=0,pe=0,Ce=0,Ke=0,Je=0,ke=0,St=0,Ct=0,ze=0,Oe=0,Ue=0,je=0,He=0,Ae=0,Fe=0,Se=0,Te=0,Ve=0,$e=0,Ze=0,et=0,at=0,ct=0,nt=0,Sr=0,Ur=0,On=0,Cr=0,Wn=0,bi=0,rs=0,Lt=B[0],Ot=B[1],Mt=B[2],Ut=B[3],Tt=B[4],$t=B[5],Gt=B[6],Yt=B[7],jt=B[8],Jt=B[9],Ft=B[10],Ht=B[11],Bt=B[12],_t=B[13],Zt=B[14],Qt=B[15];g=W[0],le+=g*Lt,pe+=g*Ot,Ce+=g*Mt,Ke+=g*Ut,Je+=g*Tt,ke+=g*$t,St+=g*Gt,Ct+=g*Yt,ze+=g*jt,Oe+=g*Jt,Ue+=g*Ft,je+=g*Ht,He+=g*Bt,Ae+=g*_t,Fe+=g*Zt,Se+=g*Qt,g=W[1],pe+=g*Lt,Ce+=g*Ot,Ke+=g*Mt,Je+=g*Ut,ke+=g*Tt,St+=g*$t,Ct+=g*Gt,ze+=g*Yt,Oe+=g*jt,Ue+=g*Jt,je+=g*Ft,He+=g*Ht,Ae+=g*Bt,Fe+=g*_t,Se+=g*Zt,Te+=g*Qt,g=W[2],Ce+=g*Lt,Ke+=g*Ot,Je+=g*Mt,ke+=g*Ut,St+=g*Tt,Ct+=g*$t,ze+=g*Gt,Oe+=g*Yt,Ue+=g*jt,je+=g*Jt,He+=g*Ft,Ae+=g*Ht,Fe+=g*Bt,Se+=g*_t,Te+=g*Zt,Ve+=g*Qt,g=W[3],Ke+=g*Lt,Je+=g*Ot,ke+=g*Mt,St+=g*Ut,Ct+=g*Tt,ze+=g*$t,Oe+=g*Gt,Ue+=g*Yt,je+=g*jt,He+=g*Jt,Ae+=g*Ft,Fe+=g*Ht,Se+=g*Bt,Te+=g*_t,Ve+=g*Zt,$e+=g*Qt,g=W[4],Je+=g*Lt,ke+=g*Ot,St+=g*Mt,Ct+=g*Ut,ze+=g*Tt,Oe+=g*$t,Ue+=g*Gt,je+=g*Yt,He+=g*jt,Ae+=g*Jt,Fe+=g*Ft,Se+=g*Ht,Te+=g*Bt,Ve+=g*_t,$e+=g*Zt,Ze+=g*Qt,g=W[5],ke+=g*Lt,St+=g*Ot,Ct+=g*Mt,ze+=g*Ut,Oe+=g*Tt,Ue+=g*$t,je+=g*Gt,He+=g*Yt,Ae+=g*jt,Fe+=g*Jt,Se+=g*Ft,Te+=g*Ht,Ve+=g*Bt,$e+=g*_t,Ze+=g*Zt,et+=g*Qt,g=W[6],St+=g*Lt,Ct+=g*Ot,ze+=g*Mt,Oe+=g*Ut,Ue+=g*Tt,je+=g*$t,He+=g*Gt,Ae+=g*Yt,Fe+=g*jt,Se+=g*Jt,Te+=g*Ft,Ve+=g*Ht,$e+=g*Bt,Ze+=g*_t,et+=g*Zt,at+=g*Qt,g=W[7],Ct+=g*Lt,ze+=g*Ot,Oe+=g*Mt,Ue+=g*Ut,je+=g*Tt,He+=g*$t,Ae+=g*Gt,Fe+=g*Yt,Se+=g*jt,Te+=g*Jt,Ve+=g*Ft,$e+=g*Ht,Ze+=g*Bt,et+=g*_t,at+=g*Zt,ct+=g*Qt,g=W[8],ze+=g*Lt,Oe+=g*Ot,Ue+=g*Mt,je+=g*Ut,He+=g*Tt,Ae+=g*$t,Fe+=g*Gt,Se+=g*Yt,Te+=g*jt,Ve+=g*Jt,$e+=g*Ft,Ze+=g*Ht,et+=g*Bt,at+=g*_t,ct+=g*Zt,nt+=g*Qt,g=W[9],Oe+=g*Lt,Ue+=g*Ot,je+=g*Mt,He+=g*Ut,Ae+=g*Tt,Fe+=g*$t,Se+=g*Gt,Te+=g*Yt,Ve+=g*jt,$e+=g*Jt,Ze+=g*Ft,et+=g*Ht,at+=g*Bt,ct+=g*_t,nt+=g*Zt,Sr+=g*Qt,g=W[10],Ue+=g*Lt,je+=g*Ot,He+=g*Mt,Ae+=g*Ut,Fe+=g*Tt,Se+=g*$t,Te+=g*Gt,Ve+=g*Yt,$e+=g*jt,Ze+=g*Jt,et+=g*Ft,at+=g*Ht,ct+=g*Bt,nt+=g*_t,Sr+=g*Zt,Ur+=g*Qt,g=W[11],je+=g*Lt,He+=g*Ot,Ae+=g*Mt,Fe+=g*Ut,Se+=g*Tt,Te+=g*$t,Ve+=g*Gt,$e+=g*Yt,Ze+=g*jt,et+=g*Jt,at+=g*Ft,ct+=g*Ht,nt+=g*Bt,Sr+=g*_t,Ur+=g*Zt,On+=g*Qt,g=W[12],He+=g*Lt,Ae+=g*Ot,Fe+=g*Mt,Se+=g*Ut,Te+=g*Tt,Ve+=g*$t,$e+=g*Gt,Ze+=g*Yt,et+=g*jt,at+=g*Jt,ct+=g*Ft,nt+=g*Ht,Sr+=g*Bt,Ur+=g*_t,On+=g*Zt,Cr+=g*Qt,g=W[13],Ae+=g*Lt,Fe+=g*Ot,Se+=g*Mt,Te+=g*Ut,Ve+=g*Tt,$e+=g*$t,Ze+=g*Gt,et+=g*Yt,at+=g*jt,ct+=g*Jt,nt+=g*Ft,Sr+=g*Ht,Ur+=g*Bt,On+=g*_t,Cr+=g*Zt,Wn+=g*Qt,g=W[14],Fe+=g*Lt,Se+=g*Ot,Te+=g*Mt,Ve+=g*Ut,$e+=g*Tt,Ze+=g*$t,et+=g*Gt,at+=g*Yt,ct+=g*jt,nt+=g*Jt,Sr+=g*Ft,Ur+=g*Ht,On+=g*Bt,Cr+=g*_t,Wn+=g*Zt,bi+=g*Qt,g=W[15],Se+=g*Lt,Te+=g*Ot,Ve+=g*Mt,$e+=g*Ut,Ze+=g*Tt,et+=g*$t,at+=g*Gt,ct+=g*Yt,nt+=g*jt,Sr+=g*Jt,Ur+=g*Ft,On+=g*Ht,Cr+=g*Bt,Wn+=g*_t,bi+=g*Zt,rs+=g*Qt,le+=38*Te,pe+=38*Ve,Ce+=38*$e,Ke+=38*Ze,Je+=38*et,ke+=38*at,St+=38*ct,Ct+=38*nt,ze+=38*Sr,Oe+=38*Ur,Ue+=38*On,je+=38*Cr,He+=38*Wn,Ae+=38*bi,Fe+=38*rs,L=1,g=le+L+65535,L=Math.floor(g/65536),le=g-L*65536,g=pe+L+65535,L=Math.floor(g/65536),pe=g-L*65536,g=Ce+L+65535,L=Math.floor(g/65536),Ce=g-L*65536,g=Ke+L+65535,L=Math.floor(g/65536),Ke=g-L*65536,g=Je+L+65535,L=Math.floor(g/65536),Je=g-L*65536,g=ke+L+65535,L=Math.floor(g/65536),ke=g-L*65536,g=St+L+65535,L=Math.floor(g/65536),St=g-L*65536,g=Ct+L+65535,L=Math.floor(g/65536),Ct=g-L*65536,g=ze+L+65535,L=Math.floor(g/65536),ze=g-L*65536,g=Oe+L+65535,L=Math.floor(g/65536),Oe=g-L*65536,g=Ue+L+65535,L=Math.floor(g/65536),Ue=g-L*65536,g=je+L+65535,L=Math.floor(g/65536),je=g-L*65536,g=He+L+65535,L=Math.floor(g/65536),He=g-L*65536,g=Ae+L+65535,L=Math.floor(g/65536),Ae=g-L*65536,g=Fe+L+65535,L=Math.floor(g/65536),Fe=g-L*65536,g=Se+L+65535,L=Math.floor(g/65536),Se=g-L*65536,le+=L-1+37*(L-1),L=1,g=le+L+65535,L=Math.floor(g/65536),le=g-L*65536,g=pe+L+65535,L=Math.floor(g/65536),pe=g-L*65536,g=Ce+L+65535,L=Math.floor(g/65536),Ce=g-L*65536,g=Ke+L+65535,L=Math.floor(g/65536),Ke=g-L*65536,g=Je+L+65535,L=Math.floor(g/65536),Je=g-L*65536,g=ke+L+65535,L=Math.floor(g/65536),ke=g-L*65536,g=St+L+65535,L=Math.floor(g/65536),St=g-L*65536,g=Ct+L+65535,L=Math.floor(g/65536),Ct=g-L*65536,g=ze+L+65535,L=Math.floor(g/65536),ze=g-L*65536,g=Oe+L+65535,L=Math.floor(g/65536),Oe=g-L*65536,g=Ue+L+65535,L=Math.floor(g/65536),Ue=g-L*65536,g=je+L+65535,L=Math.floor(g/65536),je=g-L*65536,g=He+L+65535,L=Math.floor(g/65536),He=g-L*65536,g=Ae+L+65535,L=Math.floor(g/65536),Ae=g-L*65536,g=Fe+L+65535,L=Math.floor(g/65536),Fe=g-L*65536,g=Se+L+65535,L=Math.floor(g/65536),Se=g-L*65536,le+=L-1+37*(L-1),K[0]=le,K[1]=pe,K[2]=Ce,K[3]=Ke,K[4]=Je,K[5]=ke,K[6]=St,K[7]=Ct,K[8]=ze,K[9]=Oe,K[10]=Ue,K[11]=je,K[12]=He,K[13]=Ae,K[14]=Fe,K[15]=Se}function b(K,W){d(K,W,W)}function H(K,W){const B=i();let g;for(g=0;g<16;g++)B[g]=W[g];for(g=253;g>=0;g--)b(B,B),g!==2&&g!==4&&d(B,B,W);for(g=0;g<16;g++)K[g]=B[g]}function F(K,W){const B=i();let g;for(g=0;g<16;g++)B[g]=W[g];for(g=250;g>=0;g--)b(B,B),g!==1&&d(B,B,W);for(g=0;g<16;g++)K[g]=B[g]}function V(K,W){const B=i(),g=i(),L=i(),le=i(),pe=i(),Ce=i(),Ke=i(),Je=i(),ke=i();E(B,K[1],K[0]),E(ke,W[1],W[0]),d(B,B,ke),$(g,K[0],K[1]),$(ke,W[0],W[1]),d(g,g,ke),d(L,K[3],W[3]),d(L,L,h),d(le,K[2],W[2]),$(le,le,le),E(pe,g,B),E(Ce,le,L),$(Ke,le,L),$(Je,g,B),d(K[0],pe,Ce),d(K[1],Je,Ke),d(K[2],Ke,Ce),d(K[3],pe,Je)}function se(K,W,B){for(let g=0;g<4;g++)P(K[g],W[g],B)}function ce(K,W){const B=i(),g=i(),L=i();H(L,W[2]),d(B,W[0],L),d(g,W[1],L),U(K,g),K[31]^=T(B)<<7}function I(K,W,B){x(K[0],c),x(K[1],u),x(K[2],u),x(K[3],c);for(let g=255;g>=0;--g){const L=B[g/8|0]>>(g&7)&1;se(K,W,L),V(W,K),V(K,K),se(K,W,L)}}function N(K,W){const B=[i(),i(),i(),i()];x(B[0],m),x(B[1],w),x(B[2],u),d(B[3],m,w),I(K,B,W)}function X(K){if(K.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const W=(0,t.hash)(K);W[0]&=248,W[31]&=127,W[31]|=64;const B=new Uint8Array(32),g=[i(),i(),i(),i()];N(g,W),ce(B,g);const L=new Uint8Array(64);return L.set(K),L.set(B,32),{publicKey:B,secretKey:L}}r.generateKeyPairFromSeed=X;function ee(K){const W=(0,e.randomBytes)(32,K),B=X(W);return(0,n.wipe)(W),B}r.generateKeyPair=ee;function Y(K){if(K.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(K.subarray(32))}r.extractPublicKeyFromSecretKey=Y;const J=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 Q(K,W){let B,g,L,le;for(g=63;g>=32;--g){for(B=0,L=g-32,le=g-12;L<le;++L)W[L]+=B-16*W[g]*J[L-(g-32)],B=Math.floor((W[L]+128)/256),W[L]-=B*256;W[L]+=B,W[g]=0}for(B=0,L=0;L<32;L++)W[L]+=B-(W[31]>>4)*J[L],B=W[L]>>8,W[L]&=255;for(L=0;L<32;L++)W[L]-=B*J[L];for(g=0;g<32;g++)W[g+1]+=W[g]>>8,K[g]=W[g]&255}function ie(K){const W=new Float64Array(64);for(let B=0;B<64;B++)W[B]=K[B];for(let B=0;B<64;B++)K[B]=0;Q(K,W)}function Ee(K,W){const B=new Float64Array(64),g=[i(),i(),i(),i()],L=(0,t.hash)(K.subarray(0,32));L[0]&=248,L[31]&=127,L[31]|=64;const le=new Uint8Array(64);le.set(L.subarray(32),32);const pe=new t.SHA512;pe.update(le.subarray(32)),pe.update(W);const Ce=pe.digest();pe.clean(),ie(Ce),N(g,Ce),ce(le,g),pe.reset(),pe.update(le.subarray(0,32)),pe.update(K.subarray(32)),pe.update(W);const Ke=pe.digest();ie(Ke);for(let Je=0;Je<32;Je++)B[Je]=Ce[Je];for(let Je=0;Je<32;Je++)for(let ke=0;ke<32;ke++)B[Je+ke]+=Ke[Je]*L[ke];return Q(le.subarray(32),B),le}r.sign=Ee;function ae(K,W){const B=i(),g=i(),L=i(),le=i(),pe=i(),Ce=i(),Ke=i();return x(K[2],u),C(K[1],W),b(L,K[1]),d(le,L,f),E(L,L,K[2]),$(le,K[2],le),b(pe,le),b(Ce,pe),d(Ke,Ce,pe),d(B,Ke,L),d(B,B,le),F(B,B),d(B,B,L),d(B,B,le),d(B,B,le),d(K[0],B,le),b(g,K[0]),d(g,g,le),A(g,L)&&d(K[0],K[0],y),b(g,K[0]),d(g,g,le),A(g,L)?-1:(T(K[0])===W[31]>>7&&E(K[0],c,K[0]),d(K[3],K[0],K[1]),0)}function xe(K,W,B){const g=new Uint8Array(32),L=[i(),i(),i(),i()],le=[i(),i(),i(),i()];if(B.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(ae(le,K))return!1;const pe=new t.SHA512;pe.update(B.subarray(0,32)),pe.update(K),pe.update(W);const Ce=pe.digest();return ie(Ce),I(L,le,Ce),N(le,B.subarray(32)),V(L,le),ce(g,L),!j(B,g)}r.verify=xe;function de(K){let W=[i(),i(),i(),i()];if(ae(W,K))throw new Error("Ed25519: invalid public key");let B=i(),g=i(),L=W[1];$(B,u,L),E(g,u,L),H(g,g),d(B,B,g);let le=new Uint8Array(32);return U(le,B),le}r.convertPublicKeyToX25519=de;function be(K){const W=(0,t.hash)(K.subarray(0,32));W[0]&=248,W[31]&=127,W[31]|=64;const B=new Uint8Array(W.subarray(0,32));return(0,n.wipe)(W),B}r.convertSecretKeyToX25519=be}(Su);const e6="EdDSA",t6="JWT",Tp=".",Rp="base64url",r6="utf8",n6="utf8",i6=":",s6="did",o6="key",Np="base58btc",a6="z",c6="K36",l6=32;function qa(r){return wr(Tr(ji(r),r6),Rp)}function Lp(r){const e=Tr(c6,Np),t=a6+wr(Bl([e,r]),Np);return[s6,o6,t].join(i6)}function u6(r){return wr(r,Rp)}function h6(r){return Tr([qa(r.header),qa(r.payload)].join(Tp),n6)}function f6(r){return[qa(r.header),qa(r.payload),u6(r.signature)].join(Tp)}function Mp(r=vs.randomBytes(l6)){return Su.generateKeyPairFromSeed(r)}async function d6(r,e,t,n,i=ye.fromMiliseconds(Date.now())){const a={alg:e6,typ:t6},c=Lp(n.publicKey),u=i+t,f={iss:c,sub:r,aud:e,iat:i,exp:u},h=h6({header:a,payload:f}),m=Su.sign(n.secretKey,h);return f6({header:a,payload:f,signature:m})}const p6="PARSE_ERROR",g6="INVALID_REQUEST",m6="METHOD_NOT_FOUND",v6="INVALID_PARAMS",Up="INTERNAL_ERROR",Cu="SERVER_ERROR",y6=[-32700,-32600,-32601,-32602,-32603],Ao={[p6]:{code:-32700,message:"Parse error"},[g6]:{code:-32600,message:"Invalid Request"},[m6]:{code:-32601,message:"Method not found"},[v6]:{code:-32602,message:"Invalid params"},[Up]:{code:-32603,message:"Internal error"},[Cu]:{code:-32e3,message:"Server error"}},jp=Cu;function w6(r){return y6.includes(r)}function Fp(r){return Object.keys(Ao).includes(r)?Ao[r]:Ao[jp]}function b6(r){const e=Object.values(Ao).find(t=>t.code===r);return e||Ao[jp]}function Bp(r,e,t){return r.message.includes("getaddrinfo ENOTFOUND")||r.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):r}var kp={};/*! *****************************************************************************
46
+ ***************************************************************************** */var xu=function(r,e){return xu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},xu(r,e)};function y5(r,e){xu(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Iu=function(){return Iu=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Iu.apply(this,arguments)};function w5(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function b5(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function _5(r,e){return function(t,n){e(t,n,r)}}function E5(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function x5(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function I5(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function D5(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function S5(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Du(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function O5(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Sp(arguments[e]));return r}function C5(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function No(r){return this instanceof No?(this.v=r,this):new No(r)}function $5(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(_){return new Promise(function(S,P){a.push([y,_,S,P])>1||u(y,_)})})}function u(y,_){try{f(n[y](_))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof No?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,_){y(_),a.shift(),a.length&&u(a[0][0],a[0][1])}}function A5(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:No(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function P5(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Du=="function"?Du(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function T5(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function R5(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function N5(r){return r&&r.__esModule?r:{default:r}}function L5(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function M5(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var U5=Object.freeze({__proto__:null,__extends:y5,get __assign(){return Iu},__rest:w5,__decorate:b5,__param:_5,__metadata:E5,__awaiter:x5,__generator:I5,__createBinding:D5,__exportStar:S5,__values:Du,__read:Sp,__spread:O5,__spreadArrays:C5,__await:No,__asyncGenerator:$5,__asyncDelegator:A5,__asyncValues:P5,__makeTemplateObject:T5,__importStar:R5,__importDefault:N5,__classPrivateFieldGet:L5,__classPrivateFieldSet:M5}),j5=Pi(U5),Su,Op;function F5(){if(Op)return Su;Op=1;function r(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}Su=e;function e(t,n,i){var a=i&&i.stringify||r,c=1;if(typeof t=="object"&&t!==null){var u=n.length+c;if(u===1)return t;var f=new Array(u);f[0]=a(t);for(var h=1;h<u;h++)f[h]=a(n[h]);return f.join(" ")}if(typeof t!="string")return t;var m=n.length;if(m===0)return t;for(var w="",y=1-c,_=-1,S=t&&t.length||0,P=0;P<S;){if(t.charCodeAt(P)===37&&P+1<S){switch(_=_>-1?_:0,t.charCodeAt(P+1)){case 100:case 102:if(y>=m||n[y]==null)break;_<P&&(w+=t.slice(_,P)),w+=Number(n[y]),_=P+2,P++;break;case 105:if(y>=m||n[y]==null)break;_<P&&(w+=t.slice(_,P)),w+=Math.floor(Number(n[y])),_=P+2,P++;break;case 79:case 111:case 106:if(y>=m||n[y]===void 0)break;_<P&&(w+=t.slice(_,P));var j=typeof n[y];if(j==="string"){w+="'"+n[y]+"'",_=P+2,P++;break}if(j==="function"){w+=n[y].name||"<anonymous>",_=P+2,P++;break}w+=a(n[y]),_=P+2,P++;break;case 115:if(y>=m)break;_<P&&(w+=t.slice(_,P)),w+=String(n[y]),_=P+2,P++;break;case 37:_<P&&(w+=t.slice(_,P)),w+="%",_=P+2,P++,y--;break}++y}++P}return _===-1?t:(_<S&&(w+=t.slice(_)),w)}return Su}var Ou,Cp;function B5(){if(Cp)return Ou;Cp=1;const r=F5();Ou=i;const e=$().console||{},t={mapHttpRequest:S,mapHttpResponse:S,wrapRequestSerializer:P,wrapResponseSerializer:P,wrapErrorSerializer:P,req:S,res:S,err:y};function n(x,d){return Array.isArray(x)?x.filter(function(H){return H!=="!stdSerializers.err"}):x===!0?Object.keys(d):!1}function i(x){x=x||{},x.browser=x.browser||{};const d=x.browser.transmit;if(d&&typeof d.send!="function")throw Error("pino: transmit option must have a send function");const b=x.browser.write||e;x.browser.write&&(x.browser.asObject=!0);const H=x.serializers||{},F=n(x.browser.serialize,H);let V=x.browser.serialize;Array.isArray(x.browser.serialize)&&x.browser.serialize.indexOf("!stdSerializers.err")>-1&&(V=!1);const se=["error","fatal","warn","info","debug","trace"];typeof b=="function"&&(b.error=b.fatal=b.warn=b.info=b.debug=b.trace=b),x.enabled===!1&&(x.level="silent");const ce=x.level||"info",I=Object.create(b);I.log||(I.log=j),Object.defineProperty(I,"levelVal",{get:X}),Object.defineProperty(I,"level",{get:ee,set:Y});const N={transmit:d,serialize:F,asObject:x.browser.asObject,levels:se,timestamp:_(x)};I.levels=i.levels,I.level=ce,I.setMaxListeners=I.getMaxListeners=I.emit=I.addListener=I.on=I.prependListener=I.once=I.prependOnceListener=I.removeListener=I.removeAllListeners=I.listeners=I.listenerCount=I.eventNames=I.write=I.flush=j,I.serializers=H,I._serialize=F,I._stdErrSerialize=V,I.child=Z,d&&(I._logEvent=w());function X(){return this.level==="silent"?1/0:this.levels.values[this.level]}function ee(){return this._level}function Y(Q){if(Q!=="silent"&&!this.levels.values[Q])throw Error("unknown level "+Q);this._level=Q,a(N,I,"error","log"),a(N,I,"fatal","error"),a(N,I,"warn","error"),a(N,I,"info","log"),a(N,I,"debug","log"),a(N,I,"trace","log")}function Z(Q,ie){if(!Q)throw new Error("missing bindings for child Pino");ie=ie||{},F&&Q.serializers&&(ie.serializers=Q.serializers);const Ee=ie.serializers;if(F&&Ee){var ae=Object.assign({},H,Ee),xe=x.browser.serialize===!0?Object.keys(ae):F;delete Q.serializers,f([Q],xe,ae,this._stdErrSerialize)}function de(be){this._childLevel=(be._childLevel|0)+1,this.error=h(be,Q,"error"),this.fatal=h(be,Q,"fatal"),this.warn=h(be,Q,"warn"),this.info=h(be,Q,"info"),this.debug=h(be,Q,"debug"),this.trace=h(be,Q,"trace"),ae&&(this.serializers=ae,this._serialize=xe),d&&(this._logEvent=w([].concat(be._logEvent.bindings,Q)))}return de.prototype=this,new de(this)}return I}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=t,i.stdTimeFunctions=Object.assign({},{nullTime:U,epochTime:A,unixTime:T,isoTime:O});function a(x,d,b,H){const F=Object.getPrototypeOf(d);d[b]=d.levelVal>d.levels.values[b]?j:F[b]?F[b]:e[b]||e[H]||j,c(x,d,b)}function c(x,d,b){!x.transmit&&d[b]===j||(d[b]=function(H){return function(){const V=x.timestamp(),se=new Array(arguments.length),ce=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var I=0;I<se.length;I++)se[I]=arguments[I];if(x.serialize&&!x.asObject&&f(se,this._serialize,this.serializers,this._stdErrSerialize),x.asObject?H.call(ce,u(this,b,se,V)):H.apply(ce,se),x.transmit){const N=x.transmit.level||d.level,X=i.levels.values[N],ee=i.levels.values[b];if(ee<X)return;m(this,{ts:V,methodLevel:b,methodValue:ee,transmitLevel:N,transmitValue:i.levels.values[x.transmit.level||d.level],send:x.transmit.send,val:d.levelVal},se)}}}(d[b]))}function u(x,d,b,H){x._serialize&&f(b,x._serialize,x.serializers,x._stdErrSerialize);const F=b.slice();let V=F[0];const se={};H&&(se.time=H),se.level=i.levels.values[d];let ce=(x._childLevel|0)+1;if(ce<1&&(ce=1),V!==null&&typeof V=="object"){for(;ce--&&typeof F[0]=="object";)Object.assign(se,F.shift());V=F.length?r(F.shift(),F):void 0}else typeof V=="string"&&(V=r(F.shift(),F));return V!==void 0&&(se.msg=V),se}function f(x,d,b,H){for(const F in x)if(H&&x[F]instanceof Error)x[F]=i.stdSerializers.err(x[F]);else if(typeof x[F]=="object"&&!Array.isArray(x[F]))for(const V in x[F])d&&d.indexOf(V)>-1&&V in b&&(x[F][V]=b[V](x[F][V]))}function h(x,d,b){return function(){const H=new Array(1+arguments.length);H[0]=d;for(var F=1;F<H.length;F++)H[F]=arguments[F-1];return x[b].apply(this,H)}}function m(x,d,b){const H=d.send,F=d.ts,V=d.methodLevel,se=d.methodValue,ce=d.val,I=x._logEvent.bindings;f(b,x._serialize||Object.keys(x.serializers),x.serializers,x._stdErrSerialize===void 0?!0:x._stdErrSerialize),x._logEvent.ts=F,x._logEvent.messages=b.filter(function(N){return I.indexOf(N)===-1}),x._logEvent.level.label=V,x._logEvent.level.value=se,H(V,x._logEvent,ce),x._logEvent=w(I)}function w(x){return{ts:0,messages:[],bindings:x||[],level:{label:"",value:0}}}function y(x){const d={type:x.constructor.name,msg:x.message,stack:x.stack};for(const b in x)d[b]===void 0&&(d[b]=x[b]);return d}function _(x){return typeof x.timestamp=="function"?x.timestamp:x.timestamp===!1?U:A}function S(){return{}}function P(x){return x}function j(){}function U(){return!1}function A(){return Date.now()}function T(){return Math.round(Date.now()/1e3)}function O(){return new Date(Date.now()).toISOString()}function $(){function x(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 x(self)||x(window)||x(this)||{}}}return Ou}var ki={},$p;function Ap(){return $p||($p=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 _r={},Pp;function k5(){if(Pp)return _r;Pp=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.generateChildLogger=_r.formatChildLoggerContext=_r.getLoggerContext=_r.setBrowserLoggerContext=_r.getBrowserLoggerContext=_r.getDefaultLoggerOptions=void 0;const r=Ap();function e(u){return Object.assign(Object.assign({},u),{level:u?.level||r.PINO_LOGGER_DEFAULTS.level})}_r.getDefaultLoggerOptions=e;function t(u,f=r.PINO_CUSTOM_CONTEXT_KEY){return u[f]||""}_r.getBrowserLoggerContext=t;function n(u,f,h=r.PINO_CUSTOM_CONTEXT_KEY){return u[h]=f,u}_r.setBrowserLoggerContext=n;function i(u,f=r.PINO_CUSTOM_CONTEXT_KEY){let h="";return typeof u.bindings>"u"?h=t(u,f):h=u.bindings().context||"",h}_r.getLoggerContext=i;function a(u,f,h=r.PINO_CUSTOM_CONTEXT_KEY){const m=i(u,h);return m.trim()?`${m}/${f}`:f}_r.formatChildLoggerContext=a;function c(u,f,h=r.PINO_CUSTOM_CONTEXT_KEY){const m=a(u,f,h),w=u.child({context:m});return n(w,m,h)}return _r.generateChildLogger=c,_r}(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.pino=void 0;const e=j5,t=e.__importDefault(B5());Object.defineProperty(r,"pino",{enumerable:!0,get:function(){return t.default}}),e.__exportStar(Ap(),r),e.__exportStar(k5(),r)})(Xe);class q5 extends Fi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class z5 extends Fi{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class H5{constructor(e,t){this.logger=e,this.core=t}}class W5 extends Fi{constructor(e,t){super(),this.relayer=e,this.logger=t}}class K5 extends Fi{constructor(e){super()}}class V5{constructor(e,t,n,i){this.core=e,this.logger=t,this.name=n}}class G5 extends Fi{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Y5 extends Fi{constructor(e,t){super(),this.core=e,this.logger=t}}class Z5{constructor(e,t){this.projectId=e,this.logger=t}}class J5{constructor(e,t){this.projectId=e,this.logger=t}}class Q5{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class X5{constructor(e){this.client=e}}var Cu={},Tp={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Me,t=qr;r.DIGEST_LENGTH=64,r.BLOCK_SIZE=128;var n=function(){function u(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},u.prototype.update=function(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var m=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<r.BLOCK_SIZE&&h>0;)this._buffer[this._bufferLength++]=f[m++],h--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(m=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,f,m,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[m++],h--;return this},u.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,m=this._bufferLength,w=h/536870912|0,y=h<<3,_=h%128<112?128:256;this._buffer[m]=128;for(var S=m+1;S<_-8;S++)this._buffer[S]=0;e.writeUint32BE(w,this._buffer,_-8),e.writeUint32BE(y,this._buffer,_-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,_),this._finished=!0}for(var S=0;S<this.digestLength/8;S++)e.writeUint32BE(this._stateHi[S],f,S*8),e.writeUint32BE(this._stateLo[S],f,S*8+4);return this},u.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},u.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}},u.prototype.restoreState=function(f){return this._stateHi.set(f.stateHi),this._stateLo.set(f.stateLo),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(f){t.wipe(f.stateHi),t.wipe(f.stateLo),f.buffer&&t.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},u}();r.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 a(u,f,h,m,w,y,_){for(var S=h[0],P=h[1],j=h[2],U=h[3],A=h[4],T=h[5],O=h[6],$=h[7],x=m[0],d=m[1],b=m[2],H=m[3],F=m[4],V=m[5],se=m[6],ce=m[7],I,N,X,ee,Y,Z,Q,ie;_>=128;){for(var Ee=0;Ee<16;Ee++){var ae=8*Ee+y;u[Ee]=e.readUint32BE(w,ae),f[Ee]=e.readUint32BE(w,ae+4)}for(var Ee=0;Ee<80;Ee++){var xe=S,de=P,be=j,K=U,W=A,B=T,g=O,L=$,le=x,pe=d,Oe=b,Ke=H,Ze=F,ke=V,Ot=se,Ct=ce;if(I=$,N=ce,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=(A>>>14|F<<32-14)^(A>>>18|F<<32-18)^(F>>>41-32|A<<32-(41-32)),N=(F>>>14|A<<32-14)^(F>>>18|A<<32-18)^(A>>>41-32|F<<32-(41-32)),Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,I=A&T^~A&O,N=F&V^~F&se,Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,I=i[Ee*2],N=i[Ee*2+1],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,I=u[Ee%16],N=f[Ee%16],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,X=Q&65535|ie<<16,ee=Y&65535|Z<<16,I=X,N=ee,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=(S>>>28|x<<32-28)^(x>>>34-32|S<<32-(34-32))^(x>>>39-32|S<<32-(39-32)),N=(x>>>28|S<<32-28)^(S>>>34-32|x<<32-(34-32))^(S>>>39-32|x<<32-(39-32)),Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,I=S&P^S&j^P&j,N=x&d^x&b^d&b,Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,L=Q&65535|ie<<16,Ct=Y&65535|Z<<16,I=K,N=Ke,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=X,N=ee,Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,K=Q&65535|ie<<16,Ke=Y&65535|Z<<16,P=xe,j=de,U=be,A=K,T=W,O=B,$=g,S=L,d=le,b=pe,H=Oe,F=Ke,V=Ze,se=ke,ce=Ot,x=Ct,Ee%16===15)for(var ae=0;ae<16;ae++)I=u[ae],N=f[ae],Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=u[(ae+9)%16],N=f[(ae+9)%16],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,X=u[(ae+1)%16],ee=f[(ae+1)%16],I=(X>>>1|ee<<32-1)^(X>>>8|ee<<32-8)^X>>>7,N=(ee>>>1|X<<32-1)^(ee>>>8|X<<32-8)^(ee>>>7|X<<32-7),Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,X=u[(ae+14)%16],ee=f[(ae+14)%16],I=(X>>>19|ee<<32-19)^(ee>>>61-32|X<<32-(61-32))^X>>>6,N=(ee>>>19|X<<32-19)^(X>>>61-32|ee<<32-(61-32))^(ee>>>6|X<<32-6),Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,u[ae]=Q&65535|ie<<16,f[ae]=Y&65535|Z<<16}I=S,N=x,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=h[0],N=m[0],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,h[0]=S=Q&65535|ie<<16,m[0]=x=Y&65535|Z<<16,I=P,N=d,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=h[1],N=m[1],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,h[1]=P=Q&65535|ie<<16,m[1]=d=Y&65535|Z<<16,I=j,N=b,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=h[2],N=m[2],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,h[2]=j=Q&65535|ie<<16,m[2]=b=Y&65535|Z<<16,I=U,N=H,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=h[3],N=m[3],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,h[3]=U=Q&65535|ie<<16,m[3]=H=Y&65535|Z<<16,I=A,N=F,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=h[4],N=m[4],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,h[4]=A=Q&65535|ie<<16,m[4]=F=Y&65535|Z<<16,I=T,N=V,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=h[5],N=m[5],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,h[5]=T=Q&65535|ie<<16,m[5]=V=Y&65535|Z<<16,I=O,N=se,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=h[6],N=m[6],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,h[6]=O=Q&65535|ie<<16,m[6]=se=Y&65535|Z<<16,I=$,N=ce,Y=N&65535,Z=N>>>16,Q=I&65535,ie=I>>>16,I=h[7],N=m[7],Y+=N&65535,Z+=N>>>16,Q+=I&65535,ie+=I>>>16,Z+=Y>>>16,Q+=Z>>>16,ie+=Q>>>16,h[7]=$=Q&65535|ie<<16,m[7]=ce=Y&65535|Z<<16,y+=128,_-=128}return y}function c(u){var f=new n;f.update(u);var h=f.digest();return f.clean(),h}r.hash=c})(Tp),function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=ys,t=Tp,n=qr;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function i(K){const W=new Float64Array(16);if(K)for(let B=0;B<K.length;B++)W[B]=K[B];return W}const a=new Uint8Array(32);a[0]=9;const c=i(),u=i([1]),f=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),m=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),w=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),y=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function _(K,W){for(let B=0;B<16;B++)K[B]=W[B]|0}function S(K){let W=1;for(let B=0;B<16;B++){let g=K[B]+W+65535;W=Math.floor(g/65536),K[B]=g-W*65536}K[0]+=W-1+37*(W-1)}function P(K,W,B){const g=~(B-1);for(let L=0;L<16;L++){const le=g&(K[L]^W[L]);K[L]^=le,W[L]^=le}}function j(K,W){const B=i(),g=i();for(let L=0;L<16;L++)g[L]=W[L];S(g),S(g),S(g);for(let L=0;L<2;L++){B[0]=g[0]-65517;for(let pe=1;pe<15;pe++)B[pe]=g[pe]-65535-(B[pe-1]>>16&1),B[pe-1]&=65535;B[15]=g[15]-32767-(B[14]>>16&1);const le=B[15]>>16&1;B[14]&=65535,P(g,B,1-le)}for(let L=0;L<16;L++)K[2*L]=g[L]&255,K[2*L+1]=g[L]>>8}function U(K,W){let B=0;for(let g=0;g<32;g++)B|=K[g]^W[g];return(1&B-1>>>8)-1}function A(K,W){const B=new Uint8Array(32),g=new Uint8Array(32);return j(B,K),j(g,W),U(B,g)}function T(K){const W=new Uint8Array(32);return j(W,K),W[0]&1}function O(K,W){for(let B=0;B<16;B++)K[B]=W[2*B]+(W[2*B+1]<<8);K[15]&=32767}function $(K,W,B){for(let g=0;g<16;g++)K[g]=W[g]+B[g]}function x(K,W,B){for(let g=0;g<16;g++)K[g]=W[g]-B[g]}function d(K,W,B){let g,L,le=0,pe=0,Oe=0,Ke=0,Ze=0,ke=0,Ot=0,Ct=0,ze=0,Ce=0,Ue=0,je=0,He=0,Ae=0,Fe=0,Se=0,Te=0,Ve=0,$e=0,Je=0,et=0,at=0,ct=0,nt=0,Dr=0,Mr=0,$n=0,Sr=0,Wn=0,bi=0,ns=0,Mt=B[0],$t=B[1],Ut=B[2],jt=B[3],Rt=B[4],At=B[5],Gt=B[6],Yt=B[7],Ft=B[8],Zt=B[9],Bt=B[10],Ht=B[11],kt=B[12],Et=B[13],Jt=B[14],Qt=B[15];g=W[0],le+=g*Mt,pe+=g*$t,Oe+=g*Ut,Ke+=g*jt,Ze+=g*Rt,ke+=g*At,Ot+=g*Gt,Ct+=g*Yt,ze+=g*Ft,Ce+=g*Zt,Ue+=g*Bt,je+=g*Ht,He+=g*kt,Ae+=g*Et,Fe+=g*Jt,Se+=g*Qt,g=W[1],pe+=g*Mt,Oe+=g*$t,Ke+=g*Ut,Ze+=g*jt,ke+=g*Rt,Ot+=g*At,Ct+=g*Gt,ze+=g*Yt,Ce+=g*Ft,Ue+=g*Zt,je+=g*Bt,He+=g*Ht,Ae+=g*kt,Fe+=g*Et,Se+=g*Jt,Te+=g*Qt,g=W[2],Oe+=g*Mt,Ke+=g*$t,Ze+=g*Ut,ke+=g*jt,Ot+=g*Rt,Ct+=g*At,ze+=g*Gt,Ce+=g*Yt,Ue+=g*Ft,je+=g*Zt,He+=g*Bt,Ae+=g*Ht,Fe+=g*kt,Se+=g*Et,Te+=g*Jt,Ve+=g*Qt,g=W[3],Ke+=g*Mt,Ze+=g*$t,ke+=g*Ut,Ot+=g*jt,Ct+=g*Rt,ze+=g*At,Ce+=g*Gt,Ue+=g*Yt,je+=g*Ft,He+=g*Zt,Ae+=g*Bt,Fe+=g*Ht,Se+=g*kt,Te+=g*Et,Ve+=g*Jt,$e+=g*Qt,g=W[4],Ze+=g*Mt,ke+=g*$t,Ot+=g*Ut,Ct+=g*jt,ze+=g*Rt,Ce+=g*At,Ue+=g*Gt,je+=g*Yt,He+=g*Ft,Ae+=g*Zt,Fe+=g*Bt,Se+=g*Ht,Te+=g*kt,Ve+=g*Et,$e+=g*Jt,Je+=g*Qt,g=W[5],ke+=g*Mt,Ot+=g*$t,Ct+=g*Ut,ze+=g*jt,Ce+=g*Rt,Ue+=g*At,je+=g*Gt,He+=g*Yt,Ae+=g*Ft,Fe+=g*Zt,Se+=g*Bt,Te+=g*Ht,Ve+=g*kt,$e+=g*Et,Je+=g*Jt,et+=g*Qt,g=W[6],Ot+=g*Mt,Ct+=g*$t,ze+=g*Ut,Ce+=g*jt,Ue+=g*Rt,je+=g*At,He+=g*Gt,Ae+=g*Yt,Fe+=g*Ft,Se+=g*Zt,Te+=g*Bt,Ve+=g*Ht,$e+=g*kt,Je+=g*Et,et+=g*Jt,at+=g*Qt,g=W[7],Ct+=g*Mt,ze+=g*$t,Ce+=g*Ut,Ue+=g*jt,je+=g*Rt,He+=g*At,Ae+=g*Gt,Fe+=g*Yt,Se+=g*Ft,Te+=g*Zt,Ve+=g*Bt,$e+=g*Ht,Je+=g*kt,et+=g*Et,at+=g*Jt,ct+=g*Qt,g=W[8],ze+=g*Mt,Ce+=g*$t,Ue+=g*Ut,je+=g*jt,He+=g*Rt,Ae+=g*At,Fe+=g*Gt,Se+=g*Yt,Te+=g*Ft,Ve+=g*Zt,$e+=g*Bt,Je+=g*Ht,et+=g*kt,at+=g*Et,ct+=g*Jt,nt+=g*Qt,g=W[9],Ce+=g*Mt,Ue+=g*$t,je+=g*Ut,He+=g*jt,Ae+=g*Rt,Fe+=g*At,Se+=g*Gt,Te+=g*Yt,Ve+=g*Ft,$e+=g*Zt,Je+=g*Bt,et+=g*Ht,at+=g*kt,ct+=g*Et,nt+=g*Jt,Dr+=g*Qt,g=W[10],Ue+=g*Mt,je+=g*$t,He+=g*Ut,Ae+=g*jt,Fe+=g*Rt,Se+=g*At,Te+=g*Gt,Ve+=g*Yt,$e+=g*Ft,Je+=g*Zt,et+=g*Bt,at+=g*Ht,ct+=g*kt,nt+=g*Et,Dr+=g*Jt,Mr+=g*Qt,g=W[11],je+=g*Mt,He+=g*$t,Ae+=g*Ut,Fe+=g*jt,Se+=g*Rt,Te+=g*At,Ve+=g*Gt,$e+=g*Yt,Je+=g*Ft,et+=g*Zt,at+=g*Bt,ct+=g*Ht,nt+=g*kt,Dr+=g*Et,Mr+=g*Jt,$n+=g*Qt,g=W[12],He+=g*Mt,Ae+=g*$t,Fe+=g*Ut,Se+=g*jt,Te+=g*Rt,Ve+=g*At,$e+=g*Gt,Je+=g*Yt,et+=g*Ft,at+=g*Zt,ct+=g*Bt,nt+=g*Ht,Dr+=g*kt,Mr+=g*Et,$n+=g*Jt,Sr+=g*Qt,g=W[13],Ae+=g*Mt,Fe+=g*$t,Se+=g*Ut,Te+=g*jt,Ve+=g*Rt,$e+=g*At,Je+=g*Gt,et+=g*Yt,at+=g*Ft,ct+=g*Zt,nt+=g*Bt,Dr+=g*Ht,Mr+=g*kt,$n+=g*Et,Sr+=g*Jt,Wn+=g*Qt,g=W[14],Fe+=g*Mt,Se+=g*$t,Te+=g*Ut,Ve+=g*jt,$e+=g*Rt,Je+=g*At,et+=g*Gt,at+=g*Yt,ct+=g*Ft,nt+=g*Zt,Dr+=g*Bt,Mr+=g*Ht,$n+=g*kt,Sr+=g*Et,Wn+=g*Jt,bi+=g*Qt,g=W[15],Se+=g*Mt,Te+=g*$t,Ve+=g*Ut,$e+=g*jt,Je+=g*Rt,et+=g*At,at+=g*Gt,ct+=g*Yt,nt+=g*Ft,Dr+=g*Zt,Mr+=g*Bt,$n+=g*Ht,Sr+=g*kt,Wn+=g*Et,bi+=g*Jt,ns+=g*Qt,le+=38*Te,pe+=38*Ve,Oe+=38*$e,Ke+=38*Je,Ze+=38*et,ke+=38*at,Ot+=38*ct,Ct+=38*nt,ze+=38*Dr,Ce+=38*Mr,Ue+=38*$n,je+=38*Sr,He+=38*Wn,Ae+=38*bi,Fe+=38*ns,L=1,g=le+L+65535,L=Math.floor(g/65536),le=g-L*65536,g=pe+L+65535,L=Math.floor(g/65536),pe=g-L*65536,g=Oe+L+65535,L=Math.floor(g/65536),Oe=g-L*65536,g=Ke+L+65535,L=Math.floor(g/65536),Ke=g-L*65536,g=Ze+L+65535,L=Math.floor(g/65536),Ze=g-L*65536,g=ke+L+65535,L=Math.floor(g/65536),ke=g-L*65536,g=Ot+L+65535,L=Math.floor(g/65536),Ot=g-L*65536,g=Ct+L+65535,L=Math.floor(g/65536),Ct=g-L*65536,g=ze+L+65535,L=Math.floor(g/65536),ze=g-L*65536,g=Ce+L+65535,L=Math.floor(g/65536),Ce=g-L*65536,g=Ue+L+65535,L=Math.floor(g/65536),Ue=g-L*65536,g=je+L+65535,L=Math.floor(g/65536),je=g-L*65536,g=He+L+65535,L=Math.floor(g/65536),He=g-L*65536,g=Ae+L+65535,L=Math.floor(g/65536),Ae=g-L*65536,g=Fe+L+65535,L=Math.floor(g/65536),Fe=g-L*65536,g=Se+L+65535,L=Math.floor(g/65536),Se=g-L*65536,le+=L-1+37*(L-1),L=1,g=le+L+65535,L=Math.floor(g/65536),le=g-L*65536,g=pe+L+65535,L=Math.floor(g/65536),pe=g-L*65536,g=Oe+L+65535,L=Math.floor(g/65536),Oe=g-L*65536,g=Ke+L+65535,L=Math.floor(g/65536),Ke=g-L*65536,g=Ze+L+65535,L=Math.floor(g/65536),Ze=g-L*65536,g=ke+L+65535,L=Math.floor(g/65536),ke=g-L*65536,g=Ot+L+65535,L=Math.floor(g/65536),Ot=g-L*65536,g=Ct+L+65535,L=Math.floor(g/65536),Ct=g-L*65536,g=ze+L+65535,L=Math.floor(g/65536),ze=g-L*65536,g=Ce+L+65535,L=Math.floor(g/65536),Ce=g-L*65536,g=Ue+L+65535,L=Math.floor(g/65536),Ue=g-L*65536,g=je+L+65535,L=Math.floor(g/65536),je=g-L*65536,g=He+L+65535,L=Math.floor(g/65536),He=g-L*65536,g=Ae+L+65535,L=Math.floor(g/65536),Ae=g-L*65536,g=Fe+L+65535,L=Math.floor(g/65536),Fe=g-L*65536,g=Se+L+65535,L=Math.floor(g/65536),Se=g-L*65536,le+=L-1+37*(L-1),K[0]=le,K[1]=pe,K[2]=Oe,K[3]=Ke,K[4]=Ze,K[5]=ke,K[6]=Ot,K[7]=Ct,K[8]=ze,K[9]=Ce,K[10]=Ue,K[11]=je,K[12]=He,K[13]=Ae,K[14]=Fe,K[15]=Se}function b(K,W){d(K,W,W)}function H(K,W){const B=i();let g;for(g=0;g<16;g++)B[g]=W[g];for(g=253;g>=0;g--)b(B,B),g!==2&&g!==4&&d(B,B,W);for(g=0;g<16;g++)K[g]=B[g]}function F(K,W){const B=i();let g;for(g=0;g<16;g++)B[g]=W[g];for(g=250;g>=0;g--)b(B,B),g!==1&&d(B,B,W);for(g=0;g<16;g++)K[g]=B[g]}function V(K,W){const B=i(),g=i(),L=i(),le=i(),pe=i(),Oe=i(),Ke=i(),Ze=i(),ke=i();x(B,K[1],K[0]),x(ke,W[1],W[0]),d(B,B,ke),$(g,K[0],K[1]),$(ke,W[0],W[1]),d(g,g,ke),d(L,K[3],W[3]),d(L,L,h),d(le,K[2],W[2]),$(le,le,le),x(pe,g,B),x(Oe,le,L),$(Ke,le,L),$(Ze,g,B),d(K[0],pe,Oe),d(K[1],Ze,Ke),d(K[2],Ke,Oe),d(K[3],pe,Ze)}function se(K,W,B){for(let g=0;g<4;g++)P(K[g],W[g],B)}function ce(K,W){const B=i(),g=i(),L=i();H(L,W[2]),d(B,W[0],L),d(g,W[1],L),j(K,g),K[31]^=T(B)<<7}function I(K,W,B){_(K[0],c),_(K[1],u),_(K[2],u),_(K[3],c);for(let g=255;g>=0;--g){const L=B[g/8|0]>>(g&7)&1;se(K,W,L),V(W,K),V(K,K),se(K,W,L)}}function N(K,W){const B=[i(),i(),i(),i()];_(B[0],m),_(B[1],w),_(B[2],u),d(B[3],m,w),I(K,B,W)}function X(K){if(K.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const W=(0,t.hash)(K);W[0]&=248,W[31]&=127,W[31]|=64;const B=new Uint8Array(32),g=[i(),i(),i(),i()];N(g,W),ce(B,g);const L=new Uint8Array(64);return L.set(K),L.set(B,32),{publicKey:B,secretKey:L}}r.generateKeyPairFromSeed=X;function ee(K){const W=(0,e.randomBytes)(32,K),B=X(W);return(0,n.wipe)(W),B}r.generateKeyPair=ee;function Y(K){if(K.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(K.subarray(32))}r.extractPublicKeyFromSecretKey=Y;const Z=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Q(K,W){let B,g,L,le;for(g=63;g>=32;--g){for(B=0,L=g-32,le=g-12;L<le;++L)W[L]+=B-16*W[g]*Z[L-(g-32)],B=Math.floor((W[L]+128)/256),W[L]-=B*256;W[L]+=B,W[g]=0}for(B=0,L=0;L<32;L++)W[L]+=B-(W[31]>>4)*Z[L],B=W[L]>>8,W[L]&=255;for(L=0;L<32;L++)W[L]-=B*Z[L];for(g=0;g<32;g++)W[g+1]+=W[g]>>8,K[g]=W[g]&255}function ie(K){const W=new Float64Array(64);for(let B=0;B<64;B++)W[B]=K[B];for(let B=0;B<64;B++)K[B]=0;Q(K,W)}function Ee(K,W){const B=new Float64Array(64),g=[i(),i(),i(),i()],L=(0,t.hash)(K.subarray(0,32));L[0]&=248,L[31]&=127,L[31]|=64;const le=new Uint8Array(64);le.set(L.subarray(32),32);const pe=new t.SHA512;pe.update(le.subarray(32)),pe.update(W);const Oe=pe.digest();pe.clean(),ie(Oe),N(g,Oe),ce(le,g),pe.reset(),pe.update(le.subarray(0,32)),pe.update(K.subarray(32)),pe.update(W);const Ke=pe.digest();ie(Ke);for(let Ze=0;Ze<32;Ze++)B[Ze]=Oe[Ze];for(let Ze=0;Ze<32;Ze++)for(let ke=0;ke<32;ke++)B[Ze+ke]+=Ke[Ze]*L[ke];return Q(le.subarray(32),B),le}r.sign=Ee;function ae(K,W){const B=i(),g=i(),L=i(),le=i(),pe=i(),Oe=i(),Ke=i();return _(K[2],u),O(K[1],W),b(L,K[1]),d(le,L,f),x(L,L,K[2]),$(le,K[2],le),b(pe,le),b(Oe,pe),d(Ke,Oe,pe),d(B,Ke,L),d(B,B,le),F(B,B),d(B,B,L),d(B,B,le),d(B,B,le),d(K[0],B,le),b(g,K[0]),d(g,g,le),A(g,L)&&d(K[0],K[0],y),b(g,K[0]),d(g,g,le),A(g,L)?-1:(T(K[0])===W[31]>>7&&x(K[0],c,K[0]),d(K[3],K[0],K[1]),0)}function xe(K,W,B){const g=new Uint8Array(32),L=[i(),i(),i(),i()],le=[i(),i(),i(),i()];if(B.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(ae(le,K))return!1;const pe=new t.SHA512;pe.update(B.subarray(0,32)),pe.update(K),pe.update(W);const Oe=pe.digest();return ie(Oe),I(L,le,Oe),N(le,B.subarray(32)),V(L,le),ce(g,L),!U(B,g)}r.verify=xe;function de(K){let W=[i(),i(),i(),i()];if(ae(W,K))throw new Error("Ed25519: invalid public key");let B=i(),g=i(),L=W[1];$(B,u,L),x(g,u,L),H(g,g),d(B,B,g);let le=new Uint8Array(32);return j(le,B),le}r.convertPublicKeyToX25519=de;function be(K){const W=(0,t.hash)(K.subarray(0,32));W[0]&=248,W[31]&=127,W[31]|=64;const B=new Uint8Array(W.subarray(0,32));return(0,n.wipe)(W),B}r.convertSecretKeyToX25519=be}(Cu);const eE="EdDSA",tE="JWT",Rp=".",Np="base64url",rE="utf8",nE="utf8",iE=":",sE="did",oE="key",Lp="base58btc",aE="z",cE="K36",lE=32;function Wa(r){return yr(Pr(ji(r),rE),Np)}function Mp(r){const e=Pr(cE,Lp),t=aE+yr(zl([e,r]),Lp);return[sE,oE,t].join(iE)}function uE(r){return yr(r,Np)}function hE(r){return Pr([Wa(r.header),Wa(r.payload)].join(Rp),nE)}function fE(r){return[Wa(r.header),Wa(r.payload),uE(r.signature)].join(Rp)}function Up(r=ys.randomBytes(lE)){return Cu.generateKeyPairFromSeed(r)}async function dE(r,e,t,n,i=me.fromMiliseconds(Date.now())){const a={alg:eE,typ:tE},c=Mp(n.publicKey),u=i+t,f={iss:c,sub:r,aud:e,iat:i,exp:u},h=hE({header:a,payload:f}),m=Cu.sign(n.secretKey,h);return fE({header:a,payload:f,signature:m})}const pE="PARSE_ERROR",gE="INVALID_REQUEST",mE="METHOD_NOT_FOUND",vE="INVALID_PARAMS",jp="INTERNAL_ERROR",$u="SERVER_ERROR",yE=[-32700,-32600,-32601,-32602,-32603],Lo={[pE]:{code:-32700,message:"Parse error"},[gE]:{code:-32600,message:"Invalid Request"},[mE]:{code:-32601,message:"Method not found"},[vE]:{code:-32602,message:"Invalid params"},[jp]:{code:-32603,message:"Internal error"},[$u]:{code:-32e3,message:"Server error"}},Fp=$u;function wE(r){return yE.includes(r)}function Bp(r){return Object.keys(Lo).includes(r)?Lo[r]:Lo[Fp]}function bE(r){const e=Object.values(Lo).find(t=>t.code===r);return e||Lo[Fp]}function kp(r,e,t){return r.message.includes("getaddrinfo ENOTFOUND")||r.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):r}var qp={};/*! *****************************************************************************
47
47
  Copyright (c) Microsoft Corporation.
48
48
 
49
49
  Permission to use, copy, modify, and/or distribute this software for any
@@ -56,51 +56,51 @@
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 Ou=function(r,e){return Ou=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Ou(r,e)};function _6(r,e){Ou(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var $u=function(){return $u=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},$u.apply(this,arguments)};function E6(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function x6(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function I6(r,e){return function(t,n){e(t,n,r)}}function D6(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function S6(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function C6(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function O6(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function $6(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Au(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function qp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function A6(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(qp(arguments[e]));return r}function P6(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function Po(r){return this instanceof Po?(this.v=r,this):new Po(r)}function T6(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(x){return new Promise(function(S,P){a.push([y,x,S,P])>1||u(y,x)})})}function u(y,x){try{f(n[y](x))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof Po?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,x){y(x),a.shift(),a.length&&u(a[0][0],a[0][1])}}function R6(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:Po(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function N6(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Au=="function"?Au(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function L6(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function M6(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function U6(r){return r&&r.__esModule?r:{default:r}}function j6(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function F6(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var B6=Object.freeze({__proto__:null,__extends:_6,get __assign(){return $u},__rest:E6,__decorate:x6,__param:I6,__metadata:D6,__awaiter:S6,__generator:C6,__createBinding:O6,__exportStar:$6,__values:Au,__read:qp,__spread:A6,__spreadArrays:P6,__await:Po,__asyncGenerator:T6,__asyncDelegator:R6,__asyncValues:N6,__makeTemplateObject:L6,__importStar:M6,__importDefault:U6,__classPrivateFieldGet:j6,__classPrivateFieldSet:F6}),k6=Pi(B6),Nn={},zp;function q6(){if(zp)return Nn;zp=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.isBrowserCryptoAvailable=Nn.getSubtleCrypto=Nn.getBrowerCrypto=void 0;function r(){return yr?.crypto||yr?.msCrypto||{}}Nn.getBrowerCrypto=r;function e(){const n=r();return n.subtle||n.webkitSubtle}Nn.getSubtleCrypto=e;function t(){return!!r()&&!!e()}return Nn.isBrowserCryptoAvailable=t,Nn}var Ln={},Hp;function z6(){if(Hp)return Ln;Hp=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.isBrowser=Ln.isNode=Ln.isReactNative=void 0;function r(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ln.isReactNative=r;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Ln.isNode=e;function t(){return!r()&&!e()}return Ln.isBrowser=t,Ln}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=k6;e.__exportStar(q6(),r),e.__exportStar(z6(),r)})(kp);function Pu(r=3){const e=Date.now()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}function Wp(r=6){return BigInt(Pu(r))}function Ss(r,e,t){return{id:t||Pu(),jsonrpc:"2.0",method:r,params:e}}function za(r,e){return{id:r,jsonrpc:"2.0",result:e}}function Ha(r,e,t){return{id:r,jsonrpc:"2.0",error:H6(e,t)}}function H6(r,e){return typeof r>"u"?Fp(Up):(typeof r=="string"&&(r=Object.assign(Object.assign({},Fp(Cu)),{message:r})),typeof e<"u"&&(r.data=e),w6(r.code)&&(r=b6(r.code)),r)}class W6{}class K6 extends W6{constructor(){super()}}class V6 extends K6{constructor(e){super()}}const G6="^https?:",Y6="^wss?:";function J6(r){const e=r.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Kp(r,e){const t=J6(r);return typeof t>"u"?!1:new RegExp(e).test(t)}function Vp(r){return Kp(r,G6)}function Gp(r){return Kp(r,Y6)}function Z6(r){return new RegExp("wss?://localhost(:d{2,5})?").test(r)}function Yp(r){return typeof r=="object"&&"id"in r&&"jsonrpc"in r&&r.jsonrpc==="2.0"}function Tu(r){return Yp(r)&&"method"in r}function Wa(r){return Yp(r)&&(Mn(r)||dn(r))}function Mn(r){return"result"in r}function dn(r){return"error"in r}class Un extends V6{constructor(e){super(e),this.events=new lr.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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Ss(e.method,e.params||[],e.id||Wp().toString()),t)}async requestStrict(e,t){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{dn(a)?i(a.error):n(a.result)});try{await this.connection.send(e,t)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Wa(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 Q6=()=>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"),X6=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Jp=r=>r.split("?")[0],Zp=10,eE=Q6();class tE{constructor(e){if(this.url=e,this.events=new lr.exports.EventEmitter,this.registering=!1,!Gp(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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ji(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!Gp(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),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((t,n)=>{const i=new URLSearchParams(e).get("origin"),a=kp.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!Z6(e)},c=new eE(e,[],a);X6()?c.onerror=u=>{const f=u;n(this.emitError(f.error))}:c.on("error",u=>{n(this.emitError(u))}),c.onopen=()=>{this.onOpen(c),t(c)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),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 t=typeof e.data=="string"?Do(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),i=n.message||n.toString(),a=Ha(e,i);this.events.emit("payload",a)}parseError(e,t=this.url){return Bp(e,Jp(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Zp&&this.events.setMaxListeners(Zp)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Jp(this.url)}`));return this.events.emit("register_error",t),t}}var Ru={exports:{}};(function(r,e){var t=200,n="__lodash_hash_undefined__",i=1,a=2,c=9007199254740991,u="[object Arguments]",f="[object Array]",h="[object AsyncFunction]",m="[object Boolean]",w="[object Date]",y="[object Error]",x="[object Function]",S="[object GeneratorFunction]",P="[object Map]",U="[object Number]",j="[object Null]",A="[object Object]",T="[object Promise]",C="[object Proxy]",$="[object RegExp]",E="[object Set]",d="[object String]",b="[object Symbol]",H="[object Undefined]",F="[object WeakMap]",V="[object ArrayBuffer]",se="[object DataView]",ce="[object Float32Array]",I="[object Float64Array]",N="[object Int8Array]",X="[object Int16Array]",ee="[object Int32Array]",Y="[object Uint8Array]",J="[object Uint8ClampedArray]",Q="[object Uint16Array]",ie="[object Uint32Array]",Ee=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,xe=/^(?:0|[1-9]\d*)$/,de={};de[ce]=de[I]=de[N]=de[X]=de[ee]=de[Y]=de[J]=de[Q]=de[ie]=!0,de[u]=de[f]=de[V]=de[m]=de[se]=de[w]=de[y]=de[x]=de[P]=de[U]=de[A]=de[$]=de[E]=de[d]=de[F]=!1;var be=typeof yr=="object"&&yr&&yr.Object===Object&&yr,K=typeof self=="object"&&self&&self.Object===Object&&self,W=be||K||Function("return this")(),B=e&&!e.nodeType&&e,g=B&&!0&&r&&!r.nodeType&&r,L=g&&g.exports===B,le=L&&be.process,pe=function(){try{return le&&le.binding&&le.binding("util")}catch{}}(),Ce=pe&&pe.isTypedArray;function Ke(O,k){for(var ne=-1,ge=O==null?0:O.length,vt=0,Ne=[];++ne<ge;){var Et=O[ne];k(Et,ne,O)&&(Ne[vt++]=Et)}return Ne}function Je(O,k){for(var ne=-1,ge=k.length,vt=O.length;++ne<ge;)O[vt+ne]=k[ne];return O}function ke(O,k){for(var ne=-1,ge=O==null?0:O.length;++ne<ge;)if(k(O[ne],ne,O))return!0;return!1}function St(O,k){for(var ne=-1,ge=Array(O);++ne<O;)ge[ne]=k(ne);return ge}function Ct(O){return function(k){return O(k)}}function ze(O,k){return O.has(k)}function Oe(O,k){return O?.[k]}function Ue(O){var k=-1,ne=Array(O.size);return O.forEach(function(ge,vt){ne[++k]=[vt,ge]}),ne}function je(O,k){return function(ne){return O(k(ne))}}function He(O){var k=-1,ne=Array(O.size);return O.forEach(function(ge){ne[++k]=ge}),ne}var Ae=Array.prototype,Fe=Function.prototype,Se=Object.prototype,Te=W["__core-js_shared__"],Ve=Fe.toString,$e=Se.hasOwnProperty,Ze=function(){var O=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return O?"Symbol(src)_1."+O:""}(),et=Se.toString,at=RegExp("^"+Ve.call($e).replace(Ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ct=L?W.Buffer:void 0,nt=W.Symbol,Sr=W.Uint8Array,Ur=Se.propertyIsEnumerable,On=Ae.splice,Cr=nt?nt.toStringTag:void 0,Wn=Object.getOwnPropertySymbols,bi=ct?ct.isBuffer:void 0,rs=je(Object.keys,Object),Lt=Gr(W,"DataView"),Ot=Gr(W,"Map"),Mt=Gr(W,"Promise"),Ut=Gr(W,"Set"),Tt=Gr(W,"WeakMap"),$t=Gr(Object,"create"),Gt=Vn(Lt),Yt=Vn(Ot),jt=Vn(Mt),Jt=Vn(Ut),Ft=Vn(Tt),Ht=nt?nt.prototype:void 0,Bt=Ht?Ht.valueOf:void 0;function _t(O){var k=-1,ne=O==null?0:O.length;for(this.clear();++k<ne;){var ge=O[k];this.set(ge[0],ge[1])}}function Zt(){this.__data__=$t?$t(null):{},this.size=0}function Qt(O){var k=this.has(O)&&delete this.__data__[O];return this.size-=k?1:0,k}function lf(O){var k=this.__data__;if($t){var ne=k[O];return ne===n?void 0:ne}return $e.call(k,O)?k[O]:void 0}function uf(O){var k=this.__data__;return $t?k[O]!==void 0:$e.call(k,O)}function hf(O,k){var ne=this.__data__;return this.size+=this.has(O)?0:1,ne[O]=$t&&k===void 0?n:k,this}_t.prototype.clear=Zt,_t.prototype.delete=Qt,_t.prototype.get=lf,_t.prototype.has=uf,_t.prototype.set=hf;function rn(O){var k=-1,ne=O==null?0:O.length;for(this.clear();++k<ne;){var ge=O[k];this.set(ge[0],ge[1])}}function ff(){this.__data__=[],this.size=0}function df(O){var k=this.__data__,ne=ns(k,O);if(ne<0)return!1;var ge=k.length-1;return ne==ge?k.pop():On.call(k,ne,1),--this.size,!0}function pf(O){var k=this.__data__,ne=ns(k,O);return ne<0?void 0:k[ne][1]}function gf(O){return ns(this.__data__,O)>-1}function mf(O,k){var ne=this.__data__,ge=ns(ne,O);return ge<0?(++this.size,ne.push([O,k])):ne[ge][1]=k,this}rn.prototype.clear=ff,rn.prototype.delete=df,rn.prototype.get=pf,rn.prototype.has=gf,rn.prototype.set=mf;function Kn(O){var k=-1,ne=O==null?0:O.length;for(this.clear();++k<ne;){var ge=O[k];this.set(ge[0],ge[1])}}function Ks(){this.size=0,this.__data__={hash:new _t,map:new(Ot||rn),string:new _t}}function vf(O){var k=_i(this,O).delete(O);return this.size-=k?1:0,k}function Vs(O){return _i(this,O).get(O)}function yf(O){return _i(this,O).has(O)}function wf(O,k){var ne=_i(this,O),ge=ne.size;return ne.set(O,k),this.size+=ne.size==ge?0:1,this}Kn.prototype.clear=Ks,Kn.prototype.delete=vf,Kn.prototype.get=Vs,Kn.prototype.has=yf,Kn.prototype.set=wf;function Gs(O){var k=-1,ne=O==null?0:O.length;for(this.__data__=new Kn;++k<ne;)this.add(O[k])}function Cc(O){return this.__data__.set(O,n),this}function Oc(O){return this.__data__.has(O)}Gs.prototype.add=Gs.prototype.push=Cc,Gs.prototype.has=Oc;function gn(O){var k=this.__data__=new rn(O);this.size=k.size}function bf(){this.__data__=new rn,this.size=0}function _f(O){var k=this.__data__,ne=k.delete(O);return this.size=k.size,ne}function Ef(O){return this.__data__.get(O)}function xf(O){return this.__data__.has(O)}function $c(O,k){var ne=this.__data__;if(ne instanceof rn){var ge=ne.__data__;if(!Ot||ge.length<t-1)return ge.push([O,k]),this.size=++ne.size,this;ne=this.__data__=new Kn(ge)}return ne.set(O,k),this.size=ne.size,this}gn.prototype.clear=bf,gn.prototype.delete=_f,gn.prototype.get=Ef,gn.prototype.has=xf,gn.prototype.set=$c;function Ac(O,k){var ne=Zs(O),ge=!ne&&qc(O),vt=!ne&&!ge&&sa(O),Ne=!ne&&!ge&&!vt&&Wc(O),Et=ne||ge||vt||Ne,Xt=Et?St(O.length,String):[],it=Xt.length;for(var yt in O)(k||$e.call(O,yt))&&!(Et&&(yt=="length"||vt&&(yt=="offset"||yt=="parent")||Ne&&(yt=="buffer"||yt=="byteLength"||yt=="byteOffset")||Uc(yt,it)))&&Xt.push(yt);return Xt}function ns(O,k){for(var ne=O.length;ne--;)if(kc(O[ne][0],k))return ne;return-1}function na(O,k,ne){var ge=k(O);return Zs(O)?ge:Je(ge,ne(O))}function is(O){return O==null?O===void 0?H:j:Cr&&Cr in Object(O)?Lc(O):Sf(O)}function ia(O){return os(O)&&is(O)==u}function ss(O,k,ne,ge,vt){return O===k?!0:O==null||k==null||!os(O)&&!os(k)?O!==O&&k!==k:Pc(O,k,ne,ge,ss,vt)}function Pc(O,k,ne,ge,vt,Ne){var Et=Zs(O),Xt=Zs(k),it=Et?f:$n(O),yt=Xt?f:$n(k);it=it==u?A:it,yt=yt==u?A:yt;var Wt=it==A,jr=yt==A,er=it==yt;if(er&&sa(O)){if(!sa(k))return!1;Et=!0,Wt=!1}if(er&&!Wt)return Ne||(Ne=new gn),Et||Wc(O)?Ys(O,k,ne,ge,vt,Ne):Df(O,k,it,ne,ge,vt,Ne);if(!(ne&i)){var xt=Wt&&$e.call(O,"__wrapped__"),Or=jr&&$e.call(k,"__wrapped__");if(xt||Or){var mn=xt?O.value():O,nn=Or?k.value():k;return Ne||(Ne=new gn),vt(mn,nn,ne,ge,Ne)}}return er?(Ne||(Ne=new gn),Nc(O,k,ne,ge,vt,Ne)):!1}function If(O){if(!Hc(O)||Fc(O))return!1;var k=Qs(O)?at:ae;return k.test(Vn(O))}function Tc(O){return os(O)&&zc(O.length)&&!!de[is(O)]}function Rc(O){if(!Bc(O))return rs(O);var k=[];for(var ne in Object(O))$e.call(O,ne)&&ne!="constructor"&&k.push(ne);return k}function Ys(O,k,ne,ge,vt,Ne){var Et=ne&i,Xt=O.length,it=k.length;if(Xt!=it&&!(Et&&it>Xt))return!1;var yt=Ne.get(O);if(yt&&Ne.get(k))return yt==k;var Wt=-1,jr=!0,er=ne&a?new Gs:void 0;for(Ne.set(O,k),Ne.set(k,O);++Wt<Xt;){var xt=O[Wt],Or=k[Wt];if(ge)var mn=Et?ge(Or,xt,Wt,k,O,Ne):ge(xt,Or,Wt,O,k,Ne);if(mn!==void 0){if(mn)continue;jr=!1;break}if(er){if(!ke(k,function(nn,An){if(!ze(er,An)&&(xt===nn||vt(xt,nn,ne,ge,Ne)))return er.push(An)})){jr=!1;break}}else if(!(xt===Or||vt(xt,Or,ne,ge,Ne))){jr=!1;break}}return Ne.delete(O),Ne.delete(k),jr}function Df(O,k,ne,ge,vt,Ne,Et){switch(ne){case se:if(O.byteLength!=k.byteLength||O.byteOffset!=k.byteOffset)return!1;O=O.buffer,k=k.buffer;case V:return!(O.byteLength!=k.byteLength||!Ne(new Sr(O),new Sr(k)));case m:case w:case U:return kc(+O,+k);case y:return O.name==k.name&&O.message==k.message;case $:case d:return O==k+"";case P:var Xt=Ue;case E:var it=ge&i;if(Xt||(Xt=He),O.size!=k.size&&!it)return!1;var yt=Et.get(O);if(yt)return yt==k;ge|=a,Et.set(O,k);var Wt=Ys(Xt(O),Xt(k),ge,vt,Ne,Et);return Et.delete(O),Wt;case b:if(Bt)return Bt.call(O)==Bt.call(k)}return!1}function Nc(O,k,ne,ge,vt,Ne){var Et=ne&i,Xt=Js(O),it=Xt.length,yt=Js(k),Wt=yt.length;if(it!=Wt&&!Et)return!1;for(var jr=it;jr--;){var er=Xt[jr];if(!(Et?er in k:$e.call(k,er)))return!1}var xt=Ne.get(O);if(xt&&Ne.get(k))return xt==k;var Or=!0;Ne.set(O,k),Ne.set(k,O);for(var mn=Et;++jr<it;){er=Xt[jr];var nn=O[er],An=k[er];if(ge)var oa=Et?ge(An,nn,er,k,O,Ne):ge(nn,An,er,O,k,Ne);if(!(oa===void 0?nn===An||vt(nn,An,ne,ge,Ne):oa)){Or=!1;break}mn||(mn=er=="constructor")}if(Or&&!mn){var as=O.constructor,ar=k.constructor;as!=ar&&"constructor"in O&&"constructor"in k&&!(typeof as=="function"&&as instanceof as&&typeof ar=="function"&&ar instanceof ar)&&(Or=!1)}return Ne.delete(O),Ne.delete(k),Or}function Js(O){return na(O,$f,Mc)}function _i(O,k){var ne=O.__data__;return jc(k)?ne[typeof k=="string"?"string":"hash"]:ne.map}function Gr(O,k){var ne=Oe(O,k);return If(ne)?ne:void 0}function Lc(O){var k=$e.call(O,Cr),ne=O[Cr];try{O[Cr]=void 0;var ge=!0}catch{}var vt=et.call(O);return ge&&(k?O[Cr]=ne:delete O[Cr]),vt}var Mc=Wn?function(O){return O==null?[]:(O=Object(O),Ke(Wn(O),function(k){return Ur.call(O,k)}))}:mt,$n=is;(Lt&&$n(new Lt(new ArrayBuffer(1)))!=se||Ot&&$n(new Ot)!=P||Mt&&$n(Mt.resolve())!=T||Ut&&$n(new Ut)!=E||Tt&&$n(new Tt)!=F)&&($n=function(O){var k=is(O),ne=k==A?O.constructor:void 0,ge=ne?Vn(ne):"";if(ge)switch(ge){case Gt:return se;case Yt:return P;case jt:return T;case Jt:return E;case Ft:return F}return k});function Uc(O,k){return k=k??c,!!k&&(typeof O=="number"||xe.test(O))&&O>-1&&O%1==0&&O<k}function jc(O){var k=typeof O;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?O!=="__proto__":O===null}function Fc(O){return!!Ze&&Ze in O}function Bc(O){var k=O&&O.constructor,ne=typeof k=="function"&&k.prototype||Se;return O===ne}function Sf(O){return et.call(O)}function Vn(O){if(O!=null){try{return Ve.call(O)}catch{}try{return O+""}catch{}}return""}function kc(O,k){return O===k||O!==O&&k!==k}var qc=ia(function(){return arguments}())?ia:function(O){return os(O)&&$e.call(O,"callee")&&!Ur.call(O,"callee")},Zs=Array.isArray;function Cf(O){return O!=null&&zc(O.length)&&!Qs(O)}var sa=bi||gt;function Of(O,k){return ss(O,k)}function Qs(O){if(!Hc(O))return!1;var k=is(O);return k==x||k==S||k==h||k==C}function zc(O){return typeof O=="number"&&O>-1&&O%1==0&&O<=c}function Hc(O){var k=typeof O;return O!=null&&(k=="object"||k=="function")}function os(O){return O!=null&&typeof O=="object"}var Wc=Ce?Ct(Ce):Tc;function $f(O){return Cf(O)?Ac(O):Rc(O)}function mt(){return[]}function gt(){return!1}r.exports=Of})(Ru,Ru.exports);var rE=Ru.exports;function nE(r,e){return e=e||{},new Promise(function(t,n){var i=new XMLHttpRequest,a=[],c=[],u={},f=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:f,headers:{keys:function(){return a},entries:function(){return c},get:function(m){return u[m.toLowerCase()]},has:function(m){return m.toLowerCase()in u}}}};for(var h in i.open(e.method||"get",r,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(m,w,y){a.push(w=w.toLowerCase()),c.push([w,y]),u[w]=u[w]?u[w]+","+y:y}),t(f())},i.onerror=n,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(h,e.headers[h]);i.send(e.body||null)})}var iE=Object.freeze({__proto__:null,default:nE}),Qp=Pi(iE),sE=self.fetch||(self.fetch=Qp.default||Qp),oE=Object.defineProperty,Xp=Object.getOwnPropertySymbols,aE=Object.prototype.hasOwnProperty,cE=Object.prototype.propertyIsEnumerable,e1=(r,e,t)=>e in r?oE(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,xr=(r,e)=>{for(var t in e||(e={}))aE.call(e,t)&&e1(r,t,e[t]);if(Xp)for(var t of Xp(e))cE.call(e,t)&&e1(r,t,e[t]);return r};function lE(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var a=r.charAt(i),c=a.charCodeAt(0);if(t[c]!==255)throw new TypeError(a+" is ambiguous");t[c]=i}var u=r.length,f=r.charAt(0),h=Math.log(u)/Math.log(256),m=Math.log(256)/Math.log(u);function w(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var P=0,U=0,j=0,A=S.length;j!==A&&S[j]===0;)j++,P++;for(var T=(A-j)*m+1>>>0,C=new Uint8Array(T);j!==A;){for(var $=S[j],E=0,d=T-1;($!==0||E<U)&&d!==-1;d--,E++)$+=256*C[d]>>>0,C[d]=$%u>>>0,$=$/u>>>0;if($!==0)throw new Error("Non-zero carry");U=E,j++}for(var b=T-U;b!==T&&C[b]===0;)b++;for(var H=f.repeat(P);b<T;++b)H+=r.charAt(C[b]);return H}function y(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var P=0;if(S[P]!==" "){for(var U=0,j=0;S[P]===f;)U++,P++;for(var A=(S.length-P)*h+1>>>0,T=new Uint8Array(A);S[P];){var C=t[S.charCodeAt(P)];if(C===255)return;for(var $=0,E=A-1;(C!==0||$<j)&&E!==-1;E--,$++)C+=u*T[E]>>>0,T[E]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");j=$,P++}if(S[P]!==" "){for(var d=A-j;d!==A&&T[d]===0;)d++;for(var b=new Uint8Array(U+(A-d)),H=U;d!==A;)b[H++]=T[d++];return b}}}function x(S){var P=y(S);if(P)return P;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:y,decode:x}}var uE=lE,hE=uE;const t1=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},fE=r=>new TextEncoder().encode(r),dE=r=>new TextDecoder().decode(r);class pE{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class gE{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.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 r1(this,e)}}class mE{constructor(e){this.decoders=e}or(e){return r1(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 r1=(r,e)=>new mE(xr(xr({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e}));class vE{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new pE(e,t,n),this.decoder=new gE(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ka=({name:r,prefix:e,encode:t,decode:n})=>new vE(r,e,t,n),To=({prefix:r,name:e,alphabet:t})=>{const{encode:n,decode:i}=hE(t,e);return Ka({prefix:r,name:e,encode:n,decode:a=>t1(i(a))})},yE=(r,e,t,n)=>{const i={};for(let m=0;m<e.length;++m)i[e[m]]=m;let a=r.length;for(;r[a-1]==="=";)--a;const c=new Uint8Array(a*t/8|0);let u=0,f=0,h=0;for(let m=0;m<a;++m){const w=i[r[m]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<t|w,u+=t,u>=8&&(u-=8,c[h++]=255&f>>u)}if(u>=t||255&f<<8-u)throw new SyntaxError("Unexpected end of data");return c},wE=(r,e,t)=>{const n=e[e.length-1]==="=",i=(1<<t)-1;let a="",c=0,u=0;for(let f=0;f<r.length;++f)for(u=u<<8|r[f],c+=8;c>t;)c-=t,a+=e[i&u>>c];if(c&&(a+=e[i&u<<t-c]),n)for(;a.length*t&7;)a+="=";return a},hr=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Ka({prefix:e,name:r,encode(i){return wE(i,n,t)},decode(i){return yE(i,n,t,r)}}),bE=Ka({prefix:"\0",name:"identity",encode:r=>dE(r),decode:r=>fE(r)});var _E=Object.freeze({__proto__:null,identity:bE});const EE=hr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var xE=Object.freeze({__proto__:null,base2:EE});const IE=hr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var DE=Object.freeze({__proto__:null,base8:IE});const SE=To({prefix:"9",name:"base10",alphabet:"0123456789"});var CE=Object.freeze({__proto__:null,base10:SE});const OE=hr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$E=hr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var AE=Object.freeze({__proto__:null,base16:OE,base16upper:$E});const PE=hr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),TE=hr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),RE=hr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),NE=hr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),LE=hr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ME=hr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),UE=hr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),jE=hr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),FE=hr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var BE=Object.freeze({__proto__:null,base32:PE,base32upper:TE,base32pad:RE,base32padupper:NE,base32hex:LE,base32hexupper:ME,base32hexpad:UE,base32hexpadupper:jE,base32z:FE});const kE=To({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),qE=To({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var zE=Object.freeze({__proto__:null,base36:kE,base36upper:qE});const HE=To({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),WE=To({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var KE=Object.freeze({__proto__:null,base58btc:HE,base58flickr:WE});const VE=hr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),GE=hr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),YE=hr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),JE=hr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ZE=Object.freeze({__proto__:null,base64:VE,base64pad:GE,base64url:YE,base64urlpad:JE});const n1=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}"),QE=n1.reduce((r,e,t)=>(r[t]=e,r),[]),XE=n1.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function e4(r){return r.reduce((e,t)=>(e+=QE[t],e),"")}function t4(r){const e=[];for(const t of r){const n=XE[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}const r4=Ka({prefix:"\u{1F680}",name:"base256emoji",encode:e4,decode:t4});var n4=Object.freeze({__proto__:null,base256emoji:r4}),i4=s1,i1=128,s4=127,o4=~s4,a4=Math.pow(2,31);function s1(r,e,t){e=e||[],t=t||0;for(var n=t;r>=a4;)e[t++]=r&255|i1,r/=128;for(;r&o4;)e[t++]=r&255|i1,r>>>=7;return e[t]=r|0,s1.bytes=t-n+1,e}var c4=Nu,l4=128,o1=127;function Nu(r,n){var t=0,n=n||0,i=0,a=n,c,u=r.length;do{if(a>=u)throw Nu.bytes=0,new RangeError("Could not decode varint");c=r[a++],t+=i<28?(c&o1)<<i:(c&o1)*Math.pow(2,i),i+=7}while(c>=l4);return Nu.bytes=a-n,t}var u4=Math.pow(2,7),h4=Math.pow(2,14),f4=Math.pow(2,21),d4=Math.pow(2,28),p4=Math.pow(2,35),g4=Math.pow(2,42),m4=Math.pow(2,49),v4=Math.pow(2,56),y4=Math.pow(2,63),w4=function(r){return r<u4?1:r<h4?2:r<f4?3:r<d4?4:r<p4?5:r<g4?6:r<m4?7:r<v4?8:r<y4?9:10},b4={encode:i4,decode:c4,encodingLength:w4},a1=b4;const c1=(r,e,t=0)=>(a1.encode(r,e,t),e),l1=r=>a1.encodingLength(r),Lu=(r,e)=>{const t=e.byteLength,n=l1(r),i=n+l1(t),a=new Uint8Array(i+t);return c1(r,a,0),c1(t,a,n),a.set(e,i),new _4(r,t,e,a)};class _4{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}}const u1=({name:r,code:e,encode:t})=>new E4(r,e,t);class E4{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Lu(this.code,t):t.then(n=>Lu(this.code,n))}else throw Error("Unknown type, must be binary type")}}const h1=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),x4=u1({name:"sha2-256",code:18,encode:h1("SHA-256")}),I4=u1({name:"sha2-512",code:19,encode:h1("SHA-512")});var D4=Object.freeze({__proto__:null,sha256:x4,sha512:I4});const f1=0,S4="identity",d1=t1;var C4=Object.freeze({__proto__:null,identity:{code:f1,name:S4,encode:d1,digest:r=>Lu(f1,d1(r))}});new TextEncoder,new TextDecoder;const p1=xr(xr(xr(xr(xr(xr(xr(xr(xr(xr({},_E),xE),DE),CE),AE),BE),zE),KE),ZE),n4);xr(xr({},D4),C4);function g1(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function O4(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?g1(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function m1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}const v1=m1("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Mu=m1("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=O4(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),$4=xr({utf8:v1,"utf-8":v1,hex:p1.base16,latin1:Mu,ascii:Mu,binary:Mu},p1);function A4(r,e="utf8"){const t=$4[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?g1(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}const y1="wc",P4=2,Uu="core",si=`${y1}@2:${Uu}:`,T4={name:Uu,logger:"error"},R4={database:":memory:"},N4="crypto",w1="client_ed25519_seed",L4=ye.ONE_DAY,M4="keychain",U4="0.3",j4="messages",F4="0.3",B4=ye.SIX_HOURS,k4="publisher",b1="irn",q4="error",_1="wss://relay.walletconnect.com",E1="wss://relay.walletconnect.org",z4="relayer",pr={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"},H4="_subscription",jn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},W4=ye.ONE_SECOND,K4="2.11.2",V4=1e4,G4="0.3",Y4="WALLETCONNECT_CLIENT_ID",pn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},J4="subscription",Z4="0.3",Q4=ye.FIVE_SECONDS*1e3,X4="pairing",e8="0.3",Ro={wc_pairingDelete:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:0},res:{ttl:ye.ONE_DAY,prompt:!1,tag:0}}},No={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},xn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},t8="history",r8="0.3",n8="expirer",en={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},i8="0.3",ju="verify-api",Cs="https://verify.walletconnect.com",Fu="https://verify.walletconnect.org",s8=[Cs,Fu],o8="echo",a8="https://echo.walletconnect.com";class c8{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=M4,this.version=U4,this.initialized=!1,this.storagePrefix=si,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:a}=ue("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(a)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Z0(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Q0(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class l8{constructor(e,t,n){this.core=e,this.logger=t,this.name=N4,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(),a=Mp(i);return Lp(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=X2();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const a=await this.getClientSeed(),c=Mp(a),u=su();return await d6(u,i,L4,c)},this.generateSharedKey=(i,a,c)=>{this.isInitialized();const u=this.getPrivateKey(i),f=e_(u,a);return this.setSymKey(f,c)},this.setSymKey=async(i,a)=>{this.isInitialized();const c=a||t_(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,a,c)=>{this.isInitialized();const u=K0(c),f=ji(a);if(V0(u)){const y=u.senderPublicKey,x=u.receiverPublicKey;i=await this.generateSharedKey(y,x)}const h=this.getSymKey(i),{type:m,senderPublicKey:w}=u;return n_({type:m,symKey:h,message:f,senderPublicKey:w})},this.decode=async(i,a,c)=>{this.isInitialized();const u=o_(a,c);if(V0(u)){const f=u.receiverPublicKey,h=u.senderPublicKey;i=await this.generateSharedKey(f,h)}try{const f=this.getSymKey(i),h=i_({symKey:f,encoded:a});return Do(h)}catch(f){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(f)}},this.getPayloadType=i=>{const a=Ra(i);return wo(a.type)},this.getPayloadSenderPublicKey=i=>{const a=Ra(i);return a.senderPublicKey?wr(a.senderPublicKey,br):void 0},this.core=e,this.logger=Xe.generateChildLogger(t,this.name),this.keychain=n||new c8(this.core,this.logger)}get context(){return Xe.getLoggerContext(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(w1)}catch{e=su(),await this.keychain.set(w1,e)}return A4(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class u8 extends H5{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=j4,this.version=F4,this.initialized=!1,this.storagePrefix=si,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 a=bs(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[a]<"u"||(c[a]=i,this.messages.set(n,c),await this.persist()),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const a=this.get(n),c=bs(i);return typeof a[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=Xe.generateChildLogger(e,this.name),this.core=t}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Z0(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Q0(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class h8 extends W5{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new lr.exports.EventEmitter,this.name=k4,this.queue=new Map,this.publishTimeout=ye.toMiliseconds(ye.TEN_SECONDS*2),this.needsTransportRestart=!1,this.publish=async(n,i,a)=>{var c;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}});try{const u=a?.ttl||B4,f=cu(a),h=a?.prompt||!1,m=a?.tag||0,w=a?.id||Wp().toString(),y={topic:n,message:i,opts:{ttl:u,relay:f,prompt:h,tag:m,id:w}},x=setTimeout(()=>this.queue.set(w,y),this.publishTimeout);try{await await _o(this.rpcPublish(n,i,u,f,h,m,w),this.publishTimeout,`Failed to publish payload, please try again. id:${w} tag:${m}`),this.removeRequestFromQueue(w),this.relayer.events.emit(pr.publish,y)}catch(S){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(c=a?.internal)!=null&&c.throwOnFailedPublish)throw this.removeRequestFromQueue(w),S;return}finally{clearTimeout(x)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}})}catch(u){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(u),u}},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=Xe.generateChildLogger(t,this.name),this.registerEventListeners()}get context(){return Xe.getLoggerContext(this.logger)}rpcPublish(e,t,n,i,a,c,u){var f,h,m,w;const y={method:Na(i.protocol).publish,params:{topic:e,message:t,ttl:n,prompt:a,tag:c},id:u};return _r((f=y.params)==null?void 0:f.prompt)&&((h=y.params)==null||delete h.prompt),_r((m=y.params)==null?void 0:m.tag)&&((w=y.params)==null||delete w.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:y}),this.relayer.request(y)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:n,opts:i}=e;await this.publish(t,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(pr.connection_stalled);return}this.checkQueue()}),this.relayer.on(pr.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class f8{constructor(){this.map=new Map,this.set=(e,t)=>{const n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,t))return;const i=n.filter(a=>a!==t);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 d8=Object.defineProperty,p8=Object.defineProperties,g8=Object.getOwnPropertyDescriptors,x1=Object.getOwnPropertySymbols,m8=Object.prototype.hasOwnProperty,v8=Object.prototype.propertyIsEnumerable,I1=(r,e,t)=>e in r?d8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Lo=(r,e)=>{for(var t in e||(e={}))m8.call(e,t)&&I1(r,t,e[t]);if(x1)for(var t of x1(e))v8.call(e,t)&&I1(r,t,e[t]);return r},Bu=(r,e)=>p8(r,g8(e));class y8 extends G5{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new f8,this.events=new lr.exports.EventEmitter,this.name=J4,this.version=Z4,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=si,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 a=cu(i),c={topic:n,relay:a};this.pending.set(n,c);const u=await this.rpcSubscribe(n,a);return this.onSubscribe(u,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),u}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},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=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((a,c)=>{const u=new ye.Watch;u.start(i);const f=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(f),u.stop(i),a(!0)),u.elapsed(i)>=Q4&&(clearInterval(f),u.stop(i),c(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=Xe.generateChildLogger(t,this.name),this.clientId=""}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+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,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,t)))}async unsubscribeById(e,t,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}});try{const i=cu(n);await this.rpcUnsubscribe(e,t,i);const a=It("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,t){const n={method:Na(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await _o(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(pr.connection_stalled)}return bs(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,n={method:Na(t.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 _o(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(pr.connection_stalled)}}rpcUnsubscribe(e,t,n){const i={method:Na(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,t){this.setSubscription(e,Bu(Lo({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,Lo({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,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,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,Lo({},t)),this.topicMap.set(t.topic,e),this.events.emit(pn.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(pn.deleted,Bu(Lo({},n),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(pn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}}this.events.emit(pn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}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 t=await this.rpcBatchSubscribe(e);En(t)&&this.onBatchSubscribe(t.map((n,i)=>Bu(Lo({},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(t=>{e.push(t)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(pr.connect,async()=>{await this.onConnect()}),this.relayer.on(pr.disconnect,()=>{this.onDisconnect()}),this.events.on(pn.created,async e=>{const t=pn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(pn.deleted,async e=>{const t=pn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var w8=Object.defineProperty,D1=Object.getOwnPropertySymbols,b8=Object.prototype.hasOwnProperty,_8=Object.prototype.propertyIsEnumerable,S1=(r,e,t)=>e in r?w8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,E8=(r,e)=>{for(var t in e||(e={}))b8.call(e,t)&&S1(r,t,e[t]);if(D1)for(var t of D1(e))_8.call(e,t)&&S1(r,t,e[t]);return r};class x8 extends K5{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new lr.exports.EventEmitter,this.name=z4,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.request=async t=>{this.logger.debug("Publishing Request Payload");const n=t.id;try{await this.toEstablishConnection();const i=this.provider.request(t);return this.requestsInFlight.set(n,{promise:i,request:t}),await i}catch(i){throw this.logger.debug("Failed to Publish Request"),this.logger.error(i),i}finally{this.requestsInFlight.delete(n)}},this.onPayloadHandler=t=>{this.onProviderPayload(t)},this.onConnectHandler=()=>{this.events.emit(pr.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(pr.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(jn.payload,this.onPayloadHandler),this.provider.on(jn.connect,this.onConnectHandler),this.provider.on(jn.disconnect,this.onDisconnectHandler),this.provider.on(jn.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Xe.generateChildLogger(e.logger,this.name):Xe.pino(Xe.getDefaultLoggerOptions({level:e.logger||q4})),this.messages=new u8(this.logger,e.core),this.subscriber=new y8(this,this.logger),this.publisher=new h8(this,this.logger),this.relayUrl=e?.relayUrl||_1,this.projectId=e.projectId,this.bundleId=f_(),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 ${E1}...`),await this.restartTransport(E1)}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)},V4)}get context(){return Xe.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";if(i)return i;let a;const c=u=>{u.topic===e&&(this.subscriber.off(pn.created,c),a())};return await Promise.all([new Promise(u=>{a=u,this.subscriber.on(pn.created,c)}),new Promise(async u=>{i=await this.subscriber.subscribe(e,t),u()})]),i}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.requestsInFlight.size>0&&(this.logger.debug("Waiting for all in-flight requests to finish before closing transport..."),this.requestsInFlight.forEach(async e=>{await e.promise})),this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await _o(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(t=>{if(!this.initialized)return t();this.subscriber.once(pn.resubscribed,()=>{t()})}),new Promise(async(t,n)=>{try{await _o(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(i){n(i);return}t()})])}catch(t){this.logger.error(t);const n=t;if(!this.isConnectionStalled(n.message))throw t;this.provider.events.emit(jn.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 up())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Un(new tE(y_({sdkVersion:K4,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:n}=e;await this.messages.set(t,n)}async shouldIgnoreMessageEvent(e){const{topic:t,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const i=this.messages.has(t,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}),Tu(e)){if(!e.method.endsWith(H4))return;const t=e.params,{topic:n,message:i,publishedAt:a}=t.data,c={topic:n,message:i,publishedAt:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(E8({type:"event",event:t.id},c)),this.events.emit(t.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else Wa(e)&&this.events.emit(pr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(pr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=za(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(jn.payload,this.onPayloadHandler),this.provider.off(jn.connect,this.onConnectHandler),this.provider.off(jn.disconnect,this.onDisconnectHandler),this.provider.off(jn.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(pr.connection_stalled,()=>{this.restartTransport().catch(t=>this.logger.error(t))});let e=await up();f3(async t=>{this.initialized&&e!==t&&(e=t,t?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(pr.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},ye.toMiliseconds(W4)))}isInitialized(){if(!this.initialized){const{message:e}=ue("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 t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var I8=Object.defineProperty,C1=Object.getOwnPropertySymbols,D8=Object.prototype.hasOwnProperty,S8=Object.prototype.propertyIsEnumerable,O1=(r,e,t)=>e in r?I8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$1=(r,e)=>{for(var t in e||(e={}))D8.call(e,t)&&O1(r,t,e[t]);if(C1)for(var t of C1(e))S8.call(e,t)&&O1(r,t,e[t]);return r};class Va extends V5{constructor(e,t,n,i=si,a=void 0){super(e,t,n,i),this.core=e,this.logger=t,this.name=n,this.map=new Map,this.version=G4,this.cached=[],this.initialized=!1,this.storagePrefix=si,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!_r(c)?this.map.set(this.getKey(c),c):z_(c)?this.map.set(c.id,c):H_(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,u)=>{this.isInitialized(),this.map.has(c)?await this.update(c,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:u}),this.map.set(c,u),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(u=>Object.keys(c).every(f=>rE(u[f],c[f]))):this.values),this.update=async(c,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:u});const f=$1($1({},this.getData(c)),u);this.map.set(c,f),await this.persist()},this.delete=async(c,u)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:u}),this.map.delete(c),await this.persist())},this.logger=Xe.generateChildLogger(t,this.name),this.storagePrefix=i,this.getKey=a}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+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 t=this.map.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return t}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:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class C8{constructor(e,t){this.core=e,this.logger=t,this.name=X4,this.version=e8,this.events=new lr.exports,this.initialized=!1,this.storagePrefix=si,this.ignoredPayloadTypes=[Li],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=su(),i=await this.core.crypto.setSymKey(n),a=Wr(ye.FIVE_MINUTES),c={protocol:b1},u={topic:i,expiry:a,relay:c,active:!1},f=N_({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:c,expiryTimestamp:a});return await this.pairings.set(i,u),await this.core.relayer.subscribe(i),this.core.expirer.set(i,a),{topic:i,uri:f}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:a,relay:c,expiryTimestamp:u}=np(n.uri);let f;if(this.pairings.keys.includes(i)&&(f=this.pairings.get(i),f.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);const h=u||Wr(ye.FIVE_MINUTES),m={topic:i,relay:c,expiry:h,active:!1};return await this.pairings.set(i,m),this.core.expirer.set(i,h),n.activatePairing&&await this.activate({topic:i}),this.events.emit(No.create,m),this.core.crypto.keychain.has(i)||(await this.core.crypto.setSymKey(a,i),await this.core.relayer.subscribe(i,{relay:c})),m},this.activate=async({topic:n})=>{this.isInitialized();const i=Wr(ye.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 a=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:u,reject:f}=xs();this.events.once(qt("pairing_ping",a),({error:h})=>{h?f(h):u()}),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",It("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,a)=>{const c=Ss(i,a),u=await this.core.crypto.encode(n,c),f=Ro[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,u,f),c.id},this.sendResult=async(n,i,a)=>{const c=za(n,a),u=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=Ro[f.request.method].res;await this.core.relayer.publish(i,u,h),await this.core.history.resolve(c)},this.sendError=async(n,i,a)=>{const c=Ha(n,a),u=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=Ro[f.request.method]?Ro[f.request.method].res:Ro.unregistered_method.res;await this.core.relayer.publish(i,u,h),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,It("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=>ii(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:a}=n;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(i,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,a);default:return this.onUnknownRpcMethodRequest(i,a)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:a}=n,c=(await this.core.history.get(i,a.id)).request.method;switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:a}=i;try{this.isValidPing({topic:n}),await this.sendResult(a,n,!0),this.events.emit(No.ping,{id:a,topic:n})}catch(c){await this.sendError(a,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:a}=i;setTimeout(()=>{Mn(i)?this.events.emit(qt("pairing_ping",a),{}):dn(i)&&this.events.emit(qt("pairing_ping",a),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(No.delete,{id:a,topic:n})}catch(c){await this.sendError(a,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:a,method:c}=i;try{if(this.registeredMethods.includes(c))return;const u=It("WC_METHOD_UNSUPPORTED",c);await this.sendError(a,n,u),this.logger.error(u)}catch(u){await this.sendError(a,n,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(It("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{var i;if(!Rr(n)){const{message:c}=ue("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(c)}if(!q_(n.uri)){const{message:c}=ue("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(c)}const a=np(n.uri);if(!((i=a?.relay)!=null&&i.protocol)){const{message:c}=ue("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(c)}if(!(a!=null&&a.symKey)){const{message:c}=ue("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(c)}if(a!=null&&a.expiryTimestamp&&ye.toMiliseconds(a?.expiryTimestamp)<Date.now()){const{message:c}=ue("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(c)}},this.isValidPing=async n=>{if(!Rr(n)){const{message:a}=ue("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Rr(n)){const{message:a}=ue("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ir(n,!1)){const{message:i}=ue("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=ue("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(ii(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=ue("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=Xe.generateChildLogger(t,this.name),this.pairings=new Va(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Xe.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(pr.message,async e=>{const{topic:t,message:n}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(t,n);try{Tu(i)?(this.core.history.set(t,i),this.onRelayEventRequest({topic:t,payload:i})):Wa(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:t,payload:i}),this.core.history.delete(t,i.id))}catch(a){this.logger.error(a)}})}registerExpirerEvents(){this.core.expirer.on(en.expired,async e=>{const{topic:t}=ep(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(No.expire,{topic:t}))})}}class O8 extends z5{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new lr.exports.EventEmitter,this.name=t8,this.version=r8,this.cached=[],this.initialized=!1,this.storagePrefix=si,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,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:a}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:a,expiry:Wr(ye.THIRTY_DAYS)};this.records.set(c.id,c),this.events.emit(xn.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=dn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(xn.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(a=>{if(a.topic===n){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(xn.deleted,a)}})},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=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+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(t=>{if(typeof t.response<"u")return;const n={topic:t.topic,request:Ss(t.request.method,t.request.params,t.id),chainId:t.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 t=this.records.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(xn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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(xn.created,e=>{const t=xn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(xn.updated,e=>{const t=xn.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(xn.deleted,e=>{const t=xn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{ye.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}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class $8 extends Y5{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new lr.exports.EventEmitter,this.name=n8,this.version=i8,this.cached=[],this.initialized=!1,this.storagePrefix=si,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 a=this.formatTarget(n),c={target:a,expiry:i};this.expirations.set(a,c),this.checkExpiry(a,c),this.events.emit(en.created,{target:a,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),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(en.deleted,{target:i,expiration:a})}},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=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+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 w_(e);if(typeof e=="number")return b_(e);const{message:t}=ue("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}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(en.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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 t=this.expirations.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return t}checkExpiry(e,t){const{expiry:n}=t;ye.toMiliseconds(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(en.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(en.created,e=>{const t=en.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(en.expired,e=>{const t=en.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(en.deleted,e=>{const t=en.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class A8 extends J5{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=ju,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||_s()||!Es())return;const i=this.getVerifyUrl(n?.verifyUrl);this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(a){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(a)}if(!this.initialized){this.removeIframe(),this.verifyUrl=Fu;try{await this.createIframe()}catch(a){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(a),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=this.getVerifyUrl(n?.verifyUrl);let a;try{a=await this.fetchAttestation(n.attestationId,i)}catch(c){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${i}`),this.logger.info(c),a=await this.fetchAttestation(n.attestationId,Fu)}return a},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const a=this.startAbortTimer(ye.ONE_SECOND*2),c=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(a),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=a=>{a.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(a=>{if(document.getElementById(ju))return a();window.addEventListener("message",i);const c=document.createElement("iframe");c.id=ju,c.src=`${this.verifyUrl}/${this.projectId}`,c.style.display="none",document.body.append(c),this.iframe=c,n=a}),new Promise((a,c)=>setTimeout(()=>{window.removeEventListener("message",i),c("verify iframe load timeout")},ye.toMiliseconds(ye.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=n=>{let i=n||Cs;return s8.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${Cs}`),i=Cs),i},this.logger=Xe.generateChildLogger(t,this.name),this.verifyUrl=Cs,this.abortController=new AbortController,this.isDevEnv=ou()&&process.env.IS_VITEST}get context(){return Xe.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),ye.toMiliseconds(e))}}class P8 extends Z5{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=o8,this.registerDeviceToken=async n=>{const{clientId:i,token:a,notificationType:c,enableEncrypted:u=!1}=n,f=`${a8}/${this.projectId}/clients`;await sE(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:c,token:a,always_raw:u})})},this.logger=Xe.generateChildLogger(t,this.context)}}var T8=Object.defineProperty,A1=Object.getOwnPropertySymbols,R8=Object.prototype.hasOwnProperty,N8=Object.prototype.propertyIsEnumerable,P1=(r,e,t)=>e in r?T8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,T1=(r,e)=>{for(var t in e||(e={}))R8.call(e,t)&&P1(r,t,e[t]);if(A1)for(var t of A1(e))N8.call(e,t)&&P1(r,t,e[t]);return r};class ku extends q5{constructor(e){super(e),this.protocol=y1,this.version=P4,this.name=Uu,this.events=new lr.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||_1,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const t=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||T4.logger}));this.logger=Xe.generateChildLogger(t,this.name),this.heartbeat=new Ds.HeartBeat,this.crypto=new l8(this,this.logger,e?.keychain),this.history=new O8(this,this.logger),this.expirer=new $8(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new K3(T1(T1({},R4),e?.storageOptions)),this.relayer=new x8({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new C8(this,this.logger),this.verify=new A8(this.projectId||"",this.logger),this.echoClient=new P8(this.projectId||"",this.logger)}static async init(e){const t=new ku(e);await t.initialize();const n=await t.crypto.getClientId();return await t.storage.setItem(Y4,n),t}get context(){return Xe.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 L8=ku,R1="wc",N1=2,L1="client",qu=`${R1}@${N1}:${L1}:`,zu={name:L1,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},M1="WALLETCONNECT_DEEPLINK_CHOICE",M8="proposal",U1="Proposal expired",U8="session",Ga=ye.SEVEN_DAYS,j8="engine",Fn={wc_sessionPropose:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1115}}},Hu={min:ye.FIVE_MINUTES,max:ye.SEVEN_DAYS},Bn={idle:"IDLE",active:"ACTIVE"},F8="request",B8=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var k8=Object.defineProperty,q8=Object.defineProperties,z8=Object.getOwnPropertyDescriptors,j1=Object.getOwnPropertySymbols,H8=Object.prototype.hasOwnProperty,W8=Object.prototype.propertyIsEnumerable,F1=(r,e,t)=>e in r?k8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ir=(r,e)=>{for(var t in e||(e={}))H8.call(e,t)&&F1(r,t,e[t]);if(j1)for(var t of j1(e))W8.call(e,t)&&F1(r,t,e[t]);return r},Os=(r,e)=>q8(r,z8(e));class K8 extends X5{constructor(e){super(e),this.name=j8,this.events=new lr.exports,this.initialized=!1,this.ignoredPayloadTypes=[Li],this.requestQueue={state:Bn.idle,queue:[]},this.sessionRequestQueue={state:Bn.idle,queue:[]},this.requestQueueDelay=ye.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Fn)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ye.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();const n=Os(Ir({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:c,sessionProperties:u,relays:f}=n;let h=i,m,w=!1;if(h&&(w=this.client.core.pairing.pairings.get(h).active),!h||!w){const{topic:C,uri:$}=await this.client.core.pairing.create();h=C,m=$}const y=await this.client.core.crypto.generateKeyPair(),x=Fn.wc_sessionPropose.req.ttl||ye.FIVE_MINUTES,S=Wr(x),P=Ir({requiredNamespaces:a,optionalNamespaces:c,relays:f??[{protocol:b1}],proposer:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:S},u&&{sessionProperties:u}),{reject:U,resolve:j,done:A}=xs(x,U1);if(this.events.once(qt("session_connect"),async({error:C,session:$})=>{if(C)U(C);else if($){$.self.publicKey=y;const E=Os(Ir({},$),{requiredNamespaces:P.requiredNamespaces,optionalNamespaces:P.optionalNamespaces});await this.client.session.set($.topic,E),await this.setExpiry($.topic,$.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:$.peer.metadata}),j(E)}}),!h){const{message:C}=ue("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(C)}const T=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:P,throwOnFailedPublish:!0});return await this.setProposal(T,Ir({id:T},P)),{uri:m,approval:A}},this.pair=async t=>(await this.isInitialized(),await this.client.core.pairing.pair(t)),this.approve=async t=>{await this.isInitialized(),await this.isValidApprove(t);const{id:n,relayProtocol:i,namespaces:a,sessionProperties:c}=t,u=this.client.proposal.get(n);let{pairingTopic:f,proposer:h,requiredNamespaces:m,optionalNamespaces:w}=u;f=f||"";const y=await this.client.core.crypto.generateKeyPair(),x=h.publicKey,S=await this.client.core.crypto.generateSharedKey(y,x);f&&n&&(await this.client.core.pairing.updateMetadata({topic:f,metadata:h.metadata}),await this.sendResult({id:n,topic:f,result:{relay:{protocol:i??"irn"},responderPublicKey:y}}),await this.client.proposal.delete(n,It("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:f}));const P=Ir({relay:{protocol:i??"irn"},namespaces:a,pairingTopic:f,controller:{publicKey:y,metadata:this.client.metadata},expiry:Wr(Ga)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(S);const U=Os(Ir({},P),{topic:S,requiredNamespaces:m,optionalNamespaces:w,pairingTopic:f,acknowledged:!1,self:P.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:y});await this.client.session.set(S,U);try{await this.sendRequest({topic:S,method:"wc_sessionSettle",params:P,throwOnFailedPublish:!0})}catch(j){throw this.client.logger.error(j),this.client.session.delete(S,It("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(S),j}return await this.setExpiry(S,Wr(Ga)),{topic:S,acknowledged:()=>new Promise(j=>setTimeout(()=>j(this.client.session.get(S)),500))}},this.reject=async t=>{await this.isInitialized(),await this.isValidReject(t);const{id:n,reason:i}=t,{pairingTopic:a}=this.client.proposal.get(n);a&&(await this.sendError(n,a,i),await this.client.proposal.delete(n,It("USER_DISCONNECTED")))},this.update=async t=>{await this.isInitialized(),await this.isValidUpdate(t);const{topic:n,namespaces:i}=t,a=await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i}}),{done:c,resolve:u,reject:f}=xs();return this.events.once(qt("session_update",a),({error:h})=>{h?f(h):u()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:c}},this.extend=async t=>{await this.isInitialized(),await this.isValidExtend(t);const{topic:n}=t,i=await this.sendRequest({topic:n,method:"wc_sessionExtend",params:{}}),{done:a,resolve:c,reject:u}=xs();return this.events.once(qt("session_extend",i),({error:f})=>{f?u(f):c()}),await this.setExpiry(n,Wr(Ga)),{acknowledged:a}},this.request=async t=>{await this.isInitialized(),await this.isValidRequest(t);const{chainId:n,request:i,topic:a,expiry:c=Fn.wc_sessionRequest.req.ttl}=t,u=Pu(),{done:f,resolve:h,reject:m}=xs(c,"Request expired. Please try again.");return this.events.once(qt("session_request",u),({error:w,result:y})=>{w?m(w):h(y)}),await Promise.all([new Promise(async w=>{await this.sendRequest({clientRpcId:u,topic:a,method:"wc_sessionRequest",params:{request:Os(Ir({},i),{expiryTimestamp:Wr(c)}),chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(y=>m(y)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:u}),w()}),new Promise(async w=>{const y=await E_(this.client.core.storage,M1);__({id:u,topic:a,wcDeepLink:y}),w()}),f()]).then(w=>w[2])},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);const{topic:n,response:i}=t,{id:a}=i;Mn(i)?await this.sendResult({id:a,topic:n,result:i.result,throwOnFailedPublish:!0}):dn(i)&&await this.sendError(a,n,i.error),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized(),await this.isValidPing(t);const{topic:n}=t;if(this.client.session.keys.includes(n)){const i=await this.sendRequest({topic:n,method:"wc_sessionPing",params:{}}),{done:a,resolve:c,reject:u}=xs();this.events.once(qt("session_ping",i),({error:f})=>{f?u(f):c()}),await a()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);const{topic:n,event:i,chainId:a}=t;await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:a}})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);const{topic:n}=t;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:It("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=ue("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(n=>B_(n,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const n=this.client.core.pairing.pairings.get(t.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var c,u;return((c=a.peerMetadata)==null?void 0:c.url)&&((u=a.peerMetadata)==null?void 0:u.url)===t.peer.metadata.url&&a.topic&&a.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async t=>{const{topic:n,expirerHasDeleted:i=!1,emitEvent:a=!0,id:c=0}=t,{self:u}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,It("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(u.publicKey)&&await this.client.core.crypto.deleteKeyPair(u.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),i||this.client.core.expirer.del(n),this.client.core.storage.removeItem(M1).catch(f=>this.client.logger.warn(f)),this.getPendingSessionRequests().forEach(f=>{f.topic===n&&this.deletePendingSessionRequest(f.id,It("USER_DISCONNECTED"))}),a&&this.client.events.emit("session_delete",{id:c,topic:n})},this.deleteProposal=async(t,n)=>{await Promise.all([this.client.proposal.delete(t,It("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(t)])},this.deletePendingSessionRequest=async(t,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,n),i?Promise.resolve():this.client.core.expirer.del(t)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==t),i&&(this.sessionRequestQueue.state=Bn.idle,this.client.events.emit("session_request_expire",{id:t}))},this.setExpiry=async(t,n)=>{this.client.session.keys.includes(t)&&await this.client.session.update(t,{expiry:n}),this.client.core.expirer.set(t,n)},this.setProposal=async(t,n)=>{await this.client.proposal.set(t,n),this.client.core.expirer.set(t,Wr(Fn.wc_sessionPropose.req.ttl))},this.setPendingSessionRequest=async t=>{const{id:n,topic:i,params:a,verifyContext:c}=t,u=a.request.expiryTimestamp||Wr(Fn.wc_sessionRequest.req.ttl);await this.client.pendingRequest.set(n,{id:n,topic:i,params:a,verifyContext:c}),u&&this.client.core.expirer.set(n,u)},this.sendRequest=async t=>{const{topic:n,method:i,params:a,expiry:c,relayRpcId:u,clientRpcId:f,throwOnFailedPublish:h}=t,m=Ss(i,a,f);if(Es()&&B8.includes(i)){const x=bs(JSON.stringify(m));this.client.core.verify.register({attestationId:x})}const w=await this.client.core.crypto.encode(n,m),y=Fn[i].req;return c&&(y.ttl=c),u&&(y.id=u),this.client.core.history.set(n,m),h?(y.internal=Os(Ir({},y.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,w,y)):this.client.core.relayer.publish(n,w,y).catch(x=>this.client.logger.error(x)),m.id},this.sendResult=async t=>{const{id:n,topic:i,result:a,throwOnFailedPublish:c}=t,u=za(n,a),f=await this.client.core.crypto.encode(i,u),h=await this.client.core.history.get(i,n),m=Fn[h.request.method].res;c?(m.internal=Os(Ir({},m.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,f,m)):this.client.core.relayer.publish(i,f,m).catch(w=>this.client.logger.error(w)),await this.client.core.history.resolve(u)},this.sendError=async(t,n,i)=>{const a=Ha(t,i),c=await this.client.core.crypto.encode(n,a),u=await this.client.core.history.get(n,t),f=Fn[u.request.method].res;this.client.core.relayer.publish(n,c,f),await this.client.core.history.resolve(a)},this.cleanup=async()=>{const t=[],n=[];this.client.session.getAll().forEach(i=>{let a=!1;ii(i.expiry)&&(a=!0),this.client.core.crypto.keychain.has(i.topic)||(a=!0),a&&t.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{ii(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...t.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Bn.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=Bn.active;const t=this.requestQueue.queue.shift();if(t)try{this.processRequest(t),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Bn.idle},this.processRequest=t=>{const{topic:n,payload:i}=t,a=i.method;switch(a){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 ${a}`)}},this.onRelayEventResponse=async t=>{const{topic:n,payload:i}=t,a=(await this.client.core.history.get(n,i.id)).request.method;switch(a){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 ${a}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:n}=t,{message:i}=ue("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(t,n)=>{const{params:i,id:a}=n;try{this.isValidConnect(Ir({},n.params));const c=i.expiryTimestamp||Wr(Fn.wc_sessionPropose.req.ttl),u=Ir({id:a,pairingTopic:t,expiryTimestamp:c},i);await this.setProposal(a,u);const f=bs(JSON.stringify(n)),h=await this.getVerifyContext(f,u.proposer.metadata);this.client.events.emit("session_proposal",{id:a,params:u,verifyContext:h})}catch(c){await this.sendError(a,t,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(t,n)=>{const{id:i}=n;if(Mn(n)){const{result:a}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const u=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u});const f=a.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:f});const h=await this.client.core.crypto.generateSharedKey(u,f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:h});const m=await this.client.core.relayer.subscribe(h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:m}),await this.client.core.pairing.activate({topic:t})}else dn(n)&&(await this.client.proposal.delete(i,It("USER_DISCONNECTED")),this.events.emit(qt("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(t,n)=>{const{id:i,params:a}=n;try{this.isValidSessionSettleRequest(a);const{relay:c,controller:u,expiry:f,namespaces:h,sessionProperties:m,pairingTopic:w}=n.params,y=Ir({topic:t,relay:c,expiry:f,namespaces:h,acknowledged:!0,pairingTopic:w,requiredNamespaces:{},optionalNamespaces:{},controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},m&&{sessionProperties:m});await this.sendResult({id:n.id,topic:t,result:!0}),this.events.emit(qt("session_connect"),{session:y}),this.cleanupDuplicatePairings(y)}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.onSessionSettleResponse=async(t,n)=>{const{id:i}=n;Mn(n)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(qt("session_approve",i),{})):dn(n)&&(await this.client.session.delete(t,It("USER_DISCONNECTED")),this.events.emit(qt("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(t,n)=>{const{params:i,id:a}=n;try{const c=`${t}_session_update`,u=Ma.get(c);if(u&&this.isRequestOutOfSync(u,a)){this.client.logger.info(`Discarding out of sync request - ${a}`);return}this.isValidUpdate(Ir({topic:t},i)),await this.client.session.update(t,{namespaces:i.namespaces}),await this.sendResult({id:a,topic:t,result:!0}),this.client.events.emit("session_update",{id:a,topic:t,params:i}),Ma.set(c,a)}catch(c){await this.sendError(a,t,c),this.client.logger.error(c)}},this.isRequestOutOfSync=(t,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,n)=>{const{id:i}=n;Mn(n)?this.events.emit(qt("session_update",i),{}):dn(n)&&this.events.emit(qt("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(t,n)=>{const{id:i}=n;try{this.isValidExtend({topic:t}),await this.setExpiry(t,Wr(Ga)),await this.sendResult({id:i,topic:t,result:!0}),this.client.events.emit("session_extend",{id:i,topic:t})}catch(a){await this.sendError(i,t,a),this.client.logger.error(a)}},this.onSessionExtendResponse=(t,n)=>{const{id:i}=n;Mn(n)?this.events.emit(qt("session_extend",i),{}):dn(n)&&this.events.emit(qt("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(t,n)=>{const{id:i}=n;try{this.isValidPing({topic:t}),await this.sendResult({id:i,topic:t,result:!0}),this.client.events.emit("session_ping",{id:i,topic:t})}catch(a){await this.sendError(i,t,a),this.client.logger.error(a)}},this.onSessionPingResponse=(t,n)=>{const{id:i}=n;setTimeout(()=>{Mn(n)?this.events.emit(qt("session_ping",i),{}):dn(n)&&this.events.emit(qt("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(t,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:t,reason:n.params}),await Promise.all([new Promise(a=>{this.client.core.relayer.once(pr.publish,async()=>{a(await this.deleteSession({topic:t,id:i}))})}),this.sendResult({id:i,topic:t,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:It("USER_DISCONNECTED")})])}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async(t,n)=>{const{id:i,params:a}=n;try{this.isValidRequest(Ir({topic:t},a));const c=bs(JSON.stringify(Ss("wc_sessionRequest",a,i))),u=this.client.session.get(t),f=await this.getVerifyContext(c,u.peer.metadata),h={id:i,topic:t,params:a,verifyContext:f};await this.setPendingSessionRequest(h),this.addSessionRequestToSessionRequestQueue(h),this.processSessionRequestQueue()}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(t,n)=>{const{id:i}=n;Mn(n)?this.events.emit(qt("session_request",i),{result:n.result}):dn(n)&&this.events.emit(qt("session_request",i),{error:n.error})},this.onSessionEventRequest=async(t,n)=>{const{id:i,params:a}=n;try{const c=`${t}_session_event_${a.event.name}`,u=Ma.get(c);if(u&&this.isRequestOutOfSync(u,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Ir({topic:t},a)),this.client.events.emit("session_event",{id:i,topic:t,params:a}),Ma.set(c,i)}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Bn.idle,this.processSessionRequestQueue()},ye.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(a=>a.topic===t&&a.request.method==="wc_sessionRequest").forEach(a=>{this.events.emit(qt("session_request",a.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Bn.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Bn.active,this.client.events.emit("session_request",t)}catch(n){this.client.logger.error(n)}},this.onPairingCreated=t=>{if(t.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===t.topic);n&&this.onSessionProposeRequest(t.topic,Ss("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id))},this.isValidConnect=async t=>{if(!Rr(t)){const{message:f}=ue("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(f)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:c,relays:u}=t;if(_r(n)||await this.isValidPairingTopic(n),!Q_(u,!0)){const{message:f}=ue("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(f)}!_r(i)&&xo(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!_r(a)&&xo(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),_r(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(t,n)=>{const i=Z_(t,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async t=>{if(!Rr(t))throw new Error(ue("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:n,namespaces:i,relayProtocol:a,sessionProperties:c}=t;await this.isValidProposalId(n);const u=this.client.proposal.get(n),f=hu(i,"approve()");if(f)throw new Error(f.message);const h=cp(u.requiredNamespaces,i,"approve()");if(h)throw new Error(h.message);if(!ir(a,!0)){const{message:m}=ue("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(m)}_r(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async t=>{if(!Rr(t)){const{message:a}=ue("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(a)}const{id:n,reason:i}=t;if(await this.isValidProposalId(n),!e3(i)){const{message:a}=ue("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidSessionSettleRequest=t=>{if(!Rr(t)){const{message:h}=ue("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(h)}const{relay:n,controller:i,namespaces:a,expiry:c}=t;if(!op(n)){const{message:h}=ue("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(h)}const u=W_(i,"onSessionSettleRequest()");if(u)throw new Error(u.message);const f=hu(a,"onSessionSettleRequest()");if(f)throw new Error(f.message);if(ii(c)){const{message:h}=ue("EXPIRED","onSessionSettleRequest()");throw new Error(h)}},this.isValidUpdate=async t=>{if(!Rr(t)){const{message:f}=ue("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(f)}const{topic:n,namespaces:i}=t;await this.isValidSessionTopic(n);const a=this.client.session.get(n),c=hu(i,"update()");if(c)throw new Error(c.message);const u=cp(a.requiredNamespaces,i,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async t=>{if(!Rr(t)){const{message:i}=ue("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionTopic(n)},this.isValidRequest=async t=>{if(!Rr(t)){const{message:f}=ue("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(f)}const{topic:n,request:i,chainId:a,expiry:c}=t;await this.isValidSessionTopic(n);const{namespaces:u}=this.client.session.get(n);if(!ap(u,a)){const{message:f}=ue("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(f)}if(!t3(i)){const{message:f}=ue("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(f)}if(!i3(u,a,i.method)){const{message:f}=ue("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(f)}if(c&&!c3(c,Hu)){const{message:f}=ue("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${Hu.min} and ${Hu.max}`);throw new Error(f)}},this.isValidRespond=async t=>{var n;if(!Rr(t)){const{message:c}=ue("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(c)}const{topic:i,response:a}=t;try{await this.isValidSessionTopic(i)}catch(c){throw(n=t?.response)!=null&&n.id&&this.cleanupAfterResponse(t),c}if(!r3(a)){const{message:c}=ue("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(c)}},this.isValidPing=async t=>{if(!Rr(t)){const{message:i}=ue("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async t=>{if(!Rr(t)){const{message:u}=ue("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(u)}const{topic:n,event:i,chainId:a}=t;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!ap(c,a)){const{message:u}=ue("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(u)}if(!n3(i)){const{message:u}=ue("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}if(!s3(c,a,i.name)){const{message:u}=ue("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}},this.isValidDisconnect=async t=>{if(!Rr(t)){const{message:i}=ue("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(t,n)=>{const i={verified:{verifyUrl:n.verifyUrl||Cs,validation:"UNKNOWN",origin:n.url||""}};try{const a=await this.client.core.verify.resolve({attestationId:t,verifyUrl:n.verifyUrl});a&&(i.verified.origin=a.origin,i.verified.isScam=a.isScam,i.verified.validation=a.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(a){this.client.logger.info(a)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(t,n)=>{Object.values(t).forEach(i=>{if(!ir(i,!1)){const{message:a}=ue("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(a)}})}}async isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(pr.message,async e=>{const{topic:t,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(t,n);try{Tu(i)?(this.client.core.history.set(t,i),this.onRelayEventRequest({topic:t,payload:i})):Wa(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:t,payload:i}),this.client.core.history.delete(t,i.id)):this.onRelayEventUnknownPayload({topic:t,payload:i})}catch(a){this.client.logger.error(a)}})}registerExpirerEvents(){this.client.core.expirer.on(en.expired,async e=>{const{topic:t,id:n}=ep(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ue("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(No.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!ir(e,!1)){const{message:t}=ue("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=ue("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(ii(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=ue("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!ir(e,!1)){const{message:t}=ue("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(!this.client.session.keys.includes(e)){const{message:t}=ue("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(ii(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=ue("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=ue("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}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(ir(e,!1)){const{message:t}=ue("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=ue("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!X_(e)){const{message:t}=ue("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=ue("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(ii(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=ue("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class V8 extends Va{constructor(e,t){super(e,t,M8,qu),this.core=e,this.logger=t}}class G8 extends Va{constructor(e,t){super(e,t,U8,qu),this.core=e,this.logger=t}}class Y8 extends Va{constructor(e,t){super(e,t,F8,qu,n=>n.id),this.core=e,this.logger=t}}class Wu extends Q5{constructor(e){super(e),this.protocol=R1,this.version=N1,this.name=zu.name,this.events=new lr.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||zu.name,this.metadata=e?.metadata||p_();const t=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||zu.logger}));this.core=e?.core||new L8(e),this.logger=Xe.generateChildLogger(t,this.name),this.session=new G8(this.core,this.logger),this.proposal=new V8(this.core,this.logger),this.pendingRequest=new Y8(this.core,this.logger),this.engine=new K8(this)}static async init(e){const t=new Wu(e);return await t.initialize(),t}get context(){return Xe.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 Ku={exports:{}};(function(r,e){var t=typeof self<"u"?self:yr,n=function(){function a(){this.fetch=!1,this.DOMException=t.DOMException}return a.prototype=t,new a}();(function(a){(function(c){var u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function f(I){return I&&DataView.prototype.isPrototypeOf(I)}if(u.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(I){return I&&h.indexOf(Object.prototype.toString.call(I))>-1};function w(I){if(typeof I!="string"&&(I=String(I)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(I))throw new TypeError("Invalid character in header field name");return I.toLowerCase()}function y(I){return typeof I!="string"&&(I=String(I)),I}function x(I){var N={next:function(){var X=I.shift();return{done:X===void 0,value:X}}};return u.iterable&&(N[Symbol.iterator]=function(){return N}),N}function S(I){this.map={},I instanceof S?I.forEach(function(N,X){this.append(X,N)},this):Array.isArray(I)?I.forEach(function(N){this.append(N[0],N[1])},this):I&&Object.getOwnPropertyNames(I).forEach(function(N){this.append(N,I[N])},this)}S.prototype.append=function(I,N){I=w(I),N=y(N);var X=this.map[I];this.map[I]=X?X+", "+N:N},S.prototype.delete=function(I){delete this.map[w(I)]},S.prototype.get=function(I){return I=w(I),this.has(I)?this.map[I]:null},S.prototype.has=function(I){return this.map.hasOwnProperty(w(I))},S.prototype.set=function(I,N){this.map[w(I)]=y(N)},S.prototype.forEach=function(I,N){for(var X in this.map)this.map.hasOwnProperty(X)&&I.call(N,this.map[X],X,this)},S.prototype.keys=function(){var I=[];return this.forEach(function(N,X){I.push(X)}),x(I)},S.prototype.values=function(){var I=[];return this.forEach(function(N){I.push(N)}),x(I)},S.prototype.entries=function(){var I=[];return this.forEach(function(N,X){I.push([X,N])}),x(I)},u.iterable&&(S.prototype[Symbol.iterator]=S.prototype.entries);function P(I){if(I.bodyUsed)return Promise.reject(new TypeError("Already read"));I.bodyUsed=!0}function U(I){return new Promise(function(N,X){I.onload=function(){N(I.result)},I.onerror=function(){X(I.error)}})}function j(I){var N=new FileReader,X=U(N);return N.readAsArrayBuffer(I),X}function A(I){var N=new FileReader,X=U(N);return N.readAsText(I),X}function T(I){for(var N=new Uint8Array(I),X=new Array(N.length),ee=0;ee<N.length;ee++)X[ee]=String.fromCharCode(N[ee]);return X.join("")}function C(I){if(I.slice)return I.slice(0);var N=new Uint8Array(I.byteLength);return N.set(new Uint8Array(I)),N.buffer}function $(){return this.bodyUsed=!1,this._initBody=function(I){this._bodyInit=I,I?typeof I=="string"?this._bodyText=I:u.blob&&Blob.prototype.isPrototypeOf(I)?this._bodyBlob=I:u.formData&&FormData.prototype.isPrototypeOf(I)?this._bodyFormData=I:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(I)?this._bodyText=I.toString():u.arrayBuffer&&u.blob&&f(I)?(this._bodyArrayBuffer=C(I.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(I)||m(I))?this._bodyArrayBuffer=C(I):this._bodyText=I=Object.prototype.toString.call(I):this._bodyText="",this.headers.get("content-type")||(typeof I=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(I)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var I=P(this);if(I)return I;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?P(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(j)}),this.text=function(){var I=P(this);if(I)return I;if(this._bodyBlob)return A(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(T(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(H)}),this.json=function(){return this.text().then(JSON.parse)},this}var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function d(I){var N=I.toUpperCase();return E.indexOf(N)>-1?N:I}function b(I,N){N=N||{};var X=N.body;if(I instanceof b){if(I.bodyUsed)throw new TypeError("Already read");this.url=I.url,this.credentials=I.credentials,N.headers||(this.headers=new S(I.headers)),this.method=I.method,this.mode=I.mode,this.signal=I.signal,!X&&I._bodyInit!=null&&(X=I._bodyInit,I.bodyUsed=!0)}else this.url=String(I);if(this.credentials=N.credentials||this.credentials||"same-origin",(N.headers||!this.headers)&&(this.headers=new S(N.headers)),this.method=d(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})};function H(I){var N=new FormData;return I.trim().split("&").forEach(function(X){if(X){var ee=X.split("="),Y=ee.shift().replace(/\+/g," "),J=ee.join("=").replace(/\+/g," ");N.append(decodeURIComponent(Y),decodeURIComponent(J))}}),N}function F(I){var N=new S,X=I.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(ee){var Y=ee.split(":"),J=Y.shift().trim();if(J){var Q=Y.join(":").trim();N.append(J,Q)}}),N}$.call(b.prototype);function V(I,N){N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in N?N.statusText:"OK",this.headers=new S(N.headers),this.url=N.url||"",this._initBody(I)}$.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new S(this.headers),url:this.url})},V.error=function(){var I=new V(null,{status:0,statusText:""});return I.type="error",I};var se=[301,302,303,307,308];V.redirect=function(I,N){if(se.indexOf(N)===-1)throw new RangeError("Invalid status code");return new V(null,{status:N,headers:{location:I}})},c.DOMException=a.DOMException;try{new c.DOMException}catch{c.DOMException=function(N,X){this.message=N,this.name=X;var ee=Error(N);this.stack=ee.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function ce(I,N){return new Promise(function(X,ee){var Y=new b(I,N);if(Y.signal&&Y.signal.aborted)return ee(new c.DOMException("Aborted","AbortError"));var J=new XMLHttpRequest;function Q(){J.abort()}J.onload=function(){var ie={status:J.status,statusText:J.statusText,headers:F(J.getAllResponseHeaders()||"")};ie.url="responseURL"in J?J.responseURL:ie.headers.get("X-Request-URL");var Ee="response"in J?J.response:J.responseText;X(new V(Ee,ie))},J.onerror=function(){ee(new TypeError("Network request failed"))},J.ontimeout=function(){ee(new TypeError("Network request failed"))},J.onabort=function(){ee(new c.DOMException("Aborted","AbortError"))},J.open(Y.method,Y.url,!0),Y.credentials==="include"?J.withCredentials=!0:Y.credentials==="omit"&&(J.withCredentials=!1),"responseType"in J&&u.blob&&(J.responseType="blob"),Y.headers.forEach(function(ie,Ee){J.setRequestHeader(Ee,ie)}),Y.signal&&(Y.signal.addEventListener("abort",Q),J.onreadystatechange=function(){J.readyState===4&&Y.signal.removeEventListener("abort",Q)}),J.send(typeof Y._bodyInit>"u"?null:Y._bodyInit)})}return ce.polyfill=!0,a.fetch||(a.fetch=ce,a.Headers=S,a.Request=b,a.Response=V),c.Headers=S,c.Request=b,c.Response=V,c.fetch=ce,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,r.exports=e})(Ku,Ku.exports);var B1=Oy(Ku.exports);const k1={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},q1=10;class oi{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new lr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Vp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}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,t){this.isAvailable||await this.register();try{const n=ji(e),a=await(await B1(this.url,Object.assign(Object.assign({},k1),{body:n}))).json();this.onPayload({data:a})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Vp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),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 t=ji({id:1,jsonrpc:"2.0",method:"test",params:[]});await B1(e,Object.assign(Object.assign({},k1),{body:t}))}this.onOpen()}catch(t){const n=this.parseError(t);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 t=typeof e.data=="string"?Do(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),i=n.message||n.toString(),a=Ha(e,i);this.events.emit("payload",a)}parseError(e,t=this.url){return Bp(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>q1&&this.events.setMaxListeners(q1)}}const z1="error",J8="wss://relay.walletconnect.com",Z8="wc",Q8="universal_provider",H1=`${Z8}@2:${Q8}:`,X8="https://rpc.walletconnect.com/v1/",kn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Mo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vu={exports:{}};/**
59
+ ***************************************************************************** */var Au=function(r,e){return Au=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Au(r,e)};function _E(r,e){Au(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Pu=function(){return Pu=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Pu.apply(this,arguments)};function EE(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function xE(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function IE(r,e){return function(t,n){e(t,n,r)}}function DE(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function SE(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function OE(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function CE(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function $E(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Tu(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function zp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function AE(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(zp(arguments[e]));return r}function PE(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function Mo(r){return this instanceof Mo?(this.v=r,this):new Mo(r)}function TE(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(_){return new Promise(function(S,P){a.push([y,_,S,P])>1||u(y,_)})})}function u(y,_){try{f(n[y](_))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof Mo?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,_){y(_),a.shift(),a.length&&u(a[0][0],a[0][1])}}function RE(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:Mo(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function NE(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Tu=="function"?Tu(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function LE(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function ME(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function UE(r){return r&&r.__esModule?r:{default:r}}function jE(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function FE(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var BE=Object.freeze({__proto__:null,__extends:_E,get __assign(){return Pu},__rest:EE,__decorate:xE,__param:IE,__metadata:DE,__awaiter:SE,__generator:OE,__createBinding:CE,__exportStar:$E,__values:Tu,__read:zp,__spread:AE,__spreadArrays:PE,__await:Mo,__asyncGenerator:TE,__asyncDelegator:RE,__asyncValues:NE,__makeTemplateObject:LE,__importStar:ME,__importDefault:UE,__classPrivateFieldGet:jE,__classPrivateFieldSet:FE}),kE=Pi(BE),Ln={},Hp;function qE(){if(Hp)return Ln;Hp=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.isBrowserCryptoAvailable=Ln.getSubtleCrypto=Ln.getBrowerCrypto=void 0;function r(){return vr?.crypto||vr?.msCrypto||{}}Ln.getBrowerCrypto=r;function e(){const n=r();return n.subtle||n.webkitSubtle}Ln.getSubtleCrypto=e;function t(){return!!r()&&!!e()}return Ln.isBrowserCryptoAvailable=t,Ln}var Mn={},Wp;function zE(){if(Wp)return Mn;Wp=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.isBrowser=Mn.isNode=Mn.isReactNative=void 0;function r(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Mn.isReactNative=r;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Mn.isNode=e;function t(){return!r()&&!e()}return Mn.isBrowser=t,Mn}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=kE;e.__exportStar(qE(),r),e.__exportStar(zE(),r)})(qp);function Os(r=3){const e=Date.now()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}function qi(r=6){return BigInt(Os(r))}function Cs(r,e,t){return{id:t||Os(),jsonrpc:"2.0",method:r,params:e}}function Ka(r,e){return{id:r,jsonrpc:"2.0",result:e}}function Va(r,e,t){return{id:r,jsonrpc:"2.0",error:HE(e,t)}}function HE(r,e){return typeof r>"u"?Bp(jp):(typeof r=="string"&&(r=Object.assign(Object.assign({},Bp($u)),{message:r})),typeof e<"u"&&(r.data=e),wE(r.code)&&(r=bE(r.code)),r)}class WE{}class KE extends WE{constructor(){super()}}class VE extends KE{constructor(e){super()}}const GE="^https?:",YE="^wss?:";function ZE(r){const e=r.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Kp(r,e){const t=ZE(r);return typeof t>"u"?!1:new RegExp(e).test(t)}function Vp(r){return Kp(r,GE)}function Gp(r){return Kp(r,YE)}function JE(r){return new RegExp("wss?://localhost(:d{2,5})?").test(r)}function Yp(r){return typeof r=="object"&&"id"in r&&"jsonrpc"in r&&r.jsonrpc==="2.0"}function Ru(r){return Yp(r)&&"method"in r}function Ga(r){return Yp(r)&&(Un(r)||pn(r))}function Un(r){return"result"in r}function pn(r){return"error"in r}class jn extends VE{constructor(e){super(e),this.events=new lr.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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Cs(e.method,e.params||[],e.id||qi().toString()),t)}async requestStrict(e,t){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{pn(a)?i(a.error):n(a.result)});try{await this.connection.send(e,t)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Ga(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 QE=()=>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"),XE=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Zp=r=>r.split("?")[0],Jp=10,e6=QE();class t6{constructor(e){if(this.url=e,this.events=new lr.exports.EventEmitter,this.registering=!1,!Gp(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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ji(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!Gp(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),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((t,n)=>{const i=new URLSearchParams(e).get("origin"),a=qp.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!JE(e)},c=new e6(e,[],a);XE()?c.onerror=u=>{const f=u;n(this.emitError(f.error))}:c.on("error",u=>{n(this.emitError(u))}),c.onopen=()=>{this.onOpen(c),t(c)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),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 t=typeof e.data=="string"?Ao(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),i=n.message||n.toString(),a=Va(e,i);this.events.emit("payload",a)}parseError(e,t=this.url){return kp(e,Zp(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Jp&&this.events.setMaxListeners(Jp)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Zp(this.url)}`));return this.events.emit("register_error",t),t}}var Nu={exports:{}};(function(r,e){var t=200,n="__lodash_hash_undefined__",i=1,a=2,c=9007199254740991,u="[object Arguments]",f="[object Array]",h="[object AsyncFunction]",m="[object Boolean]",w="[object Date]",y="[object Error]",_="[object Function]",S="[object GeneratorFunction]",P="[object Map]",j="[object Number]",U="[object Null]",A="[object Object]",T="[object Promise]",O="[object Proxy]",$="[object RegExp]",x="[object Set]",d="[object String]",b="[object Symbol]",H="[object Undefined]",F="[object WeakMap]",V="[object ArrayBuffer]",se="[object DataView]",ce="[object Float32Array]",I="[object Float64Array]",N="[object Int8Array]",X="[object Int16Array]",ee="[object Int32Array]",Y="[object Uint8Array]",Z="[object Uint8ClampedArray]",Q="[object Uint16Array]",ie="[object Uint32Array]",Ee=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,xe=/^(?:0|[1-9]\d*)$/,de={};de[ce]=de[I]=de[N]=de[X]=de[ee]=de[Y]=de[Z]=de[Q]=de[ie]=!0,de[u]=de[f]=de[V]=de[m]=de[se]=de[w]=de[y]=de[_]=de[P]=de[j]=de[A]=de[$]=de[x]=de[d]=de[F]=!1;var be=typeof vr=="object"&&vr&&vr.Object===Object&&vr,K=typeof self=="object"&&self&&self.Object===Object&&self,W=be||K||Function("return this")(),B=e&&!e.nodeType&&e,g=B&&!0&&r&&!r.nodeType&&r,L=g&&g.exports===B,le=L&&be.process,pe=function(){try{return le&&le.binding&&le.binding("util")}catch{}}(),Oe=pe&&pe.isTypedArray;function Ke(C,k){for(var ne=-1,ge=C==null?0:C.length,yt=0,Ne=[];++ne<ge;){var It=C[ne];k(It,ne,C)&&(Ne[yt++]=It)}return Ne}function Ze(C,k){for(var ne=-1,ge=k.length,yt=C.length;++ne<ge;)C[yt+ne]=k[ne];return C}function ke(C,k){for(var ne=-1,ge=C==null?0:C.length;++ne<ge;)if(k(C[ne],ne,C))return!0;return!1}function Ot(C,k){for(var ne=-1,ge=Array(C);++ne<C;)ge[ne]=k(ne);return ge}function Ct(C){return function(k){return C(k)}}function ze(C,k){return C.has(k)}function Ce(C,k){return C?.[k]}function Ue(C){var k=-1,ne=Array(C.size);return C.forEach(function(ge,yt){ne[++k]=[yt,ge]}),ne}function je(C,k){return function(ne){return C(k(ne))}}function He(C){var k=-1,ne=Array(C.size);return C.forEach(function(ge){ne[++k]=ge}),ne}var Ae=Array.prototype,Fe=Function.prototype,Se=Object.prototype,Te=W["__core-js_shared__"],Ve=Fe.toString,$e=Se.hasOwnProperty,Je=function(){var C=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return C?"Symbol(src)_1."+C:""}(),et=Se.toString,at=RegExp("^"+Ve.call($e).replace(Ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ct=L?W.Buffer:void 0,nt=W.Symbol,Dr=W.Uint8Array,Mr=Se.propertyIsEnumerable,$n=Ae.splice,Sr=nt?nt.toStringTag:void 0,Wn=Object.getOwnPropertySymbols,bi=ct?ct.isBuffer:void 0,ns=je(Object.keys,Object),Mt=Gr(W,"DataView"),$t=Gr(W,"Map"),Ut=Gr(W,"Promise"),jt=Gr(W,"Set"),Rt=Gr(W,"WeakMap"),At=Gr(Object,"create"),Gt=Vn(Mt),Yt=Vn($t),Ft=Vn(Ut),Zt=Vn(jt),Bt=Vn(Rt),Ht=nt?nt.prototype:void 0,kt=Ht?Ht.valueOf:void 0;function Et(C){var k=-1,ne=C==null?0:C.length;for(this.clear();++k<ne;){var ge=C[k];this.set(ge[0],ge[1])}}function Jt(){this.__data__=At?At(null):{},this.size=0}function Qt(C){var k=this.has(C)&&delete this.__data__[C];return this.size-=k?1:0,k}function uf(C){var k=this.__data__;if(At){var ne=k[C];return ne===n?void 0:ne}return $e.call(k,C)?k[C]:void 0}function hf(C){var k=this.__data__;return At?k[C]!==void 0:$e.call(k,C)}function ff(C,k){var ne=this.__data__;return this.size+=this.has(C)?0:1,ne[C]=At&&k===void 0?n:k,this}Et.prototype.clear=Jt,Et.prototype.delete=Qt,Et.prototype.get=uf,Et.prototype.has=hf,Et.prototype.set=ff;function nn(C){var k=-1,ne=C==null?0:C.length;for(this.clear();++k<ne;){var ge=C[k];this.set(ge[0],ge[1])}}function df(){this.__data__=[],this.size=0}function pf(C){var k=this.__data__,ne=is(k,C);if(ne<0)return!1;var ge=k.length-1;return ne==ge?k.pop():$n.call(k,ne,1),--this.size,!0}function gf(C){var k=this.__data__,ne=is(k,C);return ne<0?void 0:k[ne][1]}function mf(C){return is(this.__data__,C)>-1}function vf(C,k){var ne=this.__data__,ge=is(ne,C);return ge<0?(++this.size,ne.push([C,k])):ne[ge][1]=k,this}nn.prototype.clear=df,nn.prototype.delete=pf,nn.prototype.get=gf,nn.prototype.has=mf,nn.prototype.set=vf;function Kn(C){var k=-1,ne=C==null?0:C.length;for(this.clear();++k<ne;){var ge=C[k];this.set(ge[0],ge[1])}}function Ys(){this.size=0,this.__data__={hash:new Et,map:new($t||nn),string:new Et}}function yf(C){var k=_i(this,C).delete(C);return this.size-=k?1:0,k}function Zs(C){return _i(this,C).get(C)}function wf(C){return _i(this,C).has(C)}function bf(C,k){var ne=_i(this,C),ge=ne.size;return ne.set(C,k),this.size+=ne.size==ge?0:1,this}Kn.prototype.clear=Ys,Kn.prototype.delete=yf,Kn.prototype.get=Zs,Kn.prototype.has=wf,Kn.prototype.set=bf;function Js(C){var k=-1,ne=C==null?0:C.length;for(this.__data__=new Kn;++k<ne;)this.add(C[k])}function Ac(C){return this.__data__.set(C,n),this}function Pc(C){return this.__data__.has(C)}Js.prototype.add=Js.prototype.push=Ac,Js.prototype.has=Pc;function gn(C){var k=this.__data__=new nn(C);this.size=k.size}function _f(){this.__data__=new nn,this.size=0}function Ef(C){var k=this.__data__,ne=k.delete(C);return this.size=k.size,ne}function xf(C){return this.__data__.get(C)}function If(C){return this.__data__.has(C)}function Tc(C,k){var ne=this.__data__;if(ne instanceof nn){var ge=ne.__data__;if(!$t||ge.length<t-1)return ge.push([C,k]),this.size=++ne.size,this;ne=this.__data__=new Kn(ge)}return ne.set(C,k),this.size=ne.size,this}gn.prototype.clear=_f,gn.prototype.delete=Ef,gn.prototype.get=xf,gn.prototype.has=If,gn.prototype.set=Tc;function Rc(C,k){var ne=eo(C),ge=!ne&&Wc(C),yt=!ne&&!ge&&la(C),Ne=!ne&&!ge&&!yt&&Gc(C),It=ne||ge||yt||Ne,Xt=It?Ot(C.length,String):[],it=Xt.length;for(var wt in C)(k||$e.call(C,wt))&&!(It&&(wt=="length"||yt&&(wt=="offset"||wt=="parent")||Ne&&(wt=="buffer"||wt=="byteLength"||wt=="byteOffset")||Bc(wt,it)))&&Xt.push(wt);return Xt}function is(C,k){for(var ne=C.length;ne--;)if(Hc(C[ne][0],k))return ne;return-1}function aa(C,k,ne){var ge=k(C);return eo(C)?ge:Ze(ge,ne(C))}function ss(C){return C==null?C===void 0?H:U:Sr&&Sr in Object(C)?jc(C):Of(C)}function ca(C){return as(C)&&ss(C)==u}function os(C,k,ne,ge,yt){return C===k?!0:C==null||k==null||!as(C)&&!as(k)?C!==C&&k!==k:Nc(C,k,ne,ge,os,yt)}function Nc(C,k,ne,ge,yt,Ne){var It=eo(C),Xt=eo(k),it=It?f:An(C),wt=Xt?f:An(k);it=it==u?A:it,wt=wt==u?A:wt;var Wt=it==A,Ur=wt==A,er=it==wt;if(er&&la(C)){if(!la(k))return!1;It=!0,Wt=!1}if(er&&!Wt)return Ne||(Ne=new gn),It||Gc(C)?Qs(C,k,ne,ge,yt,Ne):Sf(C,k,it,ne,ge,yt,Ne);if(!(ne&i)){var Dt=Wt&&$e.call(C,"__wrapped__"),Or=Ur&&$e.call(k,"__wrapped__");if(Dt||Or){var mn=Dt?C.value():C,sn=Or?k.value():k;return Ne||(Ne=new gn),yt(mn,sn,ne,ge,Ne)}}return er?(Ne||(Ne=new gn),Uc(C,k,ne,ge,yt,Ne)):!1}function Df(C){if(!Vc(C)||qc(C))return!1;var k=to(C)?at:ae;return k.test(Vn(C))}function Lc(C){return as(C)&&Kc(C.length)&&!!de[ss(C)]}function Mc(C){if(!zc(C))return ns(C);var k=[];for(var ne in Object(C))$e.call(C,ne)&&ne!="constructor"&&k.push(ne);return k}function Qs(C,k,ne,ge,yt,Ne){var It=ne&i,Xt=C.length,it=k.length;if(Xt!=it&&!(It&&it>Xt))return!1;var wt=Ne.get(C);if(wt&&Ne.get(k))return wt==k;var Wt=-1,Ur=!0,er=ne&a?new Js:void 0;for(Ne.set(C,k),Ne.set(k,C);++Wt<Xt;){var Dt=C[Wt],Or=k[Wt];if(ge)var mn=It?ge(Or,Dt,Wt,k,C,Ne):ge(Dt,Or,Wt,C,k,Ne);if(mn!==void 0){if(mn)continue;Ur=!1;break}if(er){if(!ke(k,function(sn,Pn){if(!ze(er,Pn)&&(Dt===sn||yt(Dt,sn,ne,ge,Ne)))return er.push(Pn)})){Ur=!1;break}}else if(!(Dt===Or||yt(Dt,Or,ne,ge,Ne))){Ur=!1;break}}return Ne.delete(C),Ne.delete(k),Ur}function Sf(C,k,ne,ge,yt,Ne,It){switch(ne){case se:if(C.byteLength!=k.byteLength||C.byteOffset!=k.byteOffset)return!1;C=C.buffer,k=k.buffer;case V:return!(C.byteLength!=k.byteLength||!Ne(new Dr(C),new Dr(k)));case m:case w:case j:return Hc(+C,+k);case y:return C.name==k.name&&C.message==k.message;case $:case d:return C==k+"";case P:var Xt=Ue;case x:var it=ge&i;if(Xt||(Xt=He),C.size!=k.size&&!it)return!1;var wt=It.get(C);if(wt)return wt==k;ge|=a,It.set(C,k);var Wt=Qs(Xt(C),Xt(k),ge,yt,Ne,It);return It.delete(C),Wt;case b:if(kt)return kt.call(C)==kt.call(k)}return!1}function Uc(C,k,ne,ge,yt,Ne){var It=ne&i,Xt=Xs(C),it=Xt.length,wt=Xs(k),Wt=wt.length;if(it!=Wt&&!It)return!1;for(var Ur=it;Ur--;){var er=Xt[Ur];if(!(It?er in k:$e.call(k,er)))return!1}var Dt=Ne.get(C);if(Dt&&Ne.get(k))return Dt==k;var Or=!0;Ne.set(C,k),Ne.set(k,C);for(var mn=It;++Ur<it;){er=Xt[Ur];var sn=C[er],Pn=k[er];if(ge)var ua=It?ge(Pn,sn,er,k,C,Ne):ge(sn,Pn,er,C,k,Ne);if(!(ua===void 0?sn===Pn||yt(sn,Pn,ne,ge,Ne):ua)){Or=!1;break}mn||(mn=er=="constructor")}if(Or&&!mn){var cs=C.constructor,ar=k.constructor;cs!=ar&&"constructor"in C&&"constructor"in k&&!(typeof cs=="function"&&cs instanceof cs&&typeof ar=="function"&&ar instanceof ar)&&(Or=!1)}return Ne.delete(C),Ne.delete(k),Or}function Xs(C){return aa(C,Af,Fc)}function _i(C,k){var ne=C.__data__;return kc(k)?ne[typeof k=="string"?"string":"hash"]:ne.map}function Gr(C,k){var ne=Ce(C,k);return Df(ne)?ne:void 0}function jc(C){var k=$e.call(C,Sr),ne=C[Sr];try{C[Sr]=void 0;var ge=!0}catch{}var yt=et.call(C);return ge&&(k?C[Sr]=ne:delete C[Sr]),yt}var Fc=Wn?function(C){return C==null?[]:(C=Object(C),Ke(Wn(C),function(k){return Mr.call(C,k)}))}:vt,An=ss;(Mt&&An(new Mt(new ArrayBuffer(1)))!=se||$t&&An(new $t)!=P||Ut&&An(Ut.resolve())!=T||jt&&An(new jt)!=x||Rt&&An(new Rt)!=F)&&(An=function(C){var k=ss(C),ne=k==A?C.constructor:void 0,ge=ne?Vn(ne):"";if(ge)switch(ge){case Gt:return se;case Yt:return P;case Ft:return T;case Zt:return x;case Bt:return F}return k});function Bc(C,k){return k=k??c,!!k&&(typeof C=="number"||xe.test(C))&&C>-1&&C%1==0&&C<k}function kc(C){var k=typeof C;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?C!=="__proto__":C===null}function qc(C){return!!Je&&Je in C}function zc(C){var k=C&&C.constructor,ne=typeof k=="function"&&k.prototype||Se;return C===ne}function Of(C){return et.call(C)}function Vn(C){if(C!=null){try{return Ve.call(C)}catch{}try{return C+""}catch{}}return""}function Hc(C,k){return C===k||C!==C&&k!==k}var Wc=ca(function(){return arguments}())?ca:function(C){return as(C)&&$e.call(C,"callee")&&!Mr.call(C,"callee")},eo=Array.isArray;function Cf(C){return C!=null&&Kc(C.length)&&!to(C)}var la=bi||mt;function $f(C,k){return os(C,k)}function to(C){if(!Vc(C))return!1;var k=ss(C);return k==_||k==S||k==h||k==O}function Kc(C){return typeof C=="number"&&C>-1&&C%1==0&&C<=c}function Vc(C){var k=typeof C;return C!=null&&(k=="object"||k=="function")}function as(C){return C!=null&&typeof C=="object"}var Gc=Oe?Ct(Oe):Lc;function Af(C){return Cf(C)?Rc(C):Mc(C)}function vt(){return[]}function mt(){return!1}r.exports=$f})(Nu,Nu.exports);var r6=Nu.exports;function n6(r,e){return e=e||{},new Promise(function(t,n){var i=new XMLHttpRequest,a=[],c=[],u={},f=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:f,headers:{keys:function(){return a},entries:function(){return c},get:function(m){return u[m.toLowerCase()]},has:function(m){return m.toLowerCase()in u}}}};for(var h in i.open(e.method||"get",r,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(m,w,y){a.push(w=w.toLowerCase()),c.push([w,y]),u[w]=u[w]?u[w]+","+y:y}),t(f())},i.onerror=n,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(h,e.headers[h]);i.send(e.body||null)})}var i6=Object.freeze({__proto__:null,default:n6}),Qp=Pi(i6),s6=self.fetch||(self.fetch=Qp.default||Qp),o6=Object.defineProperty,Xp=Object.getOwnPropertySymbols,a6=Object.prototype.hasOwnProperty,c6=Object.prototype.propertyIsEnumerable,e1=(r,e,t)=>e in r?o6(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Er=(r,e)=>{for(var t in e||(e={}))a6.call(e,t)&&e1(r,t,e[t]);if(Xp)for(var t of Xp(e))c6.call(e,t)&&e1(r,t,e[t]);return r};function l6(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var a=r.charAt(i),c=a.charCodeAt(0);if(t[c]!==255)throw new TypeError(a+" is ambiguous");t[c]=i}var u=r.length,f=r.charAt(0),h=Math.log(u)/Math.log(256),m=Math.log(256)/Math.log(u);function w(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var P=0,j=0,U=0,A=S.length;U!==A&&S[U]===0;)U++,P++;for(var T=(A-U)*m+1>>>0,O=new Uint8Array(T);U!==A;){for(var $=S[U],x=0,d=T-1;($!==0||x<j)&&d!==-1;d--,x++)$+=256*O[d]>>>0,O[d]=$%u>>>0,$=$/u>>>0;if($!==0)throw new Error("Non-zero carry");j=x,U++}for(var b=T-j;b!==T&&O[b]===0;)b++;for(var H=f.repeat(P);b<T;++b)H+=r.charAt(O[b]);return H}function y(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var P=0;if(S[P]!==" "){for(var j=0,U=0;S[P]===f;)j++,P++;for(var A=(S.length-P)*h+1>>>0,T=new Uint8Array(A);S[P];){var O=t[S.charCodeAt(P)];if(O===255)return;for(var $=0,x=A-1;(O!==0||$<U)&&x!==-1;x--,$++)O+=u*T[x]>>>0,T[x]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");U=$,P++}if(S[P]!==" "){for(var d=A-U;d!==A&&T[d]===0;)d++;for(var b=new Uint8Array(j+(A-d)),H=j;d!==A;)b[H++]=T[d++];return b}}}function _(S){var P=y(S);if(P)return P;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:y,decode:_}}var u6=l6,h6=u6;const t1=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},f6=r=>new TextEncoder().encode(r),d6=r=>new TextDecoder().decode(r);class p6{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class g6{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.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 r1(this,e)}}class m6{constructor(e){this.decoders=e}or(e){return r1(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 r1=(r,e)=>new m6(Er(Er({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e}));class v6{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new p6(e,t,n),this.decoder=new g6(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ya=({name:r,prefix:e,encode:t,decode:n})=>new v6(r,e,t,n),Uo=({prefix:r,name:e,alphabet:t})=>{const{encode:n,decode:i}=h6(t,e);return Ya({prefix:r,name:e,encode:n,decode:a=>t1(i(a))})},y6=(r,e,t,n)=>{const i={};for(let m=0;m<e.length;++m)i[e[m]]=m;let a=r.length;for(;r[a-1]==="=";)--a;const c=new Uint8Array(a*t/8|0);let u=0,f=0,h=0;for(let m=0;m<a;++m){const w=i[r[m]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<t|w,u+=t,u>=8&&(u-=8,c[h++]=255&f>>u)}if(u>=t||255&f<<8-u)throw new SyntaxError("Unexpected end of data");return c},w6=(r,e,t)=>{const n=e[e.length-1]==="=",i=(1<<t)-1;let a="",c=0,u=0;for(let f=0;f<r.length;++f)for(u=u<<8|r[f],c+=8;c>t;)c-=t,a+=e[i&u>>c];if(c&&(a+=e[i&u<<t-c]),n)for(;a.length*t&7;)a+="=";return a},hr=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Ya({prefix:e,name:r,encode(i){return w6(i,n,t)},decode(i){return y6(i,n,t,r)}}),b6=Ya({prefix:"\0",name:"identity",encode:r=>d6(r),decode:r=>f6(r)});var _6=Object.freeze({__proto__:null,identity:b6});const E6=hr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var x6=Object.freeze({__proto__:null,base2:E6});const I6=hr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var D6=Object.freeze({__proto__:null,base8:I6});const S6=Uo({prefix:"9",name:"base10",alphabet:"0123456789"});var O6=Object.freeze({__proto__:null,base10:S6});const C6=hr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$6=hr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var A6=Object.freeze({__proto__:null,base16:C6,base16upper:$6});const P6=hr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),T6=hr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),R6=hr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),N6=hr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),L6=hr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),M6=hr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),U6=hr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),j6=hr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),F6=hr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var B6=Object.freeze({__proto__:null,base32:P6,base32upper:T6,base32pad:R6,base32padupper:N6,base32hex:L6,base32hexupper:M6,base32hexpad:U6,base32hexpadupper:j6,base32z:F6});const k6=Uo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),q6=Uo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var z6=Object.freeze({__proto__:null,base36:k6,base36upper:q6});const H6=Uo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),W6=Uo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var K6=Object.freeze({__proto__:null,base58btc:H6,base58flickr:W6});const V6=hr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),G6=hr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Y6=hr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Z6=hr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var J6=Object.freeze({__proto__:null,base64:V6,base64pad:G6,base64url:Y6,base64urlpad:Z6});const n1=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}"),Q6=n1.reduce((r,e,t)=>(r[t]=e,r),[]),X6=n1.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function e4(r){return r.reduce((e,t)=>(e+=Q6[t],e),"")}function t4(r){const e=[];for(const t of r){const n=X6[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}const r4=Ya({prefix:"\u{1F680}",name:"base256emoji",encode:e4,decode:t4});var n4=Object.freeze({__proto__:null,base256emoji:r4}),i4=s1,i1=128,s4=127,o4=~s4,a4=Math.pow(2,31);function s1(r,e,t){e=e||[],t=t||0;for(var n=t;r>=a4;)e[t++]=r&255|i1,r/=128;for(;r&o4;)e[t++]=r&255|i1,r>>>=7;return e[t]=r|0,s1.bytes=t-n+1,e}var c4=Lu,l4=128,o1=127;function Lu(r,n){var t=0,n=n||0,i=0,a=n,c,u=r.length;do{if(a>=u)throw Lu.bytes=0,new RangeError("Could not decode varint");c=r[a++],t+=i<28?(c&o1)<<i:(c&o1)*Math.pow(2,i),i+=7}while(c>=l4);return Lu.bytes=a-n,t}var u4=Math.pow(2,7),h4=Math.pow(2,14),f4=Math.pow(2,21),d4=Math.pow(2,28),p4=Math.pow(2,35),g4=Math.pow(2,42),m4=Math.pow(2,49),v4=Math.pow(2,56),y4=Math.pow(2,63),w4=function(r){return r<u4?1:r<h4?2:r<f4?3:r<d4?4:r<p4?5:r<g4?6:r<m4?7:r<v4?8:r<y4?9:10},b4={encode:i4,decode:c4,encodingLength:w4},a1=b4;const c1=(r,e,t=0)=>(a1.encode(r,e,t),e),l1=r=>a1.encodingLength(r),Mu=(r,e)=>{const t=e.byteLength,n=l1(r),i=n+l1(t),a=new Uint8Array(i+t);return c1(r,a,0),c1(t,a,n),a.set(e,i),new _4(r,t,e,a)};class _4{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}}const u1=({name:r,code:e,encode:t})=>new E4(r,e,t);class E4{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Mu(this.code,t):t.then(n=>Mu(this.code,n))}else throw Error("Unknown type, must be binary type")}}const h1=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),x4=u1({name:"sha2-256",code:18,encode:h1("SHA-256")}),I4=u1({name:"sha2-512",code:19,encode:h1("SHA-512")});var D4=Object.freeze({__proto__:null,sha256:x4,sha512:I4});const f1=0,S4="identity",d1=t1;var O4=Object.freeze({__proto__:null,identity:{code:f1,name:S4,encode:d1,digest:r=>Mu(f1,d1(r))}});new TextEncoder,new TextDecoder;const p1=Er(Er(Er(Er(Er(Er(Er(Er(Er(Er({},_6),x6),D6),O6),A6),B6),z6),K6),J6),n4);Er(Er({},D4),O4);function g1(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function C4(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?g1(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function m1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}const v1=m1("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Uu=m1("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=C4(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),$4=Er({utf8:v1,"utf-8":v1,hex:p1.base16,latin1:Uu,ascii:Uu,binary:Uu},p1);function A4(r,e="utf8"){const t=$4[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?g1(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}const y1="wc",P4=2,ju="core",si=`${y1}@2:${ju}:`,T4={name:ju,logger:"error"},R4={database:":memory:"},N4="crypto",w1="client_ed25519_seed",L4=me.ONE_DAY,M4="keychain",U4="0.3",j4="messages",F4="0.3",B4=me.SIX_HOURS,k4="publisher",b1="irn",q4="error",_1="wss://relay.walletconnect.com",E1="wss://relay.walletconnect.org",z4="relayer",Wr={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"},H4="_subscription",en={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},W4=me.ONE_SECOND,K4="2.11.3",V4=1e4,G4="0.3",Y4="WALLETCONNECT_CLIENT_ID",xn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},Z4="subscription",J4="0.3",Q4=me.FIVE_SECONDS*1e3,X4="pairing",e8="0.3",jo={wc_pairingDelete:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:me.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:me.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:me.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:me.ONE_DAY,prompt:!1,tag:0},res:{ttl:me.ONE_DAY,prompt:!1,tag:0}}},$s={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},In={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},t8="history",r8="0.3",n8="expirer",tn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},i8="0.3",Fu="verify-api",As="https://verify.walletconnect.com",Bu="https://verify.walletconnect.org",s8=[As,Bu],o8="echo",a8="https://echo.walletconnect.com";class c8{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=M4,this.version=U4,this.initialized=!1,this.storagePrefix=si,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:a}=ue("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(a)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Q0(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?X0(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class l8{constructor(e,t,n){this.core=e,this.logger=t,this.name=N4,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(),a=Up(i);return Mp(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=X2();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const a=await this.getClientSeed(),c=Up(a),u=cu();return await dE(u,i,L4,c)},this.generateSharedKey=(i,a,c)=>{this.isInitialized();const u=this.getPrivateKey(i),f=e_(u,a);return this.setSymKey(f,c)},this.setSymKey=async(i,a)=>{this.isInitialized();const c=a||t_(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,a,c)=>{this.isInitialized();const u=V0(c),f=ji(a);if(G0(u)){const y=u.senderPublicKey,_=u.receiverPublicKey;i=await this.generateSharedKey(y,_)}const h=this.getSymKey(i),{type:m,senderPublicKey:w}=u;return n_({type:m,symKey:h,message:f,senderPublicKey:w})},this.decode=async(i,a,c)=>{this.isInitialized();const u=o_(a,c);if(G0(u)){const f=u.receiverPublicKey,h=u.senderPublicKey;i=await this.generateSharedKey(f,h)}try{const f=this.getSymKey(i),h=i_({symKey:f,encoded:a});return Ao(h)}catch(f){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(f)}},this.getPayloadType=i=>{const a=Ua(i);return Eo(a.type)},this.getPayloadSenderPublicKey=i=>{const a=Ua(i);return a.senderPublicKey?yr(a.senderPublicKey,wr):void 0},this.core=e,this.logger=Xe.generateChildLogger(t,this.name),this.keychain=n||new c8(this.core,this.logger)}get context(){return Xe.getLoggerContext(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(w1)}catch{e=cu(),await this.keychain.set(w1,e)}return A4(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class u8 extends H5{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=j4,this.version=F4,this.initialized=!1,this.storagePrefix=si,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 a=_s(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[a]<"u"||(c[a]=i,this.messages.set(n,c),await this.persist()),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const a=this.get(n),c=_s(i);return typeof a[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=Xe.generateChildLogger(e,this.name),this.core=t}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Q0(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?X0(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class h8 extends W5{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new lr.exports.EventEmitter,this.name=k4,this.queue=new Map,this.publishTimeout=me.toMiliseconds(me.ONE_MINUTE),this.failedPublishTimeout=me.toMiliseconds(me.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(n,i,a)=>{var c;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}});const u=a?.ttl||B4,f=uu(a),h=a?.prompt||!1,m=a?.tag||0,w=a?.id||qi().toString(),y={topic:n,message:i,opts:{ttl:u,relay:f,prompt:h,tag:m,id:w}},_=`Failed to publish payload, please try again. id:${w} tag:${m}`,S=Date.now();let P,j=1;try{for(;P===void 0;){if(Date.now()-S>this.publishTimeout)throw new Error(_);this.logger.trace({id:w,attempts:j},`publisher.publish - attempt ${j}`),P=await await Do(this.rpcPublish(n,i,u,f,h,m,w).catch(U=>this.logger.warn(U)),this.publishTimeout,_),j++,P||await new Promise(U=>setTimeout(U,this.failedPublishTimeout))}this.relayer.events.emit(Wr.publish,y),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:w,topic:n,message:i,opts:a}})}catch(U){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(U),(c=a?.internal)!=null&&c.throwOnFailedPublish)throw U;this.queue.set(w,y)}},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=Xe.generateChildLogger(t,this.name),this.registerEventListeners()}get context(){return Xe.getLoggerContext(this.logger)}rpcPublish(e,t,n,i,a,c,u){var f,h,m,w;const y={method:ja(i.protocol).publish,params:{topic:e,message:t,ttl:n,prompt:a,tag:c},id:u};return br((f=y.params)==null?void 0:f.prompt)&&((h=y.params)==null||delete h.prompt),br((m=y.params)==null?void 0:m.tag)&&((w=y.params)==null||delete w.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:y}),this.relayer.request(y)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:n,opts:i}=e;await this.publish(t,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Ss.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Wr.connection_stalled);return}this.checkQueue()}),this.relayer.on(Wr.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class f8{constructor(){this.map=new Map,this.set=(e,t)=>{const n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,t))return;const i=n.filter(a=>a!==t);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 d8=Object.defineProperty,p8=Object.defineProperties,g8=Object.getOwnPropertyDescriptors,x1=Object.getOwnPropertySymbols,m8=Object.prototype.hasOwnProperty,v8=Object.prototype.propertyIsEnumerable,I1=(r,e,t)=>e in r?d8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Fo=(r,e)=>{for(var t in e||(e={}))m8.call(e,t)&&I1(r,t,e[t]);if(x1)for(var t of x1(e))v8.call(e,t)&&I1(r,t,e[t]);return r},ku=(r,e)=>p8(r,g8(e));class y8 extends G5{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new f8,this.events=new lr.exports.EventEmitter,this.name=Z4,this.version=J4,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=si,this.subscribeTimeout=me.toMiliseconds(me.ONE_MINUTE),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 a=uu(i),c={topic:n,relay:a};this.pending.set(n,c);const u=await this.rpcSubscribe(n,a);return typeof u=="string"&&(this.onSubscribe(u,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),u}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},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=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((a,c)=>{const u=new me.Watch;u.start(i);const f=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(f),u.stop(i),a(!0)),u.elapsed(i)>=Q4&&(clearInterval(f),u.stop(i),c(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.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Xe.generateChildLogger(t,this.name),this.clientId=""}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+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,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,t)))}async unsubscribeById(e,t,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}});try{const i=uu(n);await this.rpcUnsubscribe(e,t,i);const a=xt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,t){const n={method:ja(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Do(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)?_s(e+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Wr.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,n={method:ja(t.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 Do(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(Wr.connection_stalled)}}rpcUnsubscribe(e,t,n){const i={method:ja(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,t){this.setSubscription(e,ku(Fo({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,Fo({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,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,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,Fo({},t)),this.topicMap.set(t.topic,e),this.events.emit(xn.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(xn.deleted,ku(Fo({},n),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(xn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}}this.events.emit(xn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}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 t=await this.rpcBatchSubscribe(e);En(t)&&this.onBatchSubscribe(t.map((n,i)=>ku(Fo({},e[i]),{id:n})))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Ss.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.events.on(xn.created,async e=>{const t=xn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(xn.deleted,async e=>{const t=xn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var w8=Object.defineProperty,D1=Object.getOwnPropertySymbols,b8=Object.prototype.hasOwnProperty,_8=Object.prototype.propertyIsEnumerable,S1=(r,e,t)=>e in r?w8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,E8=(r,e)=>{for(var t in e||(e={}))b8.call(e,t)&&S1(r,t,e[t]);if(D1)for(var t of D1(e))_8.call(e,t)&&S1(r,t,e[t]);return r};class x8 extends K5{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new lr.exports.EventEmitter,this.name=z4,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=me.toMiliseconds(me.THIRTY_SECONDS+me.ONE_SECOND),this.request=async t=>{var n,i;this.logger.debug("Publishing Request Payload");const a=t.id||qi().toString();await this.toEstablishConnection();try{const c=this.provider.request(t);this.requestsInFlight.set(a,{promise:c,request:t}),this.logger.trace({id:a,method:t.method,topic:(n=t.params)==null?void 0:n.topic},"relayer.request - attempt to publish...");const u=await new Promise(async(f,h)=>{const m=()=>{h(new Error(`relayer.request - publish interrupted, id: ${a}`))};this.provider.on(en.disconnect,m);const w=await c;this.provider.off(en.disconnect,m),f(w)});return this.logger.trace({id:a,method:t.method,topic:(i=t.params)==null?void 0:i.topic},"relayer.request - published"),u}catch(c){throw this.logger.debug(`Failed to Publish Request: ${a}`),c}finally{this.requestsInFlight.delete(a)}},this.resetPingTimeout=()=>{if(xo())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var t,n,i;(i=(n=(t=this.provider)==null?void 0:t.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.startPingTimeout(),this.events.emit(Wr.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(Wr.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(en.payload,this.onPayloadHandler),this.provider.on(en.connect,this.onConnectHandler),this.provider.on(en.disconnect,this.onDisconnectHandler),this.provider.on(en.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Xe.generateChildLogger(e.logger,this.name):Xe.pino(Xe.getDefaultLoggerOptions({level:e.logger||q4})),this.messages=new u8(this.logger,e.core),this.subscriber=new y8(this,this.logger),this.publisher=new h8(this,this.logger),this.relayUrl=e?.relayUrl||_1,this.projectId=e.projectId,this.bundleId=f_(),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 ${E1}...`),await this.restartTransport(E1)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&this.subscriber.pending.size===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},V4)}get context(){return Xe.getLoggerContext(this.logger)}get connected(){var e,t,n;return((n=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:n.readyState)===1}get connecting(){var e,t,n;return((n=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:n.readyState)===0}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"",a;const c=u=>{u.topic===e&&(this.subscriber.off(xn.created,c),a())};return await Promise.all([new Promise(u=>{a=u,this.subscriber.on(xn.created,c)}),new Promise(async u=>{i=await this.subscriber.subscribe(e,t)||i,u()})]),i}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await Do(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect(),await this.createProvider()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(t,n)=>{const i=()=>{this.provider.off(en.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(en.disconnect,i),await Do(this.provider.connect(),me.toMiliseconds(me.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(a=>{n(a)}),await this.subscriber.start(),this.hasExperiencedNetworkDisruption=!1,t()})}catch(t){this.logger.error(t);const n=t;if(!this.isConnectionStalled(n.message))throw t}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await hp())throw new Error("No internet connection detected. Please restart your network and try again.")}startPingTimeout(){var e,t,n,i,a;if(xo())try{(t=(e=this.provider)==null?void 0:e.connection)!=null&&t.socket&&((a=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||a.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(c){this.logger.warn(c)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new jn(new t6(y_({sdkVersion:K4,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:n}=e;await this.messages.set(t,n)}async shouldIgnoreMessageEvent(e){const{topic:t,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const i=this.messages.has(t,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}),Ru(e)){if(!e.method.endsWith(H4))return;const t=e.params,{topic:n,message:i,publishedAt:a}=t.data,c={topic:n,message:i,publishedAt:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(E8({type:"event",event:t.id},c)),this.events.emit(t.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else Ga(e)&&this.events.emit(Wr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Wr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=Ka(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(en.payload,this.onPayloadHandler),this.provider.off(en.connect,this.onConnectHandler),this.provider.off(en.disconnect,this.onDisconnectHandler),this.provider.off(en.error,this.onProviderErrorHandler)}async registerEventListeners(){let e=await hp();f3(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.events.emit(Wr.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},me.toMiliseconds(W4))}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var I8=Object.defineProperty,O1=Object.getOwnPropertySymbols,D8=Object.prototype.hasOwnProperty,S8=Object.prototype.propertyIsEnumerable,C1=(r,e,t)=>e in r?I8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$1=(r,e)=>{for(var t in e||(e={}))D8.call(e,t)&&C1(r,t,e[t]);if(O1)for(var t of O1(e))S8.call(e,t)&&C1(r,t,e[t]);return r};class Za extends V5{constructor(e,t,n,i=si,a=void 0){super(e,t,n,i),this.core=e,this.logger=t,this.name=n,this.map=new Map,this.version=G4,this.cached=[],this.initialized=!1,this.storagePrefix=si,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!br(c)?this.map.set(this.getKey(c),c):z_(c)?this.map.set(c.id,c):H_(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,u)=>{this.isInitialized(),this.map.has(c)?await this.update(c,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:u}),this.map.set(c,u),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(u=>Object.keys(c).every(f=>r6(u[f],c[f]))):this.values),this.update=async(c,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:u});const f=$1($1({},this.getData(c)),u);this.map.set(c,f),await this.persist()},this.delete=async(c,u)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:u}),this.map.delete(c),this.addToRecentlyDeleted(c),await this.persist())},this.logger=Xe.generateChildLogger(t,this.name),this.storagePrefix=i,this.getKey=a}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:i}=ue("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return t}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:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class O8{constructor(e,t){this.core=e,this.logger=t,this.name=X4,this.version=e8,this.events=new lr.exports,this.initialized=!1,this.storagePrefix=si,this.ignoredPayloadTypes=[Li],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=cu(),i=await this.core.crypto.setSymKey(n),a=Hr(me.FIVE_MINUTES),c={protocol:b1},u={topic:i,expiry:a,relay:c,active:!1},f=N_({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:c,expiryTimestamp:a});return await this.pairings.set(i,u),await this.core.relayer.subscribe(i),this.core.expirer.set(i,a),{topic:i,uri:f}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:a,relay:c,expiryTimestamp:u}=ip(n.uri);let f;if(this.pairings.keys.includes(i)&&(f=this.pairings.get(i),f.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);const h=u||Hr(me.FIVE_MINUTES),m={topic:i,relay:c,expiry:h,active:!1};return await this.pairings.set(i,m),this.core.expirer.set(i,h),n.activatePairing&&await this.activate({topic:i}),this.events.emit($s.create,m),this.core.crypto.keychain.has(i)||await this.core.crypto.setSymKey(a,i),await this.core.relayer.subscribe(i,{relay:c}),m},this.activate=async({topic:n})=>{this.isInitialized();const i=Hr(me.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const a=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:u,reject:f}=Is();this.events.once(gt("pairing_ping",a),({error:h})=>{h?f(h):u()}),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",xt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,a)=>{const c=Cs(i,a),u=await this.core.crypto.encode(n,c),f=jo[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,u,f),c.id},this.sendResult=async(n,i,a)=>{const c=Ka(n,a),u=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=jo[f.request.method].res;await this.core.relayer.publish(i,u,h),await this.core.history.resolve(c)},this.sendError=async(n,i,a)=>{const c=Va(n,a),u=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=jo[f.request.method]?jo[f.request.method].res:jo.unregistered_method.res;await this.core.relayer.publish(i,u,h),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,xt("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=>ii(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:a}=n;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(i,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,a);default:return this.onUnknownRpcMethodRequest(i,a)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:a}=n,c=(await this.core.history.get(i,a.id)).request.method;switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:a}=i;try{this.isValidPing({topic:n}),await this.sendResult(a,n,!0),this.events.emit($s.ping,{id:a,topic:n})}catch(c){await this.sendError(a,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:a}=i;setTimeout(()=>{Un(i)?this.events.emit(gt("pairing_ping",a),{}):pn(i)&&this.events.emit(gt("pairing_ping",a),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit($s.delete,{id:a,topic:n})}catch(c){await this.sendError(a,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:a,method:c}=i;try{if(this.registeredMethods.includes(c))return;const u=xt("WC_METHOD_UNSUPPORTED",c);await this.sendError(a,n,u),this.logger.error(u)}catch(u){await this.sendError(a,n,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(xt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{var i;if(!Tr(n)){const{message:c}=ue("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(c)}if(!q_(n.uri)){const{message:c}=ue("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(c)}const a=ip(n.uri);if(!((i=a?.relay)!=null&&i.protocol)){const{message:c}=ue("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(c)}if(!(a!=null&&a.symKey)){const{message:c}=ue("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(c)}if(a!=null&&a.expiryTimestamp&&me.toMiliseconds(a?.expiryTimestamp)<Date.now()){const{message:c}=ue("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(c)}},this.isValidPing=async n=>{if(!Tr(n)){const{message:a}=ue("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Tr(n)){const{message:a}=ue("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ir(n,!1)){const{message:i}=ue("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=ue("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(ii(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=ue("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=Xe.generateChildLogger(t,this.name),this.pairings=new Za(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Xe.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Wr.message,async e=>{const{topic:t,message:n}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(t,n);try{Ru(i)?(this.core.history.set(t,i),this.onRelayEventRequest({topic:t,payload:i})):Ga(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:t,payload:i}),this.core.history.delete(t,i.id))}catch(a){this.logger.error(a)}})}registerExpirerEvents(){this.core.expirer.on(tn.expired,async e=>{const{topic:t}=tp(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit($s.expire,{topic:t}))})}}class C8 extends z5{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new lr.exports.EventEmitter,this.name=t8,this.version=r8,this.cached=[],this.initialized=!1,this.storagePrefix=si,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,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:a}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:a,expiry:Hr(me.THIRTY_DAYS)};this.records.set(c.id,c),this.events.emit(In.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=pn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(In.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(a=>{if(a.topic===n){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(In.deleted,a)}})},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=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+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(t=>{if(typeof t.response<"u")return;const n={topic:t.topic,request:Cs(t.request.method,t.request.params,t.id),chainId:t.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 t=this.records.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(In.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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(In.created,e=>{const t=In.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(In.updated,e=>{const t=In.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(In.deleted,e=>{const t=In.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.core.heartbeat.on(Ss.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{me.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}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class $8 extends Y5{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new lr.exports.EventEmitter,this.name=n8,this.version=i8,this.cached=[],this.initialized=!1,this.storagePrefix=si,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 a=this.formatTarget(n),c={target:a,expiry:i};this.expirations.set(a,c),this.checkExpiry(a,c),this.events.emit(tn.created,{target:a,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),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(tn.deleted,{target:i,expiration:a})}},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=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+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 w_(e);if(typeof e=="number")return b_(e);const{message:t}=ue("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}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(tn.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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 t=this.expirations.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return t}checkExpiry(e,t){const{expiry:n}=t;me.toMiliseconds(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(tn.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(Ss.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(tn.created,e=>{const t=tn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(tn.expired,e=>{const t=tn.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(tn.deleted,e=>{const t=tn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class A8 extends Z5{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=Fu,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||Es()||!xs())return;const i=this.getVerifyUrl(n?.verifyUrl);this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(a){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(a)}if(!this.initialized){this.removeIframe(),this.verifyUrl=Bu;try{await this.createIframe()}catch(a){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(a),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=this.getVerifyUrl(n?.verifyUrl);let a;try{a=await this.fetchAttestation(n.attestationId,i)}catch(c){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${i}`),this.logger.info(c),a=await this.fetchAttestation(n.attestationId,Bu)}return a},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const a=this.startAbortTimer(me.ONE_SECOND*2),c=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(a),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=a=>{a.data==="verify_ready"&&(this.onInit(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(a=>{const c=document.getElementById(Fu);if(c)return this.iframe=c,this.onInit(),a();window.addEventListener("message",i);const u=document.createElement("iframe");u.id=Fu,u.src=`${this.verifyUrl}/${this.projectId}`,u.style.display="none",document.body.append(u),this.iframe=u,n=a}),new Promise((a,c)=>setTimeout(()=>{window.removeEventListener("message",i),c("verify iframe load timeout")},me.toMiliseconds(me.FIVE_SECONDS)))])},this.onInit=()=>{this.initialized=!0,this.processQueue()},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=n=>{let i=n||As;return s8.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${As}`),i=As),i},this.logger=Xe.generateChildLogger(t,this.name),this.verifyUrl=As,this.abortController=new AbortController,this.isDevEnv=xo()&&process.env.IS_VITEST}get context(){return Xe.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),me.toMiliseconds(e))}}class P8 extends J5{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=o8,this.registerDeviceToken=async n=>{const{clientId:i,token:a,notificationType:c,enableEncrypted:u=!1}=n,f=`${a8}/${this.projectId}/clients`;await s6(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:c,token:a,always_raw:u})})},this.logger=Xe.generateChildLogger(t,this.context)}}var T8=Object.defineProperty,A1=Object.getOwnPropertySymbols,R8=Object.prototype.hasOwnProperty,N8=Object.prototype.propertyIsEnumerable,P1=(r,e,t)=>e in r?T8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,T1=(r,e)=>{for(var t in e||(e={}))R8.call(e,t)&&P1(r,t,e[t]);if(A1)for(var t of A1(e))N8.call(e,t)&&P1(r,t,e[t]);return r};class qu extends q5{constructor(e){super(e),this.protocol=y1,this.version=P4,this.name=ju,this.events=new lr.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||_1,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const t=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||T4.logger}));this.logger=Xe.generateChildLogger(t,this.name),this.heartbeat=new Ss.HeartBeat,this.crypto=new l8(this,this.logger,e?.keychain),this.history=new C8(this,this.logger),this.expirer=new $8(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new K3(T1(T1({},R4),e?.storageOptions)),this.relayer=new x8({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new O8(this,this.logger),this.verify=new A8(this.projectId||"",this.logger),this.echoClient=new P8(this.projectId||"",this.logger)}static async init(e){const t=new qu(e);await t.initialize();const n=await t.crypto.getClientId();return await t.storage.setItem(Y4,n),t}get context(){return Xe.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 L8=qu,R1="wc",N1=2,L1="client",zu=`${R1}@${N1}:${L1}:`,Hu={name:L1,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},M1="WALLETCONNECT_DEEPLINK_CHOICE",M8="proposal",U1="Proposal expired",U8="session",Ja=me.SEVEN_DAYS,j8="engine",Fn={wc_sessionPropose:{req:{ttl:me.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1104},res:{ttl:me.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1106},res:{ttl:me.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:me.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:me.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1112},res:{ttl:me.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1114},res:{ttl:me.ONE_DAY,prompt:!1,tag:1115}}},Wu={min:me.FIVE_MINUTES,max:me.SEVEN_DAYS},Bn={idle:"IDLE",active:"ACTIVE"},F8="request",B8=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var k8=Object.defineProperty,q8=Object.defineProperties,z8=Object.getOwnPropertyDescriptors,j1=Object.getOwnPropertySymbols,H8=Object.prototype.hasOwnProperty,W8=Object.prototype.propertyIsEnumerable,F1=(r,e,t)=>e in r?k8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,xr=(r,e)=>{for(var t in e||(e={}))H8.call(e,t)&&F1(r,t,e[t]);if(j1)for(var t of j1(e))W8.call(e,t)&&F1(r,t,e[t]);return r},Ps=(r,e)=>q8(r,z8(e));class K8 extends X5{constructor(e){super(e),this.name=j8,this.events=new lr.exports,this.initialized=!1,this.ignoredPayloadTypes=[Li],this.requestQueue={state:Bn.idle,queue:[]},this.sessionRequestQueue={state:Bn.idle,queue:[]},this.requestQueueDelay=me.ONE_SECOND,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Fn)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},me.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();const n=Ps(xr({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:c,sessionProperties:u,relays:f}=n;let h=i,m,w=!1;try{h&&(w=this.client.core.pairing.pairings.get(h).active)}catch(O){throw this.client.logger.error(`connect() -> pairing.get(${h}) failed`),O}if(!h||!w){const{topic:O,uri:$}=await this.client.core.pairing.create();h=O,m=$}if(!h){const{message:O}=ue("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(O)}const y=await this.client.core.crypto.generateKeyPair(),_=Fn.wc_sessionPropose.req.ttl||me.FIVE_MINUTES,S=Hr(_),P=xr({requiredNamespaces:a,optionalNamespaces:c,relays:f??[{protocol:b1}],proposer:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:S},u&&{sessionProperties:u}),{reject:j,resolve:U,done:A}=Is(_,U1);this.events.once(gt("session_connect"),async({error:O,session:$})=>{if(O)j(O);else if($){$.self.publicKey=y;const x=Ps(xr({},$),{requiredNamespaces:P.requiredNamespaces,optionalNamespaces:P.optionalNamespaces});await this.client.session.set($.topic,x),await this.setExpiry($.topic,$.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:$.peer.metadata}),U(x)}});const T=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:P,throwOnFailedPublish:!0});return await this.setProposal(T,xr({id:T},P)),{uri:m,approval:A}},this.pair=async t=>{await this.isInitialized();try{return await this.client.core.pairing.pair(t)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async t=>{await this.isInitialized();try{await this.isValidApprove(t)}catch(U){throw this.client.logger.error("approve() -> isValidApprove() failed"),U}const{id:n,relayProtocol:i,namespaces:a,sessionProperties:c}=t;let u;try{u=this.client.proposal.get(n)}catch(U){throw this.client.logger.error(`approve() -> proposal.get(${n}) failed`),U}let{pairingTopic:f,proposer:h,requiredNamespaces:m,optionalNamespaces:w}=u;f=f||"";const y=await this.client.core.crypto.generateKeyPair(),_=h.publicKey,S=await this.client.core.crypto.generateSharedKey(y,_),P=xr({relay:{protocol:i??"irn"},namespaces:a,pairingTopic:f,controller:{publicKey:y,metadata:this.client.metadata},expiry:Hr(Ja)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(S);const j=Ps(xr({},P),{topic:S,requiredNamespaces:m,optionalNamespaces:w,pairingTopic:f,acknowledged:!1,self:P.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:y});await this.client.session.set(S,j);try{await this.sendResult({id:n,topic:f,result:{relay:{protocol:i??"irn"},responderPublicKey:y},throwOnFailedPublish:!0}),await this.sendRequest({topic:S,method:"wc_sessionSettle",params:P,throwOnFailedPublish:!0})}catch(U){throw this.client.logger.error(U),this.client.session.delete(S,xt("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(S),U}return await this.client.core.pairing.updateMetadata({topic:f,metadata:h.metadata}),await this.client.proposal.delete(n,xt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:f}),await this.setExpiry(S,Hr(Ja)),{topic:S,acknowledged:()=>new Promise(U=>setTimeout(()=>U(this.client.session.get(S)),500))}},this.reject=async t=>{await this.isInitialized();try{await this.isValidReject(t)}catch(c){throw this.client.logger.error("reject() -> isValidReject() failed"),c}const{id:n,reason:i}=t;let a;try{a=this.client.proposal.get(n).pairingTopic}catch(c){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),c}a&&(await this.sendError(n,a,i),await this.client.proposal.delete(n,xt("USER_DISCONNECTED")))},this.update=async t=>{await this.isInitialized();try{await this.isValidUpdate(t)}catch(w){throw this.client.logger.error("update() -> isValidUpdate() failed"),w}const{topic:n,namespaces:i}=t,{done:a,resolve:c,reject:u}=Is(),f=Os(),h=qi().toString(),m=this.client.session.get(n).namespaces;return this.events.once(gt("session_update",f),async({error:w})=>{w?u(w):(await this.client.session.update(n,{namespaces:i}),c())}),this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:f,relayRpcId:h}).catch(w=>{this.client.logger.error(w),this.client.session.update(n,{namespaces:m}),u(w)}),{acknowledged:a}},this.extend=async t=>{await this.isInitialized();try{await this.isValidExtend(t)}catch(f){throw this.client.logger.error("extend() -> isValidExtend() failed"),f}const{topic:n}=t,i=Os(),{done:a,resolve:c,reject:u}=Is();return this.events.once(gt("session_extend",i),({error:f})=>{f?u(f):c()}),await this.setExpiry(n,Hr(Ja)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(f=>{u(f)}),{acknowledged:a}},this.request=async t=>{await this.isInitialized();try{await this.isValidRequest(t)}catch(y){throw this.client.logger.error("request() -> isValidRequest() failed"),y}const{chainId:n,request:i,topic:a,expiry:c=Fn.wc_sessionRequest.req.ttl}=t,u=Os(),f=qi().toString(),{done:h,resolve:m,reject:w}=Is(c,"Request expired. Please try again.");return this.events.once(gt("session_request",u),({error:y,result:_})=>{y?w(y):m(_)}),await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:u,relayRpcId:f,topic:a,method:"wc_sessionRequest",params:{request:Ps(xr({},i),{expiryTimestamp:Hr(c)}),chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(_=>w(_)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:u}),y()}),new Promise(async y=>{const _=await E_(this.client.core.storage,M1);__({id:u,topic:a,wcDeepLink:_}),y()}),h()]).then(y=>y[2])},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);const{topic:n,response:i}=t,{id:a}=i;Un(i)?await this.sendResult({id:a,topic:n,result:i.result,throwOnFailedPublish:!0}):pn(i)&&await this.sendError(a,n,i.error),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized();try{await this.isValidPing(t)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=t;if(this.client.session.keys.includes(n)){const i=Os(),a=qi().toString(),{done:c,resolve:u,reject:f}=Is();this.events.once(gt("session_ping",i),({error:h})=>{h?f(h):u()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:a}),c()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);const{topic:n,event:i,chainId:a}=t,c=qi().toString();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:a},throwOnFailedPublish:!0,relayRpcId:c})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);const{topic:n}=t;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:xt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=ue("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(n=>B_(n,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const n=this.client.core.pairing.pairings.get(t.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var c,u;return((c=a.peerMetadata)==null?void 0:c.url)&&((u=a.peerMetadata)==null?void 0:u.url)===t.peer.metadata.url&&a.topic&&a.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async t=>{const{topic:n,expirerHasDeleted:i=!1,emitEvent:a=!0,id:c=0}=t,{self:u}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,xt("USER_DISCONNECTED")),this.addToRecentlyDeleted(n,"session"),this.client.core.crypto.keychain.has(u.publicKey)&&await this.client.core.crypto.deleteKeyPair(u.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),i||this.client.core.expirer.del(n),this.client.core.storage.removeItem(M1).catch(f=>this.client.logger.warn(f)),this.getPendingSessionRequests().forEach(f=>{f.topic===n&&this.deletePendingSessionRequest(f.id,xt("USER_DISCONNECTED"))}),a&&this.client.events.emit("session_delete",{id:c,topic:n})},this.deleteProposal=async(t,n)=>{await Promise.all([this.client.proposal.delete(t,xt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")},this.deletePendingSessionRequest=async(t,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,n),i?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==t),i&&(this.sessionRequestQueue.state=Bn.idle,this.client.events.emit("session_request_expire",{id:t}))},this.setExpiry=async(t,n)=>{this.client.session.keys.includes(t)&&await this.client.session.update(t,{expiry:n}),this.client.core.expirer.set(t,n)},this.setProposal=async(t,n)=>{await this.client.proposal.set(t,n),this.client.core.expirer.set(t,Hr(Fn.wc_sessionPropose.req.ttl))},this.setPendingSessionRequest=async t=>{const{id:n,topic:i,params:a,verifyContext:c}=t,u=a.request.expiryTimestamp||Hr(Fn.wc_sessionRequest.req.ttl);await this.client.pendingRequest.set(n,{id:n,topic:i,params:a,verifyContext:c}),u&&this.client.core.expirer.set(n,u)},this.sendRequest=async t=>{const{topic:n,method:i,params:a,expiry:c,relayRpcId:u,clientRpcId:f,throwOnFailedPublish:h}=t,m=Cs(i,a,f);if(xs()&&B8.includes(i)){const _=_s(JSON.stringify(m));this.client.core.verify.register({attestationId:_})}let w;try{w=await this.client.core.crypto.encode(n,m)}catch(_){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),_}const y=Fn[i].req;return c&&(y.ttl=c),u&&(y.id=u),this.client.core.history.set(n,m),h?(y.internal=Ps(xr({},y.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,w,y)):this.client.core.relayer.publish(n,w,y).catch(_=>this.client.logger.error(_)),m.id},this.sendResult=async t=>{const{id:n,topic:i,result:a,throwOnFailedPublish:c}=t,u=Ka(n,a);let f;try{f=await this.client.core.crypto.encode(i,u)}catch(w){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),w}let h;try{h=await this.client.core.history.get(i,n)}catch(w){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),w}const m=Fn[h.request.method].res;c?(m.internal=Ps(xr({},m.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,f,m)):this.client.core.relayer.publish(i,f,m).catch(w=>this.client.logger.error(w)),await this.client.core.history.resolve(u)},this.sendError=async(t,n,i)=>{const a=Va(t,i);let c;try{c=await this.client.core.crypto.encode(n,a)}catch(h){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),h}let u;try{u=await this.client.core.history.get(n,t)}catch(h){throw this.client.logger.error(`sendError() -> history.get(${n}, ${t}) failed`),h}const f=Fn[u.request.method].res;this.client.core.relayer.publish(n,c,f),await this.client.core.history.resolve(a)},this.cleanup=async()=>{const t=[],n=[];this.client.session.getAll().forEach(i=>{let a=!1;ii(i.expiry)&&(a=!0),this.client.core.crypto.keychain.has(i.topic)||(a=!0),a&&t.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{ii(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...t.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Bn.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=Bn.active;const t=this.requestQueue.queue.shift();if(t)try{this.processRequest(t),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Bn.idle},this.processRequest=t=>{const{topic:n,payload:i}=t,a=i.method;switch(a){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 ${a}`)}},this.onRelayEventResponse=async t=>{const{topic:n,payload:i}=t,a=(await this.client.core.history.get(n,i.id)).request.method;switch(a){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 ${a}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:n}=t,{message:i}=ue("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(t,n)=>{const{params:i,id:a}=n;try{this.isValidConnect(xr({},n.params));const c=i.expiryTimestamp||Hr(Fn.wc_sessionPropose.req.ttl),u=xr({id:a,pairingTopic:t,expiryTimestamp:c},i);await this.setProposal(a,u);const f=_s(JSON.stringify(n)),h=await this.getVerifyContext(f,u.proposer.metadata);this.client.events.emit("session_proposal",{id:a,params:u,verifyContext:h})}catch(c){await this.sendError(a,t,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(t,n)=>{const{id:i}=n;if(Un(n)){const{result:a}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const u=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u});const f=a.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:f});const h=await this.client.core.crypto.generateSharedKey(u,f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:h});const m=await this.client.core.relayer.subscribe(h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:m}),await this.client.core.pairing.activate({topic:t})}else if(pn(n)){await this.client.proposal.delete(i,xt("USER_DISCONNECTED"));const a=gt("session_connect");if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners, 954`);this.events.emit(gt("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(t,n)=>{const{id:i,params:a}=n;try{this.isValidSessionSettleRequest(a);const{relay:c,controller:u,expiry:f,namespaces:h,sessionProperties:m,pairingTopic:w}=n.params,y=xr({topic:t,relay:c,expiry:f,namespaces:h,acknowledged:!0,pairingTopic:w,requiredNamespaces:{},optionalNamespaces:{},controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},m&&{sessionProperties:m});await this.sendResult({id:n.id,topic:t,result:!0,throwOnFailedPublish:!0});const _=gt("session_connect");if(this.events.listenerCount(_)===0)throw new Error(`emitting ${_} without any listeners 997`);this.events.emit(gt("session_connect"),{session:y}),this.cleanupDuplicatePairings(y)}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.onSessionSettleResponse=async(t,n)=>{const{id:i}=n;Un(n)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(gt("session_approve",i),{})):pn(n)&&(await this.client.session.delete(t,xt("USER_DISCONNECTED")),this.events.emit(gt("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(t,n)=>{const{params:i,id:a}=n;try{const c=`${t}_session_update`,u=Co.get(c);if(u&&this.isRequestOutOfSync(u,a)){this.client.logger.info(`Discarding out of sync request - ${a}`),this.sendError(a,t,xt("INVALID_UPDATE_REQUEST"));return}this.isValidUpdate(xr({topic:t},i));try{Co.set(c,a),await this.client.session.update(t,{namespaces:i.namespaces}),await this.sendResult({id:a,topic:t,result:!0,throwOnFailedPublish:!0})}catch(f){throw Co.delete(c),f}this.client.events.emit("session_update",{id:a,topic:t,params:i})}catch(c){await this.sendError(a,t,c),this.client.logger.error(c)}},this.isRequestOutOfSync=(t,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,n)=>{const{id:i}=n,a=gt("session_update",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Un(n)?this.events.emit(gt("session_update",i),{}):pn(n)&&this.events.emit(gt("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(t,n)=>{const{id:i}=n;try{this.isValidExtend({topic:t}),await this.setExpiry(t,Hr(Ja)),await this.sendResult({id:i,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:t})}catch(a){await this.sendError(i,t,a),this.client.logger.error(a)}},this.onSessionExtendResponse=(t,n)=>{const{id:i}=n,a=gt("session_extend",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Un(n)?this.events.emit(gt("session_extend",i),{}):pn(n)&&this.events.emit(gt("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(t,n)=>{const{id:i}=n;try{this.isValidPing({topic:t}),await this.sendResult({id:i,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:t})}catch(a){await this.sendError(i,t,a),this.client.logger.error(a)}},this.onSessionPingResponse=(t,n)=>{const{id:i}=n,a=gt("session_ping",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);setTimeout(()=>{Un(n)?this.events.emit(gt("session_ping",i),{}):pn(n)&&this.events.emit(gt("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(t,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:t,reason:n.params}),await Promise.all([new Promise(a=>{this.client.core.relayer.once(Wr.publish,async()=>{a(await this.deleteSession({topic:t,id:i}))})}),this.sendResult({id:i,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:xt("USER_DISCONNECTED")})])}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async(t,n)=>{const{id:i,params:a}=n;try{this.isValidRequest(xr({topic:t},a));const c=_s(JSON.stringify(Cs("wc_sessionRequest",a,i))),u=this.client.session.get(t),f=await this.getVerifyContext(c,u.peer.metadata),h={id:i,topic:t,params:a,verifyContext:f};await this.setPendingSessionRequest(h),this.addSessionRequestToSessionRequestQueue(h),this.processSessionRequestQueue()}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(t,n)=>{const{id:i}=n,a=gt("session_request",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Un(n)?this.events.emit(gt("session_request",i),{result:n.result}):pn(n)&&this.events.emit(gt("session_request",i),{error:n.error})},this.onSessionEventRequest=async(t,n)=>{const{id:i,params:a}=n;try{const c=`${t}_session_event_${a.event.name}`,u=Co.get(c);if(u&&this.isRequestOutOfSync(u,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(xr({topic:t},a)),this.client.events.emit("session_event",{id:i,topic:t,params:a}),Co.set(c,i)}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Bn.idle,this.processSessionRequestQueue()},me.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(a=>a.topic===t&&a.request.method==="wc_sessionRequest").forEach(a=>{const c=a.request.id,u=gt("session_request",c);if(this.events.listenerCount(u)===0)throw new Error(`emitting ${u} without any listeners`);this.events.emit(gt("session_request",a.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Bn.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Bn.active,this.client.events.emit("session_request",t)}catch(n){this.client.logger.error(n)}},this.onPairingCreated=t=>{if(t.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===t.topic);n&&this.onSessionProposeRequest(t.topic,Cs("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id))},this.isValidConnect=async t=>{if(!Tr(t)){const{message:f}=ue("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(f)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:c,relays:u}=t;if(br(n)||await this.isValidPairingTopic(n),!Q_(u,!0)){const{message:f}=ue("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(f)}!br(i)&&Oo(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!br(a)&&Oo(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),br(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(t,n)=>{const i=J_(t,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async t=>{if(!Tr(t))throw new Error(ue("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:n,namespaces:i,relayProtocol:a,sessionProperties:c}=t;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const u=this.client.proposal.get(n),f=du(i,"approve()");if(f)throw new Error(f.message);const h=lp(u.requiredNamespaces,i,"approve()");if(h)throw new Error(h.message);if(!ir(a,!0)){const{message:m}=ue("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(m)}br(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async t=>{if(!Tr(t)){const{message:a}=ue("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(a)}const{id:n,reason:i}=t;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!e3(i)){const{message:a}=ue("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidSessionSettleRequest=t=>{if(!Tr(t)){const{message:h}=ue("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(h)}const{relay:n,controller:i,namespaces:a,expiry:c}=t;if(!ap(n)){const{message:h}=ue("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(h)}const u=W_(i,"onSessionSettleRequest()");if(u)throw new Error(u.message);const f=du(a,"onSessionSettleRequest()");if(f)throw new Error(f.message);if(ii(c)){const{message:h}=ue("EXPIRED","onSessionSettleRequest()");throw new Error(h)}},this.isValidUpdate=async t=>{if(!Tr(t)){const{message:f}=ue("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(f)}const{topic:n,namespaces:i}=t;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const a=this.client.session.get(n),c=du(i,"update()");if(c)throw new Error(c.message);const u=lp(a.requiredNamespaces,i,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async t=>{if(!Tr(t)){const{message:i}=ue("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(i)}const{topic:n}=t;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async t=>{if(!Tr(t)){const{message:f}=ue("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(f)}const{topic:n,request:i,chainId:a,expiry:c}=t;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:u}=this.client.session.get(n);if(!cp(u,a)){const{message:f}=ue("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(f)}if(!t3(i)){const{message:f}=ue("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(f)}if(!i3(u,a,i.method)){const{message:f}=ue("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(f)}if(c&&!c3(c,Wu)){const{message:f}=ue("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${Wu.min} and ${Wu.max}`);throw new Error(f)}},this.isValidRespond=async t=>{var n;if(!Tr(t)){const{message:c}=ue("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(c)}const{topic:i,response:a}=t;try{await this.isValidSessionTopic(i)}catch(c){throw(n=t?.response)!=null&&n.id&&this.cleanupAfterResponse(t),c}if(!r3(a)){const{message:c}=ue("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(c)}},this.isValidPing=async t=>{if(!Tr(t)){const{message:i}=ue("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async t=>{if(!Tr(t)){const{message:u}=ue("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(u)}const{topic:n,event:i,chainId:a}=t;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!cp(c,a)){const{message:u}=ue("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(u)}if(!n3(i)){const{message:u}=ue("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}if(!s3(c,a,i.name)){const{message:u}=ue("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}},this.isValidDisconnect=async t=>{if(!Tr(t)){const{message:i}=ue("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(t,n)=>{const i={verified:{verifyUrl:n.verifyUrl||As,validation:"UNKNOWN",origin:n.url||""}};try{const a=await this.client.core.verify.resolve({attestationId:t,verifyUrl:n.verifyUrl});a&&(i.verified.origin=a.origin,i.verified.isScam=a.isScam,i.verified.validation=a.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(a){this.client.logger.info(a)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(t,n)=>{Object.values(t).forEach(i=>{if(!ir(i,!1)){const{message:a}=ue("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(a)}})},this.addToRecentlyDeleted=(t,n)=>{if(this.recentlyDeletedMap.set(t,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const a=this.recentlyDeletedLimit/2;for(const c of this.recentlyDeletedMap.keys()){if(i++>=a)break;this.recentlyDeletedMap.delete(c)}}},this.checkRecentlyDeleted=t=>{const n=this.recentlyDeletedMap.get(t);if(n){const{message:i}=ue("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${t}`);throw new Error(i)}}}async isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Wr.message,async e=>{const{topic:t,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(t,n);try{Ru(i)?(this.client.core.history.set(t,i),this.onRelayEventRequest({topic:t,payload:i})):Ga(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:t,payload:i}),this.client.core.history.delete(t,i.id)):this.onRelayEventUnknownPayload({topic:t,payload:i})}catch(a){this.client.logger.error(a)}})}registerExpirerEvents(){this.client.core.expirer.on(tn.expired,async e=>{const{topic:t,id:n}=tp(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ue("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on($s.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on($s.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!ir(e,!1)){const{message:t}=ue("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=ue("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(ii(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=ue("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!ir(e,!1)){const{message:t}=ue("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=ue("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(ii(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=ue("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=ue("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),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(ir(e,!1)){const{message:t}=ue("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=ue("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!X_(e)){const{message:t}=ue("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=ue("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(ii(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=ue("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class V8 extends Za{constructor(e,t){super(e,t,M8,zu),this.core=e,this.logger=t}}class G8 extends Za{constructor(e,t){super(e,t,U8,zu),this.core=e,this.logger=t}}class Y8 extends Za{constructor(e,t){super(e,t,F8,zu,n=>n.id),this.core=e,this.logger=t}}class Ku extends Q5{constructor(e){super(e),this.protocol=R1,this.version=N1,this.name=Hu.name,this.events=new lr.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||Hu.name,this.metadata=e?.metadata||p_();const t=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||Hu.logger}));this.core=e?.core||new L8(e),this.logger=Xe.generateChildLogger(t,this.name),this.session=new G8(this.core,this.logger),this.proposal=new V8(this.core,this.logger),this.pendingRequest=new Y8(this.core,this.logger),this.engine=new K8(this)}static async init(e){const t=new Ku(e);return await t.initialize(),t}get context(){return Xe.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 Vu={exports:{}};(function(r,e){var t=typeof self<"u"?self:vr,n=function(){function a(){this.fetch=!1,this.DOMException=t.DOMException}return a.prototype=t,new a}();(function(a){(function(c){var u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function f(I){return I&&DataView.prototype.isPrototypeOf(I)}if(u.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(I){return I&&h.indexOf(Object.prototype.toString.call(I))>-1};function w(I){if(typeof I!="string"&&(I=String(I)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(I))throw new TypeError("Invalid character in header field name");return I.toLowerCase()}function y(I){return typeof I!="string"&&(I=String(I)),I}function _(I){var N={next:function(){var X=I.shift();return{done:X===void 0,value:X}}};return u.iterable&&(N[Symbol.iterator]=function(){return N}),N}function S(I){this.map={},I instanceof S?I.forEach(function(N,X){this.append(X,N)},this):Array.isArray(I)?I.forEach(function(N){this.append(N[0],N[1])},this):I&&Object.getOwnPropertyNames(I).forEach(function(N){this.append(N,I[N])},this)}S.prototype.append=function(I,N){I=w(I),N=y(N);var X=this.map[I];this.map[I]=X?X+", "+N:N},S.prototype.delete=function(I){delete this.map[w(I)]},S.prototype.get=function(I){return I=w(I),this.has(I)?this.map[I]:null},S.prototype.has=function(I){return this.map.hasOwnProperty(w(I))},S.prototype.set=function(I,N){this.map[w(I)]=y(N)},S.prototype.forEach=function(I,N){for(var X in this.map)this.map.hasOwnProperty(X)&&I.call(N,this.map[X],X,this)},S.prototype.keys=function(){var I=[];return this.forEach(function(N,X){I.push(X)}),_(I)},S.prototype.values=function(){var I=[];return this.forEach(function(N){I.push(N)}),_(I)},S.prototype.entries=function(){var I=[];return this.forEach(function(N,X){I.push([X,N])}),_(I)},u.iterable&&(S.prototype[Symbol.iterator]=S.prototype.entries);function P(I){if(I.bodyUsed)return Promise.reject(new TypeError("Already read"));I.bodyUsed=!0}function j(I){return new Promise(function(N,X){I.onload=function(){N(I.result)},I.onerror=function(){X(I.error)}})}function U(I){var N=new FileReader,X=j(N);return N.readAsArrayBuffer(I),X}function A(I){var N=new FileReader,X=j(N);return N.readAsText(I),X}function T(I){for(var N=new Uint8Array(I),X=new Array(N.length),ee=0;ee<N.length;ee++)X[ee]=String.fromCharCode(N[ee]);return X.join("")}function O(I){if(I.slice)return I.slice(0);var N=new Uint8Array(I.byteLength);return N.set(new Uint8Array(I)),N.buffer}function $(){return this.bodyUsed=!1,this._initBody=function(I){this._bodyInit=I,I?typeof I=="string"?this._bodyText=I:u.blob&&Blob.prototype.isPrototypeOf(I)?this._bodyBlob=I:u.formData&&FormData.prototype.isPrototypeOf(I)?this._bodyFormData=I:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(I)?this._bodyText=I.toString():u.arrayBuffer&&u.blob&&f(I)?(this._bodyArrayBuffer=O(I.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(I)||m(I))?this._bodyArrayBuffer=O(I):this._bodyText=I=Object.prototype.toString.call(I):this._bodyText="",this.headers.get("content-type")||(typeof I=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(I)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var I=P(this);if(I)return I;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?P(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(U)}),this.text=function(){var I=P(this);if(I)return I;if(this._bodyBlob)return A(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(T(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(H)}),this.json=function(){return this.text().then(JSON.parse)},this}var x=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function d(I){var N=I.toUpperCase();return x.indexOf(N)>-1?N:I}function b(I,N){N=N||{};var X=N.body;if(I instanceof b){if(I.bodyUsed)throw new TypeError("Already read");this.url=I.url,this.credentials=I.credentials,N.headers||(this.headers=new S(I.headers)),this.method=I.method,this.mode=I.mode,this.signal=I.signal,!X&&I._bodyInit!=null&&(X=I._bodyInit,I.bodyUsed=!0)}else this.url=String(I);if(this.credentials=N.credentials||this.credentials||"same-origin",(N.headers||!this.headers)&&(this.headers=new S(N.headers)),this.method=d(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})};function H(I){var N=new FormData;return I.trim().split("&").forEach(function(X){if(X){var ee=X.split("="),Y=ee.shift().replace(/\+/g," "),Z=ee.join("=").replace(/\+/g," ");N.append(decodeURIComponent(Y),decodeURIComponent(Z))}}),N}function F(I){var N=new S,X=I.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(ee){var Y=ee.split(":"),Z=Y.shift().trim();if(Z){var Q=Y.join(":").trim();N.append(Z,Q)}}),N}$.call(b.prototype);function V(I,N){N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in N?N.statusText:"OK",this.headers=new S(N.headers),this.url=N.url||"",this._initBody(I)}$.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new S(this.headers),url:this.url})},V.error=function(){var I=new V(null,{status:0,statusText:""});return I.type="error",I};var se=[301,302,303,307,308];V.redirect=function(I,N){if(se.indexOf(N)===-1)throw new RangeError("Invalid status code");return new V(null,{status:N,headers:{location:I}})},c.DOMException=a.DOMException;try{new c.DOMException}catch{c.DOMException=function(N,X){this.message=N,this.name=X;var ee=Error(N);this.stack=ee.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function ce(I,N){return new Promise(function(X,ee){var Y=new b(I,N);if(Y.signal&&Y.signal.aborted)return ee(new c.DOMException("Aborted","AbortError"));var Z=new XMLHttpRequest;function Q(){Z.abort()}Z.onload=function(){var ie={status:Z.status,statusText:Z.statusText,headers:F(Z.getAllResponseHeaders()||"")};ie.url="responseURL"in Z?Z.responseURL:ie.headers.get("X-Request-URL");var Ee="response"in Z?Z.response:Z.responseText;X(new V(Ee,ie))},Z.onerror=function(){ee(new TypeError("Network request failed"))},Z.ontimeout=function(){ee(new TypeError("Network request failed"))},Z.onabort=function(){ee(new c.DOMException("Aborted","AbortError"))},Z.open(Y.method,Y.url,!0),Y.credentials==="include"?Z.withCredentials=!0:Y.credentials==="omit"&&(Z.withCredentials=!1),"responseType"in Z&&u.blob&&(Z.responseType="blob"),Y.headers.forEach(function(ie,Ee){Z.setRequestHeader(Ee,ie)}),Y.signal&&(Y.signal.addEventListener("abort",Q),Z.onreadystatechange=function(){Z.readyState===4&&Y.signal.removeEventListener("abort",Q)}),Z.send(typeof Y._bodyInit>"u"?null:Y._bodyInit)})}return ce.polyfill=!0,a.fetch||(a.fetch=ce,a.Headers=S,a.Request=b,a.Response=V),c.Headers=S,c.Request=b,c.Response=V,c.fetch=ce,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,r.exports=e})(Vu,Vu.exports);var B1=Cy(Vu.exports);const k1={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},q1=10;class oi{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new lr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Vp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}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,t){this.isAvailable||await this.register();try{const n=ji(e),a=await(await B1(this.url,Object.assign(Object.assign({},k1),{body:n}))).json();this.onPayload({data:a})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Vp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),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 t=ji({id:1,jsonrpc:"2.0",method:"test",params:[]});await B1(e,Object.assign(Object.assign({},k1),{body:t}))}this.onOpen()}catch(t){const n=this.parseError(t);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 t=typeof e.data=="string"?Ao(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),i=n.message||n.toString(),a=Va(e,i);this.events.emit("payload",a)}parseError(e,t=this.url){return kp(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>q1&&this.events.setMaxListeners(q1)}}const z1="error",Z8="wss://relay.walletconnect.com",J8="wc",Q8="universal_provider",H1=`${J8}@2:${Q8}:`,X8="https://rpc.walletconnect.com/v1/",kn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Gu={exports:{}};/**
60
60
  * @license
61
61
  * Lodash <https://lodash.com/>
62
62
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
63
63
  * Released under MIT license <https://lodash.com/license>
64
64
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
65
65
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
66
- */(function(r,e){(function(){var t,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",w=1,y=2,x=4,S=1,P=2,U=1,j=2,A=4,T=8,C=16,$=32,E=64,d=128,b=256,H=512,F=30,V="...",se=800,ce=16,I=1,N=2,X=3,ee=1/0,Y=9007199254740991,J=17976931348623157e292,Q=0/0,ie=4294967295,Ee=ie-1,ae=ie>>>1,xe=[["ary",d],["bind",U],["bindKey",j],["curry",T],["curryRight",C],["flip",H],["partial",$],["partialRight",E],["rearg",b]],de="[object Arguments]",be="[object Array]",K="[object AsyncFunction]",W="[object Boolean]",B="[object Date]",g="[object DOMException]",L="[object Error]",le="[object Function]",pe="[object GeneratorFunction]",Ce="[object Map]",Ke="[object Number]",Je="[object Null]",ke="[object Object]",St="[object Promise]",Ct="[object Proxy]",ze="[object RegExp]",Oe="[object Set]",Ue="[object String]",je="[object Symbol]",He="[object Undefined]",Ae="[object WeakMap]",Fe="[object WeakSet]",Se="[object ArrayBuffer]",Te="[object DataView]",Ve="[object Float32Array]",$e="[object Float64Array]",Ze="[object Int8Array]",et="[object Int16Array]",at="[object Int32Array]",ct="[object Uint8Array]",nt="[object Uint8ClampedArray]",Sr="[object Uint16Array]",Ur="[object Uint32Array]",On=/\b__p \+= '';/g,Cr=/\b(__p \+=) '' \+/g,Wn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bi=/&(?:amp|lt|gt|quot|#39);/g,rs=/[&<>"']/g,Lt=RegExp(bi.source),Ot=RegExp(rs.source),Mt=/<%-([\s\S]+?)%>/g,Ut=/<%([\s\S]+?)%>/g,Tt=/<%=([\s\S]+?)%>/g,$t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/,Yt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jt=/[\\^$.*+?()[\]{}|]/g,Jt=RegExp(jt.source),Ft=/^\s+/,Ht=/\s/,Bt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_t=/\{\n\/\* \[wrapped with (.+)\] \*/,Zt=/,? & /,Qt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lf=/[()=,{}\[\]\/\s]/,uf=/\\(\\)?/g,hf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rn=/\w*$/,ff=/^[-+]0x[0-9a-f]+$/i,df=/^0b[01]+$/i,pf=/^\[object .+?Constructor\]$/,gf=/^0o[0-7]+$/i,mf=/^(?:0|[1-9]\d*)$/,Kn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ks=/($^)/,vf=/['\n\r\u2028\u2029\\]/g,Vs="\\ud800-\\udfff",yf="\\u0300-\\u036f",wf="\\ufe20-\\ufe2f",Gs="\\u20d0-\\u20ff",Cc=yf+wf+Gs,Oc="\\u2700-\\u27bf",gn="a-z\\xdf-\\xf6\\xf8-\\xff",bf="\\xac\\xb1\\xd7\\xf7",_f="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ef="\\u2000-\\u206f",xf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$c="A-Z\\xc0-\\xd6\\xd8-\\xde",Ac="\\ufe0e\\ufe0f",ns=bf+_f+Ef+xf,na="['\u2019]",is="["+Vs+"]",ia="["+ns+"]",ss="["+Cc+"]",Pc="\\d+",If="["+Oc+"]",Tc="["+gn+"]",Rc="[^"+Vs+ns+Pc+Oc+gn+$c+"]",Ys="\\ud83c[\\udffb-\\udfff]",Df="(?:"+ss+"|"+Ys+")",Nc="[^"+Vs+"]",Js="(?:\\ud83c[\\udde6-\\uddff]){2}",_i="[\\ud800-\\udbff][\\udc00-\\udfff]",Gr="["+$c+"]",Lc="\\u200d",Mc="(?:"+Tc+"|"+Rc+")",$n="(?:"+Gr+"|"+Rc+")",Uc="(?:"+na+"(?:d|ll|m|re|s|t|ve))?",jc="(?:"+na+"(?:D|LL|M|RE|S|T|VE))?",Fc=Df+"?",Bc="["+Ac+"]?",Sf="(?:"+Lc+"(?:"+[Nc,Js,_i].join("|")+")"+Bc+Fc+")*",Vn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qc=Bc+Fc+Sf,Zs="(?:"+[If,Js,_i].join("|")+")"+qc,Cf="(?:"+[Nc+ss+"?",ss,Js,_i,is].join("|")+")",sa=RegExp(na,"g"),Of=RegExp(ss,"g"),Qs=RegExp(Ys+"(?="+Ys+")|"+Cf+qc,"g"),zc=RegExp([Gr+"?"+Tc+"+"+Uc+"(?="+[ia,Gr,"$"].join("|")+")",$n+"+"+jc+"(?="+[ia,Gr+Mc,"$"].join("|")+")",Gr+"?"+Mc+"+"+Uc,Gr+"+"+jc,kc,Vn,Pc,Zs].join("|"),"g"),Hc=RegExp("["+Lc+Vs+Cc+Ac+"]"),os=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wc=["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"],$f=-1,mt={};mt[Ve]=mt[$e]=mt[Ze]=mt[et]=mt[at]=mt[ct]=mt[nt]=mt[Sr]=mt[Ur]=!0,mt[de]=mt[be]=mt[Se]=mt[W]=mt[Te]=mt[B]=mt[L]=mt[le]=mt[Ce]=mt[Ke]=mt[ke]=mt[ze]=mt[Oe]=mt[Ue]=mt[Ae]=!1;var gt={};gt[de]=gt[be]=gt[Se]=gt[Te]=gt[W]=gt[B]=gt[Ve]=gt[$e]=gt[Ze]=gt[et]=gt[at]=gt[Ce]=gt[Ke]=gt[ke]=gt[ze]=gt[Oe]=gt[Ue]=gt[je]=gt[ct]=gt[nt]=gt[Sr]=gt[Ur]=!0,gt[L]=gt[le]=gt[Ae]=!1;var O={\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"},k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ne={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ge={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},vt=parseFloat,Ne=parseInt,Et=typeof Mo=="object"&&Mo&&Mo.Object===Object&&Mo,Xt=typeof self=="object"&&self&&self.Object===Object&&self,it=Et||Xt||Function("return this")(),yt=e&&!e.nodeType&&e,Wt=yt&&!0&&r&&!r.nodeType&&r,jr=Wt&&Wt.exports===yt,er=jr&&Et.process,xt=function(){try{var q=Wt&&Wt.require&&Wt.require("util").types;return q||er&&er.binding&&er.binding("util")}catch{}}(),Or=xt&&xt.isArrayBuffer,mn=xt&&xt.isDate,nn=xt&&xt.isMap,An=xt&&xt.isRegExp,oa=xt&&xt.isSet,as=xt&&xt.isTypedArray;function ar(q,Z,G){switch(G.length){case 0:return q.call(Z);case 1:return q.call(Z,G[0]);case 2:return q.call(Z,G[0],G[1]);case 3:return q.call(Z,G[0],G[1],G[2])}return q.apply(Z,G)}function uO(q,Z,G,me){for(var Re=-1,ut=q==null?0:q.length;++Re<ut;){var rr=q[Re];Z(me,rr,G(rr),q)}return me}function sn(q,Z){for(var G=-1,me=q==null?0:q.length;++G<me&&Z(q[G],G,q)!==!1;);return q}function hO(q,Z){for(var G=q==null?0:q.length;G--&&Z(q[G],G,q)!==!1;);return q}function $m(q,Z){for(var G=-1,me=q==null?0:q.length;++G<me;)if(!Z(q[G],G,q))return!1;return!0}function Ei(q,Z){for(var G=-1,me=q==null?0:q.length,Re=0,ut=[];++G<me;){var rr=q[G];Z(rr,G,q)&&(ut[Re++]=rr)}return ut}function Kc(q,Z){var G=q==null?0:q.length;return!!G&&Xs(q,Z,0)>-1}function Af(q,Z,G){for(var me=-1,Re=q==null?0:q.length;++me<Re;)if(G(Z,q[me]))return!0;return!1}function At(q,Z){for(var G=-1,me=q==null?0:q.length,Re=Array(me);++G<me;)Re[G]=Z(q[G],G,q);return Re}function xi(q,Z){for(var G=-1,me=Z.length,Re=q.length;++G<me;)q[Re+G]=Z[G];return q}function Pf(q,Z,G,me){var Re=-1,ut=q==null?0:q.length;for(me&&ut&&(G=q[++Re]);++Re<ut;)G=Z(G,q[Re],Re,q);return G}function fO(q,Z,G,me){var Re=q==null?0:q.length;for(me&&Re&&(G=q[--Re]);Re--;)G=Z(G,q[Re],Re,q);return G}function Tf(q,Z){for(var G=-1,me=q==null?0:q.length;++G<me;)if(Z(q[G],G,q))return!0;return!1}var dO=Rf("length");function pO(q){return q.split("")}function gO(q){return q.match(Qt)||[]}function Am(q,Z,G){var me;return G(q,function(Re,ut,rr){if(Z(Re,ut,rr))return me=ut,!1}),me}function Vc(q,Z,G,me){for(var Re=q.length,ut=G+(me?1:-1);me?ut--:++ut<Re;)if(Z(q[ut],ut,q))return ut;return-1}function Xs(q,Z,G){return Z===Z?CO(q,Z,G):Vc(q,Pm,G)}function mO(q,Z,G,me){for(var Re=G-1,ut=q.length;++Re<ut;)if(me(q[Re],Z))return Re;return-1}function Pm(q){return q!==q}function Tm(q,Z){var G=q==null?0:q.length;return G?Lf(q,Z)/G:Q}function Rf(q){return function(Z){return Z==null?t:Z[q]}}function Nf(q){return function(Z){return q==null?t:q[Z]}}function Rm(q,Z,G,me,Re){return Re(q,function(ut,rr,wt){G=me?(me=!1,ut):Z(G,ut,rr,wt)}),G}function vO(q,Z){var G=q.length;for(q.sort(Z);G--;)q[G]=q[G].value;return q}function Lf(q,Z){for(var G,me=-1,Re=q.length;++me<Re;){var ut=Z(q[me]);ut!==t&&(G=G===t?ut:G+ut)}return G}function Mf(q,Z){for(var G=-1,me=Array(q);++G<q;)me[G]=Z(G);return me}function yO(q,Z){return At(Z,function(G){return[G,q[G]]})}function Nm(q){return q&&q.slice(0,jm(q)+1).replace(Ft,"")}function Yr(q){return function(Z){return q(Z)}}function Uf(q,Z){return At(Z,function(G){return q[G]})}function aa(q,Z){return q.has(Z)}function Lm(q,Z){for(var G=-1,me=q.length;++G<me&&Xs(Z,q[G],0)>-1;);return G}function Mm(q,Z){for(var G=q.length;G--&&Xs(Z,q[G],0)>-1;);return G}function wO(q,Z){for(var G=q.length,me=0;G--;)q[G]===Z&&++me;return me}var bO=Nf(O),_O=Nf(k);function EO(q){return"\\"+ge[q]}function xO(q,Z){return q==null?t:q[Z]}function eo(q){return Hc.test(q)}function IO(q){return os.test(q)}function DO(q){for(var Z,G=[];!(Z=q.next()).done;)G.push(Z.value);return G}function jf(q){var Z=-1,G=Array(q.size);return q.forEach(function(me,Re){G[++Z]=[Re,me]}),G}function Um(q,Z){return function(G){return q(Z(G))}}function Ii(q,Z){for(var G=-1,me=q.length,Re=0,ut=[];++G<me;){var rr=q[G];(rr===Z||rr===m)&&(q[G]=m,ut[Re++]=G)}return ut}function Gc(q){var Z=-1,G=Array(q.size);return q.forEach(function(me){G[++Z]=me}),G}function SO(q){var Z=-1,G=Array(q.size);return q.forEach(function(me){G[++Z]=[me,me]}),G}function CO(q,Z,G){for(var me=G-1,Re=q.length;++me<Re;)if(q[me]===Z)return me;return-1}function OO(q,Z,G){for(var me=G+1;me--;)if(q[me]===Z)return me;return me}function to(q){return eo(q)?AO(q):dO(q)}function vn(q){return eo(q)?PO(q):pO(q)}function jm(q){for(var Z=q.length;Z--&&Ht.test(q.charAt(Z)););return Z}var $O=Nf(ne);function AO(q){for(var Z=Qs.lastIndex=0;Qs.test(q);)++Z;return Z}function PO(q){return q.match(Qs)||[]}function TO(q){return q.match(zc)||[]}var RO=function q(Z){Z=Z==null?it:ro.defaults(it.Object(),Z,ro.pick(it,Wc));var G=Z.Array,me=Z.Date,Re=Z.Error,ut=Z.Function,rr=Z.Math,wt=Z.Object,Ff=Z.RegExp,NO=Z.String,on=Z.TypeError,Yc=G.prototype,LO=ut.prototype,no=wt.prototype,Jc=Z["__core-js_shared__"],Zc=LO.toString,dt=no.hasOwnProperty,MO=0,Fm=function(){var s=/[^.]+$/.exec(Jc&&Jc.keys&&Jc.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Qc=no.toString,UO=Zc.call(wt),jO=it._,FO=Ff("^"+Zc.call(dt).replace(jt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xc=jr?Z.Buffer:t,Di=Z.Symbol,el=Z.Uint8Array,Bm=Xc?Xc.allocUnsafe:t,tl=Um(wt.getPrototypeOf,wt),km=wt.create,qm=no.propertyIsEnumerable,rl=Yc.splice,zm=Di?Di.isConcatSpreadable:t,ca=Di?Di.iterator:t,cs=Di?Di.toStringTag:t,nl=function(){try{var s=ds(wt,"defineProperty");return s({},"",{}),s}catch{}}(),BO=Z.clearTimeout!==it.clearTimeout&&Z.clearTimeout,kO=me&&me.now!==it.Date.now&&me.now,qO=Z.setTimeout!==it.setTimeout&&Z.setTimeout,il=rr.ceil,sl=rr.floor,Bf=wt.getOwnPropertySymbols,zO=Xc?Xc.isBuffer:t,Hm=Z.isFinite,HO=Yc.join,WO=Um(wt.keys,wt),nr=rr.max,mr=rr.min,KO=me.now,VO=Z.parseInt,Wm=rr.random,GO=Yc.reverse,kf=ds(Z,"DataView"),la=ds(Z,"Map"),qf=ds(Z,"Promise"),io=ds(Z,"Set"),ua=ds(Z,"WeakMap"),ha=ds(wt,"create"),ol=ua&&new ua,so={},YO=ps(kf),JO=ps(la),ZO=ps(qf),QO=ps(io),XO=ps(ua),al=Di?Di.prototype:t,fa=al?al.valueOf:t,Km=al?al.toString:t;function _(s){if(kt(s)&&!Le(s)&&!(s instanceof tt)){if(s instanceof an)return s;if(dt.call(s,"__wrapped__"))return Vv(s)}return new an(s)}var oo=function(){function s(){}return function(o){if(!Rt(o))return{};if(km)return km(o);s.prototype=o;var l=new s;return s.prototype=t,l}}();function cl(){}function an(s,o){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=t}_.templateSettings={escape:Mt,evaluate:Ut,interpolate:Tt,variable:"",imports:{_}},_.prototype=cl.prototype,_.prototype.constructor=_,an.prototype=oo(cl.prototype),an.prototype.constructor=an;function tt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function e7(){var s=new tt(this.__wrapped__);return s.__actions__=Fr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Fr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Fr(this.__views__),s}function t7(){if(this.__filtered__){var s=new tt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function r7(){var s=this.__wrapped__.value(),o=this.__dir__,l=Le(s),p=o<0,v=l?s.length:0,D=p$(0,v,this.__views__),R=D.start,M=D.end,z=M-R,te=p?M:R-1,re=this.__iteratees__,oe=re.length,fe=0,ve=mr(z,this.__takeCount__);if(!l||!p&&v==z&&ve==z)return mv(s,this.__actions__);var Ie=[];e:for(;z--&&fe<ve;){te+=o;for(var We=-1,De=s[te];++We<oe;){var Qe=re[We],st=Qe.iteratee,Qr=Qe.type,Pr=st(De);if(Qr==N)De=Pr;else if(!Pr){if(Qr==I)continue e;break e}}Ie[fe++]=De}return Ie}tt.prototype=oo(cl.prototype),tt.prototype.constructor=tt;function ls(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function n7(){this.__data__=ha?ha(null):{},this.size=0}function i7(s){var o=this.has(s)&&delete this.__data__[s];return this.size-=o?1:0,o}function s7(s){var o=this.__data__;if(ha){var l=o[s];return l===f?t:l}return dt.call(o,s)?o[s]:t}function o7(s){var o=this.__data__;return ha?o[s]!==t:dt.call(o,s)}function a7(s,o){var l=this.__data__;return this.size+=this.has(s)?0:1,l[s]=ha&&o===t?f:o,this}ls.prototype.clear=n7,ls.prototype.delete=i7,ls.prototype.get=s7,ls.prototype.has=o7,ls.prototype.set=a7;function Gn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function c7(){this.__data__=[],this.size=0}function l7(s){var o=this.__data__,l=ll(o,s);if(l<0)return!1;var p=o.length-1;return l==p?o.pop():rl.call(o,l,1),--this.size,!0}function u7(s){var o=this.__data__,l=ll(o,s);return l<0?t:o[l][1]}function h7(s){return ll(this.__data__,s)>-1}function f7(s,o){var l=this.__data__,p=ll(l,s);return p<0?(++this.size,l.push([s,o])):l[p][1]=o,this}Gn.prototype.clear=c7,Gn.prototype.delete=l7,Gn.prototype.get=u7,Gn.prototype.has=h7,Gn.prototype.set=f7;function Yn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function d7(){this.size=0,this.__data__={hash:new ls,map:new(la||Gn),string:new ls}}function p7(s){var o=_l(this,s).delete(s);return this.size-=o?1:0,o}function g7(s){return _l(this,s).get(s)}function m7(s){return _l(this,s).has(s)}function v7(s,o){var l=_l(this,s),p=l.size;return l.set(s,o),this.size+=l.size==p?0:1,this}Yn.prototype.clear=d7,Yn.prototype.delete=p7,Yn.prototype.get=g7,Yn.prototype.has=m7,Yn.prototype.set=v7;function us(s){var o=-1,l=s==null?0:s.length;for(this.__data__=new Yn;++o<l;)this.add(s[o])}function y7(s){return this.__data__.set(s,f),this}function w7(s){return this.__data__.has(s)}us.prototype.add=us.prototype.push=y7,us.prototype.has=w7;function yn(s){var o=this.__data__=new Gn(s);this.size=o.size}function b7(){this.__data__=new Gn,this.size=0}function _7(s){var o=this.__data__,l=o.delete(s);return this.size=o.size,l}function E7(s){return this.__data__.get(s)}function x7(s){return this.__data__.has(s)}function I7(s,o){var l=this.__data__;if(l instanceof Gn){var p=l.__data__;if(!la||p.length<i-1)return p.push([s,o]),this.size=++l.size,this;l=this.__data__=new Yn(p)}return l.set(s,o),this.size=l.size,this}yn.prototype.clear=b7,yn.prototype.delete=_7,yn.prototype.get=E7,yn.prototype.has=x7,yn.prototype.set=I7;function Vm(s,o){var l=Le(s),p=!l&&gs(s),v=!l&&!p&&Ai(s),D=!l&&!p&&!v&&uo(s),R=l||p||v||D,M=R?Mf(s.length,NO):[],z=M.length;for(var te in s)(o||dt.call(s,te))&&!(R&&(te=="length"||v&&(te=="offset"||te=="parent")||D&&(te=="buffer"||te=="byteLength"||te=="byteOffset")||Xn(te,z)))&&M.push(te);return M}function Gm(s){var o=s.length;return o?s[Xf(0,o-1)]:t}function D7(s,o){return El(Fr(s),hs(o,0,s.length))}function S7(s){return El(Fr(s))}function zf(s,o,l){(l!==t&&!wn(s[o],l)||l===t&&!(o in s))&&Jn(s,o,l)}function da(s,o,l){var p=s[o];(!(dt.call(s,o)&&wn(p,l))||l===t&&!(o in s))&&Jn(s,o,l)}function ll(s,o){for(var l=s.length;l--;)if(wn(s[l][0],o))return l;return-1}function C7(s,o,l,p){return Si(s,function(v,D,R){o(p,v,l(v),R)}),p}function Ym(s,o){return s&&Tn(o,cr(o),s)}function O7(s,o){return s&&Tn(o,kr(o),s)}function Jn(s,o,l){o=="__proto__"&&nl?nl(s,o,{configurable:!0,enumerable:!0,value:l,writable:!0}):s[o]=l}function Hf(s,o){for(var l=-1,p=o.length,v=G(p),D=s==null;++l<p;)v[l]=D?t:Id(s,o[l]);return v}function hs(s,o,l){return s===s&&(l!==t&&(s=s<=l?s:l),o!==t&&(s=s>=o?s:o)),s}function cn(s,o,l,p,v,D){var R,M=o&w,z=o&y,te=o&x;if(l&&(R=v?l(s,p,v,D):l(s)),R!==t)return R;if(!Rt(s))return s;var re=Le(s);if(re){if(R=m$(s),!M)return Fr(s,R)}else{var oe=vr(s),fe=oe==le||oe==pe;if(Ai(s))return wv(s,M);if(oe==ke||oe==de||fe&&!v){if(R=z||fe?{}:jv(s),!M)return z?s$(s,O7(R,s)):i$(s,Ym(R,s))}else{if(!gt[oe])return v?s:{};R=v$(s,oe,M)}}D||(D=new yn);var ve=D.get(s);if(ve)return ve;D.set(s,R),dy(s)?s.forEach(function(De){R.add(cn(De,o,l,De,s,D))}):hy(s)&&s.forEach(function(De,Qe){R.set(Qe,cn(De,o,l,Qe,s,D))});var Ie=te?z?ud:ld:z?kr:cr,We=re?t:Ie(s);return sn(We||s,function(De,Qe){We&&(Qe=De,De=s[Qe]),da(R,Qe,cn(De,o,l,Qe,s,D))}),R}function $7(s){var o=cr(s);return function(l){return Jm(l,s,o)}}function Jm(s,o,l){var p=l.length;if(s==null)return!p;for(s=wt(s);p--;){var v=l[p],D=o[v],R=s[v];if(R===t&&!(v in s)||!D(R))return!1}return!0}function Zm(s,o,l){if(typeof s!="function")throw new on(c);return ba(function(){s.apply(t,l)},o)}function pa(s,o,l,p){var v=-1,D=Kc,R=!0,M=s.length,z=[],te=o.length;if(!M)return z;l&&(o=At(o,Yr(l))),p?(D=Af,R=!1):o.length>=i&&(D=aa,R=!1,o=new us(o));e:for(;++v<M;){var re=s[v],oe=l==null?re:l(re);if(re=p||re!==0?re:0,R&&oe===oe){for(var fe=te;fe--;)if(o[fe]===oe)continue e;z.push(re)}else D(o,oe,p)||z.push(re)}return z}var Si=Iv(Pn),Qm=Iv(Kf,!0);function A7(s,o){var l=!0;return Si(s,function(p,v,D){return l=!!o(p,v,D),l}),l}function ul(s,o,l){for(var p=-1,v=s.length;++p<v;){var D=s[p],R=o(D);if(R!=null&&(M===t?R===R&&!Zr(R):l(R,M)))var M=R,z=D}return z}function P7(s,o,l,p){var v=s.length;for(l=qe(l),l<0&&(l=-l>v?0:v+l),p=p===t||p>v?v:qe(p),p<0&&(p+=v),p=l>p?0:gy(p);l<p;)s[l++]=o;return s}function Xm(s,o){var l=[];return Si(s,function(p,v,D){o(p,v,D)&&l.push(p)}),l}function fr(s,o,l,p,v){var D=-1,R=s.length;for(l||(l=w$),v||(v=[]);++D<R;){var M=s[D];o>0&&l(M)?o>1?fr(M,o-1,l,p,v):xi(v,M):p||(v[v.length]=M)}return v}var Wf=Dv(),ev=Dv(!0);function Pn(s,o){return s&&Wf(s,o,cr)}function Kf(s,o){return s&&ev(s,o,cr)}function hl(s,o){return Ei(o,function(l){return ei(s[l])})}function fs(s,o){o=Oi(o,s);for(var l=0,p=o.length;s!=null&&l<p;)s=s[Rn(o[l++])];return l&&l==p?s:t}function tv(s,o,l){var p=o(s);return Le(s)?p:xi(p,l(s))}function $r(s){return s==null?s===t?He:Je:cs&&cs in wt(s)?d$(s):S$(s)}function Vf(s,o){return s>o}function T7(s,o){return s!=null&&dt.call(s,o)}function R7(s,o){return s!=null&&o in wt(s)}function N7(s,o,l){return s>=mr(o,l)&&s<nr(o,l)}function Gf(s,o,l){for(var p=l?Af:Kc,v=s[0].length,D=s.length,R=D,M=G(D),z=1/0,te=[];R--;){var re=s[R];R&&o&&(re=At(re,Yr(o))),z=mr(re.length,z),M[R]=!l&&(o||v>=120&&re.length>=120)?new us(R&&re):t}re=s[0];var oe=-1,fe=M[0];e:for(;++oe<v&&te.length<z;){var ve=re[oe],Ie=o?o(ve):ve;if(ve=l||ve!==0?ve:0,!(fe?aa(fe,Ie):p(te,Ie,l))){for(R=D;--R;){var We=M[R];if(!(We?aa(We,Ie):p(s[R],Ie,l)))continue e}fe&&fe.push(Ie),te.push(ve)}}return te}function L7(s,o,l,p){return Pn(s,function(v,D,R){o(p,l(v),D,R)}),p}function ga(s,o,l){o=Oi(o,s),s=qv(s,o);var p=s==null?s:s[Rn(un(o))];return p==null?t:ar(p,s,l)}function rv(s){return kt(s)&&$r(s)==de}function M7(s){return kt(s)&&$r(s)==Se}function U7(s){return kt(s)&&$r(s)==B}function ma(s,o,l,p,v){return s===o?!0:s==null||o==null||!kt(s)&&!kt(o)?s!==s&&o!==o:j7(s,o,l,p,ma,v)}function j7(s,o,l,p,v,D){var R=Le(s),M=Le(o),z=R?be:vr(s),te=M?be:vr(o);z=z==de?ke:z,te=te==de?ke:te;var re=z==ke,oe=te==ke,fe=z==te;if(fe&&Ai(s)){if(!Ai(o))return!1;R=!0,re=!1}if(fe&&!re)return D||(D=new yn),R||uo(s)?Lv(s,o,l,p,v,D):h$(s,o,z,l,p,v,D);if(!(l&S)){var ve=re&&dt.call(s,"__wrapped__"),Ie=oe&&dt.call(o,"__wrapped__");if(ve||Ie){var We=ve?s.value():s,De=Ie?o.value():o;return D||(D=new yn),v(We,De,l,p,D)}}return fe?(D||(D=new yn),f$(s,o,l,p,v,D)):!1}function F7(s){return kt(s)&&vr(s)==Ce}function Yf(s,o,l,p){var v=l.length,D=v,R=!p;if(s==null)return!D;for(s=wt(s);v--;){var M=l[v];if(R&&M[2]?M[1]!==s[M[0]]:!(M[0]in s))return!1}for(;++v<D;){M=l[v];var z=M[0],te=s[z],re=M[1];if(R&&M[2]){if(te===t&&!(z in s))return!1}else{var oe=new yn;if(p)var fe=p(te,re,z,s,o,oe);if(!(fe===t?ma(re,te,S|P,p,oe):fe))return!1}}return!0}function nv(s){if(!Rt(s)||_$(s))return!1;var o=ei(s)?FO:pf;return o.test(ps(s))}function B7(s){return kt(s)&&$r(s)==ze}function k7(s){return kt(s)&&vr(s)==Oe}function q7(s){return kt(s)&&Ol(s.length)&&!!mt[$r(s)]}function iv(s){return typeof s=="function"?s:s==null?qr:typeof s=="object"?Le(s)?av(s[0],s[1]):ov(s):Sy(s)}function Jf(s){if(!wa(s))return WO(s);var o=[];for(var l in wt(s))dt.call(s,l)&&l!="constructor"&&o.push(l);return o}function z7(s){if(!Rt(s))return D$(s);var o=wa(s),l=[];for(var p in s)p=="constructor"&&(o||!dt.call(s,p))||l.push(p);return l}function Zf(s,o){return s<o}function sv(s,o){var l=-1,p=Br(s)?G(s.length):[];return Si(s,function(v,D,R){p[++l]=o(v,D,R)}),p}function ov(s){var o=fd(s);return o.length==1&&o[0][2]?Bv(o[0][0],o[0][1]):function(l){return l===s||Yf(l,s,o)}}function av(s,o){return pd(s)&&Fv(o)?Bv(Rn(s),o):function(l){var p=Id(l,s);return p===t&&p===o?Dd(l,s):ma(o,p,S|P)}}function fl(s,o,l,p,v){s!==o&&Wf(o,function(D,R){if(v||(v=new yn),Rt(D))H7(s,o,R,l,fl,p,v);else{var M=p?p(md(s,R),D,R+"",s,o,v):t;M===t&&(M=D),zf(s,R,M)}},kr)}function H7(s,o,l,p,v,D,R){var M=md(s,l),z=md(o,l),te=R.get(z);if(te){zf(s,l,te);return}var re=D?D(M,z,l+"",s,o,R):t,oe=re===t;if(oe){var fe=Le(z),ve=!fe&&Ai(z),Ie=!fe&&!ve&&uo(z);re=z,fe||ve||Ie?Le(M)?re=M:Kt(M)?re=Fr(M):ve?(oe=!1,re=wv(z,!0)):Ie?(oe=!1,re=bv(z,!0)):re=[]:_a(z)||gs(z)?(re=M,gs(M)?re=my(M):(!Rt(M)||ei(M))&&(re=jv(z))):oe=!1}oe&&(R.set(z,re),v(re,z,p,D,R),R.delete(z)),zf(s,l,re)}function cv(s,o){var l=s.length;if(l)return o+=o<0?l:0,Xn(o,l)?s[o]:t}function lv(s,o,l){o.length?o=At(o,function(D){return Le(D)?function(R){return fs(R,D.length===1?D[0]:D)}:D}):o=[qr];var p=-1;o=At(o,Yr(_e()));var v=sv(s,function(D,R,M){var z=At(o,function(te){return te(D)});return{criteria:z,index:++p,value:D}});return vO(v,function(D,R){return n$(D,R,l)})}function W7(s,o){return uv(s,o,function(l,p){return Dd(s,p)})}function uv(s,o,l){for(var p=-1,v=o.length,D={};++p<v;){var R=o[p],M=fs(s,R);l(M,R)&&va(D,Oi(R,s),M)}return D}function K7(s){return function(o){return fs(o,s)}}function Qf(s,o,l,p){var v=p?mO:Xs,D=-1,R=o.length,M=s;for(s===o&&(o=Fr(o)),l&&(M=At(s,Yr(l)));++D<R;)for(var z=0,te=o[D],re=l?l(te):te;(z=v(M,re,z,p))>-1;)M!==s&&rl.call(M,z,1),rl.call(s,z,1);return s}function hv(s,o){for(var l=s?o.length:0,p=l-1;l--;){var v=o[l];if(l==p||v!==D){var D=v;Xn(v)?rl.call(s,v,1):rd(s,v)}}return s}function Xf(s,o){return s+sl(Wm()*(o-s+1))}function V7(s,o,l,p){for(var v=-1,D=nr(il((o-s)/(l||1)),0),R=G(D);D--;)R[p?D:++v]=s,s+=l;return R}function ed(s,o){var l="";if(!s||o<1||o>Y)return l;do o%2&&(l+=s),o=sl(o/2),o&&(s+=s);while(o);return l}function Ge(s,o){return vd(kv(s,o,qr),s+"")}function G7(s){return Gm(ho(s))}function Y7(s,o){var l=ho(s);return El(l,hs(o,0,l.length))}function va(s,o,l,p){if(!Rt(s))return s;o=Oi(o,s);for(var v=-1,D=o.length,R=D-1,M=s;M!=null&&++v<D;){var z=Rn(o[v]),te=l;if(z==="__proto__"||z==="constructor"||z==="prototype")return s;if(v!=R){var re=M[z];te=p?p(re,z,M):t,te===t&&(te=Rt(re)?re:Xn(o[v+1])?[]:{})}da(M,z,te),M=M[z]}return s}var fv=ol?function(s,o){return ol.set(s,o),s}:qr,J7=nl?function(s,o){return nl(s,"toString",{configurable:!0,enumerable:!1,value:Cd(o),writable:!0})}:qr;function Z7(s){return El(ho(s))}function ln(s,o,l){var p=-1,v=s.length;o<0&&(o=-o>v?0:v+o),l=l>v?v:l,l<0&&(l+=v),v=o>l?0:l-o>>>0,o>>>=0;for(var D=G(v);++p<v;)D[p]=s[p+o];return D}function Q7(s,o){var l;return Si(s,function(p,v,D){return l=o(p,v,D),!l}),!!l}function dl(s,o,l){var p=0,v=s==null?p:s.length;if(typeof o=="number"&&o===o&&v<=ae){for(;p<v;){var D=p+v>>>1,R=s[D];R!==null&&!Zr(R)&&(l?R<=o:R<o)?p=D+1:v=D}return v}return td(s,o,qr,l)}function td(s,o,l,p){var v=0,D=s==null?0:s.length;if(D===0)return 0;o=l(o);for(var R=o!==o,M=o===null,z=Zr(o),te=o===t;v<D;){var re=sl((v+D)/2),oe=l(s[re]),fe=oe!==t,ve=oe===null,Ie=oe===oe,We=Zr(oe);if(R)var De=p||Ie;else te?De=Ie&&(p||fe):M?De=Ie&&fe&&(p||!ve):z?De=Ie&&fe&&!ve&&(p||!We):ve||We?De=!1:De=p?oe<=o:oe<o;De?v=re+1:D=re}return mr(D,Ee)}function dv(s,o){for(var l=-1,p=s.length,v=0,D=[];++l<p;){var R=s[l],M=o?o(R):R;if(!l||!wn(M,z)){var z=M;D[v++]=R===0?0:R}}return D}function pv(s){return typeof s=="number"?s:Zr(s)?Q:+s}function Jr(s){if(typeof s=="string")return s;if(Le(s))return At(s,Jr)+"";if(Zr(s))return Km?Km.call(s):"";var o=s+"";return o=="0"&&1/s==-ee?"-0":o}function Ci(s,o,l){var p=-1,v=Kc,D=s.length,R=!0,M=[],z=M;if(l)R=!1,v=Af;else if(D>=i){var te=o?null:l$(s);if(te)return Gc(te);R=!1,v=aa,z=new us}else z=o?[]:M;e:for(;++p<D;){var re=s[p],oe=o?o(re):re;if(re=l||re!==0?re:0,R&&oe===oe){for(var fe=z.length;fe--;)if(z[fe]===oe)continue e;o&&z.push(oe),M.push(re)}else v(z,oe,l)||(z!==M&&z.push(oe),M.push(re))}return M}function rd(s,o){return o=Oi(o,s),s=qv(s,o),s==null||delete s[Rn(un(o))]}function gv(s,o,l,p){return va(s,o,l(fs(s,o)),p)}function pl(s,o,l,p){for(var v=s.length,D=p?v:-1;(p?D--:++D<v)&&o(s[D],D,s););return l?ln(s,p?0:D,p?D+1:v):ln(s,p?D+1:0,p?v:D)}function mv(s,o){var l=s;return l instanceof tt&&(l=l.value()),Pf(o,function(p,v){return v.func.apply(v.thisArg,xi([p],v.args))},l)}function nd(s,o,l){var p=s.length;if(p<2)return p?Ci(s[0]):[];for(var v=-1,D=G(p);++v<p;)for(var R=s[v],M=-1;++M<p;)M!=v&&(D[v]=pa(D[v]||R,s[M],o,l));return Ci(fr(D,1),o,l)}function vv(s,o,l){for(var p=-1,v=s.length,D=o.length,R={};++p<v;){var M=p<D?o[p]:t;l(R,s[p],M)}return R}function id(s){return Kt(s)?s:[]}function sd(s){return typeof s=="function"?s:qr}function Oi(s,o){return Le(s)?s:pd(s,o)?[s]:Kv(ft(s))}var X7=Ge;function $i(s,o,l){var p=s.length;return l=l===t?p:l,!o&&l>=p?s:ln(s,o,l)}var yv=BO||function(s){return it.clearTimeout(s)};function wv(s,o){if(o)return s.slice();var l=s.length,p=Bm?Bm(l):new s.constructor(l);return s.copy(p),p}function od(s){var o=new s.constructor(s.byteLength);return new el(o).set(new el(s)),o}function e$(s,o){var l=o?od(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.byteLength)}function t$(s){var o=new s.constructor(s.source,rn.exec(s));return o.lastIndex=s.lastIndex,o}function r$(s){return fa?wt(fa.call(s)):{}}function bv(s,o){var l=o?od(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.length)}function _v(s,o){if(s!==o){var l=s!==t,p=s===null,v=s===s,D=Zr(s),R=o!==t,M=o===null,z=o===o,te=Zr(o);if(!M&&!te&&!D&&s>o||D&&R&&z&&!M&&!te||p&&R&&z||!l&&z||!v)return 1;if(!p&&!D&&!te&&s<o||te&&l&&v&&!p&&!D||M&&l&&v||!R&&v||!z)return-1}return 0}function n$(s,o,l){for(var p=-1,v=s.criteria,D=o.criteria,R=v.length,M=l.length;++p<R;){var z=_v(v[p],D[p]);if(z){if(p>=M)return z;var te=l[p];return z*(te=="desc"?-1:1)}}return s.index-o.index}function Ev(s,o,l,p){for(var v=-1,D=s.length,R=l.length,M=-1,z=o.length,te=nr(D-R,0),re=G(z+te),oe=!p;++M<z;)re[M]=o[M];for(;++v<R;)(oe||v<D)&&(re[l[v]]=s[v]);for(;te--;)re[M++]=s[v++];return re}function xv(s,o,l,p){for(var v=-1,D=s.length,R=-1,M=l.length,z=-1,te=o.length,re=nr(D-M,0),oe=G(re+te),fe=!p;++v<re;)oe[v]=s[v];for(var ve=v;++z<te;)oe[ve+z]=o[z];for(;++R<M;)(fe||v<D)&&(oe[ve+l[R]]=s[v++]);return oe}function Fr(s,o){var l=-1,p=s.length;for(o||(o=G(p));++l<p;)o[l]=s[l];return o}function Tn(s,o,l,p){var v=!l;l||(l={});for(var D=-1,R=o.length;++D<R;){var M=o[D],z=p?p(l[M],s[M],M,l,s):t;z===t&&(z=s[M]),v?Jn(l,M,z):da(l,M,z)}return l}function i$(s,o){return Tn(s,dd(s),o)}function s$(s,o){return Tn(s,Mv(s),o)}function gl(s,o){return function(l,p){var v=Le(l)?uO:C7,D=o?o():{};return v(l,s,_e(p,2),D)}}function ao(s){return Ge(function(o,l){var p=-1,v=l.length,D=v>1?l[v-1]:t,R=v>2?l[2]:t;for(D=s.length>3&&typeof D=="function"?(v--,D):t,R&&Ar(l[0],l[1],R)&&(D=v<3?t:D,v=1),o=wt(o);++p<v;){var M=l[p];M&&s(o,M,p,D)}return o})}function Iv(s,o){return function(l,p){if(l==null)return l;if(!Br(l))return s(l,p);for(var v=l.length,D=o?v:-1,R=wt(l);(o?D--:++D<v)&&p(R[D],D,R)!==!1;);return l}}function Dv(s){return function(o,l,p){for(var v=-1,D=wt(o),R=p(o),M=R.length;M--;){var z=R[s?M:++v];if(l(D[z],z,D)===!1)break}return o}}function o$(s,o,l){var p=o&U,v=ya(s);function D(){var R=this&&this!==it&&this instanceof D?v:s;return R.apply(p?l:this,arguments)}return D}function Sv(s){return function(o){o=ft(o);var l=eo(o)?vn(o):t,p=l?l[0]:o.charAt(0),v=l?$i(l,1).join(""):o.slice(1);return p[s]()+v}}function co(s){return function(o){return Pf(Iy(xy(o).replace(sa,"")),s,"")}}function ya(s){return function(){var o=arguments;switch(o.length){case 0:return new s;case 1:return new s(o[0]);case 2:return new s(o[0],o[1]);case 3:return new s(o[0],o[1],o[2]);case 4:return new s(o[0],o[1],o[2],o[3]);case 5:return new s(o[0],o[1],o[2],o[3],o[4]);case 6:return new s(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new s(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var l=oo(s.prototype),p=s.apply(l,o);return Rt(p)?p:l}}function a$(s,o,l){var p=ya(s);function v(){for(var D=arguments.length,R=G(D),M=D,z=lo(v);M--;)R[M]=arguments[M];var te=D<3&&R[0]!==z&&R[D-1]!==z?[]:Ii(R,z);if(D-=te.length,D<l)return Pv(s,o,ml,v.placeholder,t,R,te,t,t,l-D);var re=this&&this!==it&&this instanceof v?p:s;return ar(re,this,R)}return v}function Cv(s){return function(o,l,p){var v=wt(o);if(!Br(o)){var D=_e(l,3);o=cr(o),l=function(M){return D(v[M],M,v)}}var R=s(o,l,p);return R>-1?v[D?o[R]:R]:t}}function Ov(s){return Qn(function(o){var l=o.length,p=l,v=an.prototype.thru;for(s&&o.reverse();p--;){var D=o[p];if(typeof D!="function")throw new on(c);if(v&&!R&&bl(D)=="wrapper")var R=new an([],!0)}for(p=R?p:l;++p<l;){D=o[p];var M=bl(D),z=M=="wrapper"?hd(D):t;z&&gd(z[0])&&z[1]==(d|T|$|b)&&!z[4].length&&z[9]==1?R=R[bl(z[0])].apply(R,z[3]):R=D.length==1&&gd(D)?R[M]():R.thru(D)}return function(){var te=arguments,re=te[0];if(R&&te.length==1&&Le(re))return R.plant(re).value();for(var oe=0,fe=l?o[oe].apply(this,te):re;++oe<l;)fe=o[oe].call(this,fe);return fe}})}function ml(s,o,l,p,v,D,R,M,z,te){var re=o&d,oe=o&U,fe=o&j,ve=o&(T|C),Ie=o&H,We=fe?t:ya(s);function De(){for(var Qe=arguments.length,st=G(Qe),Qr=Qe;Qr--;)st[Qr]=arguments[Qr];if(ve)var Pr=lo(De),Xr=wO(st,Pr);if(p&&(st=Ev(st,p,v,ve)),D&&(st=xv(st,D,R,ve)),Qe-=Xr,ve&&Qe<te){var Vt=Ii(st,Pr);return Pv(s,o,ml,De.placeholder,l,st,Vt,M,z,te-Qe)}var bn=oe?l:this,ri=fe?bn[s]:s;return Qe=st.length,M?st=C$(st,M):Ie&&Qe>1&&st.reverse(),re&&z<Qe&&(st.length=z),this&&this!==it&&this instanceof De&&(ri=We||ya(ri)),ri.apply(bn,st)}return De}function $v(s,o){return function(l,p){return L7(l,s,o(p),{})}}function vl(s,o){return function(l,p){var v;if(l===t&&p===t)return o;if(l!==t&&(v=l),p!==t){if(v===t)return p;typeof l=="string"||typeof p=="string"?(l=Jr(l),p=Jr(p)):(l=pv(l),p=pv(p)),v=s(l,p)}return v}}function ad(s){return Qn(function(o){return o=At(o,Yr(_e())),Ge(function(l){var p=this;return s(o,function(v){return ar(v,p,l)})})})}function yl(s,o){o=o===t?" ":Jr(o);var l=o.length;if(l<2)return l?ed(o,s):o;var p=ed(o,il(s/to(o)));return eo(o)?$i(vn(p),0,s).join(""):p.slice(0,s)}function c$(s,o,l,p){var v=o&U,D=ya(s);function R(){for(var M=-1,z=arguments.length,te=-1,re=p.length,oe=G(re+z),fe=this&&this!==it&&this instanceof R?D:s;++te<re;)oe[te]=p[te];for(;z--;)oe[te++]=arguments[++M];return ar(fe,v?l:this,oe)}return R}function Av(s){return function(o,l,p){return p&&typeof p!="number"&&Ar(o,l,p)&&(l=p=t),o=ti(o),l===t?(l=o,o=0):l=ti(l),p=p===t?o<l?1:-1:ti(p),V7(o,l,p,s)}}function wl(s){return function(o,l){return typeof o=="string"&&typeof l=="string"||(o=hn(o),l=hn(l)),s(o,l)}}function Pv(s,o,l,p,v,D,R,M,z,te){var re=o&T,oe=re?R:t,fe=re?t:R,ve=re?D:t,Ie=re?t:D;o|=re?$:E,o&=~(re?E:$),o&A||(o&=~(U|j));var We=[s,o,v,ve,oe,Ie,fe,M,z,te],De=l.apply(t,We);return gd(s)&&zv(De,We),De.placeholder=p,Hv(De,s,o)}function cd(s){var o=rr[s];return function(l,p){if(l=hn(l),p=p==null?0:mr(qe(p),292),p&&Hm(l)){var v=(ft(l)+"e").split("e"),D=o(v[0]+"e"+(+v[1]+p));return v=(ft(D)+"e").split("e"),+(v[0]+"e"+(+v[1]-p))}return o(l)}}var l$=io&&1/Gc(new io([,-0]))[1]==ee?function(s){return new io(s)}:Ad;function Tv(s){return function(o){var l=vr(o);return l==Ce?jf(o):l==Oe?SO(o):yO(o,s(o))}}function Zn(s,o,l,p,v,D,R,M){var z=o&j;if(!z&&typeof s!="function")throw new on(c);var te=p?p.length:0;if(te||(o&=~($|E),p=v=t),R=R===t?R:nr(qe(R),0),M=M===t?M:qe(M),te-=v?v.length:0,o&E){var re=p,oe=v;p=v=t}var fe=z?t:hd(s),ve=[s,o,l,p,v,re,oe,D,R,M];if(fe&&I$(ve,fe),s=ve[0],o=ve[1],l=ve[2],p=ve[3],v=ve[4],M=ve[9]=ve[9]===t?z?0:s.length:nr(ve[9]-te,0),!M&&o&(T|C)&&(o&=~(T|C)),!o||o==U)var Ie=o$(s,o,l);else o==T||o==C?Ie=a$(s,o,M):(o==$||o==(U|$))&&!v.length?Ie=c$(s,o,l,p):Ie=ml.apply(t,ve);var We=fe?fv:zv;return Hv(We(Ie,ve),s,o)}function Rv(s,o,l,p){return s===t||wn(s,no[l])&&!dt.call(p,l)?o:s}function Nv(s,o,l,p,v,D){return Rt(s)&&Rt(o)&&(D.set(o,s),fl(s,o,t,Nv,D),D.delete(o)),s}function u$(s){return _a(s)?t:s}function Lv(s,o,l,p,v,D){var R=l&S,M=s.length,z=o.length;if(M!=z&&!(R&&z>M))return!1;var te=D.get(s),re=D.get(o);if(te&&re)return te==o&&re==s;var oe=-1,fe=!0,ve=l&P?new us:t;for(D.set(s,o),D.set(o,s);++oe<M;){var Ie=s[oe],We=o[oe];if(p)var De=R?p(We,Ie,oe,o,s,D):p(Ie,We,oe,s,o,D);if(De!==t){if(De)continue;fe=!1;break}if(ve){if(!Tf(o,function(Qe,st){if(!aa(ve,st)&&(Ie===Qe||v(Ie,Qe,l,p,D)))return ve.push(st)})){fe=!1;break}}else if(!(Ie===We||v(Ie,We,l,p,D))){fe=!1;break}}return D.delete(s),D.delete(o),fe}function h$(s,o,l,p,v,D,R){switch(l){case Te:if(s.byteLength!=o.byteLength||s.byteOffset!=o.byteOffset)return!1;s=s.buffer,o=o.buffer;case Se:return!(s.byteLength!=o.byteLength||!D(new el(s),new el(o)));case W:case B:case Ke:return wn(+s,+o);case L:return s.name==o.name&&s.message==o.message;case ze:case Ue:return s==o+"";case Ce:var M=jf;case Oe:var z=p&S;if(M||(M=Gc),s.size!=o.size&&!z)return!1;var te=R.get(s);if(te)return te==o;p|=P,R.set(s,o);var re=Lv(M(s),M(o),p,v,D,R);return R.delete(s),re;case je:if(fa)return fa.call(s)==fa.call(o)}return!1}function f$(s,o,l,p,v,D){var R=l&S,M=ld(s),z=M.length,te=ld(o),re=te.length;if(z!=re&&!R)return!1;for(var oe=z;oe--;){var fe=M[oe];if(!(R?fe in o:dt.call(o,fe)))return!1}var ve=D.get(s),Ie=D.get(o);if(ve&&Ie)return ve==o&&Ie==s;var We=!0;D.set(s,o),D.set(o,s);for(var De=R;++oe<z;){fe=M[oe];var Qe=s[fe],st=o[fe];if(p)var Qr=R?p(st,Qe,fe,o,s,D):p(Qe,st,fe,s,o,D);if(!(Qr===t?Qe===st||v(Qe,st,l,p,D):Qr)){We=!1;break}De||(De=fe=="constructor")}if(We&&!De){var Pr=s.constructor,Xr=o.constructor;Pr!=Xr&&"constructor"in s&&"constructor"in o&&!(typeof Pr=="function"&&Pr instanceof Pr&&typeof Xr=="function"&&Xr instanceof Xr)&&(We=!1)}return D.delete(s),D.delete(o),We}function Qn(s){return vd(kv(s,t,Jv),s+"")}function ld(s){return tv(s,cr,dd)}function ud(s){return tv(s,kr,Mv)}var hd=ol?function(s){return ol.get(s)}:Ad;function bl(s){for(var o=s.name+"",l=so[o],p=dt.call(so,o)?l.length:0;p--;){var v=l[p],D=v.func;if(D==null||D==s)return v.name}return o}function lo(s){var o=dt.call(_,"placeholder")?_:s;return o.placeholder}function _e(){var s=_.iteratee||Od;return s=s===Od?iv:s,arguments.length?s(arguments[0],arguments[1]):s}function _l(s,o){var l=s.__data__;return b$(o)?l[typeof o=="string"?"string":"hash"]:l.map}function fd(s){for(var o=cr(s),l=o.length;l--;){var p=o[l],v=s[p];o[l]=[p,v,Fv(v)]}return o}function ds(s,o){var l=xO(s,o);return nv(l)?l:t}function d$(s){var o=dt.call(s,cs),l=s[cs];try{s[cs]=t;var p=!0}catch{}var v=Qc.call(s);return p&&(o?s[cs]=l:delete s[cs]),v}var dd=Bf?function(s){return s==null?[]:(s=wt(s),Ei(Bf(s),function(o){return qm.call(s,o)}))}:Pd,Mv=Bf?function(s){for(var o=[];s;)xi(o,dd(s)),s=tl(s);return o}:Pd,vr=$r;(kf&&vr(new kf(new ArrayBuffer(1)))!=Te||la&&vr(new la)!=Ce||qf&&vr(qf.resolve())!=St||io&&vr(new io)!=Oe||ua&&vr(new ua)!=Ae)&&(vr=function(s){var o=$r(s),l=o==ke?s.constructor:t,p=l?ps(l):"";if(p)switch(p){case YO:return Te;case JO:return Ce;case ZO:return St;case QO:return Oe;case XO:return Ae}return o});function p$(s,o,l){for(var p=-1,v=l.length;++p<v;){var D=l[p],R=D.size;switch(D.type){case"drop":s+=R;break;case"dropRight":o-=R;break;case"take":o=mr(o,s+R);break;case"takeRight":s=nr(s,o-R);break}}return{start:s,end:o}}function g$(s){var o=s.match(_t);return o?o[1].split(Zt):[]}function Uv(s,o,l){o=Oi(o,s);for(var p=-1,v=o.length,D=!1;++p<v;){var R=Rn(o[p]);if(!(D=s!=null&&l(s,R)))break;s=s[R]}return D||++p!=v?D:(v=s==null?0:s.length,!!v&&Ol(v)&&Xn(R,v)&&(Le(s)||gs(s)))}function m$(s){var o=s.length,l=new s.constructor(o);return o&&typeof s[0]=="string"&&dt.call(s,"index")&&(l.index=s.index,l.input=s.input),l}function jv(s){return typeof s.constructor=="function"&&!wa(s)?oo(tl(s)):{}}function v$(s,o,l){var p=s.constructor;switch(o){case Se:return od(s);case W:case B:return new p(+s);case Te:return e$(s,l);case Ve:case $e:case Ze:case et:case at:case ct:case nt:case Sr:case Ur:return bv(s,l);case Ce:return new p;case Ke:case Ue:return new p(s);case ze:return t$(s);case Oe:return new p;case je:return r$(s)}}function y$(s,o){var l=o.length;if(!l)return s;var p=l-1;return o[p]=(l>1?"& ":"")+o[p],o=o.join(l>2?", ":" "),s.replace(Bt,`{
66
+ */(function(r,e){(function(){var t,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",w=1,y=2,_=4,S=1,P=2,j=1,U=2,A=4,T=8,O=16,$=32,x=64,d=128,b=256,H=512,F=30,V="...",se=800,ce=16,I=1,N=2,X=3,ee=1/0,Y=9007199254740991,Z=17976931348623157e292,Q=0/0,ie=4294967295,Ee=ie-1,ae=ie>>>1,xe=[["ary",d],["bind",j],["bindKey",U],["curry",T],["curryRight",O],["flip",H],["partial",$],["partialRight",x],["rearg",b]],de="[object Arguments]",be="[object Array]",K="[object AsyncFunction]",W="[object Boolean]",B="[object Date]",g="[object DOMException]",L="[object Error]",le="[object Function]",pe="[object GeneratorFunction]",Oe="[object Map]",Ke="[object Number]",Ze="[object Null]",ke="[object Object]",Ot="[object Promise]",Ct="[object Proxy]",ze="[object RegExp]",Ce="[object Set]",Ue="[object String]",je="[object Symbol]",He="[object Undefined]",Ae="[object WeakMap]",Fe="[object WeakSet]",Se="[object ArrayBuffer]",Te="[object DataView]",Ve="[object Float32Array]",$e="[object Float64Array]",Je="[object Int8Array]",et="[object Int16Array]",at="[object Int32Array]",ct="[object Uint8Array]",nt="[object Uint8ClampedArray]",Dr="[object Uint16Array]",Mr="[object Uint32Array]",$n=/\b__p \+= '';/g,Sr=/\b(__p \+=) '' \+/g,Wn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bi=/&(?:amp|lt|gt|quot|#39);/g,ns=/[&<>"']/g,Mt=RegExp(bi.source),$t=RegExp(ns.source),Ut=/<%-([\s\S]+?)%>/g,jt=/<%([\s\S]+?)%>/g,Rt=/<%=([\s\S]+?)%>/g,At=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/,Yt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ft=/[\\^$.*+?()[\]{}|]/g,Zt=RegExp(Ft.source),Bt=/^\s+/,Ht=/\s/,kt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Et=/\{\n\/\* \[wrapped with (.+)\] \*/,Jt=/,? & /,Qt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,uf=/[()=,{}\[\]\/\s]/,hf=/\\(\\)?/g,ff=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nn=/\w*$/,df=/^[-+]0x[0-9a-f]+$/i,pf=/^0b[01]+$/i,gf=/^\[object .+?Constructor\]$/,mf=/^0o[0-7]+$/i,vf=/^(?:0|[1-9]\d*)$/,Kn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ys=/($^)/,yf=/['\n\r\u2028\u2029\\]/g,Zs="\\ud800-\\udfff",wf="\\u0300-\\u036f",bf="\\ufe20-\\ufe2f",Js="\\u20d0-\\u20ff",Ac=wf+bf+Js,Pc="\\u2700-\\u27bf",gn="a-z\\xdf-\\xf6\\xf8-\\xff",_f="\\xac\\xb1\\xd7\\xf7",Ef="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",xf="\\u2000-\\u206f",If=" \\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",Tc="A-Z\\xc0-\\xd6\\xd8-\\xde",Rc="\\ufe0e\\ufe0f",is=_f+Ef+xf+If,aa="['\u2019]",ss="["+Zs+"]",ca="["+is+"]",os="["+Ac+"]",Nc="\\d+",Df="["+Pc+"]",Lc="["+gn+"]",Mc="[^"+Zs+is+Nc+Pc+gn+Tc+"]",Qs="\\ud83c[\\udffb-\\udfff]",Sf="(?:"+os+"|"+Qs+")",Uc="[^"+Zs+"]",Xs="(?:\\ud83c[\\udde6-\\uddff]){2}",_i="[\\ud800-\\udbff][\\udc00-\\udfff]",Gr="["+Tc+"]",jc="\\u200d",Fc="(?:"+Lc+"|"+Mc+")",An="(?:"+Gr+"|"+Mc+")",Bc="(?:"+aa+"(?:d|ll|m|re|s|t|ve))?",kc="(?:"+aa+"(?:D|LL|M|RE|S|T|VE))?",qc=Sf+"?",zc="["+Rc+"]?",Of="(?:"+jc+"(?:"+[Uc,Xs,_i].join("|")+")"+zc+qc+")*",Vn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Wc=zc+qc+Of,eo="(?:"+[Df,Xs,_i].join("|")+")"+Wc,Cf="(?:"+[Uc+os+"?",os,Xs,_i,ss].join("|")+")",la=RegExp(aa,"g"),$f=RegExp(os,"g"),to=RegExp(Qs+"(?="+Qs+")|"+Cf+Wc,"g"),Kc=RegExp([Gr+"?"+Lc+"+"+Bc+"(?="+[ca,Gr,"$"].join("|")+")",An+"+"+kc+"(?="+[ca,Gr+Fc,"$"].join("|")+")",Gr+"?"+Fc+"+"+Bc,Gr+"+"+kc,Hc,Vn,Nc,eo].join("|"),"g"),Vc=RegExp("["+jc+Zs+Ac+Rc+"]"),as=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gc=["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"],Af=-1,vt={};vt[Ve]=vt[$e]=vt[Je]=vt[et]=vt[at]=vt[ct]=vt[nt]=vt[Dr]=vt[Mr]=!0,vt[de]=vt[be]=vt[Se]=vt[W]=vt[Te]=vt[B]=vt[L]=vt[le]=vt[Oe]=vt[Ke]=vt[ke]=vt[ze]=vt[Ce]=vt[Ue]=vt[Ae]=!1;var mt={};mt[de]=mt[be]=mt[Se]=mt[Te]=mt[W]=mt[B]=mt[Ve]=mt[$e]=mt[Je]=mt[et]=mt[at]=mt[Oe]=mt[Ke]=mt[ke]=mt[ze]=mt[Ce]=mt[Ue]=mt[je]=mt[ct]=mt[nt]=mt[Dr]=mt[Mr]=!0,mt[L]=mt[le]=mt[Ae]=!1;var C={\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"},k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ne={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ge={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},yt=parseFloat,Ne=parseInt,It=typeof Bo=="object"&&Bo&&Bo.Object===Object&&Bo,Xt=typeof self=="object"&&self&&self.Object===Object&&self,it=It||Xt||Function("return this")(),wt=e&&!e.nodeType&&e,Wt=wt&&!0&&r&&!r.nodeType&&r,Ur=Wt&&Wt.exports===wt,er=Ur&&It.process,Dt=function(){try{var q=Wt&&Wt.require&&Wt.require("util").types;return q||er&&er.binding&&er.binding("util")}catch{}}(),Or=Dt&&Dt.isArrayBuffer,mn=Dt&&Dt.isDate,sn=Dt&&Dt.isMap,Pn=Dt&&Dt.isRegExp,ua=Dt&&Dt.isSet,cs=Dt&&Dt.isTypedArray;function ar(q,J,G){switch(G.length){case 0:return q.call(J);case 1:return q.call(J,G[0]);case 2:return q.call(J,G[0],G[1]);case 3:return q.call(J,G[0],G[1],G[2])}return q.apply(J,G)}function uC(q,J,G,ve){for(var Re=-1,ut=q==null?0:q.length;++Re<ut;){var rr=q[Re];J(ve,rr,G(rr),q)}return ve}function on(q,J){for(var G=-1,ve=q==null?0:q.length;++G<ve&&J(q[G],G,q)!==!1;);return q}function hC(q,J){for(var G=q==null?0:q.length;G--&&J(q[G],G,q)!==!1;);return q}function $m(q,J){for(var G=-1,ve=q==null?0:q.length;++G<ve;)if(!J(q[G],G,q))return!1;return!0}function Ei(q,J){for(var G=-1,ve=q==null?0:q.length,Re=0,ut=[];++G<ve;){var rr=q[G];J(rr,G,q)&&(ut[Re++]=rr)}return ut}function Yc(q,J){var G=q==null?0:q.length;return!!G&&ro(q,J,0)>-1}function Pf(q,J,G){for(var ve=-1,Re=q==null?0:q.length;++ve<Re;)if(G(J,q[ve]))return!0;return!1}function Pt(q,J){for(var G=-1,ve=q==null?0:q.length,Re=Array(ve);++G<ve;)Re[G]=J(q[G],G,q);return Re}function xi(q,J){for(var G=-1,ve=J.length,Re=q.length;++G<ve;)q[Re+G]=J[G];return q}function Tf(q,J,G,ve){var Re=-1,ut=q==null?0:q.length;for(ve&&ut&&(G=q[++Re]);++Re<ut;)G=J(G,q[Re],Re,q);return G}function fC(q,J,G,ve){var Re=q==null?0:q.length;for(ve&&Re&&(G=q[--Re]);Re--;)G=J(G,q[Re],Re,q);return G}function Rf(q,J){for(var G=-1,ve=q==null?0:q.length;++G<ve;)if(J(q[G],G,q))return!0;return!1}var dC=Nf("length");function pC(q){return q.split("")}function gC(q){return q.match(Qt)||[]}function Am(q,J,G){var ve;return G(q,function(Re,ut,rr){if(J(Re,ut,rr))return ve=ut,!1}),ve}function Zc(q,J,G,ve){for(var Re=q.length,ut=G+(ve?1:-1);ve?ut--:++ut<Re;)if(J(q[ut],ut,q))return ut;return-1}function ro(q,J,G){return J===J?OC(q,J,G):Zc(q,Pm,G)}function mC(q,J,G,ve){for(var Re=G-1,ut=q.length;++Re<ut;)if(ve(q[Re],J))return Re;return-1}function Pm(q){return q!==q}function Tm(q,J){var G=q==null?0:q.length;return G?Mf(q,J)/G:Q}function Nf(q){return function(J){return J==null?t:J[q]}}function Lf(q){return function(J){return q==null?t:q[J]}}function Rm(q,J,G,ve,Re){return Re(q,function(ut,rr,bt){G=ve?(ve=!1,ut):J(G,ut,rr,bt)}),G}function vC(q,J){var G=q.length;for(q.sort(J);G--;)q[G]=q[G].value;return q}function Mf(q,J){for(var G,ve=-1,Re=q.length;++ve<Re;){var ut=J(q[ve]);ut!==t&&(G=G===t?ut:G+ut)}return G}function Uf(q,J){for(var G=-1,ve=Array(q);++G<q;)ve[G]=J(G);return ve}function yC(q,J){return Pt(J,function(G){return[G,q[G]]})}function Nm(q){return q&&q.slice(0,jm(q)+1).replace(Bt,"")}function Yr(q){return function(J){return q(J)}}function jf(q,J){return Pt(J,function(G){return q[G]})}function ha(q,J){return q.has(J)}function Lm(q,J){for(var G=-1,ve=q.length;++G<ve&&ro(J,q[G],0)>-1;);return G}function Mm(q,J){for(var G=q.length;G--&&ro(J,q[G],0)>-1;);return G}function wC(q,J){for(var G=q.length,ve=0;G--;)q[G]===J&&++ve;return ve}var bC=Lf(C),_C=Lf(k);function EC(q){return"\\"+ge[q]}function xC(q,J){return q==null?t:q[J]}function no(q){return Vc.test(q)}function IC(q){return as.test(q)}function DC(q){for(var J,G=[];!(J=q.next()).done;)G.push(J.value);return G}function Ff(q){var J=-1,G=Array(q.size);return q.forEach(function(ve,Re){G[++J]=[Re,ve]}),G}function Um(q,J){return function(G){return q(J(G))}}function Ii(q,J){for(var G=-1,ve=q.length,Re=0,ut=[];++G<ve;){var rr=q[G];(rr===J||rr===m)&&(q[G]=m,ut[Re++]=G)}return ut}function Jc(q){var J=-1,G=Array(q.size);return q.forEach(function(ve){G[++J]=ve}),G}function SC(q){var J=-1,G=Array(q.size);return q.forEach(function(ve){G[++J]=[ve,ve]}),G}function OC(q,J,G){for(var ve=G-1,Re=q.length;++ve<Re;)if(q[ve]===J)return ve;return-1}function CC(q,J,G){for(var ve=G+1;ve--;)if(q[ve]===J)return ve;return ve}function io(q){return no(q)?AC(q):dC(q)}function vn(q){return no(q)?PC(q):pC(q)}function jm(q){for(var J=q.length;J--&&Ht.test(q.charAt(J)););return J}var $C=Lf(ne);function AC(q){for(var J=to.lastIndex=0;to.test(q);)++J;return J}function PC(q){return q.match(to)||[]}function TC(q){return q.match(Kc)||[]}var RC=function q(J){J=J==null?it:so.defaults(it.Object(),J,so.pick(it,Gc));var G=J.Array,ve=J.Date,Re=J.Error,ut=J.Function,rr=J.Math,bt=J.Object,Bf=J.RegExp,NC=J.String,an=J.TypeError,Qc=G.prototype,LC=ut.prototype,oo=bt.prototype,Xc=J["__core-js_shared__"],el=LC.toString,dt=oo.hasOwnProperty,MC=0,Fm=function(){var s=/[^.]+$/.exec(Xc&&Xc.keys&&Xc.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),tl=oo.toString,UC=el.call(bt),jC=it._,FC=Bf("^"+el.call(dt).replace(Ft,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rl=Ur?J.Buffer:t,Di=J.Symbol,nl=J.Uint8Array,Bm=rl?rl.allocUnsafe:t,il=Um(bt.getPrototypeOf,bt),km=bt.create,qm=oo.propertyIsEnumerable,sl=Qc.splice,zm=Di?Di.isConcatSpreadable:t,fa=Di?Di.iterator:t,ls=Di?Di.toStringTag:t,ol=function(){try{var s=ps(bt,"defineProperty");return s({},"",{}),s}catch{}}(),BC=J.clearTimeout!==it.clearTimeout&&J.clearTimeout,kC=ve&&ve.now!==it.Date.now&&ve.now,qC=J.setTimeout!==it.setTimeout&&J.setTimeout,al=rr.ceil,cl=rr.floor,kf=bt.getOwnPropertySymbols,zC=rl?rl.isBuffer:t,Hm=J.isFinite,HC=Qc.join,WC=Um(bt.keys,bt),nr=rr.max,gr=rr.min,KC=ve.now,VC=J.parseInt,Wm=rr.random,GC=Qc.reverse,qf=ps(J,"DataView"),da=ps(J,"Map"),zf=ps(J,"Promise"),ao=ps(J,"Set"),pa=ps(J,"WeakMap"),ga=ps(bt,"create"),ll=pa&&new pa,co={},YC=gs(qf),ZC=gs(da),JC=gs(zf),QC=gs(ao),XC=gs(pa),ul=Di?Di.prototype:t,ma=ul?ul.valueOf:t,Km=ul?ul.toString:t;function E(s){if(qt(s)&&!Le(s)&&!(s instanceof tt)){if(s instanceof cn)return s;if(dt.call(s,"__wrapped__"))return Vv(s)}return new cn(s)}var lo=function(){function s(){}return function(o){if(!Nt(o))return{};if(km)return km(o);s.prototype=o;var l=new s;return s.prototype=t,l}}();function hl(){}function cn(s,o){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=t}E.templateSettings={escape:Ut,evaluate:jt,interpolate:Rt,variable:"",imports:{_:E}},E.prototype=hl.prototype,E.prototype.constructor=E,cn.prototype=lo(hl.prototype),cn.prototype.constructor=cn;function tt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function e7(){var s=new tt(this.__wrapped__);return s.__actions__=jr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=jr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=jr(this.__views__),s}function t7(){if(this.__filtered__){var s=new tt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function r7(){var s=this.__wrapped__.value(),o=this.__dir__,l=Le(s),p=o<0,v=l?s.length:0,D=p$(0,v,this.__views__),R=D.start,M=D.end,z=M-R,te=p?M:R-1,re=this.__iteratees__,oe=re.length,fe=0,ye=gr(z,this.__takeCount__);if(!l||!p&&v==z&&ye==z)return mv(s,this.__actions__);var Ie=[];e:for(;z--&&fe<ye;){te+=o;for(var We=-1,De=s[te];++We<oe;){var Qe=re[We],st=Qe.iteratee,Qr=Qe.type,Ar=st(De);if(Qr==N)De=Ar;else if(!Ar){if(Qr==I)continue e;break e}}Ie[fe++]=De}return Ie}tt.prototype=lo(hl.prototype),tt.prototype.constructor=tt;function us(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function n7(){this.__data__=ga?ga(null):{},this.size=0}function i7(s){var o=this.has(s)&&delete this.__data__[s];return this.size-=o?1:0,o}function s7(s){var o=this.__data__;if(ga){var l=o[s];return l===f?t:l}return dt.call(o,s)?o[s]:t}function o7(s){var o=this.__data__;return ga?o[s]!==t:dt.call(o,s)}function a7(s,o){var l=this.__data__;return this.size+=this.has(s)?0:1,l[s]=ga&&o===t?f:o,this}us.prototype.clear=n7,us.prototype.delete=i7,us.prototype.get=s7,us.prototype.has=o7,us.prototype.set=a7;function Gn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function c7(){this.__data__=[],this.size=0}function l7(s){var o=this.__data__,l=fl(o,s);if(l<0)return!1;var p=o.length-1;return l==p?o.pop():sl.call(o,l,1),--this.size,!0}function u7(s){var o=this.__data__,l=fl(o,s);return l<0?t:o[l][1]}function h7(s){return fl(this.__data__,s)>-1}function f7(s,o){var l=this.__data__,p=fl(l,s);return p<0?(++this.size,l.push([s,o])):l[p][1]=o,this}Gn.prototype.clear=c7,Gn.prototype.delete=l7,Gn.prototype.get=u7,Gn.prototype.has=h7,Gn.prototype.set=f7;function Yn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function d7(){this.size=0,this.__data__={hash:new us,map:new(da||Gn),string:new us}}function p7(s){var o=Il(this,s).delete(s);return this.size-=o?1:0,o}function g7(s){return Il(this,s).get(s)}function m7(s){return Il(this,s).has(s)}function v7(s,o){var l=Il(this,s),p=l.size;return l.set(s,o),this.size+=l.size==p?0:1,this}Yn.prototype.clear=d7,Yn.prototype.delete=p7,Yn.prototype.get=g7,Yn.prototype.has=m7,Yn.prototype.set=v7;function hs(s){var o=-1,l=s==null?0:s.length;for(this.__data__=new Yn;++o<l;)this.add(s[o])}function y7(s){return this.__data__.set(s,f),this}function w7(s){return this.__data__.has(s)}hs.prototype.add=hs.prototype.push=y7,hs.prototype.has=w7;function yn(s){var o=this.__data__=new Gn(s);this.size=o.size}function b7(){this.__data__=new Gn,this.size=0}function _7(s){var o=this.__data__,l=o.delete(s);return this.size=o.size,l}function E7(s){return this.__data__.get(s)}function x7(s){return this.__data__.has(s)}function I7(s,o){var l=this.__data__;if(l instanceof Gn){var p=l.__data__;if(!da||p.length<i-1)return p.push([s,o]),this.size=++l.size,this;l=this.__data__=new Yn(p)}return l.set(s,o),this.size=l.size,this}yn.prototype.clear=b7,yn.prototype.delete=_7,yn.prototype.get=E7,yn.prototype.has=x7,yn.prototype.set=I7;function Vm(s,o){var l=Le(s),p=!l&&ms(s),v=!l&&!p&&Ai(s),D=!l&&!p&&!v&&po(s),R=l||p||v||D,M=R?Uf(s.length,NC):[],z=M.length;for(var te in s)(o||dt.call(s,te))&&!(R&&(te=="length"||v&&(te=="offset"||te=="parent")||D&&(te=="buffer"||te=="byteLength"||te=="byteOffset")||Xn(te,z)))&&M.push(te);return M}function Gm(s){var o=s.length;return o?s[ed(0,o-1)]:t}function D7(s,o){return Dl(jr(s),fs(o,0,s.length))}function S7(s){return Dl(jr(s))}function Hf(s,o,l){(l!==t&&!wn(s[o],l)||l===t&&!(o in s))&&Zn(s,o,l)}function va(s,o,l){var p=s[o];(!(dt.call(s,o)&&wn(p,l))||l===t&&!(o in s))&&Zn(s,o,l)}function fl(s,o){for(var l=s.length;l--;)if(wn(s[l][0],o))return l;return-1}function O7(s,o,l,p){return Si(s,function(v,D,R){o(p,v,l(v),R)}),p}function Ym(s,o){return s&&Rn(o,cr(o),s)}function C7(s,o){return s&&Rn(o,Br(o),s)}function Zn(s,o,l){o=="__proto__"&&ol?ol(s,o,{configurable:!0,enumerable:!0,value:l,writable:!0}):s[o]=l}function Wf(s,o){for(var l=-1,p=o.length,v=G(p),D=s==null;++l<p;)v[l]=D?t:Dd(s,o[l]);return v}function fs(s,o,l){return s===s&&(l!==t&&(s=s<=l?s:l),o!==t&&(s=s>=o?s:o)),s}function ln(s,o,l,p,v,D){var R,M=o&w,z=o&y,te=o&_;if(l&&(R=v?l(s,p,v,D):l(s)),R!==t)return R;if(!Nt(s))return s;var re=Le(s);if(re){if(R=m$(s),!M)return jr(s,R)}else{var oe=mr(s),fe=oe==le||oe==pe;if(Ai(s))return wv(s,M);if(oe==ke||oe==de||fe&&!v){if(R=z||fe?{}:jv(s),!M)return z?s$(s,C7(R,s)):i$(s,Ym(R,s))}else{if(!mt[oe])return v?s:{};R=v$(s,oe,M)}}D||(D=new yn);var ye=D.get(s);if(ye)return ye;D.set(s,R),dy(s)?s.forEach(function(De){R.add(ln(De,o,l,De,s,D))}):hy(s)&&s.forEach(function(De,Qe){R.set(Qe,ln(De,o,l,Qe,s,D))});var Ie=te?z?hd:ud:z?Br:cr,We=re?t:Ie(s);return on(We||s,function(De,Qe){We&&(Qe=De,De=s[Qe]),va(R,Qe,ln(De,o,l,Qe,s,D))}),R}function $7(s){var o=cr(s);return function(l){return Zm(l,s,o)}}function Zm(s,o,l){var p=l.length;if(s==null)return!p;for(s=bt(s);p--;){var v=l[p],D=o[v],R=s[v];if(R===t&&!(v in s)||!D(R))return!1}return!0}function Jm(s,o,l){if(typeof s!="function")throw new an(c);return Ia(function(){s.apply(t,l)},o)}function ya(s,o,l,p){var v=-1,D=Yc,R=!0,M=s.length,z=[],te=o.length;if(!M)return z;l&&(o=Pt(o,Yr(l))),p?(D=Pf,R=!1):o.length>=i&&(D=ha,R=!1,o=new hs(o));e:for(;++v<M;){var re=s[v],oe=l==null?re:l(re);if(re=p||re!==0?re:0,R&&oe===oe){for(var fe=te;fe--;)if(o[fe]===oe)continue e;z.push(re)}else D(o,oe,p)||z.push(re)}return z}var Si=Iv(Tn),Qm=Iv(Vf,!0);function A7(s,o){var l=!0;return Si(s,function(p,v,D){return l=!!o(p,v,D),l}),l}function dl(s,o,l){for(var p=-1,v=s.length;++p<v;){var D=s[p],R=o(D);if(R!=null&&(M===t?R===R&&!Jr(R):l(R,M)))var M=R,z=D}return z}function P7(s,o,l,p){var v=s.length;for(l=qe(l),l<0&&(l=-l>v?0:v+l),p=p===t||p>v?v:qe(p),p<0&&(p+=v),p=l>p?0:gy(p);l<p;)s[l++]=o;return s}function Xm(s,o){var l=[];return Si(s,function(p,v,D){o(p,v,D)&&l.push(p)}),l}function fr(s,o,l,p,v){var D=-1,R=s.length;for(l||(l=w$),v||(v=[]);++D<R;){var M=s[D];o>0&&l(M)?o>1?fr(M,o-1,l,p,v):xi(v,M):p||(v[v.length]=M)}return v}var Kf=Dv(),ev=Dv(!0);function Tn(s,o){return s&&Kf(s,o,cr)}function Vf(s,o){return s&&ev(s,o,cr)}function pl(s,o){return Ei(o,function(l){return ei(s[l])})}function ds(s,o){o=Ci(o,s);for(var l=0,p=o.length;s!=null&&l<p;)s=s[Nn(o[l++])];return l&&l==p?s:t}function tv(s,o,l){var p=o(s);return Le(s)?p:xi(p,l(s))}function Cr(s){return s==null?s===t?He:Ze:ls&&ls in bt(s)?d$(s):S$(s)}function Gf(s,o){return s>o}function T7(s,o){return s!=null&&dt.call(s,o)}function R7(s,o){return s!=null&&o in bt(s)}function N7(s,o,l){return s>=gr(o,l)&&s<nr(o,l)}function Yf(s,o,l){for(var p=l?Pf:Yc,v=s[0].length,D=s.length,R=D,M=G(D),z=1/0,te=[];R--;){var re=s[R];R&&o&&(re=Pt(re,Yr(o))),z=gr(re.length,z),M[R]=!l&&(o||v>=120&&re.length>=120)?new hs(R&&re):t}re=s[0];var oe=-1,fe=M[0];e:for(;++oe<v&&te.length<z;){var ye=re[oe],Ie=o?o(ye):ye;if(ye=l||ye!==0?ye:0,!(fe?ha(fe,Ie):p(te,Ie,l))){for(R=D;--R;){var We=M[R];if(!(We?ha(We,Ie):p(s[R],Ie,l)))continue e}fe&&fe.push(Ie),te.push(ye)}}return te}function L7(s,o,l,p){return Tn(s,function(v,D,R){o(p,l(v),D,R)}),p}function wa(s,o,l){o=Ci(o,s),s=qv(s,o);var p=s==null?s:s[Nn(hn(o))];return p==null?t:ar(p,s,l)}function rv(s){return qt(s)&&Cr(s)==de}function M7(s){return qt(s)&&Cr(s)==Se}function U7(s){return qt(s)&&Cr(s)==B}function ba(s,o,l,p,v){return s===o?!0:s==null||o==null||!qt(s)&&!qt(o)?s!==s&&o!==o:j7(s,o,l,p,ba,v)}function j7(s,o,l,p,v,D){var R=Le(s),M=Le(o),z=R?be:mr(s),te=M?be:mr(o);z=z==de?ke:z,te=te==de?ke:te;var re=z==ke,oe=te==ke,fe=z==te;if(fe&&Ai(s)){if(!Ai(o))return!1;R=!0,re=!1}if(fe&&!re)return D||(D=new yn),R||po(s)?Lv(s,o,l,p,v,D):h$(s,o,z,l,p,v,D);if(!(l&S)){var ye=re&&dt.call(s,"__wrapped__"),Ie=oe&&dt.call(o,"__wrapped__");if(ye||Ie){var We=ye?s.value():s,De=Ie?o.value():o;return D||(D=new yn),v(We,De,l,p,D)}}return fe?(D||(D=new yn),f$(s,o,l,p,v,D)):!1}function F7(s){return qt(s)&&mr(s)==Oe}function Zf(s,o,l,p){var v=l.length,D=v,R=!p;if(s==null)return!D;for(s=bt(s);v--;){var M=l[v];if(R&&M[2]?M[1]!==s[M[0]]:!(M[0]in s))return!1}for(;++v<D;){M=l[v];var z=M[0],te=s[z],re=M[1];if(R&&M[2]){if(te===t&&!(z in s))return!1}else{var oe=new yn;if(p)var fe=p(te,re,z,s,o,oe);if(!(fe===t?ba(re,te,S|P,p,oe):fe))return!1}}return!0}function nv(s){if(!Nt(s)||_$(s))return!1;var o=ei(s)?FC:gf;return o.test(gs(s))}function B7(s){return qt(s)&&Cr(s)==ze}function k7(s){return qt(s)&&mr(s)==Ce}function q7(s){return qt(s)&&Pl(s.length)&&!!vt[Cr(s)]}function iv(s){return typeof s=="function"?s:s==null?kr:typeof s=="object"?Le(s)?av(s[0],s[1]):ov(s):Sy(s)}function Jf(s){if(!xa(s))return WC(s);var o=[];for(var l in bt(s))dt.call(s,l)&&l!="constructor"&&o.push(l);return o}function z7(s){if(!Nt(s))return D$(s);var o=xa(s),l=[];for(var p in s)p=="constructor"&&(o||!dt.call(s,p))||l.push(p);return l}function Qf(s,o){return s<o}function sv(s,o){var l=-1,p=Fr(s)?G(s.length):[];return Si(s,function(v,D,R){p[++l]=o(v,D,R)}),p}function ov(s){var o=dd(s);return o.length==1&&o[0][2]?Bv(o[0][0],o[0][1]):function(l){return l===s||Zf(l,s,o)}}function av(s,o){return gd(s)&&Fv(o)?Bv(Nn(s),o):function(l){var p=Dd(l,s);return p===t&&p===o?Sd(l,s):ba(o,p,S|P)}}function gl(s,o,l,p,v){s!==o&&Kf(o,function(D,R){if(v||(v=new yn),Nt(D))H7(s,o,R,l,gl,p,v);else{var M=p?p(vd(s,R),D,R+"",s,o,v):t;M===t&&(M=D),Hf(s,R,M)}},Br)}function H7(s,o,l,p,v,D,R){var M=vd(s,l),z=vd(o,l),te=R.get(z);if(te){Hf(s,l,te);return}var re=D?D(M,z,l+"",s,o,R):t,oe=re===t;if(oe){var fe=Le(z),ye=!fe&&Ai(z),Ie=!fe&&!ye&&po(z);re=z,fe||ye||Ie?Le(M)?re=M:Kt(M)?re=jr(M):ye?(oe=!1,re=wv(z,!0)):Ie?(oe=!1,re=bv(z,!0)):re=[]:Da(z)||ms(z)?(re=M,ms(M)?re=my(M):(!Nt(M)||ei(M))&&(re=jv(z))):oe=!1}oe&&(R.set(z,re),v(re,z,p,D,R),R.delete(z)),Hf(s,l,re)}function cv(s,o){var l=s.length;if(l)return o+=o<0?l:0,Xn(o,l)?s[o]:t}function lv(s,o,l){o.length?o=Pt(o,function(D){return Le(D)?function(R){return ds(R,D.length===1?D[0]:D)}:D}):o=[kr];var p=-1;o=Pt(o,Yr(_e()));var v=sv(s,function(D,R,M){var z=Pt(o,function(te){return te(D)});return{criteria:z,index:++p,value:D}});return vC(v,function(D,R){return n$(D,R,l)})}function W7(s,o){return uv(s,o,function(l,p){return Sd(s,p)})}function uv(s,o,l){for(var p=-1,v=o.length,D={};++p<v;){var R=o[p],M=ds(s,R);l(M,R)&&_a(D,Ci(R,s),M)}return D}function K7(s){return function(o){return ds(o,s)}}function Xf(s,o,l,p){var v=p?mC:ro,D=-1,R=o.length,M=s;for(s===o&&(o=jr(o)),l&&(M=Pt(s,Yr(l)));++D<R;)for(var z=0,te=o[D],re=l?l(te):te;(z=v(M,re,z,p))>-1;)M!==s&&sl.call(M,z,1),sl.call(s,z,1);return s}function hv(s,o){for(var l=s?o.length:0,p=l-1;l--;){var v=o[l];if(l==p||v!==D){var D=v;Xn(v)?sl.call(s,v,1):nd(s,v)}}return s}function ed(s,o){return s+cl(Wm()*(o-s+1))}function V7(s,o,l,p){for(var v=-1,D=nr(al((o-s)/(l||1)),0),R=G(D);D--;)R[p?D:++v]=s,s+=l;return R}function td(s,o){var l="";if(!s||o<1||o>Y)return l;do o%2&&(l+=s),o=cl(o/2),o&&(s+=s);while(o);return l}function Ge(s,o){return yd(kv(s,o,kr),s+"")}function G7(s){return Gm(go(s))}function Y7(s,o){var l=go(s);return Dl(l,fs(o,0,l.length))}function _a(s,o,l,p){if(!Nt(s))return s;o=Ci(o,s);for(var v=-1,D=o.length,R=D-1,M=s;M!=null&&++v<D;){var z=Nn(o[v]),te=l;if(z==="__proto__"||z==="constructor"||z==="prototype")return s;if(v!=R){var re=M[z];te=p?p(re,z,M):t,te===t&&(te=Nt(re)?re:Xn(o[v+1])?[]:{})}va(M,z,te),M=M[z]}return s}var fv=ll?function(s,o){return ll.set(s,o),s}:kr,Z7=ol?function(s,o){return ol(s,"toString",{configurable:!0,enumerable:!1,value:Cd(o),writable:!0})}:kr;function J7(s){return Dl(go(s))}function un(s,o,l){var p=-1,v=s.length;o<0&&(o=-o>v?0:v+o),l=l>v?v:l,l<0&&(l+=v),v=o>l?0:l-o>>>0,o>>>=0;for(var D=G(v);++p<v;)D[p]=s[p+o];return D}function Q7(s,o){var l;return Si(s,function(p,v,D){return l=o(p,v,D),!l}),!!l}function ml(s,o,l){var p=0,v=s==null?p:s.length;if(typeof o=="number"&&o===o&&v<=ae){for(;p<v;){var D=p+v>>>1,R=s[D];R!==null&&!Jr(R)&&(l?R<=o:R<o)?p=D+1:v=D}return v}return rd(s,o,kr,l)}function rd(s,o,l,p){var v=0,D=s==null?0:s.length;if(D===0)return 0;o=l(o);for(var R=o!==o,M=o===null,z=Jr(o),te=o===t;v<D;){var re=cl((v+D)/2),oe=l(s[re]),fe=oe!==t,ye=oe===null,Ie=oe===oe,We=Jr(oe);if(R)var De=p||Ie;else te?De=Ie&&(p||fe):M?De=Ie&&fe&&(p||!ye):z?De=Ie&&fe&&!ye&&(p||!We):ye||We?De=!1:De=p?oe<=o:oe<o;De?v=re+1:D=re}return gr(D,Ee)}function dv(s,o){for(var l=-1,p=s.length,v=0,D=[];++l<p;){var R=s[l],M=o?o(R):R;if(!l||!wn(M,z)){var z=M;D[v++]=R===0?0:R}}return D}function pv(s){return typeof s=="number"?s:Jr(s)?Q:+s}function Zr(s){if(typeof s=="string")return s;if(Le(s))return Pt(s,Zr)+"";if(Jr(s))return Km?Km.call(s):"";var o=s+"";return o=="0"&&1/s==-ee?"-0":o}function Oi(s,o,l){var p=-1,v=Yc,D=s.length,R=!0,M=[],z=M;if(l)R=!1,v=Pf;else if(D>=i){var te=o?null:l$(s);if(te)return Jc(te);R=!1,v=ha,z=new hs}else z=o?[]:M;e:for(;++p<D;){var re=s[p],oe=o?o(re):re;if(re=l||re!==0?re:0,R&&oe===oe){for(var fe=z.length;fe--;)if(z[fe]===oe)continue e;o&&z.push(oe),M.push(re)}else v(z,oe,l)||(z!==M&&z.push(oe),M.push(re))}return M}function nd(s,o){return o=Ci(o,s),s=qv(s,o),s==null||delete s[Nn(hn(o))]}function gv(s,o,l,p){return _a(s,o,l(ds(s,o)),p)}function vl(s,o,l,p){for(var v=s.length,D=p?v:-1;(p?D--:++D<v)&&o(s[D],D,s););return l?un(s,p?0:D,p?D+1:v):un(s,p?D+1:0,p?v:D)}function mv(s,o){var l=s;return l instanceof tt&&(l=l.value()),Tf(o,function(p,v){return v.func.apply(v.thisArg,xi([p],v.args))},l)}function id(s,o,l){var p=s.length;if(p<2)return p?Oi(s[0]):[];for(var v=-1,D=G(p);++v<p;)for(var R=s[v],M=-1;++M<p;)M!=v&&(D[v]=ya(D[v]||R,s[M],o,l));return Oi(fr(D,1),o,l)}function vv(s,o,l){for(var p=-1,v=s.length,D=o.length,R={};++p<v;){var M=p<D?o[p]:t;l(R,s[p],M)}return R}function sd(s){return Kt(s)?s:[]}function od(s){return typeof s=="function"?s:kr}function Ci(s,o){return Le(s)?s:gd(s,o)?[s]:Kv(ft(s))}var X7=Ge;function $i(s,o,l){var p=s.length;return l=l===t?p:l,!o&&l>=p?s:un(s,o,l)}var yv=BC||function(s){return it.clearTimeout(s)};function wv(s,o){if(o)return s.slice();var l=s.length,p=Bm?Bm(l):new s.constructor(l);return s.copy(p),p}function ad(s){var o=new s.constructor(s.byteLength);return new nl(o).set(new nl(s)),o}function e$(s,o){var l=o?ad(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.byteLength)}function t$(s){var o=new s.constructor(s.source,nn.exec(s));return o.lastIndex=s.lastIndex,o}function r$(s){return ma?bt(ma.call(s)):{}}function bv(s,o){var l=o?ad(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.length)}function _v(s,o){if(s!==o){var l=s!==t,p=s===null,v=s===s,D=Jr(s),R=o!==t,M=o===null,z=o===o,te=Jr(o);if(!M&&!te&&!D&&s>o||D&&R&&z&&!M&&!te||p&&R&&z||!l&&z||!v)return 1;if(!p&&!D&&!te&&s<o||te&&l&&v&&!p&&!D||M&&l&&v||!R&&v||!z)return-1}return 0}function n$(s,o,l){for(var p=-1,v=s.criteria,D=o.criteria,R=v.length,M=l.length;++p<R;){var z=_v(v[p],D[p]);if(z){if(p>=M)return z;var te=l[p];return z*(te=="desc"?-1:1)}}return s.index-o.index}function Ev(s,o,l,p){for(var v=-1,D=s.length,R=l.length,M=-1,z=o.length,te=nr(D-R,0),re=G(z+te),oe=!p;++M<z;)re[M]=o[M];for(;++v<R;)(oe||v<D)&&(re[l[v]]=s[v]);for(;te--;)re[M++]=s[v++];return re}function xv(s,o,l,p){for(var v=-1,D=s.length,R=-1,M=l.length,z=-1,te=o.length,re=nr(D-M,0),oe=G(re+te),fe=!p;++v<re;)oe[v]=s[v];for(var ye=v;++z<te;)oe[ye+z]=o[z];for(;++R<M;)(fe||v<D)&&(oe[ye+l[R]]=s[v++]);return oe}function jr(s,o){var l=-1,p=s.length;for(o||(o=G(p));++l<p;)o[l]=s[l];return o}function Rn(s,o,l,p){var v=!l;l||(l={});for(var D=-1,R=o.length;++D<R;){var M=o[D],z=p?p(l[M],s[M],M,l,s):t;z===t&&(z=s[M]),v?Zn(l,M,z):va(l,M,z)}return l}function i$(s,o){return Rn(s,pd(s),o)}function s$(s,o){return Rn(s,Mv(s),o)}function yl(s,o){return function(l,p){var v=Le(l)?uC:O7,D=o?o():{};return v(l,s,_e(p,2),D)}}function uo(s){return Ge(function(o,l){var p=-1,v=l.length,D=v>1?l[v-1]:t,R=v>2?l[2]:t;for(D=s.length>3&&typeof D=="function"?(v--,D):t,R&&$r(l[0],l[1],R)&&(D=v<3?t:D,v=1),o=bt(o);++p<v;){var M=l[p];M&&s(o,M,p,D)}return o})}function Iv(s,o){return function(l,p){if(l==null)return l;if(!Fr(l))return s(l,p);for(var v=l.length,D=o?v:-1,R=bt(l);(o?D--:++D<v)&&p(R[D],D,R)!==!1;);return l}}function Dv(s){return function(o,l,p){for(var v=-1,D=bt(o),R=p(o),M=R.length;M--;){var z=R[s?M:++v];if(l(D[z],z,D)===!1)break}return o}}function o$(s,o,l){var p=o&j,v=Ea(s);function D(){var R=this&&this!==it&&this instanceof D?v:s;return R.apply(p?l:this,arguments)}return D}function Sv(s){return function(o){o=ft(o);var l=no(o)?vn(o):t,p=l?l[0]:o.charAt(0),v=l?$i(l,1).join(""):o.slice(1);return p[s]()+v}}function ho(s){return function(o){return Tf(Iy(xy(o).replace(la,"")),s,"")}}function Ea(s){return function(){var o=arguments;switch(o.length){case 0:return new s;case 1:return new s(o[0]);case 2:return new s(o[0],o[1]);case 3:return new s(o[0],o[1],o[2]);case 4:return new s(o[0],o[1],o[2],o[3]);case 5:return new s(o[0],o[1],o[2],o[3],o[4]);case 6:return new s(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new s(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var l=lo(s.prototype),p=s.apply(l,o);return Nt(p)?p:l}}function a$(s,o,l){var p=Ea(s);function v(){for(var D=arguments.length,R=G(D),M=D,z=fo(v);M--;)R[M]=arguments[M];var te=D<3&&R[0]!==z&&R[D-1]!==z?[]:Ii(R,z);if(D-=te.length,D<l)return Pv(s,o,wl,v.placeholder,t,R,te,t,t,l-D);var re=this&&this!==it&&this instanceof v?p:s;return ar(re,this,R)}return v}function Ov(s){return function(o,l,p){var v=bt(o);if(!Fr(o)){var D=_e(l,3);o=cr(o),l=function(M){return D(v[M],M,v)}}var R=s(o,l,p);return R>-1?v[D?o[R]:R]:t}}function Cv(s){return Qn(function(o){var l=o.length,p=l,v=cn.prototype.thru;for(s&&o.reverse();p--;){var D=o[p];if(typeof D!="function")throw new an(c);if(v&&!R&&xl(D)=="wrapper")var R=new cn([],!0)}for(p=R?p:l;++p<l;){D=o[p];var M=xl(D),z=M=="wrapper"?fd(D):t;z&&md(z[0])&&z[1]==(d|T|$|b)&&!z[4].length&&z[9]==1?R=R[xl(z[0])].apply(R,z[3]):R=D.length==1&&md(D)?R[M]():R.thru(D)}return function(){var te=arguments,re=te[0];if(R&&te.length==1&&Le(re))return R.plant(re).value();for(var oe=0,fe=l?o[oe].apply(this,te):re;++oe<l;)fe=o[oe].call(this,fe);return fe}})}function wl(s,o,l,p,v,D,R,M,z,te){var re=o&d,oe=o&j,fe=o&U,ye=o&(T|O),Ie=o&H,We=fe?t:Ea(s);function De(){for(var Qe=arguments.length,st=G(Qe),Qr=Qe;Qr--;)st[Qr]=arguments[Qr];if(ye)var Ar=fo(De),Xr=wC(st,Ar);if(p&&(st=Ev(st,p,v,ye)),D&&(st=xv(st,D,R,ye)),Qe-=Xr,ye&&Qe<te){var Vt=Ii(st,Ar);return Pv(s,o,wl,De.placeholder,l,st,Vt,M,z,te-Qe)}var bn=oe?l:this,ri=fe?bn[s]:s;return Qe=st.length,M?st=O$(st,M):Ie&&Qe>1&&st.reverse(),re&&z<Qe&&(st.length=z),this&&this!==it&&this instanceof De&&(ri=We||Ea(ri)),ri.apply(bn,st)}return De}function $v(s,o){return function(l,p){return L7(l,s,o(p),{})}}function bl(s,o){return function(l,p){var v;if(l===t&&p===t)return o;if(l!==t&&(v=l),p!==t){if(v===t)return p;typeof l=="string"||typeof p=="string"?(l=Zr(l),p=Zr(p)):(l=pv(l),p=pv(p)),v=s(l,p)}return v}}function cd(s){return Qn(function(o){return o=Pt(o,Yr(_e())),Ge(function(l){var p=this;return s(o,function(v){return ar(v,p,l)})})})}function _l(s,o){o=o===t?" ":Zr(o);var l=o.length;if(l<2)return l?td(o,s):o;var p=td(o,al(s/io(o)));return no(o)?$i(vn(p),0,s).join(""):p.slice(0,s)}function c$(s,o,l,p){var v=o&j,D=Ea(s);function R(){for(var M=-1,z=arguments.length,te=-1,re=p.length,oe=G(re+z),fe=this&&this!==it&&this instanceof R?D:s;++te<re;)oe[te]=p[te];for(;z--;)oe[te++]=arguments[++M];return ar(fe,v?l:this,oe)}return R}function Av(s){return function(o,l,p){return p&&typeof p!="number"&&$r(o,l,p)&&(l=p=t),o=ti(o),l===t?(l=o,o=0):l=ti(l),p=p===t?o<l?1:-1:ti(p),V7(o,l,p,s)}}function El(s){return function(o,l){return typeof o=="string"&&typeof l=="string"||(o=fn(o),l=fn(l)),s(o,l)}}function Pv(s,o,l,p,v,D,R,M,z,te){var re=o&T,oe=re?R:t,fe=re?t:R,ye=re?D:t,Ie=re?t:D;o|=re?$:x,o&=~(re?x:$),o&A||(o&=~(j|U));var We=[s,o,v,ye,oe,Ie,fe,M,z,te],De=l.apply(t,We);return md(s)&&zv(De,We),De.placeholder=p,Hv(De,s,o)}function ld(s){var o=rr[s];return function(l,p){if(l=fn(l),p=p==null?0:gr(qe(p),292),p&&Hm(l)){var v=(ft(l)+"e").split("e"),D=o(v[0]+"e"+(+v[1]+p));return v=(ft(D)+"e").split("e"),+(v[0]+"e"+(+v[1]-p))}return o(l)}}var l$=ao&&1/Jc(new ao([,-0]))[1]==ee?function(s){return new ao(s)}:Pd;function Tv(s){return function(o){var l=mr(o);return l==Oe?Ff(o):l==Ce?SC(o):yC(o,s(o))}}function Jn(s,o,l,p,v,D,R,M){var z=o&U;if(!z&&typeof s!="function")throw new an(c);var te=p?p.length:0;if(te||(o&=~($|x),p=v=t),R=R===t?R:nr(qe(R),0),M=M===t?M:qe(M),te-=v?v.length:0,o&x){var re=p,oe=v;p=v=t}var fe=z?t:fd(s),ye=[s,o,l,p,v,re,oe,D,R,M];if(fe&&I$(ye,fe),s=ye[0],o=ye[1],l=ye[2],p=ye[3],v=ye[4],M=ye[9]=ye[9]===t?z?0:s.length:nr(ye[9]-te,0),!M&&o&(T|O)&&(o&=~(T|O)),!o||o==j)var Ie=o$(s,o,l);else o==T||o==O?Ie=a$(s,o,M):(o==$||o==(j|$))&&!v.length?Ie=c$(s,o,l,p):Ie=wl.apply(t,ye);var We=fe?fv:zv;return Hv(We(Ie,ye),s,o)}function Rv(s,o,l,p){return s===t||wn(s,oo[l])&&!dt.call(p,l)?o:s}function Nv(s,o,l,p,v,D){return Nt(s)&&Nt(o)&&(D.set(o,s),gl(s,o,t,Nv,D),D.delete(o)),s}function u$(s){return Da(s)?t:s}function Lv(s,o,l,p,v,D){var R=l&S,M=s.length,z=o.length;if(M!=z&&!(R&&z>M))return!1;var te=D.get(s),re=D.get(o);if(te&&re)return te==o&&re==s;var oe=-1,fe=!0,ye=l&P?new hs:t;for(D.set(s,o),D.set(o,s);++oe<M;){var Ie=s[oe],We=o[oe];if(p)var De=R?p(We,Ie,oe,o,s,D):p(Ie,We,oe,s,o,D);if(De!==t){if(De)continue;fe=!1;break}if(ye){if(!Rf(o,function(Qe,st){if(!ha(ye,st)&&(Ie===Qe||v(Ie,Qe,l,p,D)))return ye.push(st)})){fe=!1;break}}else if(!(Ie===We||v(Ie,We,l,p,D))){fe=!1;break}}return D.delete(s),D.delete(o),fe}function h$(s,o,l,p,v,D,R){switch(l){case Te:if(s.byteLength!=o.byteLength||s.byteOffset!=o.byteOffset)return!1;s=s.buffer,o=o.buffer;case Se:return!(s.byteLength!=o.byteLength||!D(new nl(s),new nl(o)));case W:case B:case Ke:return wn(+s,+o);case L:return s.name==o.name&&s.message==o.message;case ze:case Ue:return s==o+"";case Oe:var M=Ff;case Ce:var z=p&S;if(M||(M=Jc),s.size!=o.size&&!z)return!1;var te=R.get(s);if(te)return te==o;p|=P,R.set(s,o);var re=Lv(M(s),M(o),p,v,D,R);return R.delete(s),re;case je:if(ma)return ma.call(s)==ma.call(o)}return!1}function f$(s,o,l,p,v,D){var R=l&S,M=ud(s),z=M.length,te=ud(o),re=te.length;if(z!=re&&!R)return!1;for(var oe=z;oe--;){var fe=M[oe];if(!(R?fe in o:dt.call(o,fe)))return!1}var ye=D.get(s),Ie=D.get(o);if(ye&&Ie)return ye==o&&Ie==s;var We=!0;D.set(s,o),D.set(o,s);for(var De=R;++oe<z;){fe=M[oe];var Qe=s[fe],st=o[fe];if(p)var Qr=R?p(st,Qe,fe,o,s,D):p(Qe,st,fe,s,o,D);if(!(Qr===t?Qe===st||v(Qe,st,l,p,D):Qr)){We=!1;break}De||(De=fe=="constructor")}if(We&&!De){var Ar=s.constructor,Xr=o.constructor;Ar!=Xr&&"constructor"in s&&"constructor"in o&&!(typeof Ar=="function"&&Ar instanceof Ar&&typeof Xr=="function"&&Xr instanceof Xr)&&(We=!1)}return D.delete(s),D.delete(o),We}function Qn(s){return yd(kv(s,t,Zv),s+"")}function ud(s){return tv(s,cr,pd)}function hd(s){return tv(s,Br,Mv)}var fd=ll?function(s){return ll.get(s)}:Pd;function xl(s){for(var o=s.name+"",l=co[o],p=dt.call(co,o)?l.length:0;p--;){var v=l[p],D=v.func;if(D==null||D==s)return v.name}return o}function fo(s){var o=dt.call(E,"placeholder")?E:s;return o.placeholder}function _e(){var s=E.iteratee||$d;return s=s===$d?iv:s,arguments.length?s(arguments[0],arguments[1]):s}function Il(s,o){var l=s.__data__;return b$(o)?l[typeof o=="string"?"string":"hash"]:l.map}function dd(s){for(var o=cr(s),l=o.length;l--;){var p=o[l],v=s[p];o[l]=[p,v,Fv(v)]}return o}function ps(s,o){var l=xC(s,o);return nv(l)?l:t}function d$(s){var o=dt.call(s,ls),l=s[ls];try{s[ls]=t;var p=!0}catch{}var v=tl.call(s);return p&&(o?s[ls]=l:delete s[ls]),v}var pd=kf?function(s){return s==null?[]:(s=bt(s),Ei(kf(s),function(o){return qm.call(s,o)}))}:Td,Mv=kf?function(s){for(var o=[];s;)xi(o,pd(s)),s=il(s);return o}:Td,mr=Cr;(qf&&mr(new qf(new ArrayBuffer(1)))!=Te||da&&mr(new da)!=Oe||zf&&mr(zf.resolve())!=Ot||ao&&mr(new ao)!=Ce||pa&&mr(new pa)!=Ae)&&(mr=function(s){var o=Cr(s),l=o==ke?s.constructor:t,p=l?gs(l):"";if(p)switch(p){case YC:return Te;case ZC:return Oe;case JC:return Ot;case QC:return Ce;case XC:return Ae}return o});function p$(s,o,l){for(var p=-1,v=l.length;++p<v;){var D=l[p],R=D.size;switch(D.type){case"drop":s+=R;break;case"dropRight":o-=R;break;case"take":o=gr(o,s+R);break;case"takeRight":s=nr(s,o-R);break}}return{start:s,end:o}}function g$(s){var o=s.match(Et);return o?o[1].split(Jt):[]}function Uv(s,o,l){o=Ci(o,s);for(var p=-1,v=o.length,D=!1;++p<v;){var R=Nn(o[p]);if(!(D=s!=null&&l(s,R)))break;s=s[R]}return D||++p!=v?D:(v=s==null?0:s.length,!!v&&Pl(v)&&Xn(R,v)&&(Le(s)||ms(s)))}function m$(s){var o=s.length,l=new s.constructor(o);return o&&typeof s[0]=="string"&&dt.call(s,"index")&&(l.index=s.index,l.input=s.input),l}function jv(s){return typeof s.constructor=="function"&&!xa(s)?lo(il(s)):{}}function v$(s,o,l){var p=s.constructor;switch(o){case Se:return ad(s);case W:case B:return new p(+s);case Te:return e$(s,l);case Ve:case $e:case Je:case et:case at:case ct:case nt:case Dr:case Mr:return bv(s,l);case Oe:return new p;case Ke:case Ue:return new p(s);case ze:return t$(s);case Ce:return new p;case je:return r$(s)}}function y$(s,o){var l=o.length;if(!l)return s;var p=l-1;return o[p]=(l>1?"& ":"")+o[p],o=o.join(l>2?", ":" "),s.replace(kt,`{
67
67
  /* [wrapped with `+o+`] */
68
- `)}function w$(s){return Le(s)||gs(s)||!!(zm&&s&&s[zm])}function Xn(s,o){var l=typeof s;return o=o??Y,!!o&&(l=="number"||l!="symbol"&&mf.test(s))&&s>-1&&s%1==0&&s<o}function Ar(s,o,l){if(!Rt(l))return!1;var p=typeof o;return(p=="number"?Br(l)&&Xn(o,l.length):p=="string"&&o in l)?wn(l[o],s):!1}function pd(s,o){if(Le(s))return!1;var l=typeof s;return l=="number"||l=="symbol"||l=="boolean"||s==null||Zr(s)?!0:Gt.test(s)||!$t.test(s)||o!=null&&s in wt(o)}function b$(s){var o=typeof s;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?s!=="__proto__":s===null}function gd(s){var o=bl(s),l=_[o];if(typeof l!="function"||!(o in tt.prototype))return!1;if(s===l)return!0;var p=hd(l);return!!p&&s===p[0]}function _$(s){return!!Fm&&Fm in s}var E$=Jc?ei:Td;function wa(s){var o=s&&s.constructor,l=typeof o=="function"&&o.prototype||no;return s===l}function Fv(s){return s===s&&!Rt(s)}function Bv(s,o){return function(l){return l==null?!1:l[s]===o&&(o!==t||s in wt(l))}}function x$(s){var o=Sl(s,function(p){return l.size===h&&l.clear(),p}),l=o.cache;return o}function I$(s,o){var l=s[1],p=o[1],v=l|p,D=v<(U|j|d),R=p==d&&l==T||p==d&&l==b&&s[7].length<=o[8]||p==(d|b)&&o[7].length<=o[8]&&l==T;if(!(D||R))return s;p&U&&(s[2]=o[2],v|=l&U?0:A);var M=o[3];if(M){var z=s[3];s[3]=z?Ev(z,M,o[4]):M,s[4]=z?Ii(s[3],m):o[4]}return M=o[5],M&&(z=s[5],s[5]=z?xv(z,M,o[6]):M,s[6]=z?Ii(s[5],m):o[6]),M=o[7],M&&(s[7]=M),p&d&&(s[8]=s[8]==null?o[8]:mr(s[8],o[8])),s[9]==null&&(s[9]=o[9]),s[0]=o[0],s[1]=v,s}function D$(s){var o=[];if(s!=null)for(var l in wt(s))o.push(l);return o}function S$(s){return Qc.call(s)}function kv(s,o,l){return o=nr(o===t?s.length-1:o,0),function(){for(var p=arguments,v=-1,D=nr(p.length-o,0),R=G(D);++v<D;)R[v]=p[o+v];v=-1;for(var M=G(o+1);++v<o;)M[v]=p[v];return M[o]=l(R),ar(s,this,M)}}function qv(s,o){return o.length<2?s:fs(s,ln(o,0,-1))}function C$(s,o){for(var l=s.length,p=mr(o.length,l),v=Fr(s);p--;){var D=o[p];s[p]=Xn(D,l)?v[D]:t}return s}function md(s,o){if(!(o==="constructor"&&typeof s[o]=="function")&&o!="__proto__")return s[o]}var zv=Wv(fv),ba=qO||function(s,o){return it.setTimeout(s,o)},vd=Wv(J7);function Hv(s,o,l){var p=o+"";return vd(s,y$(p,O$(g$(p),l)))}function Wv(s){var o=0,l=0;return function(){var p=KO(),v=ce-(p-l);if(l=p,v>0){if(++o>=se)return arguments[0]}else o=0;return s.apply(t,arguments)}}function El(s,o){var l=-1,p=s.length,v=p-1;for(o=o===t?p:o;++l<o;){var D=Xf(l,v),R=s[D];s[D]=s[l],s[l]=R}return s.length=o,s}var Kv=x$(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(Yt,function(l,p,v,D){o.push(v?D.replace(uf,"$1"):p||l)}),o});function Rn(s){if(typeof s=="string"||Zr(s))return s;var o=s+"";return o=="0"&&1/s==-ee?"-0":o}function ps(s){if(s!=null){try{return Zc.call(s)}catch{}try{return s+""}catch{}}return""}function O$(s,o){return sn(xe,function(l){var p="_."+l[0];o&l[1]&&!Kc(s,p)&&s.push(p)}),s.sort()}function Vv(s){if(s instanceof tt)return s.clone();var o=new an(s.__wrapped__,s.__chain__);return o.__actions__=Fr(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}function $$(s,o,l){(l?Ar(s,o,l):o===t)?o=1:o=nr(qe(o),0);var p=s==null?0:s.length;if(!p||o<1)return[];for(var v=0,D=0,R=G(il(p/o));v<p;)R[D++]=ln(s,v,v+=o);return R}function A$(s){for(var o=-1,l=s==null?0:s.length,p=0,v=[];++o<l;){var D=s[o];D&&(v[p++]=D)}return v}function P$(){var s=arguments.length;if(!s)return[];for(var o=G(s-1),l=arguments[0],p=s;p--;)o[p-1]=arguments[p];return xi(Le(l)?Fr(l):[l],fr(o,1))}var T$=Ge(function(s,o){return Kt(s)?pa(s,fr(o,1,Kt,!0)):[]}),R$=Ge(function(s,o){var l=un(o);return Kt(l)&&(l=t),Kt(s)?pa(s,fr(o,1,Kt,!0),_e(l,2)):[]}),N$=Ge(function(s,o){var l=un(o);return Kt(l)&&(l=t),Kt(s)?pa(s,fr(o,1,Kt,!0),t,l):[]});function L$(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:qe(o),ln(s,o<0?0:o,p)):[]}function M$(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:qe(o),o=p-o,ln(s,0,o<0?0:o)):[]}function U$(s,o){return s&&s.length?pl(s,_e(o,3),!0,!0):[]}function j$(s,o){return s&&s.length?pl(s,_e(o,3),!0):[]}function F$(s,o,l,p){var v=s==null?0:s.length;return v?(l&&typeof l!="number"&&Ar(s,o,l)&&(l=0,p=v),P7(s,o,l,p)):[]}function Gv(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=l==null?0:qe(l);return v<0&&(v=nr(p+v,0)),Vc(s,_e(o,3),v)}function Yv(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=p-1;return l!==t&&(v=qe(l),v=l<0?nr(p+v,0):mr(v,p-1)),Vc(s,_e(o,3),v,!0)}function Jv(s){var o=s==null?0:s.length;return o?fr(s,1):[]}function B$(s){var o=s==null?0:s.length;return o?fr(s,ee):[]}function k$(s,o){var l=s==null?0:s.length;return l?(o=o===t?1:qe(o),fr(s,o)):[]}function q$(s){for(var o=-1,l=s==null?0:s.length,p={};++o<l;){var v=s[o];p[v[0]]=v[1]}return p}function Zv(s){return s&&s.length?s[0]:t}function z$(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=l==null?0:qe(l);return v<0&&(v=nr(p+v,0)),Xs(s,o,v)}function H$(s){var o=s==null?0:s.length;return o?ln(s,0,-1):[]}var W$=Ge(function(s){var o=At(s,id);return o.length&&o[0]===s[0]?Gf(o):[]}),K$=Ge(function(s){var o=un(s),l=At(s,id);return o===un(l)?o=t:l.pop(),l.length&&l[0]===s[0]?Gf(l,_e(o,2)):[]}),V$=Ge(function(s){var o=un(s),l=At(s,id);return o=typeof o=="function"?o:t,o&&l.pop(),l.length&&l[0]===s[0]?Gf(l,t,o):[]});function G$(s,o){return s==null?"":HO.call(s,o)}function un(s){var o=s==null?0:s.length;return o?s[o-1]:t}function Y$(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=p;return l!==t&&(v=qe(l),v=v<0?nr(p+v,0):mr(v,p-1)),o===o?OO(s,o,v):Vc(s,Pm,v,!0)}function J$(s,o){return s&&s.length?cv(s,qe(o)):t}var Z$=Ge(Qv);function Qv(s,o){return s&&s.length&&o&&o.length?Qf(s,o):s}function Q$(s,o,l){return s&&s.length&&o&&o.length?Qf(s,o,_e(l,2)):s}function X$(s,o,l){return s&&s.length&&o&&o.length?Qf(s,o,t,l):s}var eA=Qn(function(s,o){var l=s==null?0:s.length,p=Hf(s,o);return hv(s,At(o,function(v){return Xn(v,l)?+v:v}).sort(_v)),p});function tA(s,o){var l=[];if(!(s&&s.length))return l;var p=-1,v=[],D=s.length;for(o=_e(o,3);++p<D;){var R=s[p];o(R,p,s)&&(l.push(R),v.push(p))}return hv(s,v),l}function yd(s){return s==null?s:GO.call(s)}function rA(s,o,l){var p=s==null?0:s.length;return p?(l&&typeof l!="number"&&Ar(s,o,l)?(o=0,l=p):(o=o==null?0:qe(o),l=l===t?p:qe(l)),ln(s,o,l)):[]}function nA(s,o){return dl(s,o)}function iA(s,o,l){return td(s,o,_e(l,2))}function sA(s,o){var l=s==null?0:s.length;if(l){var p=dl(s,o);if(p<l&&wn(s[p],o))return p}return-1}function oA(s,o){return dl(s,o,!0)}function aA(s,o,l){return td(s,o,_e(l,2),!0)}function cA(s,o){var l=s==null?0:s.length;if(l){var p=dl(s,o,!0)-1;if(wn(s[p],o))return p}return-1}function lA(s){return s&&s.length?dv(s):[]}function uA(s,o){return s&&s.length?dv(s,_e(o,2)):[]}function hA(s){var o=s==null?0:s.length;return o?ln(s,1,o):[]}function fA(s,o,l){return s&&s.length?(o=l||o===t?1:qe(o),ln(s,0,o<0?0:o)):[]}function dA(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:qe(o),o=p-o,ln(s,o<0?0:o,p)):[]}function pA(s,o){return s&&s.length?pl(s,_e(o,3),!1,!0):[]}function gA(s,o){return s&&s.length?pl(s,_e(o,3)):[]}var mA=Ge(function(s){return Ci(fr(s,1,Kt,!0))}),vA=Ge(function(s){var o=un(s);return Kt(o)&&(o=t),Ci(fr(s,1,Kt,!0),_e(o,2))}),yA=Ge(function(s){var o=un(s);return o=typeof o=="function"?o:t,Ci(fr(s,1,Kt,!0),t,o)});function wA(s){return s&&s.length?Ci(s):[]}function bA(s,o){return s&&s.length?Ci(s,_e(o,2)):[]}function _A(s,o){return o=typeof o=="function"?o:t,s&&s.length?Ci(s,t,o):[]}function wd(s){if(!(s&&s.length))return[];var o=0;return s=Ei(s,function(l){if(Kt(l))return o=nr(l.length,o),!0}),Mf(o,function(l){return At(s,Rf(l))})}function Xv(s,o){if(!(s&&s.length))return[];var l=wd(s);return o==null?l:At(l,function(p){return ar(o,t,p)})}var EA=Ge(function(s,o){return Kt(s)?pa(s,o):[]}),xA=Ge(function(s){return nd(Ei(s,Kt))}),IA=Ge(function(s){var o=un(s);return Kt(o)&&(o=t),nd(Ei(s,Kt),_e(o,2))}),DA=Ge(function(s){var o=un(s);return o=typeof o=="function"?o:t,nd(Ei(s,Kt),t,o)}),SA=Ge(wd);function CA(s,o){return vv(s||[],o||[],da)}function OA(s,o){return vv(s||[],o||[],va)}var $A=Ge(function(s){var o=s.length,l=o>1?s[o-1]:t;return l=typeof l=="function"?(s.pop(),l):t,Xv(s,l)});function ey(s){var o=_(s);return o.__chain__=!0,o}function AA(s,o){return o(s),s}function xl(s,o){return o(s)}var PA=Qn(function(s){var o=s.length,l=o?s[0]:0,p=this.__wrapped__,v=function(D){return Hf(D,s)};return o>1||this.__actions__.length||!(p instanceof tt)||!Xn(l)?this.thru(v):(p=p.slice(l,+l+(o?1:0)),p.__actions__.push({func:xl,args:[v],thisArg:t}),new an(p,this.__chain__).thru(function(D){return o&&!D.length&&D.push(t),D}))});function TA(){return ey(this)}function RA(){return new an(this.value(),this.__chain__)}function NA(){this.__values__===t&&(this.__values__=py(this.value()));var s=this.__index__>=this.__values__.length,o=s?t:this.__values__[this.__index__++];return{done:s,value:o}}function LA(){return this}function MA(s){for(var o,l=this;l instanceof cl;){var p=Vv(l);p.__index__=0,p.__values__=t,o?v.__wrapped__=p:o=p;var v=p;l=l.__wrapped__}return v.__wrapped__=s,o}function UA(){var s=this.__wrapped__;if(s instanceof tt){var o=s;return this.__actions__.length&&(o=new tt(this)),o=o.reverse(),o.__actions__.push({func:xl,args:[yd],thisArg:t}),new an(o,this.__chain__)}return this.thru(yd)}function jA(){return mv(this.__wrapped__,this.__actions__)}var FA=gl(function(s,o,l){dt.call(s,l)?++s[l]:Jn(s,l,1)});function BA(s,o,l){var p=Le(s)?$m:A7;return l&&Ar(s,o,l)&&(o=t),p(s,_e(o,3))}function kA(s,o){var l=Le(s)?Ei:Xm;return l(s,_e(o,3))}var qA=Cv(Gv),zA=Cv(Yv);function HA(s,o){return fr(Il(s,o),1)}function WA(s,o){return fr(Il(s,o),ee)}function KA(s,o,l){return l=l===t?1:qe(l),fr(Il(s,o),l)}function ty(s,o){var l=Le(s)?sn:Si;return l(s,_e(o,3))}function ry(s,o){var l=Le(s)?hO:Qm;return l(s,_e(o,3))}var VA=gl(function(s,o,l){dt.call(s,l)?s[l].push(o):Jn(s,l,[o])});function GA(s,o,l,p){s=Br(s)?s:ho(s),l=l&&!p?qe(l):0;var v=s.length;return l<0&&(l=nr(v+l,0)),$l(s)?l<=v&&s.indexOf(o,l)>-1:!!v&&Xs(s,o,l)>-1}var YA=Ge(function(s,o,l){var p=-1,v=typeof o=="function",D=Br(s)?G(s.length):[];return Si(s,function(R){D[++p]=v?ar(o,R,l):ga(R,o,l)}),D}),JA=gl(function(s,o,l){Jn(s,l,o)});function Il(s,o){var l=Le(s)?At:sv;return l(s,_e(o,3))}function ZA(s,o,l,p){return s==null?[]:(Le(o)||(o=o==null?[]:[o]),l=p?t:l,Le(l)||(l=l==null?[]:[l]),lv(s,o,l))}var QA=gl(function(s,o,l){s[l?0:1].push(o)},function(){return[[],[]]});function XA(s,o,l){var p=Le(s)?Pf:Rm,v=arguments.length<3;return p(s,_e(o,4),l,v,Si)}function eP(s,o,l){var p=Le(s)?fO:Rm,v=arguments.length<3;return p(s,_e(o,4),l,v,Qm)}function tP(s,o){var l=Le(s)?Ei:Xm;return l(s,Cl(_e(o,3)))}function rP(s){var o=Le(s)?Gm:G7;return o(s)}function nP(s,o,l){(l?Ar(s,o,l):o===t)?o=1:o=qe(o);var p=Le(s)?D7:Y7;return p(s,o)}function iP(s){var o=Le(s)?S7:Z7;return o(s)}function sP(s){if(s==null)return 0;if(Br(s))return $l(s)?to(s):s.length;var o=vr(s);return o==Ce||o==Oe?s.size:Jf(s).length}function oP(s,o,l){var p=Le(s)?Tf:Q7;return l&&Ar(s,o,l)&&(o=t),p(s,_e(o,3))}var aP=Ge(function(s,o){if(s==null)return[];var l=o.length;return l>1&&Ar(s,o[0],o[1])?o=[]:l>2&&Ar(o[0],o[1],o[2])&&(o=[o[0]]),lv(s,fr(o,1),[])}),Dl=kO||function(){return it.Date.now()};function cP(s,o){if(typeof o!="function")throw new on(c);return s=qe(s),function(){if(--s<1)return o.apply(this,arguments)}}function ny(s,o,l){return o=l?t:o,o=s&&o==null?s.length:o,Zn(s,d,t,t,t,t,o)}function iy(s,o){var l;if(typeof o!="function")throw new on(c);return s=qe(s),function(){return--s>0&&(l=o.apply(this,arguments)),s<=1&&(o=t),l}}var bd=Ge(function(s,o,l){var p=U;if(l.length){var v=Ii(l,lo(bd));p|=$}return Zn(s,p,o,l,v)}),sy=Ge(function(s,o,l){var p=U|j;if(l.length){var v=Ii(l,lo(sy));p|=$}return Zn(o,p,s,l,v)});function oy(s,o,l){o=l?t:o;var p=Zn(s,T,t,t,t,t,t,o);return p.placeholder=oy.placeholder,p}function ay(s,o,l){o=l?t:o;var p=Zn(s,C,t,t,t,t,t,o);return p.placeholder=ay.placeholder,p}function cy(s,o,l){var p,v,D,R,M,z,te=0,re=!1,oe=!1,fe=!0;if(typeof s!="function")throw new on(c);o=hn(o)||0,Rt(l)&&(re=!!l.leading,oe="maxWait"in l,D=oe?nr(hn(l.maxWait)||0,o):D,fe="trailing"in l?!!l.trailing:fe);function ve(Vt){var bn=p,ri=v;return p=v=t,te=Vt,R=s.apply(ri,bn),R}function Ie(Vt){return te=Vt,M=ba(Qe,o),re?ve(Vt):R}function We(Vt){var bn=Vt-z,ri=Vt-te,Cy=o-bn;return oe?mr(Cy,D-ri):Cy}function De(Vt){var bn=Vt-z,ri=Vt-te;return z===t||bn>=o||bn<0||oe&&ri>=D}function Qe(){var Vt=Dl();if(De(Vt))return st(Vt);M=ba(Qe,We(Vt))}function st(Vt){return M=t,fe&&p?ve(Vt):(p=v=t,R)}function Qr(){M!==t&&yv(M),te=0,p=z=v=M=t}function Pr(){return M===t?R:st(Dl())}function Xr(){var Vt=Dl(),bn=De(Vt);if(p=arguments,v=this,z=Vt,bn){if(M===t)return Ie(z);if(oe)return yv(M),M=ba(Qe,o),ve(z)}return M===t&&(M=ba(Qe,o)),R}return Xr.cancel=Qr,Xr.flush=Pr,Xr}var lP=Ge(function(s,o){return Zm(s,1,o)}),uP=Ge(function(s,o,l){return Zm(s,hn(o)||0,l)});function hP(s){return Zn(s,H)}function Sl(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new on(c);var l=function(){var p=arguments,v=o?o.apply(this,p):p[0],D=l.cache;if(D.has(v))return D.get(v);var R=s.apply(this,p);return l.cache=D.set(v,R)||D,R};return l.cache=new(Sl.Cache||Yn),l}Sl.Cache=Yn;function Cl(s){if(typeof s!="function")throw new on(c);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function fP(s){return iy(2,s)}var dP=X7(function(s,o){o=o.length==1&&Le(o[0])?At(o[0],Yr(_e())):At(fr(o,1),Yr(_e()));var l=o.length;return Ge(function(p){for(var v=-1,D=mr(p.length,l);++v<D;)p[v]=o[v].call(this,p[v]);return ar(s,this,p)})}),_d=Ge(function(s,o){var l=Ii(o,lo(_d));return Zn(s,$,t,o,l)}),ly=Ge(function(s,o){var l=Ii(o,lo(ly));return Zn(s,E,t,o,l)}),pP=Qn(function(s,o){return Zn(s,b,t,t,t,o)});function gP(s,o){if(typeof s!="function")throw new on(c);return o=o===t?o:qe(o),Ge(s,o)}function mP(s,o){if(typeof s!="function")throw new on(c);return o=o==null?0:nr(qe(o),0),Ge(function(l){var p=l[o],v=$i(l,0,o);return p&&xi(v,p),ar(s,this,v)})}function vP(s,o,l){var p=!0,v=!0;if(typeof s!="function")throw new on(c);return Rt(l)&&(p="leading"in l?!!l.leading:p,v="trailing"in l?!!l.trailing:v),cy(s,o,{leading:p,maxWait:o,trailing:v})}function yP(s){return ny(s,1)}function wP(s,o){return _d(sd(o),s)}function bP(){if(!arguments.length)return[];var s=arguments[0];return Le(s)?s:[s]}function _P(s){return cn(s,x)}function EP(s,o){return o=typeof o=="function"?o:t,cn(s,x,o)}function xP(s){return cn(s,w|x)}function IP(s,o){return o=typeof o=="function"?o:t,cn(s,w|x,o)}function DP(s,o){return o==null||Jm(s,o,cr(o))}function wn(s,o){return s===o||s!==s&&o!==o}var SP=wl(Vf),CP=wl(function(s,o){return s>=o}),gs=rv(function(){return arguments}())?rv:function(s){return kt(s)&&dt.call(s,"callee")&&!qm.call(s,"callee")},Le=G.isArray,OP=Or?Yr(Or):M7;function Br(s){return s!=null&&Ol(s.length)&&!ei(s)}function Kt(s){return kt(s)&&Br(s)}function $P(s){return s===!0||s===!1||kt(s)&&$r(s)==W}var Ai=zO||Td,AP=mn?Yr(mn):U7;function PP(s){return kt(s)&&s.nodeType===1&&!_a(s)}function TP(s){if(s==null)return!0;if(Br(s)&&(Le(s)||typeof s=="string"||typeof s.splice=="function"||Ai(s)||uo(s)||gs(s)))return!s.length;var o=vr(s);if(o==Ce||o==Oe)return!s.size;if(wa(s))return!Jf(s).length;for(var l in s)if(dt.call(s,l))return!1;return!0}function RP(s,o){return ma(s,o)}function NP(s,o,l){l=typeof l=="function"?l:t;var p=l?l(s,o):t;return p===t?ma(s,o,t,l):!!p}function Ed(s){if(!kt(s))return!1;var o=$r(s);return o==L||o==g||typeof s.message=="string"&&typeof s.name=="string"&&!_a(s)}function LP(s){return typeof s=="number"&&Hm(s)}function ei(s){if(!Rt(s))return!1;var o=$r(s);return o==le||o==pe||o==K||o==Ct}function uy(s){return typeof s=="number"&&s==qe(s)}function Ol(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Y}function Rt(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function kt(s){return s!=null&&typeof s=="object"}var hy=nn?Yr(nn):F7;function MP(s,o){return s===o||Yf(s,o,fd(o))}function UP(s,o,l){return l=typeof l=="function"?l:t,Yf(s,o,fd(o),l)}function jP(s){return fy(s)&&s!=+s}function FP(s){if(E$(s))throw new Re(a);return nv(s)}function BP(s){return s===null}function kP(s){return s==null}function fy(s){return typeof s=="number"||kt(s)&&$r(s)==Ke}function _a(s){if(!kt(s)||$r(s)!=ke)return!1;var o=tl(s);if(o===null)return!0;var l=dt.call(o,"constructor")&&o.constructor;return typeof l=="function"&&l instanceof l&&Zc.call(l)==UO}var xd=An?Yr(An):B7;function qP(s){return uy(s)&&s>=-Y&&s<=Y}var dy=oa?Yr(oa):k7;function $l(s){return typeof s=="string"||!Le(s)&&kt(s)&&$r(s)==Ue}function Zr(s){return typeof s=="symbol"||kt(s)&&$r(s)==je}var uo=as?Yr(as):q7;function zP(s){return s===t}function HP(s){return kt(s)&&vr(s)==Ae}function WP(s){return kt(s)&&$r(s)==Fe}var KP=wl(Zf),VP=wl(function(s,o){return s<=o});function py(s){if(!s)return[];if(Br(s))return $l(s)?vn(s):Fr(s);if(ca&&s[ca])return DO(s[ca]());var o=vr(s),l=o==Ce?jf:o==Oe?Gc:ho;return l(s)}function ti(s){if(!s)return s===0?s:0;if(s=hn(s),s===ee||s===-ee){var o=s<0?-1:1;return o*J}return s===s?s:0}function qe(s){var o=ti(s),l=o%1;return o===o?l?o-l:o:0}function gy(s){return s?hs(qe(s),0,ie):0}function hn(s){if(typeof s=="number")return s;if(Zr(s))return Q;if(Rt(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=Rt(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=Nm(s);var l=df.test(s);return l||gf.test(s)?Ne(s.slice(2),l?2:8):ff.test(s)?Q:+s}function my(s){return Tn(s,kr(s))}function GP(s){return s?hs(qe(s),-Y,Y):s===0?s:0}function ft(s){return s==null?"":Jr(s)}var YP=ao(function(s,o){if(wa(o)||Br(o)){Tn(o,cr(o),s);return}for(var l in o)dt.call(o,l)&&da(s,l,o[l])}),vy=ao(function(s,o){Tn(o,kr(o),s)}),Al=ao(function(s,o,l,p){Tn(o,kr(o),s,p)}),JP=ao(function(s,o,l,p){Tn(o,cr(o),s,p)}),ZP=Qn(Hf);function QP(s,o){var l=oo(s);return o==null?l:Ym(l,o)}var XP=Ge(function(s,o){s=wt(s);var l=-1,p=o.length,v=p>2?o[2]:t;for(v&&Ar(o[0],o[1],v)&&(p=1);++l<p;)for(var D=o[l],R=kr(D),M=-1,z=R.length;++M<z;){var te=R[M],re=s[te];(re===t||wn(re,no[te])&&!dt.call(s,te))&&(s[te]=D[te])}return s}),e9=Ge(function(s){return s.push(t,Nv),ar(yy,t,s)});function t9(s,o){return Am(s,_e(o,3),Pn)}function r9(s,o){return Am(s,_e(o,3),Kf)}function n9(s,o){return s==null?s:Wf(s,_e(o,3),kr)}function i9(s,o){return s==null?s:ev(s,_e(o,3),kr)}function s9(s,o){return s&&Pn(s,_e(o,3))}function o9(s,o){return s&&Kf(s,_e(o,3))}function a9(s){return s==null?[]:hl(s,cr(s))}function c9(s){return s==null?[]:hl(s,kr(s))}function Id(s,o,l){var p=s==null?t:fs(s,o);return p===t?l:p}function l9(s,o){return s!=null&&Uv(s,o,T7)}function Dd(s,o){return s!=null&&Uv(s,o,R7)}var u9=$v(function(s,o,l){o!=null&&typeof o.toString!="function"&&(o=Qc.call(o)),s[o]=l},Cd(qr)),h9=$v(function(s,o,l){o!=null&&typeof o.toString!="function"&&(o=Qc.call(o)),dt.call(s,o)?s[o].push(l):s[o]=[l]},_e),f9=Ge(ga);function cr(s){return Br(s)?Vm(s):Jf(s)}function kr(s){return Br(s)?Vm(s,!0):z7(s)}function d9(s,o){var l={};return o=_e(o,3),Pn(s,function(p,v,D){Jn(l,o(p,v,D),p)}),l}function p9(s,o){var l={};return o=_e(o,3),Pn(s,function(p,v,D){Jn(l,v,o(p,v,D))}),l}var g9=ao(function(s,o,l){fl(s,o,l)}),yy=ao(function(s,o,l,p){fl(s,o,l,p)}),m9=Qn(function(s,o){var l={};if(s==null)return l;var p=!1;o=At(o,function(D){return D=Oi(D,s),p||(p=D.length>1),D}),Tn(s,ud(s),l),p&&(l=cn(l,w|y|x,u$));for(var v=o.length;v--;)rd(l,o[v]);return l});function v9(s,o){return wy(s,Cl(_e(o)))}var y9=Qn(function(s,o){return s==null?{}:W7(s,o)});function wy(s,o){if(s==null)return{};var l=At(ud(s),function(p){return[p]});return o=_e(o),uv(s,l,function(p,v){return o(p,v[0])})}function w9(s,o,l){o=Oi(o,s);var p=-1,v=o.length;for(v||(v=1,s=t);++p<v;){var D=s==null?t:s[Rn(o[p])];D===t&&(p=v,D=l),s=ei(D)?D.call(s):D}return s}function b9(s,o,l){return s==null?s:va(s,o,l)}function _9(s,o,l,p){return p=typeof p=="function"?p:t,s==null?s:va(s,o,l,p)}var by=Tv(cr),_y=Tv(kr);function E9(s,o,l){var p=Le(s),v=p||Ai(s)||uo(s);if(o=_e(o,4),l==null){var D=s&&s.constructor;v?l=p?new D:[]:Rt(s)?l=ei(D)?oo(tl(s)):{}:l={}}return(v?sn:Pn)(s,function(R,M,z){return o(l,R,M,z)}),l}function x9(s,o){return s==null?!0:rd(s,o)}function I9(s,o,l){return s==null?s:gv(s,o,sd(l))}function D9(s,o,l,p){return p=typeof p=="function"?p:t,s==null?s:gv(s,o,sd(l),p)}function ho(s){return s==null?[]:Uf(s,cr(s))}function S9(s){return s==null?[]:Uf(s,kr(s))}function C9(s,o,l){return l===t&&(l=o,o=t),l!==t&&(l=hn(l),l=l===l?l:0),o!==t&&(o=hn(o),o=o===o?o:0),hs(hn(s),o,l)}function O9(s,o,l){return o=ti(o),l===t?(l=o,o=0):l=ti(l),s=hn(s),N7(s,o,l)}function $9(s,o,l){if(l&&typeof l!="boolean"&&Ar(s,o,l)&&(o=l=t),l===t&&(typeof o=="boolean"?(l=o,o=t):typeof s=="boolean"&&(l=s,s=t)),s===t&&o===t?(s=0,o=1):(s=ti(s),o===t?(o=s,s=0):o=ti(o)),s>o){var p=s;s=o,o=p}if(l||s%1||o%1){var v=Wm();return mr(s+v*(o-s+vt("1e-"+((v+"").length-1))),o)}return Xf(s,o)}var A9=co(function(s,o,l){return o=o.toLowerCase(),s+(l?Ey(o):o)});function Ey(s){return Sd(ft(s).toLowerCase())}function xy(s){return s=ft(s),s&&s.replace(Kn,bO).replace(Of,"")}function P9(s,o,l){s=ft(s),o=Jr(o);var p=s.length;l=l===t?p:hs(qe(l),0,p);var v=l;return l-=o.length,l>=0&&s.slice(l,v)==o}function T9(s){return s=ft(s),s&&Ot.test(s)?s.replace(rs,_O):s}function R9(s){return s=ft(s),s&&Jt.test(s)?s.replace(jt,"\\$&"):s}var N9=co(function(s,o,l){return s+(l?"-":"")+o.toLowerCase()}),L9=co(function(s,o,l){return s+(l?" ":"")+o.toLowerCase()}),M9=Sv("toLowerCase");function U9(s,o,l){s=ft(s),o=qe(o);var p=o?to(s):0;if(!o||p>=o)return s;var v=(o-p)/2;return yl(sl(v),l)+s+yl(il(v),l)}function j9(s,o,l){s=ft(s),o=qe(o);var p=o?to(s):0;return o&&p<o?s+yl(o-p,l):s}function F9(s,o,l){s=ft(s),o=qe(o);var p=o?to(s):0;return o&&p<o?yl(o-p,l)+s:s}function B9(s,o,l){return l||o==null?o=0:o&&(o=+o),VO(ft(s).replace(Ft,""),o||0)}function k9(s,o,l){return(l?Ar(s,o,l):o===t)?o=1:o=qe(o),ed(ft(s),o)}function q9(){var s=arguments,o=ft(s[0]);return s.length<3?o:o.replace(s[1],s[2])}var z9=co(function(s,o,l){return s+(l?"_":"")+o.toLowerCase()});function H9(s,o,l){return l&&typeof l!="number"&&Ar(s,o,l)&&(o=l=t),l=l===t?ie:l>>>0,l?(s=ft(s),s&&(typeof o=="string"||o!=null&&!xd(o))&&(o=Jr(o),!o&&eo(s))?$i(vn(s),0,l):s.split(o,l)):[]}var W9=co(function(s,o,l){return s+(l?" ":"")+Sd(o)});function K9(s,o,l){return s=ft(s),l=l==null?0:hs(qe(l),0,s.length),o=Jr(o),s.slice(l,l+o.length)==o}function V9(s,o,l){var p=_.templateSettings;l&&Ar(s,o,l)&&(o=t),s=ft(s),o=Al({},o,p,Rv);var v=Al({},o.imports,p.imports,Rv),D=cr(v),R=Uf(v,D),M,z,te=0,re=o.interpolate||Ks,oe="__p += '",fe=Ff((o.escape||Ks).source+"|"+re.source+"|"+(re===Tt?hf:Ks).source+"|"+(o.evaluate||Ks).source+"|$","g"),ve="//# sourceURL="+(dt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$f+"]")+`
69
- `;s.replace(fe,function(De,Qe,st,Qr,Pr,Xr){return st||(st=Qr),oe+=s.slice(te,Xr).replace(vf,EO),Qe&&(M=!0,oe+=`' +
68
+ `)}function w$(s){return Le(s)||ms(s)||!!(zm&&s&&s[zm])}function Xn(s,o){var l=typeof s;return o=o??Y,!!o&&(l=="number"||l!="symbol"&&vf.test(s))&&s>-1&&s%1==0&&s<o}function $r(s,o,l){if(!Nt(l))return!1;var p=typeof o;return(p=="number"?Fr(l)&&Xn(o,l.length):p=="string"&&o in l)?wn(l[o],s):!1}function gd(s,o){if(Le(s))return!1;var l=typeof s;return l=="number"||l=="symbol"||l=="boolean"||s==null||Jr(s)?!0:Gt.test(s)||!At.test(s)||o!=null&&s in bt(o)}function b$(s){var o=typeof s;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?s!=="__proto__":s===null}function md(s){var o=xl(s),l=E[o];if(typeof l!="function"||!(o in tt.prototype))return!1;if(s===l)return!0;var p=fd(l);return!!p&&s===p[0]}function _$(s){return!!Fm&&Fm in s}var E$=Xc?ei:Rd;function xa(s){var o=s&&s.constructor,l=typeof o=="function"&&o.prototype||oo;return s===l}function Fv(s){return s===s&&!Nt(s)}function Bv(s,o){return function(l){return l==null?!1:l[s]===o&&(o!==t||s in bt(l))}}function x$(s){var o=$l(s,function(p){return l.size===h&&l.clear(),p}),l=o.cache;return o}function I$(s,o){var l=s[1],p=o[1],v=l|p,D=v<(j|U|d),R=p==d&&l==T||p==d&&l==b&&s[7].length<=o[8]||p==(d|b)&&o[7].length<=o[8]&&l==T;if(!(D||R))return s;p&j&&(s[2]=o[2],v|=l&j?0:A);var M=o[3];if(M){var z=s[3];s[3]=z?Ev(z,M,o[4]):M,s[4]=z?Ii(s[3],m):o[4]}return M=o[5],M&&(z=s[5],s[5]=z?xv(z,M,o[6]):M,s[6]=z?Ii(s[5],m):o[6]),M=o[7],M&&(s[7]=M),p&d&&(s[8]=s[8]==null?o[8]:gr(s[8],o[8])),s[9]==null&&(s[9]=o[9]),s[0]=o[0],s[1]=v,s}function D$(s){var o=[];if(s!=null)for(var l in bt(s))o.push(l);return o}function S$(s){return tl.call(s)}function kv(s,o,l){return o=nr(o===t?s.length-1:o,0),function(){for(var p=arguments,v=-1,D=nr(p.length-o,0),R=G(D);++v<D;)R[v]=p[o+v];v=-1;for(var M=G(o+1);++v<o;)M[v]=p[v];return M[o]=l(R),ar(s,this,M)}}function qv(s,o){return o.length<2?s:ds(s,un(o,0,-1))}function O$(s,o){for(var l=s.length,p=gr(o.length,l),v=jr(s);p--;){var D=o[p];s[p]=Xn(D,l)?v[D]:t}return s}function vd(s,o){if(!(o==="constructor"&&typeof s[o]=="function")&&o!="__proto__")return s[o]}var zv=Wv(fv),Ia=qC||function(s,o){return it.setTimeout(s,o)},yd=Wv(Z7);function Hv(s,o,l){var p=o+"";return yd(s,y$(p,C$(g$(p),l)))}function Wv(s){var o=0,l=0;return function(){var p=KC(),v=ce-(p-l);if(l=p,v>0){if(++o>=se)return arguments[0]}else o=0;return s.apply(t,arguments)}}function Dl(s,o){var l=-1,p=s.length,v=p-1;for(o=o===t?p:o;++l<o;){var D=ed(l,v),R=s[D];s[D]=s[l],s[l]=R}return s.length=o,s}var Kv=x$(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(Yt,function(l,p,v,D){o.push(v?D.replace(hf,"$1"):p||l)}),o});function Nn(s){if(typeof s=="string"||Jr(s))return s;var o=s+"";return o=="0"&&1/s==-ee?"-0":o}function gs(s){if(s!=null){try{return el.call(s)}catch{}try{return s+""}catch{}}return""}function C$(s,o){return on(xe,function(l){var p="_."+l[0];o&l[1]&&!Yc(s,p)&&s.push(p)}),s.sort()}function Vv(s){if(s instanceof tt)return s.clone();var o=new cn(s.__wrapped__,s.__chain__);return o.__actions__=jr(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}function $$(s,o,l){(l?$r(s,o,l):o===t)?o=1:o=nr(qe(o),0);var p=s==null?0:s.length;if(!p||o<1)return[];for(var v=0,D=0,R=G(al(p/o));v<p;)R[D++]=un(s,v,v+=o);return R}function A$(s){for(var o=-1,l=s==null?0:s.length,p=0,v=[];++o<l;){var D=s[o];D&&(v[p++]=D)}return v}function P$(){var s=arguments.length;if(!s)return[];for(var o=G(s-1),l=arguments[0],p=s;p--;)o[p-1]=arguments[p];return xi(Le(l)?jr(l):[l],fr(o,1))}var T$=Ge(function(s,o){return Kt(s)?ya(s,fr(o,1,Kt,!0)):[]}),R$=Ge(function(s,o){var l=hn(o);return Kt(l)&&(l=t),Kt(s)?ya(s,fr(o,1,Kt,!0),_e(l,2)):[]}),N$=Ge(function(s,o){var l=hn(o);return Kt(l)&&(l=t),Kt(s)?ya(s,fr(o,1,Kt,!0),t,l):[]});function L$(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:qe(o),un(s,o<0?0:o,p)):[]}function M$(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:qe(o),o=p-o,un(s,0,o<0?0:o)):[]}function U$(s,o){return s&&s.length?vl(s,_e(o,3),!0,!0):[]}function j$(s,o){return s&&s.length?vl(s,_e(o,3),!0):[]}function F$(s,o,l,p){var v=s==null?0:s.length;return v?(l&&typeof l!="number"&&$r(s,o,l)&&(l=0,p=v),P7(s,o,l,p)):[]}function Gv(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=l==null?0:qe(l);return v<0&&(v=nr(p+v,0)),Zc(s,_e(o,3),v)}function Yv(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=p-1;return l!==t&&(v=qe(l),v=l<0?nr(p+v,0):gr(v,p-1)),Zc(s,_e(o,3),v,!0)}function Zv(s){var o=s==null?0:s.length;return o?fr(s,1):[]}function B$(s){var o=s==null?0:s.length;return o?fr(s,ee):[]}function k$(s,o){var l=s==null?0:s.length;return l?(o=o===t?1:qe(o),fr(s,o)):[]}function q$(s){for(var o=-1,l=s==null?0:s.length,p={};++o<l;){var v=s[o];p[v[0]]=v[1]}return p}function Jv(s){return s&&s.length?s[0]:t}function z$(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=l==null?0:qe(l);return v<0&&(v=nr(p+v,0)),ro(s,o,v)}function H$(s){var o=s==null?0:s.length;return o?un(s,0,-1):[]}var W$=Ge(function(s){var o=Pt(s,sd);return o.length&&o[0]===s[0]?Yf(o):[]}),K$=Ge(function(s){var o=hn(s),l=Pt(s,sd);return o===hn(l)?o=t:l.pop(),l.length&&l[0]===s[0]?Yf(l,_e(o,2)):[]}),V$=Ge(function(s){var o=hn(s),l=Pt(s,sd);return o=typeof o=="function"?o:t,o&&l.pop(),l.length&&l[0]===s[0]?Yf(l,t,o):[]});function G$(s,o){return s==null?"":HC.call(s,o)}function hn(s){var o=s==null?0:s.length;return o?s[o-1]:t}function Y$(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=p;return l!==t&&(v=qe(l),v=v<0?nr(p+v,0):gr(v,p-1)),o===o?CC(s,o,v):Zc(s,Pm,v,!0)}function Z$(s,o){return s&&s.length?cv(s,qe(o)):t}var J$=Ge(Qv);function Qv(s,o){return s&&s.length&&o&&o.length?Xf(s,o):s}function Q$(s,o,l){return s&&s.length&&o&&o.length?Xf(s,o,_e(l,2)):s}function X$(s,o,l){return s&&s.length&&o&&o.length?Xf(s,o,t,l):s}var eA=Qn(function(s,o){var l=s==null?0:s.length,p=Wf(s,o);return hv(s,Pt(o,function(v){return Xn(v,l)?+v:v}).sort(_v)),p});function tA(s,o){var l=[];if(!(s&&s.length))return l;var p=-1,v=[],D=s.length;for(o=_e(o,3);++p<D;){var R=s[p];o(R,p,s)&&(l.push(R),v.push(p))}return hv(s,v),l}function wd(s){return s==null?s:GC.call(s)}function rA(s,o,l){var p=s==null?0:s.length;return p?(l&&typeof l!="number"&&$r(s,o,l)?(o=0,l=p):(o=o==null?0:qe(o),l=l===t?p:qe(l)),un(s,o,l)):[]}function nA(s,o){return ml(s,o)}function iA(s,o,l){return rd(s,o,_e(l,2))}function sA(s,o){var l=s==null?0:s.length;if(l){var p=ml(s,o);if(p<l&&wn(s[p],o))return p}return-1}function oA(s,o){return ml(s,o,!0)}function aA(s,o,l){return rd(s,o,_e(l,2),!0)}function cA(s,o){var l=s==null?0:s.length;if(l){var p=ml(s,o,!0)-1;if(wn(s[p],o))return p}return-1}function lA(s){return s&&s.length?dv(s):[]}function uA(s,o){return s&&s.length?dv(s,_e(o,2)):[]}function hA(s){var o=s==null?0:s.length;return o?un(s,1,o):[]}function fA(s,o,l){return s&&s.length?(o=l||o===t?1:qe(o),un(s,0,o<0?0:o)):[]}function dA(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:qe(o),o=p-o,un(s,o<0?0:o,p)):[]}function pA(s,o){return s&&s.length?vl(s,_e(o,3),!1,!0):[]}function gA(s,o){return s&&s.length?vl(s,_e(o,3)):[]}var mA=Ge(function(s){return Oi(fr(s,1,Kt,!0))}),vA=Ge(function(s){var o=hn(s);return Kt(o)&&(o=t),Oi(fr(s,1,Kt,!0),_e(o,2))}),yA=Ge(function(s){var o=hn(s);return o=typeof o=="function"?o:t,Oi(fr(s,1,Kt,!0),t,o)});function wA(s){return s&&s.length?Oi(s):[]}function bA(s,o){return s&&s.length?Oi(s,_e(o,2)):[]}function _A(s,o){return o=typeof o=="function"?o:t,s&&s.length?Oi(s,t,o):[]}function bd(s){if(!(s&&s.length))return[];var o=0;return s=Ei(s,function(l){if(Kt(l))return o=nr(l.length,o),!0}),Uf(o,function(l){return Pt(s,Nf(l))})}function Xv(s,o){if(!(s&&s.length))return[];var l=bd(s);return o==null?l:Pt(l,function(p){return ar(o,t,p)})}var EA=Ge(function(s,o){return Kt(s)?ya(s,o):[]}),xA=Ge(function(s){return id(Ei(s,Kt))}),IA=Ge(function(s){var o=hn(s);return Kt(o)&&(o=t),id(Ei(s,Kt),_e(o,2))}),DA=Ge(function(s){var o=hn(s);return o=typeof o=="function"?o:t,id(Ei(s,Kt),t,o)}),SA=Ge(bd);function OA(s,o){return vv(s||[],o||[],va)}function CA(s,o){return vv(s||[],o||[],_a)}var $A=Ge(function(s){var o=s.length,l=o>1?s[o-1]:t;return l=typeof l=="function"?(s.pop(),l):t,Xv(s,l)});function ey(s){var o=E(s);return o.__chain__=!0,o}function AA(s,o){return o(s),s}function Sl(s,o){return o(s)}var PA=Qn(function(s){var o=s.length,l=o?s[0]:0,p=this.__wrapped__,v=function(D){return Wf(D,s)};return o>1||this.__actions__.length||!(p instanceof tt)||!Xn(l)?this.thru(v):(p=p.slice(l,+l+(o?1:0)),p.__actions__.push({func:Sl,args:[v],thisArg:t}),new cn(p,this.__chain__).thru(function(D){return o&&!D.length&&D.push(t),D}))});function TA(){return ey(this)}function RA(){return new cn(this.value(),this.__chain__)}function NA(){this.__values__===t&&(this.__values__=py(this.value()));var s=this.__index__>=this.__values__.length,o=s?t:this.__values__[this.__index__++];return{done:s,value:o}}function LA(){return this}function MA(s){for(var o,l=this;l instanceof hl;){var p=Vv(l);p.__index__=0,p.__values__=t,o?v.__wrapped__=p:o=p;var v=p;l=l.__wrapped__}return v.__wrapped__=s,o}function UA(){var s=this.__wrapped__;if(s instanceof tt){var o=s;return this.__actions__.length&&(o=new tt(this)),o=o.reverse(),o.__actions__.push({func:Sl,args:[wd],thisArg:t}),new cn(o,this.__chain__)}return this.thru(wd)}function jA(){return mv(this.__wrapped__,this.__actions__)}var FA=yl(function(s,o,l){dt.call(s,l)?++s[l]:Zn(s,l,1)});function BA(s,o,l){var p=Le(s)?$m:A7;return l&&$r(s,o,l)&&(o=t),p(s,_e(o,3))}function kA(s,o){var l=Le(s)?Ei:Xm;return l(s,_e(o,3))}var qA=Ov(Gv),zA=Ov(Yv);function HA(s,o){return fr(Ol(s,o),1)}function WA(s,o){return fr(Ol(s,o),ee)}function KA(s,o,l){return l=l===t?1:qe(l),fr(Ol(s,o),l)}function ty(s,o){var l=Le(s)?on:Si;return l(s,_e(o,3))}function ry(s,o){var l=Le(s)?hC:Qm;return l(s,_e(o,3))}var VA=yl(function(s,o,l){dt.call(s,l)?s[l].push(o):Zn(s,l,[o])});function GA(s,o,l,p){s=Fr(s)?s:go(s),l=l&&!p?qe(l):0;var v=s.length;return l<0&&(l=nr(v+l,0)),Tl(s)?l<=v&&s.indexOf(o,l)>-1:!!v&&ro(s,o,l)>-1}var YA=Ge(function(s,o,l){var p=-1,v=typeof o=="function",D=Fr(s)?G(s.length):[];return Si(s,function(R){D[++p]=v?ar(o,R,l):wa(R,o,l)}),D}),ZA=yl(function(s,o,l){Zn(s,l,o)});function Ol(s,o){var l=Le(s)?Pt:sv;return l(s,_e(o,3))}function JA(s,o,l,p){return s==null?[]:(Le(o)||(o=o==null?[]:[o]),l=p?t:l,Le(l)||(l=l==null?[]:[l]),lv(s,o,l))}var QA=yl(function(s,o,l){s[l?0:1].push(o)},function(){return[[],[]]});function XA(s,o,l){var p=Le(s)?Tf:Rm,v=arguments.length<3;return p(s,_e(o,4),l,v,Si)}function eP(s,o,l){var p=Le(s)?fC:Rm,v=arguments.length<3;return p(s,_e(o,4),l,v,Qm)}function tP(s,o){var l=Le(s)?Ei:Xm;return l(s,Al(_e(o,3)))}function rP(s){var o=Le(s)?Gm:G7;return o(s)}function nP(s,o,l){(l?$r(s,o,l):o===t)?o=1:o=qe(o);var p=Le(s)?D7:Y7;return p(s,o)}function iP(s){var o=Le(s)?S7:J7;return o(s)}function sP(s){if(s==null)return 0;if(Fr(s))return Tl(s)?io(s):s.length;var o=mr(s);return o==Oe||o==Ce?s.size:Jf(s).length}function oP(s,o,l){var p=Le(s)?Rf:Q7;return l&&$r(s,o,l)&&(o=t),p(s,_e(o,3))}var aP=Ge(function(s,o){if(s==null)return[];var l=o.length;return l>1&&$r(s,o[0],o[1])?o=[]:l>2&&$r(o[0],o[1],o[2])&&(o=[o[0]]),lv(s,fr(o,1),[])}),Cl=kC||function(){return it.Date.now()};function cP(s,o){if(typeof o!="function")throw new an(c);return s=qe(s),function(){if(--s<1)return o.apply(this,arguments)}}function ny(s,o,l){return o=l?t:o,o=s&&o==null?s.length:o,Jn(s,d,t,t,t,t,o)}function iy(s,o){var l;if(typeof o!="function")throw new an(c);return s=qe(s),function(){return--s>0&&(l=o.apply(this,arguments)),s<=1&&(o=t),l}}var _d=Ge(function(s,o,l){var p=j;if(l.length){var v=Ii(l,fo(_d));p|=$}return Jn(s,p,o,l,v)}),sy=Ge(function(s,o,l){var p=j|U;if(l.length){var v=Ii(l,fo(sy));p|=$}return Jn(o,p,s,l,v)});function oy(s,o,l){o=l?t:o;var p=Jn(s,T,t,t,t,t,t,o);return p.placeholder=oy.placeholder,p}function ay(s,o,l){o=l?t:o;var p=Jn(s,O,t,t,t,t,t,o);return p.placeholder=ay.placeholder,p}function cy(s,o,l){var p,v,D,R,M,z,te=0,re=!1,oe=!1,fe=!0;if(typeof s!="function")throw new an(c);o=fn(o)||0,Nt(l)&&(re=!!l.leading,oe="maxWait"in l,D=oe?nr(fn(l.maxWait)||0,o):D,fe="trailing"in l?!!l.trailing:fe);function ye(Vt){var bn=p,ri=v;return p=v=t,te=Vt,R=s.apply(ri,bn),R}function Ie(Vt){return te=Vt,M=Ia(Qe,o),re?ye(Vt):R}function We(Vt){var bn=Vt-z,ri=Vt-te,Oy=o-bn;return oe?gr(Oy,D-ri):Oy}function De(Vt){var bn=Vt-z,ri=Vt-te;return z===t||bn>=o||bn<0||oe&&ri>=D}function Qe(){var Vt=Cl();if(De(Vt))return st(Vt);M=Ia(Qe,We(Vt))}function st(Vt){return M=t,fe&&p?ye(Vt):(p=v=t,R)}function Qr(){M!==t&&yv(M),te=0,p=z=v=M=t}function Ar(){return M===t?R:st(Cl())}function Xr(){var Vt=Cl(),bn=De(Vt);if(p=arguments,v=this,z=Vt,bn){if(M===t)return Ie(z);if(oe)return yv(M),M=Ia(Qe,o),ye(z)}return M===t&&(M=Ia(Qe,o)),R}return Xr.cancel=Qr,Xr.flush=Ar,Xr}var lP=Ge(function(s,o){return Jm(s,1,o)}),uP=Ge(function(s,o,l){return Jm(s,fn(o)||0,l)});function hP(s){return Jn(s,H)}function $l(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new an(c);var l=function(){var p=arguments,v=o?o.apply(this,p):p[0],D=l.cache;if(D.has(v))return D.get(v);var R=s.apply(this,p);return l.cache=D.set(v,R)||D,R};return l.cache=new($l.Cache||Yn),l}$l.Cache=Yn;function Al(s){if(typeof s!="function")throw new an(c);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function fP(s){return iy(2,s)}var dP=X7(function(s,o){o=o.length==1&&Le(o[0])?Pt(o[0],Yr(_e())):Pt(fr(o,1),Yr(_e()));var l=o.length;return Ge(function(p){for(var v=-1,D=gr(p.length,l);++v<D;)p[v]=o[v].call(this,p[v]);return ar(s,this,p)})}),Ed=Ge(function(s,o){var l=Ii(o,fo(Ed));return Jn(s,$,t,o,l)}),ly=Ge(function(s,o){var l=Ii(o,fo(ly));return Jn(s,x,t,o,l)}),pP=Qn(function(s,o){return Jn(s,b,t,t,t,o)});function gP(s,o){if(typeof s!="function")throw new an(c);return o=o===t?o:qe(o),Ge(s,o)}function mP(s,o){if(typeof s!="function")throw new an(c);return o=o==null?0:nr(qe(o),0),Ge(function(l){var p=l[o],v=$i(l,0,o);return p&&xi(v,p),ar(s,this,v)})}function vP(s,o,l){var p=!0,v=!0;if(typeof s!="function")throw new an(c);return Nt(l)&&(p="leading"in l?!!l.leading:p,v="trailing"in l?!!l.trailing:v),cy(s,o,{leading:p,maxWait:o,trailing:v})}function yP(s){return ny(s,1)}function wP(s,o){return Ed(od(o),s)}function bP(){if(!arguments.length)return[];var s=arguments[0];return Le(s)?s:[s]}function _P(s){return ln(s,_)}function EP(s,o){return o=typeof o=="function"?o:t,ln(s,_,o)}function xP(s){return ln(s,w|_)}function IP(s,o){return o=typeof o=="function"?o:t,ln(s,w|_,o)}function DP(s,o){return o==null||Zm(s,o,cr(o))}function wn(s,o){return s===o||s!==s&&o!==o}var SP=El(Gf),OP=El(function(s,o){return s>=o}),ms=rv(function(){return arguments}())?rv:function(s){return qt(s)&&dt.call(s,"callee")&&!qm.call(s,"callee")},Le=G.isArray,CP=Or?Yr(Or):M7;function Fr(s){return s!=null&&Pl(s.length)&&!ei(s)}function Kt(s){return qt(s)&&Fr(s)}function $P(s){return s===!0||s===!1||qt(s)&&Cr(s)==W}var Ai=zC||Rd,AP=mn?Yr(mn):U7;function PP(s){return qt(s)&&s.nodeType===1&&!Da(s)}function TP(s){if(s==null)return!0;if(Fr(s)&&(Le(s)||typeof s=="string"||typeof s.splice=="function"||Ai(s)||po(s)||ms(s)))return!s.length;var o=mr(s);if(o==Oe||o==Ce)return!s.size;if(xa(s))return!Jf(s).length;for(var l in s)if(dt.call(s,l))return!1;return!0}function RP(s,o){return ba(s,o)}function NP(s,o,l){l=typeof l=="function"?l:t;var p=l?l(s,o):t;return p===t?ba(s,o,t,l):!!p}function xd(s){if(!qt(s))return!1;var o=Cr(s);return o==L||o==g||typeof s.message=="string"&&typeof s.name=="string"&&!Da(s)}function LP(s){return typeof s=="number"&&Hm(s)}function ei(s){if(!Nt(s))return!1;var o=Cr(s);return o==le||o==pe||o==K||o==Ct}function uy(s){return typeof s=="number"&&s==qe(s)}function Pl(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Y}function Nt(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function qt(s){return s!=null&&typeof s=="object"}var hy=sn?Yr(sn):F7;function MP(s,o){return s===o||Zf(s,o,dd(o))}function UP(s,o,l){return l=typeof l=="function"?l:t,Zf(s,o,dd(o),l)}function jP(s){return fy(s)&&s!=+s}function FP(s){if(E$(s))throw new Re(a);return nv(s)}function BP(s){return s===null}function kP(s){return s==null}function fy(s){return typeof s=="number"||qt(s)&&Cr(s)==Ke}function Da(s){if(!qt(s)||Cr(s)!=ke)return!1;var o=il(s);if(o===null)return!0;var l=dt.call(o,"constructor")&&o.constructor;return typeof l=="function"&&l instanceof l&&el.call(l)==UC}var Id=Pn?Yr(Pn):B7;function qP(s){return uy(s)&&s>=-Y&&s<=Y}var dy=ua?Yr(ua):k7;function Tl(s){return typeof s=="string"||!Le(s)&&qt(s)&&Cr(s)==Ue}function Jr(s){return typeof s=="symbol"||qt(s)&&Cr(s)==je}var po=cs?Yr(cs):q7;function zP(s){return s===t}function HP(s){return qt(s)&&mr(s)==Ae}function WP(s){return qt(s)&&Cr(s)==Fe}var KP=El(Qf),VP=El(function(s,o){return s<=o});function py(s){if(!s)return[];if(Fr(s))return Tl(s)?vn(s):jr(s);if(fa&&s[fa])return DC(s[fa]());var o=mr(s),l=o==Oe?Ff:o==Ce?Jc:go;return l(s)}function ti(s){if(!s)return s===0?s:0;if(s=fn(s),s===ee||s===-ee){var o=s<0?-1:1;return o*Z}return s===s?s:0}function qe(s){var o=ti(s),l=o%1;return o===o?l?o-l:o:0}function gy(s){return s?fs(qe(s),0,ie):0}function fn(s){if(typeof s=="number")return s;if(Jr(s))return Q;if(Nt(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=Nt(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=Nm(s);var l=pf.test(s);return l||mf.test(s)?Ne(s.slice(2),l?2:8):df.test(s)?Q:+s}function my(s){return Rn(s,Br(s))}function GP(s){return s?fs(qe(s),-Y,Y):s===0?s:0}function ft(s){return s==null?"":Zr(s)}var YP=uo(function(s,o){if(xa(o)||Fr(o)){Rn(o,cr(o),s);return}for(var l in o)dt.call(o,l)&&va(s,l,o[l])}),vy=uo(function(s,o){Rn(o,Br(o),s)}),Rl=uo(function(s,o,l,p){Rn(o,Br(o),s,p)}),ZP=uo(function(s,o,l,p){Rn(o,cr(o),s,p)}),JP=Qn(Wf);function QP(s,o){var l=lo(s);return o==null?l:Ym(l,o)}var XP=Ge(function(s,o){s=bt(s);var l=-1,p=o.length,v=p>2?o[2]:t;for(v&&$r(o[0],o[1],v)&&(p=1);++l<p;)for(var D=o[l],R=Br(D),M=-1,z=R.length;++M<z;){var te=R[M],re=s[te];(re===t||wn(re,oo[te])&&!dt.call(s,te))&&(s[te]=D[te])}return s}),e9=Ge(function(s){return s.push(t,Nv),ar(yy,t,s)});function t9(s,o){return Am(s,_e(o,3),Tn)}function r9(s,o){return Am(s,_e(o,3),Vf)}function n9(s,o){return s==null?s:Kf(s,_e(o,3),Br)}function i9(s,o){return s==null?s:ev(s,_e(o,3),Br)}function s9(s,o){return s&&Tn(s,_e(o,3))}function o9(s,o){return s&&Vf(s,_e(o,3))}function a9(s){return s==null?[]:pl(s,cr(s))}function c9(s){return s==null?[]:pl(s,Br(s))}function Dd(s,o,l){var p=s==null?t:ds(s,o);return p===t?l:p}function l9(s,o){return s!=null&&Uv(s,o,T7)}function Sd(s,o){return s!=null&&Uv(s,o,R7)}var u9=$v(function(s,o,l){o!=null&&typeof o.toString!="function"&&(o=tl.call(o)),s[o]=l},Cd(kr)),h9=$v(function(s,o,l){o!=null&&typeof o.toString!="function"&&(o=tl.call(o)),dt.call(s,o)?s[o].push(l):s[o]=[l]},_e),f9=Ge(wa);function cr(s){return Fr(s)?Vm(s):Jf(s)}function Br(s){return Fr(s)?Vm(s,!0):z7(s)}function d9(s,o){var l={};return o=_e(o,3),Tn(s,function(p,v,D){Zn(l,o(p,v,D),p)}),l}function p9(s,o){var l={};return o=_e(o,3),Tn(s,function(p,v,D){Zn(l,v,o(p,v,D))}),l}var g9=uo(function(s,o,l){gl(s,o,l)}),yy=uo(function(s,o,l,p){gl(s,o,l,p)}),m9=Qn(function(s,o){var l={};if(s==null)return l;var p=!1;o=Pt(o,function(D){return D=Ci(D,s),p||(p=D.length>1),D}),Rn(s,hd(s),l),p&&(l=ln(l,w|y|_,u$));for(var v=o.length;v--;)nd(l,o[v]);return l});function v9(s,o){return wy(s,Al(_e(o)))}var y9=Qn(function(s,o){return s==null?{}:W7(s,o)});function wy(s,o){if(s==null)return{};var l=Pt(hd(s),function(p){return[p]});return o=_e(o),uv(s,l,function(p,v){return o(p,v[0])})}function w9(s,o,l){o=Ci(o,s);var p=-1,v=o.length;for(v||(v=1,s=t);++p<v;){var D=s==null?t:s[Nn(o[p])];D===t&&(p=v,D=l),s=ei(D)?D.call(s):D}return s}function b9(s,o,l){return s==null?s:_a(s,o,l)}function _9(s,o,l,p){return p=typeof p=="function"?p:t,s==null?s:_a(s,o,l,p)}var by=Tv(cr),_y=Tv(Br);function E9(s,o,l){var p=Le(s),v=p||Ai(s)||po(s);if(o=_e(o,4),l==null){var D=s&&s.constructor;v?l=p?new D:[]:Nt(s)?l=ei(D)?lo(il(s)):{}:l={}}return(v?on:Tn)(s,function(R,M,z){return o(l,R,M,z)}),l}function x9(s,o){return s==null?!0:nd(s,o)}function I9(s,o,l){return s==null?s:gv(s,o,od(l))}function D9(s,o,l,p){return p=typeof p=="function"?p:t,s==null?s:gv(s,o,od(l),p)}function go(s){return s==null?[]:jf(s,cr(s))}function S9(s){return s==null?[]:jf(s,Br(s))}function O9(s,o,l){return l===t&&(l=o,o=t),l!==t&&(l=fn(l),l=l===l?l:0),o!==t&&(o=fn(o),o=o===o?o:0),fs(fn(s),o,l)}function C9(s,o,l){return o=ti(o),l===t?(l=o,o=0):l=ti(l),s=fn(s),N7(s,o,l)}function $9(s,o,l){if(l&&typeof l!="boolean"&&$r(s,o,l)&&(o=l=t),l===t&&(typeof o=="boolean"?(l=o,o=t):typeof s=="boolean"&&(l=s,s=t)),s===t&&o===t?(s=0,o=1):(s=ti(s),o===t?(o=s,s=0):o=ti(o)),s>o){var p=s;s=o,o=p}if(l||s%1||o%1){var v=Wm();return gr(s+v*(o-s+yt("1e-"+((v+"").length-1))),o)}return ed(s,o)}var A9=ho(function(s,o,l){return o=o.toLowerCase(),s+(l?Ey(o):o)});function Ey(s){return Od(ft(s).toLowerCase())}function xy(s){return s=ft(s),s&&s.replace(Kn,bC).replace($f,"")}function P9(s,o,l){s=ft(s),o=Zr(o);var p=s.length;l=l===t?p:fs(qe(l),0,p);var v=l;return l-=o.length,l>=0&&s.slice(l,v)==o}function T9(s){return s=ft(s),s&&$t.test(s)?s.replace(ns,_C):s}function R9(s){return s=ft(s),s&&Zt.test(s)?s.replace(Ft,"\\$&"):s}var N9=ho(function(s,o,l){return s+(l?"-":"")+o.toLowerCase()}),L9=ho(function(s,o,l){return s+(l?" ":"")+o.toLowerCase()}),M9=Sv("toLowerCase");function U9(s,o,l){s=ft(s),o=qe(o);var p=o?io(s):0;if(!o||p>=o)return s;var v=(o-p)/2;return _l(cl(v),l)+s+_l(al(v),l)}function j9(s,o,l){s=ft(s),o=qe(o);var p=o?io(s):0;return o&&p<o?s+_l(o-p,l):s}function F9(s,o,l){s=ft(s),o=qe(o);var p=o?io(s):0;return o&&p<o?_l(o-p,l)+s:s}function B9(s,o,l){return l||o==null?o=0:o&&(o=+o),VC(ft(s).replace(Bt,""),o||0)}function k9(s,o,l){return(l?$r(s,o,l):o===t)?o=1:o=qe(o),td(ft(s),o)}function q9(){var s=arguments,o=ft(s[0]);return s.length<3?o:o.replace(s[1],s[2])}var z9=ho(function(s,o,l){return s+(l?"_":"")+o.toLowerCase()});function H9(s,o,l){return l&&typeof l!="number"&&$r(s,o,l)&&(o=l=t),l=l===t?ie:l>>>0,l?(s=ft(s),s&&(typeof o=="string"||o!=null&&!Id(o))&&(o=Zr(o),!o&&no(s))?$i(vn(s),0,l):s.split(o,l)):[]}var W9=ho(function(s,o,l){return s+(l?" ":"")+Od(o)});function K9(s,o,l){return s=ft(s),l=l==null?0:fs(qe(l),0,s.length),o=Zr(o),s.slice(l,l+o.length)==o}function V9(s,o,l){var p=E.templateSettings;l&&$r(s,o,l)&&(o=t),s=ft(s),o=Rl({},o,p,Rv);var v=Rl({},o.imports,p.imports,Rv),D=cr(v),R=jf(v,D),M,z,te=0,re=o.interpolate||Ys,oe="__p += '",fe=Bf((o.escape||Ys).source+"|"+re.source+"|"+(re===Rt?ff:Ys).source+"|"+(o.evaluate||Ys).source+"|$","g"),ye="//# sourceURL="+(dt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Af+"]")+`
69
+ `;s.replace(fe,function(De,Qe,st,Qr,Ar,Xr){return st||(st=Qr),oe+=s.slice(te,Xr).replace(yf,EC),Qe&&(M=!0,oe+=`' +
70
70
  __e(`+Qe+`) +
71
- '`),Pr&&(z=!0,oe+=`';
72
- `+Pr+`;
71
+ '`),Ar&&(z=!0,oe+=`';
72
+ `+Ar+`;
73
73
  __p += '`),st&&(oe+=`' +
74
74
  ((__t = (`+st+`)) == null ? '' : __t) +
75
75
  '`),te=Xr+De.length,De}),oe+=`';
76
76
  `;var Ie=dt.call(o,"variable")&&o.variable;if(!Ie)oe=`with (obj) {
77
77
  `+oe+`
78
78
  }
79
- `;else if(lf.test(Ie))throw new Re(u);oe=(z?oe.replace(On,""):oe).replace(Cr,"$1").replace(Wn,"$1;"),oe="function("+(Ie||"obj")+`) {
79
+ `;else if(uf.test(Ie))throw new Re(u);oe=(z?oe.replace($n,""):oe).replace(Sr,"$1").replace(Wn,"$1;"),oe="function("+(Ie||"obj")+`) {
80
80
  `+(Ie?"":`obj || (obj = {});
81
81
  `)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(z?`, __j = Array.prototype.join;
82
82
  function print() { __p += __j.call(arguments, '') }
83
83
  `:`;
84
84
  `)+oe+`return __p
85
- }`;var We=Dy(function(){return ut(D,ve+"return "+oe).apply(t,R)});if(We.source=oe,Ed(We))throw We;return We}function G9(s){return ft(s).toLowerCase()}function Y9(s){return ft(s).toUpperCase()}function J9(s,o,l){if(s=ft(s),s&&(l||o===t))return Nm(s);if(!s||!(o=Jr(o)))return s;var p=vn(s),v=vn(o),D=Lm(p,v),R=Mm(p,v)+1;return $i(p,D,R).join("")}function Z9(s,o,l){if(s=ft(s),s&&(l||o===t))return s.slice(0,jm(s)+1);if(!s||!(o=Jr(o)))return s;var p=vn(s),v=Mm(p,vn(o))+1;return $i(p,0,v).join("")}function Q9(s,o,l){if(s=ft(s),s&&(l||o===t))return s.replace(Ft,"");if(!s||!(o=Jr(o)))return s;var p=vn(s),v=Lm(p,vn(o));return $i(p,v).join("")}function X9(s,o){var l=F,p=V;if(Rt(o)){var v="separator"in o?o.separator:v;l="length"in o?qe(o.length):l,p="omission"in o?Jr(o.omission):p}s=ft(s);var D=s.length;if(eo(s)){var R=vn(s);D=R.length}if(l>=D)return s;var M=l-to(p);if(M<1)return p;var z=R?$i(R,0,M).join(""):s.slice(0,M);if(v===t)return z+p;if(R&&(M+=z.length-M),xd(v)){if(s.slice(M).search(v)){var te,re=z;for(v.global||(v=Ff(v.source,ft(rn.exec(v))+"g")),v.lastIndex=0;te=v.exec(re);)var oe=te.index;z=z.slice(0,oe===t?M:oe)}}else if(s.indexOf(Jr(v),M)!=M){var fe=z.lastIndexOf(v);fe>-1&&(z=z.slice(0,fe))}return z+p}function eT(s){return s=ft(s),s&&Lt.test(s)?s.replace(bi,$O):s}var tT=co(function(s,o,l){return s+(l?" ":"")+o.toUpperCase()}),Sd=Sv("toUpperCase");function Iy(s,o,l){return s=ft(s),o=l?t:o,o===t?IO(s)?TO(s):gO(s):s.match(o)||[]}var Dy=Ge(function(s,o){try{return ar(s,t,o)}catch(l){return Ed(l)?l:new Re(l)}}),rT=Qn(function(s,o){return sn(o,function(l){l=Rn(l),Jn(s,l,bd(s[l],s))}),s});function nT(s){var o=s==null?0:s.length,l=_e();return s=o?At(s,function(p){if(typeof p[1]!="function")throw new on(c);return[l(p[0]),p[1]]}):[],Ge(function(p){for(var v=-1;++v<o;){var D=s[v];if(ar(D[0],this,p))return ar(D[1],this,p)}})}function iT(s){return $7(cn(s,w))}function Cd(s){return function(){return s}}function sT(s,o){return s==null||s!==s?o:s}var oT=Ov(),aT=Ov(!0);function qr(s){return s}function Od(s){return iv(typeof s=="function"?s:cn(s,w))}function cT(s){return ov(cn(s,w))}function lT(s,o){return av(s,cn(o,w))}var uT=Ge(function(s,o){return function(l){return ga(l,s,o)}}),hT=Ge(function(s,o){return function(l){return ga(s,l,o)}});function $d(s,o,l){var p=cr(o),v=hl(o,p);l==null&&!(Rt(o)&&(v.length||!p.length))&&(l=o,o=s,s=this,v=hl(o,cr(o)));var D=!(Rt(l)&&"chain"in l)||!!l.chain,R=ei(s);return sn(v,function(M){var z=o[M];s[M]=z,R&&(s.prototype[M]=function(){var te=this.__chain__;if(D||te){var re=s(this.__wrapped__),oe=re.__actions__=Fr(this.__actions__);return oe.push({func:z,args:arguments,thisArg:s}),re.__chain__=te,re}return z.apply(s,xi([this.value()],arguments))})}),s}function fT(){return it._===this&&(it._=jO),this}function Ad(){}function dT(s){return s=qe(s),Ge(function(o){return cv(o,s)})}var pT=ad(At),gT=ad($m),mT=ad(Tf);function Sy(s){return pd(s)?Rf(Rn(s)):K7(s)}function vT(s){return function(o){return s==null?t:fs(s,o)}}var yT=Av(),wT=Av(!0);function Pd(){return[]}function Td(){return!1}function bT(){return{}}function _T(){return""}function ET(){return!0}function xT(s,o){if(s=qe(s),s<1||s>Y)return[];var l=ie,p=mr(s,ie);o=_e(o),s-=ie;for(var v=Mf(p,o);++l<s;)o(l);return v}function IT(s){return Le(s)?At(s,Rn):Zr(s)?[s]:Fr(Kv(ft(s)))}function DT(s){var o=++MO;return ft(s)+o}var ST=vl(function(s,o){return s+o},0),CT=cd("ceil"),OT=vl(function(s,o){return s/o},1),$T=cd("floor");function AT(s){return s&&s.length?ul(s,qr,Vf):t}function PT(s,o){return s&&s.length?ul(s,_e(o,2),Vf):t}function TT(s){return Tm(s,qr)}function RT(s,o){return Tm(s,_e(o,2))}function NT(s){return s&&s.length?ul(s,qr,Zf):t}function LT(s,o){return s&&s.length?ul(s,_e(o,2),Zf):t}var MT=vl(function(s,o){return s*o},1),UT=cd("round"),jT=vl(function(s,o){return s-o},0);function FT(s){return s&&s.length?Lf(s,qr):0}function BT(s,o){return s&&s.length?Lf(s,_e(o,2)):0}return _.after=cP,_.ary=ny,_.assign=YP,_.assignIn=vy,_.assignInWith=Al,_.assignWith=JP,_.at=ZP,_.before=iy,_.bind=bd,_.bindAll=rT,_.bindKey=sy,_.castArray=bP,_.chain=ey,_.chunk=$$,_.compact=A$,_.concat=P$,_.cond=nT,_.conforms=iT,_.constant=Cd,_.countBy=FA,_.create=QP,_.curry=oy,_.curryRight=ay,_.debounce=cy,_.defaults=XP,_.defaultsDeep=e9,_.defer=lP,_.delay=uP,_.difference=T$,_.differenceBy=R$,_.differenceWith=N$,_.drop=L$,_.dropRight=M$,_.dropRightWhile=U$,_.dropWhile=j$,_.fill=F$,_.filter=kA,_.flatMap=HA,_.flatMapDeep=WA,_.flatMapDepth=KA,_.flatten=Jv,_.flattenDeep=B$,_.flattenDepth=k$,_.flip=hP,_.flow=oT,_.flowRight=aT,_.fromPairs=q$,_.functions=a9,_.functionsIn=c9,_.groupBy=VA,_.initial=H$,_.intersection=W$,_.intersectionBy=K$,_.intersectionWith=V$,_.invert=u9,_.invertBy=h9,_.invokeMap=YA,_.iteratee=Od,_.keyBy=JA,_.keys=cr,_.keysIn=kr,_.map=Il,_.mapKeys=d9,_.mapValues=p9,_.matches=cT,_.matchesProperty=lT,_.memoize=Sl,_.merge=g9,_.mergeWith=yy,_.method=uT,_.methodOf=hT,_.mixin=$d,_.negate=Cl,_.nthArg=dT,_.omit=m9,_.omitBy=v9,_.once=fP,_.orderBy=ZA,_.over=pT,_.overArgs=dP,_.overEvery=gT,_.overSome=mT,_.partial=_d,_.partialRight=ly,_.partition=QA,_.pick=y9,_.pickBy=wy,_.property=Sy,_.propertyOf=vT,_.pull=Z$,_.pullAll=Qv,_.pullAllBy=Q$,_.pullAllWith=X$,_.pullAt=eA,_.range=yT,_.rangeRight=wT,_.rearg=pP,_.reject=tP,_.remove=tA,_.rest=gP,_.reverse=yd,_.sampleSize=nP,_.set=b9,_.setWith=_9,_.shuffle=iP,_.slice=rA,_.sortBy=aP,_.sortedUniq=lA,_.sortedUniqBy=uA,_.split=H9,_.spread=mP,_.tail=hA,_.take=fA,_.takeRight=dA,_.takeRightWhile=pA,_.takeWhile=gA,_.tap=AA,_.throttle=vP,_.thru=xl,_.toArray=py,_.toPairs=by,_.toPairsIn=_y,_.toPath=IT,_.toPlainObject=my,_.transform=E9,_.unary=yP,_.union=mA,_.unionBy=vA,_.unionWith=yA,_.uniq=wA,_.uniqBy=bA,_.uniqWith=_A,_.unset=x9,_.unzip=wd,_.unzipWith=Xv,_.update=I9,_.updateWith=D9,_.values=ho,_.valuesIn=S9,_.without=EA,_.words=Iy,_.wrap=wP,_.xor=xA,_.xorBy=IA,_.xorWith=DA,_.zip=SA,_.zipObject=CA,_.zipObjectDeep=OA,_.zipWith=$A,_.entries=by,_.entriesIn=_y,_.extend=vy,_.extendWith=Al,$d(_,_),_.add=ST,_.attempt=Dy,_.camelCase=A9,_.capitalize=Ey,_.ceil=CT,_.clamp=C9,_.clone=_P,_.cloneDeep=xP,_.cloneDeepWith=IP,_.cloneWith=EP,_.conformsTo=DP,_.deburr=xy,_.defaultTo=sT,_.divide=OT,_.endsWith=P9,_.eq=wn,_.escape=T9,_.escapeRegExp=R9,_.every=BA,_.find=qA,_.findIndex=Gv,_.findKey=t9,_.findLast=zA,_.findLastIndex=Yv,_.findLastKey=r9,_.floor=$T,_.forEach=ty,_.forEachRight=ry,_.forIn=n9,_.forInRight=i9,_.forOwn=s9,_.forOwnRight=o9,_.get=Id,_.gt=SP,_.gte=CP,_.has=l9,_.hasIn=Dd,_.head=Zv,_.identity=qr,_.includes=GA,_.indexOf=z$,_.inRange=O9,_.invoke=f9,_.isArguments=gs,_.isArray=Le,_.isArrayBuffer=OP,_.isArrayLike=Br,_.isArrayLikeObject=Kt,_.isBoolean=$P,_.isBuffer=Ai,_.isDate=AP,_.isElement=PP,_.isEmpty=TP,_.isEqual=RP,_.isEqualWith=NP,_.isError=Ed,_.isFinite=LP,_.isFunction=ei,_.isInteger=uy,_.isLength=Ol,_.isMap=hy,_.isMatch=MP,_.isMatchWith=UP,_.isNaN=jP,_.isNative=FP,_.isNil=kP,_.isNull=BP,_.isNumber=fy,_.isObject=Rt,_.isObjectLike=kt,_.isPlainObject=_a,_.isRegExp=xd,_.isSafeInteger=qP,_.isSet=dy,_.isString=$l,_.isSymbol=Zr,_.isTypedArray=uo,_.isUndefined=zP,_.isWeakMap=HP,_.isWeakSet=WP,_.join=G$,_.kebabCase=N9,_.last=un,_.lastIndexOf=Y$,_.lowerCase=L9,_.lowerFirst=M9,_.lt=KP,_.lte=VP,_.max=AT,_.maxBy=PT,_.mean=TT,_.meanBy=RT,_.min=NT,_.minBy=LT,_.stubArray=Pd,_.stubFalse=Td,_.stubObject=bT,_.stubString=_T,_.stubTrue=ET,_.multiply=MT,_.nth=J$,_.noConflict=fT,_.noop=Ad,_.now=Dl,_.pad=U9,_.padEnd=j9,_.padStart=F9,_.parseInt=B9,_.random=$9,_.reduce=XA,_.reduceRight=eP,_.repeat=k9,_.replace=q9,_.result=w9,_.round=UT,_.runInContext=q,_.sample=rP,_.size=sP,_.snakeCase=z9,_.some=oP,_.sortedIndex=nA,_.sortedIndexBy=iA,_.sortedIndexOf=sA,_.sortedLastIndex=oA,_.sortedLastIndexBy=aA,_.sortedLastIndexOf=cA,_.startCase=W9,_.startsWith=K9,_.subtract=jT,_.sum=FT,_.sumBy=BT,_.template=V9,_.times=xT,_.toFinite=ti,_.toInteger=qe,_.toLength=gy,_.toLower=G9,_.toNumber=hn,_.toSafeInteger=GP,_.toString=ft,_.toUpper=Y9,_.trim=J9,_.trimEnd=Z9,_.trimStart=Q9,_.truncate=X9,_.unescape=eT,_.uniqueId=DT,_.upperCase=tT,_.upperFirst=Sd,_.each=ty,_.eachRight=ry,_.first=Zv,$d(_,function(){var s={};return Pn(_,function(o,l){dt.call(_.prototype,l)||(s[l]=o)}),s}(),{chain:!1}),_.VERSION=n,sn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){_[s].placeholder=_}),sn(["drop","take"],function(s,o){tt.prototype[s]=function(l){l=l===t?1:nr(qe(l),0);var p=this.__filtered__&&!o?new tt(this):this.clone();return p.__filtered__?p.__takeCount__=mr(l,p.__takeCount__):p.__views__.push({size:mr(l,ie),type:s+(p.__dir__<0?"Right":"")}),p},tt.prototype[s+"Right"]=function(l){return this.reverse()[s](l).reverse()}}),sn(["filter","map","takeWhile"],function(s,o){var l=o+1,p=l==I||l==X;tt.prototype[s]=function(v){var D=this.clone();return D.__iteratees__.push({iteratee:_e(v,3),type:l}),D.__filtered__=D.__filtered__||p,D}}),sn(["head","last"],function(s,o){var l="take"+(o?"Right":"");tt.prototype[s]=function(){return this[l](1).value()[0]}}),sn(["initial","tail"],function(s,o){var l="drop"+(o?"":"Right");tt.prototype[s]=function(){return this.__filtered__?new tt(this):this[l](1)}}),tt.prototype.compact=function(){return this.filter(qr)},tt.prototype.find=function(s){return this.filter(s).head()},tt.prototype.findLast=function(s){return this.reverse().find(s)},tt.prototype.invokeMap=Ge(function(s,o){return typeof s=="function"?new tt(this):this.map(function(l){return ga(l,s,o)})}),tt.prototype.reject=function(s){return this.filter(Cl(_e(s)))},tt.prototype.slice=function(s,o){s=qe(s);var l=this;return l.__filtered__&&(s>0||o<0)?new tt(l):(s<0?l=l.takeRight(-s):s&&(l=l.drop(s)),o!==t&&(o=qe(o),l=o<0?l.dropRight(-o):l.take(o-s)),l)},tt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},tt.prototype.toArray=function(){return this.take(ie)},Pn(tt.prototype,function(s,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),p=/^(?:head|last)$/.test(o),v=_[p?"take"+(o=="last"?"Right":""):o],D=p||/^find/.test(o);v&&(_.prototype[o]=function(){var R=this.__wrapped__,M=p?[1]:arguments,z=R instanceof tt,te=M[0],re=z||Le(R),oe=function(Qe){var st=v.apply(_,xi([Qe],M));return p&&fe?st[0]:st};re&&l&&typeof te=="function"&&te.length!=1&&(z=re=!1);var fe=this.__chain__,ve=!!this.__actions__.length,Ie=D&&!fe,We=z&&!ve;if(!D&&re){R=We?R:new tt(this);var De=s.apply(R,M);return De.__actions__.push({func:xl,args:[oe],thisArg:t}),new an(De,fe)}return Ie&&We?s.apply(this,M):(De=this.thru(oe),Ie?p?De.value()[0]:De.value():De)})}),sn(["pop","push","shift","sort","splice","unshift"],function(s){var o=Yc[s],l=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",p=/^(?:pop|shift)$/.test(s);_.prototype[s]=function(){var v=arguments;if(p&&!this.__chain__){var D=this.value();return o.apply(Le(D)?D:[],v)}return this[l](function(R){return o.apply(Le(R)?R:[],v)})}}),Pn(tt.prototype,function(s,o){var l=_[o];if(l){var p=l.name+"";dt.call(so,p)||(so[p]=[]),so[p].push({name:o,func:l})}}),so[ml(t,j).name]=[{name:"wrapper",func:t}],tt.prototype.clone=e7,tt.prototype.reverse=t7,tt.prototype.value=r7,_.prototype.at=PA,_.prototype.chain=TA,_.prototype.commit=RA,_.prototype.next=NA,_.prototype.plant=MA,_.prototype.reverse=UA,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=jA,_.prototype.first=_.prototype.head,ca&&(_.prototype[ca]=LA),_},ro=RO();Wt?((Wt.exports=ro)._=ro,yt._=ro):it._=ro}).call(Mo)})(Vu,Vu.exports);var ex=Object.defineProperty,tx=Object.defineProperties,rx=Object.getOwnPropertyDescriptors,W1=Object.getOwnPropertySymbols,nx=Object.prototype.hasOwnProperty,ix=Object.prototype.propertyIsEnumerable,K1=(r,e,t)=>e in r?ex(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ya=(r,e)=>{for(var t in e||(e={}))nx.call(e,t)&&K1(r,t,e[t]);if(W1)for(var t of W1(e))ix.call(e,t)&&K1(r,t,e[t]);return r},sx=(r,e)=>tx(r,rx(e));function ai(r,e,t){var n;const i=J2(r);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${X8}?chainId=${i.namespace}:${i.reference}&projectId=${t}`}function qi(r){return r.includes(":")?r.split(":")[1]:r}function V1(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function ox(r,e){const t=Object.keys(e.namespaces).filter(i=>i.includes(r));if(!t.length)return[];const n=[];return t.forEach(i=>{const a=e.namespaces[i].accounts;n.push(...a)}),n}function G1(r={},e={}){const t=Y1(r),n=Y1(e);return Vu.exports.merge(t,n)}function Y1(r){var e,t,n,i;const a={};if(!xo(r))return a;for(const[c,u]of Object.entries(r)){const f=lu(c)?[c]:u.chains,h=u.methods||[],m=u.events||[],w=u.rpcMap||{},y=Eo(c);a[y]=sx(Ya(Ya({},a[y]),u),{chains:au(f,(e=a[y])==null?void 0:e.chains),methods:au(h,(t=a[y])==null?void 0:t.methods),events:au(m,(n=a[y])==null?void 0:n.events),rpcMap:Ya(Ya({},w),(i=a[y])==null?void 0:i.rpcMap)})}return a}function ax(r){return r.includes(":")?r.split(":")[2]:r}function cx(r){const e={};for(const[t,n]of Object.entries(r)){const i=n.methods||[],a=n.events||[],c=n.accounts||[],u=lu(t)?[t]:n.chains?n.chains:V1(n.accounts);e[t]={chains:u,methods:i,events:a,accounts:c}}return e}function Gu(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const J1={},Dt=r=>J1[r],Yu=(r,e)=>{J1[r]=e};class lx{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=qi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class ux{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("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,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(kn.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,t){const n=t||ai(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=parseInt(qi(t));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,n;let i=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);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(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. 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 hx{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.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(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=qi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class fx{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=qi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class dx{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const n=this.getCardanoRPCUrl(t),i=qi(t);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class px{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.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(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=qi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class gx{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.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(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=qi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class mx{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("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,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||ai(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;e[t]=this.createHttpProvider(t,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace);return typeof n>"u"?void 0:new Un(new oi(n,Dt("disableProviderPing")))}}var vx=Object.defineProperty,yx=Object.defineProperties,wx=Object.getOwnPropertyDescriptors,Z1=Object.getOwnPropertySymbols,bx=Object.prototype.hasOwnProperty,_x=Object.prototype.propertyIsEnumerable,Q1=(r,e,t)=>e in r?vx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ja=(r,e)=>{for(var t in e||(e={}))bx.call(e,t)&&Q1(r,t,e[t]);if(Z1)for(var t of Z1(e))_x.call(e,t)&&Q1(r,t,e[t]);return r},Ju=(r,e)=>yx(r,wx(e));class Zu{constructor(e){this.events=new lr.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:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||z1})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new Zu(e);return await t.initialize(),t}async request(e,t,n){const[i,a]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:Ja({},e),chainId:`${i}:${a}`,topic:this.session.topic,expiry:n})}sendAsync(e,t,n,i){const a=new Date().getTime();this.request(e,n,i).then(c=>t(null,za(a,c))).catch(c=>t(c,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:It("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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=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(a=>{this.session=a;const c=cx(a.namespaces);this.namespaces=G1(this.namespaces,c),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==U1)throw a;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,t)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(En(t)){for(const n of t)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: ${t.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 Wu.init({logger:this.providerOpts.logger||z1,relayUrl:this.providerOpts.relayUrl||J8,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(t=>Eo(t)))];Yu("client",this.client),Yu("events",this.events),Yu("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const n=ox(t,this.session),i=V1(n),a=G1(this.namespaces,this.optionalNamespaces),c=Ju(Ja({},a[t]),{accounts:n,chains:i});switch(t){case"eip155":this.rpcProviders[t]=new ux({namespace:c});break;case"solana":this.rpcProviders[t]=new hx({namespace:c});break;case"cosmos":this.rpcProviders[t]=new fx({namespace:c});break;case"polkadot":this.rpcProviders[t]=new lx({namespace:c});break;case"cip34":this.rpcProviders[t]=new dx({namespace:c});break;case"elrond":this.rpcProviders[t]=new px({namespace:c});break;case"multiversx":this.rpcProviders[t]=new gx({namespace:c});break;case"near":this.rpcProviders[t]=new mx({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:t}=e,{event:n}=t;if(n.name==="accountsChanged"){const i=n.data;i&&En(i)&&this.events.emit("accountsChanged",i.map(ax))}else if(n.name==="chainChanged"){const i=t.chainId,a=t.event.data,c=Eo(i),u=Gu(i)!==Gu(a)?`${c}:${Gu(a)}`:i;this.onChainChanged(u)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var n;const{namespaces:i}=t,a=(n=this.client)==null?void 0:n.session.get(e);this.session=Ju(Ja({},a),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Ju(Ja({},It("USER_DISCONNECTED")),{data:e.topic}))}),this.on(kn.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 t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:n,sessionProperties:i}=e;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(e){const[t,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map(c=>Eo(c)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const i=Eo(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(t||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,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,t){this.client.core.storage.setItem(`${H1}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${H1}/${e}`)}}const Ex=Zu,xx="wc",Ix="ethereum_provider",Dx=`${xx}@2:${Ix}:`,Sx="https://rpc.walletconnect.com/v1/",Za=["eth_sendTransaction","personal_sign"],X1=["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"],Qa=["chainChanged","accountsChanged"],eg=["chainChanged","accountsChanged","message","disconnect","connect"];var Cx=Object.defineProperty,Ox=Object.defineProperties,$x=Object.getOwnPropertyDescriptors,tg=Object.getOwnPropertySymbols,Ax=Object.prototype.hasOwnProperty,Px=Object.prototype.propertyIsEnumerable,rg=(r,e,t)=>e in r?Cx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Uo=(r,e)=>{for(var t in e||(e={}))Ax.call(e,t)&&rg(r,t,e[t]);if(tg)for(var t of tg(e))Px.call(e,t)&&rg(r,t,e[t]);return r},ng=(r,e)=>Ox(r,$x(e));function Xa(r){return Number(r[0].split(":")[1])}function Qu(r){return`0x${r.toString(16)}`}function Tx(r){const{chains:e,optionalChains:t,methods:n,optionalMethods:i,events:a,optionalEvents:c,rpcMap:u}=r;if(!En(e))throw new Error("Invalid chains");const f={chains:e,methods:n||Za,events:a||Qa,rpcMap:Uo({},e.length?{[Xa(e)]:u[Xa(e)]}:{})},h=a?.filter(x=>!Qa.includes(x)),m=n?.filter(x=>!Za.includes(x));if(!t&&!c&&!i&&!(h!=null&&h.length)&&!(m!=null&&m.length))return{required:e.length?f:void 0};const w=h?.length&&m?.length||!t,y={chains:[...new Set(w?f.chains.concat(t||[]):t)],methods:[...new Set(f.methods.concat(i!=null&&i.length?i:X1))],events:[...new Set(f.events.concat(c!=null&&c.length?c:eg))],rpcMap:u};return{required:e.length?f:void 0,optional:t.length?y:void 0}}class ec{constructor(){this.events=new lr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Dx,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new ec;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,n){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),n)}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:t,optional:n}=Tx(this.rpc);try{const i=await new Promise(async(c,u)=>{var f;this.rpc.showQrModal&&((f=this.modal)==null||f.subscribeModal(h=>{!h.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),u(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(ng(Uo({namespaces:Uo({},t&&{[this.namespace]:t})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(h=>{c(h)}).catch(h=>{u(new Error(h.message))})});if(!i)return;const a=Z2(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Qu(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:t}=e,{event:n}=t;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 t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Qu(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",ng(Uo({},It("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,n;this.rpc.showQrModal&&((t=this.modal)==null||t.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 t=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",Qu(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,n,i]=e.split(":");return{chainId:`${t}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,n;const i=(t=e?.chains)!=null?t:[],a=(n=e?.optionalChains)!=null?n:[],c=i.concat(a);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const u=i.length?e?.methods||Za:[],f=i.length?e?.events||Qa:[],h=e?.optionalMethods||[],m=e?.optionalEvents||[],w=e?.rpcMap||this.buildRpcMap(c,e.projectId),y=e?.qrModalOptions||void 0;return{chains:i?.map(x=>this.formatChainId(x)),optionalChains:a.map(x=>this.formatChainId(x)),methods:u,events:f,optionalMethods:h,optionalEvents:m,rpcMap:w,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:y,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,t)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Xa(this.rpc.chains):Xa(this.rpc.optionalChains),this.signer=await Ex.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 t;try{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return tI});t=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Uo({projectId:this.rpc.projectId},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:t,optionalChains:n,rpcMap:i}=e;t&&En(t)&&(this.rpc.chains=t.map(a=>this.formatChainId(a)),t.forEach(a=>{this.rpc.rpcMap[a]=i?.[a]||this.getRpcUrl(a)})),n&&En(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(a=>this.formatChainId(a)),n.forEach(a=>{this.rpc.rpcMap[a]=i?.[a]||this.getRpcUrl(a)}))}getRpcUrl(e,t){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${Sx}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.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(t=>this.parseAccount(t))}}const Rx=ec,Nx=Symbol(),ig=Object.getPrototypeOf,Xu=new WeakMap,Lx=r=>r&&(Xu.has(r)?Xu.get(r):ig(r)===Object.prototype||ig(r)===Array.prototype),Mx=r=>Lx(r)&&r[Nx]||null,sg=(r,e=!0)=>{Xu.set(r,e)},eh=r=>typeof r=="object"&&r!==null,ci=new WeakMap,tc=new WeakSet,Ux=(r=Object.is,e=(h,m)=>new Proxy(h,m),t=h=>eh(h)&&!tc.has(h)&&(Array.isArray(h)||!(Symbol.iterator in h))&&!(h instanceof WeakMap)&&!(h instanceof WeakSet)&&!(h instanceof Error)&&!(h instanceof Number)&&!(h instanceof Date)&&!(h instanceof String)&&!(h instanceof RegExp)&&!(h instanceof ArrayBuffer),n=h=>{switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:throw h}},i=new WeakMap,a=(h,m,w=n)=>{const y=i.get(h);if(y?.[0]===m)return y[1];const x=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return sg(x,!0),i.set(h,[m,x]),Reflect.ownKeys(h).forEach(S=>{if(Object.getOwnPropertyDescriptor(x,S))return;const P=Reflect.get(h,S),U={value:P,enumerable:!0,configurable:!0};if(tc.has(P))sg(P,!1);else if(P instanceof Promise)delete U.value,U.get=()=>w(P);else if(ci.has(P)){const[j,A]=ci.get(P);U.value=a(j,A(),w)}Object.defineProperty(x,S,U)}),Object.preventExtensions(x)},c=new WeakMap,u=[1,1],f=h=>{if(!eh(h))throw new Error("object required");const m=c.get(h);if(m)return m;let w=u[0];const y=new Set,x=(H,F=++u[0])=>{w!==F&&(w=F,y.forEach(V=>V(H,F)))};let S=u[1];const P=(H=++u[1])=>(S!==H&&!y.size&&(S=H,j.forEach(([F])=>{const V=F[1](H);V>w&&(w=V)})),w),U=H=>(F,V)=>{const se=[...F];se[1]=[H,...se[1]],x(se,V)},j=new Map,A=(H,F)=>{if(j.has(H))throw new Error("prop listener already exists");if(y.size){const V=F[3](U(H));j.set(H,[F,V])}else j.set(H,[F])},T=H=>{var F;const V=j.get(H);V&&(j.delete(H),(F=V[1])==null||F.call(V))},C=H=>(y.add(H),y.size===1&&j.forEach(([V,se],ce)=>{if(se)throw new Error("remove already exists");const I=V[3](U(ce));j.set(ce,[V,I])}),()=>{y.delete(H),y.size===0&&j.forEach(([V,se],ce)=>{se&&(se(),j.set(ce,[V]))})}),$=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h)),d=e($,{deleteProperty(H,F){const V=Reflect.get(H,F);T(F);const se=Reflect.deleteProperty(H,F);return se&&x(["delete",[F],V]),se},set(H,F,V,se){const ce=Reflect.has(H,F),I=Reflect.get(H,F,se);if(ce&&(r(I,V)||c.has(V)&&r(I,c.get(V))))return!0;T(F),eh(V)&&(V=Mx(V)||V);let N=V;if(V instanceof Promise)V.then(X=>{V.status="fulfilled",V.value=X,x(["resolve",[F],X])}).catch(X=>{V.status="rejected",V.reason=X,x(["reject",[F],X])});else{!ci.has(V)&&t(V)&&(N=f(V));const X=!tc.has(N)&&ci.get(N);X&&A(F,X)}return Reflect.set(H,F,N,se),x(["set",[F],V,I]),!0}});c.set(h,d);const b=[$,P,a,C];return ci.set(d,b),Reflect.ownKeys(h).forEach(H=>{const F=Object.getOwnPropertyDescriptor(h,H);"value"in F&&(d[H]=h[H],delete F.value,delete F.writable),Object.defineProperty($,H,F)}),d})=>[f,ci,tc,r,e,t,n,i,a,c,u],[jx]=Ux();function li(r={}){return jx(r)}function zi(r,e,t){const n=ci.get(r);n||console.warn("Please use proxy object");let i;const a=[],c=n[3];let u=!1;const h=c(m=>{if(a.push(m),t){e(a.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(a.splice(0))}))});return u=!0,()=>{u=!1,h()}}function Fx(r,e){const t=ci.get(r);t||console.warn("Please use proxy object");const[n,i,a]=t;return a(n,i(),e)}const or=li({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Pt={state:or,subscribe(r){return zi(or,()=>r(or))},push(r,e){r!==or.view&&(or.view=r,e&&(or.data=e),or.history.push(r))},reset(r){or.view=r,or.history=[r]},replace(r){or.history.length>1&&(or.history[or.history.length-1]=r,or.view=r)},goBack(){if(or.history.length>1){or.history.pop();const[r]=or.history.slice(-1);or.view=r}},setData(r){or.data=r}},we={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",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 we.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const r=navigator.userAgent.toLowerCase();return we.isMobile()&&(r.includes("iphone")||r.includes("ipad"))},isHttpUrl(r){return r.startsWith("http://")||r.startsWith("https://")},isArray(r){return Array.isArray(r)&&r.length>0},formatNativeUrl(r,e,t){if(we.isHttpUrl(r))return this.formatUniversalUrl(r,e,t);let n=r;n.includes("://")||(n=r.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,t);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(r,e,t){if(!we.isHttpUrl(r))return this.formatNativeUrl(r,e,t);let n=r;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,t);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(r){return new Promise(e=>{setTimeout(e,r)})},openHref(r,e){window.open(r,e,"noreferrer noopener")},setWalletConnectDeepLink(r,e){try{localStorage.setItem(we.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:r,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(r){try{const[e]=r.split("?");localStorage.setItem(we.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(we.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(we.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var r;const e=(r=Pt.state.data)==null?void 0:r.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},Bx=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),gr=li({enabled:Bx,userSessionId:"",events:[],connectedWalletId:void 0}),og={state:gr,subscribe(r){return zi(gr.events,()=>r(Fx(gr.events[gr.events.length-1])))},initialize(){gr.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(gr.userSessionId=crypto.randomUUID())},setConnectedWalletId(r){gr.connectedWalletId=r},click(r){if(gr.enabled){const e={type:"CLICK",name:r.name,userSessionId:gr.userSessionId,timestamp:Date.now(),data:r};gr.events.push(e)}},track(r){if(gr.enabled){const e={type:"TRACK",name:r.name,userSessionId:gr.userSessionId,timestamp:Date.now(),data:r};gr.events.push(e)}},view(r){if(gr.enabled){const e={type:"VIEW",name:r.name,userSessionId:gr.userSessionId,timestamp:Date.now(),data:r};gr.events.push(e)}}},In=li({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),zt={state:In,subscribe(r){return zi(In,()=>r(In))},setChains(r){In.chains=r},setWalletConnectUri(r){In.walletConnectUri=r},setIsCustomDesktop(r){In.isCustomDesktop=r},setIsCustomMobile(r){In.isCustomMobile=r},setIsDataLoaded(r){In.isDataLoaded=r},setIsUiLoaded(r){In.isUiLoaded=r},setIsAuth(r){In.isAuth=r}},rc=li({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Kr={state:rc,subscribe(r){return zi(rc,()=>r(rc))},setConfig(r){var e,t;og.initialize(),zt.setChains(r.chains),zt.setIsAuth(!!r.enableAuthMode),zt.setIsCustomMobile(!!((e=r.mobileWallets)!=null&&e.length)),zt.setIsCustomDesktop(!!((t=r.desktopWallets)!=null&&t.length)),we.setModalVersionInStorage(),Object.assign(rc,r)}};var kx=Object.defineProperty,ag=Object.getOwnPropertySymbols,qx=Object.prototype.hasOwnProperty,zx=Object.prototype.propertyIsEnumerable,cg=(r,e,t)=>e in r?kx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Hx=(r,e)=>{for(var t in e||(e={}))qx.call(e,t)&&cg(r,t,e[t]);if(ag)for(var t of ag(e))zx.call(e,t)&&cg(r,t,e[t]);return r};const th="https://explorer-api.walletconnect.com",rh="wcm",nh="js-2.6.2";async function nc(r,e){const t=Hx({sdkType:rh,sdkVersion:nh},e),n=new URL(r,th);return n.searchParams.append("projectId",Kr.state.projectId),Object.entries(t).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const Hi={async getDesktopListings(r){return nc("/w3m/v1/getDesktopListings",r)},async getMobileListings(r){return nc("/w3m/v1/getMobileListings",r)},async getInjectedListings(r){return nc("/w3m/v1/getInjectedListings",r)},async getAllListings(r){return nc("/w3m/v1/getAllListings",r)},getWalletImageUrl(r){return`${th}/w3m/v1/getWalletImage/${r}?projectId=${Kr.state.projectId}&sdkType=${rh}&sdkVersion=${nh}`},getAssetImageUrl(r){return`${th}/w3m/v1/getAssetImage/${r}?projectId=${Kr.state.projectId}&sdkType=${rh}&sdkVersion=${nh}`}};var Wx=Object.defineProperty,lg=Object.getOwnPropertySymbols,Kx=Object.prototype.hasOwnProperty,Vx=Object.prototype.propertyIsEnumerable,ug=(r,e,t)=>e in r?Wx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Gx=(r,e)=>{for(var t in e||(e={}))Kx.call(e,t)&&ug(r,t,e[t]);if(lg)for(var t of lg(e))Vx.call(e,t)&&ug(r,t,e[t]);return r};const hg=we.isMobile(),Dn=li({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Lr={state:Dn,async getRecomendedWallets(){const{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:e}=Kr.state;if(r==="NONE"||e==="ALL"&&!r)return Dn.recomendedWallets;if(we.isArray(r)){const t={recommendedIds:r.join(",")},{listings:n}=await Hi.getAllListings(t),i=Object.values(n);i.sort((a,c)=>{const u=r.indexOf(a.id),f=r.indexOf(c.id);return u-f}),Dn.recomendedWallets=i}else{const{chains:t,isAuth:n}=zt.state,i=t?.join(","),a=we.isArray(e),c={page:1,sdks:n?"auth_v1":void 0,entries:we.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:u}=hg?await Hi.getMobileListings(c):await Hi.getDesktopListings(c);Dn.recomendedWallets=Object.values(u)}return Dn.recomendedWallets},async getWallets(r){const e=Gx({},r),{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:n}=Kr.state,{recomendedWallets:i}=Dn;if(n==="ALL")return Dn.wallets;i.length?e.excludedIds=i.map(w=>w.id).join(","):we.isArray(t)&&(e.excludedIds=t.join(",")),we.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),zt.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:c}=r,{listings:u,total:f}=hg?await Hi.getMobileListings(e):await Hi.getDesktopListings(e),h=Object.values(u),m=c?"search":"wallets";return Dn[m]={listings:[...Dn[m].listings,...h],total:f,page:a??1},{listings:h,total:f}},getWalletImageUrl(r){return Hi.getWalletImageUrl(r)},getAssetImageUrl(r){return Hi.getAssetImageUrl(r)},resetSearch(){Dn.search={listings:[],total:0,page:1}}},$s=li({open:!1}),Wi={state:$s,subscribe(r){return zi($s,()=>r($s))},async open(r){return new Promise(e=>{const{isUiLoaded:t,isDataLoaded:n}=zt.state;if(we.removeWalletConnectDeepLink(),zt.setWalletConnectUri(r?.uri),zt.setChains(r?.chains),Pt.reset("ConnectWallet"),t&&n)$s.open=!0,e();else{const i=setInterval(()=>{const a=zt.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),$s.open=!0,e())},200)}})},close(){$s.open=!1}};var Yx=Object.defineProperty,fg=Object.getOwnPropertySymbols,Jx=Object.prototype.hasOwnProperty,Zx=Object.prototype.propertyIsEnumerable,dg=(r,e,t)=>e in r?Yx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Qx=(r,e)=>{for(var t in e||(e={}))Jx.call(e,t)&&dg(r,t,e[t]);if(fg)for(var t of fg(e))Zx.call(e,t)&&dg(r,t,e[t]);return r};function Xx(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const jo=li({themeMode:Xx()?"dark":"light"}),ui={state:jo,subscribe(r){return zi(jo,()=>r(jo))},setThemeConfig(r){const{themeMode:e,themeVariables:t}=r;e&&(jo.themeMode=e),t&&(jo.themeVariables=Qx({},t))}},Ki=li({open:!1,message:"",variant:"success"}),hi={state:Ki,subscribe(r){return zi(Ki,()=>r(Ki))},openToast(r,e){Ki.open=!0,Ki.message=r,Ki.variant=e},closeToast(){Ki.open=!1}};class eI{constructor(e){this.openModal=Wi.open,this.closeModal=Wi.close,this.subscribeModal=Wi.subscribe,this.setTheme=ui.setThemeConfig,ui.setThemeConfig(e),Kr.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return lO});const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),zt.setIsUiLoaded(!0)}}}var tI=Object.freeze({__proto__:null,WalletConnectModal:eI});/**
85
+ }`;var We=Dy(function(){return ut(D,ye+"return "+oe).apply(t,R)});if(We.source=oe,xd(We))throw We;return We}function G9(s){return ft(s).toLowerCase()}function Y9(s){return ft(s).toUpperCase()}function Z9(s,o,l){if(s=ft(s),s&&(l||o===t))return Nm(s);if(!s||!(o=Zr(o)))return s;var p=vn(s),v=vn(o),D=Lm(p,v),R=Mm(p,v)+1;return $i(p,D,R).join("")}function J9(s,o,l){if(s=ft(s),s&&(l||o===t))return s.slice(0,jm(s)+1);if(!s||!(o=Zr(o)))return s;var p=vn(s),v=Mm(p,vn(o))+1;return $i(p,0,v).join("")}function Q9(s,o,l){if(s=ft(s),s&&(l||o===t))return s.replace(Bt,"");if(!s||!(o=Zr(o)))return s;var p=vn(s),v=Lm(p,vn(o));return $i(p,v).join("")}function X9(s,o){var l=F,p=V;if(Nt(o)){var v="separator"in o?o.separator:v;l="length"in o?qe(o.length):l,p="omission"in o?Zr(o.omission):p}s=ft(s);var D=s.length;if(no(s)){var R=vn(s);D=R.length}if(l>=D)return s;var M=l-io(p);if(M<1)return p;var z=R?$i(R,0,M).join(""):s.slice(0,M);if(v===t)return z+p;if(R&&(M+=z.length-M),Id(v)){if(s.slice(M).search(v)){var te,re=z;for(v.global||(v=Bf(v.source,ft(nn.exec(v))+"g")),v.lastIndex=0;te=v.exec(re);)var oe=te.index;z=z.slice(0,oe===t?M:oe)}}else if(s.indexOf(Zr(v),M)!=M){var fe=z.lastIndexOf(v);fe>-1&&(z=z.slice(0,fe))}return z+p}function eT(s){return s=ft(s),s&&Mt.test(s)?s.replace(bi,$C):s}var tT=ho(function(s,o,l){return s+(l?" ":"")+o.toUpperCase()}),Od=Sv("toUpperCase");function Iy(s,o,l){return s=ft(s),o=l?t:o,o===t?IC(s)?TC(s):gC(s):s.match(o)||[]}var Dy=Ge(function(s,o){try{return ar(s,t,o)}catch(l){return xd(l)?l:new Re(l)}}),rT=Qn(function(s,o){return on(o,function(l){l=Nn(l),Zn(s,l,_d(s[l],s))}),s});function nT(s){var o=s==null?0:s.length,l=_e();return s=o?Pt(s,function(p){if(typeof p[1]!="function")throw new an(c);return[l(p[0]),p[1]]}):[],Ge(function(p){for(var v=-1;++v<o;){var D=s[v];if(ar(D[0],this,p))return ar(D[1],this,p)}})}function iT(s){return $7(ln(s,w))}function Cd(s){return function(){return s}}function sT(s,o){return s==null||s!==s?o:s}var oT=Cv(),aT=Cv(!0);function kr(s){return s}function $d(s){return iv(typeof s=="function"?s:ln(s,w))}function cT(s){return ov(ln(s,w))}function lT(s,o){return av(s,ln(o,w))}var uT=Ge(function(s,o){return function(l){return wa(l,s,o)}}),hT=Ge(function(s,o){return function(l){return wa(s,l,o)}});function Ad(s,o,l){var p=cr(o),v=pl(o,p);l==null&&!(Nt(o)&&(v.length||!p.length))&&(l=o,o=s,s=this,v=pl(o,cr(o)));var D=!(Nt(l)&&"chain"in l)||!!l.chain,R=ei(s);return on(v,function(M){var z=o[M];s[M]=z,R&&(s.prototype[M]=function(){var te=this.__chain__;if(D||te){var re=s(this.__wrapped__),oe=re.__actions__=jr(this.__actions__);return oe.push({func:z,args:arguments,thisArg:s}),re.__chain__=te,re}return z.apply(s,xi([this.value()],arguments))})}),s}function fT(){return it._===this&&(it._=jC),this}function Pd(){}function dT(s){return s=qe(s),Ge(function(o){return cv(o,s)})}var pT=cd(Pt),gT=cd($m),mT=cd(Rf);function Sy(s){return gd(s)?Nf(Nn(s)):K7(s)}function vT(s){return function(o){return s==null?t:ds(s,o)}}var yT=Av(),wT=Av(!0);function Td(){return[]}function Rd(){return!1}function bT(){return{}}function _T(){return""}function ET(){return!0}function xT(s,o){if(s=qe(s),s<1||s>Y)return[];var l=ie,p=gr(s,ie);o=_e(o),s-=ie;for(var v=Uf(p,o);++l<s;)o(l);return v}function IT(s){return Le(s)?Pt(s,Nn):Jr(s)?[s]:jr(Kv(ft(s)))}function DT(s){var o=++MC;return ft(s)+o}var ST=bl(function(s,o){return s+o},0),OT=ld("ceil"),CT=bl(function(s,o){return s/o},1),$T=ld("floor");function AT(s){return s&&s.length?dl(s,kr,Gf):t}function PT(s,o){return s&&s.length?dl(s,_e(o,2),Gf):t}function TT(s){return Tm(s,kr)}function RT(s,o){return Tm(s,_e(o,2))}function NT(s){return s&&s.length?dl(s,kr,Qf):t}function LT(s,o){return s&&s.length?dl(s,_e(o,2),Qf):t}var MT=bl(function(s,o){return s*o},1),UT=ld("round"),jT=bl(function(s,o){return s-o},0);function FT(s){return s&&s.length?Mf(s,kr):0}function BT(s,o){return s&&s.length?Mf(s,_e(o,2)):0}return E.after=cP,E.ary=ny,E.assign=YP,E.assignIn=vy,E.assignInWith=Rl,E.assignWith=ZP,E.at=JP,E.before=iy,E.bind=_d,E.bindAll=rT,E.bindKey=sy,E.castArray=bP,E.chain=ey,E.chunk=$$,E.compact=A$,E.concat=P$,E.cond=nT,E.conforms=iT,E.constant=Cd,E.countBy=FA,E.create=QP,E.curry=oy,E.curryRight=ay,E.debounce=cy,E.defaults=XP,E.defaultsDeep=e9,E.defer=lP,E.delay=uP,E.difference=T$,E.differenceBy=R$,E.differenceWith=N$,E.drop=L$,E.dropRight=M$,E.dropRightWhile=U$,E.dropWhile=j$,E.fill=F$,E.filter=kA,E.flatMap=HA,E.flatMapDeep=WA,E.flatMapDepth=KA,E.flatten=Zv,E.flattenDeep=B$,E.flattenDepth=k$,E.flip=hP,E.flow=oT,E.flowRight=aT,E.fromPairs=q$,E.functions=a9,E.functionsIn=c9,E.groupBy=VA,E.initial=H$,E.intersection=W$,E.intersectionBy=K$,E.intersectionWith=V$,E.invert=u9,E.invertBy=h9,E.invokeMap=YA,E.iteratee=$d,E.keyBy=ZA,E.keys=cr,E.keysIn=Br,E.map=Ol,E.mapKeys=d9,E.mapValues=p9,E.matches=cT,E.matchesProperty=lT,E.memoize=$l,E.merge=g9,E.mergeWith=yy,E.method=uT,E.methodOf=hT,E.mixin=Ad,E.negate=Al,E.nthArg=dT,E.omit=m9,E.omitBy=v9,E.once=fP,E.orderBy=JA,E.over=pT,E.overArgs=dP,E.overEvery=gT,E.overSome=mT,E.partial=Ed,E.partialRight=ly,E.partition=QA,E.pick=y9,E.pickBy=wy,E.property=Sy,E.propertyOf=vT,E.pull=J$,E.pullAll=Qv,E.pullAllBy=Q$,E.pullAllWith=X$,E.pullAt=eA,E.range=yT,E.rangeRight=wT,E.rearg=pP,E.reject=tP,E.remove=tA,E.rest=gP,E.reverse=wd,E.sampleSize=nP,E.set=b9,E.setWith=_9,E.shuffle=iP,E.slice=rA,E.sortBy=aP,E.sortedUniq=lA,E.sortedUniqBy=uA,E.split=H9,E.spread=mP,E.tail=hA,E.take=fA,E.takeRight=dA,E.takeRightWhile=pA,E.takeWhile=gA,E.tap=AA,E.throttle=vP,E.thru=Sl,E.toArray=py,E.toPairs=by,E.toPairsIn=_y,E.toPath=IT,E.toPlainObject=my,E.transform=E9,E.unary=yP,E.union=mA,E.unionBy=vA,E.unionWith=yA,E.uniq=wA,E.uniqBy=bA,E.uniqWith=_A,E.unset=x9,E.unzip=bd,E.unzipWith=Xv,E.update=I9,E.updateWith=D9,E.values=go,E.valuesIn=S9,E.without=EA,E.words=Iy,E.wrap=wP,E.xor=xA,E.xorBy=IA,E.xorWith=DA,E.zip=SA,E.zipObject=OA,E.zipObjectDeep=CA,E.zipWith=$A,E.entries=by,E.entriesIn=_y,E.extend=vy,E.extendWith=Rl,Ad(E,E),E.add=ST,E.attempt=Dy,E.camelCase=A9,E.capitalize=Ey,E.ceil=OT,E.clamp=O9,E.clone=_P,E.cloneDeep=xP,E.cloneDeepWith=IP,E.cloneWith=EP,E.conformsTo=DP,E.deburr=xy,E.defaultTo=sT,E.divide=CT,E.endsWith=P9,E.eq=wn,E.escape=T9,E.escapeRegExp=R9,E.every=BA,E.find=qA,E.findIndex=Gv,E.findKey=t9,E.findLast=zA,E.findLastIndex=Yv,E.findLastKey=r9,E.floor=$T,E.forEach=ty,E.forEachRight=ry,E.forIn=n9,E.forInRight=i9,E.forOwn=s9,E.forOwnRight=o9,E.get=Dd,E.gt=SP,E.gte=OP,E.has=l9,E.hasIn=Sd,E.head=Jv,E.identity=kr,E.includes=GA,E.indexOf=z$,E.inRange=C9,E.invoke=f9,E.isArguments=ms,E.isArray=Le,E.isArrayBuffer=CP,E.isArrayLike=Fr,E.isArrayLikeObject=Kt,E.isBoolean=$P,E.isBuffer=Ai,E.isDate=AP,E.isElement=PP,E.isEmpty=TP,E.isEqual=RP,E.isEqualWith=NP,E.isError=xd,E.isFinite=LP,E.isFunction=ei,E.isInteger=uy,E.isLength=Pl,E.isMap=hy,E.isMatch=MP,E.isMatchWith=UP,E.isNaN=jP,E.isNative=FP,E.isNil=kP,E.isNull=BP,E.isNumber=fy,E.isObject=Nt,E.isObjectLike=qt,E.isPlainObject=Da,E.isRegExp=Id,E.isSafeInteger=qP,E.isSet=dy,E.isString=Tl,E.isSymbol=Jr,E.isTypedArray=po,E.isUndefined=zP,E.isWeakMap=HP,E.isWeakSet=WP,E.join=G$,E.kebabCase=N9,E.last=hn,E.lastIndexOf=Y$,E.lowerCase=L9,E.lowerFirst=M9,E.lt=KP,E.lte=VP,E.max=AT,E.maxBy=PT,E.mean=TT,E.meanBy=RT,E.min=NT,E.minBy=LT,E.stubArray=Td,E.stubFalse=Rd,E.stubObject=bT,E.stubString=_T,E.stubTrue=ET,E.multiply=MT,E.nth=Z$,E.noConflict=fT,E.noop=Pd,E.now=Cl,E.pad=U9,E.padEnd=j9,E.padStart=F9,E.parseInt=B9,E.random=$9,E.reduce=XA,E.reduceRight=eP,E.repeat=k9,E.replace=q9,E.result=w9,E.round=UT,E.runInContext=q,E.sample=rP,E.size=sP,E.snakeCase=z9,E.some=oP,E.sortedIndex=nA,E.sortedIndexBy=iA,E.sortedIndexOf=sA,E.sortedLastIndex=oA,E.sortedLastIndexBy=aA,E.sortedLastIndexOf=cA,E.startCase=W9,E.startsWith=K9,E.subtract=jT,E.sum=FT,E.sumBy=BT,E.template=V9,E.times=xT,E.toFinite=ti,E.toInteger=qe,E.toLength=gy,E.toLower=G9,E.toNumber=fn,E.toSafeInteger=GP,E.toString=ft,E.toUpper=Y9,E.trim=Z9,E.trimEnd=J9,E.trimStart=Q9,E.truncate=X9,E.unescape=eT,E.uniqueId=DT,E.upperCase=tT,E.upperFirst=Od,E.each=ty,E.eachRight=ry,E.first=Jv,Ad(E,function(){var s={};return Tn(E,function(o,l){dt.call(E.prototype,l)||(s[l]=o)}),s}(),{chain:!1}),E.VERSION=n,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){E[s].placeholder=E}),on(["drop","take"],function(s,o){tt.prototype[s]=function(l){l=l===t?1:nr(qe(l),0);var p=this.__filtered__&&!o?new tt(this):this.clone();return p.__filtered__?p.__takeCount__=gr(l,p.__takeCount__):p.__views__.push({size:gr(l,ie),type:s+(p.__dir__<0?"Right":"")}),p},tt.prototype[s+"Right"]=function(l){return this.reverse()[s](l).reverse()}}),on(["filter","map","takeWhile"],function(s,o){var l=o+1,p=l==I||l==X;tt.prototype[s]=function(v){var D=this.clone();return D.__iteratees__.push({iteratee:_e(v,3),type:l}),D.__filtered__=D.__filtered__||p,D}}),on(["head","last"],function(s,o){var l="take"+(o?"Right":"");tt.prototype[s]=function(){return this[l](1).value()[0]}}),on(["initial","tail"],function(s,o){var l="drop"+(o?"":"Right");tt.prototype[s]=function(){return this.__filtered__?new tt(this):this[l](1)}}),tt.prototype.compact=function(){return this.filter(kr)},tt.prototype.find=function(s){return this.filter(s).head()},tt.prototype.findLast=function(s){return this.reverse().find(s)},tt.prototype.invokeMap=Ge(function(s,o){return typeof s=="function"?new tt(this):this.map(function(l){return wa(l,s,o)})}),tt.prototype.reject=function(s){return this.filter(Al(_e(s)))},tt.prototype.slice=function(s,o){s=qe(s);var l=this;return l.__filtered__&&(s>0||o<0)?new tt(l):(s<0?l=l.takeRight(-s):s&&(l=l.drop(s)),o!==t&&(o=qe(o),l=o<0?l.dropRight(-o):l.take(o-s)),l)},tt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},tt.prototype.toArray=function(){return this.take(ie)},Tn(tt.prototype,function(s,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),p=/^(?:head|last)$/.test(o),v=E[p?"take"+(o=="last"?"Right":""):o],D=p||/^find/.test(o);v&&(E.prototype[o]=function(){var R=this.__wrapped__,M=p?[1]:arguments,z=R instanceof tt,te=M[0],re=z||Le(R),oe=function(Qe){var st=v.apply(E,xi([Qe],M));return p&&fe?st[0]:st};re&&l&&typeof te=="function"&&te.length!=1&&(z=re=!1);var fe=this.__chain__,ye=!!this.__actions__.length,Ie=D&&!fe,We=z&&!ye;if(!D&&re){R=We?R:new tt(this);var De=s.apply(R,M);return De.__actions__.push({func:Sl,args:[oe],thisArg:t}),new cn(De,fe)}return Ie&&We?s.apply(this,M):(De=this.thru(oe),Ie?p?De.value()[0]:De.value():De)})}),on(["pop","push","shift","sort","splice","unshift"],function(s){var o=Qc[s],l=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",p=/^(?:pop|shift)$/.test(s);E.prototype[s]=function(){var v=arguments;if(p&&!this.__chain__){var D=this.value();return o.apply(Le(D)?D:[],v)}return this[l](function(R){return o.apply(Le(R)?R:[],v)})}}),Tn(tt.prototype,function(s,o){var l=E[o];if(l){var p=l.name+"";dt.call(co,p)||(co[p]=[]),co[p].push({name:o,func:l})}}),co[wl(t,U).name]=[{name:"wrapper",func:t}],tt.prototype.clone=e7,tt.prototype.reverse=t7,tt.prototype.value=r7,E.prototype.at=PA,E.prototype.chain=TA,E.prototype.commit=RA,E.prototype.next=NA,E.prototype.plant=MA,E.prototype.reverse=UA,E.prototype.toJSON=E.prototype.valueOf=E.prototype.value=jA,E.prototype.first=E.prototype.head,fa&&(E.prototype[fa]=LA),E},so=RC();Wt?((Wt.exports=so)._=so,wt._=so):it._=so}).call(Bo)})(Gu,Gu.exports);var ex=Object.defineProperty,tx=Object.defineProperties,rx=Object.getOwnPropertyDescriptors,W1=Object.getOwnPropertySymbols,nx=Object.prototype.hasOwnProperty,ix=Object.prototype.propertyIsEnumerable,K1=(r,e,t)=>e in r?ex(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Qa=(r,e)=>{for(var t in e||(e={}))nx.call(e,t)&&K1(r,t,e[t]);if(W1)for(var t of W1(e))ix.call(e,t)&&K1(r,t,e[t]);return r},sx=(r,e)=>tx(r,rx(e));function ai(r,e,t){var n;const i=Z2(r);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${X8}?chainId=${i.namespace}:${i.reference}&projectId=${t}`}function zi(r){return r.includes(":")?r.split(":")[1]:r}function V1(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function ox(r,e){const t=Object.keys(e.namespaces).filter(i=>i.includes(r));if(!t.length)return[];const n=[];return t.forEach(i=>{const a=e.namespaces[i].accounts;n.push(...a)}),n}function G1(r={},e={}){const t=Y1(r),n=Y1(e);return Gu.exports.merge(t,n)}function Y1(r){var e,t,n,i;const a={};if(!Oo(r))return a;for(const[c,u]of Object.entries(r)){const f=hu(c)?[c]:u.chains,h=u.methods||[],m=u.events||[],w=u.rpcMap||{},y=So(c);a[y]=sx(Qa(Qa({},a[y]),u),{chains:lu(f,(e=a[y])==null?void 0:e.chains),methods:lu(h,(t=a[y])==null?void 0:t.methods),events:lu(m,(n=a[y])==null?void 0:n.events),rpcMap:Qa(Qa({},w),(i=a[y])==null?void 0:i.rpcMap)})}return a}function ax(r){return r.includes(":")?r.split(":")[2]:r}function cx(r){const e={};for(const[t,n]of Object.entries(r)){const i=n.methods||[],a=n.events||[],c=n.accounts||[],u=hu(t)?[t]:n.chains?n.chains:V1(n.accounts);e[t]={chains:u,methods:i,events:a,accounts:c}}return e}function Yu(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const Z1={},St=r=>Z1[r],Zu=(r,e)=>{Z1[r]=e};class lx{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=St("events"),this.client=St("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=zi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new jn(new oi(n,St("disableProviderPing")))}}class ux{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=St("events"),this.client=St("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,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(kn.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,t){const n=t||ai(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new jn(new oi(n,St("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=parseInt(zi(t));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,n;let i=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);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(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. 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 hx{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=St("events"),this.client=St("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.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(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=zi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new jn(new oi(n,St("disableProviderPing")))}}class fx{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=St("events"),this.client=St("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=zi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new jn(new oi(n,St("disableProviderPing")))}}class dx{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=St("events"),this.client=St("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const n=this.getCardanoRPCUrl(t),i=zi(t);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new jn(new oi(n,St("disableProviderPing")))}}class px{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=St("events"),this.client=St("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.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(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=zi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new jn(new oi(n,St("disableProviderPing")))}}class gx{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=St("events"),this.client=St("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,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.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(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=zi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new jn(new oi(n,St("disableProviderPing")))}}class mx{constructor(e){this.name="near",this.namespace=e.namespace,this.events=St("events"),this.client=St("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,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||ai(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;e[t]=this.createHttpProvider(t,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace);return typeof n>"u"?void 0:new jn(new oi(n,St("disableProviderPing")))}}var vx=Object.defineProperty,yx=Object.defineProperties,wx=Object.getOwnPropertyDescriptors,J1=Object.getOwnPropertySymbols,bx=Object.prototype.hasOwnProperty,_x=Object.prototype.propertyIsEnumerable,Q1=(r,e,t)=>e in r?vx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Xa=(r,e)=>{for(var t in e||(e={}))bx.call(e,t)&&Q1(r,t,e[t]);if(J1)for(var t of J1(e))_x.call(e,t)&&Q1(r,t,e[t]);return r},Ju=(r,e)=>yx(r,wx(e));class Qu{constructor(e){this.events=new lr.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:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||z1})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new Qu(e);return await t.initialize(),t}async request(e,t,n){const[i,a]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:Xa({},e),chainId:`${i}:${a}`,topic:this.session.topic,expiry:n})}sendAsync(e,t,n,i){const a=new Date().getTime();this.request(e,n,i).then(c=>t(null,Ka(a,c))).catch(c=>t(c,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:xt("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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=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(a=>{this.session=a;const c=cx(a.namespaces);this.namespaces=G1(this.namespaces,c),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==U1)throw a;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,t)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(En(t)){for(const n of t)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: ${t.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 Ku.init({logger:this.providerOpts.logger||z1,relayUrl:this.providerOpts.relayUrl||Z8,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(t=>So(t)))];Zu("client",this.client),Zu("events",this.events),Zu("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const n=ox(t,this.session),i=V1(n),a=G1(this.namespaces,this.optionalNamespaces),c=Ju(Xa({},a[t]),{accounts:n,chains:i});switch(t){case"eip155":this.rpcProviders[t]=new ux({namespace:c});break;case"solana":this.rpcProviders[t]=new hx({namespace:c});break;case"cosmos":this.rpcProviders[t]=new fx({namespace:c});break;case"polkadot":this.rpcProviders[t]=new lx({namespace:c});break;case"cip34":this.rpcProviders[t]=new dx({namespace:c});break;case"elrond":this.rpcProviders[t]=new px({namespace:c});break;case"multiversx":this.rpcProviders[t]=new gx({namespace:c});break;case"near":this.rpcProviders[t]=new mx({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:t}=e,{event:n}=t;if(n.name==="accountsChanged"){const i=n.data;i&&En(i)&&this.events.emit("accountsChanged",i.map(ax))}else if(n.name==="chainChanged"){const i=t.chainId,a=t.event.data,c=So(i),u=Yu(i)!==Yu(a)?`${c}:${Yu(a)}`:i;this.onChainChanged(u)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var n;const{namespaces:i}=t,a=(n=this.client)==null?void 0:n.session.get(e);this.session=Ju(Xa({},a),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Ju(Xa({},xt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(kn.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 t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:n,sessionProperties:i}=e;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(e){const[t,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map(c=>So(c)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const i=So(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(t||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,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,t){this.client.core.storage.setItem(`${H1}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${H1}/${e}`)}}const Ex=Qu,xx="wc",Ix="ethereum_provider",Dx=`${xx}@2:${Ix}:`,Sx="https://rpc.walletconnect.com/v1/",ec=["eth_sendTransaction","personal_sign"],X1=["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"],tc=["chainChanged","accountsChanged"],eg=["chainChanged","accountsChanged","message","disconnect","connect"];var Ox=Object.defineProperty,Cx=Object.defineProperties,$x=Object.getOwnPropertyDescriptors,tg=Object.getOwnPropertySymbols,Ax=Object.prototype.hasOwnProperty,Px=Object.prototype.propertyIsEnumerable,rg=(r,e,t)=>e in r?Ox(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ko=(r,e)=>{for(var t in e||(e={}))Ax.call(e,t)&&rg(r,t,e[t]);if(tg)for(var t of tg(e))Px.call(e,t)&&rg(r,t,e[t]);return r},ng=(r,e)=>Cx(r,$x(e));function rc(r){return Number(r[0].split(":")[1])}function Xu(r){return`0x${r.toString(16)}`}function Tx(r){const{chains:e,optionalChains:t,methods:n,optionalMethods:i,events:a,optionalEvents:c,rpcMap:u}=r;if(!En(e))throw new Error("Invalid chains");const f={chains:e,methods:n||ec,events:a||tc,rpcMap:ko({},e.length?{[rc(e)]:u[rc(e)]}:{})},h=a?.filter(_=>!tc.includes(_)),m=n?.filter(_=>!ec.includes(_));if(!t&&!c&&!i&&!(h!=null&&h.length)&&!(m!=null&&m.length))return{required:e.length?f:void 0};const w=h?.length&&m?.length||!t,y={chains:[...new Set(w?f.chains.concat(t||[]):t)],methods:[...new Set(f.methods.concat(i!=null&&i.length?i:X1))],events:[...new Set(f.events.concat(c!=null&&c.length?c:eg))],rpcMap:u};return{required:e.length?f:void 0,optional:t.length?y:void 0}}class nc{constructor(){this.events=new lr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Dx,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new nc;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,n){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),n)}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:t,optional:n}=Tx(this.rpc);try{const i=await new Promise(async(c,u)=>{var f;this.rpc.showQrModal&&((f=this.modal)==null||f.subscribeModal(h=>{!h.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),u(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(ng(ko({namespaces:ko({},t&&{[this.namespace]:t})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(h=>{c(h)}).catch(h=>{u(new Error(h.message))})});if(!i)return;const a=J2(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Xu(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:t}=e,{event:n}=t;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 t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Xu(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",ng(ko({},xt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,n;this.rpc.showQrModal&&((t=this.modal)==null||t.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 t=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",Xu(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,n,i]=e.split(":");return{chainId:`${t}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,n;const i=(t=e?.chains)!=null?t:[],a=(n=e?.optionalChains)!=null?n:[],c=i.concat(a);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const u=i.length?e?.methods||ec:[],f=i.length?e?.events||tc:[],h=e?.optionalMethods||[],m=e?.optionalEvents||[],w=e?.rpcMap||this.buildRpcMap(c,e.projectId),y=e?.qrModalOptions||void 0;return{chains:i?.map(_=>this.formatChainId(_)),optionalChains:a.map(_=>this.formatChainId(_)),methods:u,events:f,optionalMethods:h,optionalEvents:m,rpcMap:w,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:y,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,t)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?rc(this.rpc.chains):rc(this.rpc.optionalChains),this.signer=await Ex.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 t;try{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return tI});t=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(ko({projectId:this.rpc.projectId},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:t,optionalChains:n,rpcMap:i}=e;t&&En(t)&&(this.rpc.chains=t.map(a=>this.formatChainId(a)),t.forEach(a=>{this.rpc.rpcMap[a]=i?.[a]||this.getRpcUrl(a)})),n&&En(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(a=>this.formatChainId(a)),n.forEach(a=>{this.rpc.rpcMap[a]=i?.[a]||this.getRpcUrl(a)}))}getRpcUrl(e,t){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${Sx}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.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(t=>this.parseAccount(t))}}const Rx=nc,Nx=Symbol(),ig=Object.getPrototypeOf,eh=new WeakMap,Lx=r=>r&&(eh.has(r)?eh.get(r):ig(r)===Object.prototype||ig(r)===Array.prototype),Mx=r=>Lx(r)&&r[Nx]||null,sg=(r,e=!0)=>{eh.set(r,e)},th=r=>typeof r=="object"&&r!==null,ci=new WeakMap,ic=new WeakSet,Ux=(r=Object.is,e=(h,m)=>new Proxy(h,m),t=h=>th(h)&&!ic.has(h)&&(Array.isArray(h)||!(Symbol.iterator in h))&&!(h instanceof WeakMap)&&!(h instanceof WeakSet)&&!(h instanceof Error)&&!(h instanceof Number)&&!(h instanceof Date)&&!(h instanceof String)&&!(h instanceof RegExp)&&!(h instanceof ArrayBuffer),n=h=>{switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:throw h}},i=new WeakMap,a=(h,m,w=n)=>{const y=i.get(h);if(y?.[0]===m)return y[1];const _=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return sg(_,!0),i.set(h,[m,_]),Reflect.ownKeys(h).forEach(S=>{if(Object.getOwnPropertyDescriptor(_,S))return;const P=Reflect.get(h,S),j={value:P,enumerable:!0,configurable:!0};if(ic.has(P))sg(P,!1);else if(P instanceof Promise)delete j.value,j.get=()=>w(P);else if(ci.has(P)){const[U,A]=ci.get(P);j.value=a(U,A(),w)}Object.defineProperty(_,S,j)}),Object.preventExtensions(_)},c=new WeakMap,u=[1,1],f=h=>{if(!th(h))throw new Error("object required");const m=c.get(h);if(m)return m;let w=u[0];const y=new Set,_=(H,F=++u[0])=>{w!==F&&(w=F,y.forEach(V=>V(H,F)))};let S=u[1];const P=(H=++u[1])=>(S!==H&&!y.size&&(S=H,U.forEach(([F])=>{const V=F[1](H);V>w&&(w=V)})),w),j=H=>(F,V)=>{const se=[...F];se[1]=[H,...se[1]],_(se,V)},U=new Map,A=(H,F)=>{if(U.has(H))throw new Error("prop listener already exists");if(y.size){const V=F[3](j(H));U.set(H,[F,V])}else U.set(H,[F])},T=H=>{var F;const V=U.get(H);V&&(U.delete(H),(F=V[1])==null||F.call(V))},O=H=>(y.add(H),y.size===1&&U.forEach(([V,se],ce)=>{if(se)throw new Error("remove already exists");const I=V[3](j(ce));U.set(ce,[V,I])}),()=>{y.delete(H),y.size===0&&U.forEach(([V,se],ce)=>{se&&(se(),U.set(ce,[V]))})}),$=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h)),d=e($,{deleteProperty(H,F){const V=Reflect.get(H,F);T(F);const se=Reflect.deleteProperty(H,F);return se&&_(["delete",[F],V]),se},set(H,F,V,se){const ce=Reflect.has(H,F),I=Reflect.get(H,F,se);if(ce&&(r(I,V)||c.has(V)&&r(I,c.get(V))))return!0;T(F),th(V)&&(V=Mx(V)||V);let N=V;if(V instanceof Promise)V.then(X=>{V.status="fulfilled",V.value=X,_(["resolve",[F],X])}).catch(X=>{V.status="rejected",V.reason=X,_(["reject",[F],X])});else{!ci.has(V)&&t(V)&&(N=f(V));const X=!ic.has(N)&&ci.get(N);X&&A(F,X)}return Reflect.set(H,F,N,se),_(["set",[F],V,I]),!0}});c.set(h,d);const b=[$,P,a,O];return ci.set(d,b),Reflect.ownKeys(h).forEach(H=>{const F=Object.getOwnPropertyDescriptor(h,H);"value"in F&&(d[H]=h[H],delete F.value,delete F.writable),Object.defineProperty($,H,F)}),d})=>[f,ci,ic,r,e,t,n,i,a,c,u],[jx]=Ux();function li(r={}){return jx(r)}function Hi(r,e,t){const n=ci.get(r);n||console.warn("Please use proxy object");let i;const a=[],c=n[3];let u=!1;const h=c(m=>{if(a.push(m),t){e(a.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(a.splice(0))}))});return u=!0,()=>{u=!1,h()}}function Fx(r,e){const t=ci.get(r);t||console.warn("Please use proxy object");const[n,i,a]=t;return a(n,i(),e)}const or=li({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Tt={state:or,subscribe(r){return Hi(or,()=>r(or))},push(r,e){r!==or.view&&(or.view=r,e&&(or.data=e),or.history.push(r))},reset(r){or.view=r,or.history=[r]},replace(r){or.history.length>1&&(or.history[or.history.length-1]=r,or.view=r)},goBack(){if(or.history.length>1){or.history.pop();const[r]=or.history.slice(-1);or.view=r}},setData(r){or.data=r}},we={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",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 we.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const r=navigator.userAgent.toLowerCase();return we.isMobile()&&(r.includes("iphone")||r.includes("ipad"))},isHttpUrl(r){return r.startsWith("http://")||r.startsWith("https://")},isArray(r){return Array.isArray(r)&&r.length>0},formatNativeUrl(r,e,t){if(we.isHttpUrl(r))return this.formatUniversalUrl(r,e,t);let n=r;n.includes("://")||(n=r.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,t);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(r,e,t){if(!we.isHttpUrl(r))return this.formatNativeUrl(r,e,t);let n=r;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,t);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(r){return new Promise(e=>{setTimeout(e,r)})},openHref(r,e){window.open(r,e,"noreferrer noopener")},setWalletConnectDeepLink(r,e){try{localStorage.setItem(we.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:r,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(r){try{const[e]=r.split("?");localStorage.setItem(we.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(we.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(we.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var r;const e=(r=Tt.state.data)==null?void 0:r.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},Bx=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),pr=li({enabled:Bx,userSessionId:"",events:[],connectedWalletId:void 0}),og={state:pr,subscribe(r){return Hi(pr.events,()=>r(Fx(pr.events[pr.events.length-1])))},initialize(){pr.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(pr.userSessionId=crypto.randomUUID())},setConnectedWalletId(r){pr.connectedWalletId=r},click(r){if(pr.enabled){const e={type:"CLICK",name:r.name,userSessionId:pr.userSessionId,timestamp:Date.now(),data:r};pr.events.push(e)}},track(r){if(pr.enabled){const e={type:"TRACK",name:r.name,userSessionId:pr.userSessionId,timestamp:Date.now(),data:r};pr.events.push(e)}},view(r){if(pr.enabled){const e={type:"VIEW",name:r.name,userSessionId:pr.userSessionId,timestamp:Date.now(),data:r};pr.events.push(e)}}},Dn=li({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),zt={state:Dn,subscribe(r){return Hi(Dn,()=>r(Dn))},setChains(r){Dn.chains=r},setWalletConnectUri(r){Dn.walletConnectUri=r},setIsCustomDesktop(r){Dn.isCustomDesktop=r},setIsCustomMobile(r){Dn.isCustomMobile=r},setIsDataLoaded(r){Dn.isDataLoaded=r},setIsUiLoaded(r){Dn.isUiLoaded=r},setIsAuth(r){Dn.isAuth=r}},sc=li({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Kr={state:sc,subscribe(r){return Hi(sc,()=>r(sc))},setConfig(r){var e,t;og.initialize(),zt.setChains(r.chains),zt.setIsAuth(!!r.enableAuthMode),zt.setIsCustomMobile(!!((e=r.mobileWallets)!=null&&e.length)),zt.setIsCustomDesktop(!!((t=r.desktopWallets)!=null&&t.length)),we.setModalVersionInStorage(),Object.assign(sc,r)}};var kx=Object.defineProperty,ag=Object.getOwnPropertySymbols,qx=Object.prototype.hasOwnProperty,zx=Object.prototype.propertyIsEnumerable,cg=(r,e,t)=>e in r?kx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Hx=(r,e)=>{for(var t in e||(e={}))qx.call(e,t)&&cg(r,t,e[t]);if(ag)for(var t of ag(e))zx.call(e,t)&&cg(r,t,e[t]);return r};const rh="https://explorer-api.walletconnect.com",nh="wcm",ih="js-2.6.2";async function oc(r,e){const t=Hx({sdkType:nh,sdkVersion:ih},e),n=new URL(r,rh);return n.searchParams.append("projectId",Kr.state.projectId),Object.entries(t).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const Wi={async getDesktopListings(r){return oc("/w3m/v1/getDesktopListings",r)},async getMobileListings(r){return oc("/w3m/v1/getMobileListings",r)},async getInjectedListings(r){return oc("/w3m/v1/getInjectedListings",r)},async getAllListings(r){return oc("/w3m/v1/getAllListings",r)},getWalletImageUrl(r){return`${rh}/w3m/v1/getWalletImage/${r}?projectId=${Kr.state.projectId}&sdkType=${nh}&sdkVersion=${ih}`},getAssetImageUrl(r){return`${rh}/w3m/v1/getAssetImage/${r}?projectId=${Kr.state.projectId}&sdkType=${nh}&sdkVersion=${ih}`}};var Wx=Object.defineProperty,lg=Object.getOwnPropertySymbols,Kx=Object.prototype.hasOwnProperty,Vx=Object.prototype.propertyIsEnumerable,ug=(r,e,t)=>e in r?Wx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Gx=(r,e)=>{for(var t in e||(e={}))Kx.call(e,t)&&ug(r,t,e[t]);if(lg)for(var t of lg(e))Vx.call(e,t)&&ug(r,t,e[t]);return r};const hg=we.isMobile(),Sn=li({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Nr={state:Sn,async getRecomendedWallets(){const{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:e}=Kr.state;if(r==="NONE"||e==="ALL"&&!r)return Sn.recomendedWallets;if(we.isArray(r)){const t={recommendedIds:r.join(",")},{listings:n}=await Wi.getAllListings(t),i=Object.values(n);i.sort((a,c)=>{const u=r.indexOf(a.id),f=r.indexOf(c.id);return u-f}),Sn.recomendedWallets=i}else{const{chains:t,isAuth:n}=zt.state,i=t?.join(","),a=we.isArray(e),c={page:1,sdks:n?"auth_v1":void 0,entries:we.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:u}=hg?await Wi.getMobileListings(c):await Wi.getDesktopListings(c);Sn.recomendedWallets=Object.values(u)}return Sn.recomendedWallets},async getWallets(r){const e=Gx({},r),{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:n}=Kr.state,{recomendedWallets:i}=Sn;if(n==="ALL")return Sn.wallets;i.length?e.excludedIds=i.map(w=>w.id).join(","):we.isArray(t)&&(e.excludedIds=t.join(",")),we.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),zt.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:c}=r,{listings:u,total:f}=hg?await Wi.getMobileListings(e):await Wi.getDesktopListings(e),h=Object.values(u),m=c?"search":"wallets";return Sn[m]={listings:[...Sn[m].listings,...h],total:f,page:a??1},{listings:h,total:f}},getWalletImageUrl(r){return Wi.getWalletImageUrl(r)},getAssetImageUrl(r){return Wi.getAssetImageUrl(r)},resetSearch(){Sn.search={listings:[],total:0,page:1}}},Ts=li({open:!1}),Ki={state:Ts,subscribe(r){return Hi(Ts,()=>r(Ts))},async open(r){return new Promise(e=>{const{isUiLoaded:t,isDataLoaded:n}=zt.state;if(we.removeWalletConnectDeepLink(),zt.setWalletConnectUri(r?.uri),zt.setChains(r?.chains),Tt.reset("ConnectWallet"),t&&n)Ts.open=!0,e();else{const i=setInterval(()=>{const a=zt.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),Ts.open=!0,e())},200)}})},close(){Ts.open=!1}};var Yx=Object.defineProperty,fg=Object.getOwnPropertySymbols,Zx=Object.prototype.hasOwnProperty,Jx=Object.prototype.propertyIsEnumerable,dg=(r,e,t)=>e in r?Yx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Qx=(r,e)=>{for(var t in e||(e={}))Zx.call(e,t)&&dg(r,t,e[t]);if(fg)for(var t of fg(e))Jx.call(e,t)&&dg(r,t,e[t]);return r};function Xx(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const qo=li({themeMode:Xx()?"dark":"light"}),ui={state:qo,subscribe(r){return Hi(qo,()=>r(qo))},setThemeConfig(r){const{themeMode:e,themeVariables:t}=r;e&&(qo.themeMode=e),t&&(qo.themeVariables=Qx({},t))}},Vi=li({open:!1,message:"",variant:"success"}),hi={state:Vi,subscribe(r){return Hi(Vi,()=>r(Vi))},openToast(r,e){Vi.open=!0,Vi.message=r,Vi.variant=e},closeToast(){Vi.open=!1}};class eI{constructor(e){this.openModal=Ki.open,this.closeModal=Ki.close,this.subscribeModal=Ki.subscribe,this.setTheme=ui.setThemeConfig,ui.setThemeConfig(e),Kr.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return lC});const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),zt.setIsUiLoaded(!0)}}}var tI=Object.freeze({__proto__:null,WalletConnectModal:eI});/**
86
86
  * @license
87
87
  * Copyright 2019 Google LLC
88
88
  * SPDX-License-Identifier: BSD-3-Clause
89
- */const ic=window,ih=ic.ShadowRoot&&(ic.ShadyCSS===void 0||ic.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,sh=Symbol(),pg=new WeakMap;class gg{constructor(e,t,n){if(this._$cssResult$=!0,n!==sh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(ih&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=pg.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&pg.set(t,e))}return e}toString(){return this.cssText}}const rI=r=>new gg(typeof r=="string"?r:r+"",void 0,sh),lt=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((n,i,a)=>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)+r[a+1],r[0]);return new gg(t,r,sh)},nI=(r,e)=>{ih?r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const n=document.createElement("style"),i=ic.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)})},mg=ih?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return rI(t)})(r):r;/**
89
+ */const ac=window,sh=ac.ShadowRoot&&(ac.ShadyCSS===void 0||ac.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,oh=Symbol(),pg=new WeakMap;class gg{constructor(e,t,n){if(this._$cssResult$=!0,n!==oh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(sh&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=pg.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&pg.set(t,e))}return e}toString(){return this.cssText}}const rI=r=>new gg(typeof r=="string"?r:r+"",void 0,oh),lt=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((n,i,a)=>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)+r[a+1],r[0]);return new gg(t,r,oh)},nI=(r,e)=>{sh?r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const n=document.createElement("style"),i=ac.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)})},mg=sh?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return rI(t)})(r):r;/**
90
90
  * @license
91
91
  * Copyright 2017 Google LLC
92
92
  * SPDX-License-Identifier: BSD-3-Clause
93
- */var oh;const sc=window,vg=sc.trustedTypes,iI=vg?vg.emptyScript:"",yg=sc.reactiveElementPolyfillSupport,ah={toAttribute(r,e){switch(e){case Boolean:r=r?iI:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},wg=(r,e)=>e!==r&&(e==e||r==r),ch={attribute:!0,type:String,converter:ah,reflect:!1,hasChanged:wg},lh="finalized";class As extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,n)=>{const i=this._$Ep(n,t);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,t=ch){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const a=this[e];this[t]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ch}static finalize(){if(this.hasOwnProperty(lh))return!1;this[lh]=!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 t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of n)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(mg(i))}else e!==void 0&&t.push(mg(e));return t}static _$Ep(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return nI(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=ch){var i;const a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){const c=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:ah).toAttribute(t,n.type);this._$El=e,c==null?this.removeAttribute(a):this.setAttribute(a,c),this._$El=null}}_$AK(e,t){var n;const i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){const c=i.getPropertyOptions(a),u=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?c.converter:ah;this._$El=a,this[a]=u.fromAttribute(t,c.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||wg)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),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(t){Promise.reject(t)}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,a)=>this[a]=i),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw t=!1,this._$Ek(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.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((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}As[lh]=!0,As.elementProperties=new Map,As.elementStyles=[],As.shadowRootOptions={mode:"open"},yg?.({ReactiveElement:As}),((oh=sc.reactiveElementVersions)!==null&&oh!==void 0?oh:sc.reactiveElementVersions=[]).push("1.6.3");/**
93
+ */var ah;const cc=window,vg=cc.trustedTypes,iI=vg?vg.emptyScript:"",yg=cc.reactiveElementPolyfillSupport,ch={toAttribute(r,e){switch(e){case Boolean:r=r?iI:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},wg=(r,e)=>e!==r&&(e==e||r==r),lh={attribute:!0,type:String,converter:ch,reflect:!1,hasChanged:wg},uh="finalized";class Rs extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,n)=>{const i=this._$Ep(n,t);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,t=lh){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const a=this[e];this[t]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||lh}static finalize(){if(this.hasOwnProperty(uh))return!1;this[uh]=!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 t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of n)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(mg(i))}else e!==void 0&&t.push(mg(e));return t}static _$Ep(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return nI(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=lh){var i;const a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){const c=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:ch).toAttribute(t,n.type);this._$El=e,c==null?this.removeAttribute(a):this.setAttribute(a,c),this._$El=null}}_$AK(e,t){var n;const i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){const c=i.getPropertyOptions(a),u=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?c.converter:ch;this._$El=a,this[a]=u.fromAttribute(t,c.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||wg)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),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(t){Promise.reject(t)}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,a)=>this[a]=i),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw t=!1,this._$Ek(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.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((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}Rs[uh]=!0,Rs.elementProperties=new Map,Rs.elementStyles=[],Rs.shadowRootOptions={mode:"open"},yg?.({ReactiveElement:Rs}),((ah=cc.reactiveElementVersions)!==null&&ah!==void 0?ah:cc.reactiveElementVersions=[]).push("1.6.3");/**
94
94
  * @license
95
95
  * Copyright 2017 Google LLC
96
96
  * SPDX-License-Identifier: BSD-3-Clause
97
- */var uh;const oc=window,Ps=oc.trustedTypes,bg=Ps?Ps.createPolicy("lit-html",{createHTML:r=>r}):void 0,hh="$lit$",fi=`lit$${(Math.random()+"").slice(9)}$`,_g="?"+fi,sI=`<${_g}>`,Vi=document,Fo=()=>Vi.createComment(""),Bo=r=>r===null||typeof r!="object"&&typeof r!="function",Eg=Array.isArray,oI=r=>Eg(r)||typeof r?.[Symbol.iterator]=="function",fh=`[
98
- \f\r]`,ko=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xg=/-->/g,Ig=/>/g,Gi=RegExp(`>|${fh}(?:([^\\s"'>=/]+)(${fh}*=${fh}*(?:[^
99
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Dg=/'/g,Sg=/"/g,Cg=/^(?:script|style|textarea|title)$/i,Og=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),he=Og(1),Nt=Og(2),Yi=Symbol.for("lit-noChange"),tr=Symbol.for("lit-nothing"),$g=new WeakMap,Ji=Vi.createTreeWalker(Vi,129,null,!1);function Ag(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return bg!==void 0?bg.createHTML(e):e}const aI=(r,e)=>{const t=r.length-1,n=[];let i,a=e===2?"<svg>":"",c=ko;for(let u=0;u<t;u++){const f=r[u];let h,m,w=-1,y=0;for(;y<f.length&&(c.lastIndex=y,m=c.exec(f),m!==null);)y=c.lastIndex,c===ko?m[1]==="!--"?c=xg:m[1]!==void 0?c=Ig:m[2]!==void 0?(Cg.test(m[2])&&(i=RegExp("</"+m[2],"g")),c=Gi):m[3]!==void 0&&(c=Gi):c===Gi?m[0]===">"?(c=i??ko,w=-1):m[1]===void 0?w=-2:(w=c.lastIndex-m[2].length,h=m[1],c=m[3]===void 0?Gi:m[3]==='"'?Sg:Dg):c===Sg||c===Dg?c=Gi:c===xg||c===Ig?c=ko:(c=Gi,i=void 0);const x=c===Gi&&r[u+1].startsWith("/>")?" ":"";a+=c===ko?f+sI:w>=0?(n.push(h),f.slice(0,w)+hh+f.slice(w)+fi+x):f+fi+(w===-2?(n.push(void 0),u):x)}return[Ag(r,a+(r[t]||"<?>")+(e===2?"</svg>":"")),n]};class qo{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,c=0;const u=e.length-1,f=this.parts,[h,m]=aI(e,t);if(this.el=qo.createElement(h,n),Ji.currentNode=this.el.content,t===2){const w=this.el.content,y=w.firstChild;y.remove(),w.append(...y.childNodes)}for(;(i=Ji.nextNode())!==null&&f.length<u;){if(i.nodeType===1){if(i.hasAttributes()){const w=[];for(const y of i.getAttributeNames())if(y.endsWith(hh)||y.startsWith(fi)){const x=m[c++];if(w.push(y),x!==void 0){const S=i.getAttribute(x.toLowerCase()+hh).split(fi),P=/([.?@])?(.*)/.exec(x);f.push({type:1,index:a,name:P[2],strings:S,ctor:P[1]==="."?lI:P[1]==="?"?hI:P[1]==="@"?fI:ac})}else f.push({type:6,index:a})}for(const y of w)i.removeAttribute(y)}if(Cg.test(i.tagName)){const w=i.textContent.split(fi),y=w.length-1;if(y>0){i.textContent=Ps?Ps.emptyScript:"";for(let x=0;x<y;x++)i.append(w[x],Fo()),Ji.nextNode(),f.push({type:2,index:++a});i.append(w[y],Fo())}}}else if(i.nodeType===8)if(i.data===_g)f.push({type:2,index:a});else{let w=-1;for(;(w=i.data.indexOf(fi,w+1))!==-1;)f.push({type:7,index:a}),w+=fi.length-1}a++}}static createElement(e,t){const n=Vi.createElement("template");return n.innerHTML=e,n}}function Ts(r,e,t=r,n){var i,a,c,u;if(e===Yi)return e;let f=n!==void 0?(i=t._$Co)===null||i===void 0?void 0:i[n]:t._$Cl;const h=Bo(e)?void 0:e._$litDirective$;return f?.constructor!==h&&((a=f?._$AO)===null||a===void 0||a.call(f,!1),h===void 0?f=void 0:(f=new h(r),f._$AT(r,t,n)),n!==void 0?((c=(u=t)._$Co)!==null&&c!==void 0?c:u._$Co=[])[n]=f:t._$Cl=f),f!==void 0&&(e=Ts(r,f._$AS(r,e.values),f,n)),e}class cI{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:n},parts:i}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:Vi).importNode(n,!0);Ji.currentNode=a;let c=Ji.nextNode(),u=0,f=0,h=i[0];for(;h!==void 0;){if(u===h.index){let m;h.type===2?m=new zo(c,c.nextSibling,this,e):h.type===1?m=new h.ctor(c,h.name,h.strings,this,e):h.type===6&&(m=new dI(c,this,e)),this._$AV.push(m),h=i[++f]}u!==h?.index&&(c=Ji.nextNode(),u++)}return Ji.currentNode=Vi,a}v(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class zo{constructor(e,t,n,i){var a;this.type=2,this._$AH=tr,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ts(this,e,t),Bo(e)?e===tr||e==null||e===""?(this._$AH!==tr&&this._$AR(),this._$AH=tr):e!==this._$AH&&e!==Yi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):oI(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!==tr&&Bo(this._$AH)?this._$AA.nextSibling.data=e:this.$(Vi.createTextNode(e)),this._$AH=e}g(e){var t;const{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=qo.createElement(Ag(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(n);else{const c=new cI(a,this),u=c.u(this.options);c.v(n),this.$(u),this._$AH=c}}_$AC(e){let t=$g.get(e.strings);return t===void 0&&$g.set(e.strings,t=new qo(e)),t}T(e){Eg(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const a of e)i===t.length?t.push(n=new zo(this.k(Fo()),this.k(Fo()),this,this.options)):n=t[i],n._$AI(a),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}}class ac{constructor(e,t,n,i,a){this.type=1,this._$AH=tr,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=tr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){const a=this.strings;let c=!1;if(a===void 0)e=Ts(this,e,t,0),c=!Bo(e)||e!==this._$AH&&e!==Yi,c&&(this._$AH=e);else{const u=e;let f,h;for(e=a[0],f=0;f<a.length-1;f++)h=Ts(this,u[n+f],t,f),h===Yi&&(h=this._$AH[f]),c||(c=!Bo(h)||h!==this._$AH[f]),h===tr?e=tr:e!==tr&&(e+=(h??"")+a[f+1]),this._$AH[f]=h}c&&!i&&this.j(e)}j(e){e===tr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class lI extends ac{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===tr?void 0:e}}const uI=Ps?Ps.emptyScript:"";class hI extends ac{constructor(){super(...arguments),this.type=4}j(e){e&&e!==tr?this.element.setAttribute(this.name,uI):this.element.removeAttribute(this.name)}}class fI extends ac{constructor(e,t,n,i,a){super(e,t,n,i,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=Ts(this,e,t,0))!==null&&n!==void 0?n:tr)===Yi)return;const i=this._$AH,a=e===tr&&i!==tr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,c=e!==tr&&(i===tr||a);a&&this.element.removeEventListener(this.name,this,i),c&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class dI{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Ts(this,e)}}const Pg=oc.litHtmlPolyfillSupport;Pg?.(qo,zo),((uh=oc.litHtmlVersions)!==null&&uh!==void 0?uh:oc.litHtmlVersions=[]).push("2.8.0");const pI=(r,e,t)=>{var n,i;const a=(n=t?.renderBefore)!==null&&n!==void 0?n:e;let c=a._$litPart$;if(c===void 0){const u=(i=t?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=c=new zo(e.insertBefore(Fo(),u),u,void 0,t??{})}return c._$AI(r),c};/**
97
+ */var hh;const lc=window,Ns=lc.trustedTypes,bg=Ns?Ns.createPolicy("lit-html",{createHTML:r=>r}):void 0,fh="$lit$",fi=`lit$${(Math.random()+"").slice(9)}$`,_g="?"+fi,sI=`<${_g}>`,Gi=document,zo=()=>Gi.createComment(""),Ho=r=>r===null||typeof r!="object"&&typeof r!="function",Eg=Array.isArray,oI=r=>Eg(r)||typeof r?.[Symbol.iterator]=="function",dh=`[
98
+ \f\r]`,Wo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xg=/-->/g,Ig=/>/g,Yi=RegExp(`>|${dh}(?:([^\\s"'>=/]+)(${dh}*=${dh}*(?:[^
99
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Dg=/'/g,Sg=/"/g,Og=/^(?:script|style|textarea|title)$/i,Cg=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),he=Cg(1),Lt=Cg(2),Zi=Symbol.for("lit-noChange"),tr=Symbol.for("lit-nothing"),$g=new WeakMap,Ji=Gi.createTreeWalker(Gi,129,null,!1);function Ag(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return bg!==void 0?bg.createHTML(e):e}const aI=(r,e)=>{const t=r.length-1,n=[];let i,a=e===2?"<svg>":"",c=Wo;for(let u=0;u<t;u++){const f=r[u];let h,m,w=-1,y=0;for(;y<f.length&&(c.lastIndex=y,m=c.exec(f),m!==null);)y=c.lastIndex,c===Wo?m[1]==="!--"?c=xg:m[1]!==void 0?c=Ig:m[2]!==void 0?(Og.test(m[2])&&(i=RegExp("</"+m[2],"g")),c=Yi):m[3]!==void 0&&(c=Yi):c===Yi?m[0]===">"?(c=i??Wo,w=-1):m[1]===void 0?w=-2:(w=c.lastIndex-m[2].length,h=m[1],c=m[3]===void 0?Yi:m[3]==='"'?Sg:Dg):c===Sg||c===Dg?c=Yi:c===xg||c===Ig?c=Wo:(c=Yi,i=void 0);const _=c===Yi&&r[u+1].startsWith("/>")?" ":"";a+=c===Wo?f+sI:w>=0?(n.push(h),f.slice(0,w)+fh+f.slice(w)+fi+_):f+fi+(w===-2?(n.push(void 0),u):_)}return[Ag(r,a+(r[t]||"<?>")+(e===2?"</svg>":"")),n]};class Ko{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,c=0;const u=e.length-1,f=this.parts,[h,m]=aI(e,t);if(this.el=Ko.createElement(h,n),Ji.currentNode=this.el.content,t===2){const w=this.el.content,y=w.firstChild;y.remove(),w.append(...y.childNodes)}for(;(i=Ji.nextNode())!==null&&f.length<u;){if(i.nodeType===1){if(i.hasAttributes()){const w=[];for(const y of i.getAttributeNames())if(y.endsWith(fh)||y.startsWith(fi)){const _=m[c++];if(w.push(y),_!==void 0){const S=i.getAttribute(_.toLowerCase()+fh).split(fi),P=/([.?@])?(.*)/.exec(_);f.push({type:1,index:a,name:P[2],strings:S,ctor:P[1]==="."?lI:P[1]==="?"?hI:P[1]==="@"?fI:uc})}else f.push({type:6,index:a})}for(const y of w)i.removeAttribute(y)}if(Og.test(i.tagName)){const w=i.textContent.split(fi),y=w.length-1;if(y>0){i.textContent=Ns?Ns.emptyScript:"";for(let _=0;_<y;_++)i.append(w[_],zo()),Ji.nextNode(),f.push({type:2,index:++a});i.append(w[y],zo())}}}else if(i.nodeType===8)if(i.data===_g)f.push({type:2,index:a});else{let w=-1;for(;(w=i.data.indexOf(fi,w+1))!==-1;)f.push({type:7,index:a}),w+=fi.length-1}a++}}static createElement(e,t){const n=Gi.createElement("template");return n.innerHTML=e,n}}function Ls(r,e,t=r,n){var i,a,c,u;if(e===Zi)return e;let f=n!==void 0?(i=t._$Co)===null||i===void 0?void 0:i[n]:t._$Cl;const h=Ho(e)?void 0:e._$litDirective$;return f?.constructor!==h&&((a=f?._$AO)===null||a===void 0||a.call(f,!1),h===void 0?f=void 0:(f=new h(r),f._$AT(r,t,n)),n!==void 0?((c=(u=t)._$Co)!==null&&c!==void 0?c:u._$Co=[])[n]=f:t._$Cl=f),f!==void 0&&(e=Ls(r,f._$AS(r,e.values),f,n)),e}class cI{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:n},parts:i}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:Gi).importNode(n,!0);Ji.currentNode=a;let c=Ji.nextNode(),u=0,f=0,h=i[0];for(;h!==void 0;){if(u===h.index){let m;h.type===2?m=new Vo(c,c.nextSibling,this,e):h.type===1?m=new h.ctor(c,h.name,h.strings,this,e):h.type===6&&(m=new dI(c,this,e)),this._$AV.push(m),h=i[++f]}u!==h?.index&&(c=Ji.nextNode(),u++)}return Ji.currentNode=Gi,a}v(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class Vo{constructor(e,t,n,i){var a;this.type=2,this._$AH=tr,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ls(this,e,t),Ho(e)?e===tr||e==null||e===""?(this._$AH!==tr&&this._$AR(),this._$AH=tr):e!==this._$AH&&e!==Zi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):oI(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!==tr&&Ho(this._$AH)?this._$AA.nextSibling.data=e:this.$(Gi.createTextNode(e)),this._$AH=e}g(e){var t;const{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ko.createElement(Ag(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(n);else{const c=new cI(a,this),u=c.u(this.options);c.v(n),this.$(u),this._$AH=c}}_$AC(e){let t=$g.get(e.strings);return t===void 0&&$g.set(e.strings,t=new Ko(e)),t}T(e){Eg(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const a of e)i===t.length?t.push(n=new Vo(this.k(zo()),this.k(zo()),this,this.options)):n=t[i],n._$AI(a),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}}class uc{constructor(e,t,n,i,a){this.type=1,this._$AH=tr,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=tr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){const a=this.strings;let c=!1;if(a===void 0)e=Ls(this,e,t,0),c=!Ho(e)||e!==this._$AH&&e!==Zi,c&&(this._$AH=e);else{const u=e;let f,h;for(e=a[0],f=0;f<a.length-1;f++)h=Ls(this,u[n+f],t,f),h===Zi&&(h=this._$AH[f]),c||(c=!Ho(h)||h!==this._$AH[f]),h===tr?e=tr:e!==tr&&(e+=(h??"")+a[f+1]),this._$AH[f]=h}c&&!i&&this.j(e)}j(e){e===tr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class lI extends uc{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===tr?void 0:e}}const uI=Ns?Ns.emptyScript:"";class hI extends uc{constructor(){super(...arguments),this.type=4}j(e){e&&e!==tr?this.element.setAttribute(this.name,uI):this.element.removeAttribute(this.name)}}class fI extends uc{constructor(e,t,n,i,a){super(e,t,n,i,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=Ls(this,e,t,0))!==null&&n!==void 0?n:tr)===Zi)return;const i=this._$AH,a=e===tr&&i!==tr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,c=e!==tr&&(i===tr||a);a&&this.element.removeEventListener(this.name,this,i),c&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class dI{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Ls(this,e)}}const Pg=lc.litHtmlPolyfillSupport;Pg?.(Ko,Vo),((hh=lc.litHtmlVersions)!==null&&hh!==void 0?hh:lc.litHtmlVersions=[]).push("2.8.0");const pI=(r,e,t)=>{var n,i;const a=(n=t?.renderBefore)!==null&&n!==void 0?n:e;let c=a._$litPart$;if(c===void 0){const u=(i=t?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=c=new Vo(e.insertBefore(zo(),u),u,void 0,t??{})}return c._$AI(r),c};/**
100
100
  * @license
101
101
  * Copyright 2017 Google LLC
102
102
  * SPDX-License-Identifier: BSD-3-Clause
103
- */var dh,ph;class Ye extends As{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=pI(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Yi}}Ye.finalized=!0,Ye._$litElement$=!0,(dh=globalThis.litElementHydrateSupport)===null||dh===void 0||dh.call(globalThis,{LitElement:Ye});const Tg=globalThis.litElementPolyfillSupport;Tg?.({LitElement:Ye}),((ph=globalThis.litElementVersions)!==null&&ph!==void 0?ph:globalThis.litElementVersions=[]).push("3.3.3");/**
103
+ */var ph,gh;class Ye extends Rs{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=pI(t,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 Zi}}Ye.finalized=!0,Ye._$litElement$=!0,(ph=globalThis.litElementHydrateSupport)===null||ph===void 0||ph.call(globalThis,{LitElement:Ye});const Tg=globalThis.litElementPolyfillSupport;Tg?.({LitElement:Ye}),((gh=globalThis.litElementVersions)!==null&&gh!==void 0?gh:globalThis.litElementVersions=[]).push("3.3.3");/**
104
104
  * @license
105
105
  * Copyright 2017 Google LLC
106
106
  * SPDX-License-Identifier: BSD-3-Clause
@@ -112,11 +112,11 @@ function print() { __p += __j.call(arguments, '') }
112
112
  * @license
113
113
  * Copyright 2017 Google LLC
114
114
  * SPDX-License-Identifier: BSD-3-Clause
115
- */function Mr(r){return Be({...r,state:!0})}/**
115
+ */function Lr(r){return Be({...r,state:!0})}/**
116
116
  * @license
117
117
  * Copyright 2021 Google LLC
118
118
  * SPDX-License-Identifier: BSD-3-Clause
119
- */var gh;((gh=window.HTMLSlotElement)===null||gh===void 0?void 0:gh.prototype.assignedElements)!=null;/**
119
+ */var mh;((mh=window.HTMLSlotElement)===null||mh===void 0?void 0:mh.prototype.assignedElements)!=null;/**
120
120
  * @license
121
121
  * Copyright 2017 Google LLC
122
122
  * SPDX-License-Identifier: BSD-3-Clause
@@ -124,16 +124,16 @@ function print() { __p += __j.call(arguments, '') }
124
124
  * @license
125
125
  * Copyright 2018 Google LLC
126
126
  * SPDX-License-Identifier: BSD-3-Clause
127
- */const qn=yI(class extends wI{constructor(r){var e;if(super(r),r.type!==vI.ATTRIBUTE||r.name!=="class"||((e=r.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(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){var t,n;if(this.it===void 0){this.it=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in e)e[a]&&!(!((t=this.nt)===null||t===void 0)&&t.has(a))&&this.it.add(a);return this.render(e)}const i=r.element.classList;this.it.forEach(a=>{a in e||(i.remove(a),this.it.delete(a))});for(const a in e){const c=!!e[a];c===this.it.has(a)||!((n=this.nt)===null||n===void 0)&&n.has(a)||(c?(i.add(a),this.it.add(a)):(i.remove(a),this.it.delete(a)))}return Yi}});function bI(r,e){r.indexOf(e)===-1&&r.push(e)}const Rg=(r,e,t)=>Math.min(Math.max(t,r),e),tn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},cc=r=>typeof r=="number",Rs=r=>Array.isArray(r)&&!cc(r[0]),_I=(r,e,t)=>{const n=e-r;return((t-r)%n+n)%n+r};function EI(r,e){return Rs(r)?r[_I(0,r.length,e)]:r}const Ng=(r,e,t)=>-t*r+t*e+r,Lg=()=>{},di=r=>r,mh=(r,e,t)=>e-r===0?1:(t-r)/(e-r);function Mg(r,e){const t=r[r.length-1];for(let n=1;n<=e;n++){const i=mh(0,e,n);r.push(Ng(t,1,i))}}function xI(r){const e=[0];return Mg(e,r-1),e}function II(r,e=xI(r.length),t=di){const n=r.length,i=n-e.length;return i>0&&Mg(e,i),a=>{let c=0;for(;c<n-2&&!(a<e[c+1]);c++);let u=Rg(0,1,mh(e[c],e[c+1],a));return u=EI(t,c)(u),Ng(r[c],r[c+1],u)}}const Ug=r=>Array.isArray(r)&&cc(r[0]),vh=r=>typeof r=="object"&&!!r.createAnimation,Zi=r=>typeof r=="function",DI=r=>typeof r=="string",Ho={ms:r=>r*1e3,s:r=>r/1e3},jg=(r,e,t)=>(((1-3*t+3*e)*r+(3*t-6*e))*r+3*e)*r,SI=1e-7,CI=12;function OI(r,e,t,n,i){let a,c,u=0;do c=e+(t-e)/2,a=jg(c,n,i)-r,a>0?t=c:e=c;while(Math.abs(a)>SI&&++u<CI);return c}function Wo(r,e,t,n){if(r===e&&t===n)return di;const i=a=>OI(a,0,1,r,t);return a=>a===0||a===1?a:jg(i(a),e,n)}const $I=(r,e="end")=>t=>{t=e==="end"?Math.min(t,.999):Math.max(t,.001);const n=t*r,i=e==="end"?Math.floor(n):Math.ceil(n);return Rg(0,1,i/r)},Fg={ease:Wo(.25,.1,.25,1),"ease-in":Wo(.42,0,1,1),"ease-in-out":Wo(.42,0,.58,1),"ease-out":Wo(0,0,.58,1)},AI=/\((.*?)\)/;function Bg(r){if(Zi(r))return r;if(Ug(r))return Wo(...r);if(Fg[r])return Fg[r];if(r.startsWith("steps")){const e=AI.exec(r);if(e){const t=e[1].split(",");return $I(parseFloat(t[0]),t[1].trim())}}return di}class kg{constructor(e,t=[0,1],{easing:n,duration:i=tn.duration,delay:a=tn.delay,endDelay:c=tn.endDelay,repeat:u=tn.repeat,offset:f,direction:h="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=di,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((w,y)=>{this.resolve=w,this.reject=y}),n=n||tn.easing,vh(n)){const w=n.createAnimation(t);n=w.easing,t=w.keyframes||t,i=w.duration||i}this.repeat=u,this.easing=Rs(n)?di:Bg(n),this.updateDuration(i);const m=II(t,f,Rs(n)?n.map(Bg):di);this.tick=w=>{var y;a=a;let x=0;this.pauseTime!==void 0?x=this.pauseTime:x=(w-this.startTime)*this.rate,this.t=x,x/=1e3,x=Math.max(x-a,0),this.playState==="finished"&&this.pauseTime===void 0&&(x=this.totalDuration);const S=x/this.duration;let P=Math.floor(S),U=S%1;!U&&S>=1&&(U=1),U===1&&P--;const j=P%2;(h==="reverse"||h==="alternate"&&j||h==="alternate-reverse"&&!j)&&(U=1-U);const A=x>=this.totalDuration?1:Math.min(U,1),T=m(this.easing(A));e(T),this.pauseTime===void 0&&(this.playState==="finished"||x>=this.totalDuration+c)?(this.playState="finished",(y=this.resolve)===null||y===void 0||y.call(this,T)):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(r,e){if(!r)throw new Error(e)});class PI{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const wh=new WeakMap;function qg(r){return wh.has(r)||wh.set(r,{transforms:[],values:new Map}),wh.get(r)}function TI(r,e){return r.has(e)||r.set(e,new PI),r.get(e)}const RI=["","X","Y","Z"],NI=["translate","scale","rotate","skew"],lc={x:"translateX",y:"translateY",z:"translateZ"},zg={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:r=>r+"deg"},LI={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:r=>r+"px"},rotate:zg,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:di},skew:zg},Ko=new Map,bh=r=>`--motion-${r}`,uc=["x","y","z"];NI.forEach(r=>{RI.forEach(e=>{uc.push(r+e),Ko.set(bh(r+e),LI[r])})});const MI=(r,e)=>uc.indexOf(r)-uc.indexOf(e),UI=new Set(uc),Hg=r=>UI.has(r),jI=(r,e)=>{lc[e]&&(e=lc[e]);const{transforms:t}=qg(r);bI(t,e),r.style.transform=FI(t)},FI=r=>r.sort(MI).reduce(BI,"").trim(),BI=(r,e)=>`${r} ${e}(var(${bh(e)}))`,_h=r=>r.startsWith("--"),Wg=new Set;function kI(r){if(!Wg.has(r)){Wg.add(r);try{const{syntax:e,initialValue:t}=Ko.has(r)?Ko.get(r):{};CSS.registerProperty({name:r,inherits:!1,syntax:e,initialValue:t})}catch{}}}const Eh=(r,e)=>document.createElement("div").animate(r,e),Kg={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Eh({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Eh({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Eh({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},xh={},Ns={};for(const r in Kg)Ns[r]=()=>(xh[r]===void 0&&(xh[r]=Kg[r]()),xh[r]);const qI=.015,zI=(r,e)=>{let t="";const n=Math.round(e/qI);for(let i=0;i<n;i++)t+=r(mh(0,n-1,i))+", ";return t.substring(0,t.length-2)},Vg=(r,e)=>Zi(r)?Ns.linearEasing()?`linear(${zI(r,e)})`:tn.easing:Ug(r)?HI(r):r,HI=([r,e,t,n])=>`cubic-bezier(${r}, ${e}, ${t}, ${n})`;function WI(r,e){for(let t=0;t<r.length;t++)r[t]===null&&(r[t]=t?r[t-1]:e());return r}const KI=r=>Array.isArray(r)?r:[r];function Ih(r){return lc[r]&&(r=lc[r]),Hg(r)?bh(r):r}const hc={get:(r,e)=>{e=Ih(e);let t=_h(e)?r.style.getPropertyValue(e):getComputedStyle(r)[e];if(!t&&t!==0){const n=Ko.get(e);n&&(t=n.initialValue)}return t},set:(r,e,t)=>{e=Ih(e),_h(e)?r.style.setProperty(e,t):r.style[e]=t}};function Gg(r,e=!0){if(!(!r||r.playState==="finished"))try{r.stop?r.stop():(e&&r.commitStyles(),r.cancel())}catch{}}function VI(r,e){var t;let n=e?.toDefaultUnit||di;const i=r[r.length-1];if(DI(i)){const a=((t=i.match(/(-?[\d.]+)([a-z%]*)/))===null||t===void 0?void 0:t[2])||"";a&&(n=c=>c+a)}return n}function GI(){return window.__MOTION_DEV_TOOLS_RECORD}function YI(r,e,t,n={},i){const a=GI(),c=n.record!==!1&&a;let u,{duration:f=tn.duration,delay:h=tn.delay,endDelay:m=tn.endDelay,repeat:w=tn.repeat,easing:y=tn.easing,persist:x=!1,direction:S,offset:P,allowWebkitAcceleration:U=!1}=n;const j=qg(r),A=Hg(e);let T=Ns.waapi();A&&jI(r,e);const C=Ih(e),$=TI(j.values,C),E=Ko.get(C);return Gg($.animation,!(vh(y)&&$.generator)&&n.record!==!1),()=>{const d=()=>{var F,V;return(V=(F=hc.get(r,C))!==null&&F!==void 0?F:E?.initialValue)!==null&&V!==void 0?V:0};let b=WI(KI(t),d);const H=VI(b,E);if(vh(y)){const F=y.createAnimation(b,e!=="opacity",d,C,$);y=F.easing,b=F.keyframes||b,f=F.duration||f}if(_h(C)&&(Ns.cssRegisterProperty()?kI(C):T=!1),A&&!Ns.linearEasing()&&(Zi(y)||Rs(y)&&y.some(Zi))&&(T=!1),T){E&&(b=b.map(se=>cc(se)?E.toDefaultUnit(se):se)),b.length===1&&(!Ns.partialKeyframes()||c)&&b.unshift(d());const F={delay:Ho.ms(h),duration:Ho.ms(f),endDelay:Ho.ms(m),easing:Rs(y)?void 0:Vg(y,f),direction:S,iterations:w+1,fill:"both"};u=r.animate({[C]:b,offset:P,easing:Rs(y)?y.map(se=>Vg(se,f)):void 0},F),u.finished||(u.finished=new Promise((se,ce)=>{u.onfinish=se,u.oncancel=ce}));const V=b[b.length-1];u.finished.then(()=>{x||(hc.set(r,C,V),u.cancel())}).catch(Lg),U||(u.playbackRate=1.000001)}else if(i&&A)b=b.map(F=>typeof F=="string"?parseFloat(F):F),b.length===1&&b.unshift(parseFloat(d())),u=new i(F=>{hc.set(r,C,H?H(F):F)},b,Object.assign(Object.assign({},n),{duration:f,easing:y}));else{const F=b[b.length-1];hc.set(r,C,E&&cc(F)?E.toDefaultUnit(F):F)}return c&&a(r,e,b,{duration:f,delay:h,easing:y,repeat:w,offset:P},"motion-one"),$.setAnimation(u),u}}const JI=(r,e)=>r[e]?Object.assign(Object.assign({},r),r[e]):Object.assign({},r);function Yg(r,e){var t;return typeof r=="string"?e?((t=e[r])!==null&&t!==void 0||(e[r]=document.querySelectorAll(r)),r=e[r]):r=document.querySelectorAll(r):r instanceof Element&&(r=[r]),Array.from(r||[])}const ZI=r=>r(),Jg=(r,e,t=tn.duration)=>new Proxy({animations:r.map(ZI).filter(Boolean),duration:t,options:e},XI),QI=r=>r.animations[0],XI={get:(r,e)=>{const t=QI(r);switch(e){case"duration":return r.duration;case"currentTime":return Ho.s(t?.[e]||0);case"playbackRate":case"playState":return t?.[e];case"finished":return r.finished||(r.finished=Promise.all(r.animations.map(eD)).catch(Lg)),r.finished;case"stop":return()=>{r.animations.forEach(n=>Gg(n))};case"forEachNative":return n=>{r.animations.forEach(i=>n(i,r))};default:return typeof t?.[e]>"u"?void 0:()=>r.animations.forEach(n=>n[e]())}},set:(r,e,t)=>{switch(e){case"currentTime":t=Ho.ms(t);case"playbackRate":for(let n=0;n<r.animations.length;n++)r.animations[n][e]=t;return!0}return!1}},eD=r=>r.finished;function tD(r,e,t){return Zi(r)?r(e,t):r}function rD(r){return function(t,n,i={}){t=Yg(t);const a=t.length;yh(!!a,"No valid element provided."),yh(!!n,"No keyframes defined.");const c=[];for(let u=0;u<a;u++){const f=t[u];for(const h in n){const m=JI(i,h);m.delay=tD(m.delay,u,a);const w=YI(f,h,n[h],m,r);c.push(w)}}return Jg(c,i,i.duration)}}const nD=rD(kg);function iD(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}typeof SuppressedError=="function"&&SuppressedError;const sD={any:0,all:1};function oD(r,e,{root:t,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const a=Yg(r),c=new WeakMap,u=h=>{h.forEach(m=>{const w=c.get(m.target);if(m.isIntersecting!==!!w)if(m.isIntersecting){const y=e(m);Zi(y)?c.set(m.target,y):f.unobserve(m.target)}else w&&(w(m),c.delete(m.target))})},f=new IntersectionObserver(u,{root:t,rootMargin:n,threshold:typeof i=="number"?i:sD[i]});return a.forEach(h=>f.observe(h)),()=>f.disconnect()}function Dh(r,e,t){r.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:t}}))}function Zg(r,e,t){r.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:t}}))}const aD={isActive:r=>!!r.inView,subscribe:(r,{enable:e,disable:t},{inViewOptions:n={}})=>{const{once:i}=n,a=iD(n,["once"]);return oD(r,c=>{if(e(),Zg(r,"viewenter",c),!i)return u=>{t(),Zg(r,"viewleave",u)}},a)}},Qg=(r,e,t)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(t(),Dh(r,e,n))};[...Object.keys({inView:aD,hover:{isActive:r=>!!r.hover,subscribe:(r,{enable:e,disable:t})=>{const n=Qg(r,"hoverstart",e),i=Qg(r,"hoverend",t);return r.addEventListener("pointerenter",n),r.addEventListener("pointerleave",i),()=>{r.removeEventListener("pointerenter",n),r.removeEventListener("pointerleave",i)}}},press:{isActive:r=>!!r.press,subscribe:(r,{enable:e,disable:t})=>{const n=a=>{t(),Dh(r,"pressend",a),window.removeEventListener("pointerup",n)},i=a=>{e(),Dh(r,"pressstart",a),window.addEventListener("pointerup",n)};return r.addEventListener("pointerdown",i),()=>{r.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function cD(r,e={}){return Jg([()=>{const t=new kg(r,[0,1],e);return t.finished.catch(()=>{}),t}],e,e.duration)}function Qi(r,e,t){return(Zi(r)?cD:nD)(r,e,t)}/**
127
+ */const qn=yI(class extends wI{constructor(r){var e;if(super(r),r.type!==vI.ATTRIBUTE||r.name!=="class"||((e=r.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(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){var t,n;if(this.it===void 0){this.it=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in e)e[a]&&!(!((t=this.nt)===null||t===void 0)&&t.has(a))&&this.it.add(a);return this.render(e)}const i=r.element.classList;this.it.forEach(a=>{a in e||(i.remove(a),this.it.delete(a))});for(const a in e){const c=!!e[a];c===this.it.has(a)||!((n=this.nt)===null||n===void 0)&&n.has(a)||(c?(i.add(a),this.it.add(a)):(i.remove(a),this.it.delete(a)))}return Zi}});function bI(r,e){r.indexOf(e)===-1&&r.push(e)}const Rg=(r,e,t)=>Math.min(Math.max(t,r),e),rn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},hc=r=>typeof r=="number",Ms=r=>Array.isArray(r)&&!hc(r[0]),_I=(r,e,t)=>{const n=e-r;return((t-r)%n+n)%n+r};function EI(r,e){return Ms(r)?r[_I(0,r.length,e)]:r}const Ng=(r,e,t)=>-t*r+t*e+r,Lg=()=>{},di=r=>r,vh=(r,e,t)=>e-r===0?1:(t-r)/(e-r);function Mg(r,e){const t=r[r.length-1];for(let n=1;n<=e;n++){const i=vh(0,e,n);r.push(Ng(t,1,i))}}function xI(r){const e=[0];return Mg(e,r-1),e}function II(r,e=xI(r.length),t=di){const n=r.length,i=n-e.length;return i>0&&Mg(e,i),a=>{let c=0;for(;c<n-2&&!(a<e[c+1]);c++);let u=Rg(0,1,vh(e[c],e[c+1],a));return u=EI(t,c)(u),Ng(r[c],r[c+1],u)}}const Ug=r=>Array.isArray(r)&&hc(r[0]),yh=r=>typeof r=="object"&&!!r.createAnimation,Qi=r=>typeof r=="function",DI=r=>typeof r=="string",Go={ms:r=>r*1e3,s:r=>r/1e3},jg=(r,e,t)=>(((1-3*t+3*e)*r+(3*t-6*e))*r+3*e)*r,SI=1e-7,OI=12;function CI(r,e,t,n,i){let a,c,u=0;do c=e+(t-e)/2,a=jg(c,n,i)-r,a>0?t=c:e=c;while(Math.abs(a)>SI&&++u<OI);return c}function Yo(r,e,t,n){if(r===e&&t===n)return di;const i=a=>CI(a,0,1,r,t);return a=>a===0||a===1?a:jg(i(a),e,n)}const $I=(r,e="end")=>t=>{t=e==="end"?Math.min(t,.999):Math.max(t,.001);const n=t*r,i=e==="end"?Math.floor(n):Math.ceil(n);return Rg(0,1,i/r)},Fg={ease:Yo(.25,.1,.25,1),"ease-in":Yo(.42,0,1,1),"ease-in-out":Yo(.42,0,.58,1),"ease-out":Yo(0,0,.58,1)},AI=/\((.*?)\)/;function Bg(r){if(Qi(r))return r;if(Ug(r))return Yo(...r);if(Fg[r])return Fg[r];if(r.startsWith("steps")){const e=AI.exec(r);if(e){const t=e[1].split(",");return $I(parseFloat(t[0]),t[1].trim())}}return di}class kg{constructor(e,t=[0,1],{easing:n,duration:i=rn.duration,delay:a=rn.delay,endDelay:c=rn.endDelay,repeat:u=rn.repeat,offset:f,direction:h="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=di,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((w,y)=>{this.resolve=w,this.reject=y}),n=n||rn.easing,yh(n)){const w=n.createAnimation(t);n=w.easing,t=w.keyframes||t,i=w.duration||i}this.repeat=u,this.easing=Ms(n)?di:Bg(n),this.updateDuration(i);const m=II(t,f,Ms(n)?n.map(Bg):di);this.tick=w=>{var y;a=a;let _=0;this.pauseTime!==void 0?_=this.pauseTime:_=(w-this.startTime)*this.rate,this.t=_,_/=1e3,_=Math.max(_-a,0),this.playState==="finished"&&this.pauseTime===void 0&&(_=this.totalDuration);const S=_/this.duration;let P=Math.floor(S),j=S%1;!j&&S>=1&&(j=1),j===1&&P--;const U=P%2;(h==="reverse"||h==="alternate"&&U||h==="alternate-reverse"&&!U)&&(j=1-j);const A=_>=this.totalDuration?1:Math.min(j,1),T=m(this.easing(A));e(T),this.pauseTime===void 0&&(this.playState==="finished"||_>=this.totalDuration+c)?(this.playState="finished",(y=this.resolve)===null||y===void 0||y.call(this,T)):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 wh=function(){};process.env.NODE_ENV!=="production"&&(wh=function(r,e){if(!r)throw new Error(e)});class PI{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const bh=new WeakMap;function qg(r){return bh.has(r)||bh.set(r,{transforms:[],values:new Map}),bh.get(r)}function TI(r,e){return r.has(e)||r.set(e,new PI),r.get(e)}const RI=["","X","Y","Z"],NI=["translate","scale","rotate","skew"],fc={x:"translateX",y:"translateY",z:"translateZ"},zg={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:r=>r+"deg"},LI={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:r=>r+"px"},rotate:zg,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:di},skew:zg},Zo=new Map,_h=r=>`--motion-${r}`,dc=["x","y","z"];NI.forEach(r=>{RI.forEach(e=>{dc.push(r+e),Zo.set(_h(r+e),LI[r])})});const MI=(r,e)=>dc.indexOf(r)-dc.indexOf(e),UI=new Set(dc),Hg=r=>UI.has(r),jI=(r,e)=>{fc[e]&&(e=fc[e]);const{transforms:t}=qg(r);bI(t,e),r.style.transform=FI(t)},FI=r=>r.sort(MI).reduce(BI,"").trim(),BI=(r,e)=>`${r} ${e}(var(${_h(e)}))`,Eh=r=>r.startsWith("--"),Wg=new Set;function kI(r){if(!Wg.has(r)){Wg.add(r);try{const{syntax:e,initialValue:t}=Zo.has(r)?Zo.get(r):{};CSS.registerProperty({name:r,inherits:!1,syntax:e,initialValue:t})}catch{}}}const xh=(r,e)=>document.createElement("div").animate(r,e),Kg={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{xh({opacity:[1]})}catch{return!1}return!0},finished:()=>!!xh({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{xh({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Ih={},Us={};for(const r in Kg)Us[r]=()=>(Ih[r]===void 0&&(Ih[r]=Kg[r]()),Ih[r]);const qI=.015,zI=(r,e)=>{let t="";const n=Math.round(e/qI);for(let i=0;i<n;i++)t+=r(vh(0,n-1,i))+", ";return t.substring(0,t.length-2)},Vg=(r,e)=>Qi(r)?Us.linearEasing()?`linear(${zI(r,e)})`:rn.easing:Ug(r)?HI(r):r,HI=([r,e,t,n])=>`cubic-bezier(${r}, ${e}, ${t}, ${n})`;function WI(r,e){for(let t=0;t<r.length;t++)r[t]===null&&(r[t]=t?r[t-1]:e());return r}const KI=r=>Array.isArray(r)?r:[r];function Dh(r){return fc[r]&&(r=fc[r]),Hg(r)?_h(r):r}const pc={get:(r,e)=>{e=Dh(e);let t=Eh(e)?r.style.getPropertyValue(e):getComputedStyle(r)[e];if(!t&&t!==0){const n=Zo.get(e);n&&(t=n.initialValue)}return t},set:(r,e,t)=>{e=Dh(e),Eh(e)?r.style.setProperty(e,t):r.style[e]=t}};function Gg(r,e=!0){if(!(!r||r.playState==="finished"))try{r.stop?r.stop():(e&&r.commitStyles(),r.cancel())}catch{}}function VI(r,e){var t;let n=e?.toDefaultUnit||di;const i=r[r.length-1];if(DI(i)){const a=((t=i.match(/(-?[\d.]+)([a-z%]*)/))===null||t===void 0?void 0:t[2])||"";a&&(n=c=>c+a)}return n}function GI(){return window.__MOTION_DEV_TOOLS_RECORD}function YI(r,e,t,n={},i){const a=GI(),c=n.record!==!1&&a;let u,{duration:f=rn.duration,delay:h=rn.delay,endDelay:m=rn.endDelay,repeat:w=rn.repeat,easing:y=rn.easing,persist:_=!1,direction:S,offset:P,allowWebkitAcceleration:j=!1}=n;const U=qg(r),A=Hg(e);let T=Us.waapi();A&&jI(r,e);const O=Dh(e),$=TI(U.values,O),x=Zo.get(O);return Gg($.animation,!(yh(y)&&$.generator)&&n.record!==!1),()=>{const d=()=>{var F,V;return(V=(F=pc.get(r,O))!==null&&F!==void 0?F:x?.initialValue)!==null&&V!==void 0?V:0};let b=WI(KI(t),d);const H=VI(b,x);if(yh(y)){const F=y.createAnimation(b,e!=="opacity",d,O,$);y=F.easing,b=F.keyframes||b,f=F.duration||f}if(Eh(O)&&(Us.cssRegisterProperty()?kI(O):T=!1),A&&!Us.linearEasing()&&(Qi(y)||Ms(y)&&y.some(Qi))&&(T=!1),T){x&&(b=b.map(se=>hc(se)?x.toDefaultUnit(se):se)),b.length===1&&(!Us.partialKeyframes()||c)&&b.unshift(d());const F={delay:Go.ms(h),duration:Go.ms(f),endDelay:Go.ms(m),easing:Ms(y)?void 0:Vg(y,f),direction:S,iterations:w+1,fill:"both"};u=r.animate({[O]:b,offset:P,easing:Ms(y)?y.map(se=>Vg(se,f)):void 0},F),u.finished||(u.finished=new Promise((se,ce)=>{u.onfinish=se,u.oncancel=ce}));const V=b[b.length-1];u.finished.then(()=>{_||(pc.set(r,O,V),u.cancel())}).catch(Lg),j||(u.playbackRate=1.000001)}else if(i&&A)b=b.map(F=>typeof F=="string"?parseFloat(F):F),b.length===1&&b.unshift(parseFloat(d())),u=new i(F=>{pc.set(r,O,H?H(F):F)},b,Object.assign(Object.assign({},n),{duration:f,easing:y}));else{const F=b[b.length-1];pc.set(r,O,x&&hc(F)?x.toDefaultUnit(F):F)}return c&&a(r,e,b,{duration:f,delay:h,easing:y,repeat:w,offset:P},"motion-one"),$.setAnimation(u),u}}const ZI=(r,e)=>r[e]?Object.assign(Object.assign({},r),r[e]):Object.assign({},r);function Yg(r,e){var t;return typeof r=="string"?e?((t=e[r])!==null&&t!==void 0||(e[r]=document.querySelectorAll(r)),r=e[r]):r=document.querySelectorAll(r):r instanceof Element&&(r=[r]),Array.from(r||[])}const JI=r=>r(),Zg=(r,e,t=rn.duration)=>new Proxy({animations:r.map(JI).filter(Boolean),duration:t,options:e},XI),QI=r=>r.animations[0],XI={get:(r,e)=>{const t=QI(r);switch(e){case"duration":return r.duration;case"currentTime":return Go.s(t?.[e]||0);case"playbackRate":case"playState":return t?.[e];case"finished":return r.finished||(r.finished=Promise.all(r.animations.map(eD)).catch(Lg)),r.finished;case"stop":return()=>{r.animations.forEach(n=>Gg(n))};case"forEachNative":return n=>{r.animations.forEach(i=>n(i,r))};default:return typeof t?.[e]>"u"?void 0:()=>r.animations.forEach(n=>n[e]())}},set:(r,e,t)=>{switch(e){case"currentTime":t=Go.ms(t);case"playbackRate":for(let n=0;n<r.animations.length;n++)r.animations[n][e]=t;return!0}return!1}},eD=r=>r.finished;function tD(r,e,t){return Qi(r)?r(e,t):r}function rD(r){return function(t,n,i={}){t=Yg(t);const a=t.length;wh(!!a,"No valid element provided."),wh(!!n,"No keyframes defined.");const c=[];for(let u=0;u<a;u++){const f=t[u];for(const h in n){const m=ZI(i,h);m.delay=tD(m.delay,u,a);const w=YI(f,h,n[h],m,r);c.push(w)}}return Zg(c,i,i.duration)}}const nD=rD(kg);function iD(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}typeof SuppressedError=="function"&&SuppressedError;const sD={any:0,all:1};function oD(r,e,{root:t,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const a=Yg(r),c=new WeakMap,u=h=>{h.forEach(m=>{const w=c.get(m.target);if(m.isIntersecting!==!!w)if(m.isIntersecting){const y=e(m);Qi(y)?c.set(m.target,y):f.unobserve(m.target)}else w&&(w(m),c.delete(m.target))})},f=new IntersectionObserver(u,{root:t,rootMargin:n,threshold:typeof i=="number"?i:sD[i]});return a.forEach(h=>f.observe(h)),()=>f.disconnect()}function Sh(r,e,t){r.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:t}}))}function Jg(r,e,t){r.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:t}}))}const aD={isActive:r=>!!r.inView,subscribe:(r,{enable:e,disable:t},{inViewOptions:n={}})=>{const{once:i}=n,a=iD(n,["once"]);return oD(r,c=>{if(e(),Jg(r,"viewenter",c),!i)return u=>{t(),Jg(r,"viewleave",u)}},a)}},Qg=(r,e,t)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(t(),Sh(r,e,n))};[...Object.keys({inView:aD,hover:{isActive:r=>!!r.hover,subscribe:(r,{enable:e,disable:t})=>{const n=Qg(r,"hoverstart",e),i=Qg(r,"hoverend",t);return r.addEventListener("pointerenter",n),r.addEventListener("pointerleave",i),()=>{r.removeEventListener("pointerenter",n),r.removeEventListener("pointerleave",i)}}},press:{isActive:r=>!!r.press,subscribe:(r,{enable:e,disable:t})=>{const n=a=>{t(),Sh(r,"pressend",a),window.removeEventListener("pointerup",n)},i=a=>{e(),Sh(r,"pressstart",a),window.addEventListener("pointerup",n)};return r.addEventListener("pointerdown",i),()=>{r.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function cD(r,e={}){return Zg([()=>{const t=new kg(r,[0,1],e);return t.finished.catch(()=>{}),t}],e,e.duration)}function Xi(r,e,t){return(Qi(r)?cD:nD)(r,e,t)}/**
128
128
  * @license
129
129
  * Copyright 2018 Google LLC
130
130
  * SPDX-License-Identifier: BSD-3-Clause
131
- */const Dr=r=>r??tr;var Vo={},lD=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Xg={},Vr={};let Sh;const uD=[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];Vr.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},Vr.getSymbolTotalCodewords=function(e){return uD[e]},Vr.getBCHDigit=function(r){let e=0;for(;r!==0;)e++,r>>>=1;return e},Vr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Sh=e},Vr.isKanjiModeEnabled=function(){return typeof Sh<"u"},Vr.toSJIS=function(e){return Sh(e)};var fc={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},r.from=function(n,i){if(r.isValid(n))return n;try{return e(n)}catch{return i}}})(fc);function em(){this.buffer=[],this.length=0}em.prototype={get:function(r){const e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(let t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var hD=em;function Go(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}Go.prototype.set=function(r,e,t,n){const i=r*this.size+e;this.data[i]=t,n&&(this.reservedBit[i]=!0)},Go.prototype.get=function(r,e){return this.data[r*this.size+e]},Go.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t},Go.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var fD=Go,tm={};(function(r){const e=Vr.getSymbolSize;r.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,a=e(n),c=a===145?26:Math.ceil((a-13)/(2*i-2))*2,u=[a-7];for(let f=1;f<i-1;f++)u[f]=u[f-1]-c;return u.push(6),u.reverse()},r.getPositions=function(n){const i=[],a=r.getRowColCoords(n),c=a.length;for(let u=0;u<c;u++)for(let f=0;f<c;f++)u===0&&f===0||u===0&&f===c-1||u===c-1&&f===0||i.push([a[u],a[f]]);return i}})(tm);var rm={};const dD=Vr.getSymbolSize,nm=7;rm.getPositions=function(e){const t=dD(e);return[[0,0],[t-nm,0],[0,t-nm]]};var im={};(function(r){r.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};r.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},r.from=function(i){return r.isValid(i)?parseInt(i,10):void 0},r.getPenaltyN1=function(i){const a=i.size;let c=0,u=0,f=0,h=null,m=null;for(let w=0;w<a;w++){u=f=0,h=m=null;for(let y=0;y<a;y++){let x=i.get(w,y);x===h?u++:(u>=5&&(c+=e.N1+(u-5)),h=x,u=1),x=i.get(y,w),x===m?f++:(f>=5&&(c+=e.N1+(f-5)),m=x,f=1)}u>=5&&(c+=e.N1+(u-5)),f>=5&&(c+=e.N1+(f-5))}return c},r.getPenaltyN2=function(i){const a=i.size;let c=0;for(let u=0;u<a-1;u++)for(let f=0;f<a-1;f++){const h=i.get(u,f)+i.get(u,f+1)+i.get(u+1,f)+i.get(u+1,f+1);(h===4||h===0)&&c++}return c*e.N2},r.getPenaltyN3=function(i){const a=i.size;let c=0,u=0,f=0;for(let h=0;h<a;h++){u=f=0;for(let m=0;m<a;m++)u=u<<1&2047|i.get(h,m),m>=10&&(u===1488||u===93)&&c++,f=f<<1&2047|i.get(m,h),m>=10&&(f===1488||f===93)&&c++}return c*e.N3},r.getPenaltyN4=function(i){let a=0;const c=i.data.length;for(let f=0;f<c;f++)a+=i.data[f];return Math.abs(Math.ceil(a*100/c/5)-10)*e.N4};function t(n,i,a){switch(n){case r.Patterns.PATTERN000:return(i+a)%2===0;case r.Patterns.PATTERN001:return i%2===0;case r.Patterns.PATTERN010:return a%3===0;case r.Patterns.PATTERN011:return(i+a)%3===0;case r.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(a/3))%2===0;case r.Patterns.PATTERN101:return i*a%2+i*a%3===0;case r.Patterns.PATTERN110:return(i*a%2+i*a%3)%2===0;case r.Patterns.PATTERN111:return(i*a%3+(i+a)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}r.applyMask=function(i,a){const c=a.size;for(let u=0;u<c;u++)for(let f=0;f<c;f++)a.isReserved(f,u)||a.xor(f,u,t(i,f,u))},r.getBestMask=function(i,a){const c=Object.keys(r.Patterns).length;let u=0,f=1/0;for(let h=0;h<c;h++){a(h),r.applyMask(h,i);const m=r.getPenaltyN1(i)+r.getPenaltyN2(i)+r.getPenaltyN3(i)+r.getPenaltyN4(i);r.applyMask(h,i),m<f&&(f=m,u=h)}return u}})(im);var dc={};const pi=fc,pc=[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],gc=[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];dc.getBlocksCount=function(e,t){switch(t){case pi.L:return pc[(e-1)*4+0];case pi.M:return pc[(e-1)*4+1];case pi.Q:return pc[(e-1)*4+2];case pi.H:return pc[(e-1)*4+3];default:return}},dc.getTotalCodewordsCount=function(e,t){switch(t){case pi.L:return gc[(e-1)*4+0];case pi.M:return gc[(e-1)*4+1];case pi.Q:return gc[(e-1)*4+2];case pi.H:return gc[(e-1)*4+3];default:return}};var sm={},mc={};const Yo=new Uint8Array(512),vc=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)Yo[t]=e,vc[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)Yo[t]=Yo[t-255]})(),mc.log=function(e){if(e<1)throw new Error("log("+e+")");return vc[e]},mc.exp=function(e){return Yo[e]},mc.mul=function(e,t){return e===0||t===0?0:Yo[vc[e]+vc[t]]},function(r){const e=mc;r.mul=function(n,i){const a=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let u=0;u<i.length;u++)a[c+u]^=e.mul(n[c],i[u]);return a},r.mod=function(n,i){let a=new Uint8Array(n);for(;a.length-i.length>=0;){const c=a[0];for(let f=0;f<i.length;f++)a[f]^=e.mul(i[f],c);let u=0;for(;u<a.length&&a[u]===0;)u++;a=a.slice(u)}return a},r.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let a=0;a<n;a++)i=r.mul(i,new Uint8Array([1,e.exp(a)]));return i}}(sm);const om=sm;function Ch(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}Ch.prototype.initialize=function(e){this.degree=e,this.genPoly=om.generateECPolynomial(this.degree)},Ch.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=om.mod(t,this.genPoly),i=this.degree-n.length;if(i>0){const a=new Uint8Array(this.degree);return a.set(n,i),a}return n};var pD=Ch,am={},gi={},Oh={};Oh.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Sn={};const cm="[0-9]+",gD="[A-Z $%*+\\-./:]+";let Jo="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Jo=Jo.replace(/u/g,"\\u");const mD="(?:(?![A-Z0-9 $%*+\\-./:]|"+Jo+`)(?:.|[\r
132
- ]))+`;Sn.KANJI=new RegExp(Jo,"g"),Sn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Sn.BYTE=new RegExp(mD,"g"),Sn.NUMERIC=new RegExp(cm,"g"),Sn.ALPHANUMERIC=new RegExp(gD,"g");const vD=new RegExp("^"+Jo+"$"),yD=new RegExp("^"+cm+"$"),wD=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Sn.testKanji=function(e){return vD.test(e)},Sn.testNumeric=function(e){return yD.test(e)},Sn.testAlphanumeric=function(e){return wD.test(e)},function(r){const e=Oh,t=Sn;r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(a,c){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!e.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?a.ccBits[0]:c<27?a.ccBits[1]:a.ccBits[2]},r.getBestModeForData=function(a){return t.testNumeric(a)?r.NUMERIC:t.testAlphanumeric(a)?r.ALPHANUMERIC:t.testKanji(a)?r.KANJI:r.BYTE},r.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},r.isValid=function(a){return a&&a.bit&&a.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+i)}}r.from=function(a,c){if(r.isValid(a))return a;try{return n(a)}catch{return c}}}(gi),function(r){const e=Vr,t=dc,n=fc,i=gi,a=Oh,c=7973,u=e.getBCHDigit(c);function f(y,x,S){for(let P=1;P<=40;P++)if(x<=r.getCapacity(P,S,y))return P}function h(y,x){return i.getCharCountIndicator(y,x)+4}function m(y,x){let S=0;return y.forEach(function(P){const U=h(P.mode,x);S+=U+P.getBitsLength()}),S}function w(y,x){for(let S=1;S<=40;S++)if(m(y,S)<=r.getCapacity(S,x,i.MIXED))return S}r.from=function(x,S){return a.isValid(x)?parseInt(x,10):S},r.getCapacity=function(x,S,P){if(!a.isValid(x))throw new Error("Invalid QR Code version");typeof P>"u"&&(P=i.BYTE);const U=e.getSymbolTotalCodewords(x),j=t.getTotalCodewordsCount(x,S),A=(U-j)*8;if(P===i.MIXED)return A;const T=A-h(P,x);switch(P){case i.NUMERIC:return Math.floor(T/10*3);case i.ALPHANUMERIC:return Math.floor(T/11*2);case i.KANJI:return Math.floor(T/13);case i.BYTE:default:return Math.floor(T/8)}},r.getBestVersionForData=function(x,S){let P;const U=n.from(S,n.M);if(Array.isArray(x)){if(x.length>1)return w(x,U);if(x.length===0)return 1;P=x[0]}else P=x;return f(P.mode,P.getLength(),U)},r.getEncodedBits=function(x){if(!a.isValid(x)||x<7)throw new Error("Invalid QR Code version");let S=x<<12;for(;e.getBCHDigit(S)-u>=0;)S^=c<<e.getBCHDigit(S)-u;return x<<12|S}}(am);var lm={};const $h=Vr,um=1335,bD=21522,hm=$h.getBCHDigit(um);lm.getEncodedBits=function(e,t){const n=e.bit<<3|t;let i=n<<10;for(;$h.getBCHDigit(i)-hm>=0;)i^=um<<$h.getBCHDigit(i)-hm;return(n<<10|i)^bD};var fm={};const _D=gi;function Ls(r){this.mode=_D.NUMERIC,this.data=r.toString()}Ls.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Ls.prototype.getLength=function(){return this.data.length},Ls.prototype.getBitsLength=function(){return Ls.getBitsLength(this.data.length)},Ls.prototype.write=function(e){let t,n,i;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),i=parseInt(n,10),e.put(i,10);const a=this.data.length-t;a>0&&(n=this.data.substr(t),i=parseInt(n,10),e.put(i,a*3+1))};var ED=Ls;const xD=gi,Ah=["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 Ms(r){this.mode=xD.ALPHANUMERIC,this.data=r}Ms.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Ms.prototype.getLength=function(){return this.data.length},Ms.prototype.getBitsLength=function(){return Ms.getBitsLength(this.data.length)},Ms.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=Ah.indexOf(this.data[t])*45;n+=Ah.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(Ah.indexOf(this.data[t]),6)};var ID=Ms,DD=function(e){for(var t=[],n=e.length,i=0;i<n;i++){var a=e.charCodeAt(i);if(a>=55296&&a<=56319&&n>i+1){var c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(a=(a-55296)*1024+c-56320+65536,i+=1)}if(a<128){t.push(a);continue}if(a<2048){t.push(a>>6|192),t.push(a&63|128);continue}if(a<55296||a>=57344&&a<65536){t.push(a>>12|224),t.push(a>>6&63|128),t.push(a&63|128);continue}if(a>=65536&&a<=1114111){t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer};const SD=DD,CD=gi;function Us(r){this.mode=CD.BYTE,typeof r=="string"&&(r=SD(r)),this.data=new Uint8Array(r)}Us.getBitsLength=function(e){return e*8},Us.prototype.getLength=function(){return this.data.length},Us.prototype.getBitsLength=function(){return Us.getBitsLength(this.data.length)},Us.prototype.write=function(r){for(let e=0,t=this.data.length;e<t;e++)r.put(this.data[e],8)};var OD=Us;const $D=gi,AD=Vr;function js(r){this.mode=$D.KANJI,this.data=r}js.getBitsLength=function(e){return e*13},js.prototype.getLength=function(){return this.data.length},js.prototype.getBitsLength=function(){return js.getBitsLength(this.data.length)},js.prototype.write=function(r){let e;for(e=0;e<this.data.length;e++){let t=AD.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
133
- Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),r.put(t,13)}};var PD=js,dm={exports:{}};(function(r){var e={single_source_shortest_paths:function(t,n,i){var a={},c={};c[n]=0;var u=e.PriorityQueue.make();u.push(n,0);for(var f,h,m,w,y,x,S,P,U;!u.empty();){f=u.pop(),h=f.value,w=f.cost,y=t[h]||{};for(m in y)y.hasOwnProperty(m)&&(x=y[m],S=w+x,P=c[m],U=typeof c[m]>"u",(U||P>S)&&(c[m]=S,u.push(m,S),a[m]=h))}if(typeof i<"u"&&typeof c[i]>"u"){var j=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(j)}return a},extract_shortest_path_from_predecessor_list:function(t,n){for(var i=[],a=n;a;)i.push(a),t[a],a=t[a];return i.reverse(),i},find_path:function(t,n,i){var a=e.single_source_shortest_paths(t,n,i);return e.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(t){var n=e.PriorityQueue,i={},a;t=t||{};for(a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);return i.queue=[],i.sorter=t.sorter||n.default_sorter,i},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){var i={value:t,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=e})(dm),function(r){const e=gi,t=ED,n=ID,i=OD,a=PD,c=Sn,u=Vr,f=dm.exports;function h(j){return unescape(encodeURIComponent(j)).length}function m(j,A,T){const C=[];let $;for(;($=j.exec(T))!==null;)C.push({data:$[0],index:$.index,mode:A,length:$[0].length});return C}function w(j){const A=m(c.NUMERIC,e.NUMERIC,j),T=m(c.ALPHANUMERIC,e.ALPHANUMERIC,j);let C,$;return u.isKanjiModeEnabled()?(C=m(c.BYTE,e.BYTE,j),$=m(c.KANJI,e.KANJI,j)):(C=m(c.BYTE_KANJI,e.BYTE,j),$=[]),A.concat(T,C,$).sort(function(d,b){return d.index-b.index}).map(function(d){return{data:d.data,mode:d.mode,length:d.length}})}function y(j,A){switch(A){case e.NUMERIC:return t.getBitsLength(j);case e.ALPHANUMERIC:return n.getBitsLength(j);case e.KANJI:return a.getBitsLength(j);case e.BYTE:return i.getBitsLength(j)}}function x(j){return j.reduce(function(A,T){const C=A.length-1>=0?A[A.length-1]:null;return C&&C.mode===T.mode?(A[A.length-1].data+=T.data,A):(A.push(T),A)},[])}function S(j){const A=[];for(let T=0;T<j.length;T++){const C=j[T];switch(C.mode){case e.NUMERIC:A.push([C,{data:C.data,mode:e.ALPHANUMERIC,length:C.length},{data:C.data,mode:e.BYTE,length:C.length}]);break;case e.ALPHANUMERIC:A.push([C,{data:C.data,mode:e.BYTE,length:C.length}]);break;case e.KANJI:A.push([C,{data:C.data,mode:e.BYTE,length:h(C.data)}]);break;case e.BYTE:A.push([{data:C.data,mode:e.BYTE,length:h(C.data)}])}}return A}function P(j,A){const T={},C={start:{}};let $=["start"];for(let E=0;E<j.length;E++){const d=j[E],b=[];for(let H=0;H<d.length;H++){const F=d[H],V=""+E+H;b.push(V),T[V]={node:F,lastCount:0},C[V]={};for(let se=0;se<$.length;se++){const ce=$[se];T[ce]&&T[ce].node.mode===F.mode?(C[ce][V]=y(T[ce].lastCount+F.length,F.mode)-y(T[ce].lastCount,F.mode),T[ce].lastCount+=F.length):(T[ce]&&(T[ce].lastCount=F.length),C[ce][V]=y(F.length,F.mode)+4+e.getCharCountIndicator(F.mode,A))}}$=b}for(let E=0;E<$.length;E++)C[$[E]].end=0;return{map:C,table:T}}function U(j,A){let T;const C=e.getBestModeForData(j);if(T=e.from(A,C),T!==e.BYTE&&T.bit<C.bit)throw new Error('"'+j+'" cannot be encoded with mode '+e.toString(T)+`.
134
- Suggested mode is: `+e.toString(C));switch(T===e.KANJI&&!u.isKanjiModeEnabled()&&(T=e.BYTE),T){case e.NUMERIC:return new t(j);case e.ALPHANUMERIC:return new n(j);case e.KANJI:return new a(j);case e.BYTE:return new i(j)}}r.fromArray=function(A){return A.reduce(function(T,C){return typeof C=="string"?T.push(U(C,null)):C.data&&T.push(U(C.data,C.mode)),T},[])},r.fromString=function(A,T){const C=w(A,u.isKanjiModeEnabled()),$=S(C),E=P($,T),d=f.find_path(E.map,"start","end"),b=[];for(let H=1;H<d.length-1;H++)b.push(E.table[d[H]].node);return r.fromArray(x(b))},r.rawSplit=function(A){return r.fromArray(w(A,u.isKanjiModeEnabled()))}}(fm);const yc=Vr,Ph=fc,TD=hD,RD=fD,ND=tm,LD=rm,Th=im,Rh=dc,MD=pD,wc=am,UD=lm,jD=gi,Nh=fm;function FD(r,e){const t=r.size,n=LD.getPositions(e);for(let i=0;i<n.length;i++){const a=n[i][0],c=n[i][1];for(let u=-1;u<=7;u++)if(!(a+u<=-1||t<=a+u))for(let f=-1;f<=7;f++)c+f<=-1||t<=c+f||(u>=0&&u<=6&&(f===0||f===6)||f>=0&&f<=6&&(u===0||u===6)||u>=2&&u<=4&&f>=2&&f<=4?r.set(a+u,c+f,!0,!0):r.set(a+u,c+f,!1,!0))}}function BD(r){const e=r.size;for(let t=8;t<e-8;t++){const n=t%2===0;r.set(t,6,n,!0),r.set(6,t,n,!0)}}function kD(r,e){const t=ND.getPositions(e);for(let n=0;n<t.length;n++){const i=t[n][0],a=t[n][1];for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)c===-2||c===2||u===-2||u===2||c===0&&u===0?r.set(i+c,a+u,!0,!0):r.set(i+c,a+u,!1,!0)}}function qD(r,e){const t=r.size,n=wc.getEncodedBits(e);let i,a,c;for(let u=0;u<18;u++)i=Math.floor(u/3),a=u%3+t-8-3,c=(n>>u&1)===1,r.set(i,a,c,!0),r.set(a,i,c,!0)}function Lh(r,e,t){const n=r.size,i=UD.getEncodedBits(e,t);let a,c;for(a=0;a<15;a++)c=(i>>a&1)===1,a<6?r.set(a,8,c,!0):a<8?r.set(a+1,8,c,!0):r.set(n-15+a,8,c,!0),a<8?r.set(8,n-a-1,c,!0):a<9?r.set(8,15-a-1+1,c,!0):r.set(8,15-a-1,c,!0);r.set(n-8,8,1,!0)}function zD(r,e){const t=r.size;let n=-1,i=t-1,a=7,c=0;for(let u=t-1;u>0;u-=2)for(u===6&&u--;;){for(let f=0;f<2;f++)if(!r.isReserved(i,u-f)){let h=!1;c<e.length&&(h=(e[c]>>>a&1)===1),r.set(i,u-f,h),a--,a===-1&&(c++,a=7)}if(i+=n,i<0||t<=i){i-=n,n=-n;break}}}function HD(r,e,t){const n=new TD;t.forEach(function(f){n.put(f.mode.bit,4),n.put(f.getLength(),jD.getCharCountIndicator(f.mode,r)),f.write(n)});const i=yc.getSymbolTotalCodewords(r),a=Rh.getTotalCodewordsCount(r,e),c=(i-a)*8;for(n.getLengthInBits()+4<=c&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const u=(c-n.getLengthInBits())/8;for(let f=0;f<u;f++)n.put(f%2?17:236,8);return WD(n,r,e)}function WD(r,e,t){const n=yc.getSymbolTotalCodewords(e),i=Rh.getTotalCodewordsCount(e,t),a=n-i,c=Rh.getBlocksCount(e,t),u=n%c,f=c-u,h=Math.floor(n/c),m=Math.floor(a/c),w=m+1,y=h-m,x=new MD(y);let S=0;const P=new Array(c),U=new Array(c);let j=0;const A=new Uint8Array(r.buffer);for(let d=0;d<c;d++){const b=d<f?m:w;P[d]=A.slice(S,S+b),U[d]=x.encode(P[d]),S+=b,j=Math.max(j,b)}const T=new Uint8Array(n);let C=0,$,E;for($=0;$<j;$++)for(E=0;E<c;E++)$<P[E].length&&(T[C++]=P[E][$]);for($=0;$<y;$++)for(E=0;E<c;E++)T[C++]=U[E][$];return T}function KD(r,e,t,n){let i;if(Array.isArray(r))i=Nh.fromArray(r);else if(typeof r=="string"){let h=e;if(!h){const m=Nh.rawSplit(r);h=wc.getBestVersionForData(m,t)}i=Nh.fromString(r,h||40)}else throw new Error("Invalid data");const a=wc.getBestVersionForData(i,t);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`
131
+ */const Ir=r=>r??tr;var Jo={},lD=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Xg={},Vr={};let Oh;const uD=[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];Vr.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},Vr.getSymbolTotalCodewords=function(e){return uD[e]},Vr.getBCHDigit=function(r){let e=0;for(;r!==0;)e++,r>>>=1;return e},Vr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Oh=e},Vr.isKanjiModeEnabled=function(){return typeof Oh<"u"},Vr.toSJIS=function(e){return Oh(e)};var gc={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},r.from=function(n,i){if(r.isValid(n))return n;try{return e(n)}catch{return i}}})(gc);function em(){this.buffer=[],this.length=0}em.prototype={get:function(r){const e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(let t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var hD=em;function Qo(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}Qo.prototype.set=function(r,e,t,n){const i=r*this.size+e;this.data[i]=t,n&&(this.reservedBit[i]=!0)},Qo.prototype.get=function(r,e){return this.data[r*this.size+e]},Qo.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t},Qo.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var fD=Qo,tm={};(function(r){const e=Vr.getSymbolSize;r.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,a=e(n),c=a===145?26:Math.ceil((a-13)/(2*i-2))*2,u=[a-7];for(let f=1;f<i-1;f++)u[f]=u[f-1]-c;return u.push(6),u.reverse()},r.getPositions=function(n){const i=[],a=r.getRowColCoords(n),c=a.length;for(let u=0;u<c;u++)for(let f=0;f<c;f++)u===0&&f===0||u===0&&f===c-1||u===c-1&&f===0||i.push([a[u],a[f]]);return i}})(tm);var rm={};const dD=Vr.getSymbolSize,nm=7;rm.getPositions=function(e){const t=dD(e);return[[0,0],[t-nm,0],[0,t-nm]]};var im={};(function(r){r.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};r.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},r.from=function(i){return r.isValid(i)?parseInt(i,10):void 0},r.getPenaltyN1=function(i){const a=i.size;let c=0,u=0,f=0,h=null,m=null;for(let w=0;w<a;w++){u=f=0,h=m=null;for(let y=0;y<a;y++){let _=i.get(w,y);_===h?u++:(u>=5&&(c+=e.N1+(u-5)),h=_,u=1),_=i.get(y,w),_===m?f++:(f>=5&&(c+=e.N1+(f-5)),m=_,f=1)}u>=5&&(c+=e.N1+(u-5)),f>=5&&(c+=e.N1+(f-5))}return c},r.getPenaltyN2=function(i){const a=i.size;let c=0;for(let u=0;u<a-1;u++)for(let f=0;f<a-1;f++){const h=i.get(u,f)+i.get(u,f+1)+i.get(u+1,f)+i.get(u+1,f+1);(h===4||h===0)&&c++}return c*e.N2},r.getPenaltyN3=function(i){const a=i.size;let c=0,u=0,f=0;for(let h=0;h<a;h++){u=f=0;for(let m=0;m<a;m++)u=u<<1&2047|i.get(h,m),m>=10&&(u===1488||u===93)&&c++,f=f<<1&2047|i.get(m,h),m>=10&&(f===1488||f===93)&&c++}return c*e.N3},r.getPenaltyN4=function(i){let a=0;const c=i.data.length;for(let f=0;f<c;f++)a+=i.data[f];return Math.abs(Math.ceil(a*100/c/5)-10)*e.N4};function t(n,i,a){switch(n){case r.Patterns.PATTERN000:return(i+a)%2===0;case r.Patterns.PATTERN001:return i%2===0;case r.Patterns.PATTERN010:return a%3===0;case r.Patterns.PATTERN011:return(i+a)%3===0;case r.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(a/3))%2===0;case r.Patterns.PATTERN101:return i*a%2+i*a%3===0;case r.Patterns.PATTERN110:return(i*a%2+i*a%3)%2===0;case r.Patterns.PATTERN111:return(i*a%3+(i+a)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}r.applyMask=function(i,a){const c=a.size;for(let u=0;u<c;u++)for(let f=0;f<c;f++)a.isReserved(f,u)||a.xor(f,u,t(i,f,u))},r.getBestMask=function(i,a){const c=Object.keys(r.Patterns).length;let u=0,f=1/0;for(let h=0;h<c;h++){a(h),r.applyMask(h,i);const m=r.getPenaltyN1(i)+r.getPenaltyN2(i)+r.getPenaltyN3(i)+r.getPenaltyN4(i);r.applyMask(h,i),m<f&&(f=m,u=h)}return u}})(im);var mc={};const pi=gc,vc=[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],yc=[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,t){switch(t){case pi.L:return vc[(e-1)*4+0];case pi.M:return vc[(e-1)*4+1];case pi.Q:return vc[(e-1)*4+2];case pi.H:return vc[(e-1)*4+3];default:return}},mc.getTotalCodewordsCount=function(e,t){switch(t){case pi.L:return yc[(e-1)*4+0];case pi.M:return yc[(e-1)*4+1];case pi.Q:return yc[(e-1)*4+2];case pi.H:return yc[(e-1)*4+3];default:return}};var sm={},wc={};const Xo=new Uint8Array(512),bc=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)Xo[t]=e,bc[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)Xo[t]=Xo[t-255]})(),wc.log=function(e){if(e<1)throw new Error("log("+e+")");return bc[e]},wc.exp=function(e){return Xo[e]},wc.mul=function(e,t){return e===0||t===0?0:Xo[bc[e]+bc[t]]},function(r){const e=wc;r.mul=function(n,i){const a=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let u=0;u<i.length;u++)a[c+u]^=e.mul(n[c],i[u]);return a},r.mod=function(n,i){let a=new Uint8Array(n);for(;a.length-i.length>=0;){const c=a[0];for(let f=0;f<i.length;f++)a[f]^=e.mul(i[f],c);let u=0;for(;u<a.length&&a[u]===0;)u++;a=a.slice(u)}return a},r.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let a=0;a<n;a++)i=r.mul(i,new Uint8Array([1,e.exp(a)]));return i}}(sm);const om=sm;function Ch(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}Ch.prototype.initialize=function(e){this.degree=e,this.genPoly=om.generateECPolynomial(this.degree)},Ch.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=om.mod(t,this.genPoly),i=this.degree-n.length;if(i>0){const a=new Uint8Array(this.degree);return a.set(n,i),a}return n};var pD=Ch,am={},gi={},$h={};$h.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var On={};const cm="[0-9]+",gD="[A-Z $%*+\\-./:]+";let ea="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ea=ea.replace(/u/g,"\\u");const mD="(?:(?![A-Z0-9 $%*+\\-./:]|"+ea+`)(?:.|[\r
132
+ ]))+`;On.KANJI=new RegExp(ea,"g"),On.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),On.BYTE=new RegExp(mD,"g"),On.NUMERIC=new RegExp(cm,"g"),On.ALPHANUMERIC=new RegExp(gD,"g");const vD=new RegExp("^"+ea+"$"),yD=new RegExp("^"+cm+"$"),wD=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");On.testKanji=function(e){return vD.test(e)},On.testNumeric=function(e){return yD.test(e)},On.testAlphanumeric=function(e){return wD.test(e)},function(r){const e=$h,t=On;r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(a,c){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!e.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?a.ccBits[0]:c<27?a.ccBits[1]:a.ccBits[2]},r.getBestModeForData=function(a){return t.testNumeric(a)?r.NUMERIC:t.testAlphanumeric(a)?r.ALPHANUMERIC:t.testKanji(a)?r.KANJI:r.BYTE},r.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},r.isValid=function(a){return a&&a.bit&&a.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+i)}}r.from=function(a,c){if(r.isValid(a))return a;try{return n(a)}catch{return c}}}(gi),function(r){const e=Vr,t=mc,n=gc,i=gi,a=$h,c=7973,u=e.getBCHDigit(c);function f(y,_,S){for(let P=1;P<=40;P++)if(_<=r.getCapacity(P,S,y))return P}function h(y,_){return i.getCharCountIndicator(y,_)+4}function m(y,_){let S=0;return y.forEach(function(P){const j=h(P.mode,_);S+=j+P.getBitsLength()}),S}function w(y,_){for(let S=1;S<=40;S++)if(m(y,S)<=r.getCapacity(S,_,i.MIXED))return S}r.from=function(_,S){return a.isValid(_)?parseInt(_,10):S},r.getCapacity=function(_,S,P){if(!a.isValid(_))throw new Error("Invalid QR Code version");typeof P>"u"&&(P=i.BYTE);const j=e.getSymbolTotalCodewords(_),U=t.getTotalCodewordsCount(_,S),A=(j-U)*8;if(P===i.MIXED)return A;const T=A-h(P,_);switch(P){case i.NUMERIC:return Math.floor(T/10*3);case i.ALPHANUMERIC:return Math.floor(T/11*2);case i.KANJI:return Math.floor(T/13);case i.BYTE:default:return Math.floor(T/8)}},r.getBestVersionForData=function(_,S){let P;const j=n.from(S,n.M);if(Array.isArray(_)){if(_.length>1)return w(_,j);if(_.length===0)return 1;P=_[0]}else P=_;return f(P.mode,P.getLength(),j)},r.getEncodedBits=function(_){if(!a.isValid(_)||_<7)throw new Error("Invalid QR Code version");let S=_<<12;for(;e.getBCHDigit(S)-u>=0;)S^=c<<e.getBCHDigit(S)-u;return _<<12|S}}(am);var lm={};const Ah=Vr,um=1335,bD=21522,hm=Ah.getBCHDigit(um);lm.getEncodedBits=function(e,t){const n=e.bit<<3|t;let i=n<<10;for(;Ah.getBCHDigit(i)-hm>=0;)i^=um<<Ah.getBCHDigit(i)-hm;return(n<<10|i)^bD};var fm={};const _D=gi;function js(r){this.mode=_D.NUMERIC,this.data=r.toString()}js.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},js.prototype.getLength=function(){return this.data.length},js.prototype.getBitsLength=function(){return js.getBitsLength(this.data.length)},js.prototype.write=function(e){let t,n,i;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),i=parseInt(n,10),e.put(i,10);const a=this.data.length-t;a>0&&(n=this.data.substr(t),i=parseInt(n,10),e.put(i,a*3+1))};var ED=js;const xD=gi,Ph=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Fs(r){this.mode=xD.ALPHANUMERIC,this.data=r}Fs.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Fs.prototype.getLength=function(){return this.data.length},Fs.prototype.getBitsLength=function(){return Fs.getBitsLength(this.data.length)},Fs.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=Ph.indexOf(this.data[t])*45;n+=Ph.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(Ph.indexOf(this.data[t]),6)};var ID=Fs,DD=function(e){for(var t=[],n=e.length,i=0;i<n;i++){var a=e.charCodeAt(i);if(a>=55296&&a<=56319&&n>i+1){var c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(a=(a-55296)*1024+c-56320+65536,i+=1)}if(a<128){t.push(a);continue}if(a<2048){t.push(a>>6|192),t.push(a&63|128);continue}if(a<55296||a>=57344&&a<65536){t.push(a>>12|224),t.push(a>>6&63|128),t.push(a&63|128);continue}if(a>=65536&&a<=1114111){t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer};const SD=DD,OD=gi;function Bs(r){this.mode=OD.BYTE,typeof r=="string"&&(r=SD(r)),this.data=new Uint8Array(r)}Bs.getBitsLength=function(e){return e*8},Bs.prototype.getLength=function(){return this.data.length},Bs.prototype.getBitsLength=function(){return Bs.getBitsLength(this.data.length)},Bs.prototype.write=function(r){for(let e=0,t=this.data.length;e<t;e++)r.put(this.data[e],8)};var CD=Bs;const $D=gi,AD=Vr;function ks(r){this.mode=$D.KANJI,this.data=r}ks.getBitsLength=function(e){return e*13},ks.prototype.getLength=function(){return this.data.length},ks.prototype.getBitsLength=function(){return ks.getBitsLength(this.data.length)},ks.prototype.write=function(r){let e;for(e=0;e<this.data.length;e++){let t=AD.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
133
+ Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),r.put(t,13)}};var PD=ks,dm={exports:{}};(function(r){var e={single_source_shortest_paths:function(t,n,i){var a={},c={};c[n]=0;var u=e.PriorityQueue.make();u.push(n,0);for(var f,h,m,w,y,_,S,P,j;!u.empty();){f=u.pop(),h=f.value,w=f.cost,y=t[h]||{};for(m in y)y.hasOwnProperty(m)&&(_=y[m],S=w+_,P=c[m],j=typeof c[m]>"u",(j||P>S)&&(c[m]=S,u.push(m,S),a[m]=h))}if(typeof i<"u"&&typeof c[i]>"u"){var U=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(U)}return a},extract_shortest_path_from_predecessor_list:function(t,n){for(var i=[],a=n;a;)i.push(a),t[a],a=t[a];return i.reverse(),i},find_path:function(t,n,i){var a=e.single_source_shortest_paths(t,n,i);return e.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(t){var n=e.PriorityQueue,i={},a;t=t||{};for(a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);return i.queue=[],i.sorter=t.sorter||n.default_sorter,i},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){var i={value:t,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=e})(dm),function(r){const e=gi,t=ED,n=ID,i=CD,a=PD,c=On,u=Vr,f=dm.exports;function h(U){return unescape(encodeURIComponent(U)).length}function m(U,A,T){const O=[];let $;for(;($=U.exec(T))!==null;)O.push({data:$[0],index:$.index,mode:A,length:$[0].length});return O}function w(U){const A=m(c.NUMERIC,e.NUMERIC,U),T=m(c.ALPHANUMERIC,e.ALPHANUMERIC,U);let O,$;return u.isKanjiModeEnabled()?(O=m(c.BYTE,e.BYTE,U),$=m(c.KANJI,e.KANJI,U)):(O=m(c.BYTE_KANJI,e.BYTE,U),$=[]),A.concat(T,O,$).sort(function(d,b){return d.index-b.index}).map(function(d){return{data:d.data,mode:d.mode,length:d.length}})}function y(U,A){switch(A){case e.NUMERIC:return t.getBitsLength(U);case e.ALPHANUMERIC:return n.getBitsLength(U);case e.KANJI:return a.getBitsLength(U);case e.BYTE:return i.getBitsLength(U)}}function _(U){return U.reduce(function(A,T){const O=A.length-1>=0?A[A.length-1]:null;return O&&O.mode===T.mode?(A[A.length-1].data+=T.data,A):(A.push(T),A)},[])}function S(U){const A=[];for(let T=0;T<U.length;T++){const O=U[T];switch(O.mode){case e.NUMERIC:A.push([O,{data:O.data,mode:e.ALPHANUMERIC,length:O.length},{data:O.data,mode:e.BYTE,length:O.length}]);break;case e.ALPHANUMERIC:A.push([O,{data:O.data,mode:e.BYTE,length:O.length}]);break;case e.KANJI:A.push([O,{data:O.data,mode:e.BYTE,length:h(O.data)}]);break;case e.BYTE:A.push([{data:O.data,mode:e.BYTE,length:h(O.data)}])}}return A}function P(U,A){const T={},O={start:{}};let $=["start"];for(let x=0;x<U.length;x++){const d=U[x],b=[];for(let H=0;H<d.length;H++){const F=d[H],V=""+x+H;b.push(V),T[V]={node:F,lastCount:0},O[V]={};for(let se=0;se<$.length;se++){const ce=$[se];T[ce]&&T[ce].node.mode===F.mode?(O[ce][V]=y(T[ce].lastCount+F.length,F.mode)-y(T[ce].lastCount,F.mode),T[ce].lastCount+=F.length):(T[ce]&&(T[ce].lastCount=F.length),O[ce][V]=y(F.length,F.mode)+4+e.getCharCountIndicator(F.mode,A))}}$=b}for(let x=0;x<$.length;x++)O[$[x]].end=0;return{map:O,table:T}}function j(U,A){let T;const O=e.getBestModeForData(U);if(T=e.from(A,O),T!==e.BYTE&&T.bit<O.bit)throw new Error('"'+U+'" cannot be encoded with mode '+e.toString(T)+`.
134
+ Suggested mode is: `+e.toString(O));switch(T===e.KANJI&&!u.isKanjiModeEnabled()&&(T=e.BYTE),T){case e.NUMERIC:return new t(U);case e.ALPHANUMERIC:return new n(U);case e.KANJI:return new a(U);case e.BYTE:return new i(U)}}r.fromArray=function(A){return A.reduce(function(T,O){return typeof O=="string"?T.push(j(O,null)):O.data&&T.push(j(O.data,O.mode)),T},[])},r.fromString=function(A,T){const O=w(A,u.isKanjiModeEnabled()),$=S(O),x=P($,T),d=f.find_path(x.map,"start","end"),b=[];for(let H=1;H<d.length-1;H++)b.push(x.table[d[H]].node);return r.fromArray(_(b))},r.rawSplit=function(A){return r.fromArray(w(A,u.isKanjiModeEnabled()))}}(fm);const _c=Vr,Th=gc,TD=hD,RD=fD,ND=tm,LD=rm,Rh=im,Nh=mc,MD=pD,Ec=am,UD=lm,jD=gi,Lh=fm;function FD(r,e){const t=r.size,n=LD.getPositions(e);for(let i=0;i<n.length;i++){const a=n[i][0],c=n[i][1];for(let u=-1;u<=7;u++)if(!(a+u<=-1||t<=a+u))for(let f=-1;f<=7;f++)c+f<=-1||t<=c+f||(u>=0&&u<=6&&(f===0||f===6)||f>=0&&f<=6&&(u===0||u===6)||u>=2&&u<=4&&f>=2&&f<=4?r.set(a+u,c+f,!0,!0):r.set(a+u,c+f,!1,!0))}}function BD(r){const e=r.size;for(let t=8;t<e-8;t++){const n=t%2===0;r.set(t,6,n,!0),r.set(6,t,n,!0)}}function kD(r,e){const t=ND.getPositions(e);for(let n=0;n<t.length;n++){const i=t[n][0],a=t[n][1];for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)c===-2||c===2||u===-2||u===2||c===0&&u===0?r.set(i+c,a+u,!0,!0):r.set(i+c,a+u,!1,!0)}}function qD(r,e){const t=r.size,n=Ec.getEncodedBits(e);let i,a,c;for(let u=0;u<18;u++)i=Math.floor(u/3),a=u%3+t-8-3,c=(n>>u&1)===1,r.set(i,a,c,!0),r.set(a,i,c,!0)}function Mh(r,e,t){const n=r.size,i=UD.getEncodedBits(e,t);let a,c;for(a=0;a<15;a++)c=(i>>a&1)===1,a<6?r.set(a,8,c,!0):a<8?r.set(a+1,8,c,!0):r.set(n-15+a,8,c,!0),a<8?r.set(8,n-a-1,c,!0):a<9?r.set(8,15-a-1+1,c,!0):r.set(8,15-a-1,c,!0);r.set(n-8,8,1,!0)}function zD(r,e){const t=r.size;let n=-1,i=t-1,a=7,c=0;for(let u=t-1;u>0;u-=2)for(u===6&&u--;;){for(let f=0;f<2;f++)if(!r.isReserved(i,u-f)){let h=!1;c<e.length&&(h=(e[c]>>>a&1)===1),r.set(i,u-f,h),a--,a===-1&&(c++,a=7)}if(i+=n,i<0||t<=i){i-=n,n=-n;break}}}function HD(r,e,t){const n=new TD;t.forEach(function(f){n.put(f.mode.bit,4),n.put(f.getLength(),jD.getCharCountIndicator(f.mode,r)),f.write(n)});const i=_c.getSymbolTotalCodewords(r),a=Nh.getTotalCodewordsCount(r,e),c=(i-a)*8;for(n.getLengthInBits()+4<=c&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const u=(c-n.getLengthInBits())/8;for(let f=0;f<u;f++)n.put(f%2?17:236,8);return WD(n,r,e)}function WD(r,e,t){const n=_c.getSymbolTotalCodewords(e),i=Nh.getTotalCodewordsCount(e,t),a=n-i,c=Nh.getBlocksCount(e,t),u=n%c,f=c-u,h=Math.floor(n/c),m=Math.floor(a/c),w=m+1,y=h-m,_=new MD(y);let S=0;const P=new Array(c),j=new Array(c);let U=0;const A=new Uint8Array(r.buffer);for(let d=0;d<c;d++){const b=d<f?m:w;P[d]=A.slice(S,S+b),j[d]=_.encode(P[d]),S+=b,U=Math.max(U,b)}const T=new Uint8Array(n);let O=0,$,x;for($=0;$<U;$++)for(x=0;x<c;x++)$<P[x].length&&(T[O++]=P[x][$]);for($=0;$<y;$++)for(x=0;x<c;x++)T[O++]=j[x][$];return T}function KD(r,e,t,n){let i;if(Array.isArray(r))i=Lh.fromArray(r);else if(typeof r=="string"){let h=e;if(!h){const m=Lh.rawSplit(r);h=Ec.getBestVersionForData(m,t)}i=Lh.fromString(r,h||40)}else throw new Error("Invalid data");const a=Ec.getBestVersionForData(i,t);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`
135
135
  The chosen QR Code version cannot contain this amount of data.
136
136
  Minimum version required to store current data is: `+a+`.
137
- `);const c=HD(e,t,i),u=yc.getSymbolSize(e),f=new RD(u);return FD(f,e),BD(f),kD(f,e),Lh(f,t,0),e>=7&&qD(f,e),zD(f,c),isNaN(n)&&(n=Th.getBestMask(f,Lh.bind(null,f,t))),Th.applyMask(n,f),Lh(f,t,n),{modules:f,version:e,errorCorrectionLevel:t,maskPattern:n,segments:i}}Xg.create=function(e,t){if(typeof e>"u"||e==="")throw new Error("No input text");let n=Ph.M,i,a;return typeof t<"u"&&(n=Ph.from(t.errorCorrectionLevel,Ph.M),i=wc.from(t.version),a=Th.from(t.maskPattern),t.toSJISFunc&&yc.setToSJISFunction(t.toSJISFunc)),KD(e,i,n,a)};var pm={},Mh={};(function(r){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+t);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),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("")}}r.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,c=n.scale||4;return{width:a,scale:a?4:c,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},r.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},r.getImageWidth=function(n,i){const a=r.getScale(n,i);return Math.floor((n+i.margin*2)*a)},r.qrToImageData=function(n,i,a){const c=i.modules.size,u=i.modules.data,f=r.getScale(c,a),h=Math.floor((c+a.margin*2)*f),m=a.margin*f,w=[a.color.light,a.color.dark];for(let y=0;y<h;y++)for(let x=0;x<h;x++){let S=(y*h+x)*4,P=a.color.light;if(y>=m&&x>=m&&y<h-m&&x<h-m){const U=Math.floor((y-m)/f),j=Math.floor((x-m)/f);P=w[u[U*c+j]?1:0]}n[S++]=P.r,n[S++]=P.g,n[S++]=P.b,n[S]=P.a}}})(Mh),function(r){const e=Mh;function t(i,a,c){i.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=c,a.width=c,a.style.height=c+"px",a.style.width=c+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(a,c,u){let f=u,h=c;typeof f>"u"&&(!c||!c.getContext)&&(f=c,c=void 0),c||(h=n()),f=e.getOptions(f);const m=e.getImageWidth(a.modules.size,f),w=h.getContext("2d"),y=w.createImageData(m,m);return e.qrToImageData(y.data,a,f),t(w,h,m),w.putImageData(y,0,0),h},r.renderToDataURL=function(a,c,u){let f=u;typeof f>"u"&&(!c||!c.getContext)&&(f=c,c=void 0),f||(f={});const h=r.render(a,c,f),m=f.type||"image/png",w=f.rendererOpts||{};return h.toDataURL(m,w.quality)}}(pm);var gm={};const VD=Mh;function mm(r,e){const t=r.a/255,n=e+'="'+r.hex+'"';return t<1?n+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':n}function Uh(r,e,t){let n=r+e;return typeof t<"u"&&(n+=" "+t),n}function GD(r,e,t){let n="",i=0,a=!1,c=0;for(let u=0;u<r.length;u++){const f=Math.floor(u%e),h=Math.floor(u/e);!f&&!a&&(a=!0),r[u]?(c++,u>0&&f>0&&r[u-1]||(n+=a?Uh("M",f+t,.5+h+t):Uh("m",i,0),i=0,a=!1),f+1<e&&r[u+1]||(n+=Uh("h",c),c=0)):i++}return n}gm.render=function(e,t,n){const i=VD.getOptions(t),a=e.modules.size,c=e.modules.data,u=a+i.margin*2,f=i.color.light.a?"<path "+mm(i.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",h="<path "+mm(i.color.dark,"stroke")+' d="'+GD(c,a,i.margin)+'"/>',m='viewBox="0 0 '+u+" "+u+'"',y='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+m+' shape-rendering="crispEdges">'+f+h+`</svg>
138
- `;return typeof n=="function"&&n(null,y),y};const YD=lD,jh=Xg,vm=pm,JD=gm;function Fh(r,e,t,n,i){const a=[].slice.call(arguments,1),c=a.length,u=typeof a[c-1]=="function";if(!u&&!YD())throw new Error("Callback required as last argument");if(u){if(c<2)throw new Error("Too few arguments provided");c===2?(i=t,t=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=t,t=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(t=e,e=n=void 0):c===2&&!e.getContext&&(n=t,t=e,e=void 0),new Promise(function(f,h){try{const m=jh.create(t,n);f(r(m,e,n))}catch(m){h(m)}})}try{const f=jh.create(t,n);i(null,r(f,e,n))}catch(f){i(f)}}Vo.create=jh.create,Vo.toCanvas=Fh.bind(null,vm.render),Vo.toDataURL=Fh.bind(null,vm.renderToDataURL),Vo.toString=Fh.bind(null,function(r,e,t){return JD.render(r,t)});var ZD=Object.defineProperty,ym=Object.getOwnPropertySymbols,QD=Object.prototype.hasOwnProperty,XD=Object.prototype.propertyIsEnumerable,wm=(r,e,t)=>e in r?ZD(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Bh=(r,e)=>{for(var t in e||(e={}))QD.call(e,t)&&wm(r,t,e[t]);if(ym)for(var t of ym(e))XD.call(e,t)&&wm(r,t,e[t]);return r};function eS(){var r;const e=(r=ui.state.themeMode)!=null?r:"dark",t={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{"--wcm-color-fg-1":t.foreground[1],"--wcm-color-fg-2":t.foreground[2],"--wcm-color-fg-3":t.foreground[3],"--wcm-color-bg-1":t.background[1],"--wcm-color-bg-2":t.background[2],"--wcm-color-bg-3":t.background[3],"--wcm-color-overlay":t.overlay}}function bm(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const rt={getPreset(r){return bm()[r]},setTheme(){const r=document.querySelector(":root"),{themeVariables:e}=ui.state;if(r){const t=Bh(Bh(Bh({},eS()),bm()),e);Object.entries(t).forEach(([n,i])=>r.style.setProperty(n,i))}},globalCss:lt`*,::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 wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},tS=lt`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var rS=Object.defineProperty,nS=Object.getOwnPropertyDescriptor,Fs=(r,e,t,n)=>{for(var i=n>1?void 0:n?nS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&rS(e,t,i),i};let mi=class extends Ye{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const r={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),he`<button class="${qn(r)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};mi.styles=[rt.globalCss,tS],Fs([Be({type:Boolean})],mi.prototype,"disabled",2),Fs([Be()],mi.prototype,"iconLeft",2),Fs([Be()],mi.prototype,"iconRight",2),Fs([Be()],mi.prototype,"onClick",2),Fs([Be()],mi.prototype,"variant",2),mi=Fs([ot("wcm-button")],mi);const iS=lt`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-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(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var sS=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,kh=(r,e,t,n)=>{for(var i=n>1?void 0:n?oS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&sS(e,t,i),i};let Zo=class extends Ye{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const r={"wcm-secondary":this.variant==="secondary"};return he`<button ?disabled="${this.disabled}" class="${qn(r)}"><slot></slot></button>`}};Zo.styles=[rt.globalCss,iS],kh([Be({type:Boolean})],Zo.prototype,"disabled",2),kh([Be()],Zo.prototype,"variant",2),Zo=kh([ot("wcm-button-big")],Zo);const aS=lt`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var cS=Object.defineProperty,lS=Object.getOwnPropertyDescriptor,uS=(r,e,t,n)=>{for(var i=n>1?void 0:n?lS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&cS(e,t,i),i};let qh=class extends Ye{render(){return he`<div><slot></slot></div>`}};qh.styles=[rt.globalCss,aS],qh=uS([ot("wcm-info-footer")],qh);const ht={CROSS_ICON:Nt`<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:Nt`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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>`,SEARCH_ICON:Nt`<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>`,WALLET_PLACEHOLDER:Nt`<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>`,GLOBE_ICON:Nt`<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>`},hS=lt`.wcm-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(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var fS=Object.defineProperty,dS=Object.getOwnPropertyDescriptor,pS=(r,e,t,n)=>{for(var i=n>1?void 0:n?dS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&fS(e,t,i),i};let zh=class extends Ye{render(){return he`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${ht.WALLET_CONNECT_LOGO} <button @click="${Wi.close}">${ht.CROSS_ICON}</button></div>`}};zh.styles=[rt.globalCss,hS],zh=pS([ot("wcm-modal-backcard")],zh);const gS=lt`main{padding:20px;padding-top:0;width:100%}`;var mS=Object.defineProperty,vS=Object.getOwnPropertyDescriptor,yS=(r,e,t,n)=>{for(var i=n>1?void 0:n?vS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&mS(e,t,i),i};let Hh=class extends Ye{render(){return he`<main><slot></slot></main>`}};Hh.styles=[rt.globalCss,gS],Hh=yS([ot("wcm-modal-content")],Hh);const wS=lt`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var bS=Object.defineProperty,_S=Object.getOwnPropertyDescriptor,ES=(r,e,t,n)=>{for(var i=n>1?void 0:n?_S(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&bS(e,t,i),i};let Wh=class extends Ye{render(){return he`<footer><slot></slot></footer>`}};Wh.styles=[rt.globalCss,wS],Wh=ES([ot("wcm-modal-footer")],Wh);const xS=lt`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var IS=Object.defineProperty,DS=Object.getOwnPropertyDescriptor,Qo=(r,e,t,n)=>{for(var i=n>1?void 0:n?DS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&IS(e,t,i),i};let Xi=class extends Ye{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return he`<button class="wcm-back-btn" @click="${Pt.goBack}">${ht.BACK_ICON}</button>`}actionBtnTemplate(){return he`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const r={"wcm-border":this.border},e=Pt.state.history.length>1,t=this.title?he`<wcm-text variant="big-bold">${this.title}</wcm-text>`:he`<slot></slot>`;return he`<header class="${qn(r)}">${e?this.backBtnTemplate():null} ${t} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Xi.styles=[rt.globalCss,xS],Qo([Be()],Xi.prototype,"title",2),Qo([Be()],Xi.prototype,"onAction",2),Qo([Be()],Xi.prototype,"actionIcon",2),Qo([Be({type:Boolean})],Xi.prototype,"border",2),Xi=Qo([ot("wcm-modal-header")],Xi);const Pe={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(r,e){const t=r.renderRoot.querySelector(e);if(!t)throw new Error(`${e} not found`);return t},getWalletIcon({id:r,image_id:e}){const{walletImages:t}=Kr.state;return t!=null&&t[r]?t[r]:e?Lr.getWalletImageUrl(e):""},getWalletName(r,e=!1){return e&&r.length>8?`${r.substring(0,8)}..`:r},isMobileAnimation(){return window.innerWidth<=Pe.MOBILE_BREAKPOINT},async preloadImage(r){const e=new Promise((t,n)=>{const i=new Image;i.onload=t,i.onerror=n,i.crossOrigin="anonymous",i.src=r});return Promise.race([e,we.wait(3e3)])},getErrorMessage(r){return r instanceof Error?r.message:"Unknown Error"},debounce(r,e=500){let t;return(...n)=>{function i(){r(...n)}t&&clearTimeout(t),t=setTimeout(i,e)}},handleMobileLinking(r){const{walletConnectUri:e}=zt.state,{mobile:t,name:n}=r,i=t?.native,a=t?.universal;Pe.setRecentWallet(r);function c(u){let f="";i?f=we.formatUniversalUrl(i,u,n):a&&(f=we.formatNativeUrl(a,u,n)),we.openHref(f,"_self")}e&&c(e)},handleAndroidLinking(){const{walletConnectUri:r}=zt.state;r&&(we.setWalletConnectAndroidDeepLink(r),we.openHref(r,"_self"))},async handleUriCopy(){const{walletConnectUri:r}=zt.state;if(r)try{await navigator.clipboard.writeText(r),hi.openToast("Link copied","success")}catch{hi.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:r}=Kr.state,e=Object.values(r??{});return Object.values(e)},truncate(r,e=8){return r.length<=e?r:`${r.substring(0,4)}...${r.substring(r.length-4)}`},setRecentWallet(r){try{localStorage.setItem(Pe.WCM_RECENT_WALLET_DATA,JSON.stringify(r))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const r=localStorage.getItem(Pe.WCM_RECENT_WALLET_DATA);return r?JSON.parse(r):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(r,e){return r.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){we.openHref(Pe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:r,mobile:e}=we.getWalletRouterData(),t=!!r?.native,n=!!r?.universal,i=!!e?.native||!!e?.universal;return{isDesktop:t,isMobile:i,isWeb:n}},goToConnectingView(r){Pt.setData({Wallet:r});const e=we.isMobile(),{isDesktop:t,isWeb:n,isMobile:i}=Pe.getCachedRouterWalletPlatforms();e?i?Pt.push("MobileConnecting"):n?Pt.push("WebConnecting"):Pt.push("InstallWallet"):t?Pt.push("DesktopConnecting"):n?Pt.push("WebConnecting"):i?Pt.push("MobileQrcodeConnecting"):Pt.push("InstallWallet")}},SS=lt`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var CS=Object.defineProperty,OS=Object.getOwnPropertyDescriptor,Kh=(r,e,t,n)=>{for(var i=n>1?void 0:n?OS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&CS(e,t,i),i};let Xo=class extends Ye{constructor(){super(),this.view=Pt.state.view,this.prevView=Pt.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Pt.subscribe(r=>{this.view!==r.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([r])=>{const e=`${r.contentRect.height}px`;this.oldHeight!=="0px"&&Qi(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var r,e;(r=this.unsubscribe)==null||r.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return Pe.getShadowRootElement(this,".wcm-router")}get contentEl(){return Pe.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return he`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return he`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return he`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return he`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return he`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return he`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return he`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return he`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return he`<div>Not Found</div>`}}async onChangeRoute(){await Qi(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=Pt.state.view,Qi(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return he`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};Xo.styles=[rt.globalCss,SS],Kh([Mr()],Xo.prototype,"view",2),Kh([Mr()],Xo.prototype,"prevView",2),Xo=Kh([ot("wcm-modal-router")],Xo);const $S=lt`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(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var AS=Object.defineProperty,PS=Object.getOwnPropertyDescriptor,_m=(r,e,t,n)=>{for(var i=n>1?void 0:n?PS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&AS(e,t,i),i};let bc=class extends Ye{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=hi.subscribe(r=>{r.open?(this.open=!0,this.timeout=setTimeout(()=>hi.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this),clearTimeout(this.timeout),hi.closeToast()}render(){const{message:r,variant:e}=hi.state,t={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?he`<div class="${qn(t)}">${e==="success"?ht.CHECKMARK_ICON:null} ${e==="error"?ht.CROSS_ICON:null}<wcm-text variant="small-regular">${r}</wcm-text></div>`:null}};bc.styles=[rt.globalCss,$S],_m([Mr()],bc.prototype,"open",2),bc=_m([ot("wcm-modal-toast")],bc);const TS=.1,Em=2.5,zn=7;function Vh(r,e,t){return r===e?!1:(r-e<0?e-r:r-e)<=t+TS}function RS(r,e){const t=Array.prototype.slice.call(Vo.create(r,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(t.length);return t.reduce((i,a,c)=>(c%n===0?i.push([a]):i[i.length-1].push(a))&&i,[])}const NS={generate(r,e,t){const n="#141414",i="#ffffff",a=[],c=RS(r,"Q"),u=e/c.length,f=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];f.forEach(({x:S,y:P})=>{const U=(c.length-zn)*u*S,j=(c.length-zn)*u*P,A=.45;for(let T=0;T<f.length;T+=1){const C=u*(zn-T*2);a.push(Nt`<rect fill="${T%2===0?n:i}" height="${C}" rx="${C*A}" ry="${C*A}" width="${C}" x="${U+u*T}" y="${j+u*T}">`)}});const h=Math.floor((t+25)/u),m=c.length/2-h/2,w=c.length/2+h/2-1,y=[];c.forEach((S,P)=>{S.forEach((U,j)=>{if(c[P][j]&&!(P<zn&&j<zn||P>c.length-(zn+1)&&j<zn||P<zn&&j>c.length-(zn+1))&&!(P>m&&P<w&&j>m&&j<w)){const A=P*u+u/2,T=j*u+u/2;y.push([A,T])}})});const x={};return y.forEach(([S,P])=>{x[S]?x[S].push(P):x[S]=[P]}),Object.entries(x).map(([S,P])=>{const U=P.filter(j=>P.every(A=>!Vh(j,A,u)));return[Number(S),U]}).forEach(([S,P])=>{P.forEach(U=>{a.push(Nt`<circle cx="${S}" cy="${U}" fill="${n}" r="${u/Em}">`)})}),Object.entries(x).filter(([S,P])=>P.length>1).map(([S,P])=>{const U=P.filter(j=>P.some(A=>Vh(j,A,u)));return[Number(S),U]}).map(([S,P])=>{P.sort((j,A)=>j<A?-1:1);const U=[];for(const j of P){const A=U.find(T=>T.some(C=>Vh(j,C,u)));A?A.push(j):U.push([j])}return[S,U.map(j=>[j[0],j[j.length-1]])]}).forEach(([S,P])=>{P.forEach(([U,j])=>{a.push(Nt`<line x1="${S}" x2="${S}" y1="${U}" y2="${j}" stroke="${n}" stroke-width="${u/(Em/2)}" stroke-linecap="round">`)})}),a}},LS=lt`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var MS=Object.defineProperty,US=Object.getOwnPropertyDescriptor,Bs=(r,e,t,n)=>{for(var i=n>1?void 0:n?US(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&MS(e,t,i),i};let Hn=class extends Ye{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const r=ui.state.themeMode==="light"?this.size:this.size-36;return Nt`<svg height="${r}" width="${r}">${NS.generate(this.uri,r,r/4)}</svg>`}render(){const r={"wcm-dark":ui.state.themeMode==="dark"};return he`<div style="${`width: ${this.size}px`}" class="${qn(r)}">${this.walletId||this.imageUrl?he`<wcm-wallet-image walletId="${Dr(this.walletId)}" imageId="${Dr(this.imageId)}" imageUrl="${Dr(this.imageUrl)}"></wcm-wallet-image>`:ht.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Hn.styles=[rt.globalCss,LS],Bs([Be()],Hn.prototype,"uri",2),Bs([Be({type:Number})],Hn.prototype,"size",2),Bs([Be()],Hn.prototype,"imageId",2),Bs([Be()],Hn.prototype,"walletId",2),Bs([Be()],Hn.prototype,"imageUrl",2),Hn=Bs([ot("wcm-qrcode")],Hn);const jS=lt`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-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(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-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(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var FS=Object.defineProperty,BS=Object.getOwnPropertyDescriptor,xm=(r,e,t,n)=>{for(var i=n>1?void 0:n?BS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&FS(e,t,i),i};let _c=class extends Ye{constructor(){super(...arguments),this.onChange=()=>null}render(){return he`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${ht.SEARCH_ICON}`}};_c.styles=[rt.globalCss,jS],xm([Be()],_c.prototype,"onChange",2),_c=xm([ot("wcm-search-input")],_c);const kS=lt`@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(--wcm-accent-color)}`;var qS=Object.defineProperty,zS=Object.getOwnPropertyDescriptor,HS=(r,e,t,n)=>{for(var i=n>1?void 0:n?zS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&qS(e,t,i),i};let Gh=class extends Ye{render(){return he`<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>`}};Gh.styles=[rt.globalCss,kS],Gh=HS([ot("wcm-spinner")],Gh);const WS=lt`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var KS=Object.defineProperty,VS=Object.getOwnPropertyDescriptor,Yh=(r,e,t,n)=>{for(var i=n>1?void 0:n?VS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&KS(e,t,i),i};let ea=class extends Ye{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const r={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return he`<span><slot class="${qn(r)}"></slot></span>`}};ea.styles=[rt.globalCss,WS],Yh([Be()],ea.prototype,"variant",2),Yh([Be()],ea.prototype,"color",2),ea=Yh([ot("wcm-text")],ea);const GS=lt`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var YS=Object.defineProperty,JS=Object.getOwnPropertyDescriptor,vi=(r,e,t,n)=>{for(var i=n>1?void 0:n?JS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&YS(e,t,i),i};let Cn=class extends Ye{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?he`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?he`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){og.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var r;return he`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${Dr(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(r=this.label)!=null?r:Pe.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};Cn.styles=[rt.globalCss,GS],vi([Be()],Cn.prototype,"onClick",2),vi([Be()],Cn.prototype,"name",2),vi([Be()],Cn.prototype,"walletId",2),vi([Be()],Cn.prototype,"label",2),vi([Be()],Cn.prototype,"imageId",2),vi([Be({type:Boolean})],Cn.prototype,"installed",2),vi([Be({type:Boolean})],Cn.prototype,"recent",2),Cn=vi([ot("wcm-wallet-button")],Cn);const ZS=lt`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-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(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var QS=Object.defineProperty,XS=Object.getOwnPropertyDescriptor,Ec=(r,e,t,n)=>{for(var i=n>1?void 0:n?XS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&QS(e,t,i),i};let ks=class extends Ye{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var r;const e=(r=this.imageUrl)!=null&&r.length?this.imageUrl:Pe.getWalletIcon({id:this.walletId,image_id:this.imageId});return he`${e.length?he`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:ht.WALLET_PLACEHOLDER}`}};ks.styles=[rt.globalCss,ZS],Ec([Be()],ks.prototype,"walletId",2),Ec([Be()],ks.prototype,"imageId",2),Ec([Be()],ks.prototype,"imageUrl",2),ks=Ec([ot("wcm-wallet-image")],ks);var eC=Object.defineProperty,tC=Object.getOwnPropertyDescriptor,Im=(r,e,t,n)=>{for(var i=n>1?void 0:n?tC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&eC(e,t,i),i};let Jh=class extends Ye{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(r){try{r!=null&&r.length&&await Promise.all(r.map(async e=>Pe.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",r)}}async preloadListings(){if(Kr.state.enableExplorer){await Lr.getRecomendedWallets(),zt.setIsDataLoaded(!0);const{recomendedWallets:r}=Lr.state,e=r.map(t=>Pe.getWalletIcon(t));await this.loadImages(e)}else zt.setIsDataLoaded(!0)}async preloadCustomImages(){const r=Pe.getCustomImageUrls();await this.loadImages(r)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(r){console.error(r),hi.openToast("Failed preloading","error")}}};Im([Mr()],Jh.prototype,"preload",2),Jh=Im([ot("wcm-explorer-context")],Jh);var rC=Object.defineProperty,nC=Object.getOwnPropertyDescriptor,iC=(r,e,t,n)=>{for(var i=n>1?void 0:n?nC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&rC(e,t,i),i};let Dm=class extends Ye{constructor(){super(),this.unsubscribeTheme=void 0,rt.setTheme(),this.unsubscribeTheme=ui.subscribe(rt.setTheme)}disconnectedCallback(){var r;(r=this.unsubscribeTheme)==null||r.call(this)}};Dm=iC([ot("wcm-theme-context")],Dm);const sC=lt`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var oC=Object.defineProperty,aC=Object.getOwnPropertyDescriptor,cC=(r,e,t,n)=>{for(var i=n>1?void 0:n?aC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&oC(e,t,i),i};let Zh=class extends Ye{onGoToQrcode(){Pt.push("Qrcode")}render(){const{recomendedWallets:r}=Lr.state,e=[...r,...r],t=we.RECOMMENDED_WALLET_AMOUNT*2;return he`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ht.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${ht.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(t)].map((n,i)=>{const a=e[i%e.length];return a?he`<wcm-wallet-image walletId="${a.id}" imageId="${a.image_id}"></wcm-wallet-image>`:ht.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${Pe.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};Zh.styles=[rt.globalCss,sC],Zh=cC([ot("wcm-android-wallet-selection")],Zh);const lC=lt`@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(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var uC=Object.defineProperty,hC=Object.getOwnPropertyDescriptor,qs=(r,e,t,n)=>{for(var i=n>1?void 0:n?hC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&uC(e,t,i),i};let yi=class extends Ye{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var r,e;const t=(e=(r=ui.state.themeVariables)==null?void 0:r["--wcm-wallet-icon-large-border-radius"])!=null?e:rt.getPreset("--wcm-wallet-icon-large-border-radius");let n=0;t.includes("%")?n=88/100*parseInt(t,10):n=parseInt(t,10),n*=1.17;const i=317-n*1.57,a=425-n*1.8;return he`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${a}"></use></svg>`}render(){const r={"wcm-error":this.isError,"wcm-stale":this.isStale};return he`<div class="${qn(r)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${Dr(this.walletId)}" imageId="${Dr(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};yi.styles=[rt.globalCss,lC],qs([Be()],yi.prototype,"walletId",2),qs([Be()],yi.prototype,"imageId",2),qs([Be({type:Boolean})],yi.prototype,"isError",2),qs([Be({type:Boolean})],yi.prototype,"isStale",2),qs([Be()],yi.prototype,"label",2),yi=qs([ot("wcm-connector-waiting")],yi);const zs={manualWallets(){var r,e;const{mobileWallets:t,desktopWallets:n}=Kr.state,i=(r=zs.recentWallet())==null?void 0:r.id,a=we.isMobile()?t:n,c=a?.filter(u=>i!==u.id);return(e=we.isMobile()?c?.map(({id:u,name:f,links:h})=>({id:u,name:f,mobile:h,links:h})):c?.map(({id:u,name:f,links:h})=>({id:u,name:f,desktop:h,links:h})))!=null?e:[]},recentWallet(){return Pe.getRecentWallet()},recomendedWallets(r=!1){var e;const t=r||(e=zs.recentWallet())==null?void 0:e.id,{recomendedWallets:n}=Lr.state;return n.filter(i=>t!==i.id)}},wi={onConnecting(r){Pe.goToConnectingView(r)},manualWalletsTemplate(){return zs.manualWallets().map(r=>he`<wcm-wallet-button walletId="${r.id}" name="${r.name}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(r=!1){return zs.recomendedWallets(r).map(e=>he`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){const r=zs.recentWallet();if(r)return he`<wcm-wallet-button name="${r.name}" walletId="${r.id}" imageId="${Dr(r.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`}},fC=lt`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var dC=Object.defineProperty,pC=Object.getOwnPropertyDescriptor,gC=(r,e,t,n)=>{for(var i=n>1?void 0:n?pC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&dC(e,t,i),i};let Qh=class extends Ye{render(){const{explorerExcludedWalletIds:r,enableExplorer:e}=Kr.state,t=r!=="ALL"&&e,n=wi.manualWalletsTemplate(),i=wi.recomendedWalletsTemplate();let a=[wi.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);const c=a.length>4||t;let u=[];c?u=a.slice(0,3):u=a;const f=!!u.length;return he`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${ht.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${ht.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${f?he`<wcm-modal-footer><div class="wcm-desktop-title">${ht.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${u} ${c?he`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};Qh.styles=[rt.globalCss,fC],Qh=gC([ot("wcm-desktop-wallet-selection")],Qh);const mC=lt`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-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 vC=Object.defineProperty,yC=Object.getOwnPropertyDescriptor,wC=(r,e,t,n)=>{for(var i=n>1?void 0:n?yC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&vC(e,t,i),i};let Xh=class extends Ye{render(){const{termsOfServiceUrl:r,privacyPolicyUrl:e}=Kr.state;return r??e?he`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${r?he`<a href="${r}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${r&&e?"and":null} ${e?he`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};Xh.styles=[rt.globalCss,mC],Xh=wC([ot("wcm-legal-notice")],Xh);const bC=lt`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var _C=Object.defineProperty,EC=Object.getOwnPropertyDescriptor,xC=(r,e,t,n)=>{for(var i=n>1?void 0:n?EC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&_C(e,t,i),i};let ef=class extends Ye{onQrcode(){Pt.push("Qrcode")}render(){const{explorerExcludedWalletIds:r,enableExplorer:e}=Kr.state,t=r!=="ALL"&&e,n=wi.manualWalletsTemplate(),i=wi.recomendedWalletsTemplate();let a=[wi.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);const c=a.length>8||t;let u=[];c?u=a.slice(0,7):u=a;const f=!!u.length;return he`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${ht.QRCODE_ICON}"></wcm-modal-header>${f?he`<wcm-modal-content><div>${u} ${c?he`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};ef.styles=[rt.globalCss,bC],ef=xC([ot("wcm-mobile-wallet-selection")],ef);const IC=lt`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-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(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var DC=Object.defineProperty,SC=Object.getOwnPropertyDescriptor,tf=(r,e,t,n)=>{for(var i=n>1?void 0:n?SC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&DC(e,t,i),i};let Hs=class extends Ye{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Wi.subscribe(r=>{r.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var r;(r=this.unsubscribeModal)==null||r.call(this)}get overlayEl(){return Pe.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return Pe.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(r){document.querySelector("body")&&(r?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(r){r.target===r.currentTarget&&Wi.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const r=Pe.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,t=.2;await Promise.all([Qi(this.overlayEl,{opacity:[0,1]},{delay:e,duration:t}).finished,Qi(this.containerEl,r,{delay:e,duration:t}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const r=Pe.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([Qi(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,Qi(this.containerEl,r,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",r=>{var e;r.key==="Escape"?Wi.close():r.key==="Tab"&&((e=r.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var r;(r=this.abortController)==null||r.abort(),this.abortController=void 0}render(){const r={"wcm-overlay":!0,"wcm-active":this.active};return he`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${qn(r)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?he`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};Hs.styles=[rt.globalCss,IC],tf([Mr()],Hs.prototype,"open",2),tf([Mr()],Hs.prototype,"active",2),Hs=tf([ot("wcm-modal")],Hs);const CC=lt`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var OC=Object.defineProperty,$C=Object.getOwnPropertyDescriptor,ta=(r,e,t,n)=>{for(var i=n>1?void 0:n?$C(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&OC(e,t,i),i};let es=class extends Ye{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){we.isMobile()?Pt.replace("MobileConnecting"):Pt.replace("MobileQrcodeConnecting")}onDesktop(){Pt.replace("DesktopConnecting")}onWeb(){Pt.replace("WebConnecting")}render(){return he`<div>${this.isRetry?he`<slot></slot>`:null} ${this.isMobile?he`<wcm-button .onClick="${this.onMobile}" .iconLeft="${ht.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?he`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${ht.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?he`<wcm-button .onClick="${this.onWeb}" .iconLeft="${ht.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};es.styles=[rt.globalCss,CC],ta([Be({type:Boolean})],es.prototype,"isMobile",2),ta([Be({type:Boolean})],es.prototype,"isDesktop",2),ta([Be({type:Boolean})],es.prototype,"isWeb",2),ta([Be({type:Boolean})],es.prototype,"isRetry",2),es=ta([ot("wcm-platform-selection")],es);const AC=lt`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var PC=Object.defineProperty,TC=Object.getOwnPropertyDescriptor,RC=(r,e,t,n)=>{for(var i=n>1?void 0:n?TC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&PC(e,t,i),i};let rf=class extends Ye{onClick(){Pt.push("WalletExplorer")}render(){const{recomendedWallets:r}=Lr.state,e=zs.manualWallets(),t=[...r,...e].reverse().slice(0,4);return he`<button @click="${this.onClick}"><div class="wcm-icons">${t.map(n=>{const i=Pe.getWalletIcon(n);if(i)return he`<img crossorigin="anonymous" src="${i}">`;const a=Pe.getWalletIcon({id:n.id});return a?he`<img crossorigin="anonymous" src="${a}">`:ht.WALLET_PLACEHOLDER})} ${[...Array(4-t.length)].map(()=>ht.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};rf.styles=[rt.globalCss,AC],rf=RC([ot("wcm-view-all-wallets-button")],rf);const NC=lt`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var LC=Object.defineProperty,MC=Object.getOwnPropertyDescriptor,xc=(r,e,t,n)=>{for(var i=n>1?void 0:n?MC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&LC(e,t,i),i};let Ws=class extends Ye{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:r}=zt.state;this.uri=r},0)}get overlayEl(){return Pe.getShadowRootElement(this,".wcm-qr-container")}render(){return he`<div class="wcm-qr-container">${this.uri?he`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${Dr(this.walletId)}" imageId="${Dr(this.imageId)}"></wcm-qrcode>`:he`<wcm-spinner></wcm-spinner>`}</div>`}};Ws.styles=[rt.globalCss,NC],xc([Be()],Ws.prototype,"walletId",2),xc([Be()],Ws.prototype,"imageId",2),xc([Mr()],Ws.prototype,"uri",2),Ws=xc([ot("wcm-walletconnect-qr")],Ws);var UC=Object.defineProperty,jC=Object.getOwnPropertyDescriptor,FC=(r,e,t,n)=>{for(var i=n>1?void 0:n?jC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&UC(e,t,i),i};let nf=class extends Ye{viewTemplate(){return we.isAndroid()?he`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:we.isMobile()?he`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:he`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return he`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};nf.styles=[rt.globalCss],nf=FC([ot("wcm-connect-wallet-view")],nf);const BC=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var kC=Object.defineProperty,qC=Object.getOwnPropertyDescriptor,Sm=(r,e,t,n)=>{for(var i=n>1?void 0:n?qC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&kC(e,t,i),i};let Ic=class extends Ye{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(r){const{desktop:e,name:t}=we.getWalletRouterData(),n=e?.native;if(n){const i=we.formatNativeUrl(n,r,t);we.openHref(i,"_self")}}openDesktopApp(){const{walletConnectUri:r}=zt.state,e=we.getWalletRouterData();Pe.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){const{name:r,id:e,image_id:t}=we.getWalletRouterData(),{isMobile:n,isWeb:i}=Pe.getCachedRouterWalletPlatforms();return he`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Dr(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${r} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isWeb="${i}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Ic.styles=[rt.globalCss,BC],Sm([Mr()],Ic.prototype,"isError",2),Ic=Sm([ot("wcm-desktop-connecting-view")],Ic);const zC=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var HC=Object.defineProperty,WC=Object.getOwnPropertyDescriptor,KC=(r,e,t,n)=>{for(var i=n>1?void 0:n?WC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&HC(e,t,i),i};let sf=class extends Ye{onInstall(r){r&&we.openHref(r,"_blank")}render(){const{name:r,id:e,image_id:t,homepage:n}=we.getWalletRouterData();return he`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Dr(t)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${r} to continue. If multiple browser extensions are installed, disable non ${r} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${ht.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};sf.styles=[rt.globalCss,zC],sf=KC([ot("wcm-install-wallet-view")],sf);const VC=lt`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var GC=Object.defineProperty,YC=Object.getOwnPropertyDescriptor,Cm=(r,e,t,n)=>{for(var i=n>1?void 0:n?YC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&GC(e,t,i),i};let Dc=class extends Ye{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(r,e=!1){const{mobile:t,name:n}=we.getWalletRouterData(),i=t?.native,a=t?.universal;if(i&&!e){const c=we.formatNativeUrl(i,r,n);we.openHref(c,"_self")}else if(a){const c=we.formatUniversalUrl(a,r,n);we.openHref(c,"_self")}}openMobileApp(r=!1){const{walletConnectUri:e}=zt.state,t=we.getWalletRouterData();Pe.setRecentWallet(t),e&&this.onFormatAndRedirect(e,r)}onGoToAppStore(r){r&&we.openHref(r,"_blank")}render(){const{name:r,id:e,image_id:t,app:n,mobile:i}=we.getWalletRouterData(),{isWeb:a}=Pe.getCachedRouterWalletPlatforms(),c=n?.ios,u=i?.universal;return he`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Dr(t)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${a}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${u?he`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${Dr(t)}"></wcm-wallet-image><wcm-text>${`Get ${r}`}</wcm-text></div><wcm-button .iconRight="${ht.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};Dc.styles=[rt.globalCss,VC],Cm([Mr()],Dc.prototype,"isError",2),Dc=Cm([ot("wcm-mobile-connecting-view")],Dc);const JC=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var ZC=Object.defineProperty,QC=Object.getOwnPropertyDescriptor,XC=(r,e,t,n)=>{for(var i=n>1?void 0:n?QC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&ZC(e,t,i),i};let of=class extends Ye{render(){const{name:r,id:e,image_id:t}=we.getWalletRouterData(),{isDesktop:n,isWeb:i}=Pe.getCachedRouterWalletPlatforms();return he`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${Dr(t)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${r} app`}</wcm-text><wcm-platform-selection .isDesktop="${n}" .isWeb="${i}"></wcm-platform-selection></wcm-info-footer>`}};of.styles=[rt.globalCss,JC],of=XC([ot("wcm-mobile-qr-connecting-view")],of);var eO=Object.defineProperty,tO=Object.getOwnPropertyDescriptor,rO=(r,e,t,n)=>{for(var i=n>1?void 0:n?tO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&eO(e,t,i),i};let af=class extends Ye{render(){return he`<wcm-modal-header title="Scan the code" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};af.styles=[rt.globalCss],af=rO([ot("wcm-qrcode-view")],af);const nO=lt`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var iO=Object.defineProperty,sO=Object.getOwnPropertyDescriptor,ra=(r,e,t,n)=>{for(var i=n>1?void 0:n?sO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&iO(e,t,i),i};const cf=40;let ts=class extends Ye{constructor(){super(...arguments),this.loading=!Lr.state.wallets.listings.length,this.firstFetch=!Lr.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=Pe.debounce(r=>{r.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=r,Lr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),Lr.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var r;(r=this.intersectionObserver)==null||r.disconnect()}get placeholderEl(){return Pe.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([r])=>{r.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:r,search:e}=Lr.state,{listings:t,total:n}=this.search?e:r;return n<=cf||t.length>=n}async fetchWallets(){var r;const{wallets:e,search:t}=Lr.state,{listings:n,total:i,page:a}=this.search?t:e;if(!this.endReached&&(this.firstFetch||i>cf&&n.length<i))try{this.loading=!0;const c=(r=zt.state.chains)==null?void 0:r.join(","),{listings:u}=await Lr.getWallets({page:this.firstFetch?1:a+1,entries:cf,search:this.search,version:2,chains:c}),f=u.map(h=>Pe.getWalletIcon(h));await Promise.all([...f.map(async h=>Pe.preloadImage(h)),we.wait(300)]),this.endReached=this.isLastPage()}catch(c){console.error(c),hi.openToast(Pe.getErrorMessage(c),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(r){we.isAndroid()?Pe.handleMobileLinking(r):Pe.goToConnectingView(r)}onSearchChange(r){const{value:e}=r.target;this.searchDebounce(e)}render(){const{wallets:r,search:e}=Lr.state,{listings:t}=this.search?e:r,n=this.loading&&!t.length,i=this.search.length>=3;let a=wi.manualWalletsTemplate(),c=wi.recomendedWalletsTemplate(!0);i&&(a=a.filter(({values:h})=>Pe.caseSafeIncludes(h[0],this.search)),c=c.filter(({values:h})=>Pe.caseSafeIncludes(h[0],this.search)));const u=!this.loading&&!t.length&&!c.length,f={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":u};return he`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${qn(f)}"><div class="wcm-grid">${n?null:a} ${n?null:c} ${n?null:t.map(h=>he`${h?he`<wcm-wallet-button imageId="${h.image_id}" name="${h.name}" walletId="${h.id}" .onClick="${()=>this.onConnect(h)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${u?he`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!u&&this.loading?he`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};ts.styles=[rt.globalCss,nO],ra([Mr()],ts.prototype,"loading",2),ra([Mr()],ts.prototype,"firstFetch",2),ra([Mr()],ts.prototype,"search",2),ra([Mr()],ts.prototype,"endReached",2),ts=ra([ot("wcm-wallet-explorer-view")],ts);const oO=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var aO=Object.defineProperty,cO=Object.getOwnPropertyDescriptor,Om=(r,e,t,n)=>{for(var i=n>1?void 0:n?cO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&aO(e,t,i),i};let Sc=class extends Ye{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(r){const{desktop:e,name:t}=we.getWalletRouterData(),n=e?.universal;if(n){const i=we.formatUniversalUrl(n,r,t);we.openHref(i,"_blank")}}openWebWallet(){const{walletConnectUri:r}=zt.state,e=we.getWalletRouterData();Pe.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){const{name:r,id:e,image_id:t}=we.getWalletRouterData(),{isMobile:n,isDesktop:i}=Pe.getCachedRouterWalletPlatforms(),a=we.isMobile();return he`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Dr(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${r} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isDesktop="${a?!1:i}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Sc.styles=[rt.globalCss,oO],Om([Mr()],Sc.prototype,"isError",2),Sc=Om([ot("wcm-web-connecting-view")],Sc);var lO=Object.freeze({__proto__:null,get WcmModal(){return Hs},get WcmQrCode(){return Hn}});fn.EthereumProvider=Rx,fn.OPTIONAL_EVENTS=eg,fn.OPTIONAL_METHODS=X1,fn.REQUIRED_EVENTS=Qa,fn.REQUIRED_METHODS=Za,fn.default=ec,Object.defineProperty(fn,"__esModule",{value:!0})});
137
+ `);const c=HD(e,t,i),u=_c.getSymbolSize(e),f=new RD(u);return FD(f,e),BD(f),kD(f,e),Mh(f,t,0),e>=7&&qD(f,e),zD(f,c),isNaN(n)&&(n=Rh.getBestMask(f,Mh.bind(null,f,t))),Rh.applyMask(n,f),Mh(f,t,n),{modules:f,version:e,errorCorrectionLevel:t,maskPattern:n,segments:i}}Xg.create=function(e,t){if(typeof e>"u"||e==="")throw new Error("No input text");let n=Th.M,i,a;return typeof t<"u"&&(n=Th.from(t.errorCorrectionLevel,Th.M),i=Ec.from(t.version),a=Rh.from(t.maskPattern),t.toSJISFunc&&_c.setToSJISFunction(t.toSJISFunc)),KD(e,i,n,a)};var pm={},Uh={};(function(r){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+t);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),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("")}}r.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,c=n.scale||4;return{width:a,scale:a?4:c,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},r.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},r.getImageWidth=function(n,i){const a=r.getScale(n,i);return Math.floor((n+i.margin*2)*a)},r.qrToImageData=function(n,i,a){const c=i.modules.size,u=i.modules.data,f=r.getScale(c,a),h=Math.floor((c+a.margin*2)*f),m=a.margin*f,w=[a.color.light,a.color.dark];for(let y=0;y<h;y++)for(let _=0;_<h;_++){let S=(y*h+_)*4,P=a.color.light;if(y>=m&&_>=m&&y<h-m&&_<h-m){const j=Math.floor((y-m)/f),U=Math.floor((_-m)/f);P=w[u[j*c+U]?1:0]}n[S++]=P.r,n[S++]=P.g,n[S++]=P.b,n[S]=P.a}}})(Uh),function(r){const e=Uh;function t(i,a,c){i.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=c,a.width=c,a.style.height=c+"px",a.style.width=c+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(a,c,u){let f=u,h=c;typeof f>"u"&&(!c||!c.getContext)&&(f=c,c=void 0),c||(h=n()),f=e.getOptions(f);const m=e.getImageWidth(a.modules.size,f),w=h.getContext("2d"),y=w.createImageData(m,m);return e.qrToImageData(y.data,a,f),t(w,h,m),w.putImageData(y,0,0),h},r.renderToDataURL=function(a,c,u){let f=u;typeof f>"u"&&(!c||!c.getContext)&&(f=c,c=void 0),f||(f={});const h=r.render(a,c,f),m=f.type||"image/png",w=f.rendererOpts||{};return h.toDataURL(m,w.quality)}}(pm);var gm={};const VD=Uh;function mm(r,e){const t=r.a/255,n=e+'="'+r.hex+'"';return t<1?n+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':n}function jh(r,e,t){let n=r+e;return typeof t<"u"&&(n+=" "+t),n}function GD(r,e,t){let n="",i=0,a=!1,c=0;for(let u=0;u<r.length;u++){const f=Math.floor(u%e),h=Math.floor(u/e);!f&&!a&&(a=!0),r[u]?(c++,u>0&&f>0&&r[u-1]||(n+=a?jh("M",f+t,.5+h+t):jh("m",i,0),i=0,a=!1),f+1<e&&r[u+1]||(n+=jh("h",c),c=0)):i++}return n}gm.render=function(e,t,n){const i=VD.getOptions(t),a=e.modules.size,c=e.modules.data,u=a+i.margin*2,f=i.color.light.a?"<path "+mm(i.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",h="<path "+mm(i.color.dark,"stroke")+' d="'+GD(c,a,i.margin)+'"/>',m='viewBox="0 0 '+u+" "+u+'"',y='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+m+' shape-rendering="crispEdges">'+f+h+`</svg>
138
+ `;return typeof n=="function"&&n(null,y),y};const YD=lD,Fh=Xg,vm=pm,ZD=gm;function Bh(r,e,t,n,i){const a=[].slice.call(arguments,1),c=a.length,u=typeof a[c-1]=="function";if(!u&&!YD())throw new Error("Callback required as last argument");if(u){if(c<2)throw new Error("Too few arguments provided");c===2?(i=t,t=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=t,t=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(t=e,e=n=void 0):c===2&&!e.getContext&&(n=t,t=e,e=void 0),new Promise(function(f,h){try{const m=Fh.create(t,n);f(r(m,e,n))}catch(m){h(m)}})}try{const f=Fh.create(t,n);i(null,r(f,e,n))}catch(f){i(f)}}Jo.create=Fh.create,Jo.toCanvas=Bh.bind(null,vm.render),Jo.toDataURL=Bh.bind(null,vm.renderToDataURL),Jo.toString=Bh.bind(null,function(r,e,t){return ZD.render(r,t)});var JD=Object.defineProperty,ym=Object.getOwnPropertySymbols,QD=Object.prototype.hasOwnProperty,XD=Object.prototype.propertyIsEnumerable,wm=(r,e,t)=>e in r?JD(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,kh=(r,e)=>{for(var t in e||(e={}))QD.call(e,t)&&wm(r,t,e[t]);if(ym)for(var t of ym(e))XD.call(e,t)&&wm(r,t,e[t]);return r};function eS(){var r;const e=(r=ui.state.themeMode)!=null?r:"dark",t={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{"--wcm-color-fg-1":t.foreground[1],"--wcm-color-fg-2":t.foreground[2],"--wcm-color-fg-3":t.foreground[3],"--wcm-color-bg-1":t.background[1],"--wcm-color-bg-2":t.background[2],"--wcm-color-bg-3":t.background[3],"--wcm-color-overlay":t.overlay}}function bm(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const rt={getPreset(r){return bm()[r]},setTheme(){const r=document.querySelector(":root"),{themeVariables:e}=ui.state;if(r){const t=kh(kh(kh({},eS()),bm()),e);Object.entries(t).forEach(([n,i])=>r.style.setProperty(n,i))}},globalCss:lt`*,::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 wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},tS=lt`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var rS=Object.defineProperty,nS=Object.getOwnPropertyDescriptor,qs=(r,e,t,n)=>{for(var i=n>1?void 0:n?nS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&rS(e,t,i),i};let mi=class extends Ye{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const r={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),he`<button class="${qn(r)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};mi.styles=[rt.globalCss,tS],qs([Be({type:Boolean})],mi.prototype,"disabled",2),qs([Be()],mi.prototype,"iconLeft",2),qs([Be()],mi.prototype,"iconRight",2),qs([Be()],mi.prototype,"onClick",2),qs([Be()],mi.prototype,"variant",2),mi=qs([ot("wcm-button")],mi);const iS=lt`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-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(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var sS=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,qh=(r,e,t,n)=>{for(var i=n>1?void 0:n?oS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&sS(e,t,i),i};let ta=class extends Ye{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const r={"wcm-secondary":this.variant==="secondary"};return he`<button ?disabled="${this.disabled}" class="${qn(r)}"><slot></slot></button>`}};ta.styles=[rt.globalCss,iS],qh([Be({type:Boolean})],ta.prototype,"disabled",2),qh([Be()],ta.prototype,"variant",2),ta=qh([ot("wcm-button-big")],ta);const aS=lt`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var cS=Object.defineProperty,lS=Object.getOwnPropertyDescriptor,uS=(r,e,t,n)=>{for(var i=n>1?void 0:n?lS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&cS(e,t,i),i};let zh=class extends Ye{render(){return he`<div><slot></slot></div>`}};zh.styles=[rt.globalCss,aS],zh=uS([ot("wcm-info-footer")],zh);const ht={CROSS_ICON:Lt`<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:Lt`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-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:Lt`<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:Lt`<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:Lt`<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:Lt`<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:Lt`<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:Lt`<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:Lt`<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:Lt`<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:Lt`<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:Lt`<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:Lt`<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:Lt`<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:Lt`<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>`,SEARCH_ICON:Lt`<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>`,WALLET_PLACEHOLDER:Lt`<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>`,GLOBE_ICON:Lt`<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>`},hS=lt`.wcm-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(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var fS=Object.defineProperty,dS=Object.getOwnPropertyDescriptor,pS=(r,e,t,n)=>{for(var i=n>1?void 0:n?dS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&fS(e,t,i),i};let Hh=class extends Ye{render(){return he`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${ht.WALLET_CONNECT_LOGO} <button @click="${Ki.close}">${ht.CROSS_ICON}</button></div>`}};Hh.styles=[rt.globalCss,hS],Hh=pS([ot("wcm-modal-backcard")],Hh);const gS=lt`main{padding:20px;padding-top:0;width:100%}`;var mS=Object.defineProperty,vS=Object.getOwnPropertyDescriptor,yS=(r,e,t,n)=>{for(var i=n>1?void 0:n?vS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&mS(e,t,i),i};let Wh=class extends Ye{render(){return he`<main><slot></slot></main>`}};Wh.styles=[rt.globalCss,gS],Wh=yS([ot("wcm-modal-content")],Wh);const wS=lt`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var bS=Object.defineProperty,_S=Object.getOwnPropertyDescriptor,ES=(r,e,t,n)=>{for(var i=n>1?void 0:n?_S(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&bS(e,t,i),i};let Kh=class extends Ye{render(){return he`<footer><slot></slot></footer>`}};Kh.styles=[rt.globalCss,wS],Kh=ES([ot("wcm-modal-footer")],Kh);const xS=lt`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var IS=Object.defineProperty,DS=Object.getOwnPropertyDescriptor,ra=(r,e,t,n)=>{for(var i=n>1?void 0:n?DS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&IS(e,t,i),i};let es=class extends Ye{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return he`<button class="wcm-back-btn" @click="${Tt.goBack}">${ht.BACK_ICON}</button>`}actionBtnTemplate(){return he`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const r={"wcm-border":this.border},e=Tt.state.history.length>1,t=this.title?he`<wcm-text variant="big-bold">${this.title}</wcm-text>`:he`<slot></slot>`;return he`<header class="${qn(r)}">${e?this.backBtnTemplate():null} ${t} ${this.onAction?this.actionBtnTemplate():null}</header>`}};es.styles=[rt.globalCss,xS],ra([Be()],es.prototype,"title",2),ra([Be()],es.prototype,"onAction",2),ra([Be()],es.prototype,"actionIcon",2),ra([Be({type:Boolean})],es.prototype,"border",2),es=ra([ot("wcm-modal-header")],es);const Pe={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(r,e){const t=r.renderRoot.querySelector(e);if(!t)throw new Error(`${e} not found`);return t},getWalletIcon({id:r,image_id:e}){const{walletImages:t}=Kr.state;return t!=null&&t[r]?t[r]:e?Nr.getWalletImageUrl(e):""},getWalletName(r,e=!1){return e&&r.length>8?`${r.substring(0,8)}..`:r},isMobileAnimation(){return window.innerWidth<=Pe.MOBILE_BREAKPOINT},async preloadImage(r){const e=new Promise((t,n)=>{const i=new Image;i.onload=t,i.onerror=n,i.crossOrigin="anonymous",i.src=r});return Promise.race([e,we.wait(3e3)])},getErrorMessage(r){return r instanceof Error?r.message:"Unknown Error"},debounce(r,e=500){let t;return(...n)=>{function i(){r(...n)}t&&clearTimeout(t),t=setTimeout(i,e)}},handleMobileLinking(r){const{walletConnectUri:e}=zt.state,{mobile:t,name:n}=r,i=t?.native,a=t?.universal;Pe.setRecentWallet(r);function c(u){let f="";i?f=we.formatUniversalUrl(i,u,n):a&&(f=we.formatNativeUrl(a,u,n)),we.openHref(f,"_self")}e&&c(e)},handleAndroidLinking(){const{walletConnectUri:r}=zt.state;r&&(we.setWalletConnectAndroidDeepLink(r),we.openHref(r,"_self"))},async handleUriCopy(){const{walletConnectUri:r}=zt.state;if(r)try{await navigator.clipboard.writeText(r),hi.openToast("Link copied","success")}catch{hi.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:r}=Kr.state,e=Object.values(r??{});return Object.values(e)},truncate(r,e=8){return r.length<=e?r:`${r.substring(0,4)}...${r.substring(r.length-4)}`},setRecentWallet(r){try{localStorage.setItem(Pe.WCM_RECENT_WALLET_DATA,JSON.stringify(r))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const r=localStorage.getItem(Pe.WCM_RECENT_WALLET_DATA);return r?JSON.parse(r):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(r,e){return r.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){we.openHref(Pe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:r,mobile:e}=we.getWalletRouterData(),t=!!r?.native,n=!!r?.universal,i=!!e?.native||!!e?.universal;return{isDesktop:t,isMobile:i,isWeb:n}},goToConnectingView(r){Tt.setData({Wallet:r});const e=we.isMobile(),{isDesktop:t,isWeb:n,isMobile:i}=Pe.getCachedRouterWalletPlatforms();e?i?Tt.push("MobileConnecting"):n?Tt.push("WebConnecting"):Tt.push("InstallWallet"):t?Tt.push("DesktopConnecting"):n?Tt.push("WebConnecting"):i?Tt.push("MobileQrcodeConnecting"):Tt.push("InstallWallet")}},SS=lt`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var OS=Object.defineProperty,CS=Object.getOwnPropertyDescriptor,Vh=(r,e,t,n)=>{for(var i=n>1?void 0:n?CS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&OS(e,t,i),i};let na=class extends Ye{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(r=>{this.view!==r.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([r])=>{const e=`${r.contentRect.height}px`;this.oldHeight!=="0px"&&Xi(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var r,e;(r=this.unsubscribe)==null||r.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return Pe.getShadowRootElement(this,".wcm-router")}get contentEl(){return Pe.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return he`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return he`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return he`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return he`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return he`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return he`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return he`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return he`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return he`<div>Not Found</div>`}}async onChangeRoute(){await Xi(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=Tt.state.view,Xi(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return he`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};na.styles=[rt.globalCss,SS],Vh([Lr()],na.prototype,"view",2),Vh([Lr()],na.prototype,"prevView",2),na=Vh([ot("wcm-modal-router")],na);const $S=lt`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(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var AS=Object.defineProperty,PS=Object.getOwnPropertyDescriptor,_m=(r,e,t,n)=>{for(var i=n>1?void 0:n?PS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&AS(e,t,i),i};let xc=class extends Ye{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=hi.subscribe(r=>{r.open?(this.open=!0,this.timeout=setTimeout(()=>hi.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this),clearTimeout(this.timeout),hi.closeToast()}render(){const{message:r,variant:e}=hi.state,t={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?he`<div class="${qn(t)}">${e==="success"?ht.CHECKMARK_ICON:null} ${e==="error"?ht.CROSS_ICON:null}<wcm-text variant="small-regular">${r}</wcm-text></div>`:null}};xc.styles=[rt.globalCss,$S],_m([Lr()],xc.prototype,"open",2),xc=_m([ot("wcm-modal-toast")],xc);const TS=.1,Em=2.5,zn=7;function Gh(r,e,t){return r===e?!1:(r-e<0?e-r:r-e)<=t+TS}function RS(r,e){const t=Array.prototype.slice.call(Jo.create(r,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(t.length);return t.reduce((i,a,c)=>(c%n===0?i.push([a]):i[i.length-1].push(a))&&i,[])}const NS={generate(r,e,t){const n="#141414",i="#ffffff",a=[],c=RS(r,"Q"),u=e/c.length,f=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];f.forEach(({x:S,y:P})=>{const j=(c.length-zn)*u*S,U=(c.length-zn)*u*P,A=.45;for(let T=0;T<f.length;T+=1){const O=u*(zn-T*2);a.push(Lt`<rect fill="${T%2===0?n:i}" height="${O}" rx="${O*A}" ry="${O*A}" width="${O}" x="${j+u*T}" y="${U+u*T}">`)}});const h=Math.floor((t+25)/u),m=c.length/2-h/2,w=c.length/2+h/2-1,y=[];c.forEach((S,P)=>{S.forEach((j,U)=>{if(c[P][U]&&!(P<zn&&U<zn||P>c.length-(zn+1)&&U<zn||P<zn&&U>c.length-(zn+1))&&!(P>m&&P<w&&U>m&&U<w)){const A=P*u+u/2,T=U*u+u/2;y.push([A,T])}})});const _={};return y.forEach(([S,P])=>{_[S]?_[S].push(P):_[S]=[P]}),Object.entries(_).map(([S,P])=>{const j=P.filter(U=>P.every(A=>!Gh(U,A,u)));return[Number(S),j]}).forEach(([S,P])=>{P.forEach(j=>{a.push(Lt`<circle cx="${S}" cy="${j}" fill="${n}" r="${u/Em}">`)})}),Object.entries(_).filter(([S,P])=>P.length>1).map(([S,P])=>{const j=P.filter(U=>P.some(A=>Gh(U,A,u)));return[Number(S),j]}).map(([S,P])=>{P.sort((U,A)=>U<A?-1:1);const j=[];for(const U of P){const A=j.find(T=>T.some(O=>Gh(U,O,u)));A?A.push(U):j.push([U])}return[S,j.map(U=>[U[0],U[U.length-1]])]}).forEach(([S,P])=>{P.forEach(([j,U])=>{a.push(Lt`<line x1="${S}" x2="${S}" y1="${j}" y2="${U}" stroke="${n}" stroke-width="${u/(Em/2)}" stroke-linecap="round">`)})}),a}},LS=lt`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var MS=Object.defineProperty,US=Object.getOwnPropertyDescriptor,zs=(r,e,t,n)=>{for(var i=n>1?void 0:n?US(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&MS(e,t,i),i};let Hn=class extends Ye{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const r=ui.state.themeMode==="light"?this.size:this.size-36;return Lt`<svg height="${r}" width="${r}">${NS.generate(this.uri,r,r/4)}</svg>`}render(){const r={"wcm-dark":ui.state.themeMode==="dark"};return he`<div style="${`width: ${this.size}px`}" class="${qn(r)}">${this.walletId||this.imageUrl?he`<wcm-wallet-image walletId="${Ir(this.walletId)}" imageId="${Ir(this.imageId)}" imageUrl="${Ir(this.imageUrl)}"></wcm-wallet-image>`:ht.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Hn.styles=[rt.globalCss,LS],zs([Be()],Hn.prototype,"uri",2),zs([Be({type:Number})],Hn.prototype,"size",2),zs([Be()],Hn.prototype,"imageId",2),zs([Be()],Hn.prototype,"walletId",2),zs([Be()],Hn.prototype,"imageUrl",2),Hn=zs([ot("wcm-qrcode")],Hn);const jS=lt`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-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(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-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(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var FS=Object.defineProperty,BS=Object.getOwnPropertyDescriptor,xm=(r,e,t,n)=>{for(var i=n>1?void 0:n?BS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&FS(e,t,i),i};let Ic=class extends Ye{constructor(){super(...arguments),this.onChange=()=>null}render(){return he`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${ht.SEARCH_ICON}`}};Ic.styles=[rt.globalCss,jS],xm([Be()],Ic.prototype,"onChange",2),Ic=xm([ot("wcm-search-input")],Ic);const kS=lt`@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(--wcm-accent-color)}`;var qS=Object.defineProperty,zS=Object.getOwnPropertyDescriptor,HS=(r,e,t,n)=>{for(var i=n>1?void 0:n?zS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&qS(e,t,i),i};let Yh=class extends Ye{render(){return he`<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>`}};Yh.styles=[rt.globalCss,kS],Yh=HS([ot("wcm-spinner")],Yh);const WS=lt`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var KS=Object.defineProperty,VS=Object.getOwnPropertyDescriptor,Zh=(r,e,t,n)=>{for(var i=n>1?void 0:n?VS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&KS(e,t,i),i};let ia=class extends Ye{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const r={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return he`<span><slot class="${qn(r)}"></slot></span>`}};ia.styles=[rt.globalCss,WS],Zh([Be()],ia.prototype,"variant",2),Zh([Be()],ia.prototype,"color",2),ia=Zh([ot("wcm-text")],ia);const GS=lt`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var YS=Object.defineProperty,ZS=Object.getOwnPropertyDescriptor,vi=(r,e,t,n)=>{for(var i=n>1?void 0:n?ZS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&YS(e,t,i),i};let Cn=class extends Ye{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?he`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?he`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){og.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var r;return he`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${Ir(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(r=this.label)!=null?r:Pe.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};Cn.styles=[rt.globalCss,GS],vi([Be()],Cn.prototype,"onClick",2),vi([Be()],Cn.prototype,"name",2),vi([Be()],Cn.prototype,"walletId",2),vi([Be()],Cn.prototype,"label",2),vi([Be()],Cn.prototype,"imageId",2),vi([Be({type:Boolean})],Cn.prototype,"installed",2),vi([Be({type:Boolean})],Cn.prototype,"recent",2),Cn=vi([ot("wcm-wallet-button")],Cn);const JS=lt`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-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(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var QS=Object.defineProperty,XS=Object.getOwnPropertyDescriptor,Dc=(r,e,t,n)=>{for(var i=n>1?void 0:n?XS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&QS(e,t,i),i};let Hs=class extends Ye{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var r;const e=(r=this.imageUrl)!=null&&r.length?this.imageUrl:Pe.getWalletIcon({id:this.walletId,image_id:this.imageId});return he`${e.length?he`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:ht.WALLET_PLACEHOLDER}`}};Hs.styles=[rt.globalCss,JS],Dc([Be()],Hs.prototype,"walletId",2),Dc([Be()],Hs.prototype,"imageId",2),Dc([Be()],Hs.prototype,"imageUrl",2),Hs=Dc([ot("wcm-wallet-image")],Hs);var eO=Object.defineProperty,tO=Object.getOwnPropertyDescriptor,Im=(r,e,t,n)=>{for(var i=n>1?void 0:n?tO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&eO(e,t,i),i};let Jh=class extends Ye{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(r){try{r!=null&&r.length&&await Promise.all(r.map(async e=>Pe.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",r)}}async preloadListings(){if(Kr.state.enableExplorer){await Nr.getRecomendedWallets(),zt.setIsDataLoaded(!0);const{recomendedWallets:r}=Nr.state,e=r.map(t=>Pe.getWalletIcon(t));await this.loadImages(e)}else zt.setIsDataLoaded(!0)}async preloadCustomImages(){const r=Pe.getCustomImageUrls();await this.loadImages(r)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(r){console.error(r),hi.openToast("Failed preloading","error")}}};Im([Lr()],Jh.prototype,"preload",2),Jh=Im([ot("wcm-explorer-context")],Jh);var rO=Object.defineProperty,nO=Object.getOwnPropertyDescriptor,iO=(r,e,t,n)=>{for(var i=n>1?void 0:n?nO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&rO(e,t,i),i};let Dm=class extends Ye{constructor(){super(),this.unsubscribeTheme=void 0,rt.setTheme(),this.unsubscribeTheme=ui.subscribe(rt.setTheme)}disconnectedCallback(){var r;(r=this.unsubscribeTheme)==null||r.call(this)}};Dm=iO([ot("wcm-theme-context")],Dm);const sO=lt`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var oO=Object.defineProperty,aO=Object.getOwnPropertyDescriptor,cO=(r,e,t,n)=>{for(var i=n>1?void 0:n?aO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&oO(e,t,i),i};let Qh=class extends Ye{onGoToQrcode(){Tt.push("Qrcode")}render(){const{recomendedWallets:r}=Nr.state,e=[...r,...r],t=we.RECOMMENDED_WALLET_AMOUNT*2;return he`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ht.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${ht.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(t)].map((n,i)=>{const a=e[i%e.length];return a?he`<wcm-wallet-image walletId="${a.id}" imageId="${a.image_id}"></wcm-wallet-image>`:ht.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${Pe.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};Qh.styles=[rt.globalCss,sO],Qh=cO([ot("wcm-android-wallet-selection")],Qh);const lO=lt`@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(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var uO=Object.defineProperty,hO=Object.getOwnPropertyDescriptor,Ws=(r,e,t,n)=>{for(var i=n>1?void 0:n?hO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&uO(e,t,i),i};let yi=class extends Ye{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var r,e;const t=(e=(r=ui.state.themeVariables)==null?void 0:r["--wcm-wallet-icon-large-border-radius"])!=null?e:rt.getPreset("--wcm-wallet-icon-large-border-radius");let n=0;t.includes("%")?n=88/100*parseInt(t,10):n=parseInt(t,10),n*=1.17;const i=317-n*1.57,a=425-n*1.8;return he`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${a}"></use></svg>`}render(){const r={"wcm-error":this.isError,"wcm-stale":this.isStale};return he`<div class="${qn(r)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${Ir(this.walletId)}" imageId="${Ir(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};yi.styles=[rt.globalCss,lO],Ws([Be()],yi.prototype,"walletId",2),Ws([Be()],yi.prototype,"imageId",2),Ws([Be({type:Boolean})],yi.prototype,"isError",2),Ws([Be({type:Boolean})],yi.prototype,"isStale",2),Ws([Be()],yi.prototype,"label",2),yi=Ws([ot("wcm-connector-waiting")],yi);const Ks={manualWallets(){var r,e;const{mobileWallets:t,desktopWallets:n}=Kr.state,i=(r=Ks.recentWallet())==null?void 0:r.id,a=we.isMobile()?t:n,c=a?.filter(u=>i!==u.id);return(e=we.isMobile()?c?.map(({id:u,name:f,links:h})=>({id:u,name:f,mobile:h,links:h})):c?.map(({id:u,name:f,links:h})=>({id:u,name:f,desktop:h,links:h})))!=null?e:[]},recentWallet(){return Pe.getRecentWallet()},recomendedWallets(r=!1){var e;const t=r||(e=Ks.recentWallet())==null?void 0:e.id,{recomendedWallets:n}=Nr.state;return n.filter(i=>t!==i.id)}},wi={onConnecting(r){Pe.goToConnectingView(r)},manualWalletsTemplate(){return Ks.manualWallets().map(r=>he`<wcm-wallet-button walletId="${r.id}" name="${r.name}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(r=!1){return Ks.recomendedWallets(r).map(e=>he`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){const r=Ks.recentWallet();if(r)return he`<wcm-wallet-button name="${r.name}" walletId="${r.id}" imageId="${Ir(r.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`}},fO=lt`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var dO=Object.defineProperty,pO=Object.getOwnPropertyDescriptor,gO=(r,e,t,n)=>{for(var i=n>1?void 0:n?pO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&dO(e,t,i),i};let Xh=class extends Ye{render(){const{explorerExcludedWalletIds:r,enableExplorer:e}=Kr.state,t=r!=="ALL"&&e,n=wi.manualWalletsTemplate(),i=wi.recomendedWalletsTemplate();let a=[wi.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);const c=a.length>4||t;let u=[];c?u=a.slice(0,3):u=a;const f=!!u.length;return he`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${ht.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${ht.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${f?he`<wcm-modal-footer><div class="wcm-desktop-title">${ht.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${u} ${c?he`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};Xh.styles=[rt.globalCss,fO],Xh=gO([ot("wcm-desktop-wallet-selection")],Xh);const mO=lt`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-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 vO=Object.defineProperty,yO=Object.getOwnPropertyDescriptor,wO=(r,e,t,n)=>{for(var i=n>1?void 0:n?yO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&vO(e,t,i),i};let ef=class extends Ye{render(){const{termsOfServiceUrl:r,privacyPolicyUrl:e}=Kr.state;return r??e?he`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${r?he`<a href="${r}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${r&&e?"and":null} ${e?he`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};ef.styles=[rt.globalCss,mO],ef=wO([ot("wcm-legal-notice")],ef);const bO=lt`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var _O=Object.defineProperty,EO=Object.getOwnPropertyDescriptor,xO=(r,e,t,n)=>{for(var i=n>1?void 0:n?EO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&_O(e,t,i),i};let tf=class extends Ye{onQrcode(){Tt.push("Qrcode")}render(){const{explorerExcludedWalletIds:r,enableExplorer:e}=Kr.state,t=r!=="ALL"&&e,n=wi.manualWalletsTemplate(),i=wi.recomendedWalletsTemplate();let a=[wi.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);const c=a.length>8||t;let u=[];c?u=a.slice(0,7):u=a;const f=!!u.length;return he`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${ht.QRCODE_ICON}"></wcm-modal-header>${f?he`<wcm-modal-content><div>${u} ${c?he`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};tf.styles=[rt.globalCss,bO],tf=xO([ot("wcm-mobile-wallet-selection")],tf);const IO=lt`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-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(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var DO=Object.defineProperty,SO=Object.getOwnPropertyDescriptor,rf=(r,e,t,n)=>{for(var i=n>1?void 0:n?SO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&DO(e,t,i),i};let Vs=class extends Ye{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Ki.subscribe(r=>{r.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var r;(r=this.unsubscribeModal)==null||r.call(this)}get overlayEl(){return Pe.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return Pe.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(r){document.querySelector("body")&&(r?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(r){r.target===r.currentTarget&&Ki.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const r=Pe.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,t=.2;await Promise.all([Xi(this.overlayEl,{opacity:[0,1]},{delay:e,duration:t}).finished,Xi(this.containerEl,r,{delay:e,duration:t}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const r=Pe.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([Xi(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,Xi(this.containerEl,r,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",r=>{var e;r.key==="Escape"?Ki.close():r.key==="Tab"&&((e=r.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var r;(r=this.abortController)==null||r.abort(),this.abortController=void 0}render(){const r={"wcm-overlay":!0,"wcm-active":this.active};return he`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${qn(r)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?he`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};Vs.styles=[rt.globalCss,IO],rf([Lr()],Vs.prototype,"open",2),rf([Lr()],Vs.prototype,"active",2),Vs=rf([ot("wcm-modal")],Vs);const OO=lt`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var CO=Object.defineProperty,$O=Object.getOwnPropertyDescriptor,sa=(r,e,t,n)=>{for(var i=n>1?void 0:n?$O(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&CO(e,t,i),i};let ts=class extends Ye{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){we.isMobile()?Tt.replace("MobileConnecting"):Tt.replace("MobileQrcodeConnecting")}onDesktop(){Tt.replace("DesktopConnecting")}onWeb(){Tt.replace("WebConnecting")}render(){return he`<div>${this.isRetry?he`<slot></slot>`:null} ${this.isMobile?he`<wcm-button .onClick="${this.onMobile}" .iconLeft="${ht.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?he`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${ht.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?he`<wcm-button .onClick="${this.onWeb}" .iconLeft="${ht.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};ts.styles=[rt.globalCss,OO],sa([Be({type:Boolean})],ts.prototype,"isMobile",2),sa([Be({type:Boolean})],ts.prototype,"isDesktop",2),sa([Be({type:Boolean})],ts.prototype,"isWeb",2),sa([Be({type:Boolean})],ts.prototype,"isRetry",2),ts=sa([ot("wcm-platform-selection")],ts);const AO=lt`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var PO=Object.defineProperty,TO=Object.getOwnPropertyDescriptor,RO=(r,e,t,n)=>{for(var i=n>1?void 0:n?TO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&PO(e,t,i),i};let nf=class extends Ye{onClick(){Tt.push("WalletExplorer")}render(){const{recomendedWallets:r}=Nr.state,e=Ks.manualWallets(),t=[...r,...e].reverse().slice(0,4);return he`<button @click="${this.onClick}"><div class="wcm-icons">${t.map(n=>{const i=Pe.getWalletIcon(n);if(i)return he`<img crossorigin="anonymous" src="${i}">`;const a=Pe.getWalletIcon({id:n.id});return a?he`<img crossorigin="anonymous" src="${a}">`:ht.WALLET_PLACEHOLDER})} ${[...Array(4-t.length)].map(()=>ht.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};nf.styles=[rt.globalCss,AO],nf=RO([ot("wcm-view-all-wallets-button")],nf);const NO=lt`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var LO=Object.defineProperty,MO=Object.getOwnPropertyDescriptor,Sc=(r,e,t,n)=>{for(var i=n>1?void 0:n?MO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&LO(e,t,i),i};let Gs=class extends Ye{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:r}=zt.state;this.uri=r},0)}get overlayEl(){return Pe.getShadowRootElement(this,".wcm-qr-container")}render(){return he`<div class="wcm-qr-container">${this.uri?he`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${Ir(this.walletId)}" imageId="${Ir(this.imageId)}"></wcm-qrcode>`:he`<wcm-spinner></wcm-spinner>`}</div>`}};Gs.styles=[rt.globalCss,NO],Sc([Be()],Gs.prototype,"walletId",2),Sc([Be()],Gs.prototype,"imageId",2),Sc([Lr()],Gs.prototype,"uri",2),Gs=Sc([ot("wcm-walletconnect-qr")],Gs);var UO=Object.defineProperty,jO=Object.getOwnPropertyDescriptor,FO=(r,e,t,n)=>{for(var i=n>1?void 0:n?jO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&UO(e,t,i),i};let sf=class extends Ye{viewTemplate(){return we.isAndroid()?he`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:we.isMobile()?he`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:he`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return he`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};sf.styles=[rt.globalCss],sf=FO([ot("wcm-connect-wallet-view")],sf);const BO=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var kO=Object.defineProperty,qO=Object.getOwnPropertyDescriptor,Sm=(r,e,t,n)=>{for(var i=n>1?void 0:n?qO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&kO(e,t,i),i};let Oc=class extends Ye{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(r){const{desktop:e,name:t}=we.getWalletRouterData(),n=e?.native;if(n){const i=we.formatNativeUrl(n,r,t);we.openHref(i,"_self")}}openDesktopApp(){const{walletConnectUri:r}=zt.state,e=we.getWalletRouterData();Pe.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){const{name:r,id:e,image_id:t}=we.getWalletRouterData(),{isMobile:n,isWeb:i}=Pe.getCachedRouterWalletPlatforms();return he`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Ir(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${r} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isWeb="${i}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Oc.styles=[rt.globalCss,BO],Sm([Lr()],Oc.prototype,"isError",2),Oc=Sm([ot("wcm-desktop-connecting-view")],Oc);const zO=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var HO=Object.defineProperty,WO=Object.getOwnPropertyDescriptor,KO=(r,e,t,n)=>{for(var i=n>1?void 0:n?WO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&HO(e,t,i),i};let of=class extends Ye{onInstall(r){r&&we.openHref(r,"_blank")}render(){const{name:r,id:e,image_id:t,homepage:n}=we.getWalletRouterData();return he`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Ir(t)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${r} to continue. If multiple browser extensions are installed, disable non ${r} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${ht.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};of.styles=[rt.globalCss,zO],of=KO([ot("wcm-install-wallet-view")],of);const VO=lt`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var GO=Object.defineProperty,YO=Object.getOwnPropertyDescriptor,Om=(r,e,t,n)=>{for(var i=n>1?void 0:n?YO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&GO(e,t,i),i};let Cc=class extends Ye{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(r,e=!1){const{mobile:t,name:n}=we.getWalletRouterData(),i=t?.native,a=t?.universal;if(i&&!e){const c=we.formatNativeUrl(i,r,n);we.openHref(c,"_self")}else if(a){const c=we.formatUniversalUrl(a,r,n);we.openHref(c,"_self")}}openMobileApp(r=!1){const{walletConnectUri:e}=zt.state,t=we.getWalletRouterData();Pe.setRecentWallet(t),e&&this.onFormatAndRedirect(e,r)}onGoToAppStore(r){r&&we.openHref(r,"_blank")}render(){const{name:r,id:e,image_id:t,app:n,mobile:i}=we.getWalletRouterData(),{isWeb:a}=Pe.getCachedRouterWalletPlatforms(),c=n?.ios,u=i?.universal;return he`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Ir(t)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${a}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${u?he`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${Ir(t)}"></wcm-wallet-image><wcm-text>${`Get ${r}`}</wcm-text></div><wcm-button .iconRight="${ht.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};Cc.styles=[rt.globalCss,VO],Om([Lr()],Cc.prototype,"isError",2),Cc=Om([ot("wcm-mobile-connecting-view")],Cc);const ZO=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var JO=Object.defineProperty,QO=Object.getOwnPropertyDescriptor,XO=(r,e,t,n)=>{for(var i=n>1?void 0:n?QO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&JO(e,t,i),i};let af=class extends Ye{render(){const{name:r,id:e,image_id:t}=we.getWalletRouterData(),{isDesktop:n,isWeb:i}=Pe.getCachedRouterWalletPlatforms();return he`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${Ir(t)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${r} app`}</wcm-text><wcm-platform-selection .isDesktop="${n}" .isWeb="${i}"></wcm-platform-selection></wcm-info-footer>`}};af.styles=[rt.globalCss,ZO],af=XO([ot("wcm-mobile-qr-connecting-view")],af);var eC=Object.defineProperty,tC=Object.getOwnPropertyDescriptor,rC=(r,e,t,n)=>{for(var i=n>1?void 0:n?tC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&eC(e,t,i),i};let cf=class extends Ye{render(){return he`<wcm-modal-header title="Scan the code" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};cf.styles=[rt.globalCss],cf=rC([ot("wcm-qrcode-view")],cf);const nC=lt`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var iC=Object.defineProperty,sC=Object.getOwnPropertyDescriptor,oa=(r,e,t,n)=>{for(var i=n>1?void 0:n?sC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&iC(e,t,i),i};const lf=40;let rs=class extends Ye{constructor(){super(...arguments),this.loading=!Nr.state.wallets.listings.length,this.firstFetch=!Nr.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=Pe.debounce(r=>{r.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=r,Nr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),Nr.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var r;(r=this.intersectionObserver)==null||r.disconnect()}get placeholderEl(){return Pe.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([r])=>{r.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:r,search:e}=Nr.state,{listings:t,total:n}=this.search?e:r;return n<=lf||t.length>=n}async fetchWallets(){var r;const{wallets:e,search:t}=Nr.state,{listings:n,total:i,page:a}=this.search?t:e;if(!this.endReached&&(this.firstFetch||i>lf&&n.length<i))try{this.loading=!0;const c=(r=zt.state.chains)==null?void 0:r.join(","),{listings:u}=await Nr.getWallets({page:this.firstFetch?1:a+1,entries:lf,search:this.search,version:2,chains:c}),f=u.map(h=>Pe.getWalletIcon(h));await Promise.all([...f.map(async h=>Pe.preloadImage(h)),we.wait(300)]),this.endReached=this.isLastPage()}catch(c){console.error(c),hi.openToast(Pe.getErrorMessage(c),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(r){we.isAndroid()?Pe.handleMobileLinking(r):Pe.goToConnectingView(r)}onSearchChange(r){const{value:e}=r.target;this.searchDebounce(e)}render(){const{wallets:r,search:e}=Nr.state,{listings:t}=this.search?e:r,n=this.loading&&!t.length,i=this.search.length>=3;let a=wi.manualWalletsTemplate(),c=wi.recomendedWalletsTemplate(!0);i&&(a=a.filter(({values:h})=>Pe.caseSafeIncludes(h[0],this.search)),c=c.filter(({values:h})=>Pe.caseSafeIncludes(h[0],this.search)));const u=!this.loading&&!t.length&&!c.length,f={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":u};return he`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${qn(f)}"><div class="wcm-grid">${n?null:a} ${n?null:c} ${n?null:t.map(h=>he`${h?he`<wcm-wallet-button imageId="${h.image_id}" name="${h.name}" walletId="${h.id}" .onClick="${()=>this.onConnect(h)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${u?he`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!u&&this.loading?he`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};rs.styles=[rt.globalCss,nC],oa([Lr()],rs.prototype,"loading",2),oa([Lr()],rs.prototype,"firstFetch",2),oa([Lr()],rs.prototype,"search",2),oa([Lr()],rs.prototype,"endReached",2),rs=oa([ot("wcm-wallet-explorer-view")],rs);const oC=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var aC=Object.defineProperty,cC=Object.getOwnPropertyDescriptor,Cm=(r,e,t,n)=>{for(var i=n>1?void 0:n?cC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&aC(e,t,i),i};let $c=class extends Ye{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(r){const{desktop:e,name:t}=we.getWalletRouterData(),n=e?.universal;if(n){const i=we.formatUniversalUrl(n,r,t);we.openHref(i,"_blank")}}openWebWallet(){const{walletConnectUri:r}=zt.state,e=we.getWalletRouterData();Pe.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){const{name:r,id:e,image_id:t}=we.getWalletRouterData(),{isMobile:n,isDesktop:i}=Pe.getCachedRouterWalletPlatforms(),a=we.isMobile();return he`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Ir(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${r} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isDesktop="${a?!1:i}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};$c.styles=[rt.globalCss,oC],Cm([Lr()],$c.prototype,"isError",2),$c=Cm([ot("wcm-web-connecting-view")],$c);var lC=Object.freeze({__proto__:null,get WcmModal(){return Vs},get WcmQrCode(){return Hn}});dn.EthereumProvider=Rx,dn.OPTIONAL_EVENTS=eg,dn.OPTIONAL_METHODS=X1,dn.REQUIRED_EVENTS=tc,dn.REQUIRED_METHODS=ec,dn.default=nc,Object.defineProperty(dn,"__esModule",{value:!0})});
139
139
  //# sourceMappingURL=index.umd.js.map