UNPKG

@metamask/snap-account-abstraction-keyring

Version:

An account abstraction keyring snap that integrates with MetaMask accounts.

1 lines 561 kB
(()=>{var t={848:(t,e)=>{"use strict";e.S6=void 0;const n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={};for(let t=0;t<32;t++){const e=n.charAt(t);r[e]=t}function i(t){const e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function s(t){let e=1;for(let n=0;n<t.length;++n){const r=t.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+t+")";e=i(e)^r>>5}e=i(e);for(let n=0;n<t.length;++n){const r=t.charCodeAt(n);e=i(e)^31&r}return e}function a(t,e,n,r){let i=0,s=0;const a=(1<<n)-1,o=[];for(let r=0;r<t.length;++r)for(i=i<<e|t[r],s+=e;s>=n;)s-=n,o.push(i>>s&a);if(r)s>0&&o.push(i<<n-s&a);else{if(s>=e)return"Excess padding";if(i<<n-s&a)return"Non-zero padding"}return o}function o(t){return a(t,8,5,!0)}function f(t){const e=a(t,5,8,!1);if(Array.isArray(e))return e}function c(t){const e=a(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}function u(t){let e;function a(t,n){if(n=n||90,t.length<8)return t+" too short";if(t.length>n)return"Exceeds length limit";const a=t.toLowerCase(),o=t.toUpperCase();if(t!==a&&t!==o)return"Mixed-case string "+t;const f=(t=a).lastIndexOf("1");if(-1===f)return"No separator character for "+t;if(0===f)return"Missing prefix for "+t;const c=t.slice(0,f),u=t.slice(f+1);if(u.length<6)return"Data too short";let l=s(c);if("string"==typeof l)return l;const d=[];for(let t=0;t<u.length;++t){const e=u.charAt(t),n=r[e];if(void 0===n)return"Unknown character "+e;l=i(l)^n,t+6>=u.length||d.push(n)}return l!==e?"Invalid checksum for "+t:{prefix:c,words:d}}return e="bech32"===t?1:734539939,{decodeUnsafe:function(t,e){const n=a(t,e);if("object"==typeof n)return n},decode:function(t,e){const n=a(t,e);if("object"==typeof n)return n;throw new Error(n)},encode:function(t,r,a){if(a=a||90,t.length+7+r.length>a)throw new TypeError("Exceeds length limit");let o=s(t=t.toLowerCase());if("string"==typeof o)throw new Error(o);let f=t+"1";for(let t=0;t<r.length;++t){const e=r[t];if(e>>5!=0)throw new Error("Non 5-bit word");o=i(o)^e,f+=n.charAt(e)}for(let t=0;t<6;++t)o=i(o);o^=e;for(let t=0;t<6;++t){f+=n.charAt(o>>5*(5-t)&31)}return f},toWords:o,fromWordsUnsafe:f,fromWords:c}}e.S6=u("bech32"),u("bech32m")},64:(t,e)=>{"use strict";e.byteLength=function(t){var e=o(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,s=o(t),a=s[0],f=s[1],c=new i(function(t,e,n){return 3*(e+n)/4-n}(0,a,f)),u=0,l=f>0?a-4:a;for(n=0;n<l;n+=4)e=r[t.charCodeAt(n)]<<18|r[t.charCodeAt(n+1)]<<12|r[t.charCodeAt(n+2)]<<6|r[t.charCodeAt(n+3)],c[u++]=e>>16&255,c[u++]=e>>8&255,c[u++]=255&e;2===f&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,c[u++]=255&e);1===f&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e);return c},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],a=16383,o=0,c=r-i;o<c;o+=a)s.push(f(t,o,o+a>c?c:o+a));1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return s.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=s[a],r[s.charCodeAt(a)]=a;function o(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function f(t,e,r){for(var i,s,a=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),a.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},768:(t,e,n)=>{"use strict";const r=n(64),i=n(888),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Sn=f,e.ZK=50;const a=2147483647;function o(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return c(t,e,n)}function c(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|b(t,e);let r=o(n);const i=r.write(t,e);i!==n&&(r=r.slice(0,i));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){const e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer))return h(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return h(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return f.from(r,e,n);const i=function(t){if(f.isBuffer(t)){const e=0|p(t.length),n=o(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||W(t.length)?o(0):d(t);if("Buffer"===t.type&&Array.isArray(t.data))return d(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return u(t),o(t<0?0:0|p(t))}function d(t){const e=t.length<0?0:0|p(t.length),n=o(e);for(let r=0;r<e;r+=1)n[r]=255&t[r];return n}function h(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,f.prototype),r}function p(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function b(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(t).length;default:if(i)return r?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,n){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return O(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return x(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function g(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),W(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=f.from(e,r)),f.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){let s,a=1,o=t.length,f=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,o/=2,f/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let r=-1;for(s=n;s<o;s++)if(c(t,s)===c(e,-1===r?0:s-r)){if(-1===r&&(r=s),s-r+1===f)return r*a}else-1!==r&&(s-=s-r),r=-1}else for(n+f>o&&(n=o-f),s=n;s>=0;s--){let n=!0;for(let r=0;r<f;r++)if(c(t,s+r)!==c(e,r)){n=!1;break}if(n)return s}return-1}function A(t,e,n,r){n=Number(n)||0;const i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;const s=e.length;let a;for(r>s/2&&(r=s/2),a=0;a<r;++a){const r=parseInt(e.substr(2*a,2),16);if(W(r))return a;t[n+a]=r}return a}function v(t,e,n,r){return J(K(e,t.length-n),t,n,r)}function E(t,e,n,r){return J(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function T(t,e,n,r){return J(q(e),t,n,r)}function I(t,e,n,r){return J(function(t,e){let n,r,i;const s=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,s.push(i),s.push(r);return s}(e,t.length-n),t,n,r)}function x(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function O(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i<n;){const e=t[i];let s=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=n){let n,r,o,f;switch(a){case 1:e<128&&(s=e);break;case 2:n=t[i+1],128==(192&n)&&(f=(31&e)<<6|63&n,f>127&&(s=f));break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(f=(15&e)<<12|(63&n)<<6|63&r,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:n=t[i+1],r=t[i+2],o=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&o)&&(f=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&o,f>65535&&f<1114112&&(s=f))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return function(t){const e=t.length;if(e<=N)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=N));return n}(r)}f.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,n){return c(t,e,n)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,n){return function(t,e,n){return u(t),t<=0?o(t):void 0!==e?"string"==typeof n?o(t).fill(e,n):o(t).fill(e):o(t)}(t,e,n)},f.allocUnsafe=function(t){return l(t)},f.allocUnsafeSlow=function(t){return l(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),$(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let i=0,s=Math.min(n,r);i<s;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=f.allocUnsafe(e);let i=0;for(n=0;n<t.length;++n){let e=t[n];if($(e,Uint8Array))i+e.length>r.length?(f.isBuffer(e)||(e=f.from(e)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!f.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},f.byteLength=b,f.prototype._isBuffer=!0,f.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)g(this,e,e+1);return this},f.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},f.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},f.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?O(this,0,t):y.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){let t="";const n=e.ZK;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},s&&(f.prototype[s]=f.prototype.inspect),f.prototype.compare=function(t,e,n,r,i){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let s=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0);const o=Math.min(s,a),c=this.slice(r,i),u=t.slice(e,n);for(let t=0;t<o;++t)if(c[t]!==u[t]){s=c[t],a=u[t];break}return s<a?-1:a<s?1:0},f.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},f.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},f.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},f.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return A(this,t,e,n);case"utf8":case"utf-8":return v(this,t,e,n);case"ascii":case"latin1":case"binary":return E(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function k(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function P(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function R(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=e;r<n;++r)i+=Z[t[r]];return i}function B(t,e,n){const r=t.slice(e,n);let i="";for(let t=0;t<r.length-1;t+=2)i+=String.fromCharCode(r[t]+256*r[t+1]);return i}function S(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,n,r,i,s){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function U(t,e,n,r,i){V(e,r,i,t,n,7);let s=Number(e&BigInt(4294967295));t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,n}function L(t,e,n,r,i){V(e,r,i,t,n,7);let s=Number(e&BigInt(4294967295));t[n+7]=s,s>>=8,t[n+6]=s,s>>=8,t[n+5]=s,s>>=8,t[n+4]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=a,a>>=8,t[n+2]=a,a>>=8,t[n+1]=a,a>>=8,t[n]=a,n+8}function D(t,e,n,r,i,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(t,e,n,r,s){return e=+e,n>>>=0,s||D(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function M(t,e,n,r,s){return e=+e,n>>>=0,s||D(t,0,n,8),i.write(t,e,n,r,52,8),n+8}f.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,f.prototype),r},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||S(t,e,this.length);let r=this[t],i=1,s=0;for(;++s<e&&(i*=256);)r+=this[t+s]*i;return r},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||S(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readBigUInt64LE=Y((function(t){_(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),f.prototype.readBigUInt64BE=Y((function(t){_(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),f.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||S(t,e,this.length);let r=this[t],i=1,s=0;for(;++s<e&&(i*=256);)r+=this[t+s]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},f.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||S(t,e,this.length);let r=e,i=1,s=this[t+--r];for(;r>0&&(i*=256);)s+=this[t+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},f.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},f.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readBigInt64LE=Y((function(t){_(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),f.prototype.readBigInt64BE=Y((function(t){_(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)})),f.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){C(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=1,s=0;for(this[e]=255&t;++s<n&&(i*=256);)this[e+s]=t/i&255;return e+n},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){C(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=n-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+n},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigUInt64LE=Y((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),f.prototype.writeBigUInt64BE=Y((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),f.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);C(this,t,e,n,r-1,-r)}let i=0,s=1,a=0;for(this[e]=255&t;++i<n&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},f.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);C(this,t,e,n,r-1,-r)}let i=n-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},f.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigInt64LE=Y((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),f.prototype.writeBigInt64BE=Y((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),f.prototype.writeFloatLE=function(t,e,n){return F(this,t,e,!0,n)},f.prototype.writeFloatBE=function(t,e,n){return F(this,t,e,!1,n)},f.prototype.writeDoubleLE=function(t,e,n){return M(this,t,e,!0,n)},f.prototype.writeDoubleBE=function(t,e,n){return M(this,t,e,!1,n)},f.prototype.copy=function(t,e,n,r){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);const i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},f.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!f.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){const e=t.charCodeAt(0);("utf8"===r&&e<128||"latin1"===r)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{const s=f.isBuffer(t)?t:f.from(t,r),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=s[i%a]}return this};const G={};function H(t,e,n){G[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function j(t){let e="",n=t.length;const r="-"===t[0]?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function V(t,e,n,r,i,s){if(t>n||t<e){const r="bigint"==typeof e?"n":"";let i;throw i=s>3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new G.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){_(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||z(e,t.length-(n+1))}(r,i,s)}function _(t,e){if("number"!=typeof t)throw new G.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,n){if(Math.floor(t)!==t)throw _(t,n),new G.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}H("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),H("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),H("ERR_OUT_OF_RANGE",(function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=j(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r}),RangeError);const Q=/[^+/0-9A-Za-z-_]/g;function K(t,e){let n;e=e||1/0;const r=t.length;let i=null;const s=[];for(let a=0;a<r;++a){if(n=t.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function q(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,n,r){let i;for(i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function $(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function W(t){return t!=t}const Z=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function Y(t){return"undefined"==typeof BigInt?X:t}function X(){throw new Error("BigInt not supported")}},928:t=>{"use strict";var e,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,s),r(n)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}b(t,e,s,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&b(t,"error",e,n)}(t,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function c(t,e,n,r){var i,s,a,c;if(o(n),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),a=s[e]),void 0===a)a=s[e]=n,++t._eventsCount;else if("function"==typeof a?a=s[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=f(t))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return t}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):p(i,i.length)}function h(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function b(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(s){r.once&&t.removeEventListener(e,i),n(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===t,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var f=s[t];if(void 0===f)return!1;if("function"==typeof f)r(f,this,e);else{var c=f.length,u=p(f,c);for(n=0;n<c;++n)r(u[n],this,e)}return!0},s.prototype.addListener=function(t,e){return c(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return c(this,t,e,!0)},s.prototype.once=function(t,e){return o(e),this.on(t,l(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return o(e),this.prependListener(t,l(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,r,i,s,a;if(o(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){a=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):h.call(t,e)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},128:t=>{t.exports=a,a.default=a,a.stable=u,a.stableStringify=u;var e="[...]",n="[Circular]",r=[],i=[];function s(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(t,e,n,a){var o;void 0===a&&(a=s()),f(t,"",0,[],void 0,0,a);try{o=0===i.length?JSON.stringify(t,e,n):JSON.stringify(t,d(e),n)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return o}function o(t,e,n,s){var a=Object.getOwnPropertyDescriptor(s,n);void 0!==a.get?a.configurable?(Object.defineProperty(s,n,{value:t}),r.push([s,n,e,a])):i.push([e,n,t]):(s[n]=t,r.push([s,n,e]))}function f(t,r,i,s,a,c,u){var l;if(c+=1,"object"==typeof t&&null!==t){for(l=0;l<s.length;l++)if(s[l]===t)return void o(n,t,r,a);if(void 0!==u.depthLimit&&c>u.depthLimit)return void o(e,t,r,a);if(void 0!==u.edgesLimit&&i+1>u.edgesLimit)return void o(e,t,r,a);if(s.push(t),Array.isArray(t))for(l=0;l<t.length;l++)f(t[l],l,l,s,t,c,u);else{var d=Object.keys(t);for(l=0;l<d.length;l++){var h=d[l];f(t[h],h,l,s,t,c,u)}}s.pop()}}function c(t,e){return t<e?-1:t>e?1:0}function u(t,e,n,a){void 0===a&&(a=s());var o,f=l(t,"",0,[],void 0,0,a)||t;try{o=0===i.length?JSON.stringify(f,e,n):JSON.stringify(f,d(e),n)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return o}function l(t,i,s,a,f,u,d){var h;if(u+=1,"object"==typeof t&&null!==t){for(h=0;h<a.length;h++)if(a[h]===t)return void o(n,t,i,f);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==d.depthLimit&&u>d.depthLimit)return void o(e,t,i,f);if(void 0!==d.edgesLimit&&s+1>d.edgesLimit)return void o(e,t,i,f);if(a.push(t),Array.isArray(t))for(h=0;h<t.length;h++)l(t[h],h,h,a,t,u,d);else{var p={},b=Object.keys(t).sort(c);for(h=0;h<b.length;h++){var y=b[h];l(t[y],y,h,a,t,u,d),p[y]=t[y]}if(void 0===f)return p;r.push([f,i,t]),f[i]=p}a.pop()}}function d(t){return t=void 0!==t?t:function(t,e){return e},function(e,n){if(i.length>0)for(var r=0;r<i.length;r++){var s=i[r];if(s[1]===e&&s[0]===n){n=s[2],i.splice(r,1);break}}return t.call(this,e,n)}}},888:(t,e)=>{e.read=function(t,e,n,r,i){var s,a,o=8*i-r-1,f=(1<<o)-1,c=f>>1,u=-7,l=n?i-1:0,d=n?-1:1,h=t[e+l];for(l+=d,s=h&(1<<-u)-1,h>>=-u,u+=o;u>0;s=256*s+t[e+l],l+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=r;u>0;a=256*a+t[e+l],l+=d,u-=8);if(0===s)s=1-c;else{if(s===f)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),s-=c}return(h?-1:1)*a*Math.pow(2,s-r)},e.write=function(t,e,n,r,i,s){var a,o,f,c=8*s-i-1,u=(1<<c)-1,l=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,p=r?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+l>=1?d/f:d*Math.pow(2,1-l))*f>=2&&(a++,f/=2),a+l>=u?(o=0,a=u):a+l>=1?(o=(e*f-1)*Math.pow(2,i),a+=l):(o=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&o,h+=p,o/=256,i-=8);for(a=a<<i|o,c+=i;c>0;t[n+h]=255&a,h+=p,a/=256,c-=8);t[n+h-p]|=128*b}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{onKeyringRequest:()=>Ov,onRpcRequest:()=>xv});var t={};n.r(t),n.d(t,{yA:()=>pn,EH:()=>nn,bytesToNumberBE:()=>fn,MH:()=>cn,Q7:()=>hn,c1:()=>gn,qG:()=>dn,hexToBytes:()=>on,Y9:()=>tn,e_:()=>un,Gs:()=>ln,El:()=>wn});var e={};n.r(e),n.d(e,{yA:()=>ey,EH:()=>Kb,bytesToNumberBE:()=>$b,MH:()=>Wb,Q7:()=>ty,c1:()=>iy,qG:()=>Xb,hexToBytes:()=>Jb,e_:()=>Zb,Gs:()=>Yb,El:()=>ay});class i extends TypeError{constructor(t,e){let n;const{message:r,explanation:i,...s}=t,{path:a}=t,o=0===a.length?r:`At path: ${a.join(".")} -- ${r}`;super(i??o),null!=i&&(this.cause=o),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...e()])}}function s(t){return"object"==typeof t&&null!==t}function a(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function o(t,e,n,r){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:f,message:c=`Expected a value of type \`${o}\`${f?` with refinement \`${f}\``:""}, but received: \`${a(r)}\``}=t;return{value:r,type:o,refinement:f,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*f(t,e,n,r){(function(t){return s(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const i of t){const t=o(i,e,n,r);t&&(yield t)}}function*c(t,e,n={}){const{path:r=[],branch:i=[t],coerce:a=!1,mask:o=!1}=n,f={path:r,branch:i};if(a&&(t=e.coercer(t,f),o&&"type"!==e.type&&s(e.schema)&&s(t)&&!Array.isArray(t)))for(const n in t)void 0===e.schema[n]&&delete t[n];let u="valid";for(const r of e.validator(t,f))r.explanation=n.message,u="not_valid",yield[r,void 0];for(let[l,d,h]of e.entries(t,f)){const e=c(d,h,{path:void 0===l?r:[...r,l],branch:void 0===l?i:[...i,d],coerce:a,mask:o,message:n.message});for(const n of e)n[0]?(u=null===n[0].refinement||void 0===n[0].refinement?"not_valid":"not_refined",yield[n[0],void 0]):a&&(d=n[1],void 0===l?t=d:t instanceof Map?t.set(l,d):t instanceof Set?t.add(d):s(t)&&(void 0!==d||l in t)&&(t[l]=d))}if("not_valid"!==u)for(const r of e.refiner(t,f))r.explanation=n.message,u="not_refined",yield[r,void 0];"valid"===u&&(yield[void 0,t])}class u{constructor(t){const{type:e,schema:n,validator:r,refiner:i,coercer:s=(t=>t),entries:a=function*(){}}=t;this.type=e,this.schema=n,this.entries=a,this.coercer=s,this.validator=r?(t,e)=>f(r(t,e),e,this,t):()=>[],this.refiner=i?(t,e)=>f(i(t,e),e,this,t):()=>[]}assert(t,e){return l(t,this,e)}create(t,e){return d(t,this,e)}is(t){return h(t,this)}mask(t,e){return function(t,e,n){const r=p(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(t,this,e)}validate(t,e={}){return p(t,this,e)}}function l(t,e,n){const r=p(t,e,{message:n});if(r[0])throw r[0]}function d(t,e,n){const r=p(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function h(t,e){return!p(t,e)[0]}function p(t,e,n={}){const r=c(t,e,n),s=function(t){const{done:e,value:n}=t.next();return e?void 0:n}(r);if(s[0]){return[new i(s[0],(function*(){for(const t of r)t[0]&&(yield t[0])})),void 0]}return[void 0,s[1]]}function b(){return S("any",(()=>!0))}function y(t){return new u({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${a(t)}`})}function g(){return S("boolean",(t=>"boolean"==typeof t))}function m(t){const e={},n=t.map((t=>a(t))).join();for(const n of t)e[n]=n;return new u({type:"enums",schema:e,validator:e=>t.includes(e)||`Expected one of \`${n}\`, but received: ${a(e)}`})}function w(){return S("integer",(t=>"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${a(t)}`))}function A(t){const e=a(t),n=typeof t;return new u({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?t:null,validator:n=>n===t||`Expected the literal \`${e}\`, but received: ${a(n)}`})}function v(){return S("never",(()=>!1))}function E(t){return new u({...t,validator:(e,n)=>null===e||t.validator(e,n),refiner:(e,n)=>null===e||t.refiner(e,n)})}function T(){return S("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${a(t)}`))}function I(t){const e=t?Object.keys(t):[],n=v();return new u({type:"object",schema:t??null,*entries(r){if(t&&s(r)){const i=new Set(Object.keys(r));for(const n of e)i.delete(n),yield[n,r[n],t[n]];for(const t of i)yield[t,r[t],n]}},validator:t=>s(t)||`Expected an object, but received: ${a(t)}`,coercer:t=>s(t)?{...t}:t})}function x(t){return new u({...t,validator:(e,n)=>void 0===e||t.validator(e,n),refiner:(e,n)=>void 0===e||t.refiner(e,n)})}function O(t,e){return new u({type:"record",schema:null,*entries(n){if(s(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator:t=>s(t)||`Expected an object, but received: ${a(t)}`})}function N(){return S("string",(t=>"string"==typeof t||`Expected a string, but received: ${a(t)}`))}function k(t){const e=v();return new u({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator:t=>Array.isArray(t)||`Expected an array, but received: ${a(t)}`})}function P(t){const e=t.map((t=>t.type)).join(" | ");return new u({type:"union",schema:null,coercer(e){for(const n of t){const[t,r]=n.validate(e,{coerce:!0});if(!t)return r}return e},validator(n,r){const i=[];for(const e of t){const[...t]=c(n,e,r),[s]=t;if(!s?.[0])return[];for(const[e]of t)e&&i.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${a(n)}`,...i]}})}function R(){return S("unknown",(()=>!0))}function B(...t){const e="type"===t[0]?.type,n=t.map((({schema:t})=>t)),r=Object.assign({},...n);return e?function(t){const e=Object.keys(t);return new u({type:"type",schema:t,*entries(n){if(s(n))for(const r of e)yield[r,n[r],t[r]]},validator:t=>s(t)||`Expected an object, but received: ${a(t)}`,coercer:t=>s(t)?{...t}:t})}(r):I(r)}function S(t,e){return new u({type:t,schema:null,validator:e})}function C(t){let e;return new u({type:"lazy",schema:null,*entries(n,r){e??(e=t()),yield*e.entries(n,r)},validator:(n,r)=>(e??(e=t()),e.validator(n,r)),coercer:(n,r)=>(e??(e=t()),e.coercer(n,r)),refiner:(n,r)=>(e??(e=t()),e.refiner(n,r))})}function U(t){return I(t)}function L(t){return t.path[t.path.length-1]in t.branch[t.branch.length-2]}function D(t){return new u({...t,validator:(e,n)=>!L(n)||t.validator(e,n),refiner:(e,n)=>!L(n)||t.refiner(e,n)})}function F(t,e){return S(t,(t=>"string"==typeof t&&e.test(t)))}const M=F("UuidV4",/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu),G=S("Url",(t=>{try{const e=new URL(t);return"http:"===e.protocol||"https:"===e.protocol}catch{return!1}})),H=F("StringNumber",/^\d+(\.\d+)?$/u);function j(t,e,n){return new u({...t,coercer:(r,i)=>h(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}Error;const V=(t,e)=>Object.hasOwnProperty.call(t,e);var _;!function(t){t[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date"}(_=_||(_={}));function z(t){return function(t){return function(t){return"object"==typeof t&&null!==t&&"message"in t}(t)&&"string"==typeof t.message?t.message:null==t?"":String(t)}(t).replace(/\.$/u,"")}function Q(t,e){return n=t,Boolean("string"==typeof n?.prototype?.constructor?.name)?new t({message:e}):t({message:e});var n}class K extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}const q=t=>I(t);function J({path:t,branch:e}){const n=t[t.length-1];return V(e[e.length-2],n)}function $(t){return new u({...t,type:`optional ${t.type}`,validator:(e,n)=>!J(n)||t.validator(e,n),refiner:(e,n)=>!J(n)||t.refiner(e,n)})}const W=P([A(null),g(),S("finite number",(t=>h(t,T())&&Number.isFinite(t))),N(),y(C((()=>W))),O(N(),C((()=>W)))]),Z=j(W,b(),(t=>(function(t,e,n="Assertion failed",r=K){try{l(t,e)}catch(t){throw Q(r,`${n}: ${z(t)}.`)}}(t,W),JSON.parse(JSON.stringify(t,((t,e)=>{if("__proto__"!==t&&"constructor"!==t)return e}))))));const Y=A("2.0"),X=E(P([T(),N()])),tt=q({code:w(),message:N(),data:$(Z),stack:$(N())}),et=P([O(N(),Z),y(Z)]);q({id:X,jsonrpc:Y,method:N(),params:$(et)}),q({jsonrpc:Y,method:N(),params:$(et)});I({id:X,jsonrpc:Y,result:x(R()),error:x(tt)});const nt=q({id:X,jsonrpc:Y,result:Z}),rt=q({id:X,jsonrpc:Y,error:tt});P([nt,rt]);const it=U({jsonrpc:A("2.0"),id:P([N(),T(),A(null)]),method:N(),params:D(P([y(Z),O(N(),Z)]))});function st(t){return t instanceof Map||t instanceof Set?t.size:t.length}function at(t){return ft(t,"nonempty",(e=>st(e)>0||`Expected a nonempty ${t.type} but received an empty one`))}function ot(t,e){return ft(t,"pattern",(n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`))}function ft(t,e,n){return new u({...t,*refiner(r,i){yield*t.refiner(r,i);const s=f(n(r,i),i,t,r);for(const t of s)yield{...t,refinement:e}}})}const ct=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,ut=/^[-a-z0-9]{3,8}$/u,lt=/^[-_a-zA-Z0-9]{1,32}$/u,dt=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,ht=ot(N(),ct),pt=ot(N(),ut),bt=(ot(N(),lt),ot(N(),dt),ot(N(),/^[-.%a-zA-Z0-9]{1,128}$/u),ot(N(),/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u)),yt=ot(N(),/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u);var gt;!function(t){t.Bip122="bip122",t.Solana="solana",t.Eip155="eip155",t.Wallet="wallet"}(gt=gt||(gt={}));const mt=(t,e)=>Object.hasOwnProperty.call(t,e);var wt;!function(t){t[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date"}(wt=wt||(wt={}));const At=t=>I(t);function vt({path:t,branch:e}){const n=t[t.length-1];return mt(e[e.length-2],n)}function Et(t){return new u({...t,type:`optional ${t.type}`,validator:(e,n)=>!vt(n)||t.validator(e,n),refiner:(e,n)=>!vt(n)||t.refiner(e,n)})}function Tt(t){if(null===t||"boolean"==typeof t||"string"==typeof t)return!0;if("number"==typeof t&&Number.isFinite(t))return!0;if("object"==typeof t){let e=!0;if(Array.isArray(t)){for(let n=0;n<t.length;n++)if(!Tt(t[n])){e=!1;break}return e}const n=Object.entries(t);for(let t=0;t<n.length;t++)if("string"!=typeof n[t][0]||!Tt(n[t][1])){e=!1;break}return e}return!1}const It=S("JSON",(t=>Tt(t))),xt=j(It,ft(b(),"JSON",(t=>h(t,It))),(t=>JSON.parse(JSON.stringify(t,((t,e)=>{if("__proto__"!==t&&"constructor"!==t)return e})))));const Ot=A("2.0"),Nt=E(P([T(),N()])),kt=At({code:w(),message:N(),data:Et(xt),stack:Et(N())}),Pt=P([O(N(),xt),y(xt)]);At({id:Nt,jsonrpc:Ot,method:N(),params:Et(Pt)}),At({jsonrpc:Ot,method:N(),params:Et(Pt)});I({id:Nt,jsonrpc:Ot,result:x(R()),error:x(kt)});const Rt=At({id:Nt,jsonrpc:Ot,result:xt}),Bt=At({id:Nt,jsonrpc:Ot,error:kt});P([Rt,Bt]);var St,Ct,Ut;!function(t){t.Eoa="eip155:eoa",t.Erc4337="eip155:erc4337"}(St||(St={})),function(t){t.P2wpkh="bip122:p2wpkh"}(Ct||(Ct={})),function(t){t.DataAccount="solana:data-account"}(Ut||(Ut={}));const Lt=U({id:M,type:m([`${St.Eoa}`,`${St.Erc4337}`,`${Ct.P2wpkh}`,`${Ut.DataAccount}`]),address:N(),scopes:at(y(P([pt,ht]))),options:O(N(),xt),methods:y(N())}),Dt=U({fungible:A(!0),type:bt,unit:N(),amount:H}),Ft=U({fungible:A(!1),id:yt}),Mt=(Gt=t=>function(t){if("object"!=typeof t||null===t)return!1;try{let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}catch(t){return!1}}(t)&&!t.fungible?Ft:Dt,new u(