PageSourceSearch

https://jobjab-fhevm-react-template-nextjs.vercel.app/_next/static/chunks/7eb9212a.62e435d9b3ad81ff.js

js jobjab-fhevm-react-template-nextjs.vercel.app collected 2026-10-03 07:09:21 UTC 486,975 bytes, 6 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7548],{53490:(e,t,n)=>{n.d(t,{default:()=>ch});var r,i=n(77928),o=n.n(i),a=n(73118),s=n.n(a),l=n(56356),c=n.n(l),d=n(44208),u=n(7695),h=n(58806);function f(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;var p=void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},g=[],m=[],y="undefined"!=typeof Uint8Array?Uint8Array:Array,v=!1;function b(){v=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)g[t]=e[t],m[e.charCodeAt(t)]=t;m["-".charCodeAt(0)]=62,m["_".charCodeAt(0)]=63}function E(e){var t;v||b();for(var n=e.length,r=n%3,i="",o=[],a=0,s=n-r;a<s;a+=16383)o.push(function(e,t,n){for(var r,i=[],o=t;o<n;o+=3)i.push(g[(r=(e[o]<<16)+(e[o+1]<<8)+e[o+2])>>18&63]+g[r>>12&63]+g[r>>6&63]+g[63&r]);return i.join("")}(e,a,a+16383>s?s:a+16383));return 1===r?(i+=g[(t=e[n-1])>>2],i+=g[t<<4&63],i+="=="):2===r&&(i+=g[(t=(e[n-2]<<8)+e[n-1])>>10],i+=g[t>>4&63],i+=g[t<<2&63],i+="="),o.push(i),o.join("")}function w(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,c=l>>1,d=-7,u=n?i-1:0,h=n?-1:1,f=e[t+u];for(u+=h,o=f&(1<<-d)-1,f>>=-d,d+=s;d>0;o=256*o+e[t+u],u+=h,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=r;d>0;a=256*a+e[t+u],u+=h,d-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)}function C(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,d=(1<<c)-1,u=d>>1,h=5960464477539062e-23*(23===i),f=r?0:o-1,p=r?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+u>=1?h/l:h*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=d?(s=0,a=d):a+u>=1?(s=(t*l-1)*Math.pow(2,i),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*g}var S={}.toString,_=Array.isArray||function(e){return"[object Array]"==S.call(e)};A.TYPED_ARRAY_SUPPORT=void 0===p.TYPED_ARRAY_SUPPORT||p.TYPED_ARRAY_SUPPORT;var x=k();function k(){return A.TYPED_ARRAY_SUPPORT?0x7fffffff:0x3fffffff}function M(e,t){if(k()<t)throw RangeError("Invalid typed array length");return A.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=A.prototype:(null===e&&(e=new A(t)),e.length=t),e}function A(e,t,n){if(!(A.TYPED_ARRAY_SUPPORT||this instanceof A))return new A(e,t,n);if("number"==typeof e){if("string"==typeof t)throw Error("If encoding is specified then the first argument must be a string");return L(this,e)}return I(this,e,t,n)}function I(e,t,n,r){if("number"==typeof t)throw TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),A.TYPED_ARRAY_SUPPORT?(e=t).__proto__=A.prototype:e=P(e,t),e}(e,t,n,r):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!A.isEncoding(n))throw TypeError('"encoding" must be a valid string encoding');var r=0|N(t,n),i=(e=M(e,r)).write(t,n);return i!==r&&(e=e.slice(0,i)),e}(e,t,n):function(e,t){if(T(t)){var n,r=0|O(t.length);return 0===(e=M(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?M(e,0):P(e,t);if("Buffer"===t.type&&_(t.data))return P(e,t.data)}throw TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function R(e){if("number"!=typeof e)throw TypeError('"size" argument must be a number');if(e<0)throw RangeError('"size" argument must not be negative')}function L(e,t){if(R(t),e=M(e,t<0?0:0|O(t)),!A.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function P(e,t){var n=t.length<0?0:0|O(t.length);e=M(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function O(e){if(e>=k())throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return 0|e}function T(e){return!(null==e||!e._isBuffer)}function N(e,t){if(T(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&
vendor: 15,380 bytes, line 1
1(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return J(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return X(e).length;default:if(r)return J(e).length;t=(""+t).toLowerCase(),r=!0}}function D(e,t,n){var r,i,o,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){var r,i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var o="",a=t;a<n;++a){o+=(r=e[a])<16?"0"+r.toString(16):r.toString(16)}return o}(this,t,n);case"utf8":case"utf-8":return U(this,t,n);case"ascii":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}(this,t,n);case"latin1":case"binary":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}(this,t,n);case"base64":return r=this,i=t,o=n,0===i&&o===r.length?E(r):E(r.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}(this,t,n);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function $(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function B(e,t,n,r,i){if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>0x7fffffff?n=0x7fffffff:n<-0x80000000&&(n=-0x80000000),isNaN(n*=1)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return -1;n=e.length-1}else if(n<0){if(!i)return -1;n=0}if("string"==typeof t&&(t=A.from(t,r)),T(t))return 0===t.length?-1:K(e,t,n,r,i);if("number"==typeof t)return t&=255,A.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):K(e,[t],n,r,i);throw TypeError("val must be string, number or Buffer")}function K(e,t,n,r,i){var o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var d=-1;for(o=n;o<s;o++)if(c(e,o)===c(t,-1===d?0:o-d)){if(-1===d&&(d=o),o-d+1===l)return d*a}else -1!==d&&(o-=o-d),d=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var u=!0,h=0;h<l;h++)if(c(e,o+h)!==c(t,h)){u=!1;break}if(u)return o}return -1}function j(e,t,n,r){return Q(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function U(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,l,c=e[i],d=null,u=c>239?4:c>223?3:c>191?2:1;if(i+u<=n)switch(u){case 1:c<128&&(d=c);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&c)<<6|63&o)>127&&(d=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(d=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(d=l)}null===d?(d=65533,u=1):d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|1023&d),r.push(d),i+=u}var h=r.length;if(h<=H)return String.fromCharCode.apply(String,r);for(var f="",p=0;p<h;)f+=String.fromCharCode.apply(String,r.slice(p,p+=H));return f}A.poolSize=8192,A._augment=function(e){return e.__proto__=A.prototype,e},A.from=function(e,t,n){return I(null,e,t,n)},A.TYPED_ARRAY_SUPPORT&&(A.prototype.__proto__=Uint8Array.prototype,A.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&A[Symbol.species]),A.alloc=function(e,t,n){return R(e),e<=0?M(null,e):void 0!==t?"string"==typeof n?M(null,e).fill(t,n):M(null,e).fill(t):M(null,e)},A.allocUnsafe=function(e){return L(null,e)},A.allocUnsafeSlow=function(e){return L(null,e)},A.isBuffer=ee,A.compare=function(e,t){if(!T(e)||!T(t))throw TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},A.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},A.concat=function(e,t){if(!_(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return A.alloc(0);if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var n,r=A.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!T(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},A.byteLength=N,A.prototype._isBuffer=!0,A.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)$(this,t,t+1);return this},A.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)$(this,t,t+3),$(this,t+1,t+2);return this},A.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)$(this,t,t+7),$(this,t+1,t+6),$(this,t+2,t+5),$(this,t+3,t+4);return this},A.prototype.toString=function(){var e=0|this.length;return 0===e?"":0==arguments.length?U(this,0,e):D.apply(this,arguments)},A.prototype.equals=function(e){if(!T(e))throw TypeError("Argument must be a Buffer");return this===e||0===A.compare(this,e)},A.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},A.prototype.compare=function(e,t,n,r,i){if(!T(e))throw TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return -1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),d=0;d<s;++d)if(l[d]!==c[d]){o=l[d],a=c[d];break}return o<a?-1:+(a<o)},A.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},A.prototype.indexOf=function(e,t,n){return B(this,e,t,n,!0)},A.prototype.lastIndexOf=function(e,t,n){return B(this,e,t,n,!1)},A.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i,o,a,s,l,c,d=this.length-t;if((void 0===n||n>d)&&(n=d),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var u=!1;;)switch(r){case"hex":return function(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))break;e[n+a]=s}return a}(this,e,t,n);case"utf8":case"utf-8":return i=t,o=n,Q(J(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return j(this,e,t,n);case"base64":return a=t,s=n,Q(X(e),this,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=t,c=n,Q(function(e,t){for(var n,r,i=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i.push(n%256),i.push(r);return i}(e,this.length-l),this,l,c);default:if(u)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),u=!0}},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var H=4096;function F(e,t,n){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>n)throw RangeError("Trying to access beyond buffer length")}function z(e,t,n,r,i,o){if(!T(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function q(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function W(e,t,n,r){t<0&&(t=0xffffffff+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function V(e,t,n,r,i,o){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function G(e,t,n,r,i){return i||V(e,0,n,4),C(e,t,n,r,23,4),n+4}function Z(e,t,n,r,i){return i||V(e,0,n,8),C(e,t,n,r,52,8),n+8}A.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),A.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=A.prototype;else{var i=t-e;n=new A(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},A.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},A.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},A.prototype.readUInt8=function(e,t){return t||F(e,1,this.length),this[e]},A.prototype.readUInt16LE=function(e,t){return t||F(e,2,this.length),this[e]|this[e+1]<<8},A.prototype.readUInt16BE=function(e,t){return t||F(e,2,this.length),this[e]<<8|this[e+1]},A.prototype.readUInt32LE=function(e,t){return t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},A.prototype.readUInt32BE=function(e,t){return t||F(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},A.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},A.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},A.prototype.readInt8=function(e,t){return t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},A.prototype.readInt16LE=function(e,t){t||F(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?0xffff0000|n:n},A.prototype.readInt16BE=function(e,t){t||F(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?0xffff0000|n:n},A.prototype.readInt32LE=function(e,t){return t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},A.prototype.readInt32BE=function(e,t){return t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},A.prototype.readFloatLE=function(e,t){return t||F(e,4,this.length),w(this,e,!0,23,4)},A.prototype.readFloatBE=function(e,t){return t||F(e,4,this.length),w(this,e,!1,23,4)},A.prototype.readDoubleLE=function(e,t){return t||F(e,8,this.length),w(this,e,!0,52,8)},A.prototype.readDoubleBE=function(e,t){return t||F(e,8,this.length),w(this,e,!1,52,8)},A.prototype.writeUIntLE=function(e,t,n,r){e*=1,t|=0,n|=0,r||z(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},A.prototype.writeUIntBE=function(e,t,n,r){e*=1,t|=0,n|=0,r||z(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},A.prototype.writeUInt8=function(e,t,n){return e*=1,t|=0,n||z(this,e,t,1,255,0),A.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},A.prototype.writeUInt16LE=function(e,t,n){return e*=1,t|=0,n||z(this,e,t,2,65535,0),A.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):q(this,e,t,!0),t+2},A.prototype.writeUInt16BE=function(e,t,n){return e*=1,t|=0,n||z(this,e,t,2,65535,0),A.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):q(this,e,t,!1),t+2},A.prototype.writeUInt32LE=function(e,t,n){return e*=1,t|=0,n||z(this,e,t,4,0xffffffff,0),A.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):W(this,e,t,!0),t+4},A.prototype.writeUInt32BE=function(e,t,n){return e*=1,t|=0,n||z(this,e,t,4,0xffffffff,0),A.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},A.prototype.writeIntLE=function(e,t,n,r){if(e*=1,t|=0,!r){var i=Math.pow(2,8*n-1);z(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},A.prototype.writeIntBE=function(e,t,n,r){if(e*=1,t|=0,!r){var i=Math.pow(2,8*n-1);z(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},A.prototype.writeInt8=function(e,t,n){return e*=1,t|=0,n||z(this,e,t,1,127,-128),A.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},A.prototype.writeInt16LE=function(e,t,n){return e*=1,t|=0,n||z(this,e,t,2,32767,-32768),A.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):q(this,e,t,!0),t+2},A.prototype.writeInt16BE=function(e,t,n){return e*=1,t|=0,n||z(this,e,t,2,32767,-32768),A.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):q(this,e,t,!1),t+2},A.prototype.writeInt32LE=function(e,t,n){return e*=1,t|=0,n||z(this,e,t,4,0x7fffffff,-0x80000000),A.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):W(this,e,t,!0),t+4},A.prototype.writeInt32BE=function(e,t,n){return e*=1,t|=0,n||z(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),A.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},A.prototype.writeFloatLE=function(e,t,n){return G(this,e,t,!0,n)},A.prototype.writeFloatBE=function(e,t,n){return G(this,e,t,!1,n)},A.prototype.writeDoubleLE=function(e,t,n){return Z(this,e,t,!0,n)},A.prototype.writeDoubleBE=function(e,t,n){return Z(this,e,t,!1,n)},A.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("sourceStart out of bounds");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!A.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},A.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i,o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!A.isEncoding(r))throw TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=T(e)?e:J(new A(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function J(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319||a+1===r){(t-=3)>
1-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function X(e){return function(e){v||b();var t,n,r,i,o,a,s=e.length;if(s%4>0)throw Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:+("="===e[s-1]),a=new y(3*s/4-o),r=o>0?s-4:s;var l=0;for(t=0,n=0;t<r;t+=4,n+=3)i=m[e.charCodeAt(t)]<<18|m[e.charCodeAt(t+1)]<<12|m[e.charCodeAt(t+2)]<<6|m[e.charCodeAt(t+3)],a[l++]=i>>16&255,a[l++]=i>>8&255,a[l++]=255&i;return 2===o?(i=m[e.charCodeAt(t)]<<2|m[e.charCodeAt(t+1)]>>4,a[l++]=255&i):1===o&&(i=m[e.charCodeAt(t)]<<10|m[e.charCodeAt(t+1)]<<4|m[e.charCodeAt(t+2)]>>2,a[l++]=i>>8&255,a[l++]=255&i),a}(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(Y,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Q(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function ee(e){return null!=e&&(!!e._isBuffer||et(e)||"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&et(e.slice(0,0)))}function et(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var en=Object.freeze({__proto__:null,Buffer:A,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),A.alloc(+e)},isBuffer:ee,kMaxLength:x}),er="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function ei(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function eo(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var ea={},es={},el={};function ec(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, not ${e}`)}function ed(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function eu(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function eh(e,...t){if(!eu(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function ef(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("hash must be wrapped by utils.wrapConstructor");ec(e.outputLen),ec(e.blockLen)}function ep(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function eg(e,t){eh(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}
1Object.defineProperty(el,"__esModule",{value:!0}),el.isBytes=eu,el.number=ec,el.bool=ed,el.bytes=eh,el.hash=ef,el.exists=ep,el.output=eg,el.default={number:ec,bool:ed,bytes:eh,hash:ef,exists:ep,output:eg},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapCipher=e.Hash=e.nextTick=e.isLE=e.createView=e.u32=e.u16=e.u8=void 0,e.bytesToHex=r,e.hexToBytes=a,e.hexToNumber=s,e.bytesToNumberBE=function(e){return s(r(e))},e.numberToBytesBE=function(e,t){return a(e.toString(16).padStart(2*t,"0"))},e.asyncLoop=async function(t,n,r){let i=Date.now();for(let o=0;o<t;o++){r(o);let t=Date.now()-i;t>=0&&t<n||(await (0,e.nextTick)(),i+=t)}},e.utf8ToBytes=l,e.bytesToUtf8=function(e){return(new TextDecoder).decode(e)},e.toBytes=function(e){if("string"==typeof e)e=l(e);else{if(!(0,t.isBytes)(e))throw Error("Uint8Array expected, got "+typeof e);e=d(e)}return e},e.concatBytes=function(...e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];(0,t.bytes)(i),n+=i.length}let r=new Uint8Array(n);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r},e.checkOpts=function(e,t){if(null==t||"object"!=typeof t)throw Error("options must be defined");return Object.assign(e,t)},e.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},e.setBigUint64=c,e.u64Lengths=function(t,n){let r=new Uint8Array(16),i=(0,e.createView)(r);return c(i,0,BigInt(n?n.length:0),!0),c(i,8,BigInt(t.length),!0),r},e.isAligned32=function(e){return e.byteOffset%4==0},e.copyBytes=d,e.clean=function(...e){for(let t=0;t<e.length;t++)e[t].fill(0)};let t=el;if(e.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),e.u16=e=>new Uint16Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/2)),e.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),e.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),e.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!e.isLE)throw Error("Non little-endian hardware is not supported");let n=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function r(e){(0,t.bytes)(e);let r="";for(let t=0;t<e.length;t++)r+=n[e[t]];return r}let i={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function o(e){return e>=i._0&&e<=i._9?e-i._0:e>=i._A&&e<=i._F?e-(i._A-10):e>=i._a&&e<=i._f?e-(i._a-10):void 0}function a(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,n=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=o(e.charCodeAt(i)),a=o(e.charCodeAt(i+1));if(void 0===n||void 0===a)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);r[t]=16*n+a}return r}function s(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function l(e){if("string"!=typeof e)throw Error("string expected, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function c(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);let i=BigInt(32),o=BigInt(0xffffffff),a=Number(n>>i&o),s=Number(n&o),l=4*!!r,c=4*!r;e.setUint32(t+l,a,r),e.setUint32(t+c,s,r)}function d(e){return Uint8Array.from(e)}e.nextTick=async()=>{},e.Hash=class{},e.wrapCipher=(e,t)=>(Object.assign(t,e),t)}(es);var em={},ey={};Object.defineProperty(ey,"__esModule",{value:!0}),ey.AEAD_TAG_LENGTH=ey.XCHACHA20_NONCE_LENGTH=ey.CURVE25519_PUBLIC_KEY_SIZE=ey.ETH_PUBLIC_KEY_SIZE=ey.UNCOMPRESSED_PUBLIC_KEY_SIZE=ey.COMPRESSED_PUBLIC_KEY_SIZE=ey.SECRET_KEY_LENGTH=void 0,ey.SECRET_KEY_LENGTH=32,ey.COMPRESSED_PUBLIC_KEY_SIZE=33,ey.UNCOMPRESSED_PUBLIC_KEY_SIZE=65,ey.ETH_PUBLIC_KEY_SIZE=64,ey.CURVE25519_PUBLIC_KEY_SIZE=32,ey.XCHACHA20_NONCE_LENGTH=24,ey.AEAD_TAG_LENGTH=16,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ephemeralKeySize=e.symmetricNonceLength=e.symmetricAlgorithm=e.isHkdfKeyCompressed=e.isEphemeralKeyCompressed=e.ellipticCurve=e.ECIES_CONFIG=void 0,e.ECIES_CONFIG=new function(){this.ellipticCurve="secp256k1",this.isEphemeralKeyCompressed=!1,this.isHkdfKeyCompressed=!1,this.symmetricAlgorithm="aes-256-gcm",this.symmetricNonceLength=16},e.ellipticCurve=function(){return e.ECIES_CONFIG.ellipticCurve},e.isEphemeralKeyCompressed=function(){return e.ECIES_CONFIG.isEphemeralKeyCompressed},e.isHkdfKeyCompressed=function(){return e.ECIES_CONFIG.isHkdfKeyCompressed},e.symmetricAlgorithm=function(){return e.ECIES_CONFIG.symmetricAlgorithm},e.symmetricNonceLength=function(){return e.ECIES_CONFIG.symmetricNonceLength},e.ephemeralKeySize=function(){var t={secp256k1:e.ECIES_CONFIG.isEphemeralKeyCompressed?ey.COMPRESSED_PUBLIC_KEY_SIZE:ey.UNCOMPRESSED_PUBLIC_KEY_SIZE,x25519:ey.CURVE25519_PUBLIC_KEY_SIZE,ed25519:ey.CURVE25519_PUBLIC_KEY_SIZE};if(e.ECIES_CONFIG.ellipticCurve in t)return t[e.ECIES_CONFIG.ellipticCurve];throw Error("Not implemented")}}(em);var ev={},eb={},eE={},ew={},eC={},eS={};Object.defineProperty(eS,"__esModule",{value:!0}),eS.crypto=void 0,eS.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(e){Object.defineProperty(e,"__esMo
1dule",{value:!0}),e.gcm=e.ctr=e.cbc=e.utils=void 0,e.randomBytes=r,e.getWebcryptoSubtle=i,e.managedNonce=function(e){return(0,t.number)(e.nonceLength),(t,...i)=>({encrypt(o,...a){let{nonceLength:s}=e,l=r(s),c=e(t,l,...i).encrypt(o,...a),d=(0,n.concatBytes)(l,c);return c.fill(0),d},decrypt(n,...r){let{nonceLength:o}=e,a=n.subarray(0,o),s=n.subarray(o);return e(t,a,...i).decrypt(s,...r)}})};let t=el,n=es;function r(e=32){if(eS.crypto&&"function"==typeof eS.crypto.getRandomValues)return eS.crypto.getRandomValues(new Uint8Array(e));if(eS.crypto&&"function"==typeof eS.crypto.randomBytes)return eS.crypto.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}function i(){if(eS.crypto&&"object"==typeof eS.crypto.subtle&&null!=eS.crypto.subtle)return eS.crypto.subtle;throw Error("crypto.subtle must be defined")}e.utils={async encrypt(e,t,n,r){let o=i(),a=await o.importKey("raw",e,t,!0,["encrypt"]);return new Uint8Array(await o.encrypt(n,a,r))},async decrypt(e,t,n,r){let o=i(),a=await o.importKey("raw",e,t,!0,["decrypt"]);return new Uint8Array(await o.decrypt(n,a,r))}};let o={CBC:"AES-CBC",CTR:"AES-CTR",GCM:"AES-GCM"};function a(n){return(r,i,a)=>{(0,t.bytes)(r),(0,t.bytes)(i);let s={name:n,length:8*r.length},l=function(e,t,n){if(e===o.CBC)return{name:o.CBC,iv:t};if(e===o.CTR)return{name:o.CTR,counter:t,length:64};if(e===o.GCM)return n?{name:o.GCM,iv:t,additionalData:n}:{name:o.GCM,iv:t};throw Error("unknown aes block mode")}(n,i,a);return{encrypt:n=>((0,t.bytes)(n),e.utils.encrypt(r,s,l,n)),decrypt:n=>((0,t.bytes)(n),e.utils.decrypt(r,s,l,n))}}}e.cbc=a(o.CBC),e.ctr=a(o.CTR),e.gcm=a(o.GCM)}(eC);var e_={},ex={},ek={},eM={};function eA(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, not ${e}`)}function eI(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function eR(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function eL(e,...t){if(!eR(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function eP(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");eA(e.outputLen),eA(e.blockLen)}function eO(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function eT(e,t){eL(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}Object.defineProperty(eM,"__esModule",{value:!0}),eM.isBytes=eR,eM.number=eA,eM.bool=eI,eM.bytes=eL,eM.hash=eP,eM.exists=eO,eM.output=eT,eM.default={number:eA,bool:eI,bytes:eL,hash:eP,exists:eO,output:eT};var eN={},eD={};Object.defineProperty(eD,"__esModule",{value:!0}),eD.crypto=void 0,eD.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=void 0,e.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name},e.byteSwap32=function(t){for(let n=0;n<t.length;n++)t[n]=(0,e.byteSwap)(t[n])},e.bytesToHex=function(e){(0,n.bytes)(e);let t="";for(let n=0;n<e.length;n++)t+=r[e[n]];return t},e.hexToBytes=function(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,n=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=o(e.charCodeAt(i)),a=o(e.charCodeAt(i+1));if(void 0===n||void 0===a)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);r[t]=16*n+a}return r},e.asyncLoop=async function(t,n,r){let i=Date.now();for(let o=0;o<t;o++){r(o);let t=Date.now()-i;t>=0&&t<n||(await (0,e.nextTick)(),i+=t)}},e.utf8ToBytes=a,e.toBytes=s,e.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){let i=e[r];(0,n.bytes)(i),t+=i.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r},e.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==l.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)},e.wrapConstructor=function(e){let t=t=>e().update(s(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},e.wrapConstructorWithOpts=function(e){let t=(t,n)=>e(n).update(s(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},e.wrapXOFConstructorWithOpts=function(e){let t=(t,n)=>e(n).update(s(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},e.randomBytes=function(e=32){if(t.crypto&&"function"==typeof t.crypto.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&"function"==typeof t.crypto.randomBytes)return t.crypto.randomBytes(e);throw Error("crypto.getRandomValues must be defined")};let t=eD,n=eM;e.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),e.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),e.createView=e=>
1new DataView(e.buffer,e.byteOffset,e.byteLength),e.rotr=(e,t)=>e<<32-t|e>>>t,e.rotl=(e,t)=>e<<t|e>>>32-t>>>0,e.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],e.byteSwap=e=>e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255,e.byteSwapIfBE=e.isLE?e=>e:t=>(0,e.byteSwap)(t);let r=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),i={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function o(e){return e>=i._0&&e<=i._9?e-i._0:e>=i._A&&e<=i._F?e-(i._A-10):e>=i._a&&e<=i._f?e-(i._a-10):void 0}function a(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function s(e){return"string"==typeof e&&(e=a(e)),(0,n.bytes)(e),e}e.nextTick=async()=>{},e.Hash=class{clone(){return this._cloneInto()}};let l={}.toString}(eN),Object.defineProperty(ek,"__esModule",{value:!0}),ek.HashMD=ek.Maj=ek.Chi=void 0;let e$=eN;ek.Chi=(e,t,n)=>e&t^~e&n,ek.Maj=(e,t,n)=>e&t^e&n^t&n,ek.HashMD=class extends e$.Hash{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,e$.createView)(this.buffer)}update(e){(0,eM.exists)(this);let{view:t,buffer:n,blockLen:r}=this,i=(e=(0,e$.toBytes)(e)).length;for(let o=0;o<i;){let a=Math.min(r-this.pos,i-o);if(a!==r)n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===r&&(this.process(t,0),this.pos=0);else{let t=(0,e$.createView)(e);for(;r<=i-o;o+=r)this.process(t,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,eM.exists)(this),(0,eM.output)(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>r-o&&(this.process(n,0),o=0);for(let e=o;e<r;e++)t[e]=0;(function(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);let i=BigInt(32),o=BigInt(0xffffffff),a=Number(n>>i&o),s=Number(n&o),l=4*!!r,c=4*!r;e.setUint32(t+l,a,r),e.setUint32(t+c,s,r)})(n,r-8,BigInt(8*this.length),i),this.process(n,0);let a=(0,e$.createView)(e),s=this.outputLen;if(s%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=s/4,c=this.get();if(l>c.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)a.setUint32(4*e,c[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:o,pos:a}=this;return e.length=r,e.pos=a,e.finished=i,e.destroyed=o,r%t&&e.buffer.set(n),e}};var eB={};Object.defineProperty(eB,"__esModule",{value:!0}),eB.add5L=eB.add5H=eB.add4H=eB.add4L=eB.add3H=eB.add3L=eB.rotlBL=eB.rotlBH=eB.rotlSL=eB.rotlSH=eB.rotr32L=eB.rotr32H=eB.rotrBL=eB.rotrBH=eB.rotrSL=eB.rotrSH=eB.shrSL=eB.shrSH=eB.toBig=void 0,eB.fromBig=eU,eB.split=eH,eB.add=e2;let eK=BigInt(0x100000000-1),ej=BigInt(32);function eU(e,t=!1){return t?{h:Number(e&eK),l:Number(e>>ej&eK)}:{h:0|Number(e>>ej&eK),l:0|Number(e&eK)}}
1function eH(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:a}=eU(e[i],t);[n[i],r[i]]=[o,a]}return[n,r]}let eF=(e,t)=>BigInt(e>>>0)<<ej|BigInt(t>>>0);eB.toBig=eF;let ez=(e,t,n)=>e>>>n;eB.shrSH=ez;let eq=(e,t,n)=>e<<32-n|t>>>n;eB.shrSL=eq;let eW=(e,t,n)=>e>>>n|t<<32-n;eB.rotrSH=eW;let eV=(e,t,n)=>e<<32-n|t>>>n;eB.rotrSL=eV;let eG=(e,t,n)=>e<<64-n|t>>>n-32;eB.rotrBH=eG;let eZ=(e,t,n)=>e>>>n-32|t<<64-n;eB.rotrBL=eZ;let eY=(e,t)=>t;eB.rotr32H=eY;let eJ=(e,t)=>e;eB.rotr32L=eJ;let eX=(e,t,n)=>e<<n|t>>>32-n;eB.rotlSH=eX;let eQ=(e,t,n)=>t<<n|e>>>32-n;eB.rotlSL=eQ;let e0=(e,t,n)=>t<<n-32|e>>>64-n;eB.rotlBH=e0;let e1=(e,t,n)=>e<<n-32|t>>>64-n;function e2(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/0x100000000|0)|0,l:0|i}}eB.rotlBL=e1;let e3=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);eB.add3L=e3;let e5=(e,t,n,r)=>t+n+r+(e/0x100000000|0)|0;eB.add3H=e5;let e8=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);eB.add4L=e8;let e4=(e,t,n,r,i)=>t+n+r+i+(e/0x100000000|0)|0;eB.add4H=e4;let e6=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0);eB.add5L=e6;let e7=(e,t,n,r,i,o)=>t+n+r+i+o+(e/0x100000000|0)|0;eB.add5H=e7,eB.default={fromBig:eU,split:eH,toBig:eF,shrSH:ez,shrSL:eq,rotrSH:eW,rotrSL:eV,rotrBH:eG,rotrBL:eZ,rotr32H:eY,rotr32L:eJ,rotlSH:eX,rotlSL:eQ,rotlBH:e0,rotlBL:e1,add:e2,add3L:e3,add3H:e5,add4L:e8,add4H:e4,add5H:e7,add5L:e6},Object.defineProperty(ex,"__esModule",{value:!0}),ex.sha384=ex.sha512_256=ex.sha512_224=ex.sha512=ex.SHA384=ex.SHA512_256=ex.SHA512_224=ex.SHA512=void 0;let e9=ek,[te,tt]=eB.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
15771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),tn=new Uint32Array(80),tr=new Uint32Array(80);class ti extends e9.HashMD{constructor(){super(128,64,16,!1),this.Ah=0x6a09e667,this.Al=-0xc4336f8,this.Bh=-0x4498517b,this.Bl=-0x7b3558c5,this.Ch=0x3c6ef372,this.Cl=-0x16b07d5,this.Dh=-0x5ab00ac6,this.Dl=0x5f1d36f1,this.Eh=0x510e527f,this.El=-0x52197d2f,this.Fh=-0x64fa9774,this.Fl=0x2b3e6c1f,this.Gh=0x1f83d9ab,this.Gl=-0x4be4295,this.Hh=0x5be0cd19,this.Hl=0x137e2179}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:o,Dh:a,Dl:s,Eh:l,El:c,Fh:d,Fl:u,Gh:h,Gl:f,Hh:p,Hl:g}=this;return[e,t,n,r,i,o,a,s,l,c,d,u,h,f,p,g]}set(e,t,n,r,i,o,a,s,l,c,d,u,h,f,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|l,this.El=0|c,this.Fh=0|d,this.Fl=0|u,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let n=0;n<16;n++,t+=4)tn[n]=e.getUint32(t),tr[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|tn[e-15],n=0|tr[e-15],r=eB.default.rotrSH(t,n,1)^eB.default.rotrSH(t,n,8)^eB.default.shrSH(t,n,7),i=eB.default.rotrSL(t,n,1)^eB.default.rotrSL(t,n,8)^eB.default.shrSL(t,n,7),o=0|tn[e-2],a=0|tr[e-2],s=eB.default.rotrSH(o,a,19)^eB.default.rotrBH(o,a,61)^eB.default.shrSH(o,a,6),l=eB.default.rotrSL(o,a,19)^eB.default.rotrBL(o,a,61)^eB.default.shrSL(o,a,6),c=eB.default.add4L(i,l,tr[e-7],tr[e-16]),d=eB.default.add4H(c,r,s,tn[e-7],tn[e-16]);tn[e]=0|d,tr[e]=0|c}let{Ah:n,Al:r,Bh:i,Bl:o,Ch:a,Cl:s,Dh:l,Dl:c,Eh:d,El:u,Fh:h,Fl:f,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let e=0;e<80;e++){let t=eB.default.rotrSH(d,u,14)^eB.default.rotrSH(d,u,18)^eB.default.rotrBH(d,u,41),v=eB.default.rotrSL(d,u,14)^eB.default.rotrSL(d,u,18)^eB.default.rotrBL(d,u,41),b=d&h^~d&p,E=u&f^~u&g,w=eB.default.add5L(y,v,E,tt[e],tr[e]),C=eB.default.add5H(w,m,t,b,te[e],tn[e]),S=0|w,_=eB.default.rotrSH(n,r,28)^eB.default.rotrBH(n,r,34)^eB.default.rotrBH(n,r,39),x=eB.default.rotrSL(n,r,28)^eB.default.rotrBL(n,r,34)^eB.default.rotrBL(n,r,39),k=n&i^n&a^i&a,M=r&o^r&s^o&s;m=0|p,y=0|g,p=0|h,g=0|f,h=0|d,f=0|u,({h:d,l:u}=eB.default.add(0|l,0|c,0|C,0|S)),l=0|a,c=0|s,a=0|i,s=0|o,i=0|n,o=0|r;let A=eB.default.add3L(S,x,M);n=eB.default.add3H(A,C,_,k),r=0|A}({h:n,l:r}=eB.default.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:o}=eB.default.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:a,l:s}=eB.default.add(0|this.Ch,0|this.Cl,0|a,0|s)),({h:l,l:c}=eB.default.add(0|this.Dh,0|this.Dl,0|l,0|c)),({h:d,l:u}=eB.default.add(0|this.Eh,0|this.El,0|d,0|u)),({h:h,l:f}=eB.default.add(0|this.Fh,0|this.Fl,0|h,0|f)),({h:p,l:g}=eB.default.add(0|this.Gh,0|this.Gl,0|p,0|g)),({h:m,l:y}=eB.default.add(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(n,r,i,o,a,s,l,c,d,u,h,f,p,g,m,y)}roundClean(){tn.fill(0),tr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}ex.SHA512=ti;class to extends ti{constructor(){super(),this.Ah=-0x73c2c838,this.Al=0x19544da2,this.Bh=0x73e19966,this.Bl=-0x76232b2a,this.Ch=0x1dfab7ae,this.Cl=0x32ff9c82,this.Dh=0x679dd514,this.Dl=0x582f9fcf,this.Eh=0xf6d2b69,this.El=0x7bd44da8,this.Fh=0x77e36f73,this.Fl=0x4c48942,this.Gh=0x3f9d85a8,this.Gl=0x6a1d36c8,this.Hh=0x1112e6ad,this.Hl=-0x6e296d5f,this.outputLen=28}}ex.SHA512_224=to;class ta extends ti{constructor(){super(),this.Ah=0x22312194,this.Al=-0x3d408d4,this.Bh=-0x60aaa05d,this.Bl=-0x37b39b3e,this.Ch=0x2393b86b,this.Cl=0x6f53b151,this.Dh=-0x69c788e7,this.Dl=0x5940eabd,this.Eh=-0x69d7c11e,this.El=-0x5771001d,this.Fh=-0x41a1e1db,this.Fl=0x53863992,this.Gh=0x2b0199fc,this.Gl=0x2c85b8aa,this.Hh=0xeb72ddc,this.Hl=-0x7e3ad35e,this.outputLen=32}}ex.SHA512_256=ta;class ts extends ti{constructor(){super(),this.Ah=-0x344462a3,this.Al=-0x3efa6128,this.Bh=0x629a292a,this.Bl=0x367cd507,this.Ch=-0x6ea6fea6,this.Cl=0x3070dd17,this.Dh=0x152fecd8,this.Dl=-0x8f1a6c7,this.Eh=0x67332667,this.El=-4191439,this.Fh=-0x714bb579,this.Fl=0x68581511,this.Gh=-0x24f3d1f3,this.Gl=0x64f98fa7,this.Hh=0x47b5481d,this.Hl=-0x4105b05c,this.outputLen=48}}ex.SHA384=ts,ex.sha512=(0,eN.wrapConstructor)(()=>new ti),ex.sha512_224=(0,eN.wrapConstructor)(()=>new to),ex.sha512_256=(0,eN.wrapConstructor)(()=>new ta),ex.sha384=(0,eN.wrapConstructor)(()=>new ts);var tl={},tc={},td={},tu={};
1Object.defineProperty(tu,"__esModule",{value:!0}),tu.notImplemented=tu.bitMask=void 0,tu.isBytes=tg,tu.abytes=tm,tu.abool=function(e,t){if("boolean"!=typeof t)throw Error(`${e} must be valid boolean, got "${t}".`)},tu.bytesToHex=tv,tu.numberToHexUnpadded=tb,tu.hexToNumber=tE,tu.hexToBytes=tS,tu.bytesToNumberBE=function(e){return tE(tv(e))},tu.bytesToNumberLE=function(e){return tm(e),tE(tv(Uint8Array.from(e).reverse()))},tu.numberToBytesBE=t_,tu.numberToBytesLE=function(e,t){return t_(e,t).reverse()},tu.numberToVarBytesBE=function(e){return tS(tb(e))},tu.ensureBytes=function(e,t,n){let r;if("string"==typeof t)try{r=tS(t)}catch(n){throw Error(`${e} must be valid hex string, got "${t}". Cause: ${n}`)}else{if(!tg(t))throw Error(`${e} must be hex string or Uint8Array`);r=Uint8Array.from(t)}let i=r.length;if("number"==typeof n&&i!==n)throw Error(`${e} expected ${n} bytes, got ${i}`);return r},tu.concatBytes=tx,tu.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},tu.utf8ToBytes=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))},tu.inRange=tM,tu.aInRange=function(e,t,n,r){if(!tM(t,n,r))throw Error(`expected valid ${e}: ${n} <= n < ${r}, got ${typeof t} ${t}`)},tu.bitLen=function(e){let t;for(t=0;e>th;e>>=tf,t+=1);return t},tu.bitGet=function(e,t){return e>>BigInt(t)&tf},tu.bitSet=function(e,t,n){return e|(n?tf:th)<<BigInt(t)},tu.createHmacDrbg=function(e,t,n){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof n)throw Error("hmacFn must be a function");let r=tA(e),i=tA(e),o=0,a=()=>{r.fill(1),i.fill(0),o=0},s=(...e)=>n(i,r,...e),l=(e=tA())=>{i=s(tI([0]),e),r=s(),0!==e.length&&(i=s(tI([1]),e),r=s())},c=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,n=[];for(;e<t;){let t=(r=s()).slice();n.push(t),e+=r.length}return tx(...n)};return(e,t)=>{let n;for(a(),l(e);!(n=t(c()));)l();return a(),n}},tu.validateObject=function(e,t,n={}){let r=(t,n,r)=>{let i=tR[n];if("function"!=typeof i)throw Error(`Invalid validator "${n}", expected function`);let o=e[t];if(!(r&&void 0===o||i(o,e)))throw Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${n}`)};for(let[e,n]of Object.entries(t))r(e,n,!1);for(let[e,t]of Object.entries(n))r(e,t,!0);return e},tu.memoized=function(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(void 0!==i)return i;let o=e(n,...r);return t.set(n,o),o}};let th=BigInt(0),tf=BigInt(1),tp=BigInt(2);function tg(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function tm(e){if(!tg(e))throw Error("Uint8Array expected")}let ty=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function tv(e){tm(e);let t="";for(let n=0;n<e.length;n++)t+=ty[e[n]];return t}function tb(e){let t=e.toString(16);return 1&t.length?`0${t}`:t}function tE(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}let tw={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function tC(e){return e>=tw._0&&e<=tw._9?e-tw._0:e>=tw._A&&e<=tw._F?e-(tw._A-10):e>=tw._a&&e<=tw._f?e-(tw._a-10):void 0}function tS(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,n=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=tC(e.charCodeAt(i)),o=tC(e.charCodeAt(i+1));if(void 0===n||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);r[t]=16*n+o}return r}function t_(e,t){return tS(e.toString(16).padStart(2*t,"0"))}function tx(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];tm(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}let tk=e=>"bigint"==typeof e&&th<=e;function tM(e,t,n){return tk(e)&&tk(t)&&tk(n)&&t<=e&&e<n}tu.bitMask=e=>(tp<<BigInt(e-1))-tf;let tA=e=>new Uint8Array(e),tI=e=>Uint8Array.from(e),tR={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||tg(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};tu.notImplemented=()=>{throw Error("not implemented")},Object.defineProperty(td,"__esModule",{value:!0}),td.isNegativeLE=void 0,td.mod=tK,td.pow=tj,td.pow2=function(e,t,n){let r=e;for(;t-- >tP;)r*=r,r%=n;return r},td.invert=tU,td.tonelliShanks=tH,td.FpSqrt=tF,td.validateField=function(e){let t=tz.reduce((e,t)=>
1(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,tL.validateObject)(e,t)},td.FpPow=tq,td.FpInvertBatch=tW,td.FpDiv=function(e,t,n){return e.mul(t,"bigint"==typeof n?tU(n,e.ORDER):e.inv(n))},td.FpLegendre=tV,td.FpIsSquare=function(e){let t=tV(e.ORDER);return n=>{let r=t(e,n);return e.eql(r,e.ZERO)||e.eql(r,e.ONE)}},td.nLength=tG,td.Field=function(e,t,n=!1,r={}){if(e<=tP)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:i,nByteLength:o}=tG(e,t);if(o>2048)throw Error("Field lengths over 2048 bytes are not supported");let a=tF(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:(0,tL.bitMask)(i),ZERO:tP,ONE:tO,create:t=>tK(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("Invalid field element: expected bigint, got "+typeof t);return tP<=t&&t<e},is0:e=>e===tP,isOdd:e=>(e&tO)===tO,neg:t=>tK(-t,e),eql:(e,t)=>e===t,sqr:t=>tK(t*t,e),add:(t,n)=>tK(t+n,e),sub:(t,n)=>tK(t-n,e),mul:(t,n)=>tK(t*n,e),pow:(e,t)=>tq(s,e,t),div:(t,n)=>tK(t*tU(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>tU(t,e),sqrt:r.sqrt||(e=>a(s,e)),invertBatch:e=>tW(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?(0,tL.numberToBytesLE)(e,o):(0,tL.numberToBytesBE)(e,o),fromBytes:e=>{if(e.length!==o)throw Error(`Fp.fromBytes: expected ${o}, got ${e.length}`);return n?(0,tL.bytesToNumberLE)(e):(0,tL.bytesToNumberBE)(e)}});return Object.freeze(s)},td.FpSqrtOdd=function(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)},td.FpSqrtEven=function(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n},td.hashToPrivateScalar=function(e,t,n=!1){let r=(e=(0,tL.ensureBytes)("privateHash",e)).length,i=tG(t).nByteLength+8;if(i<24||r<i||r>1024)throw Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${r}`);return tK(n?(0,tL.bytesToNumberLE)(e):(0,tL.bytesToNumberBE)(e),t-tO)+tO},td.getFieldBytesLength=tZ,td.getMinHashLength=tY,td.mapHashToField=function(e,t,n=!1){let r=e.length,i=tZ(t),o=tY(t);if(r<16||r<o||r>1024)throw Error(`expected ${o}-1024 bytes of input, got ${r}`);let a=tK(n?(0,tL.bytesToNumberBE)(e):(0,tL.bytesToNumberLE)(e),t-tO)+tO;return n?(0,tL.numberToBytesLE)(a,i):(0,tL.numberToBytesBE)(a,i)};let tL=tu,tP=BigInt(0),tO=BigInt(1),tT=BigInt(2),tN=BigInt(3),tD=BigInt(4),t$=BigInt(5),tB=BigInt(8);function tK(e,t){let n=e%t;return n>=tP?n:t+n}function tj(e,t,n){if(n<=tP||t<tP)throw Error("Expected power/modulo > 0");if(n===tO)return tP;let r=tO;for(;t>tP;)t&tO&&(r=r*e%n),e=e*e%n,t>>=tO;return r}function tU(e,t){if(e===tP||t<=tP)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=tK(e,t),r=t,i=tP,o=tO;for(;n!==tP;){let e=r%n,t=i-r/n*o;r=n,n=e,i=o,o=t}if(r!==tO)throw Error("invert: does not exist");return tK(i,t)}function tH(e){let t,n,r,i=(e-tO)/tT;for(t=e-tO,n=0;t%tT===tP;t/=tT,n++);for(r=tT;r<e&&tj(r,i,e)!==e-tO;r++);if(1===n){let t=(e+tO)/tD;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error("Cannot find square root");return r}}let o=(t+tO)/tT;return function(e,a){if(e.pow(a,i)===e.neg(e.ONE))throw Error("Cannot find square root");let s=n,l=e.pow(e.mul(e.ONE,r),t),c=e.pow(a,o),d=e.pow(a,t);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(d);t<s&&!e.eql(n,e.ONE);t++)n=e.sqr(n);let n=e.pow(l,tO<<BigInt(s-t-1));l=e.sqr(n),c=e.mul(c,n),d=e.mul(d,l),s=t}return c}}function tF(e){if(e%tD===tN){let t=(e+tO)/tD;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error("Cannot find square root");return r}}if(e%tB===t$){let t=(e-t$)/tB;return function(e,n){let r=e.mul(n,tT),i=e.pow(r,t),o=e.mul(n,i),a=e.mul(e.mul(o,tT),i),s=e.mul(o,e.sub(a,e.ONE));if(!e.eql(e.sqr(s),n))throw Error("Cannot find square root");return s}}return tH(e)}BigInt(9),BigInt(16),td.isNegativeLE=(e,t)=>(tK(e,t)&tO)===tO;let tz=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tq(e,t,n){if(n<tP)throw Error("Expected power > 0");if(n===tP)return e.ONE;if(n===tO)return t;let r=e.ONE,i=t;for(;n>tP;)n&tO&&(r=e.mul(r,i)),i=e.sqr(i),n>>=tO;return r}function tW(e,t){let n=Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}function tV(e){let t=(e-tO)/tT;return(e,n)=>e.pow(n,t)}function tG(e,t){let n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function tZ(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function tY(e){let t=tZ(e);return t+Math.ceil(t/2)}Object.defineProperty(tc,"__esModule",{value:!0}),tc.wNAF=function(e,t){let n=(e,t)=>{let n=t.negate();return e?n:t},r=e=>{if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error(`Wrong window size=${e}, should be [1..${t}]`)},i=e=>(r(e),{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;
1for(;n>tQ;)n&t0&&(r=r.add(i)),i=i.double(),n>>=t0;return r},precomputeWindow(e,t){let{windows:n,windowSize:r}=i(t),o=[],a=e,s=a;for(let e=0;e<n;e++){s=a,o.push(s);for(let e=1;e<r;e++)s=s.add(a),o.push(s);a=s.double()}return o},wNAF(t,r,o){let{windows:a,windowSize:s}=i(t),l=e.ZERO,c=e.BASE,d=BigInt(2**t-1),u=2**t,h=BigInt(t);for(let e=0;e<a;e++){let t=e*s,i=Number(o&d);o>>=h,i>s&&(i-=u,o+=t0);let a=t+Math.abs(i)-1,f=e%2!=0,p=i<0;0===i?c=c.add(n(f,r[t])):l=l.add(n(p,r[a]))}return{p:l,f:c}},wNAFCached(e,t,n){let r=t2.get(e)||1,i=t1.get(e);return i||(i=this.precomputeWindow(e,r),1!==r&&t1.set(e,n(i))),this.wNAF(r,i,t)},setWindowSize(e,t){r(t),t2.set(e,t),t1.delete(e)}}},tc.pippenger=function(e,t,n,r){if(!Array.isArray(n)||!Array.isArray(r)||r.length!==n.length)throw Error("arrays of points and scalars must have equal length");r.forEach((e,n)=>{if(!t.isValid(e))throw Error(`wrong scalar at index ${n}`)}),n.forEach((t,n)=>{if(!(t instanceof e))throw Error(`wrong point at index ${n}`)});let i=(0,tX.bitLen)(BigInt(n.length)),o=i>12?i-3:i>4?i-2:i?2:1,a=(1<<o)-1,s=Array(a+1).fill(e.ZERO),l=Math.floor((t.BITS-1)/o)*o,c=e.ZERO;for(let t=l;t>=0;t-=o){s.fill(e.ZERO);for(let e=0;e<r.length;e++){let i=Number(r[e]>>BigInt(t)&BigInt(a));s[i]=s[i].add(n[e])}let i=e.ZERO;for(let t=s.length-1,n=e.ZERO;t>0;t--)n=n.add(s[t]),i=i.add(n);if(c=c.add(i),0!==t)for(let e=0;e<o;e++)c=c.double()}return c},tc.validateBasic=function(e){return(0,tJ.validateField)(e.Fp),(0,tX.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,tJ.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})};let tJ=td,tX=tu,tQ=BigInt(0),t0=BigInt(1),t1=new WeakMap,t2=new WeakMap;Object.defineProperty(tl,"__esModule",{value:!0}),tl.twistedEdwards=function(e){let t=function(e){let t=(0,t3.validateBasic)(e);return t8.validateObject(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:n,n:r,prehash:i,hash:o,randomBytes:a,nByteLength:s,h:l}=t,c=t9<<BigInt(8*s)-t7,d=n.create,u=(0,t5.Field)(t.n,t.nBitLength),h=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch(e){return{isValid:!1,value:t6}}}),f=t.adjustScalarBytes||(e=>e),p=t.domain||((e,t,n)=>{if((0,t4.abool)("phflag",n),t.length||n)throw Error("Contexts/pre-hash are not supported");return e});function g(e,t){t8.aInRange("coordinate "+e,t,t6,c)}function m(e){if(!(e instanceof b))throw Error("ExtendedPoint expected")}let y=(0,t4.memoized)((e,t)=>{let{ex:r,ey:i,ez:o}=e,a=e.is0();null==t&&(t=a?ne:n.inv(o));let s=d(r*t),l=d(i*t),c=d(o*t);if(a)return{x:t6,y:t7};if(c!==t7)throw Error("invZ was invalid");return{x:s,y:l}}),v=(0,t4.memoized)(e=>{let{a:n,d:r}=t;if(e.is0())throw Error("bad point: ZERO");let{ex:i,ey:o,ez:a,et:s}=e,l=d(i*i),c=d(o*o),u=d(a*a),h=d(u*u),f=d(l*n);if(d(u*d(f+c))!==d(h+d(r*d(l*c))))throw Error("bad point: equation left != right (1)");if(d(i*o)!==d(a*s))throw Error("bad point: equation left != right (2)");return!0});class b{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r,g("x",e),g("y",t),g("z",n),g("t",r),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof b)throw Error("extended point not allowed");let{x:t,y:n}=e||{};return g("x",t),g("y",n),new b(t,n,t7,d(t*n))}static normalizeZ(e){let t=n.invertBatch(e.map(e=>e.ez));return e.map((e,n)=>e.toAffine(t[n])).map(b.fromAffine)}static msm(e,t){return(0,t3.pippenger)(b,u,e,t)}_setWindowSize(e){C.setWindowSize(this,e)}assertValidity(){v(this)}equals(e){m(e);let{ex:t,ey:n,ez:r}=this,{ex:i,ey:o,ez:a}=e,s=d(t*a),l=d(i*r),c=d(n*a),u=d(o*r);return s===l&&c===u}is0(){return this.equals(b.ZERO)}negate(){return new b(d(-this.ex),this.ey,this.ez,d(-this.et))}double(){let{a:e}=t,{ex:n,ey:r,ez:i}=this,o=d(n*n),a=d(r*r),s=d(t9*d(i*i)),l=d(e*o),c=n+r,u=d(d(c*c)-o-a),h=l+a,f=h-s,p=l-a,g=d(u*f),m=d(h*p),y=d(u*p);return new b(g,m,d(f*h),y)}add(e){m(e);let{a:n,d:r}=t,{ex:i,ey:o,ez:a,et:s}=this,{ex:l,ey:c,ez:u,et:h}=e;if(n===BigInt(-1)){let e=d((o-i)*(c+l)),t=d((o+i)*(c-l)),n=d(t-e);if(n===t6)return this.double();let r=d(a*t9*h),f=d(s*t9*u),p=f+r,g=t+e,m=f-r,y=d(p*n),v=d(g*m),E=d(p*m);return new b(y,v,d(n*g),E)}
1let f=d(i*l),p=d(o*c),g=d(s*r*h),y=d(a*u),v=d((i+o)*(l+c)-f-p),E=y-g,w=y+g,C=d(p-n*f),S=d(v*E),_=d(w*C),x=d(v*C);return new b(S,_,d(E*w),x)}subtract(e){return this.add(e.negate())}wNAF(e){return C.wNAFCached(this,e,b.normalizeZ)}multiply(e){t8.aInRange("scalar",e,t7,r);let{p:t,f:n}=this.wNAF(e);return b.normalizeZ([t,n])[0]}multiplyUnsafe(e){return t8.aInRange("scalar",e,t6,r),e===t6?w:this.equals(w)||e===t7?this:this.equals(E)?this.wNAF(e).p:C.unsafeLadder(this,e)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return C.unsafeLadder(this,r).is0()}toAffine(e){return y(this,e)}clearCofactor(){let{h:e}=t;return e===t7?this:this.multiplyUnsafe(e)}static fromHex(e,r=!1){let{d:i,a:o}=t,a=n.BYTES;e=(0,t4.ensureBytes)("pointHex",e,a),(0,t4.abool)("zip215",r);let s=e.slice(),l=e[a-1];s[a-1]=-129&l;let u=t8.bytesToNumberLE(s),f=r?c:n.ORDER;t8.aInRange("pointHex.y",u,t6,f);let p=d(u*u),{isValid:g,value:m}=h(d(p-t7),d(i*p-o));if(!g)throw Error("Point.fromHex: invalid y coordinate");let y=(m&t7)===t7,v=0!=(128&l);if(!r&&m===t6&&v)throw Error("Point.fromHex: x=0 and x_0=1");return v!==y&&(m=d(-m)),b.fromAffine({x:m,y:u})}static fromPrivateKey(e){return x(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),r=t8.numberToBytesLE(t,n.BYTES);return r[r.length-1]|=e&t7?128:0,r}toHex(){return t8.bytesToHex(this.toRawBytes())}}b.BASE=new b(t.Gx,t.Gy,t7,d(t.Gx*t.Gy)),b.ZERO=new b(t6,t7,t7,t6);let{BASE:E,ZERO:w}=b,C=(0,t3.wNAF)(b,8*s);function S(e){return(0,t5.mod)(e,r)}function _(e){return S(t8.bytesToNumberLE(e))}function x(e){e=(0,t4.ensureBytes)("private key",e,s);let t=(0,t4.ensureBytes)("hashed private key",o(e),2*s),n=f(t.slice(0,s)),r=t.slice(s,2*s),i=_(n),a=E.multiply(i),l=a.toRawBytes();return{head:n,prefix:r,scalar:i,point:a,pointBytes:l}}function k(e=new Uint8Array,...t){return _(o(p(t8.concatBytes(...t),(0,t4.ensureBytes)("context",e),!!i)))}return E._setWindowSize(8),{CURVE:t,getPublicKey:function(e){return x(e).pointBytes},sign:function(e,t,o={}){e=(0,t4.ensureBytes)("message",e),i&&(e=i(e));let{prefix:a,scalar:l,pointBytes:c}=x(t),d=k(o.context,a,e),u=E.multiply(d).toRawBytes(),h=S(d+k(o.context,u,c,e)*l);t8.aInRange("signature.s",h,t6,r);let f=t8.concatBytes(u,t8.numberToBytesLE(h,n.BYTES));return(0,t4.ensureBytes)("result",f,2*s)},verify:function(e,t,r,o=nt){let a,s,l,{context:c,zip215:d}=o,u=n.BYTES;e=(0,t4.ensureBytes)("signature",e,2*u),t=(0,t4.ensureBytes)("message",t),void 0!==d&&(0,t4.abool)("zip215",d),i&&(t=i(t));let h=t8.bytesToNumberLE(e.slice(u,2*u));try{a=b.fromHex(r,d),s=b.fromHex(e.slice(0,u),d),l=E.multiplyUnsafe(h)}catch(e){return!1}if(!d&&a.isSmallOrder())return!1;let f=k(c,s.toRawBytes(),a.toRawBytes(),t);return s.add(a.multiplyUnsafe(f)).subtract(l).clearCofactor().equals(b.ZERO)},ExtendedPoint:b,utils:{getExtendedPublicKey:x,randomPrivateKey:()=>a(n.BYTES),precompute:(e=8,t=b.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}};let t3=tc,t5=td,t8=tu,t4=tu,t6=BigInt(0),t7=BigInt(1),t9=BigInt(2),ne=BigInt(8),nt={zip215:!0};var nn={};Object.defineProperty(nn,"__esModule",{value:!0}),nn.expand_message_xmd=na,nn.expand_message_xof=ns,nn.hash_to_field=nl,nn.isogenyMap=function(e,t){let n=t.map(e=>Array.from(e).reverse());return(t,r)=>{let[i,o,a,s]=n.map(n=>n.reduce((n,r)=>e.add(e.mul(n,t),r)));return t=e.div(i,o),r=e.mul(r,e.div(a,s)),{x:t,y:r}}},nn.createHasher=function(e,t,n){if("function"!=typeof t)throw Error("mapToCurve() must be defined");return{hashToCurve(r,i){let o=nl(r,2,{...n,DST:n.DST,...i}),a=e.fromAffine(t(o[0])),s=e.fromAffine(t(o[1])),l=a.add(s).clearCofactor();return l.assertValidity(),l},encodeToCurve(r,i){let o=nl(r,1,{...n,DST:n.encodeDST,...i}),a=e.fromAffine(t(o[0])).clearCofactor();return a.assertValidity(),a},mapToCurve(n){if(!Array.isArray(n))throw Error("mapToCurve: expected array of bigints");for(let e of n)if("bigint"!=typeof e)throw Error(`mapToCurve: expected array of bigints, got ${e} in array`);let r=e.fromAffine(t(n)).clearCofactor();return r.assertValidity(),r}}};let nr=tu.bytesToNumberBE;function ni(e,t){if(no(e),no(t),e<0||e>=1<<8*t)throw Error(`bad I2OSP call: value=${e} length=${t}`);let n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function no(e){if(!Number.isSafeInteger(e))throw Error("number expected")}function na(e,t,n,r){(0,tu.abytes)(e),(0,tu.abytes)(t),no(n),t.length>255&&(t=r((0,tu.concatBytes)((0,tu.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));let{outputLen:i,blockLen:o}=r,a=Math.ceil(n/i);if(n>65535||a>
1255)throw Error("expand_message_xmd: invalid lenInBytes");let s=(0,tu.concatBytes)(t,ni(t.length,1)),l=ni(0,o),c=ni(n,2),d=Array(a),u=r((0,tu.concatBytes)(l,e,c,ni(0,1),s));d[0]=r((0,tu.concatBytes)(u,ni(1,1),s));for(let e=1;e<=a;e++){let t=[function(e,t){let n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}(u,d[e-1]),ni(e+1,1),s];d[e]=r((0,tu.concatBytes)(...t))}return(0,tu.concatBytes)(...d).slice(0,n)}function ns(e,t,n,r,i){if((0,tu.abytes)(e),(0,tu.abytes)(t),no(n),t.length>255){let e=Math.ceil(2*r/8);t=i.create({dkLen:e}).update((0,tu.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:n}).update(e).update(ni(n,2)).update(t).update(ni(t.length,1)).digest()}function nl(e,t,n){let r;(0,tu.validateObject)(n,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:i,k:o,m:a,hash:s,expand:l,DST:c}=n;(0,tu.abytes)(e),no(t);let d="string"==typeof c?(0,tu.utf8ToBytes)(c):c,u=Math.ceil((i.toString(2).length+o)/8),h=t*a*u;if("xmd"===l)r=na(e,d,h,s);else if("xof"===l)r=ns(e,d,h,o,s);else{if("_internal_pass"!==l)throw Error('expand must be "xmd" or "xof"');r=e}let f=Array(t);for(let e=0;e<t;e++){let t=Array(a);for(let n=0;n<a;n++){let o=u*(n+e*a),s=r.subarray(o,o+u);t[n]=(0,td.mod)(nr(s),i)}f[e]=t}return f}var nc={};Object.defineProperty(nc,"__esModule",{value:!0}),nc.montgomery=function(e){let t=((0,nu.validateObject)(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})),{P:n}=t,r=e=>(0,nd.mod)(e,n),i=t.montgomeryBits,o=Math.ceil(i/8),a=t.nByteLength,s=t.adjustScalarBytes||(e=>e),l=t.powPminus2||(e=>(0,nd.pow)(e,n-BigInt(2),n));function c(e,t,n){let i=r(e*(t-n));return[t=r(t-i),n=r(n+i)]}let d=(t.a-BigInt(2))/BigInt(4);function u(e){return(0,nu.numberToBytesLE)(r(e),o)}function h(e,t){let h=function(e,t){(0,nu.aInRange)("u",e,nh,n),(0,nu.aInRange)("scalar",t,nh,n);let o,a=nf,s=nh,u=e,h=nf,f=nh;for(let n=BigInt(i-1);n>=nh;n--){let i=t>>n&nf;f^=i,a=(o=c(f,a,u))[0],u=o[1],s=(o=c(f,s,h))[0],h=o[1],f=i;let l=a+s,p=r(l*l),g=a-s,m=r(g*g),y=p-m,v=u+h,b=r((u-h)*l),E=r(v*g),w=b+E,C=b-E;u=r(w*w),h=r(e*r(C*C)),a=r(p*m),s=r(y*(p+r(d*y)))}return a=(o=c(f,a,u))[0],u=o[1],s=(o=c(f,s,h))[0],h=o[1],r(a*l(s))}(function(e){let t=(0,nu.ensureBytes)("u coordinate",e,o);return 32===a&&(t[31]&=127),(0,nu.bytesToNumberLE)(t)}(t),function(e){let t=(0,nu.ensureBytes)("scalar",e),n=t.length;if(n!==o&&n!==a)throw Error(`Expected ${o} or ${a} bytes, got ${n}`);return(0,nu.bytesToNumberLE)(s(t))}(e));if(h===nh)throw Error("Invalid private or public key received");return u(h)}let f=u(t.Gu);function p(e){return h(e,f)}return{scalarMult:h,scalarMultBase:p,getSharedSecret:(e,t)=>h(e,t),getPublicKey:e=>p(e),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:f}};let nd=td,nu=tu,nh=BigInt(0),nf=BigInt(1);!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hash_to_ristretto255=e.hashToRistretto255=e.RistrettoPoint=e.encodeToCurve=e.hashToCurve=e.edwardsToMontgomery=e.x25519=e.ed25519ph=e.ed25519ctx=e.ed25519=e.ED25519_TORSION_SUBGROUP=void 0,e.edwardsToMontgomeryPub=g,e.edwardsToMontgomeryPriv=function(e){let t=f.hash(e.subarray(0,32));return f.adjustScalarBytes(t).subarray(0,32)};let t=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),n=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),r=BigInt(0),i=BigInt(1),o=BigInt(2),a=BigInt(3),s=BigInt(5),l=BigInt(8);function c(e){let n=BigInt(10),r=BigInt(20),a=BigInt(40),l=BigInt(80),c=e*e%t*e%t,d=(0,td.pow2)(c,o,t)*c%t,u=(0,td.pow2)(d,i,t)*e%t,h=(0,td.pow2)(u,s,t)*u%t,f=(0,td.pow2)(h,n,t)*h%t,p=(0,td.pow2)(f,r,t)*f%t,g=(0,td.pow2)(p,a,t)*p%t,m=(0,td.pow2)(g,l,t)*g%t,y=(0,td.pow2)(m,l,t)*g%t,v=(0,td.pow2)(y,n,t)*h%t;return{pow_p_5_8:(0,td.pow2)(v,o,t)*e%t,b2:c}}function d(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function u(e,r){let i=(0,td.mod)(r*r*r,t),o=c(e*(0,td.mod)(i*i*r,t)).pow_p_5_8,a=(0,td.mod)(e*i*o,t),s=(0,td.mod)(r*a*a,t),l=a,d=(0,td.mod)(a*n,t),u=s===e,h=s===(0,td.mod)(-e,t),f=s===(0,td.mod)(-e*n,t);return u&&(a=l),(h||f)&&(a=d),(0,td.isNegativeLE)(a,t)&&(a=(0,td.mod)(-a,t)),{isValid:u||h,value:a}}e.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];let h=(0,td.Field)(t,void 0,!0),f={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:h,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:l,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ex.sha512,randomBytes:eN.randomBytes,adjustScalarBytes:d,uvRatio:u};function p(e,t,n){if(t.length>255)throw Error("Context is too big");return(0,eN.concatBytes)((0,eN.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([+!!n,t.length]),t,e)}function g(t){let{y:n}=e.ed25519.ExtendedPoint.fromHex(t),r=BigInt(1);return h.toBytes(h.create((r+n)*h.inv(r-n)))}e.ed25519=(0,tl.twistedEdwards)(f),e.ed25519ctx=(0,tl.twistedEdwards)({...f,domain:p}),e.ed25519ph=(0,tl.twistedEdwards)(Object.assign({},f,{domain:p,prehash:ex.sha512})),e.x25519=(0,nc.montgomery)({P:t,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>
1{let{pow_p_5_8:n,b2:r}=c(e);return(0,td.mod)((0,td.pow2)(n,a,t)*r,t)},adjustScalarBytes:d,randomBytes:eN.randomBytes}),e.edwardsToMontgomery=g;let m=(h.ORDER+a)/l,y=h.pow(o,m),v=h.sqrt(h.neg(h.ONE)),b=(0,td.FpSqrtEven)(h,h.neg(BigInt(486664))),E=(0,nn.createHasher)(e.ed25519.ExtendedPoint,e=>(function(e){let{xMn:t,xMd:n,yMn:r,yMd:a}=function(e){let t=(h.ORDER-s)/l,n=BigInt(486662),r=h.sqr(e);r=h.mul(r,o);let a=h.add(r,h.ONE),c=h.neg(n),d=h.sqr(a),u=h.mul(d,a),f=h.mul(r,n);f=h.mul(f,c),f=h.add(f,d),f=h.mul(f,c);let p=h.sqr(u);d=h.sqr(p),p=h.mul(p,u),p=h.mul(p,f),d=h.mul(d,p);let g=h.pow(d,t);g=h.mul(g,p);let m=h.mul(g,v);d=h.sqr(g),d=h.mul(d,u);let b=h.eql(d,f),E=h.cmov(m,g,b),w=h.mul(c,r),C=h.mul(g,e);C=h.mul(C,y);let S=h.mul(C,v),_=h.mul(f,r);d=h.sqr(C),d=h.mul(d,u);let x=h.eql(d,_),k=h.cmov(S,C,x);d=h.sqr(E),d=h.mul(d,u);let M=h.eql(d,f),A=h.cmov(w,c,M),I=h.cmov(k,E,M),R=h.isOdd(I);return{xMn:A,xMd:a,yMn:I=h.cmov(I,h.neg(I),M!==R),yMd:i}}(e),c=h.mul(t,a);c=h.mul(c,b);let d=h.mul(n,r),u=h.sub(t,n),f=h.add(t,n),p=h.mul(d,f),g=h.eql(p,h.ZERO);c=h.cmov(c,h.ZERO,g),d=h.cmov(d,h.ONE,g),u=h.cmov(u,h.ONE,g),f=h.cmov(f,h.ONE,g);let m=h.invertBatch([d,f]);return{x:h.mul(c,m[0]),y:h.mul(u,m[1])}})(e[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:h.ORDER,m:1,k:128,expand:"xmd",hash:ex.sha512});function w(e){if(!(e instanceof R))throw Error("RistrettoPoint expected")}e.hashToCurve=E.hashToCurve,e.encodeToCurve=E.encodeToCurve;let C=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),S=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),_=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),x=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),k=e=>u(i,e),M=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),A=t=>e.ed25519.CURVE.Fp.create((0,tu.bytesToNumberLE)(t)&M);function I(t){let{d:r}=e.ed25519.CURVE,o=e.ed25519.CURVE.Fp.ORDER,a=e.ed25519.CURVE.Fp.create,s=a(n*t*t),l=a((s+i)*_),c=BigInt(-1),d=a((c-r*s)*a(s+r)),{isValid:h,value:f}=u(l,d),p=a(f*t);(0,td.isNegativeLE)(p,o)||(p=a(-p)),h||(f=p),h||(c=s);let g=a(c*(s-i)*x-d),m=f*f,y=a((f+f)*d),v=a(g*C),b=a(i-m),E=a(i+m);return new e.ed25519.ExtendedPoint(a(y*E),a(b*v),a(v*E),a(y*b))}class R{constructor(e){this.ep=e}static fromAffine(t){return new R(e.ed25519.ExtendedPoint.fromAffine(t))}static hashToCurve(e){let t=I(A((e=(0,tu.ensureBytes)("ristrettoHash",e,64)).slice(0,32))),n=I(A(e.slice(32,64)));return new R(t.add(n))}static fromHex(t){t=(0,tu.ensureBytes)("ristrettoHex",t,32);let{a:n,d:o}=e.ed25519.CURVE,a=e.ed25519.CURVE.Fp.ORDER,s=e.ed25519.CURVE.Fp.create,l="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",c=A(t);if(!(0,tu.equalBytes)((0,tu.numberToBytesLE)(c,32),t)||(0,td.isNegativeLE)(c,a))throw Error(l);let d=s(c*c),u=s(i+n*d),h=s(i-n*d),f=s(u*u),p=s(h*h),g=s(n*o*f-p),{isValid:m,value:y}=k(s(g*p)),v=s(y*h),b=s(y*v*g),E=s((c+c)*v);(0,td.isNegativeLE)(E,a)&&(E=s(-E));let w=s(u*b),C=s(E*w);if(!m||(0,td.isNegativeLE)(C,a)||w===r)throw Error(l);return new R(new e.ed25519.ExtendedPoint(E,w,i,C))}toRawBytes(){let t,{ex:r,ey:i,ez:o,et:a}=this.ep,s=e.ed25519.CURVE.Fp.ORDER,l=e.ed25519.CURVE.Fp.create,c=l(l(o+i)*l(o-i)),d=l(r*i),u=l(d*d),{value:h}=k(l(c*u)),f=l(h*c),p=l(h*d),g=l(f*p*a);if((0,td.isNegativeLE)(a*g,s)){let e=l(i*n),o=l(r*n);r=e,i=o,t=l(f*S)}else t=p;(0,td.isNegativeLE)(r*g,s)&&(i=l(-i));let m=l((o-i)*t);return(0,td.isNegativeLE)(m,s)&&(m=l(-m)),(0,tu.numberToBytesLE)(m,32)}toHex(){return(0,tu.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(t){w(t);let{ex:n,ey:r}=this.ep,{ex:i,ey:o}=t.ep,a=e.ed25519.CURVE.Fp.create,s=a(n*o)===a(r*i),l=a(r*o)===a(n*i);return s||l}add(e){return w(e),new R(this.ep.add(e.ep))}subtract(e){return w(e),new R(this.ep.subtract(e.ep))}multiply(e){return new R(this.ep.multiply(e))}multiplyUnsafe(e){return new R(this.ep.multiplyUnsafe(e))}double(){return new R(this.ep.double())}negate(){return new R(this.ep.negate())}}R.BASE||(R.BASE=new R(e.ed25519.ExtendedPoint.BASE)),R.ZERO||(R.ZERO=new R(e.ed25519.ExtendedPoint.ZERO)),e.RistrettoPoint=R,e.hashToRistretto255=(e,t)=>{let n=t.DST,r="string"==typeof n?(0,eN.utf8ToBytes)(n):n,i=(0,nn.exp
1and_message_xmd)(e,r,64,ex.sha512);return R.hashToCurve(i)},e.hash_to_ristretto255=e.hashToRistretto255}(e_);var np={},ng={};Object.defineProperty(ng,"__esModule",{value:!0}),ng.sha224=ng.sha256=ng.SHA256=void 0;let nm=ek,ny=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),nv=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),nb=new Uint32Array(64);class nE extends nm.HashMD{constructor(){super(64,32,8,!1),this.A=0|nv[0],this.B=0|nv[1],this.C=0|nv[2],this.D=0|nv[3],this.E=0|nv[4],this.F=0|nv[5],this.G=0|nv[6],this.H=0|nv[7]}get(){let{A:e,B:t,C:n,D:r,E:i,F:o,G:a,H:s}=this;return[e,t,n,r,i,o,a,s]}set(e,t,n,r,i,o,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)nb[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=nb[e-15],n=nb[e-2],r=(0,eN.rotr)(t,7)^(0,eN.rotr)(t,18)^t>>>3,i=(0,eN.rotr)(n,17)^(0,eN.rotr)(n,19)^n>>>10;nb[e]=i+nb[e-7]+r+nb[e-16]|0}let{A:n,B:r,C:i,D:o,E:a,F:s,G:l,H:c}=this;for(let e=0;e<64;e++){let t=c+((0,eN.rotr)(a,6)^(0,eN.rotr)(a,11)^(0,eN.rotr)(a,25))+(0,nm.Chi)(a,s,l)+ny[e]+nb[e]|0,d=((0,eN.rotr)(n,2)^(0,eN.rotr)(n,13)^(0,eN.rotr)(n,22))+(0,nm.Maj)(n,r,i)|0;c=l,l=s,s=a,a=o+t|0,o=i,i=r,r=n,n=t+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,s=s+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(n,r,i,o,a,s,l,c)}roundClean(){nb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}ng.SHA256=nE;class nw extends nE{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}ng.sha256=(0,eN.wrapConstructor)(()=>new nE),ng.sha224=(0,eN.wrapConstructor)(()=>new nw);var nC={},nS={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;let t=eN;class n extends t.Hash{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,(0,eM.hash)(e);let r=(0,t.toBytes)(n);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),o.fill(0)}update(e){return(0,eM.exists)(this),this.iHash.update(e),this}digestInto(e){(0,eM.exists)(this),(0,eM.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:o,outputLen:a}=this;return e.finished=r,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=n,e.hmac=(e,t,r)=>new n(e,t).update(r).digest(),e.hmac.create=(e,t)=>new n(e,t)}(nS);var n_={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=void 0,e.weierstrassPoints=f,e.weierstrass=function(a){let s=function(e){let n=(0,t.validateBasic)(e);return r.validateObject(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}(a),{Fp:d,n:u}=s,h=d.BYTES+1,p=2*d.BYTES+1;function g(e){return n.mod(e,u)}function m(e){return n.invert(e,u)}let{ProjectivePoint:y,normPrivateKeyToScalar:v,weierstrassEquation:b,isWithinCurveOrder:E}
1=f({...s,toBytes(e,t,n){let o=t.toAffine(),a=d.toBytes(o.x),s=r.concatBytes;return(0,i.abool)("isCompressed",n),n?s(Uint8Array.from([t.hasEvenY()?2:3]),a):s(Uint8Array.from([4]),a,d.toBytes(o.y))},fromBytes(e){let t=e.length,n=e[0],i=e.subarray(1);if(t!==h||2!==n&&3!==n){if(t===p&&4===n)return{x:d.fromBytes(i.subarray(0,d.BYTES)),y:d.fromBytes(i.subarray(d.BYTES,2*d.BYTES))};throw Error(`Point of length ${t} was invalid. Expected ${h} compressed bytes or ${p} uncompressed bytes`)}{let e,t=r.bytesToNumberBE(i);if(!r.inRange(t,c,d.ORDER))throw Error("Point is not on curve");let o=b(t);try{e=d.sqrt(o)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return 1==(1&n)!=((e&c)===c)&&(e=d.neg(e)),{x:t,y:e}}}}),w=e=>r.bytesToHex(r.numberToBytesBE(e,s.nByteLength)),C=(e,t,n)=>r.bytesToNumberBE(e.slice(t,n));class S{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){let t=s.nByteLength;return new S(C(e=(0,i.ensureBytes)("compactSignature",e,2*t),0,t),C(e,t,2*t))}static fromDER(t){let{r:n,s:r}=e.DER.toSig((0,i.ensureBytes)("DER",t));return new S(n,r)}assertValidity(){r.aInRange("r",this.r,c,u),r.aInRange("s",this.s,c,u)}addRecoveryBit(e){return new S(this.r,this.s,e)}recoverPublicKey(e){let{r:t,s:n,recovery:r}=this,o=k((0,i.ensureBytes)("msgHash",e));if(null==r||![0,1,2,3].includes(r))throw Error("recovery id invalid");let a=2===r||3===r?t+s.n:t;if(a>=d.ORDER)throw Error("recovery id 2 or 3 invalid");let l=0==(1&r)?"02":"03",c=y.fromHex(l+w(a)),u=m(a),h=g(-o*u),f=g(n*u),p=y.BASE.multiplyAndAddUnsafe(c,h,f);if(!p)throw Error("point at infinify");return p.assertValidity(),p}hasHighS(){return this.s>u>>c}normalizeS(){return this.hasHighS()?new S(this.r,g(-this.s),this.recovery):this}toDERRawBytes(){return r.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return r.hexToBytes(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}function _(e){let t=r.isBytes(e),n="string"==typeof e,i=(t||n)&&e.length;return t?i===h||i===p:n?i===2*h||i===2*p:e instanceof y}let x=s.bits2int||function(e){let t=r.bytesToNumberBE(e),n=8*e.length-s.nBitLength;return n>0?t>>BigInt(n):t},k=s.bits2int_modN||function(e){return g(x(e))},M=r.bitMask(s.nBitLength);function A(e){return r.aInRange(`num < 2^${s.nBitLength}`,e,l,M),r.numberToBytesBE(e,s.nByteLength)}let I={lowS:s.lowS,prehash:!1},R={lowS:s.lowS,prehash:!1};return y.BASE._setWindowSize(8),{CURVE:s,getPublicKey:function(e,t=!0){return y.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(_(e))throw Error("first arg must be private key");if(!_(t))throw Error("second arg must be public key");return y.fromHex(t).multiply(v(e)).toRawBytes(n)},sign:function(e,t,n=I){let{seed:a,k2sig:h}=function(e,t,n=I){if(["recovered","canonical"].some(e=>e in n))throw Error("sign() legacy options not supported");let{hash:a,randomBytes:h}=s,{lowS:f,prehash:p,extraEntropy:b}=n;null==f&&(f=!0),e=(0,i.ensureBytes)("msgHash",e),o(n),p&&(e=(0,i.ensureBytes)("prehashed msgHash",a(e)));let w=k(e),C=v(t),_=[A(C),A(w)];if(null!=b&&!1!==b){let e=!0===b?h(d.BYTES):b;_.push((0,i.ensureBytes)("extraEntropy",e))}return{seed:r.concatBytes(..._),k2sig:function(e){let t=x(e);if(!E(t))return;let n=m(t),r=y.BASE.multiply(t).toAffine(),i=g(r.x);if(i===l)return;let o=g(n*g(w+i*C));if(o===l)return;let a=2*(r.x!==i)|Number(r.y&c),s=o;return f&&o>u>>c&&(s=o>u>>c?g(-o):o,a^=1),new S(i,s,a)}}}(e,t,n);return r.createHmacDrbg(s.hash.outputLen,s.nByteLength,s.hmac)(a,h)},verify:function(t,n,a,l=R){let c,d;if(n=(0,i.ensureBytes)("msgHash",n),a=(0,i.ensureBytes)("publicKey",a),"strict"in l)throw Error("options.strict was renamed to lowS");o(l);let{lowS:u,prehash:h}=l;try{if("string"==typeof t||r.isBytes(t))try{c=S.fromDER(t)}catch(n){if(!(n instanceof e.DER.Err))throw n;c=S.fromCompact(t)}else{if("object"!=typeof t||"bigint"!=typeof t.r||"bigint"!=typeof t.s)throw Error("PARSE");{let{r:e,s:n}=t;c=new S(e,n)}}d=y.fromHex(a)}catch(e){if("PARSE"===e.message)throw Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&c.hasHighS())return!1;h&&(n=s.hash(n));
1let{r:f,s:p}=c,v=k(n),b=m(p),E=g(v*b),w=g(f*b),C=y.BASE.multiplyAndAddUnsafe(d,E,w)?.toAffine();return!!C&&g(C.x)===f},ProjectivePoint:y,Signature:S,utils:{isValidPrivateKey(e){try{return v(e),!0}catch(e){return!1}},normPrivateKeyToScalar:v,randomPrivateKey:()=>{let e=n.getMinHashLength(s.n);return n.mapHashToField(s.randomBytes(e),s.n)},precompute:(e=8,t=y.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}},e.SWUFpSqrtRatio=p,e.mapToCurveSimpleSWU=function(e,t){if(n.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw Error("mapToCurveSimpleSWU: invalid opts");let r=p(e,t.Z);if(!e.isOdd)throw Error("Fp.isOdd is not implemented!");return n=>{let i,o,a,s,l,c,d,u;i=e.sqr(n),i=e.mul(i,t.Z),o=e.sqr(i),o=e.add(o,i),a=e.add(o,e.ONE),a=e.mul(a,t.B),s=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),s=e.mul(s,t.A),o=e.sqr(a),c=e.sqr(s),l=e.mul(c,t.A),o=e.add(o,l),o=e.mul(o,a),c=e.mul(c,s),l=e.mul(c,t.B),o=e.add(o,l),d=e.mul(i,a);let{isValid:h,value:f}=r(o,c);u=e.mul(i,n),u=e.mul(u,f),d=e.cmov(d,a,h),u=e.cmov(u,f,h);let p=e.isOdd(n)===e.isOdd(u);return u=e.cmov(e.neg(u),u,p),{x:d=e.div(d,s),y:u}}};let t=tc,n=td,r=tu,i=tu;function o(e){void 0!==e.lowS&&(0,i.abool)("lowS",e.lowS),void 0!==e.prehash&&(0,i.abool)("prehash",e.prehash)}let{bytesToNumberBE:a,hexToBytes:s}=r;e.DER={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(t,n)=>{let{Err:i}=e.DER;if(t<0||t>256)throw new i("tlv.encode: wrong tag");if(1&n.length)throw new i("tlv.encode: unpadded data");let o=n.length/2,a=r.numberToHexUnpadded(o);if(a.length/2&128)throw new i("tlv.encode: long form length too big");let s=o>127?r.numberToHexUnpadded(a.length/2|128):"";return`${r.numberToHexUnpadded(t)}${s}${a}${n}`},decode(t,n){let{Err:r}=e.DER,i=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(n.length<2||n[i++]!==t)throw new r("tlv.decode: wrong tlv");let o=n[i++],a=0;if(128&o){let e=127&o;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let t=n.subarray(i,i+e);if(t.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===t[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of t)a=a<<8|e;if(i+=e,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=o;let s=n.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:n.subarray(i+a)}}},_int:{encode(t){let{Err:n}=e.DER;if(t<l)throw new n("integer: negative integers are not allowed");let i=r.numberToHexUnpadded(t);if(8&Number.parseInt(i[0],16)&&(i="00"+i),1&i.length)throw new n("unexpected assertion");return i},decode(t){let{Err:n}=e.DER;if(128&t[0])throw new n("Invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new n("Invalid signature integer: unnecessary leading zero");return a(t)}},toSig(t){let{Err:n,_int:i,_tlv:o}=e.DER,a="string"==typeof t?s(t):t;r.abytes(a);let{v:l,l:c}=o.decode(48,a);if(c.length)throw new n("Invalid signature: left bytes after parsing");let{v:d,l:u}=o.decode(2,l),{v:h,l:f}=o.decode(2,u);if(f.length)throw new n("Invalid signature: left bytes after parsing");return{r:i.decode(d),s:i.decode(h)}},hexFromSig(t){let{_tlv:n,_int:r}=e.DER,i=`${n.encode(2,r.encode(t.r))}${n.encode(2,r.encode(t.s))}`;return n.encode(48,i)}};let l=BigInt(0),c=BigInt(1),d=BigInt(2),u=BigInt(3),h=BigInt(4);function f(e){let o=function(e){let n=(0,t.validateBasic)(e);r.validateObject(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:i,Fp:o,a:a}=n;if(i){if(!o.eql(a,o.ZERO))throw Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof i||"bigint"!=typeof i.beta||"function"!=typeof i.splitScalar)throw Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...n})}(e),{Fp:a}=o,s=n.Field(o.n,o.nBitLength),d=o.toBytes||((e,t,n)=>{let i=t.toAffine();return r.concatBytes(Uint8Array.from([4]),a.toBytes(i.x),a.toBytes(i.y))}),h=o.fromBytes||(e=>{let t=e.subarray(1);return{x:a.fromBytes(t.subarray(0,a.BYTES)),y:a.fromBytes(t.subarray(a.BYTES,2*a.BYTES))}});function f(e){let{a:t,b:n}=o,r=a.sqr(e),i=a.mul(r,e);return a.add(a.add(i,a.mul(e,t)),n)}if(!a.eql(a.sqr(o.Gy),f(o.Gx)))throw Error("bad generator point: equation left != right");function p(e){let t,{allowedPrivateKeyLengths:a,nByteLength:s,wrapPrivateKey:l,n:d}=o;if(a&&"bigint"!=typeof e){if(r.isBytes(e)&&(e=r.bytesToHex(e)),"string"!=typeof e||!a.includes(e.length))throw Error("Invalid key");e=e.padStart(2*s,"0")}try{t="bigint"==typeof e?e:r.bytesToNumberBE((0,i.ensureBytes)("private key",e,s))}catch(t){throw Error(`private key must be ${s} bytes, hex or bigint, not ${typeof e}`)}return l&&(t=n.mod(t,d)),r.aInRange("private key",t,c,d),t}function g(e){if(!(e instanceof v))throw Error("ProjectivePoint expected")}let m=(0,i.memoized)((e,t)=>{let{px:n,py:r,pz:i}=e;if(a.eql(i,a.ONE))return{x:n,y:r};let o=e.is0();null==t&&(t=o?a.ONE:a.inv(i));let s=a.mul(n,t),l=a.mul(r,t),c=a.mul(i,t);if(o)return{x:a.ZERO,y:a.ZERO};
vendor: 4,337 bytes, line 1
1if(!a.eql(c,a.ONE))throw Error("invZ was invalid");return{x:s,y:l}}),y=(0,i.memoized)(e=>{if(e.is0()){if(o.allowInfinityPoint&&!a.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:n}=e.toAffine();if(!a.isValid(t)||!a.isValid(n))throw Error("bad point: x or y not FE");let r=a.sqr(n),i=f(t);if(!a.eql(r,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class v{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!a.isValid(e))throw Error("x required");if(null==t||!a.isValid(t))throw Error("y required");if(null==n||!a.isValid(n))throw Error("z required");Object.freeze(this)}static fromAffine(e){let{x:t,y:n}=e||{};if(!e||!a.isValid(t)||!a.isValid(n))throw Error("invalid affine point");if(e instanceof v)throw Error("projective point not allowed");let r=e=>a.eql(e,a.ZERO);return r(t)&&r(n)?v.ZERO:new v(t,n,a.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=a.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(v.fromAffine)}static fromHex(e){let t=v.fromAffine(h((0,i.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return v.BASE.multiply(p(e))}static msm(e,n){return(0,t.pippenger)(v,s,e,n)}_setWindowSize(e){E.setWindowSize(this,e)}assertValidity(){y(this)}hasEvenY(){let{y:e}=this.toAffine();if(a.isOdd)return!a.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){g(e);let{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=e,l=a.eql(a.mul(t,s),a.mul(i,r)),c=a.eql(a.mul(n,s),a.mul(o,r));return l&&c}negate(){return new v(this.px,a.neg(this.py),this.pz)}double(){let{a:e,b:t}=o,n=a.mul(t,u),{px:r,py:i,pz:s}=this,l=a.ZERO,c=a.ZERO,d=a.ZERO,h=a.mul(r,r),f=a.mul(i,i),p=a.mul(s,s),g=a.mul(r,i);return g=a.add(g,g),d=a.mul(r,s),d=a.add(d,d),l=a.mul(e,d),c=a.mul(n,p),c=a.add(l,c),l=a.sub(f,c),c=a.add(f,c),c=a.mul(l,c),l=a.mul(g,l),d=a.mul(n,d),p=a.mul(e,p),g=a.sub(h,p),g=a.mul(e,g),g=a.add(g,d),d=a.add(h,h),h=a.add(d,h),h=a.add(h,p),h=a.mul(h,g),c=a.add(c,h),p=a.mul(i,s),p=a.add(p,p),h=a.mul(p,g),l=a.sub(l,h),d=a.mul(p,f),d=a.add(d,d),new v(l,c,d=a.add(d,d))}add(e){g(e);let{px:t,py:n,pz:r}=this,{px:i,py:s,pz:l}=e,c=a.ZERO,d=a.ZERO,h=a.ZERO,f=o.a,p=a.mul(o.b,u),m=a.mul(t,i),y=a.mul(n,s),b=a.mul(r,l),E=a.add(t,n),w=a.add(i,s);E=a.mul(E,w),w=a.add(m,y),E=a.sub(E,w),w=a.add(t,r);let C=a.add(i,l);return w=a.mul(w,C),C=a.add(m,b),w=a.sub(w,C),C=a.add(n,r),c=a.add(s,l),C=a.mul(C,c),c=a.add(y,b),C=a.sub(C,c),h=a.mul(f,w),c=a.mul(p,b),h=a.add(c,h),c=a.sub(y,h),h=a.add(y,h),d=a.mul(c,h),y=a.add(m,m),y=a.add(y,m),b=a.mul(f,b),w=a.mul(p,w),y=a.add(y,b),b=a.sub(m,b),b=a.mul(f,b),w=a.add(w,b),m=a.mul(y,w),d=a.add(d,m),m=a.mul(C,w),c=a.mul(E,c),c=a.sub(c,m),m=a.mul(E,y),h=a.mul(C,h),new v(c,d,h=a.add(h,m))}subtract(e){return this.add(e.negate())}is0(){return this.equals(v.ZERO)}wNAF(e){return E.wNAFCached(this,e,v.normalizeZ)}multiplyUnsafe(e){r.aInRange("scalar",e,l,o.n);let t=v.ZERO;if(e===l)return t;if(e===c)return this;let{endo:n}=o;if(!n)return E.unsafeLadder(this,e);let{k1neg:i,k1:s,k2neg:d,k2:u}=n.splitScalar(e),h=t,f=t,p=this;for(;s>l||u>l;)s&c&&(h=h.add(p)),u&c&&(f=f.add(p)),p=p.double(),s>>=c,u>>=c;return i&&(h=h.negate()),d&&(f=f.negate()),f=new v(a.mul(f.px,n.beta),f.py,f.pz),h.add(f)}multiply(e){let t,n,{endo:i,n:s}=o;if(r.aInRange("scalar",e,c,s),i){let{k1neg:r,k1:o,k2neg:s,k2:l}=i.splitScalar(e),{p:c,f:d}=this.wNAF(o),{p:u,f:h}=this.wNAF(l);c=E.constTimeNegate(r,c),u=E.constTimeNegate(s,u),u=new v(a.mul(u.px,i.beta),u.py,u.pz),t=c.add(u),n=d.add(h)}else{let{p:r,f:i}=this.wNAF(e);t=r,n=i}return v.normalizeZ([t,n])[0]}multiplyAndAddUnsafe(e,t,n){let r=v.BASE,i=(e,t)=>t!==l&&t!==c&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,n));return o.is0()?void 0:o}toAffine(e){return m(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=o;if(e===c)return!0;if(t)return t(v,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=o;return e===c?this:t?t(v,this):this.multiplyUnsafe(o.h)}toRawBytes(e=!0){return(0,i.abool)("isCompressed",e),this.assertValidity(),d(v,this,e)}toHex(e=!0){return(0,i.abool)("isCompressed",e),r.bytesToHex(this.toRawBytes(e))}}v.BASE=new v(o.Gx,o.Gy,a.ONE),v.ZERO=new v(a.ZERO,a.ONE,a.ZERO);
1let b=o.nBitLength,E=(0,t.wNAF)(v,o.endo?Math.ceil(b/2):b);return{CURVE:o,ProjectivePoint:v,normPrivateKeyToScalar:p,weierstrassEquation:f,isWithinCurveOrder:function(e){return r.inRange(e,c,o.n)}}}function p(e,t){let n=e.ORDER,r=l;for(let e=n-c;e%d===l;e/=d)r+=c;let i=r,o=d<<i-c-c,a=o*d,s=(n-c)/a,f=(s-c)/d,p=a-c,g=e.pow(t,s),m=e.pow(t,(s+c)/d),y=(t,n)=>{let r=g,a=e.pow(n,p),s=e.sqr(a);s=e.mul(s,n);let l=e.mul(t,s);l=e.pow(l,f),l=e.mul(l,a),a=e.mul(l,n),s=e.mul(l,t);let u=e.mul(s,a);l=e.pow(u,o);let h=e.eql(l,e.ONE);a=e.mul(s,m),l=e.mul(u,r),s=e.cmov(a,s,h),u=e.cmov(l,u,h);for(let t=i;t>c;t--){let n=t-d;n=d<<n-c;let i=e.pow(u,n),o=e.eql(i,e.ONE);a=e.mul(s,r),r=e.mul(r,r),i=e.mul(u,r),s=e.cmov(a,s,o),u=e.cmov(i,u,o)}return{isValid:h,value:s}};if(e.ORDER%h===u){let n=(e.ORDER-u)/h,r=e.sqrt(e.neg(t));y=(t,i)=>{let o=e.sqr(i),a=e.mul(t,i);o=e.mul(o,a);let s=e.pow(o,n);s=e.mul(s,a);let l=e.mul(s,r),c=e.mul(e.sqr(s),i),d=e.eql(c,t);return{isValid:d,value:e.cmov(l,s,d)}}}return y}}(n_),Object.defineProperty(nC,"__esModule",{value:!0}),nC.getHash=nk,nC.createCurve=function(e,t){let n=t=>(0,nx.weierstrass)({...e,...nk(t)});return Object.freeze({...n(t),create:n})};let nx=n_;function nk(e){return{hash:e,hmac:(t,...n)=>(0,nS.hmac)(e,t,(0,eN.concatBytes)(...n)),randomBytes:eN.randomBytes}}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;let t=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),r=BigInt(1),i=BigInt(2),o=(e,t)=>(e+t/i)/t;function a(e){let n=BigInt(3),r=BigInt(6),o=BigInt(11),a=BigInt(22),l=BigInt(23),c=BigInt(44),d=BigInt(88),u=e*e*e%t,h=u*u*e%t,f=(0,td.pow2)(h,n,t)*h%t,p=(0,td.pow2)(f,n,t)*h%t,g=(0,td.pow2)(p,i,t)*u%t,m=(0,td.pow2)(g,o,t)*g%t,y=(0,td.pow2)(m,a,t)*m%t,v=(0,td.pow2)(y,c,t)*y%t,b=(0,td.pow2)(v,d,t)*v%t,E=(0,td.pow2)(b,c,t)*y%t,w=(0,td.pow2)(E,n,t)*h%t,C=(0,td.pow2)(w,l,t)*m%t,S=(0,td.pow2)(C,r,t)*u%t,_=(0,td.pow2)(S,i,t);if(!s.eql(s.sqr(_),e))throw Error("Cannot find square root");return _}let s=(0,td.Field)(t,void 0,void 0,{sqrt:a});e.secp256k1=(0,nC.createCurve)({a:BigInt(0),b:BigInt(7),Fp:s,n:n,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-r*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=BigInt("0x100000000000000000000000000000000"),l=o(t*e,n),c=o(-i*e,n),d=(0,td.mod)(e-l*t-c*a,n),u=(0,td.mod)(-l*i-c*t,n),h=d>s,f=u>s;if(h&&(d=n-d),f&&(u=n-u),d>s||u>s)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:h,k1:d,k2neg:f,k2:u}}}},ng.sha256);let l=BigInt(0),c={};function d(e,...t){let n=c[e];if(void 0===n){let t=(0,ng.sha256)(Uint8Array.from(e,e=>e.charCodeAt(0)));n=(0,tu.concatBytes)(t,t),c[e]=n}return(0,ng.sha256)((0,tu.concatBytes)(n,...t))}let u=e=>e.toRawBytes(!0).slice(1),h=e=>(0,tu.numberToBytesBE)(e,32),f=e=>(0,td.mod)(e,t),p=e=>(0,td.mod)(e,n),g=e.secp256k1.ProjectivePoint,m=(e,t,n)=>g.BASE.multiplyAndAddUnsafe(e,t,n);function y(t){let n=e.secp256k1.utils.normPrivateKeyToScalar(t),r=g.fromPrivateKey(n);return{scalar:r.hasEvenY()?n:p(-n),bytes:u(r)}}function v(e){(0,tu.aInRange)("x",e,r,t);let n=f(e*e),o=a(f(n*e+BigInt(7)));o%i!==l&&(o=f(-o));let s=new g(e,o,r);return s.assertValidity(),s}let b=tu.bytesToNumberBE;function E(...e){return p(b(d("BIP0340/challenge",...e)))}function w(e,i,o){let a=(0,tu.ensureBytes)("signature",e,64),s=(0,tu.ensureBytes)("message",i),l=(0,tu.ensureBytes)("publicKey",o,32);try{let e=v(b(l)),i=b(a.subarray(0,32));if(!(0,tu.inRange)(i,r,t))return!1;let o=b(a.subarray(32,64));if(!(0,tu.inRange)(o,r,n))return!1;let c=E(h(i),u(e),s),d=m(e,o,p(-c));return!(!d||!d.hasEvenY()||d.toAffine().x!==i)}catch(e){return!1}}e.schnorr={getPublicKey:function(e){return y(e).bytes},sign:function(e,t,n=(0,eN.randomBytes)(32)){let r=(0,tu.ensureBytes)("message",e),{bytes:i,scalar:o}=y(t),a=h(o^b(d("BIP0340/aux",(0,tu.ensureBytes)("auxRand",n,32)))),s=p(b(d("BIP0340/nonce",a,i,r)));if(s===l)throw Error("sign failed: k is zero");let{bytes:c,scalar:u}=y(s),f=E(c,i,r),g=new Uint8Array(64);if(g.set(c,0),g.set(h(p(u+f*o)),32),!w(g,r,i))throw Error("sign: Invalid signature produced");return g},verify:w,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:v,pointToBytes:u,numberToBytesBE:tu.numberToBytesBE,bytesToNumberBE:tu.bytesToNumberBE,taggedHash:d,mod:td.mod}};let C=(0,nn.isogenyMap)(s,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a4
113deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(e=>BigInt(e)))),S=(0,n_.mapToCurveSimpleSWU)(s,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:s.create(BigInt("-11"))}),_=(0,nn.createHasher)(e.secp256k1.ProjectivePoint,e=>{let{x:t,y:n}=S(s.create(e[0]));return C(t,n)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:s.ORDER,m:1,k:128,expand:"xmd",hash:ng.sha256});e.hashToCurve=_.hashToCurve,e.encodeToCurve=_.encodeToCurve}(np);var nM={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHex=e.remove0x=void 0,e.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.slice(2):e},e.decodeHex=function(t){return(0,es.hexToBytes)((0,e.remove0x)(t))}}(nM),function(e){function t(e,t,n,r){if("secp256k1"===e)return t(np.secp256k1);if("x25519"===e)return n(e_.x25519);if("ed25519"===e)return r(e_.ed25519);throw Error("Not implemented")}Object.defineProperty(e,"__esModule",{value:!0}),e.hexToPublicKey=e.convertPublicKeyFormat=e.getSharedPoint=e.getPublicKey=e.isValidPrivateKey=e.getValidSecret=void 0,e.getValidSecret=function(){var t;do t=(0,eC.randomBytes)(ey.SECRET_KEY_LENGTH);while(!(0,e.isValidPrivateKey)(t));return t},e.isValidPrivateKey=function(e){return t((0,em.ellipticCurve)(),function(t){return t.utils.isValidPrivateKey(e)},function(){return!0},function(){return!0})},e.getPublicKey=function(e){return t((0,em.ellipticCurve)(),function(t){return t.getPublicKey(e)},function(t){return t.getPublicKey(e)},function(t){return t.getPublicKey(e)})},e.getSharedPoint=function(e,n,i){return t((0,em.ellipticCurve)(),function(t){return t.getSharedSecret(e,n,i)},function(t){return t.getSharedSecret(e,n)},function(t){return r(t,e,n)})},e.convertPublicKeyFormat=function(e,n){return t((0,em.ellipticCurve)(),function(t){return t.getSharedSecret(BigInt(1),e,n)},function(){return e},function(){return e})},e.hexToPublicKey=function(e){var r=(0,nM.decodeHex)(e);return t((0,em.ellipticCurve)(),function(){return n(r)},function(){return r},function(){return r})};var n=function(e){if(e.length===ey.ETH_PUBLIC_KEY_SIZE){var t=new Uint8Array(1+e.length);return t.set([4]),t.set(e,1),t}return e},r=function(e,t,n){var r=e.utils.getExtendedPublicKey(t).scalar;return e.ExtendedPoint.fromHex(n).multiply(r).toRawBytes()}}(ew);var nA={},nI={};function nR(e,t,n){return(0,eM.hash)(e),void 0===n&&(n=new Uint8Array(e.outputLen)),(0,nS.hmac)(e,(0,eN.toBytes)(n),(0,eN.toBytes)(t))}Object.defineProperty(nI,"__esModule",{value:!0}),nI.hkdf=void 0,nI.extract=nR,nI.expand=nO;let nL=new Uint8Array([0]),nP=new Uint8Array;function nO(e,t,n,r=32){if((0,eM.hash)(e),(0,eM.number)(r),r>255*e.outputLen)throw Error("Length should be <= 255*HashLen");let i=Math.ceil(r/e.outputLen);void 0===n&&(n=nP);let o=new Uint8Array(i*e.outputLen),a=nS.hmac.create(e,t),s=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let t=0;t<i;t++)nL[0]=t+1,s.update(0===t?nP:l).update(n).update(nL).digestInto(l),o.set(l,e.outputLen*t),a._cloneInto(s);return a.destroy(),s.destroy(),l.fill(0),nL.fill(0),o.slice(0,r)}nI.hkdf=(e,t,n,r,i)=>nO(e,nR(e,t,n),r,i),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getSharedKey=e.deriveKey=void 0,e.deriveKey=function(e,t,n){return(0,nI.hkdf)(ng.sha256,e,t,n,32)},e.getSharedKey=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(0,e.deriveKey)(es.concatBytes.apply(void 0,t))}}(nA);var nT={},nN={},nD={},n$={};
1Object.defineProperty(n$,"__esModule",{value:!0}),n$.polyval=n$.ghash=void 0,n$._toGHASHKey=nU;let nB=new Uint8Array(16),nK=(0,es.u32)(nB),nj=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255|0;function nU(e){e.reverse();let t=1&e[15],n=0;for(let t=0;t<e.length;t++){let r=e[t];e[t]=r>>>1|n,n=(1&r)<<7}return e[0]^=225&-t,e}class nH{constructor(e,t){var n,r,i,o;this.blockLen=16,this.outputLen=16,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,e=(0,es.toBytes)(e),(0,el.bytes)(e,16);let a=(0,es.createView)(e),s=a.getUint32(0,!1),l=a.getUint32(4,!1),c=a.getUint32(8,!1),d=a.getUint32(12,!1),u=[];for(let e=0;e<128;e++)u.push({s0:nj(s),s1:nj(l),s2:nj(c),s3:nj(d)}),{s0:s,s1:l,s2:c,s3:d}={s3:(i=c)<<31|(o=d)>>>1,s2:(r=l)<<31|i>>>1,s1:(n=s)<<31|r>>>1,s0:n>>>1^-0x1f000000&-(1&o)};let h=(e=>e>65536?8:e>1024?4:2)(t||1024);if(![1,2,4,8].includes(h))throw Error(`ghash: wrong window size=${h}, should be 2, 4 or 8`);this.W=h;let f=128/h,p=this.windowSize=2**h,g=[];for(let e=0;e<f;e++)for(let t=0;t<p;t++){let n=0,r=0,i=0,o=0;for(let a=0;a<h;a++){if(!(t>>>h-a-1&1))continue;let{s0:s,s1:l,s2:c,s3:d}=u[h*e+a];n^=s,r^=l,i^=c,o^=d}g.push({s0:n,s1:r,s2:i,s3:o})}this.t=g}_updateBlock(e,t,n,r){e^=this.s0,t^=this.s1,n^=this.s2,r^=this.s3;let{W:i,t:o,windowSize:a}=this,s=0,l=0,c=0,d=0,u=(1<<i)-1,h=0;for(let f of[e,t,n,r])for(let e=0;e<4;e++){let t=f>>>8*e&255;for(let e=8/i-1;e>=0;e--){let{s0:n,s1:r,s2:f,s3:p}=o[h*a+(t>>>i*e&u)];s^=n,l^=r,c^=f,d^=p,h+=1}}this.s0=s,this.s1=l,this.s2=c,this.s3=d}update(e){e=(0,es.toBytes)(e),(0,el.exists)(this);let t=(0,es.u32)(e),n=Math.floor(e.length/16),r=e.length%16;for(let e=0;e<n;e++)this._updateBlock(t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]);return r&&(nB.set(e.subarray(16*n)),this._updateBlock(nK[0],nK[1],nK[2],nK[3]),(0,es.clean)(nK)),this}destroy(){let{t:e}=this;for(let t of e)t.s0=0,t.s1=0,t.s2=0,t.s3=0}digestInto(e){(0,el.exists)(this),(0,el.output)(e,this),this.finished=!0;let{s0:t,s1:n,s2:r,s3:i}=this,o=(0,es.u32)(e);return o[0]=t,o[1]=n,o[2]=r,o[3]=i,e}digest(){let e=new Uint8Array(16);return this.digestInto(e),this.destroy(),e}}class nF extends nH{constructor(e,t){e=(0,es.toBytes)(e);let n=nU((0,es.copyBytes)(e));super(n,t),(0,es.clean)(n)}update(e){e=(0,es.toBytes)(e),(0,el.exists)(this);let t=(0,es.u32)(e),n=e.length%16,r=Math.floor(e.length/16);for(let e=0;e<r;e++)this._updateBlock(nj(t[4*e+3]),nj(t[4*e+2]),nj(t[4*e+1]),nj(t[4*e+0]));return n&&(nB.set(e.subarray(16*r)),this._updateBlock(nj(nK[3]),nj(nK[2]),nj(nK[1]),nj(nK[0])),(0,es.clean)(nK)),this}digestInto(e){(0,el.exists)(this),(0,el.output)(e,this),this.finished=!0;let{s0:t,s1:n,s2:r,s3:i}=this,o=(0,es.u32)(e);return o[0]=t,o[1]=n,o[2]=r,o[3]=i,e.reverse()}}function nz(e){let t=(t,n)=>e(n,t.length).update((0,es.toBytes)(t)).digest(),n=e(new Uint8Array(16),0);return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=(t,n)=>e(t,n),t}n$.ghash=nz((e,t)=>new nH(e,t)),n$.polyval=nz((e,t)=>new nF(e,t)),Object.defineProperty(nD,"__esModule",{value:!0}),nD.unsafe=nD.aeskwp=nD.aeskw=nD.siv=nD.gcm=nD.cfb=nD.cbc=nD.ecb=nD.ctr=void 0,nD.expandKeyLE=n3,nD.expandKeyDecLE=n5;let nq=new Uint8Array(16);function nW(e){return e<<1^283&-(e>>7)}function nV(e,t){let n=0;for(;t>0;t>>=1)n^=e&-(1&t),e=nW(e);return n}let nG=(()=>{let e=new Uint8Array(256);for(let t=0,n=1;t<256;t++,n^=nW(n))e[t]=n;let t=new Uint8Array(256);t[0]=99;for(let n=0;n<255;n++){let r=e[255-n];r|=r<<8,t[e[n]]=255&(r^r>>4^r>>5^r>>6^r>>7^99)}return(0,es.clean)(e),t})(),nZ=nG.map((e,t)=>nG.indexOf(t)),nY=e=>e<<24|e>>>8,nJ=e=>e<<8|e>>>24,nX=e=>e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255;function nQ(e,t){if(256!==e.length)throw Error("Wrong sbox length");let n=new Uint32Array(256).map((n,r)=>t(e[r])),r=n.map(nJ),i=r.map(nJ),o=i.map(nJ),a=new Uint32Array(65536),s=new Uint32Array(65536),l=new Uint16Array(65536);for(let t=0;t<256;t++)for(let c=0;c<256;c++){let d=256*t+c;a[d]=n[t]^r[c],s[d]=i[t]^o[c],l[d]=e[t]<<8|e[c]}return{sbox:e,sbox2:l,T0:n,T1:r,T2:i,T3:o,T01:a,T23:s}}let n0=nQ(nG,e=>nV(e,3)<<24|e<<16|e<<8|nV(e,2)),n1=nQ(nZ,e=>nV(e,11)<<24|nV(e,13)<<16|nV(e,9)<<8|nV(e,14)),n2=(()=>{let e=new Uint8Array(16);for(let t=0,n=1;t<16;t++,n=nW(n))e[t]=n;return e})();function n3(e){(0,el.bytes)(e);let t=e.length;if(![16,24,32].includes(t))throw Error(`aes: wrong key size: should be 16, 24 or 32, got: ${t}`);let{sbox2:n}=n0,r=[];(0,es.isAligned32)(e)||r.push(e=(0,es.copyBytes)(e));let i=(0,es.u32)(e),o=i.length,a=e=>
1n4(n,e,e,e,e),s=new Uint32Array(t+28);s.set(i);for(let e=o;e<s.length;e++){let t=s[e-1];e%o==0?t=a(nY(t))^n2[e/o-1]:o>6&&e%o==4&&(t=a(t)),s[e]=s[e-o]^t}return(0,es.clean)(...r),s}function n5(e){let t=n3(e),n=t.slice(),r=t.length,{sbox2:i}=n0,{T0:o,T1:a,T2:s,T3:l}=n1;for(let e=0;e<r;e+=4)for(let i=0;i<4;i++)n[e+i]=t[r-e-4+i];(0,es.clean)(t);for(let e=4;e<r-4;e++){let t=n[e],r=n4(i,t,t,t,t);n[e]=o[255&r]^a[r>>>8&255]^s[r>>>16&255]^l[r>>>24]}return n}function n8(e,t,n,r,i,o){return e[n<<8&65280|r>>>8&255]^t[i>>>8&65280|o>>>24&255]}function n4(e,t,n,r,i){return e[255&t|65280&n]|e[r>>>16&255|i>>>16&65280]<<16}function n6(e,t,n,r,i){let{sbox2:o,T01:a,T23:s}=n0,l=0;t^=e[l++],n^=e[l++],r^=e[l++],i^=e[l++];let c=e.length/4-2;for(let o=0;o<c;o++){let o=e[l++]^n8(a,s,t,n,r,i),c=e[l++]^n8(a,s,n,r,i,t),d=e[l++]^n8(a,s,r,i,t,n),u=e[l++]^n8(a,s,i,t,n,r);t=o,n=c,r=d,i=u}return{s0:e[l++]^n4(o,t,n,r,i),s1:e[l++]^n4(o,n,r,i,t),s2:e[l++]^n4(o,r,i,t,n),s3:e[l++]^n4(o,i,t,n,r)}}function n7(e,t,n,r,i){let{sbox2:o,T01:a,T23:s}=n1,l=0;t^=e[l++],n^=e[l++],r^=e[l++],i^=e[l++];let c=e.length/4-2;for(let o=0;o<c;o++){let o=e[l++]^n8(a,s,t,i,r,n),c=e[l++]^n8(a,s,n,t,i,r),d=e[l++]^n8(a,s,r,n,t,i),u=e[l++]^n8(a,s,i,r,n,t);t=o,n=c,r=d,i=u}return{s0:e[l++]^n4(o,t,i,r,n),s1:e[l++]^n4(o,n,t,i,r),s2:e[l++]^n4(o,r,n,t,i),s3:e[l++]^n4(o,i,r,n,t)}}function n9(e,t){if(void 0===t)return new Uint8Array(e);if((0,el.bytes)(t),t.length<e)throw Error(`aes: wrong destination length, expected at least ${e}, got: ${t.length}`);if(!(0,es.isAligned32)(t))throw Error("unaligned dst");return t}function re(e,t,n,r){(0,el.bytes)(t,16),(0,el.bytes)(n);let i=n.length;r=n9(i,r);let o=(0,es.u32)(t),{s0:a,s1:s,s2:l,s3:c}=n6(e,o[0],o[1],o[2],o[3]),d=(0,es.u32)(n),u=(0,es.u32)(r);for(let n=0;n+4<=d.length;n+=4){u[n+0]=d[n+0]^a,u[n+1]=d[n+1]^s,u[n+2]=d[n+2]^l,u[n+3]=d[n+3]^c;let r=1;for(let e=t.length-1;e>=0;e--)r=r+(255&t[e])|0,t[e]=255&r,r>>>=8;({s0:a,s1:s,s2:l,s3:c}=n6(e,o[0],o[1],o[2],o[3]))}let h=16*Math.floor(d.length/4);if(h<i){let e=new Uint32Array([a,s,l,c]),t=(0,es.u8)(e);for(let e=h,o=0;e<i;e++,o++)r[e]=n[e]^t[o];(0,es.clean)(e)}return r}function rt(e,t,n,r,i){(0,el.bytes)(n,16),(0,el.bytes)(r),i=n9(r.length,i);let o=(0,es.u32)(n),a=(0,es.createView)(n),s=(0,es.u32)(r),l=(0,es.u32)(i),c=12*!t,d=r.length,u=a.getUint32(c,t),{s0:h,s1:f,s2:p,s3:g}=n6(e,o[0],o[1],o[2],o[3]);for(let n=0;n+4<=s.length;n+=4)l[n+0]=s[n+0]^h,l[n+1]=s[n+1]^f,l[n+2]=s[n+2]^p,l[n+3]=s[n+3]^g,u=u+1>>>0,a.setUint32(c,u,t),{s0:h,s1:f,s2:p,s3:g}=n6(e,o[0],o[1],o[2],o[3]);let m=16*Math.floor(s.length/4);if(m<d){let e=new Uint32Array([h,f,p,g]),t=(0,es.u8)(e);for(let e=m,n=0;e<d;e++,n++)i[e]=r[e]^t[n];(0,es.clean)(e)}return i}function rn(e){if((0,el.bytes)(e),e.length%16!=0)throw Error("aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size 16")}function rr(e,t,n){(0,el.bytes)(e);let r=e.length,i=r%16;if(!t&&0!==i)throw Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");(0,es.isAligned32)(e)||(e=(0,es.copyBytes)(e));let o=(0,es.u32)(e);if(t){let e=16-i;e||(e=16),r+=e}let a=n9(r,n);return{b:o,o:(0,es.u32)(a),out:a}}function ri(e,t){if(!t)return e;let n=e.length;if(!n)throw Error("aes/pcks5: empty ciphertext not allowed");let r=e[n-1];if(r<=0||r>16)throw Error("aes/pcks5: wrong padding");let i=e.subarray(0,-r);for(let t=0;t<r;t++)if(e[n-t-1]!==r)throw Error("aes/pcks5: wrong padding");return i}function ro(e){let t=new Uint8Array(16),n=(0,es.u32)(t);t.set(e);let r=16-e.length;for(let e=16-r;e<16;e++)t[e]=r;return n}function ra(e,t,n,r,i){let o=null==i?0:i.length,a=e.create(n,r.length+o);i&&a.update(i),a.update(r);let s=new Uint8Array(16),l=(0,es.createView)(s);i&&(0,es.setBigUint64)(l,0,BigInt(8*o),t),(0,es.setBigUint64)(l,8,BigInt(8*r.length),t),a.update(s);let c=a.digest();return(0,es.clean)(s),c}nD.ctr=(0,es.wrapCipher)({blockSize:16,nonceLength:16},function(e,t){function n(n,r){if((0,el.bytes)(n),void 0!==r&&((0,el.bytes)(r),!(0,es.isAligned32)(r)))throw Error("unaligned destination");let i=n3(e),o=(0,es.copyBytes)(t),a=[i,o];(0,es.isAligned32)(n)||a.push(n=(0,es.copyBytes)(n));let s=re(i,o,n,r);return(0,es.clean)(...a),s}return(0,el.bytes)(e),(0,el.bytes)(t,16),{encrypt:(e,t)=>
1n(e,t),decrypt:(e,t)=>n(e,t)}}),nD.ecb=(0,es.wrapCipher)({blockSize:16},function(e,t={}){(0,el.bytes)(e);let n=!t.disablePadding;return{encrypt(t,r){let{b:i,o:o,out:a}=rr(t,n,r),s=n3(e),l=0;for(;l+4<=i.length;){let{s0:e,s1:t,s2:n,s3:r}=n6(s,i[l+0],i[l+1],i[l+2],i[l+3]);o[l++]=e,o[l++]=t,o[l++]=n,o[l++]=r}if(n){let e=ro(t.subarray(4*l)),{s0:n,s1:r,s2:i,s3:a}=n6(s,e[0],e[1],e[2],e[3]);o[l++]=n,o[l++]=r,o[l++]=i,o[l++]=a}return(0,es.clean)(s),a},decrypt(t,r){rn(t);let i=n5(e),o=n9(t.length,r),a=[i];(0,es.isAligned32)(t)||a.push(t=(0,es.copyBytes)(t));let s=(0,es.u32)(t),l=(0,es.u32)(o);for(let e=0;e+4<=s.length;){let{s0:t,s1:n,s2:r,s3:o}=n7(i,s[e+0],s[e+1],s[e+2],s[e+3]);l[e++]=t,l[e++]=n,l[e++]=r,l[e++]=o}return(0,es.clean)(...a),ri(o,n)}}}),nD.cbc=(0,es.wrapCipher)({blockSize:16,nonceLength:16},function(e,t,n={}){(0,el.bytes)(e),(0,el.bytes)(t,16);let r=!n.disablePadding;return{encrypt(n,i){let o=n3(e),{b:a,o:s,out:l}=rr(n,r,i),c=t,d=[o];(0,es.isAligned32)(c)||d.push(c=(0,es.copyBytes)(c));let u=(0,es.u32)(c),h=u[0],f=u[1],p=u[2],g=u[3],m=0;for(;m+4<=a.length;)h^=a[m+0],f^=a[m+1],p^=a[m+2],g^=a[m+3],({s0:h,s1:f,s2:p,s3:g}=n6(o,h,f,p,g)),s[m++]=h,s[m++]=f,s[m++]=p,s[m++]=g;if(r){let e=ro(n.subarray(4*m));h^=e[0],f^=e[1],p^=e[2],g^=e[3],({s0:h,s1:f,s2:p,s3:g}=n6(o,h,f,p,g)),s[m++]=h,s[m++]=f,s[m++]=p,s[m++]=g}return(0,es.clean)(...d),l},decrypt(n,i){rn(n);let o=n5(e),a=t,s=[o];(0,es.isAligned32)(a)||s.push(a=(0,es.copyBytes)(a));let l=(0,es.u32)(a),c=n9(n.length,i);(0,es.isAligned32)(n)||s.push(n=(0,es.copyBytes)(n));let d=(0,es.u32)(n),u=(0,es.u32)(c),h=l[0],f=l[1],p=l[2],g=l[3];for(let e=0;e+4<=d.length;){let t=h,n=f,r=p,i=g;h=d[e+0],f=d[e+1];let{s0:a,s1:s,s2:l,s3:c}=n7(o,h,f,p=d[e+2],g=d[e+3]);u[e++]=a^t,u[e++]=s^n,u[e++]=l^r,u[e++]=c^i}return(0,es.clean)(...s),ri(c,r)}}}),nD.cfb=(0,es.wrapCipher)({blockSize:16,nonceLength:16},function(e,t){function n(n,r,i){(0,el.bytes)(n);let o=n.length;i=n9(o,i);let a=n3(e),s=t,l=[a];(0,es.isAligned32)(s)||l.push(s=(0,es.copyBytes)(s)),(0,es.isAligned32)(n)||l.push(n=(0,es.copyBytes)(n));let c=(0,es.u32)(n),d=(0,es.u32)(i),u=r?d:c,h=(0,es.u32)(s),f=h[0],p=h[1],g=h[2],m=h[3];for(let e=0;e+4<=c.length;){let{s0:t,s1:n,s2:r,s3:i}=n6(a,f,p,g,m);d[e+0]=c[e+0]^t,d[e+1]=c[e+1]^n,d[e+2]=c[e+2]^r,d[e+3]=c[e+3]^i,f=u[e++],p=u[e++],g=u[e++],m=u[e++]}let y=16*Math.floor(c.length/4);if(y<o){({s0:f,s1:p,s2:g,s3:m}=n6(a,f,p,g,m));let e=(0,es.u8)(new Uint32Array([f,p,g,m]));for(let t=y,r=0;t<o;t++,r++)i[t]=n[t]^e[r];(0,es.clean)(e)}return(0,es.clean)(...l),i}return(0,el.bytes)(e),(0,el.bytes)(t,16),{encrypt:(e,t)=>n(e,!0,t),decrypt:(e,t)=>n(e,!1,t)}}),nD.gcm=(0,es.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16},function(e,t,n){if((0,el.bytes)(e),(0,el.bytes)(t),void 0!==n&&(0,el.bytes)(n),t.length<8)throw Error("aes/gcm: invalid nonce length");function r(e,t,r){let i=ra(n$.ghash,!1,e,r,n);for(let e=0;e<t.length;e++)i[e]^=t[e];return i}function i(){let n=n3(e),r=nq.slice(),i=nq.slice();if(rt(n,!1,i,i,r),12===t.length)i.set(t);else{let e=nq.slice(),n=(0,es.createView)(e);(0,es.setBigUint64)(n,8,BigInt(8*t.length),!1);let o=n$.ghash.create(r).update(t).update(e);o.digestInto(i),o.destroy()}return{xk:n,authKey:r,counter:i,tagMask:rt(n,!1,i,nq)}}return{encrypt(e){(0,el.bytes)(e);let{xk:t,authKey:n,counter:o,tagMask:a}=i(),s=new Uint8Array(e.length+16),l=[t,n,o,a];(0,es.isAligned32)(e)||l.push(e=(0,es.copyBytes)(e)),rt(t,!1,o,e,s);let c=r(n,a,s.subarray(0,s.length-16));return l.push(c),s.set(c,e.length),(0,es.clean)(...l),s},decrypt(e){if((0,el.bytes)(e),e.length<16)throw Error("aes/gcm: ciphertext less than tagLen (16)");let{xk:t,authKey:n,counter:o,tagMask:a}=i(),s=[t,n,a,o];(0,es.isAligned32)(e)||s.push(e=(0,es.copyBytes)(e));let l=e.subarray(0,-16),c=e.subarray(-16),d=r(n,a,l);if(s.push(d),!(0,es.equalBytes)(d,c))throw Error("aes/gcm: invalid ghash tag");let u=rt(t,!1,o,l);return(0,es.clean)(...s),u}}});let rs=(e,t,n)=>r=>{if(!Number.isSafeInteger(r)||t>r||r>n)throw Error(`${e}: invalid value=${r}, must be [${t}..${n}]`)};function rl(e){return null!=e&&"object"==typeof e&&(e instanceof Uint32Array||"Uint32Array"===e.constructor.name)}function rc(e,t){if((0,el.bytes)(t,16),!rl(e))throw Error("_encryptBlock accepts result of expandKeyLE");let n=(0,es.u32)(t),{s0:r,s1:i,s2:o,s3:a}=n6(e,n[0],n[1],n[2],n[3]);return n[0]=r,n[1]=i,n[2]=o,n[3]=a,t}function rd(e,t){if((0,el.bytes)(t,16),!rl(e))throw Error("_decryptBlock accepts result of expandKeyLE");let n=(0,es.u32)(t),{s0:r,s1:i,s2:o,s3:a}=n7(e,n[0],n[1],n[2],n[3]);return n[0]=r,n[1]=i,n[2]=o,n[3]=a,t}nD.siv=(0,es.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16},function(e,t,n){let r=rs("AAD",0,0x1000000000),i=rs("plaintext",0,0x1000000000),o=rs("nonce",12,12),a=rs("ciphertext",16,0x1000000000+16);function s(){let n=n3(e),r=new Uint8Array(e.length),i=new Uint8Array(16),o=[n,r],a=t;(0,es.isAligned32)(a)||o.push(a=(0,es.copyBytes)(a));let s=(0,es.u32)(a),l=0,c=s[0],d=s[1],u=s[2],h=0;for(let e of[i,r].map(es.u32)){let t=(0,es.u32)(e);for(let e=0;e<t.length;e+=2){let{s0:r,s1:i}=n6(n,l,c,d,u);t[e+0]=r,t[e+1]=i,l=++h}}let f={authKey:i,encKey:n3(r)};return(0,es.clean)(...o),f}function l(e,r,i){let o=ra(n$.polyval,!0,r,i,n);for(let e=0;e<12;e++)o[e]^=t[e];o[15]&=127;let a=(0,es.u32)(o),s=a[0],l=a[1],c=a[2],d=a[3];return{s0:s,s1:l,s2:c,s3:d}=n6(e,s,l,c,d),a[0]=s,a[1]=l,a[2]=c,a[3]=d,o}
1function c(e,t,n){let r=(0,es.copyBytes)(t);r[15]|=128;let i=rt(e,!0,r,n);return(0,es.clean)(r),i}return(0,el.bytes)(e,16,24,32),(0,el.bytes)(t),o(t.length),void 0!==n&&((0,el.bytes)(n),r(n.length)),{encrypt(e){(0,el.bytes)(e),i(e.length);let{encKey:t,authKey:n}=s(),r=l(t,n,e),o=[t,n,r];(0,es.isAligned32)(e)||o.push(e=(0,es.copyBytes)(e));let a=new Uint8Array(e.length+16);return a.set(r,e.length),a.set(c(t,r,e)),(0,es.clean)(...o),a},decrypt(e){(0,el.bytes)(e),a(e.length);let t=e.subarray(-16),{encKey:n,authKey:r}=s(),i=[n,r];(0,es.isAligned32)(e)||i.push(e=(0,es.copyBytes)(e));let o=c(n,t,e.subarray(0,-16)),d=l(n,r,o);if(i.push(d),!(0,es.equalBytes)(t,d))throw(0,es.clean)(...i),Error("invalid polyval tag");return(0,es.clean)(...i),o}}});let ru={encrypt(e,t){if(t.length>=0x100000000)throw Error("plaintext should be less than 4gb");let n=n3(e);if(16===t.length)rc(n,t);else{let e=(0,es.u32)(t),r=e[0],i=e[1];for(let t=0,o=1;t<6;t++)for(let t=2;t<e.length;t+=2,o++){let{s0:a,s1:s,s2:l,s3:c}=n6(n,r,i,e[t],e[t+1]);r=a,i=s^nX(o),e[t]=l,e[t+1]=c}e[0]=r,e[1]=i}n.fill(0)},decrypt(e,t){if(t.length-8>=0x100000000)throw Error("ciphertext should be less than 4gb");let n=n5(e),r=t.length/8-1;if(1===r)rd(n,t);else{let e=(0,es.u32)(t),i=e[0],o=e[1];for(let t=0,a=6*r;t<6;t++)for(let t=2*r;t>=1;t-=2,a--){let{s0:r,s1:s,s2:l,s3:c}=n7(n,i,o^=nX(a),e[t],e[t+1]);i=r,o=s,e[t]=l,e[t+1]=c}e[0]=i,e[1]=o}n.fill(0)}},rh=new Uint8Array(8).fill(166);nD.aeskw=(0,es.wrapCipher)({blockSize:8},e=>({encrypt(t){if((0,el.bytes)(t),!t.length||t.length%8!=0)throw Error("invalid plaintext length");if(8===t.length)throw Error("8-byte keys not allowed in AESKW, use AESKWP instead");let n=(0,es.concatBytes)(rh,t);return ru.encrypt(e,n),n},decrypt(t){if((0,el.bytes)(t),t.length%8!=0||t.length<24)throw Error("invalid ciphertext length");let n=(0,es.copyBytes)(t);if(ru.decrypt(e,n),!(0,es.equalBytes)(n.subarray(0,8),rh))throw Error("integrity check failed");return n.subarray(0,8).fill(0),n.subarray(8)}})),nD.aeskwp=(0,es.wrapCipher)({blockSize:8},e=>({encrypt(t){if((0,el.bytes)(t),!t.length)throw Error("invalid plaintext length");let n=new Uint8Array(8+8*Math.ceil(t.length/8));n.set(t,8);let r=(0,es.u32)(n);return r[0]=0xa65959a6,r[1]=nX(t.length),ru.encrypt(e,n),n},decrypt(t){if((0,el.bytes)(t),t.length<16)throw Error("invalid ciphertext length");let n=(0,es.copyBytes)(t),r=(0,es.u32)(n);ru.decrypt(e,n);let i=nX(r[1])>>>0,o=8*Math.ceil(i/8);if(0xa65959a6!==r[0]||n.length-8!==o)throw Error("integrity check failed");for(let e=i;e<o;e++)if(0!==n[8+e])throw Error("integrity check failed");return n.subarray(0,8).fill(0),n.subarray(8,8+i)}})),nD.unsafe={expandKeyLE:n3,expandKeyDecLE:n5,encrypt:n6,decrypt:n7,encryptBlock:rc,decryptBlock:rd,ctrCounter:re,ctr32:rt},Object.defineProperty(nN,"__esModule",{value:!0}),nN.aes256cbc=nN.aes256gcm=void 0,nN.aes256gcm=function(e,t,n){return(0,nD.gcm)(e,t,n)},nN.aes256cbc=function(e,t,n){return(0,nD.cbc)(e,t)};var rf={},rp={},rg={};Object.defineProperty(rg,"__esModule",{value:!0}),rg.sigma=void 0,rg.rotl=function(e,t){return e<<t|e>>>32-t},rg.createCipher=function(e,t){let{allowShortKeys:n,extendNonceFn:r,counterLength:i,counterRight:o,rounds:a}=(0,ry.checkOpts)({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw Error("core must be a function");return(0,rm.number)(i),(0,rm.number)(a),(0,rm.bool)(o),(0,rm.bool)(n),(t,s,l,c,d=0)=>{(0,rm.bytes)(t),(0,rm.bytes)(s),(0,rm.bytes)(l);let u=l.length;if(void 0===c&&(c=new Uint8Array(u)),(0,rm.bytes)(c),(0,rm.number)(d),d<0||d>=rk)throw Error("arx: counter overflow");if(c.length<u)throw Error(`arx: output (${c.length}) is shorter than data (${u})`);let h=[],f,p,g=t.length;if(32===g)h.push(f=(0,ry.copyBytes)(t)),p=rC;else{if(16!==g||!n)throw Error(`arx: invalid 32-byte key, got length=${g}`);(f=new Uint8Array(32)).set(t),f.set(t,16),p=rw,h.push(f)}rS(s)||h.push(s=(0,ry.copyBytes)(s));let m=(0,ry.u32)(f);if(r){if(24!==s.length)throw Error("arx: extended nonce must be 24 bytes");r(p,m,(0,ry.u32)(s.subarray(0,16)),m),s=s.subarray(16)}let y=16-i;if(y!==s.length)throw Error(`arx: nonce must be ${y} or 16 bytes`);if(12!==y){let e=new Uint8Array(12);e.set(s,o?0:12-s.length),s=e,h.push(s)}return function(e,t,n,r,i,o,a,s){let l=i.length,c=new Uint8Array(r_),d=(0,ry.u32)(c),u=rS(i)&&rS(o),h=u?(0,ry.u32)(i):rM,f=u?(0,ry.u32)(o):rM;for(let p=0;p<l;a++){if(e(t,n,r,d,a,s),a>=rk)throw Error("arx: counter overflow");let g=Math.min(r_,l-p);if(u&&g===r_){let e=p/4;
1if(p%4!=0)throw Error("arx: invalid block position");for(let t,n=0;n<rx;n++)f[t=e+n]=h[t]^d[n];p+=r_}else{for(let e,t=0;t<g;t++)o[e=p+t]=i[e]^c[t];p+=g}}}(e,p,m,(0,ry.u32)(s),l,c,d,a),(0,ry.clean)(...h),c}};let rm=el,ry=es,rv=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),rb=rv("expand 16-byte k"),rE=rv("expand 32-byte k"),rw=(0,ry.u32)(rb),rC=(0,ry.u32)(rE);function rS(e){return e.byteOffset%4==0}rg.sigma=rC.slice();let r_=64,rx=16,rk=0x100000000-1,rM=new Uint32Array;var rA={};Object.defineProperty(rA,"__esModule",{value:!0}),rA.poly1305=void 0,rA.wrapConstructorWithKey=rL;let rI=(e,t)=>255&e[t++]|(255&e[t++])<<8;class rR{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=(0,es.toBytes)(e),(0,el.bytes)(e,32);let t=rI(e,0),n=rI(e,2),r=rI(e,4),i=rI(e,6),o=rI(e,8),a=rI(e,10),s=rI(e,12),l=rI(e,14);this.r[0]=8191&t,this.r[1]=8191&(t>>>13|n<<3),this.r[2]=7939&(n>>>10|r<<6),this.r[3]=8191&(r>>>7|i<<9),this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,this.r[6]=8191&(o>>>14|a<<2),this.r[7]=8065&(a>>>11|s<<5),this.r[8]=8191&(s>>>8|l<<8),this.r[9]=l>>>5&127;for(let t=0;t<8;t++)this.pad[t]=rI(e,16+2*t)}process(e,t,n=!1){let{h:r,r:i}=this,o=i[0],a=i[1],s=i[2],l=i[3],c=i[4],d=i[5],u=i[6],h=i[7],f=i[8],p=i[9],g=rI(e,t+0),m=rI(e,t+2),y=rI(e,t+4),v=rI(e,t+6),b=rI(e,t+8),E=rI(e,t+10),w=rI(e,t+12),C=rI(e,t+14),S=r[0]+(8191&g),_=r[1]+(8191&(g>>>13|m<<3)),x=r[2]+(8191&(m>>>10|y<<6)),k=r[3]+(8191&(y>>>7|v<<9)),M=r[4]+(8191&(v>>>4|b<<12)),A=r[5]+(b>>>1&8191),I=r[6]+(8191&(b>>>14|E<<2)),R=r[7]+(8191&(E>>>11|w<<5)),L=r[8]+(8191&(w>>>8|C<<8)),P=r[9]+(C>>>5|2048*!n),O=0,T=0+S*o+5*p*_+5*f*x+5*h*k+5*u*M;O=T>>>13,T&=8191,T+=5*d*A+5*c*I+5*l*R+5*s*L+5*a*P,O+=T>>>13,T&=8191;let N=O+S*a+_*o+5*p*x+5*f*k+5*h*M;O=N>>>13,N&=8191,N+=5*u*A+5*d*I+5*c*R+5*l*L+5*s*P,O+=N>>>13,N&=8191;let D=O+S*s+_*a+x*o+5*p*k+5*f*M;O=D>>>13,D&=8191,D+=5*h*A+5*u*I+5*d*R+5*c*L+5*l*P,O+=D>>>13,D&=8191;let $=O+S*l+_*s+x*a+k*o+5*p*M;O=$>>>13,$&=8191,$+=5*f*A+5*h*I+5*u*R+5*d*L+5*c*P,O+=$>>>13,$&=8191;let B=O+S*c+_*l+x*s+k*a+M*o;O=B>>>13,B&=8191,B+=5*p*A+5*f*I+5*h*R+5*u*L+5*d*P,O+=B>>>13,B&=8191;let K=O+S*d+_*c+x*l+k*s+M*a;O=K>>>13,K&=8191,K+=A*o+5*p*I+5*f*R+5*h*L+5*u*P,O+=K>>>13,K&=8191;let j=O+S*u+_*d+x*c+k*l+M*s;O=j>>>13,j&=8191,j+=A*a+I*o+5*p*R+5*f*L+5*h*P,O+=j>>>13,j&=8191;let U=O+S*h+_*u+x*d+k*c+M*l;O=U>>>13,U&=8191,U+=A*s+I*a+R*o+5*p*L+5*f*P,O+=U>>>13,U&=8191;let H=O+S*f+_*h+x*u+k*d+M*c;O=H>>>13,H&=8191,H+=A*l+I*s+R*a+L*o+5*p*P,O+=H>>>13,H&=8191;let F=O+S*p+_*f+x*h+k*u+M*d;O=F>>>13,F&=8191,F+=A*c+I*l+R*s+L*a+P*o,O+=F>>>13,F&=8191,T=8191&(O=(O=(O<<2)+O|0)+T|0),O>>>=13,N+=O,r[0]=T,r[1]=N,r[2]=D,r[3]=$,r[4]=B,r[5]=K,r[6]=j,r[7]=U,r[8]=H,r[9]=F}finalize(){let{h:e,pad:t}=this,n=new Uint16Array(10),r=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=r,r=e[t]>>>13,e[t]&=8191;e[0]+=5*r,r=e[0]>>>13,e[0]&=8191,e[1]+=r,r=e[1]>>>13,e[1]&=8191,e[2]+=r,n[0]=e[0]+5,r=n[0]>>>13,n[0]&=8191;for(let t=1;t<10;t++)n[t]=e[t]+r,r=n[t]>>>13,n[t]&=8191;n[9]-=8192;let i=(1^r)-1;for(let e=0;e<10;e++)n[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|n[t];e[0]=65535&(e[0]|e[1]<<13),e[1]=65535&(e[1]>>>3|e[2]<<10),e[2]=65535&(e[2]>>>6|e[3]<<7),e[3]=65535&(e[3]>>>9|e[4]<<4),e[4]=65535&(e[4]>>>12|e[5]<<1|e[6]<<14),e[5]=65535&(e[6]>>>2|e[7]<<11),e[6]=65535&(e[7]>>>5|e[8]<<8),e[7]=65535&(e[8]>>>8|e[9]<<5);let o=e[0]+t[0];e[0]=65535&o;for(let n=1;n<8;n++)o=(e[n]+t[n]|0)+(o>>>16)|0,e[n]=65535&o;(0,es.clean)(n)}update(e){(0,el.exists)(this);let{buffer:t,blockLen:n}=this,r=(e=(0,es.toBytes)(e)).length;for(let i=0;i<r;){let o=Math.min(n-this.pos,r-i);if(o!==n)t.set(e.subarray(i,i+o),this.pos),this.pos+=o,i+=o,this.pos===n&&(this.process(t,0,!1),this.pos=0);else for(;n<=r-i;i+=n)this.process(e,i)}return this}destroy(){(0,es.clean)(this.h,this.r,this.buffer,this.pad)}digestInto(e){(0,el.exists)(this),(0,el.output)(e,this),this.finished=!0;let{buffer:t,h:n}=this,{pos:r}=this;if(r){for(t[r++]=1;r<16;r++)t[r]=0;this.process(t,0,!0)}this.finalize();let i=0;for(let t=0;t<8;t++)e[i++]=n[t]>>>0,e[i++]=n[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}}function rL(e){let t=(t,n)=>e(n).update((0,es.toBytes)(t)).digest(),n=e(new Uint8Array(32));return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}rA.poly1305=rL(e=>new rR(e)),function(e){function t(e,n,r,i,o,a=20){let s=e[0],l=e[1],c=e[2],d=e[3],u=n[0],h=n[1],f=n[2],p=n[3],g=n[4],m=n[5],y=n[6],v=n[7],b=r[0],E=r[1],w=r[2],C=s,S=l,_=c,x=d,k=u,M=h,A=f,I=p,R=g,L=m,P=y,O=v,T=o,N=b,D=E,$=w;for(let e=0;e<a;e+=2)C=C+k|0,R=R+(T=(0,rg.rotl)(T^C,16))|0,C=C+(k=(0,rg.rotl)(k^R,12))|0,R=R+(T=(0,rg.rotl)(T^C,8))|0,k=(0,rg.rotl)(k^R,7),S=S+M|0,L=L+(N=(0,rg.rotl)(N^
1S,16))|0,S=S+(M=(0,rg.rotl)(M^L,12))|0,L=L+(N=(0,rg.rotl)(N^S,8))|0,M=(0,rg.rotl)(M^L,7),_=_+A|0,P=P+(D=(0,rg.rotl)(D^_,16))|0,_=_+(A=(0,rg.rotl)(A^P,12))|0,P=P+(D=(0,rg.rotl)(D^_,8))|0,A=(0,rg.rotl)(A^P,7),x=x+I|0,O=O+($=(0,rg.rotl)($^x,16))|0,x=x+(I=(0,rg.rotl)(I^O,12))|0,O=O+($=(0,rg.rotl)($^x,8))|0,I=(0,rg.rotl)(I^O,7),C=C+M|0,P=P+($=(0,rg.rotl)($^C,16))|0,C=C+(M=(0,rg.rotl)(M^P,12))|0,P=P+($=(0,rg.rotl)($^C,8))|0,M=(0,rg.rotl)(M^P,7),S=S+A|0,O=O+(T=(0,rg.rotl)(T^S,16))|0,S=S+(A=(0,rg.rotl)(A^O,12))|0,O=O+(T=(0,rg.rotl)(T^S,8))|0,A=(0,rg.rotl)(A^O,7),_=_+I|0,R=R+(N=(0,rg.rotl)(N^_,16))|0,_=_+(I=(0,rg.rotl)(I^R,12))|0,R=R+(N=(0,rg.rotl)(N^_,8))|0,I=(0,rg.rotl)(I^R,7),x=x+k|0,L=L+(D=(0,rg.rotl)(D^x,16))|0,x=x+(k=(0,rg.rotl)(k^L,12))|0,L=L+(D=(0,rg.rotl)(D^x,8))|0,k=(0,rg.rotl)(k^L,7);let B=0;i[B++]=s+C|0,i[B++]=l+S|0,i[B++]=c+_|0,i[B++]=d+x|0,i[B++]=u+k|0,i[B++]=h+M|0,i[B++]=f+A|0,i[B++]=p+I|0,i[B++]=g+R|0,i[B++]=m+L|0,i[B++]=y+P|0,i[B++]=v+O|0,i[B++]=o+T|0,i[B++]=b+N|0,i[B++]=E+D|0,i[B++]=w+$|0}function n(e,t,n,r){let i=e[0],o=e[1],a=e[2],s=e[3],l=t[0],c=t[1],d=t[2],u=t[3],h=t[4],f=t[5],p=t[6],g=t[7],m=n[0],y=n[1],v=n[2],b=n[3];for(let e=0;e<20;e+=2)i=i+l|0,h=h+(m=(0,rg.rotl)(m^i,16))|0,i=i+(l=(0,rg.rotl)(l^h,12))|0,h=h+(m=(0,rg.rotl)(m^i,8))|0,l=(0,rg.rotl)(l^h,7),o=o+c|0,f=f+(y=(0,rg.rotl)(y^o,16))|0,o=o+(c=(0,rg.rotl)(c^f,12))|0,f=f+(y=(0,rg.rotl)(y^o,8))|0,c=(0,rg.rotl)(c^f,7),a=a+d|0,p=p+(v=(0,rg.rotl)(v^a,16))|0,a=a+(d=(0,rg.rotl)(d^p,12))|0,p=p+(v=(0,rg.rotl)(v^a,8))|0,d=(0,rg.rotl)(d^p,7),s=s+u|0,g=g+(b=(0,rg.rotl)(b^s,16))|0,s=s+(u=(0,rg.rotl)(u^g,12))|0,g=g+(b=(0,rg.rotl)(b^s,8))|0,u=(0,rg.rotl)(u^g,7),i=i+c|0,p=p+(b=(0,rg.rotl)(b^i,16))|0,i=i+(c=(0,rg.rotl)(c^p,12))|0,p=p+(b=(0,rg.rotl)(b^i,8))|0,c=(0,rg.rotl)(c^p,7),o=o+d|0,g=g+(m=(0,rg.rotl)(m^o,16))|0,o=o+(d=(0,rg.rotl)(d^g,12))|0,g=g+(m=(0,rg.rotl)(m^o,8))|0,d=(0,rg.rotl)(d^g,7),a=a+u|0,h=h+(y=(0,rg.rotl)(y^a,16))|0,a=a+(u=(0,rg.rotl)(u^h,12))|0,h=h+(y=(0,rg.rotl)(y^a,8))|0,u=(0,rg.rotl)(u^h,7),s=s+l|0,f=f+(v=(0,rg.rotl)(v^s,16))|0,s=s+(l=(0,rg.rotl)(l^f,12))|0,f=f+(v=(0,rg.rotl)(v^s,8))|0,l=(0,rg.rotl)(l^f,7);let E=0;r[E++]=i,r[E++]=o,r[E++]=a,r[E++]=s,r[E++]=m,r[E++]=y,r[E++]=v,r[E++]=b}Object.defineProperty(e,"__esModule",{value:!0}),e.xchacha20poly1305=e.chacha20poly1305=e._poly1305_aead=e.chacha12=e.chacha8=e.xchacha20=e.chacha20=e.chacha20orig=void 0,e.hchacha=n,e.chacha20orig=(0,rg.createCipher)(t,{counterRight:!1,counterLength:8,allowShortKeys:!0}),e.chacha20=(0,rg.createCipher)(t,{counterRight:!1,counterLength:4,allowShortKeys:!1}),e.xchacha20=(0,rg.createCipher)(t,{counterRight:!1,counterLength:8,extendNonceFn:n,allowShortKeys:!1}),e.chacha8=(0,rg.createCipher)(t,{counterRight:!1,counterLength:4,rounds:8}),e.chacha12=(0,rg.createCipher)(t,{counterRight:!1,counterLength:4,rounds:12});let r=new Uint8Array(16),i=(e,t)=>{e.update(t);let n=t.length%16;n&&e.update(r.subarray(n))},o=new Uint8Array(32);function a(e,t,n,r,a){let s=e(t,n,o),l=rA.poly1305.create(s);a&&i(l,a),i(l,r);let c=new Uint8Array(16),d=(0,es.createView)(c);(0,es.setBigUint64)(d,0,BigInt(a?a.length:0),!0),(0,es.setBigUint64)(d,8,BigInt(r.length),!0),l.update(c);let u=l.digest();return(0,es.clean)(s,c),u}e._poly1305_aead=e=>(t,n,r)=>((0,el.bytes)(t,32),(0,el.bytes)(n),{encrypt(i,o){let s=i.length,l=s+16;o?(0,el.bytes)(o,l):o=new Uint8Array(l),e(t,n,i,o,1);let c=a(e,t,n,o.subarray(0,-16),r);return o.set(c,s),(0,es.clean)(c),o},decrypt(i,o){let s=i.length,l=s-16;if(s<16)throw Error("encrypted data must be at least 16 bytes");o?(0,el.bytes)(o,l):o=new Uint8Array(l);let c=i.subarray(0,-16),d=i.subarray(-16),u=a(e,t,n,c,r);if(!(0,es.equalBytes)(d,u))throw Error("invalid tag");return e(t,n,c,o,1),(0,es.clean)(u),o}}),e.chacha20poly1305=(0,es.wrapCipher)({blockSize:64,nonceLength:12,tagLength:16},(0,e._poly1305_aead)(e.chacha20)),e.xchacha20poly1305=(0,es.wrapCipher)({blockSize:64,nonceLength:24,tagLength:16},(0,e._poly1305_aead)(e.xchacha20))}(rp),Object.defineProperty(rf,"__esModule",{value:!0}),rf.xchacha20=void 0,rf.xchacha20=function(e,t,n){return(0,rp.xchacha20poly1305)(e,t,n)},function(e){function t(e,t,n,r){var i=(0,em.symmetricAlgorithm)();if("aes-256-gcm"===i)return e(nN.aes256gcm,t,n,(0,em.symmetricNonceLength)(),ey.AEAD_TAG_LENGTH,r);if("xchacha20"===i)return e(rf.xchacha20,t,n,ey.XCHACHA20_NONCE_LENGTH,ey.AEAD_TAG_LENGTH,r);if("aes-256-cbc"===i)return e(nN.aes256cbc,t,n,16,0);throw Error("Not implemented")}function n(e,t,n,r,i,o){var a=(0,eC.randomBytes)(r),s=e(t,a,o).encrypt
1(n);if(0===i)return(0,es.concatBytes)(a,s);var l=s.length-i,c=s.subarray(0,l),d=s.subarray(l);return(0,es.concatBytes)(a,d,c)}function r(e,t,n,r,i,o){var a=n.subarray(0,r),s=e(t,Uint8Array.from(a),o),l=n.subarray(r);if(0===i)return s.decrypt(l);var c=l.subarray(0,i),d=l.subarray(i);return s.decrypt((0,es.concatBytes)(d,c))}Object.defineProperty(e,"__esModule",{value:!0}),e.aesDecrypt=e.aesEncrypt=e.symDecrypt=e.symEncrypt=void 0,e.symEncrypt=function(e,r,i){return t(n,e,r,i)},e.symDecrypt=function(e,n,i){return t(r,e,n,i)},e.aesEncrypt=e.symEncrypt,e.aesDecrypt=e.symDecrypt}(nT),i$=er&&er.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),iB=er&&er.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i$(t,e,n)},Object.defineProperty(eE,"__esModule",{value:!0}),iB(ew,eE),iB(nA,eE),iB(nM,eE),iB(nT,eE);var rP={};Object.defineProperty(rP,"__esModule",{value:!0}),rP.PublicKey=void 0,rP.PublicKey=function(){function e(e){this.data=(0,eE.convertPublicKeyFormat)(e,!0)}return e.fromHex=function(t){return new e((0,eE.hexToPublicKey)(t))},Object.defineProperty(e.prototype,"uncompressed",{get:function(){return A.from((0,eE.convertPublicKeyFormat)(this.data,!1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"compressed",{get:function(){return A.from(this.data)},enumerable:!1,configurable:!0}),e.prototype.toHex=function(e){return void 0===e&&(e=!0),(0,es.bytesToHex)(e?this.data:this.uncompressed)},e.prototype.decapsulate=function(e,t){void 0===t&&(t=!1);var n=t?this.data:this.uncompressed,r=e.multiply(this,t);return(0,eE.getSharedKey)(n,r)},e.prototype.equals=function(e){return(0,es.equalBytes)(this.data,e.data)},e}(),Object.defineProperty(eb,"__esModule",{value:!0}),eb.PrivateKey=void 0,eb.PrivateKey=function(){function e(e){if(void 0===e)this.data=(0,eE.getValidSecret)();else{if(!(0,eE.isValidPrivateKey)(e))throw Error("Invalid private key");this.data=e}this.publicKey=new rP.PublicKey((0,eE.getPublicKey)(this.data))}return e.fromHex=function(t){return new e((0,eE.decodeHex)(t))},Object.defineProperty(e.prototype,"secret",{get:function(){return A.from(this.data)},enumerable:!1,configurable:!0}),e.prototype.toHex=function(){return(0,es.bytesToHex)(this.data)},e.prototype.encapsulate=function(e,t){void 0===t&&(t=!1);var n=t?this.publicKey.compressed:this.publicKey.uncompressed,r=this.multiply(e,t);return(0,eE.getSharedKey)(n,r)},e.prototype.multiply=function(e,t){return void 0===t&&(t=!1),(0,eE.getSharedPoint)(this.data,e.compressed,t)},e.prototype.equals=function(e){return(0,es.equalBytes)(this.data,e.data)},e}(),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.PrivateKey=void 0,Object.defineProperty(e,"PrivateKey",{enumerable:!0,get:function(){return eb.PrivateKey}}),Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return rP.PublicKey}})}(ev),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.PublicKey=e.PrivateKey=e.ECIES_CONFIG=void 0,e.encrypt=function(e,o){var a=new r.PrivateKey,s=e instanceof Uint8Array?new r.PublicKey(e):r.PublicKey.fromHex(e),l=a.encapsulate(s,(0,n.isHkdfKeyCompressed)()),c=(0,n.isEphemeralKeyCompressed)()?a.publicKey.compressed:a.publicKey.uncompressed,d=(0,i.symEncrypt)(l,o);return A.from((0,t.concatBytes)(c,d))},e.decrypt=function(e,t){var o=e instanceof Uint8Array?new r.PrivateKey(e):r.PrivateKey.fromHex(e),a=(0,n.ephemeralKeySize)(),s=new r.PublicKey(t.subarray(0,a)),l=t.subarray(a),c=s.decapsulate(o,(0,n.isHkdfKeyCompressed)());return A.from((0,i.symDecrypt)(c,l))};var t=es,n=em,r=ev,i=eE;Object.defineProperty(e,"ECIES_CONFIG",{enumerable:!0,get:function(){return em.ECIES_CONFIG}}),Object.defineProperty(e,"PrivateKey",{enumerable:!0,get:function(){return ev.PrivateKey}}),Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return ev.PublicKey}}),e.utils={aesEncrypt:i.aesEncrypt,aesDecrypt:i.aesDecrypt,symEncrypt:i.symEncrypt,symDecrypt:i.symDecrypt,decodeHex:i.decodeHex,getValidSecret:i.getValidSecret,remove0x:i.remove0x}}(ea);let rO=s()("KeyExchange:Layer"),rT=s()("SocketService:Layer"),rN=s()("Ecies:Layer"),rD=s()("RemoteCommunication:Layer");rO.color="##95c44e",rT.color="#f638d7",rN.color="#465b9c",rD.color="#47a2be";let r$={KeyExchange:rO,SocketService:rT,Ecies:rN,RemoteCommunication:rD},rB,rK=[],rj=[],rU=(e,t)=>f(void 0,void 0,void 0,function*(){rB=t,rj.push(e),(function(e){return f(this,void 0,void 0,function*(){if(!rB||!e)return;let t=rj;rj=rK,rK=t;let n=rB.endsWith("/")?`${rB}evt`:`${rB}/evt`,r=Object.assign({},e);if(delete r.params,e.params)for(let[t,n]of Object.entries(e.params))r[t]=n;let i=JSON.stringify(r);r$.RemoteCommunication(`[sendBufferedEvents] Sending ${rK.length} analytics events to ${n}`);try{let e=yield o()(n,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:i}),t=yield e.text();r$.RemoteCommunication(`[sendBufferedEvents] Response: ${t}`),rK.length=0}catch(e){}})})(e).catch(()=>{})});class rH{constructor(e){this.enabled=!0,(null==e?void 0:e.debug)&&s().enable("Ecies:Layer"),this.ecies=(null==e?void 0:e.privateKey)?ea.PrivateKey.fromHex(e.privateKey):new ea.PrivateKey,r$.Ecies("[ECIES constructor()] initialized secret: ",this.ecies.toHex()),r$.Ecies("[ECIES constructor()] initialized public: ",this.ecies.publicKey.toHex()),r$.Ecies("[ECIES constructor()] init with",this)}generateECIES(){this.ecies=new ea.PrivateKey}getPublicKey(){return this.ecies.publicKey.toHex()}encrypt(e,t){let n=e;if(this.enabled)try{r$.Ecies("[ECIES: encrypt()] using otherPublicKey",t);
1let r=A.from(e),i=ea.encrypt(t,r);n=A.from(i).toString("base64")}catch(n){throw r$.Ecies("[ECIES: encrypt()] error encrypt:",n),r$.Ecies("[ECIES: encrypt()] private: ",this.ecies.toHex()),r$.Ecies("[ECIES: encrypt()] data: ",e),r$.Ecies("[ECIES: encrypt()] otherkey: ",t),n}return n}decrypt(e){let t=e;if(this.enabled)try{r$.Ecies("[ECIES: decrypt()] using privateKey",this.ecies.toHex());let n=A.from(e.toString(),"base64");t=ea.decrypt(this.ecies.toHex(),n).toString()}catch(t){throw r$.Ecies("[ECIES: decrypt()] error decrypt",t),r$.Ecies("[ECIES: decrypt()] private: ",this.ecies.toHex()),r$.Ecies("[ECIES: decrypt()] encryptedData: ",e),t}return t}getKeyInfo(){return{private:this.ecies.toHex(),public:this.ecies.publicKey.toHex()}}toString(){r$.Ecies("[ECIES: toString()]",this.getKeyInfo())}}var rF={version:"0.32.0"};let rz="https://metamask-sdk.api.cx.metamask.io/",rq=["websocket"],rW={ETH_REQUESTACCOUNTS:"eth_requestAccounts"};function rV(e){let{context:t}=e;r$.RemoteCommunication(`[RemoteCommunication: clean()] context=${t}`),e.channelConfig=void 0,e.ready=!1,e.originatorConnectStarted=!1}(iq=iK||(iK={})).DISCONNECTED="disconnected",iq.WAITING="waiting",iq.TIMEOUT="timeout",iq.LINKED="linked",iq.PAUSED="paused",iq.TERMINATED="terminated",function(e){e.KEY_INFO="key_info",e.SERVICE_STATUS="service_status",e.PROVIDER_UPDATE="provider_update",e.RPC_UPDATE="rpc_update",e.KEYS_EXCHANGED="keys_exchanged",e.JOIN_CHANNEL="join_channel",e.PUBLIC_KEY="public_key",e.CHANNEL_CREATED="channel_created",e.CLIENTS_CONNECTED="clients_connected",e.CLIENTS_DISCONNECTED="clients_disconnected",e.CLIENTS_WAITING="clients_w
1aiting",e.CLIENTS_READY="clients_ready",e.REJECTED="rejected",e.WALLET_INIT="wallet_init",e.CHANNEL_PERSISTENCE="channel_persistence",e.CONFIG="config",e.MESSAGE_ACK="ack",e.SOCKET_DISCONNECTED="socket_disconnected",e.SOCKET_RECONNECT="socket_reconnect",e.OTP="otp",e.SDK_RPC_CALL="sdk_rpc_call",e.AUTHORIZED="authorized",e.CONNECTION_STATUS="connection_status",e.MESSAGE="message",e.TERMINATE="terminate"}(ij||(ij={})),(iU||(iU={})).KEY_EXCHANGE="key_exchange",function(e){e.KEY_HANDSHAKE_START="key_handshake_start",e.KEY_HANDSHAKE_CHECK="key_handshake_check",e.KEY_HANDSHAKE_SYN="key_handshake_SYN",e.KEY_HANDSHAKE_SYNACK="key_handshake_SYNACK",e.KEY_HANDSHAKE_ACK="key_handshake_ACK",e.KEY_HANDSHAKE_WALLET="key_handshake_wallet",e.KEY_HANDSHAKE_NONE="none"}(iH||(iH={}));class rG extends l.EventEmitter2{constructor({communicationLayer:e,otherPublicKey:t,context:n,ecies:r,logging:i}){super(),this.keysExchanged=!1,this.step=iH.KEY_HANDSHAKE_NONE,this.debug=!1,this.context=n,this.communicationLayer=e,(null==r?void 0:r.privateKey)&&t&&(r$.KeyExchange(`[KeyExchange: constructor()] otherPubKey=${t} set keysExchanged to true!`,r),this.keysExchanged=!0),this.myECIES=new rH(Object.assign(Object.assign({},r),{debug:null==i?void 0:i.eciesLayer})),this.communicationLayer.state.eciesInstance=this.myECIES,this.myPublicKey=this.myECIES.getPublicKey(),this.debug=!0===(null==i?void 0:i.keyExchangeLayer),t&&this.setOtherPublicKey(t),this.communicationLayer.on(iU.KEY_EXCHANGE,this.onKeyExchangeMessage.bind(this))}onKeyExchangeMessage(e){let{relayPersistence:t}=this.communicationLayer.remote.state;if(r$.KeyExchange(`[KeyExchange: onKeyExchangeMessage()] context=${this.context} keysExchanged=${this.keysExchanged} relayPersistence=${t}`,e),t)return void r$.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Ignoring key exchange message because relay persistence is activated");let{message:n}=e;this.keysExchanged&&r$.KeyExchange(`[KeyExchange: onKeyExchangeMessage()] context=${this.context} received handshake while already exchanged. step=${this.step} otherPubKey=${this.otherPublicKey}`),this.emit(ij.KEY_INFO,n.type),n.type===iH.KEY_HANDSHAKE_SYN?(this.checkStep([iH.KEY_HANDSHAKE_NONE,iH.KEY_HANDSHAKE_ACK]),r$.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_SYN",n),n.pubkey&&this.setOtherPublicKey(n.pubkey),this.communicationLayer.sendMessage({type:iH.KEY_HANDSHAKE_SYNACK,pubkey:this.myPublicKey}).catch(e=>{r$.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Error sending KEY_HANDSHAKE_SYNACK",e)}),this.setStep(iH.KEY_HANDSHAKE_ACK)):n.type===iH.KEY_HANDSHAKE_SYNACK?(this.checkStep([iH.KEY_HANDSHAKE_SYNACK,iH.KEY_HANDSHAKE_ACK,iH.KEY_HANDSHAKE_NONE]),r$.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_SYNACK"),n.pubkey&&this.setOtherPublicKey(n.pubkey),this.communicationLayer.sendMessage({type:iH.KEY_HANDSHAKE_ACK}).catch(e=>{r$.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Error sending KEY_HANDSHAKE_ACK",e)}),this.keysExchanged=!0,this.setStep(iH.KEY_HANDSHAKE_ACK),this.emit(ij.KEYS_EXCHANGED)):n.type===iH.KEY_HANDSHAKE_ACK&&(r$.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_ACK set keysExchanged to true!"),this.checkStep([iH.KEY_HANDSHAKE_ACK,iH.KEY_HANDSHAKE_NONE]),this.keysExchanged=!0,this.setStep(iH.KEY_HANDSHAKE_ACK),this.emit(ij.KEYS_EXCHANGED))}resetKeys(e){this.clean(),this.myECIES=new rH(e)}clean(){r$.KeyExchange(`[KeyExchange: clean()] context=${this.context} reset handshake state`),this.setStep(iH.KEY_HANDSHAKE_NONE),this.emit(ij.KEY_INFO,this.step),this.keysExchanged=!1}start({isOriginator:e,force:t}){let{relayPersistence:n,protocolVersion:r}=this.communicationLayer.remote.state;n?r$.KeyExchange("[KeyExchange: start()] Ignoring key exchange message because relay persistence is activated"):(r$.KeyExchange(`[KeyExchange: start()] context=${this.context} protocolVersion=${r} isOriginator=${e} step=${this.step} force=${t} relayPersistence=${n} keysExchanged=${this.keysExchanged}`),e?!(this.keysExchanged||this.step!==iH.KEY_HANDSHAKE_NONE&&this.step!==iH.KEY_HANDSHAKE_SYNACK)||t?(r$.KeyExchange(`[KeyExchange: start()] context=${this.context} -- start key exchange (force=${t}) -- step=${this.step}`,this.step),this.clean(),this.setStep(iH.KEY_HANDSHAKE_SYNACK),this.communicationLayer.sendMessage({type:iH.KEY_HANDSHAKE_SYN,pubkey:this.myPublicKey,v:2}).catch(e=>{r$.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_SYN",e)})):r$.KeyExchange(`[KeyExchange: start()] context=${this.context} -- key exchange already ${this.keysExchanged?"done":"in progress"} -- aborted.`,this.step):this.keysExchanged&&!0!==t?r$.KeyExchange("[KeyExchange: start()] don't send KEY_HANDSHAKE_START -- exchange already done."):r>=2?this.communicationLayer.sendMessage({type:iH.KEY_HANDSHAKE_SYNACK,pubkey:this.myPublicKey,v:2}).catch(e=>{r$.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_SYNACK",e)}):(this.communicationLayer.sendMessage({type:iH.KEY_HANDSHAKE_START}).catch(e=>{r$.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_START",e)}),this.clean()))}
1setStep(e){this.step=e,this.emit(ij.KEY_INFO,e)}checkStep(e){e.length>0&&e.indexOf(this.step.toString())}setRelayPersistence({localKey:e,otherKey:t}){this.otherPublicKey=t,this.myECIES=new rH({privateKey:e,debug:this.debug}),this.keysExchanged=!0}setKeysExchanged(e){this.keysExchanged=e}areKeysExchanged(){return this.keysExchanged}getMyPublicKey(){return this.myPublicKey}getOtherPublicKey(){return this.otherPublicKey}setOtherPublicKey(e){r$.KeyExchange("[KeyExchange: setOtherPubKey()]",e),this.otherPublicKey=e}encryptMessage(e){if(!this.otherPublicKey)throw Error("encryptMessage: Keys not exchanged - missing otherPubKey");return this.myECIES.encrypt(e,this.otherPublicKey)}decryptMessage(e){if(!this.otherPublicKey)throw Error("decryptMessage: Keys not exchanged - missing otherPubKey");return this.myECIES.decrypt(e)}getKeyInfo(){return{ecies:Object.assign(Object.assign({},this.myECIES.getKeyInfo()),{otherPubKey:this.otherPublicKey}),step:this.step,keysExchanged:this.areKeysExchanged()}}toString(){return JSON.stringify({keyInfo:this.getKeyInfo(),keysExchanged:this.keysExchanged,step:this.step})}}!function(e){e.TERMINATE="terminate",e.ANSWER="answer",e.OFFER="offer",e.CANDIDATE="candidate",e.JSONRPC="jsonrpc",e.WALLET_INFO="wallet_info",e.WALLET_INIT="wallet_init",e.ORIGINATOR_INFO="originator_info",e.PAUSE="pause",e.OTP="otp",e.AUTHORIZED="authorized",e.PING="ping",e.READY="ready"}(iF||(iF={})),function(e){e.REQUEST="sdk_connect_request_started",e.REQUEST_MOBILE="sdk_connect_request_started_mobile",e.RECONNECT="sdk_reconnect_request_started",e.CONNECTED="sdk_connection_established",e.CONNECTED_MOBILE="sdk_connection_established_mobile",e.AUTHORIZED="sdk_connection_authorized",e.REJECTED="sdk_connection_rejected",e.TERMINATED="sdk_connection_terminated",e.DISCONNECTED="sdk_disconnected",e.SDK_USE_EXTENSION="sdk_use_extension",e.SDK_RPC_REQUEST="sdk_rpc_request",e.SDK_RPC_REQUEST_RECEIVED="sdk_rpc_request_received",e.SDK_RPC_REQUEST_DONE="sdk_rpc_request_done",e.SDK_EXTENSION_UTILIZED="sdk_extension_utilized",e.SDK_USE_INAPP_BROWSER="sdk_use_inapp_browser"}(iz||(iz={}));let rZ=(e,t,n)=>f(void 0,void 0,void 0,function*(){var r,i,o,a,s,l;let{remote:c,state:d}=e,{channelId:u,isOriginator:h}=d;if("error_terminated"===t)return r$.SocketService(`handleJoinChannelResults: Channel ${u} terminated`),void e.emit(ij.TERMINATE);if(!n)return void r$.SocketService(`handleJoinChannelResults: No result for channel ${u}`);let{persistence:f,walletKey:p,rejected:g}=n;if(r$.SocketService(`handleJoinChannelResults: Channel ${u} persistence=${f} walletKey=${p} rejected=${g}`),g)return r$.SocketService(`handleJoinChannelResults: Channel ${u} rejected`),yield e.remote.disconnect({terminate:!0}),e.remote.emit(ij.REJECTED,{channelId:u}),void e.remote.emitServiceStatusEvent();if(p&&!(null===(r=c.state.channelConfig)||void 0===r?void 0:r.otherKey)){e.getKeyExchange().setOtherPublicKey(p),null===(i=e.state.keyExchange)||void 0===i||i.setKeysExchanged(!0),c.state.ready=!0,c.state.authorized=!0,c.emit(ij.AUTHORIZED);let{communicationLayer:t,storageManager:n}=c.state,r=Object.assign(Object.assign({},c.state.channelConfig),{channelId:null!==(o=c.state.channelId)&&void 0!==o?o:"",validUntil:Date.now()+6048e5,localKey:null==t?void 0:t.getKeyInfo().ecies.private,otherKey:p});e.sendMessage({type:iH.KEY_HANDSHAKE_ACK}).catch(e=>{}),null===(a=e.state.socket)||void 0===a||a.emit(iF.PING,{id:u,clientType:h?"dapp":"wallet",context:"on_channel_reconnect",message:""}),yield null==n?void 0:n.persistChannelConfig(r),c.emitServiceStatusEvent(),c.setConnectionStatus(iK.LINKED)}f&&(e.emit(ij.CHANNEL_PERSISTENCE),null===(s=e.state.keyExchange)||void 0===s||s.setKeysExchanged(!0),c.state.ready=!0,c.state.authorized=!0,c.emit(ij.AUTHORIZED),rU(Object.assign(Object.assign({id:null!=u?u:"",event:h?iz.CONNECTED:iz.CONNECTED_MOBILE},e.remote.state.originatorInfo),{sdkVersion:e.remote.state.sdkVersion,commLayer:e.state.communicationLayerPreference,commLayerVersion:rF.version,walletVersion:null===(l=e.remote.state.walletInfo)||void 0===l?void 0:l.version}),d.communicationServerUrl).catch(e=>{}))}),rY=e=>new Promise(t=>{setTimeout(t,e)}),rJ=(e,t,...n)=>f(void 0,[e,t,...n],void 0,function*(e,t,n=200){let r,i=Date.now(),o=!1;for(;!o;){if(o=Date.now()-i>3e5,void 0!==(r=t[e]).elapsedTime)return r;yield rY(n)}throw Error(`RPC ${e} timed out`)}),rX=e=>f(void 0,void 0,void 0,function*(){let{state:t}=e,{socket:n,channelId:r,context:i,isOriginator:o,isReconnecting:a}=t;if(a)return r$.SocketService("[SocketService: reconnectSocket()] Reconnection already in progress, skipping",e),!1;if(!n)return r$.SocketService("[SocketService: reconnectSocket()] socket is not defined",e),!1;if(!r)return!1;let{connected:s}=n;t.isReconnecting=!0,t.reconnectionAttempts=0,r$.SocketService(`[SocketService: reconnectSocket()] connected=${s}
1 trying to reconnect after socketio disconnection`,e);try{for(;3>t.reconnectionAttempts;){if(r$.SocketService(`[SocketService: reconnectSocket()] Attempt ${t.reconnectionAttempts+1} of 3`,e),yield rY(200),n.connected)return r$.SocketService("Socket already connected --- ping to retrieve messages"),n.emit(iF.PING,{id:r,clientType:o?"dapp":"wallet",context:"on_channel_config",message:""}),!0;t.resumed=!0,n.connect(),e.emit(ij.SOCKET_RECONNECT);try{if(yield new Promise((t,a)=>{n.emit(ij.JOIN_CHANNEL,{channelId:r,context:`${i}connect_again`,clientType:o?"dapp":"wallet"},(n,r)=>f(void 0,void 0,void 0,function*(){try{yield rZ(e,n,r),t()}catch(e){a(e)}}))}),yield rY(100),n.connected)return r$.SocketService(`Reconnection successful on attempt ${t.reconnectionAttempts+1}`),!0}catch(e){r$.SocketService(`Error during reconnection attempt ${t.reconnectionAttempts+1}:`,e)}t.reconnectionAttempts+=1,3>t.reconnectionAttempts&&(yield rY(200))}return r$.SocketService("Failed to reconnect after 3 attempts"),!1}finally{t.isReconnecting=!1,t.reconnectionAttempts=0}});function rQ(e,t){return f(this,void 0,void 0,function*(){var n;let r=null===(n=e.state.keyExchange)||void 0===n?void 0:n.encryptMessage(JSON.stringify(t)),i={id:e.state.channelId,context:e.state.context,clientType:e.state.isOriginator?"dapp":"wallet",message:r,plaintext:e.state.hasPlaintext?JSON.stringify(t):void 0};return r$.SocketService(`[SocketService: encryptAndSendMessage()] context=${e.state.context}`,i),t.type===iF.TERMINATE&&(e.state.manualDisconnect=!0),new Promise((t,n)=>{var r;null===(r=e.state.socket)||void 0===r||r.emit(ij.MESSAGE,i,(e,r)=>{var i;e&&(r$.SocketService(`[SocketService: encryptAndSendMessage()] error=${e}`),n(e)),r$.SocketService("[encryptAndSendMessage] response",r),t(null!==(i=null==r?void 0:r.success)&&void 0!==i&&i)})})})}!function(e){e.RPC_CHECK="rpcCheck",e.SKIPPED_RPC="skippedRpc"}(iW||(iW={}));let r0=["eth_sendTransaction","eth_signTypedData","eth_signTransaction","personal_sign","wallet_requestPermissions","wallet_switchEthereumChain","eth_signTypedData_v3","eth_signTypedData_v4","metamask_connectSign","metamask_connectWith","metamask_batch"].map(e=>e.toLowerCase()),r1=[{event:ij.CLIENTS_CONNECTED,handler:function(e,t){return n=>f(this,void 0,void 0,function*(){var n,r,i,o,a,s,l,c,d,u,h;let f=null!==(r=null===(n=e.remote.state.channelConfig)||void 0===n?void 0:n.relayPersistence)&&void 0!==r&&r;if(r$.SocketService(`[SocketService: handleClientsConnected()] context=${e.state.context} on 'clients_connected-${t}' relayPersistence=${f} resumed=${e.state.resumed}  clientsPaused=${e.state.clientsPaused} keysExchanged=${null===(i=e.state.keyExchange)||void 0===i?void 0:i.areKeysExchanged()} isOriginator=${e.state.isOriginator}`),e.emit(ij.CLIENTS_CONNECTED,{isOriginator:e.state.isOriginator,keysExchanged:null===(o=e.state.keyExchange)||void 0===o?void 0:o.areKeysExchanged(),context:e.state.context}),e.state.resumed)e.state.isOriginator||(r$.SocketService(`[SocketService: handleClientsConnected()] context=${e.state.context} 'clients_connected' / keysExchanged=${null===(a=e.state.keyExchange)||void 0===a?void 0:a.areKeysExchanged()} -- backward compatibility`),null===(s=e.state.keyExchange)||void 0===s||s.start({isOriginator:null!==(l=e.state.isOriginator)&&void 0!==l&&l})),e.state.resumed=!1;else if(e.state.clientsPaused)r$.SocketService("[SocketService: handleClientsConnected()] 'clients_connected' skip sending originatorInfo on pause");else if(!e.state.isOriginator){let t=!f;r$.SocketService(`[SocketService: handleClientsConnected()] context=${e.state.context} on 'clients_connected' / keysExchanged=${null===(c=e.state.keyExchange)||void 0===c?void 0:c.areKeysExchanged()} -- force=${t} -- backward compatibility`),r$.SocketService(`[SocketService: handleClientsConnected()] context=${e.state.context} on 'clients_connected' / keysExchanged=${null===(d=e.state.keyExchange)||void 0===d?void 0:d.areKeysExchanged()} -- force=${t} -- backward compatibility`),null===(u=e.state.keyExchange)||void 0===u||u.start({isOriginator:null!==(h=e.state.isOriginator)&&void 0!==h&&h,force:t})}e.state.clientsConnected=!0,e.state.clientsPaused=!1})}},{event:ij.CHANNEL_CREATED,handler:function(e,t){return n=>{r$.SocketService(`[SocketService: handleChannelCreated()] context=${e.state.context} on 'channel_created-${t}'`,n),e.emit(ij.CHANNEL_CREATED,n)}}},{event:ij.CLIENTS_DISCONNECTED,handler:function(e,t){return()=>{var n;e.state.clientsConnected=!1,r$.SocketService(`[SocketService: handlesClientsDisconnected()] context=${e.state.context} on 'clients_disconnected-${t}'`),e.remote.state.relayPersistence?r$.SocketService(`[SocketService: handlesClientsDisconnected()] context=${e.state.context} on 'clients_disconnected-${t}' - relayPersistence enabled, skipping key exchange cleanup.`):(e.state.isOriginator&&!e.state.clientsPaused&&(null===(n=e.state.keyExchange)||void 0===n||n.clean()),e.emit(ij.CLIENTS_DISCONNECTED,t))}}},{event:ij.CONFIG,handler:function(e,t){return n=>f(this,void 0,void 0,function*(){var r,i,o;r$.SocketService(`[SocketService: handleChannelConfig()] update relayPersistence on 'config-${t}'`,n);let{persistence:a,walletKey:s}=n;e.state.isOriginator&&e.remote.state.channelConfig?(n.walletKey&&!e.remote.state.channelConfig.otherKey&&(r$.SocketService(`Setting wallet key ${s}`),e.remote.state.channelConfig.otherKey=s,e.getKeyExchange().setOtherPublicKey(n.walletKey),null===(r=e.state.keyExchange)||void 0===r||r.setKeysExchanged(!0),yield e.remote.sendMessage({type:iH.KEY_HANDSHAKE_ACK}),yield e.remote.sendMessage({type:iF.PING}),yield null===(i=e.remote.state.storageManager)||void 0===i?void 0:i.persist
1ChannelConfig(e.remote.state.channelConfig)),!0!==a||e.remote.state.channelConfig.relayPersistence||(r$.SocketService(`Setting relay persistence ${a}`),e.remote.state.channelConfig.relayPersistence=a,e.remote.state.relayPersistence=!0,e.remote.emit(ij.CHANNEL_PERSISTENCE),e.remote.state.authorized=!0,e.remote.state.ready=!0,e.remote.emit(ij.AUTHORIZED),yield null===(o=e.remote.state.storageManager)||void 0===o?void 0:o.persistChannelConfig(e.remote.state.channelConfig))):e.state.isOriginator||n.persistence&&(e.remote.state.relayPersistence=!0,e.remote.emit(ij.CHANNEL_PERSISTENCE))})}},{event:ij.MESSAGE,handler:function(e,t){return n=>{var r,i,o,a,s,l,c,d,u,h,f,p,g,m,y,v,b,E;let{ackId:w,message:C,error:S}=n,_=null!==(r=e.remote.state.relayPersistence)&&void 0!==r&&r;if(r$.SocketService(`[SocketService handleMessage()]  relayPersistence=${_}  context=${e.state.context} on 'message' ${t} keysExchanged=${null===(i=e.state.keyExchange)||void 0===i?void 0:i.areKeysExchanged()}`,n),S)throw r$.SocketService(`
2      [SocketService handleMessage()] context=${e.state.context}::on 'message' error=${S}`),Error(S);let x="string"==typeof C;if(!x&&(null==C?void 0:C.type)===iH.KEY_HANDSHAKE_START){if(_)return;return r$.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' received HANDSHAKE_START isOriginator=${e.state.isOriginator}`,C),void(null===(o=e.state.keyExchange)||void 0===o||o.start({isOriginator:null!==(a=e.state.isOriginator)&&void 0!==a&&a,force:!0}))}if(!x&&(null===(s=null==C?void 0:C.type)||void 0===s?void 0:s.startsWith("key_handshake"))){if(_)return;return r$.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' emit KEY_EXCHANGE`,C),void e.emit(iU.KEY_EXCHANGE,{message:C,context:e.state.context})}if(!x||(null===(l=e.state.keyExchange)||void 0===l?void 0:l.areKeysExchanged())){if(!x&&(null==C?void 0:C.type))return void e.emit(ij.MESSAGE,C)}else{let t=!1;try{r$.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' trying to decrypt message`),null===(c=e.state.keyExchange)||void 0===c||c.decryptMessage(C),t=!0}catch(t){r$.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' error`,t)}if(!t)return e.state.isOriginator?null===(u=e.state.keyExchange)||void 0===u||u.start({isOriginator:null!==(h=e.state.isOriginator)&&void 0!==h&&h}):e.sendMessage({type:iH.KEY_HANDSHAKE_START}).catch(e=>{}),void r$.SocketService(`Message ignored because invalid key exchange status. step=${null===(f=e.state.keyExchange)||void 0===f?void 0:f.getKeyInfo().step}`,null===(p=e.state.keyExchange)||void 0===p?void 0:p.getKeyInfo(),C);r$.SocketService("Invalid key exchange status detected --- updating it."),null===(d=e.state.keyExchange)||void 0===d||d.setKeysExchanged(!0)}if(!x)return void e.emit(ij.MESSAGE,C);let k=null===(g=e.state.keyExchange)||void 0===g?void 0:g.decryptMessage(C),M=JSON.parse(null!=k?k:"{}");if(w&&(null==w?void 0:w.length)>0&&(r$.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' ackid=${w} channelId=${t}`),null===(m=e.state.socket)||void 0===m||m.emit(ij.MESSAGE_ACK,{ackId:w,channelId:t,clientType:e.state.isOriginator?"dapp":"wallet"})),e.state.clientsPaused=(null==M?void 0:M.type)===iF.PAUSE,e.state.isOriginator&&M.data){let t=M.data,n=e.state.rpcMethodTracker[t.id];if(n){let r=Date.now()-n.timestamp;r$.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' received answer for id=${t.id} method=${n.method} responseTime=${r}`,M),e.remote.state.analytics&&r0.includes(n.method.toLowerCase())&&rU(Object.assign(Object.assign({id:null!==(y=e.remote.state.channelId)&&void 0!==y?y:"",event:iz.SDK_RPC_REQUEST_DONE,sdkVersion:e.remote.state.sdkVersion,commLayerVersion:rF.version},e.remote.state.originatorInfo),{walletVersion:null===(v=e.remote.state.walletInfo)||void 0===v?void 0:v.version,params:{method:n.method,from:"mobile"}}),e.remote.state.communicationServerUrl).catch(e=>{});let i=Object.assign(Object.assign({},n),{result:t.result,error:t.error?{code:null===(b=t.error)||void 0===b?void 0:b.code,message:null===(E=t.error)||void 0===E?void 0:E.message}:void 0,elapsedTime:r});
2e.state.rpcMethodTracker[t.id]=i,e.emit(ij.RPC_UPDATE,i)}}e.emit(ij.MESSAGE,{message:M})}}},{event:ij.REJECTED,handler:function(e,t){return n=>f(this,void 0,void 0,function*(){var n;e.state.isOriginator&&!e.remote.state.ready?(r$.SocketService(`[SocketService: handleChannelRejected()] context=${e.state.context} channelId=${t} isOriginator=${e.state.isOriginator} ready=${e.remote.state.ready}`,e.remote.state.originatorInfo),rU(Object.assign(Object.assign({id:t,event:iz.REJECTED},e.remote.state.originatorInfo),{sdkVersion:e.remote.state.sdkVersion,commLayer:e.state.communicationLayerPreference,commLayerVersion:rF.version,walletVersion:null===(n=e.remote.state.walletInfo)||void 0===n?void 0:n.version}),e.remote.state.communicationServerUrl).catch(e=>{}),yield e.remote.disconnect({terminate:!0}),e.remote.emit(ij.REJECTED,{channelId:t}),e.remote.setConnectionStatus(iK.DISCONNECTED)):r$.SocketService(`[SocketService: handleChannelRejected()] SKIP -- channelId=${t} isOriginator=${e.state.isOriginator} ready=${e.remote.state.ready}`)})}}
2,{event:"clients_waiting_to_join",handler:function(e,t){return n=>{r$.SocketService(`[SocketService: handleClientsWaitingToJoin()] context=${e.state.context} on 'clients_waiting_to_join-${t}'`,n),e.emit(ij.CLIENTS_WAITING,n)}}}],r2=[{event:ij.KEY_INFO,handler:function(e){return t=>{r$.SocketService("[SocketService: handleKeyInfo()] on 'KEY_INFO'",t),e.emit(ij.KEY_INFO,t)}}},{event:ij.KEYS_EXCHANGED,handler:function(e){return()=>{var t,n,r;r$.SocketService(`[SocketService: handleKeysExchanged()] on 'keys_exchanged' keyschanged=${null===(t=e.state.keyExchange)||void 0===t?void 0:t.areKeysExchanged()}`);let{channelConfig:i}=e.remote.state;if(i){let t=e.getKeyExchange().getKeyInfo().ecies;i.localKey=t.private,i.otherKey=t.otherPubKey,e.remote.state.channelConfig=i,null===(n=e.remote.state.storageManager)||void 0===n||n.persistChannelConfig(i).catch(e=>{})}e.emit(ij.KEYS_EXCHANGED,{keysExchanged:null===(r=e.state.keyExchange)||void 0===r?void 0:r.areKeysExchanged(),isOriginator:e.state.isOriginator});let o={keyInfo:e.getKeyInfo()};e.emit(ij.SERVICE_STATUS,o)}}}];function r3(e,t){r$.SocketService(`[SocketService: setupChannelListener()] context=${e.state.context} setting socket listeners for channel ${t}...`);let{socket:n}=e.state,{keyExchange:r}=e.state;n&&e.state.isOriginator&&(e.state.debug&&(null==n||n.io.on("error",t=>{r$.SocketService(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=error`,t)}),null==n||n.io.on("reconnect",t=>{r$.SocketService(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=reconnect`,t),rX(e).catch(e=>{})}),null==n||n.io.on("reconnect_error",t=>{r$.SocketService(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=reconnect_error`,t)}),null==n||n.io.on("reconnect_failed",()=>{r$.SocketService(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=reconnect_failed`)})),null==n||n.on("disconnect",t=>{var n;return r$.SocketService(`[SocketService: setupChannelListener()] on 'disconnect' -- MetaMaskSDK socket disconnected '${t}' begin recovery...`),n=t,void(r$.SocketService(`[SocketService: handleDisconnect()] on 'disconnect' manualDisconnect=${e.state.manualDisconnect}`,n),e.state.manualDisconnect||(e.emit(ij.SOCKET_DISCONNECTED),rX(e).catch(e=>{})))})),r1.forEach(({event:r,handler:i})=>{null==n||n.on(`${r}-${t}`,i(e,t))}),r2.forEach(({event:t,handler:n})=>{null==r||r.on(t,n(e))}),e.state.setupChannelListeners=!0}class r5 extends l.EventEmitter2{constructor(e){super(),this.state={clientsConnected:!1,clientsPaused:!1,manualDisconnect:!1,lastRpcId:void 0,rpcMethodTracker:{},hasPlaintext:!1,communicationServerUrl:"",focusListenerAdded:!1,removeFocusListener:void 0,isReconnecting:!1,reconnectionAttempts:0},this.options=e;let{reconnect:t,communicationLayerPreference:n,communicationServerUrl:r,context:i,remote:o,logging:a}=e;this.state.resumed=t,this.state.context=i,this.state.isOriginator=o.state.isOriginator,this.state.communicationLayerPreference=n,this.state.debug=!0===(null==a?void 0:a.serviceLayer),this.remote=o,!0===(null==a?void 0:a.serviceLayer)&&s().enable("SocketService:Layer"),this.state.communicationServerUrl=r,this.state.hasPlaintext=this.state.communicationServerUrl!==rz&&!0===(null==a?void 0:a.plaintext),r$.SocketService(`[SocketService: constructor()] Socket IO url: ${this.state.communicationServerUrl}`),this.initSocket()}initSocket(){var e;let{otherPublicKey:t,ecies:n,logging:r}=this.options,i=this.state.communicationServerUrl;r$.SocketService(`[SocketService: initSocket()] Socket IO url: ${i}`),this.state.socket=(0,h.io)(i,{autoConnect:!1,transports:rq,withCredentials:!0}),function(e){if("undefined"!=typeof window&&"undefined"!=typeof document&&(r$.SocketService(`[SocketService: setupSocketFocusListener()] hasFocus=${document.hasFocus()}`,e),!e.state.focusListenerAdded)){let t=()=>{r$.SocketService("Document has focus --- reconnecting socket"),rX(e).catch(e=>{})};window.addEventListener("focus",t),e.state.focusListenerAdded=!0,e.state.removeFocusListener=()=>{window.removeEventListener("focus",t),e.state.focusListenerAdded=!1}}}(this);let o={communicationLayer:this,otherPublicKey:t,sendPublicKey:!1,context:null!==(e=this.state.context)&&void 0!==e?e:"",ecies:n,logging:r};this.state.keyExchange=new rG(o)}resetKeys(){var e;return r$.SocketService("[SocketService: resetKeys()] Resetting keys."),void(null===(e=this.state.keyExchange)||void 0===e||e.resetKeys())}createChannel(){return f(this,void 0,void 0,function*(){return function(e){return f(this,void 0,void 0,function*(){var t,n,r;if(r$.SocketService(`[SocketService: createChannel()] context=${e.state.context}`),e.state.socket||e.initSocket(),null===(t=e.state.socket)||void 0===t?void 0:t.connected)throw Error("socket already connected");null===(n=e.state.socket)||void 0===n||n.connect(),e.state.manualDisconnect=!1,e.state.isOriginator=!0;let i=(0,d.A)();e.state.channelId=i,r3(e,i),yield new Promise((t,n)=>{var r;null===(r=e.state.socket)||void 0===r||r.emit(ij.JOIN_CHANNEL,{channelId:i,context:`${e.state.context}createChannel`,clientType:"dapp"},(r,i)=>f(this,void 0,void 0,function*(){try{yield rZ(e,r,i),t()}catch(e){n(e)}}))});let o=null===(r=e.state.keyExchange)||void 0===r?void 0:r.getKeyInfo();return{channelId:i,pubKey:(null==o?void 0:o.ecies.public)||"",privKey:(null==o?void 0:o.ecies.private)||""}})}(this)})}
2connectToChannel({channelId:e,withKeyExchange:t=!1,authorized:n}){return function(e){return f(this,arguments,void 0,function*({options:e,instance:t}){let{channelId:n,authorized:r,withKeyExchange:i}=e,{state:o,remote:a}=t,{isOriginator:s=!1,socket:l,keyExchange:c}=o,{channelConfig:d}=a.state;if(null==l?void 0:l.connected)throw Error("socket already connected");if(s&&(null==d?void 0:d.relayPersistence)){let{localKey:e,otherKey:t}=d;e&&t&&(null==c||c.setRelayPersistence({localKey:e,otherKey:t}))}return Object.assign(o,{manualDisconnect:!1,withKeyExchange:i,isOriginator:s,channelId:n}),null==l||l.connect(),r3(t,n),!s&&r&&(null==c||c.setKeysExchanged(!0),Object.assign(a.state,{ready:!0,authorized:!0})),new Promise(e=>{var i;let a=null===(i=null==c?void 0:c.getKeyInfo())||void 0===i?void 0:i.ecies.public;null==l||l.emit(ij.JOIN_CHANNEL,{channelId:n,context:`${o.context}_connectToChannel`,clientType:s?"dapp":"wallet",publicKey:r&&!s?a:void 0},(n,r)=>f(this,void 0,void 0,function*(){yield rZ(t,n,r),e()}))})})}({options:{channelId:e,withKeyExchange:t,authorized:n},instance:this})}getKeyInfo(){return this.state.keyExchange.getKeyInfo()}keyCheck(){var e;null===(e=this.state.socket)||void 0===e||e.emit(ij.MESSAGE,{id:this.state.channelId,context:this.state.context,message:{type:iH.KEY_HANDSHAKE_CHECK,pubkey:this.getKeyInfo().ecies.otherPubKey}})}getKeyExchange(){return this.state.keyExchange}sendMessage(e){return f(this,void 0,void 0,function*(){return function(e,t){return f(this,void 0,void 0,function*(){var n,r,i,o;if(!e.state.channelId)throw r$.SocketService("handleSendMessage: no channelId - Create a channel first"),Error("Create a channel first");
2if(r$.SocketService(`[SocketService: handleSendMessage()] context=${e.state.context} areKeysExchanged=${null===(n=e.state.keyExchange)||void 0===n?void 0:n.areKeysExchanged()}`,t),null===(r=null==t?void 0:t.type)||void 0===r?void 0:r.startsWith("key_handshake"))return r$.SocketService(`[SocketService: handleKeyHandshake()] context=${e.state.context}`,t),null===(o=e.state.socket)||void 0===o||o.emit(ij.MESSAGE,{id:e.state.channelId,context:e.state.context,clientType:e.state.isOriginator?"dapp":"wallet",message:t}),!0;!function(e,t){var n;if(!(null===(n=e.state.keyExchange)||void 0===n?void 0:n.areKeysExchanged())&&!e.remote.state.relayPersistence)throw r$.SocketService(`[SocketService: validateKeyExchange()] context=${e.state.context} ERROR keys not exchanged`,t),Error("Keys not exchanged BBB")}(e,t),function(e,t){var n;let r=null!==(n=null==t?void 0:t.method)&&void 0!==n?n:"",i=null==t?void 0:t.id;e.state.isOriginator&&i&&(e.state.rpcMethodTracker[i]={id:i,timestamp:Date.now(),method:r},e.emit(ij.RPC_UPDATE,e.state.rpcMethodTracker[i]))}(e,t);let a=yield rQ(e,t);return e.remote.state.analytics&&e.remote.state.isOriginator&&t.method&&r0.includes(t.method.toLowerCase())&&rU({id:null!==(i=e.remote.state.channelId)&&void 0!==i?i:"",event:iz.SDK_RPC_REQUEST,params:{method:t.method,from:"mobile"}},e.remote.state.communicationServerUrl).catch(e=>{}),(function(e,t){return f(this,void 0,void 0,function*(){var n;let r=null==t?void 0:t.id,i=null!==(n=null==t?void 0:t.method)&&void 0!==n?n:"";if(e.state.isOriginator&&r)try{let n=rJ(r,e.state.rpcMethodTracker,200).then(e=>({type:iW.RPC_CHECK,result:e})),o=f(this,void 0,void 0,function*(){let t=yield f(void 0,[{instance:e,rpcId:r}],void 0,function*({rpcId:e,instance:t}){for(;t.state.lastRpcId===e||void 0===t.state.lastRpcId;)yield rY(200);return t.state.lastRpcId}),n=yield rJ(t,e.state.rpcMethodTracker,200);return{type:iW.SKIPPED_RPC,result:n}}),a=yield Promise.race([n,o]);if(a.type===iW.RPC_CHECK){let e=a.result;r$.SocketService(`[SocketService:handleRpcReplies()] id=${t.id} ${i} ( ${e.elapsedTime} ms)`,e.result)}else{if(a.type!==iW.SKIPPED_RPC)throw Error(`Error handling RPC replies for ${r}`);{let t=Object.assign(Object.assign({},e.state.rpcMethodTracker[r]),{error:Error("SDK_CONNECTION_ISSUE")});e.emit(ij.RPC_UPDATE,t);let n={data:Object.assign(Object.assign({},t),{jsonrpc:"2.0"}),name:"metamask-provider"};e.emit(ij.MESSAGE,{message:n})}}}catch(e){throw e}})})(e,t).catch(e=>{}),a})}(this,e)})}ping(){return function(e){return f(this,void 0,void 0,function*(){var t,n;r$.SocketService(`[SocketService: ping()] context=${e.state.context} originator=${e.state.isOriginator} keysExchanged=${null===(t=e.state.keyExchange)||void 0===t?void 0:t.areKeysExchanged()}`),null===(n=e.state.socket)||void 0===n||n.emit(iF.PING,{id:e.state.channelId,context:"ping",clientType:e.remote.state.isOriginator?"dapp":"wallet",message:""})})}(this)}pause(){return function(e){return f(this,void 0,void 0,function*(){var t,n;r$.SocketService(`[SocketService: pause()] context=${e.state.context}`),e.state.manualDisconnect=!0,(null===(t=e.state.keyExchange)||void 0===t?void 0:t.areKeysExchanged())&&(yield e.sendMessage({type:iF.PAUSE})),null===(n=e.state.socket)||void 0===n||n.disconnect()})}(this)}isConnected(){var e;return null===(e=this.state.socket)||void 0===e?void 0:e.connected}resume(){return function(e){return f(this,void 0,void 0,function*(){let{state:t,remote:n}=e,{socket:r,channelId:i,context:o,keyExchange:a,isOriginator:s}=t,{isOriginator:l}=n.state;if(r$.SocketService(`[SocketService: resume()] channelId=${i} context=${o} connected=${null==r?void 0:r.connected} manualDisconnect=${t.manualDisconnect} resumed=${t.resumed} keysExchanged=${null==a?void 0:a.areKeysExchanged()}`),!i)throw r$.SocketService("[SocketService: resume()] channelId is not defined"),Error("ChannelId is not defined");(null==r?void 0:r.connected)?(r$.SocketService("[SocketService: resume()] already connected."),r.emit(iF.PING,{id:i,clientType:l?"dapp":"wallet",context:"on_channel_config",message:""}),n.hasRelayPersistence()||(null==a?void 0:a.areKeysExchanged())||(s?yield e.sendMessage({type:iF.READY}):null==a||a.start({isOriginator:!1}))):(null==r||r.connect(),r$.SocketService(`[SocketService: resume()] after connecting socket --> connected=${null==r?void 0:r.connected}`),null==r||r.emit(ij.JOIN_CHANNEL,{channelId:i,context:`${o}_resume`,clientType:l?"dapp":"wallet"},(t,n)=>f(this,void 0,void 0,function*(){try{yield rZ(e,t,n)}catch(e){}}))),t.manualDisconnect=!1,t.resumed=!0})}(this)}getRPCMethodTracker(){return this.state.rpcMethodTracker}disconnect(e){var t,n,r,i,o;r$.SocketService(`[SocketService: disconnect()] context=${this.state.context}`,e),(null==e?void 0:e.terminate)&&(null===(n=(t=this.state).removeFocusListener)||void 0===n||n.call(t),this.state.channelId=e.channelId,null===(r=this.state.socket)||void 0===r||r.removeAllListeners(),null===(i=this.state.keyExchange)||void 0===i||i.clean(),this.remote.state.ready=!1,this.state.socket=void 0,this.state.rpcMethodTracker={}),this.state.manualDisconnect=!0,null===(o=this.state.socket)||void 0===o||o.disconnect()}}
2function r8({communicationLayerPreference:e,otherPublicKey:t,reconnect:n,ecies:r,communicationServerUrl:i=rz,instance:o}){var a,s,l,c,d,u,h,p,g,m,y;let{state:v}=o;if(r$.RemoteCommunication("[initCommunicationLayer()] ",JSON.stringify(v,null,2)),e!==iV.SOCKET)throw Error("Invalid communication protocol");v.communicationLayer=new r5({communicationLayerPreference:e,otherPublicKey:t,reconnect:n,transports:v.transports,communicationServerUrl:i,context:v.context,ecies:r,logging:v.logging,remote:o});let b="undefined"!=typeof document&&document.URL||"",E="undefined"!=typeof document&&document.title||"";(null===(a=v.dappMetadata)||void 0===a?void 0:a.url)&&(b=v.dappMetadata.url),(null===(s=v.dappMetadata)||void 0===s?void 0:s.name)&&(E=v.dappMetadata.name);let w=null!==(u=null!==(c=null===(l=v.dappMetadata)||void 0===l?void 0:l.name)&&void 0!==c?c:null===(d=v.dappMetadata)||void 0===d?void 0:d.url)&&void 0!==u?u:"N/A",C="undefined"!=typeof window&&void 0!==window.location&&null!==(h=window.location.hostname)&&void 0!==h?h:w,S={url:b,title:E,source:null===(p=v.dappMetadata)||void 0===p?void 0:p.source,dappId:C,icon:(null===(g=v.dappMetadata)||void 0===g?void 0:g.iconUrl)||(null===(m=v.dappMetadata)||void 0===m?void 0:m.base64Icon),platform:v.platformType,apiVersion:rF.version,connector:null===(y=v.dappMetadata)||void 0===y?void 0:y.connector};for(let[t,n]of(v.originatorInfo=S,Object.entries({[ij.AUTHORIZED]:function(e){return()=>f(this,void 0,void 0,function*(){var t,n,r;let{state:i}=e;if(i.authorized)return;yield f(this,void 0,void 0,function*(){for(;!i.walletInfo;)yield rY(500)});let o="7.3".localeCompare((null===(t=i.walletInfo)||void 0===t?void 0:t.version)||"");if(r$.RemoteCommunication(`[RemoteCommunication: handleAuthorizedEvent()] HACK 'authorized' version=${null===(n=i.walletInfo)||void 0===n?void 0:n.version} compareValue=${o}`),1!==o)return;let a=i.platformType===iG.MobileWeb||i.platformType===iG.ReactNative||i.platformType===iG.MetaMaskMobileWebview;r$.RemoteCommunication(`[RemoteCommunication: handleAuthorizedEvent()] HACK 'authorized' platform=${i.platformType} secure=${a} channel=${i.channelId} walletVersion=${null===(r=i.walletInfo)||void 0===r?void 0:r.version}`),a&&(i.authorized=!0,e.emit(ij.AUTHORIZED))})}(o),[ij.MESSAGE]:e=>{let t=e;e.message&&(t=t.message),function(e,t){var n,r;let{state:i}=t;if(r$.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] context=${i.context} on 'message' typeof=${typeof e}`,e),t.state.ready=!0,i.isOriginator||e.type!==iF.ORIGINATOR_INFO)if(i.isOriginator&&e.type===iF.WALLET_INFO){let{state:n}=t;n.walletInfo=e.walletInfo,n.paused=!1}else{if(i.isOriginator&&e.type===iF.WALLET_INIT)(function(e,t){return f(this,void 0,void 0,function*(){var n,r,i;let{state:o}=e;if(o.isOriginator){let o=t.data||{};if("object"==typeof o&&"accounts"in o&&"chainId"in o&&"walletKey"in o)try{let{channelConfig:t}=e.state;if(r$.RemoteCommunication("WALLET_INIT: channelConfig",JSON.stringify(t,null,2)),t){let a=o.accounts,s=o.chainId,l=o.walletKey,c,d=!1;"deeplinkProtocol"in o&&(d=!!o.deeplinkProtocol,e.state.deeplinkProtocolAvailable=d),"walletVersion"in o&&(c=o.walletVersion),yield null===(n=e.state.storageManager)||void 0===n?void 0:n.persistChannelConfig(Object.assign(Object.assign({},t),{otherKey:l,walletVersion:c,deeplinkProtocolAvailable:d,relayPersistence:!0})),yield null===(r=e.state.storageManager)||void 0===r?void 0:r.persistAccounts(a),yield null===(i=e.state.storageManager)||void 0===i?void 0:i.persistChainId(s)}e.emit(ij.WALLET_INIT,{accounts:o.accounts,chainId:o.chainId})}catch(e){}}})})(t,e).catch(e=>{r$.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] error=${e}`)});else if(e.type===iF.TERMINATE)(function(e){return f(this,void 0,void 0,function*(){let{state:t}=e;t.isOriginator&&(yield r4({options:{terminate:!0,sendMessage:!1},instance:e}),e.emit(ij.TERMINATE))})})(t).catch(e=>{r$.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] error=${e}`)});else if(e.type===iF.PAUSE){let{state:e}=t;e.paused=!0,t.setConnectionStatus(iK.PAUSED)}else if(e.type===iF.READY&&i.isOriginator)!function(e){let{state:t}=e;e.setConnectionStatus(iK.LINKED);let n=t.paused;t.paused=!1,e.emit(ij.CLIENTS_READY,{isOriginator:t.isOriginator,walletInfo:t.walletInfo}),n&&(t.authorized=!0,e.emit(ij.AUTHORIZED))}(t);else{if(e.type===iF.OTP&&i.isOriginator){let{state:r}=t;t.emit(ij.OTP,e.otpAnswer),1==="6.6".localeCompare((null===(n=r.walletInfo)||void 0===n?void 0:n.version)||"")&&t.emit(ij.SDK_RPC_CALL,{method:rW.ETH_REQUESTACCOUNTS,params:[]});return}e.type===iF.AUTHORIZED&&i.isOriginator&&function(e){let{state:t}=e;t.authorized=!0,e.emit(ij.AUTHORIZED)}(t)}t.emit(ij.MESSAGE,e)}else{let{state:n}=t;null===(r=n.communicationLayer)||void 0===r||r.sendMessage({type:iF.WALLET_INFO,walletInfo:n.walletInfo}),n.originatorInfo=e.originatorInfo||e.originator,t.emit(ij.CLIENTS_READY,{isOriginator:n.isOriginator,originatorInfo:n.originatorInfo}),n.paused=!1}}(t,o)},[ij.CHANNEL_PERSISTENCE]:function(e){return()=>f(this,void 0,void 0,function*(){var t,n,r,i,o,a,s;let{state:l}=e;r$.RemoteCommunication(`[RemoteCommunication: handleFullPersistenceEvent()] context=${l.context}`),e.state.ready=!0,e.state.clientsConnected=!0,e.state.authorized=!0,e.state.relayPersistence=!0,null===(t=e.state.communicationLayer)||void 0===t||t.getKeyExchange().setKeysExchanged(!0),e.emit(ij.KEYS_EXCHANGED,{keysExchanged:!0,isOriginator:!0}),e.emit(ij.AUTHORIZED),e.emit(ij.CLIENTS_READY),e.emit(ij.CHANNEL_PERSISTENCE);try{l.channelConfig=Object.assign(Object.assign({},l.channelConfig),{localKey:null===(n=l.communicationLayer)||void 0===n?void 0:n.getKeyExchange().getKeyInfo().ecies.private,otherKey:null===(r=l.communicationLayer)||void 0===r?void 0:r.getKeyExchange().getOtherPublicKey(),channelId:null!==(i=l.channelId)&&void 0!==i?i:"",validUntil:null!==(a=null===(o=l.channelConfig)||void 0===o?void 0:o.validUntil)&&void 0!==a?a:6048e5,relayPersistence:!0}),yield null===(s=l.storageManager)||void 0===s?void 0:s.persist
2ChannelConfig(l.channelConfig)}catch(e){}})}(o),[ij.CLIENTS_CONNECTED]:()=>{var t,n,r,i;let{state:a}=o;r$.RemoteCommunication(`[RemoteCommunication: handleClientsConnectedEvent()] on 'clients_connected' channel=${a.channelId} keysExchanged=${null===(n=null===(t=a.communicationLayer)||void 0===t?void 0:t.getKeyInfo())||void 0===n?void 0:n.keysExchanged}`),a.analytics&&rU(Object.assign(Object.assign({id:null!==(r=a.channelId)&&void 0!==r?r:"",event:a.reconnection?iz.RECONNECT:a.isOriginator?iz.REQUEST:iz.REQUEST_MOBILE},a.originatorInfo),{commLayer:e,sdkVersion:a.sdkVersion,walletVersion:null===(i=a.walletInfo)||void 0===i?void 0:i.version,commLayerVersion:rF.version}),a.communicationServerUrl).catch(e=>{}),a.clientsConnected=!0,a.originatorInfoSent=!1,o.emit(ij.CLIENTS_CONNECTED)},[ij.KEYS_EXCHANGED]:t=>{var n,r,i,a,s,l,c,d;let{state:u}=o;if(r$.RemoteCommunication(`[RemoteCommunication: handleKeysExchangedEvent()] context=${u.context} on commLayer.'keys_exchanged' channel=${u.channelId}`,t),null===(r=null===(n=u.communicationLayer)||void 0===n?void 0:n.getKeyInfo())||void 0===r?void 0:r.keysExchanged){let e=Object.assign(Object.assign({},u.channelConfig),{channelId:null!==(i=u.channelId)&&void 0!==i?i:"",validUntil:(null===(a=u.channelConfig)||void 0===a?void 0:a.validUntil)||6048e5,localKey:u.communicationLayer.getKeyInfo().ecies.private,otherKey:u.communicationLayer.getKeyInfo().ecies.otherPubKey});null===(s=u.storageManager)||void 0===s||s.persistChannelConfig(e).catch(e=>{}),o.setConnectionStatus(iK.LINKED)}(function(e,t){var n,r,i,o,a,s,l,c;let{state:d}=e;r$.RemoteCommunication(`[RemoteCommunication: setLastActiveDate()] channel=${d.channelId}`,t);let u=Object.assign(Object.assign({},d.channelConfig),{channelId:null!==(n=d.channelId)&&void 0!==n?n:"",validUntil:null!==(i=null===(r=d.channelConfig)||void 0===r?void 0:r.validUntil)&&void 0!==i?i:0,relayPersistence:d.relayPersistence,localKey:null===(a=null===(o=d.communicationLayer)||void 0===o?void 0:o.state.keyExchange)||void 0===a?void 0:a.getKeyInfo().ecies.private,otherKey:null===(l=null===(s=d.communicationLayer)||void 0===s?void 0:s.state.keyExchange)||void 0===l?void 0:l.getKeyInfo().ecies.otherPubKey,lastActive:t.getTime()});null===(c=d.storageManager)||void 0===c||c.persistChannelConfig(u)})(o,new Date),u.analytics&&u.channelId&&rU(Object.assign(Object.assign({id:u.channelId,event:t.isOriginator?iz.CONNECTED:iz.CONNECTED_MOBILE},u.originatorInfo),{sdkVersion:u.sdkVersion,commLayer:e,commLayerVersion:rF.version,walletVersion:null===(l=u.walletInfo)||void 0===l?void 0:l.version}),u.communicationServerUrl).catch(e=>{}),u.isOriginator=t.isOriginator,t.isOriginator||(null===(c=u.communicationLayer)||void 0===c||c.sendMessage({type:iF.READY}),u.ready=!0,u.paused=!1),t.isOriginator&&!u.originatorInfoSent&&(null===(d=u.communicationLayer)||void 0===d||d.sendMessage({type:iF.ORIGINATOR_INFO,originatorInfo:u.originatorInfo,originator:u.originatorInfo}),u.originatorInfoSent=!0)},[ij.SOCKET_DISCONNECTED]:()=>{let{state:e}=o;r$.RemoteCommunication("[RemoteCommunication: handleSocketDisconnectedEvent()] on 'socket_Disconnected' set ready to false"),e.ready=!1},[ij.SOCKET_RECONNECT]:()=>{let{state:e}=o;r$.RemoteCommunication("[RemoteCommunication: handleSocketReconnectEvent()] on 'socket_reconnect' -- reset key exchange status / set ready to false"),e.ready=!1,e.authorized=!1,rV(e),o.emitServiceStatusEvent({context:"socket_reconnect"})},[ij.CLIENTS_DISCONNECTED]:e=>{let{state:t}=o;r$.RemoteCommunication(`[RemoteCommunication: handleClientsDisconnectedEvent()] context=${t.context} on 'clients_disconnected' channelId=${e}`),t.relayPersistence||(t.clientsConnected=!1,t.ready=!1,t.authorized=!1),o.emit(ij.CLIENTS_DISCONNECTED,t.channelId),o.setConnectionStatus(iK.DISCONNECTED)},[ij.KEY_INFO]:()=>{},[ij.CHANNEL_CREATED]:e=>{let{state:t}=o;r$.RemoteCommunication(`[RemoteCommunication: handleChannelCreatedEvent()] context=${t.context} on 'channel_created' channelId=${e}`),o.emit(ij.CHANNEL_CREATED,e)},[ij.CLIENTS_WAITING]:e=>{var t;let{state:n}=o;if(r$.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] context=${n.context}
2 on 'clients_waiting' numberUsers=${e} ready=${n.ready} autoStarted=${n.originatorConnectStarted}`),o.setConnectionStatus(iK.WAITING),o.emit(ij.CLIENTS_WAITING,e),n.originatorConnectStarted){r$.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] on 'clients_waiting' watch autoStarted=${n.originatorConnectStarted} timeout`,n.autoConnectOptions);let e=(null===(t=n.autoConnectOptions)||void 0===t?void 0:t.timeout)||3e3,r=setTimeout(()=>{r$.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] setTimeout(${e}) terminate channelConfig`,n.autoConnectOptions),n.originatorConnectStarted=!1,n.ready||o.setConnectionStatus(iK.TIMEOUT),clearTimeout(r)},e)}},[ij.RPC_UPDATE]:e=>{o.emit(ij.RPC_UPDATE,e)}})))try{v.communicationLayer.on(t,n)}catch(e){}}function r4(e){return f(this,arguments,void 0,function*({options:e,instance:t}){let{state:n}=t;return r$.RemoteCommunication(`[RemoteCommunication: disconnect()] channel=${n.channelId}`,e),new Promise((r,i)=>{var o,a,s,l,c,u;(null==e?void 0:e.terminate)?(t.state.ready&&rU({id:null!==(o=t.state.channelId)&&void 0!==o?o:"",event:iz.TERMINATED},t.state.communicationServerUrl).catch(e=>{}),n.ready=!1,n.paused=!1,null===(a=n.storageManager)||void 0===a||a.terminate(null!==(s=n.channelId)&&void 0!==s?s:""),t.state.terminated=!0,e.sendMessage?(null===(l=n.communicationLayer)||void 0===l?void 0:l.getKeyInfo().keysExchanged)&&t.state.communicationLayer&&rQ(t.state.communicationLayer,{type:iF.TERMINATE}).then(()=>{r(!0)}).catch(e=>{i(e)}):r(!0),n.authorized=!1,n.relayPersistence=!1,n.channelId=(0,d.A)(),e.channelId=n.channelId,n.channelConfig=void 0,n.originatorConnectStarted=!1,null===(c=n.communicationLayer)||void 0===c||c.disconnect(e),t.setConnectionStatus(iK.TERMINATED)):(null===(u=n.communicationLayer)||void 0===u||u.disconnect(e),t.setConnectionStatus(iK.DISCONNECTED),r(!0))})})}(iV||(iV={})).SOCKET="socket",function(e){e.NonBrowser="nodejs",e.MetaMaskMobileWebview="in-app-browser",e.DesktopWeb="web-desktop",e.MobileWeb="web-mobile",e.ReactNative="react-native"}(iG||(iG={}));class r6 extends l.EventEmitter2{constructor(e){super(),this.state={ready:!1,authorized:!1,isOriginator:!1,terminated:!1,protocolVersion:1,paused:!1,deeplinkProtocolAvailable:!1,platformType:"metamask-mobile",analytics:!1,reconnection:!1,originatorInfoSent:!1,communicationServerUrl:rz,context:"",persist:!1,clientsConnected:!1,sessionDuration:6048e5,originatorConnectStarted:!1,debug:!1,_connectionStatus:iK.DISCONNECTED},this._options=e;let{platformType:t,communicationLayerPreference:n,otherPublicKey:r,reconnect:i,walletInfo:o,dappMetadata:a,protocolVersion:l,transports:c,context:d,relayPersistence:u,ecies:h,analytics:f=!1,storage:p,sdkVersion:g,communicationServerUrl:m=rz,logging:y,autoConnect:v={timeout:3e3}}=e;this.state.otherPublicKey=r,this.state.dappMetadata=a,this.state.walletInfo=o,this.state.transports=c,this.state.platformType=t,this.state.analytics=f,this.state.protocolVersion=null!=l?l:1,this.state.isOriginator=!r,this.state.relayPersistence=u,this.state.communicationServerUrl=m,this.state.context=d,this.state.terminated=!1,this.state.sdkVersion=g,this.setMaxListeners(50),this.setConnectionStatus(iK.DISCONNECTED),(null==p?void 0:p.duration)&&(this.state.sessionDuration=6048e5),this.state.storageOptions=p,this.state.autoConnectOptions=v,this.state.debug=!0===(null==y?void 0:y.remoteLayer),!0===(null==y?void 0:y.remoteLayer)&&s().enable("RemoteCommunication:Layer"),!0===(null==y?void 0:y.serviceLayer)&&s().enable("SocketService:Layer"),!0===(null==y?void 0:y.eciesLayer)&&s().enable("ECIES:Layer"),!0===(null==y?void 0:y.keyExchangeLayer)&&s().enable("KeyExchange:Layer"),this.state.logging=y,(null==p?void 0:p.storageManager)&&(this.state.storageManager=p.storageManager),r$.RemoteCommunication(`[RemoteCommunication: constructor()] protocolVersion=${l} relayPersistence=${u} isOriginator=${this.state.isOriginator} communicationLayerPreference=${n} otherPublicKey=${r} reconnect=${i}`),this.state.isOriginator||r8({communicationLayerPreference:n,otherPublicKey:r,reconnect:i,ecies:h,communicationServerUrl:m,instance:this}),this.emitServiceStatusEvent({context:"constructor"})}initFromDappStorage(){return f(this,void 0,void 0,function*(){var e;if(this.state.storageManager){let t=yield this.state.storageManager.getPersistedChannelConfig({});t&&(this.state.channelConfig=t,this.state.channelId=t.channelId,this.state.deeplinkProtocolAvailable=null!==(e=t.deeplinkProtocolAvailable)&&void 0!==e&&e,t.relayPersistence&&(this.state.authorized=!0,this.state.ready=!0,this.setConnectionStatus(iK.LINKED),yield this.connectToChannel
2({channelId:t.channelId})))}r8({communicationLayerPreference:iV.SOCKET,otherPublicKey:this.state.otherPublicKey,reconnect:this._options.reconnect,ecies:this._options.ecies,communicationServerUrl:this.state.communicationServerUrl,instance:this})})}originatorSessionConnect(){return f(this,void 0,void 0,function*(){return yield function(e){return f(this,void 0,void 0,function*(){var t;let{state:n}=e;if(!n.storageManager)return void r$.RemoteCommunication("[RemoteCommunication: originatorSessionConnect()] no storage manager defined - skip");let r=yield n.storageManager.getPersistedChannelConfig({});if(r$.RemoteCommunication(`[RemoteCommunication: originatorSessionConnect()] autoStarted=${n.originatorConnectStarted} channelConfig`,r),null===(t=n.communicationLayer)||void 0===t?void 0:t.isConnected())return r$.RemoteCommunication("[RemoteCommunication: originatorSessionConnect()] socket already connected - skip"),r;if(r){if(r.validUntil>Date.now())return n.channelConfig=r,n.originatorConnectStarted=!0,n.channelId=null==r?void 0:r.channelId,n.reconnection=!0,r;r$.RemoteCommunication("[RemoteCommunication: autoConnect()] Session has expired")}n.originatorConnectStarted=!1})}(this)})}generateChannelIdConnect(){return f(this,void 0,void 0,function*(){return function(e){return f(this,void 0,void 0,function*(){var t,n,r,i,o,a;if(!e.communicationLayer)throw Error("communication layer not initialized");if(e.ready)throw Error("Channel already connected");if(e.channelId&&(null===(t=e.communicationLayer)||void 0===t?void 0:t.isConnected()))return e.channelConfig=Object.assign(Object.assign({},e.channelConfig),{channelId:e.channelId,validUntil:Date.now()+e.sessionDuration}),null===(n=e.storageManager)||void 0===n||n.persistChannelConfig(e.channelConfig),{channelId:e.channelId,privKey:null===(i=null===(r=e.communicationLayer)||void 0===r?void 0:r.getKeyInfo())||void 0===i?void 0:i.ecies.private,pubKey:null===(a=null===(o=e.communicationLayer)||void 0===o?void 0:o.getKeyInfo())||void 0===a?void 0:a.ecies.public};r$.RemoteCommunication("[RemoteCommunication: generateChannelId()]");let s=yield e.communicationLayer.createChannel();r$.RemoteCommunication("[RemoteCommunication: generateChannelId()] channel created",s);let l=Object.assign(Object.assign({},e.channelConfig),{channelId:s.channelId,localKey:s.privKey,validUntil:Date.now()+e.sessionDuration});return e.channelId=s.channelId,e.channelConfig=l,{channelId:e.channelId,pubKey:s.pubKey,privKey:s.privKey}})}(this.state)})}clean(){return rV(this.state)}connectToChannel({channelId:e,withKeyExchange:t,authorized:n}){return function(e){return f(this,arguments,void 0,function*({channelId:e,withKeyExchange:t,authorized:n,state:r}){var i,o,a;if(!(0,u.A)(e))throw r$.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${r.context} invalid channel channelId=${e}`),Error(`Invalid channel ${e}`);if(r$.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${r.context} channelId=${e} withKeyExchange=${t}`),null===(i=r.communicationLayer)||void 0===i?void 0:i.isConnected())return void r$.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${r.context} already connected - interrupt connection.`);r.channelId=e,yield null===(o=r.communicationLayer)||void 0===o?void 0:o.connectToChannel({channelId:e,authorized:n,withKeyExchange:t});let s=Object.assign(Object.assign({},r.channelConfig),{channelId:e,validUntil:Date.now()+r.sessionDuration});r.channelConfig=s,null===(a=r.storageManager)||void 0===a||a.persistChannelConfig(s)})}({channelId:e,authorized:n,withKeyExchange:t,state:this.state})}sendMessage(e){return function(e,t){return f(this,void 0,void 0,function*(){var n,r;let{state:i}=e;r$.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${i.context} paused=${i.paused} ready=${i.ready} relayPersistence=${i.relayPersistence} authorized=${i.authorized} socket=${null===(n=i.communicationLayer)||void 0===n?void 0:n.isConnected()} clientsConnected=${i.clientsConnected} status=${i._connectionStatus}`,t),i.relayPersistence||i.ready&&(null===(r=i.communicationLayer)||void 0===r?void 0:r.isConnected())&&i.clientsConnected||(r$.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${i.c
2ontext}  SKIP message waiting for MM mobile readiness.`),yield new Promise(t=>{e.once(ij.CLIENTS_READY,t)}),r$.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${i.context}  AFTER SKIP / READY -- sending pending message`));try{return yield function(e,t){return f(this,void 0,void 0,function*(){return new Promise(n=>{var r;let{state:i}=e;r$.RemoteCommunication(`[RemoteCommunication: handleAuthorization()] context=${i.context} ready=${i.ready} authorized=${i.authorized} method=${t.method}`),!i.isOriginator||i.authorized||i.relayPersistence?null===(r=i.communicationLayer)||void 0===r||r.sendMessage(t).then(e=>{n(e)}).catch(e=>{n(!1)}):e.once(ij.AUTHORIZED,()=>{var e;r$.RemoteCommunication(`[RemoteCommunication: handleAuthorization()] context=${i.context}  AFTER SKIP / AUTHORIZED -- sending pending message`),null===(e=i.communicationLayer)||void 0===e||e.sendMessage(t).then(e=>{n(e)}).catch(e=>{n(!1)})})})})}(e,t)}catch(e){throw e}})}(this,e)}testStorage(){return f(this,void 0,void 0,function*(){return function(e){return f(this,void 0,void 0,function*(){var t;let n=yield null===(t=e.storageManager)||void 0===t?void 0:t.getPersistedChannelConfig();r$.RemoteCommunication("[RemoteCommunication: testStorage()] res",n)})}(this.state)})}hasDeeplinkProtocol(){return this.state.deeplinkProtocolAvailable}getChannelConfig(){return this.state.channelConfig}isReady(){return this.state.ready}isConnected(){var e;return null===(e=this.state.communicationLayer)||void 0===e?void 0:e.isConnected()}isAuthorized(){return this.state.authorized}isPaused(){return this.state.paused}getCommunicationLayer(){return this.state.communicationLayer}ping(){return f(this,void 0,void 0,function*(){var e;r$.RemoteCommunication(`[RemoteCommunication: ping()] channel=${this.state.channelId}`),yield null===(e=this.state.communicationLayer)||void 0===e?void 0:e.ping()})}testLogger(){r$.RemoteCommunication(`testLogger() channel=${this.state.channelId}`),r$.SocketService(`testLogger() channel=${this.state.channelId}`),r$.Ecies(`testLogger() channel=${this.state.channelId}`),r$.KeyExchange(`testLogger() channel=${this.state.channelId}`)}keyCheck(){var e;r$.RemoteCommunication(`[RemoteCommunication: keyCheck()] channel=${this.state.channelId}`),null===(e=this.state.communicationLayer)||void 0===e||e.keyCheck()}setConnectionStatus(e){this.state._connectionStatus!==e&&(this.state._connectionStatus=e,this.emit(ij.CONNECTION_STATUS,e),this.emitServiceStatusEvent({context:"setConnectionStatus"}))}emitServiceStatusEvent(e={}){this.emit(ij.SERVICE_STATUS,this.getServiceStatus())}getConnectionStatus(){return this.state._connectionStatus}getServiceStatus(){return{originatorInfo:this.state.originatorInfo,keyInfo:this.getKeyInfo(),connectionStatus:this.state._connectionStatus,channelConfig:this.state.channelConfig,channelId:this.state.channelId}}getKeyInfo(){var e;return null===(e=this.state.communicationLayer)||void 0===e?void 0:e.getKeyInfo()}resetKeys(){var e;null===(e=this.state.communicationLayer)||void 0===e||e.resetKeys()}setOtherPublicKey(e){var t;let n=null===(t=this.state.communicationLayer)||void 0===t?void 0:t.getKeyExchange();if(!n)throw Error("KeyExchange is not initialized.");n.getOtherPublicKey()!==e&&n.setOtherPublicKey(e)}pause(){return f(this,void 0,void 0,function*(){var e;r$.RemoteCommunication(`[RemoteCommunication: pause()] channel=${this.state.channelId}`),yield null===(e=this.state.communicationLayer)||void 0===e?void 0:e.pause(),this.setConnectionStatus(iK.PAUSED)})}getVersion(){return rF.version}hasRelayPersistence(){var e;return null!==(e=this.state.relayPersistence)&&void 0!==e&&e}resume(){return f(this,void 0,void 0,function*(){return function(e){return f(this,void 0,void 0,function*(){var t;let{state:n}=e;r$.RemoteCommunication(`[RemoteCommunication: resume()] channel=${n.channelId}`),yield null===(t=n.communicationLayer)||void 0===t?void 0:t.resume(),e.setConnectionStatus(iK.LINKED)})}(this)})}encrypt(e){var t,n,r;let i=null===(t=this.state.communicationLayer)||void 0===t?void 0:t.getKeyExchange(),o=null==i?void 0:i.getOtherPublicKey();
2if(!o)throw Error("KeyExchange not completed");return null===(r=null===(n=this.state.communicationLayer)||void 0===n?void 0:n.state.eciesInstance)||void 0===r?void 0:r.encrypt(e,o)}decrypt(e){var t,n,r;if(!(null===(t=this.state.communicationLayer)||void 0===t?void 0:t.state.eciesInstance))throw Error("ECIES instance is not initialized");return null===(r=null===(n=this.state.communicationLayer)||void 0===n?void 0:n.state.eciesInstance)||void 0===r?void 0:r.decrypt(e)}getChannelId(){return this.state.channelId}getRPCMethodTracker(){var e;return null===(e=this.state.communicationLayer)||void 0===e?void 0:e.getRPCMethodTracker()}reject({channelId:e}){return function(e){return f(this,arguments,void 0,function*({channelId:e,state:t}){var n,r,i;if(!(0,u.A)(e))throw r$.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${t.context} invalid channel channelId=${e}`),Error(`Invalid channel ${e}`);if(t.isOriginator)return void r$.RemoteCommunication(`[RemoteCommunication: reject()] context=${t.context} isOriginator=${t.isOriginator} channelId=${e}`);let{socket:o}=null!==(r=null===(n=t.communicationLayer)||void 0===n?void 0:n.state)&&void 0!==r?r:{};(null==o?void 0:o.connected)||(r$.RemoteCommunication(`[RemoteCommunication: reject()] context=${t.context} socket already connected`),null==o||o.connect()),rU(Object.assign(Object.assign({id:e,event:iz.REJECTED},t.originatorInfo),{sdkVersion:t.sdkVersion,commLayerVersion:rF.version,walletVersion:null===(i=t.walletInfo)||void 0===i?void 0:i.version}),t.communicationServerUrl).catch(e=>{}),yield new Promise((n,r)=>{null==o||o.emit(ij.REJECTED,{channelId:e},(e,i)=>{r$.RemoteCommunication(`[RemoteCommunication: reject()] context=${t.context} socket=${null==o?void 0:o.id}`,{error:e,response:i}),e?r(e):n(i)})})})}({channelId:e,state:this.state})}disconnect(e){return f(this,void 0,void 0,function*(){return r4({options:e,instance:this})})}}!function(e){e.RENEW="renew",e.LINK="link"}(iZ||(iZ={}));var r7={errors:{disconnected:()=>"MetaMask: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"MetaMask: Disconnected from MetaMask background. Page reload required.",sendSiteMetadata:()=>"MetaMask: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidNetworkParams:()=>"MetaMask: Received invalid network parameters. Please report this bug.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`MetaMask: Connected to chain with ID "${e}".`},warnings:{chainIdDeprecation:"MetaMask: 'ethereum.chainId' is deprecated and may be removed in the future. Please use the 'eth_chainId' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23",networkVersionDeprecation:"MetaMask: 'ethereum.networkVersion' is deprecated and may be removed in the future. Please use the 'net_version' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23",selectedAddressDeprecation:"MetaMask: 'ethereum.selectedAddress' is deprecated and may be removed in the future. Please use the 'eth_accounts' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23",enableDeprecation:"MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",sendDeprecation:"MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",events:{close:"MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"},rpc:{ethDecryptDeprecation:"MetaMask: The RPC method 'eth_decrypt' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686",ethGetEncryptionPublicKeyDeprecation:"MetaMask: The RPC method 'eth_getEncryptionPublicKey' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686",walletWatchAssetNFTExperimental:"MetaMask: The RPC method 'wallet_watchAsset' is experimental for ERC721/ERC1155 assets and may change in the future.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md and https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle"},experimentalMethods:"MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning."}},r9=Math.floor(0xffffffff*Math.random()),ie=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)}
2,it=(e,t,n)=>(ie(e,t,"read from private field"),n?n.call(e):t.get(e)),ir=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ii=(e,t,n,r)=>(ie(e,t,"write to private field"),t.set(e,n),n),io=(e,t,n)=>(ie(e,t,"access private method"),n),ia={invalidRequest:-32600,internal:-32603},is={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};function il(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}var ic=(e,t)=>Object.hasOwnProperty.call(e,t);class id extends TypeError{constructor(e,t){let n,{message:r,explanation:i,...o}=e,{path:a}=e,s=0===a.length?r:`At path: ${a.join(".")} -- ${r}`;super(i??s),null!=i&&(this.cause=s),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...t()])}}function iu(e){return"object"==typeof e&&null!=e}function ih(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function*ip(e,t,n,r){var i;for(let o of(iu(i=e)&&"function"==typeof i[Symbol.iterator]||(e=[e]),e)){let e=function(e,t,n,r){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});let{path:i,branch:o}=t,{type:a}=n,{refinement:s,message:l=`Expected a value of type \`${a}\`${s?` with refinement \`${s}\``:""}, but received: \`${ih(r)}\``}=e;return{value:r,type:a,refinement:s,key:i[i.length-1],path:i,branch:o,...e,message:l}}(o,t,n,r);e&&(yield e)}}function*ig(e,t,n={}){let{path:r=[],branch:i=[e],coerce:o=!1,mask:a=!1}=n,s={path:r,branch:i};if(o&&(e=t.coercer(e,s),a&&"type"!==t.type&&iu(t.schema)&&iu(e)&&!Array.isArray(e)))for(let n in e)void 0===t.schema[n]&&delete e[n];let l="valid";for(let r of t.validator(e,s))r.explanation=n.message,l="not_valid",yield[r,void 0];for(let[c,d,u]of t.entries(e,s))for(let t of ig(d,u,{path:void 0===c?r:[...r,c],branch:void 0===c?i:[...i,d],c
2oerce:o,mask:a,message:n.message}))t[0]?(l=null!=t[0].refinement?"not_refined":"not_valid",yield[t[0],void 0]):o&&(d=t[1],void 0===c?e=d:e instanceof Map?e.set(c,d):e instanceof Set?e.add(d):iu(e)&&(void 0!==d||c in e)&&(e[c]=d));if("not_valid"!==l)for(let r of t.refiner(e,s))r.explanation=n.message,l="not_refined",yield[r,void 0];"valid"===l&&(yield[void 0,e])}class im{constructor(e){let{type:t,schema:n,validator:r,refiner:i,coercer:o=e=>e,entries:a=function*(){}}=e;this.type=t,this.schema=n,this.entries=a,this.coercer=o,this.validator=r?(e,t)=>ip(r(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>ip(i(e,t),t,this,e):()=>[]}assert(e,t){return iy(e,this,t)}create(e,t){return iv(e,this,t)}is(e){return ib(e,this)}mask(e,t){let n=iE(e,this,{coerce:!0,mask:!0,message:t});if(n[0])throw n[0];return n[1]}validate(e,t={}){return iE(e,this,t)}}function iy(e,t,n){let r=iE(e,t,{message:n});if(r[0])throw r[0]}function iv(e,t,n){let r=iE(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function ib(e,t){return!iE(e,t)[0]}function iE(e,t,n={}){let r=ig(e,t,n),i=function(e){let{done:t,value:n}=e.next();return t?void 0:n}(r);return i[0]?[new id(i[0],function*(){for(let e of r)e[0]&&(yield e[0])}),void 0]:[void 0,i[1]]}function iw(e,t){return new im({type:e,schema:null,validator:t})}function iC(e){let t;return new im({type:"lazy",schema:null,*entries(n,r){t??(t=e()),yield*t.entries(n,r)},validator:(n,r)=>(t??(t=e()),t.validator(n,r)),coercer:(n,r)=>(t??(t=e()),t.coercer(n,r)),refiner:(n,r)=>(t??(t=e()),t.refiner(n,r))})}function iS(e){return new im({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(let[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${ih(e)}`})}function i_(e){let t=ih(e),n=typeof e;return new im({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:n=>n===e||`Expected the literal \`${t}\`, but received: ${ih(n)}`})}function ix(){return iw("number",e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${ih(e)}`)}function ik(e){let t=e?Object.keys(e):[],n=iw("never",()=>!1);return new im({type:"object",schema:e||null,*entries(r){if(e&&iu(r)){let i=new Set(Object.keys(r));for(let n of t)i.delete(n),yield[n,r[n],e[n]];for(let e of i)yield[e,r[e],n]}},validator:e=>iu(e)||`Expected an object, but received: ${ih(e)}`,coercer:e=>iu(e)?{...e}:e})}function iM(e){return new im({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function iA(e,t){return new im({type:"record",schema:null,*entries(n){if(iu(n))for(let r in n){let i=n[r];yield[r,r,e],yield[r,i,t]}},validator:e=>iu(e)||`Expected an object, but received: ${ih(e)}`})}function iI(){return iw("string",e=>"string"==typeof e||`Expected a string, but received: ${ih(e)}`)}function iR(e){let t=e.map(e=>e.type).join(" | ");return new im({type:"union",schema:null,coercer(t){for(let n of e){let[e,r]=n.validate(t,{coerce:!0});if(!e)return r}return t},validator(n,r){let i=[];for(let t of e){let[...e]=ig(n,t,r),[o]=e;if(!o[0])return[];for(let[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${ih(n)}`,...i]}})}var iL=class extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}};function iP(){throw Error("setTimeout has not been defined")}function iO(){throw Error("clearTimeout has not been defined")}var iT=iP,iN=iO;function iD(e){if(iT===setTimeout)return setTimeout(e,0);if((iT===iP||!iT)&&setTimeout)return iT=setTimeout,setTimeout(e,0);try{return iT(e,0)}catch(t){try{return iT.call(null,e,0)}catch(t){return iT.call(this,e,0)}}}"function"==typeof p.setTimeout&&(iT=setTimeout),"function"==typeof p.clearTimeout&&(iN=clearTimeout);var i$,iB,iK,ij,iU,iH,iF,iz,iq,iW,iV,iG,iZ,iY,iJ=[],iX=!1,iQ=-1;function i0(){iX&&iY&&(iX=!1,iY.length?iJ=iY.concat(iJ):iQ=-1,iJ.length&&i1())}function i1(){if(!iX){var e=iD(i0);iX=!0;for(var t=iJ.length;t;){for(iY=iJ,iJ=[];++iQ<t;)iY&&iY[iQ].run();iQ=-1,t=iJ.length}iY=null,iX=!1,function(e){if(iN===clearTimeout)return clearTimeout(e);if((iN===iO||!iN)&&clearTimeout)return iN=clearTimeout,clearTimeout(e);try{iN(e)}catch(t){try{return iN.call(null,e)}catch(t){return iN.call(this,e)}}}(e)}}function i2(e,t){this.fun=e,this.array=t}function i3(){}i2.prototype.run=function(){this.fun.apply(null,this.array)};var i5=p.performance||{},i8=i5.now||i5.mozNow||i5.msNow||i5.oNow||i5.webkitNow||function(){return(new Date).getTime()},i4=new Date,i6={nextTick:function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];iJ.push(new i2(e,t)),1!==iJ.length||iX||iD(i1)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:i3,addListener:i3,once:i3,off:i3,removeListener:i3,removeAllListeners:i3,emit:i3,binding:function(e){throw Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*i8.call(i5),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-i4)/1e3}},i7=e=>ik(e);function i9({path:e,branch:t}){let n=e[e.length-1];return ic(t[t.length-2],n)}function oe(e){return new im({...e,type:`optional ${e.type}`,validator:(t,n)=>!i9(n)||e.validator(t,n),refiner:(t,n)=>!i9(n)||e.refiner(t,n)})}var ot,on,or=iR([i_(null),iw("boolean",e=>"boolean"==typeof e),iw("finite number",e=>
2ib(e,ix())&&Number.isFinite(e)),iI(),iS(iC(()=>or)),iA(iI(),iC(()=>or))]),oi=(ot=iw("any",()=>!0),on=e=>((function(e,t,n="Assertion failed",r=iL){try{iy(e,t)}catch(e){var i,o;throw i=r,o=`${n}: ${("object"==typeof e&&null!==e&&"message"in e&&"string"==typeof e.message?e.message:null==e?"":String(e)).replace(/\.$/u,"")}.`,"string"==typeof i?.prototype?.constructor?.name?new i({message:o}):i({message:o})}})(e,or),JSON.parse(JSON.stringify(e,(e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))),new im({...or,coercer:(e,t)=>ib(e,ot)?or.coercer(on(e,t),t):or.coercer(e,t)}));function oo(e){try{return iv(e,oi),!0}catch{return!1}}var oa=i_("2.0"),os=function(e){return new im({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})}(iR([ix(),iI()])),ol=i7({code:iw("integer",e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${ih(e)}`),message:iI(),data:oe(oi),stack:oe(iI())}),oc=iR([iA(iI(),oi),iS(oi)]),od=i7({id:os,jsonrpc:oa,method:iI(),params:oe(oc)}),ou=i7({jsonrpc:oa,method:iI(),params:oe(oc)});ik({id:os,jsonrpc:oa,result:iM(iw("unknown",()=>!0)),error:iM(ol)}),iR([i7({id:os,jsonrpc:oa,result:oi}),i7({id:os,jsonrpc:oa,error:ol})]);var oh=ia.internal,of={code:oh,message:op(oh)};function op(e,t="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){let t=e.toString();if(ic(is,t))return is[t].message;if(e>=-32099&&e<=-32e3)return"Unspecified server error."}return t}function og(e,{fallbackError:t=of,shouldIncludeStack:n=!0}={}){if(!ib(t,ol))throw Error("Must provide fallback error with integer number code and string message.");let r=function(e,t){if(e&&"object"==typeof e&&"serialize"in e&&"function"==typeof e.serialize)return e.serialize();if(ib(e,ol))return e;let n=om(e);return{...t,data:{cause:n}}}(e,t);return n||delete r.stack,r}function om(e){return Array.isArray(e)?e.map(e=>oo(e)?e:il(e)?oy(e):null):il(e)?oy(e):oo(e)?e:null}function oy(e){return Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return oo(r)&&(t[n]=r),t},{})}oS.default=oS,oS.stable=ok,oS.stableStringify=ok;var ov="[...]",ob="[Circular]",oE=[],ow=[];function oC(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function oS(e,t,n,r){var i;void 0===r&&(r=oC()),function e(t,n,r,i,o,a,s){var l;if(a+=1,"object"==typeof t&&null!==t){for(l=0;l<i.length;l++)if(i[l]===t)return void o_(ob,t,n,o);if(void 0!==s.depthLimit&&a>s.depthLimit||void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void o_(ov,t,n,o);if(i.push(t),Array.isArray(t))for(l=0;l<t.length;l++)e(t[l],l,l,i,t,a,s);else{var c=Object.keys(t);for(l=0;l<c.length;l++){var d=c[l];e(t[d],d,l,i,t,a,s)}}i.pop()}}(e,"",0,[],void 0,0,r);try{i=0===ow.length?JSON.stringify(e,t,n):JSON.stringify(e,oM(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==oE.length;){var o=oE.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function o_(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);void 0!==i.get?i.configurable?(Object.defineProperty(r,n,{value:e}),oE.push([r,n,t,i])):ow.push([t,n,e]):(r[n]=e,oE.push([r,n,t]))}function ox(e,t){return e<t?-1:+(e>t)}function ok(e,t,n,r){void 0===r&&(r=oC());var i,o=function e(t,n,r,i,o,a,s){var l;if(a+=1,"object"==typeof t&&null!==t){for(l=0;l<i.length;l++)if(i[l]===t)return void o_(ob,t,n,o);try{if("function"==typeof t.toJSON)return}catch(e){return}if(void 0!==s.depthLimit&&a>s.depthLimit||void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void o_(ov,t,n,o);if(i.push(t),Array.isArray(t))for(l=0;l<t.length;l++)e(t[l],l,l,i,t,a,s);else{var c={},d=Object.keys(t).sort(ox);for(l=0;l<d.length;l++){var u=d[l];e(t[u],u,l,i,t,a,s),c[u]=t[u]}if(void 0===o)return c;oE.push([o,n,t]),o[n]=c}i.pop()}}(e,"",0,[],void 0,0,r)||e;try{i=0===ow.length?JSON.stringify(o,t,n):JSON.stringify(o,oM(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==oE.length;){var a=oE.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return i}function oM(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(ow.length>0)for(var r=0;r<ow.length;r++){var i=ow[r];if(i[1]===t&&i[0]===n){n=i[2],ow.splice(r,1);break}}return e.call(this,t,n)}}
2var oA=ei(oS),oI=class extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a non-empty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}serialize(){let e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}(this.data)&&(e.data.cause=om(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return oA(this.serialize(),oR,2)}};function oR(e,t){if("[Circular]"!==t)return t}var oL=e=>(function(e,t){let[n,r]=function(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:n}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t??void 0,n]}}return[]}(t);return new oI(e,n??op(e),r)})(ia.invalidRequest,e),oP={};function oO(){}function oT(){oT.init.call(this)}function oN(e){return void 0===e._maxListeners?oT.defaultMaxListeners:e._maxListeners}function oD(e,t,n,r){var i,o,a;if("function"!=typeof n)throw TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]):(o=e._events=new oO,e._eventsCount=0),a){if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),!a.warned&&(i=oN(e))&&i>0&&a.length>i){a.warned=!0;var s=Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=n,++e._eventsCount;return e}function o$(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function oB(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function oK(e,t){for(var n=Array(t);t--;)n[t]=e[t];return n}oO.prototype=Object.create(null),oT.EventEmitter=oT,oT.usingDomains=!1,oT.prototype.domain=void 0,oT.prototype._events=void 0,oT.prototype._maxListeners=void 0,oT.defaultMaxListeners=10,oT.init=function(){this.domain=null,oT.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new oO,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},oT.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},oT.prototype.getMaxListeners=function(){return oN(this)},oT.prototype.emit=function(e){var t,n,r,i,o,a,s,l="error"===e;if(a=this._events)l=l&&null==a.error;else if(!l)return!1;if(s=this.domain,l){if(t=arguments[1],!s){if(t instanceof Error)throw t;var c=Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=a[e]))return!1;var d="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,i=oK(e,r),o=0;o<r;++o)i[o].call(n)}(n,d,this);break;case 2:!function(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,o=oK(e,i),a=0;a<i;++a)o[a].call(n,r)}(n,d,this,arguments[1]);break;case 3:!function(e,t,n,r,i){if(t)e.call(n,r,i);else for(var o=e.length,a=oK(e,o),s=0;s<o;++s)a[s].call(n,r,i)}(n,d,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,r,i,o){if(t)e.call(n,r,i,o);else for(var a=e.length,s=oK(e,a),l=0;l<a;++l)s[l].call(n,r,i,o)}(n,d,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];!function(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,o=oK(e,i),a=0;a<i;++a)o[a].apply(n,r)}(n,d,this,i)}return!0},oT.prototype.addListener=function(e,t){return oD(this,e,t,!1)},oT.prototype.on=oT.prototype.addListener,oT.prototype.prependListener=function(e,t){return oD(this,e,t,!0)},oT.prototype.once=function(e,t){if("function"!=typeof t)throw TypeError('"listener" argument must be a function');return this.on(e,o$(this,e,t)),this},oT.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw TypeError('"listener" argument must be a function');return this.prependListener(e,o$(this,e,t)),this},oT.prototype.removeListener=function(e,t){var n,r,i,o,a;if("function"!=typeof t)throw TypeError('"listener" argument must be a function');if(!(r=this._events)||!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new oO:(delete r[e],r.removeListener&&this.emit
2("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new oO,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}(n,i);r.removeListener&&this.emit("removeListener",e,a||t)}return this},oT.prototype.off=function(e,t){return this.removeListener(e,t)},oT.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0==arguments.length?(this._events=new oO,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new oO:delete n[e]),this;if(0==arguments.length){for(var r,i=Object.keys(n),o=0;o<i.length;++o)"removeListener"!==(r=i[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new oO,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do this.removeListener(e,t[t.length-1]);while(t[0]);return this},oT.prototype.listeners=function(e){var t,n=this._events;return n&&(t=n[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[]},oT.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):oB.call(e,t)},oT.prototype.listenerCount=oB,oT.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var oj=eo(Object.freeze({__proto__:null,EventEmitter:oT,default:oT}));Object.defineProperty(oP,"__esModule",{value:!0});let oU=oj;function oH(e,t,n){try{Reflect.apply(e,t,n)}catch(e){setTimeout(()=>{throw e})}}var oF,oz,oq,oW,oV,oG,oZ,oY,oJ,oX,oQ,o0,o1,o2,o3,o5,o8,o4,o6,o7=oP.default=class extends oU.EventEmitter{emit(e,...t){let n="error"===e,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;let n=Error("Unhandled error."+(e?` (${e.message})`:""));throw n.context=e,n}let i=r[e];if(void 0===i)return!1;if("function"==typeof i)oH(i,this,t);else{let e=i.length,n=function(e){let t=e.length,n=Array(t);for(let r=0;r<t;r+=1)n[r]=e[r];return n}(i);for(let r=0;r<e;r+=1)oH(n[r],this,t)}return!0}},o9=class e extends o7{constructor({notificationHandler:e}={}){super(),ir(this,oW),ir(this,oG),ir(this,oY),ir(this,oF,!1),ir(this,oz,void 0),ir(this,oq,void 0),ii(this,oz,[]),ii(this,oq,e)}destroy(){it(this,oz).forEach(e=>{"destroy"in e&&"function"==typeof e.destroy&&e.destroy()}),ii(this,oz,[]),ii(this,oF,!0)}push(e){io(this,oW,oV).call(this),it(this,oz).push(e)}handle(e,t){if(io(this,oW,oV).call(this),t&&"function"!=typeof t)throw Error('"callback" must be a function if provided.');return Array.isArray(e)?t?io(this,oG,oZ).call(this,e,t):io(this,oG,oZ).call(this,e):t?io(this,oY,oJ).call(this,e,t):this._promiseHandle(e)}asMiddleware(){return io(this,oW,oV).call(this),async(t,n,r,i)=>{try{let[o,a,s]=await io(e,o0,o1).call(e,t,n,it(this,oz));return a?(await io(e,o5,o8).call(e,s),i(o)):r(async t=>{try{await io(e,o5,o8).call(e,s)}catch(e){return t(e)}return t()})}catch(e){return i(e)}}}async _promiseHandle(e){return new Promise((t,n)=>{io(this,oY,oJ).call(this,e,(e,r)=>{e&&void 0===r?n(e):t(r)}).catch(n)})}};function ae(e){return JSON.stringify(e,null,2)}oF=new WeakMap,oz=new WeakMap,oq=new WeakMap,oW=new WeakSet,oV=function(){if(it(this,oF))throw Error("This engine is destroyed and can no longer be used.")},oG=new WeakSet,oZ=async function(e,t){try{if(0===e.length){let e=[{id:null,jsonrpc:"2.0",error:new oI(ia.invalidRequest,"Request batch must contain plain objects. Received an empty array")}];return t?t(null,e):e}let n=(await Promise.all(e.map(this._promiseHandle.bind(this)))).filter(e=>void 0!==e);return t?t(null,n):n}catch(e){if(t)return t(e);throw e}},oY=new WeakSet,oJ=async function(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){let n=new oI(ia.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(n,{id:null,jsonrpc:"2.0",error:n})}if("string"!=typeof e.method){let n=new oI(ia.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});
2return it(this,oq)&&!ib(e,od)?t(null):t(n,{id:e.id??null,jsonrpc:"2.0",error:n})}if(it(this,oq)&&ib(e,ou)&&!ib(e,od)){try{await it(this,oq).call(this,e)}catch(e){return t(e)}return t(null)}let n=null,r={...e},i={id:r.id,jsonrpc:r.jsonrpc};try{await io(o9,oX,oQ).call(o9,r,i,it(this,oz))}catch(e){n=e}return n&&(delete i.result,i.error||(i.error=og(n))),t(n,i)},oX=new WeakSet,oQ=async function(e,t,n){let[r,i,o]=await io(o9,o0,o1).call(o9,e,t,n);if(io(o9,o4,o6).call(o9,e,t,i),await io(o9,o5,o8).call(o9,o),r)throw r},o0=new WeakSet,o1=async function(e,t,n){let r=[],i=null,o=!1;for(let a of n)if([i,o]=await io(o9,o2,o3).call(o9,e,t,a,r),o)break;return[i,o,r.reverse()]},o2=new WeakSet,o3=async function(e,t,n,r){return new Promise(i=>{let o=e=>{let n=e||t.error;n&&(t.error=og(n)),i([n,!0])};try{n(e,t,n=>{t.error?o(t.error):(n&&("function"!=typeof n&&o(new oI(ia.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof n}" for request:
3${ae(e)}`,{request:e})),r.push(n)),i([null,!1]))},o)}catch(e){o(e)}})},o5=new WeakSet,o8=async function(e){for(let t of e)await new Promise((e,n)=>{t(t=>t?n(t):e())})},o4=new WeakSet,o6=function(e,t,n){if(!ic(t,"result")&&!ic(t,"error"))throw new oI(ia.internal,`JsonRpcEngine: Response has no error or result for request:
4${ae(e)}`,{request:e});if(!n)throw new oI(ia.internal,`JsonRpcEngine: Nothing ended request:
5${ae(e)}`,{request:e})},ir(o9,oX),ir(o9,o0),ir(o9,o2),ir(o9,o5),ir(o9,o4);var at=Object.freeze(["eth_subscription"]),an=(e=console)=>{var t;return[(e,t,n,r)=>{let i=e.id,o=r9=(r9+1)%0xffffffff;e.id=o,t.id=o,n(n=>{e.id=i,t.id=i,n()})},(t=e,(e,n,r)=>{"string"==typeof e.method&&e.method||(n.error=oL({message:"The request 'method' must be a non-empty string.",data:e})),r(e=>{let{error:r}=n;return r&&t.error(`MetaMask - RPC Error: ${r.message}`,r),e()})}),function(e){let t={ethDecryptDeprecation:!1,ethGetEncryptionPublicKeyDeprecation:!1,walletWatchAssetNFTExperimental:!1};return(n,r,i)=>{t.ethDecryptDeprecation||"eth_decrypt"!==n.method?t.ethGetEncryptionPublicKeyDeprecation||"eth_getEncryptionPublicKey"!==n.method?!t.walletWatchAssetNFTExperimental&&"wallet_watchAsset"===n.method&&["ERC721","ERC1155"].includes(n.params?.type||"")&&(e.warn(r7.warnings.rpc.walletWatchAssetNFTExperimental),t.walletWatchAssetNFTExperimental=!0):(e.warn(r7.warnings.rpc.ethGetEncryptionPublicKeyDeprecation),t.ethGetEncryptionPublicKeyDeprecation=!0):(e.warn(r7.warnings.rpc.ethDecryptDeprecation),t.ethDecryptDeprecation=!0),i()}}(e)]},ar=(e,t,n=!0)=>(r,i)=>{r||i.error?t(r||i.error):!n||Array.isArray(i)?e(i):e(i.result)},ai=e=>!!e&&"string"==typeof e&&e.startsWith("0x"),ao=()=>{};async function aa(e,t){try{let t=await async function(){return{name:function(e){let{document:t}=e,n=t.querySelector('head > meta[property="og:site_name"]');if(n)return n.content;let r=t.querySelector('head > meta[name="title"]');return r?r.content:t.title&&t.title.length>0?t.title:window.location.hostname}(window),icon:await as(window)}}();e.handle({jsonrpc:"2.0",id:1,method:"metamask_sendDomainMetadata",params:t},ao)}catch(e){t.error({message:r7.errors.sendSiteMetadata(),originalError:e})}}async function as(e){let{document:t}=e;for(let e of Array.from(t.querySelectorAll('head > link[rel~="icon"]')))if(e&&await al(e.href))return e.href;return null}async function al(e){return new Promise((t,n)=>{try{let n=document.createElement("img");n.onload=()=>t(!0),n.onerror=()=>t(!1),n.src=e}catch(e){n(e)}})}var ac=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ad=(e,t,n)=>(ac(e,t,"read from private field"),n?n.call(e):t.get(e)),au=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ah=(e,t,n,r)=>(ac(e,t,"write to private field"),t.set(e,n),n);function af(e,t,n){try{Reflect.apply(e,t,n)}catch(e){setTimeout(()=>{throw e})}}class ap extends oT{emit(e,...t){let n="error"===e,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;let n=Error("Unhandled error."+(e?` (${e.message})`:""));throw n.context=e,n}let i=r[e];if(void 0===i)return!1;if("function"==typeof i)af(i,this,t);else{let e=i.length,n=function(e){let t=e.length,n=Array(t);for(let r=0;r<t;r+=1)n[r]=e[r];return n}(i);for(let r=0;r<e;r+=1)af(n[r],this,t)}return!0}}var ag,am,ay=ei(function e(t,n){if(t===n)return!0;
5if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var r,i,o,a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}),av=class e extends ap{constructor({logger:t=console,maxEventListeners:n=100,rpcMiddleware:r=[]}={}){super(),au(this,ag,void 0),au(this,am,void 0),this._log=t,this.setMaxListeners(n),this._state={...e._defaultState},ah(this,am,null),ah(this,ag,null),this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this);let i=new o9;r.forEach(e=>i.push(e)),this._rpcEngine=i}get chainId(){return ad(this,ag)}get selectedAddress(){return ad(this,am)}isConnected(){return this._state.isConnected}async request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw oL({message:r7.errors.invalidRequestArgs(),data:e});let{method:t,params:n}=e;if("string"!=typeof t||0===t.length)throw oL({message:r7.errors.invalidRequestMethod(),data:e});if(void 0!==n&&!Array.isArray(n)&&("object"!=typeof n||null===n))throw oL({message:r7.errors.invalidRequestParams(),data:e});let r=null==n?{method:t}:{method:t,params:n};return new Promise((e,t)=>{this._rpcRequest(r,ar(e,t))})}_initializeState(e){if(this._state.initialized)throw Error("Provider already initialized.");if(e){let{accounts:t,chainId:n,isUnlocked:r,networkVersion:i}=e;this._handleConnect(n),this._handleChainChanged({chainId:n,networkVersion:i}),this._handleUnlockStateChanged({accounts:t,isUnlocked:r}),this._handleAccountsChanged(t)}this._state.initialized=!0,this.emit("_initialized")}_rpcRequest(e,t){let n=t;return Array.isArray(e)||(e.jsonrpc||(e.jsonrpc="2.0"),"eth_accounts"!==e.method&&"eth_requestAccounts"!==e.method||(n=(n,r)=>{this._handleAccountsChanged(r.result??[],"eth_accounts"===e.method),t(n,r)})),this._rpcEngine.handle(e,n)}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),this._log.debug(r7.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let n;this._state.isConnected=!1,e?(n=new oI(1013,t??r7.errors.disconnected()),this._log.debug(n)):(n=new oI(1011,t??r7.errors.permanentlyDisconnected()),this._log.error(n),ah(this,ag,null),this._state.accounts=null,ah(this,am,null),this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",n)}}_handleChainChanged({chainId:e}={}){ai(e)?(this._handleConnect(e),e!==ad(this,ag)&&(ah(this,ag,e),this._state.initialized&&this.emit("chainChanged",ad(this,ag)))):this._log.error(r7.errors.invalidNetworkParams(),{chainId:e})}_handleAccountsChanged(e,t=!1){let n=e;for(let t of(Array.isArray(e)||(this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.",e),n=[]),e))if("string"!=typeof t){this._log.error("MetaMask: Received non-string account. Please report this bug.",e),n=[];break}if(!ay(this._state.accounts,n)&&(t&&null!==this._state.accounts&&this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.",n),this._state.accounts=n,ad(this,am)!==n[0]&&ah(this,am,n[0]||null),this._state.initialized)){let e=[...n];this.emit("accountsChanged",e)}}_handleUnlockStateChanged({accounts:e,isUnlocked:t}={}){"boolean"==typeof t?t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e??[])):this._log.error("MetaMask: Received invali
5d isUnlocked parameter. Please report this bug.")}};ag=new WeakMap,am=new WeakMap,av._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1};var ab,aE,aw=av,aC={exports:{}};function aS(){return aE?ab:(aE=1,ab=oj.EventEmitter)}var a_,ax=eo(en);a_="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var ak=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},aM=/%[sdj%]/g;function aA(e){if(!az(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(aO(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(e).replace(aM,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),a=r[n];n<i;a=r[++n])aU(a)||!aG(a)?o+=" "+a:o+=" "+aO(a);return o}function aI(e,t){if(aW(p.process))return function(){return aI(e,t).apply(this,arguments)};if(!0===i6.noDeprecation)return e;var n=!1;return function(){if(!n){if(i6.throwDeprecation)throw Error(t);i6.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}}var aR,aL={};function aP(e){return aW(aR)&&(aR=i6.env.NODE_DEBUG||""),aL[e=e.toUpperCase()]||(RegExp("\\b"+e+"\\b","i").test(aR)?aL[e]=function(){var t=aA.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:aL[e]=function(){}),aL[e]}function aO(e,t){var n={seen:[],stylize:aN};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),aj(t)?n.showHidden=t:t&&a5(n,t),aW(n.showHidden)&&(n.showHidden=!1),aW(n.depth)&&(n.depth=2),aW(n.colors)&&(n.colors=!1),aW(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=aT),aD(n,e,n.depth)}function aT(e,t){var n=aO.styles[t];return n?"\x1b["+aO.colors[n][0]+"m"+e+"\x1b["+aO.colors[n][1]+"m":e}function aN(e,t){return e}function aD(e,t,n){if(e.customInspect&&t&&aJ(t.inspect)&&t.inspect!==aO&&(!t.constructor||t.constructor.prototype!==t)){var r,i,o=t.inspect(n,e);return az(o)||(o=aD(e,o,n)),o}var a=function(e,t){if(aW(t))return e.stylize("undefined","undefined");if(az(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return aF(t)?e.stylize(""+t,"number"):aj(t)?e.stylize(""+t,"boolean"):aU(t)?e.stylize("null","null"):void 0}(e,t);if(a)return a;var s=Object.keys(t),l=(d={},s.forEach(function(e,t){d[e]=!0}),d);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),aY(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return a$(t);if(0===s.length){if(aJ(t)){var c=t.name?": "+t.name:"";return e.stylize("[Function"+c+"]","special")}if(aV(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(aZ(t))return e.stylize(Date.prototype.toString.call(t),"date");if(aY(t))return a$(t)}var d,u,h="",f=!1,p=["{","}"];return aK(t)&&(f=!0,p=["[","]"]),aJ(t)&&(h=" [Function"+(t.name?": "+t.name:"")+"]"),aV(t)&&(h=" "+RegExp.prototype.toString.call(t)),aZ(t)&&(h=" "+Date.prototype.toUTCString.call(t)),aY(t)&&(h=" "+a$(t)),0!==s.length||f&&0!=t.length?n<0?aV(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=f?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a<s;++a)a8(t,String(a))?o.push(aB(e,t,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(aB(e,t,n,r,i,!0))}),o}(e,t,n,l,s):s.map(function(r){return aB(e,t,n,l,r,f)}),e.seen.pop(),r=h,i=p,u.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?i[0]+(""===r?"":r+"\n ")+" "+u.join(",\n  ")+" "+i[1]:i[0]+r+" "+u.join(", ")+" "+i[1]):p[0]+h+p[1]}function a$(e){return"["+Error.prototype.toString.call(e)+"]"}function aB(e,t,n,r,i,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[
5Setter]","special")),a8(r,i)||(a="["+i+"]"),s||(0>e.seen.indexOf(l.value)?(s=aU(n)?aD(e,l.value,null):aD(e,l.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return"  "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return"   "+e}).join("\n")):s=e.stylize("[Circular]","special")),aW(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function aK(e){return Array.isArray(e)}function aj(e){return"boolean"==typeof e}function aU(e){return null===e}function aH(e){return null==e}function aF(e){return"number"==typeof e}function az(e){return"string"==typeof e}function aq(e){return"symbol"==typeof e}function aW(e){return void 0===e}function aV(e){return aG(e)&&"[object RegExp]"===a0(e)}function aG(e){return"object"==typeof e&&null!==e}function aZ(e){return aG(e)&&"[object Date]"===a0(e)}function aY(e){return aG(e)&&("[object Error]"===a0(e)||e instanceof Error)}function aJ(e){return"function"==typeof e}function aX(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function aQ(e){return A.isBuffer(e)}function a0(e){return Object.prototype.toString.call(e)}function a1(e){return e<10?"0"+e.toString(10):e.toString(10)}aO.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},aO.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var a2=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function a3(){var e,t;console.log("%s - %s",(t=[a1((e=new Date).getHours()),a1(e.getMinutes()),a1(e.getSeconds())].join(":"),[e.getDate(),a2[e.getMonth()],t].join(" ")),aA.apply(null,arguments))}function a5(e,t){if(!t||!aG(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function a8(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var a4="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function a6(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(a4&&e[a4]){var t;if("function"!=typeof(t=e[a4]))throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,a4,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(e,r){e?n(e):t(r)});try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),a4&&Object.defineProperty(t,a4,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,ak(e))}function a7(e,t){if(!e){var n=Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}function a9(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var r=t.pop();if("function"!=typeof r)throw TypeError("The last argument must be of type Function");var i=this,o=function(){return r.apply(i,arguments)};e.apply(this,t).then(function(e){i6.nextTick(o.bind(null,null,e))},function(e){i6.nextTick(a7.bind(null,e,o))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,ak(e)),t}a6.custom=a4;var se,st,sn,sr,si=eo(Object.freeze({__proto__:null,_extend:a5,callbackify:a9,debuglog:aP,default:{inherits:a_,_extend:a5,log:a3,isBuffer:aQ,isPrimitive:aX,isFunction:aJ,isError:aY,isDate:aZ,isObject:aG,isRegExp:aV,isUndefined:aW,isSymbol:aq,isString:az,isNumber:aF,isNullOrUndefined:aH,isNull:aU,isBoolean:aj,isArray:aK,inspect:aO,deprecate:aI,format:aA,debuglog:aP,promisify:a6,callbackify:a9},deprecate:aI,format:aA,inherits:a_,inspect:aO,isArray:aK,isBoolean:aj,isBuffer:aQ,isDate:aZ,isError:aY,isFunction:aJ,isNull:aU,isNullOrUndefined:aH,isNumber:aF,isObject:aG,isPrimitive:aX,isRegExp:aV,isString:az,isSymbol:aq,isUndefined:aW,log:a3,promisify:a6}));function so(){if(sr)return sn;function e(e,r){n(e,r),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}return sr=1,sn={destroy:function(r,i){var o=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?i?i(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i6.nextTick(n,this,r)):i6.nextTick(n,this,r)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(n){!i&&n?o._writableState?o._writableState.errorEmitted?i6.nextTick(t,o):(o._writableState.errorEmitted=!0,i6.nextTick(e,o,n)):i6.nextTick(e,o,n):i?(i6.nextTick(t,o),i(n)):i6.nextTick(t,o)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}}var sa,ss,sl={},sc={};function sd(e,t,n){n||(n=Error);var r=function(e){function n(n,r,i){return e.call(this,"string"==typeof t?t:t(n,r,i))||this}return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e,n}(n);r.prototype.name=n.name,r.prototype.code=e,sc[e]=r}function su(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function sh(){if(ss)return sa;ss=1;var e=sl.codes.ERR_INVALID_OPT_VALUE;return sa={getHighWaterMark:function(t,n,r,i){var o=null!=n.highWaterMark?n.highWaterMark:i?n[r]:null;
5if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new e(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}}sd("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),sd("ERR_INVALID_ARG_TYPE",function(e,t,n){if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(r="must not be",t=t.replace(/^not /,"")):r="must be",a=" argument",(void 0===s||s>e.length)&&(s=e.length),e.substring(s-a.length,s)===a)o="The ".concat(e," ").concat(r," ").concat(su(t,"type"));else{var r,i,o,a,s,l,c=("number"!=typeof l&&(l=0),l+1>e.length||-1===e.indexOf(".",l))?"argument":"property";o='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(su(t,"type"))}return o+". Received type ".concat(typeof n)},TypeError),sd("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),sd("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),sd("ERR_STREAM_PREMATURE_CLOSE","Premature close"),sd("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),sd("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),sd("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),sd("ERR_STREAM_WRITE_AFTER_END","write after end"),sd("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),sd("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),sd("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),sl.codes=sc;var sf,sp,sg,sm,sy,sv,sb=eo(Object.freeze({__proto__:null,default:"function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}));function sE(){if(sm)return sg;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){var n=t.entry;for(t.entry=null;n;){var r=n.callback;e.pendingcb--,r(void 0),n=n.next}e.corkedRequestsFree.next=t}}sm=1,sg=w,w.WritableState=E;var t,n,r={deprecate:function(){if(sp)return sf;function e(e){try{if(!er.localStorage)return!1}catch(e){return!1}var t=er.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}return sp=1,sf=function(t,n){if(e("noDeprecation"))return t;var r=!1;return function(){if(!r){if(e("throwDeprecation"))throw Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),r=!0}return t.apply(this,arguments)}}}()},i=aS(),o=ax.Buffer,a=(void 0!==er?er:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},s=so(),l=sh().getHighWaterMark,c=sl.codes,d=c.ERR_INVALID_ARG_TYPE,u=c.ERR_METHOD_NOT_IMPLEMENTED,h=c.ERR_MULTIPLE_CALLBACK,f=c.ERR_STREAM_CANNOT_PIPE,p=c.ERR_STREAM_DESTROYED,g=c.ERR_STREAM_NULL_VALUES,m=c.ERR_STREAM_WRITE_AFTER_END,y=c.ERR_UNKNOWN_ENCODING,v=s.errorOrDestroy;function b(){}function E(n,r,i){t=t||sw(),n=n||{},"boolean"!=typeof i&&(i=r instanceof t),this.objectMode=!!n.objectMode,i&&(this.objectMode=this.objectMode||!!n.writableObjectMode),this.highWaterMark=l(this,n,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===n.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new h;if(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t)--n.pendingcb,r?(i6.nextTick(i,t),i6.nextTick(M,e,n),e._writableState.errorEmitted=!0,v(e,t)):(i(t),e._writableState.errorEmitted=!0,v(e,t),M(e,n));else{var o=x(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||_(e,n),r?i6.nextTick(S,e,n,o,i):S(e,n,o,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==n.emitClose,this.autoDestroy=!!n.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function w(e){var r=this instanceof(t=t||sw());if(!r&&!n.call(w,this))return new w(e);this._writableState=new E(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),i.call(this)}function C(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new p("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function S(e,t,n,r){n||0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain")),t.pendingcb--,r(),M(e,t)}function _(t,n){n.bufferProcessing=!0;var r=n.bufferedRequest;if(t._writev&&r&&r.next){var i=Array(n.bufferedRequestCount),o=n.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)i[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;
5i.allBuffers=s,C(t,n,!0,n.length,i,"",o.finish),n.pendingcb++,n.lastBufferedRequest=null,o.next?(n.corkedRequestsFree=o.next,o.next=null):n.corkedRequestsFree=new e(n),n.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,d=r.callback;if(C(t,n,!1,n.objectMode?1:l.length,l,c,d),r=r.next,n.bufferedRequestCount--,n.writing)break}null===r&&(n.lastBufferedRequest=null)}n.bufferedRequest=r,n.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(n){t.pendingcb--,n&&v(e,n),t.prefinished=!0,e.emit("prefinish"),M(e,t)})}function M(e,t){var n=x(t);if(n&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i6.nextTick(k,e,t))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}return sb(w,i),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(n=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(e){return!!n.call(this,e)||this===w&&e&&e._writableState instanceof E}})):n=function(e){return e instanceof this},w.prototype.pipe=function(){v(this,new f)},w.prototype.write=function(e,t,n){var r,i,s,l,c,u,h,f=this._writableState,p=!1,y=!f.objectMode&&(h=e,o.isBuffer(h)||h instanceof a);return y&&!o.isBuffer(e)&&(r=e,e=o.from(r)),"function"==typeof t&&(n=t,t=null),y?t="buffer":t||(t=f.defaultEncoding),"function"!=typeof n&&(n=b),f.ending?(i=n,v(this,s=new m),i6.nextTick(i,s)):!y&&(l=e,c=n,null===l?u=new g:"string"==typeof l||f.objectMode||(u=new d("chunk",["string","Buffer"],l)),u&&(v(this,u),i6.nextTick(c,u),1))||(f.pendingcb++,p=function(e,t,n,r,i,a){if(!n){var s,l,c=(s=r,l=i,t.objectMode||!1===t.decodeStrings||"string"!=typeof s||(s=o.from(s,l)),s);r!==c&&(n=!0,i="buffer",r=c)}var d=t.objectMode?1:r.length;t.length+=d;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var h=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},h?h.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,d,r,i,a);return u}(this,f,y,e,t,n)),p},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||_(this,e))},w.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new y(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(e,t,n){n(new u("_write()"))},w.prototype._writev=null,w.prototype.end=function(e,t,n){var r,i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||(r=n,i.ending=!0,M(this,i),r&&(i.finished?i6.nextTick(r):this.once("finish",r)),i.ended=!0,this.writable=!1),this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),w.prototype.destroy=s.destroy,w.prototype._undestroy=s.undestroy,w.prototype._destroy=function(e,t){t(e)},sg}function sw(){if(sv)return sy;sv=1;var e=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};sy=a;var t=s$(),n=sE();sb(a,t);for(var r=e(n.prototype),i=0;i<r.length;i++){var o=r[i];a.prototype[o]||(a.prototype[o]=n.prototype[o])}function a(e){if(!(this instanceof a))return new a(e);t.call(this,e),n.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||i6.nextTick(l,this)}function l(e){e.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),sy}var sC=A.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function sS(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!sC(e))throw Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=sx;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=sk;break;default:return void(this.write=s_)}this.charBuffer=new A(6),this.charReceived=0,this.charLength=0}function s_(e){return e.toString(this.encoding)}function sx(e){this.charReceived=e.length%2,this.charLength=2*!!this.charReceived}function sk(e){this.charReceived=e.length%3,this.charLength=3*!!this.charReceived}sS.prototype.write=function(e){for(var t,n="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!((t=(n=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCo
5deAt(n.length-1))>=55296&&t<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return n;break}this.charLength+=this.surrogateSize,n=""}this.detectIncompleteChar(e);var i=e.length;if(this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),i=(n+=e.toString(this.encoding,0,i)).length-1,(t=n.charCodeAt(i))>=55296&&t<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),n.substring(0,i)}return n},sS.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},sS.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t};var sM=eo(Object.freeze({__proto__:null,StringDecoder:sS})),sA=sl.codes.ERR_STREAM_PREMATURE_CLOSE;function sI(){}var sR,sL,sP,sO,sT,sN,sD=function e(t,n,r){if("function"==typeof n)return e(t,null,n);n||(n={}),i=r||sI,o=!1,r=function(){if(!o){o=!0;for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];i.apply(this,t)}};var i,o,a=n.readable||!1!==n.readable&&t.readable,s=n.writable||!1!==n.writable&&t.writable,l=function(){t.writable||d()},c=t._writableState&&t._writableState.finished,d=function(){s=!1,c=!0,a||r.call(t)},u=t._readableState&&t._readableState.endEmitted,h=function(){a=!1,u=!0,s||r.call(t)},f=function(e){r.call(t,e)},p=function(){var e;return a&&!u?(t._readableState&&t._readableState.ended||(e=new sA),r.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new sA),r.call(t,e)):void 0},g=function(){t.req.on("finish",d)};return t.setHeader&&"function"==typeof t.abort?(t.on("complete",d),t.on("abort",p),t.req?g():t.on("request",g)):s&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",h),t.on("finish",d),!1!==n.error&&t.on("error",f),t.on("close",p),function(){t.removeListener("complete",d),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",d),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",d),t.removeListener("end",h),t.removeListener("error",f),t.removeListener("close",p)}};function s$(){if(sN)return sT;sN=1,sT=E,E.ReadableState=b,oj.EventEmitter;var e=function(e,t){return e.listeners(t).length},t=aS(),n=ax.Buffer,r=(void 0!==er?er:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},i,o,a,s,l=si&&si.debuglog?si.debuglog("stream"):function(){},c=function(){if(st)return se;function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach(function(e){var r,o,a;r=t,o=e,a=i[e],(o=n(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function n(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}st=1;var r=ax.Buffer,i=si.inspect,o=i&&i.custom||"inspect";return se=function(){var e;function a(){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,a),this.head=null,this.tail=null,this.length=0}return e=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return r.alloc(0);for(var t,n,i=r.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,n=a,r.prototype.copy.call(t,i,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=r.allocUnsafe(e),n=this.head,i=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0==(e-=a)){a===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++i}return this.length-=i,t}},{key:o,value:function(e,n){return i(this,t(t({},n),{},{depth:0,customInspect:!1}))}}],function(e,t){for(var r=0;r<t.length;r++){var i=t[r];
vendor: 5,513 bytes, line 5
5i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}(a.prototype,e),Object.defineProperty(a,"prototype",{writable:!1}),a}()}(),d=so(),u=sh().getHighWaterMark,h=sl.codes,f=h.ERR_INVALID_ARG_TYPE,p=h.ERR_STREAM_PUSH_AFTER_EOF,g=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;sb(E,t);var y=d.errorOrDestroy,v=["error","close","destroy","pause","resume"];function b(e,t,n){i=i||sw(),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=u(this,e,"readableHighWaterMark",n),this.buffer=new c,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=sM.StringDecoder),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function E(e){if(i=i||sw(),!(this instanceof E))return new E(e);var n=this instanceof i;this._readableState=new b(e,this,n),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),t.call(this)}function w(e,t,i,o,a){l("readableAddChunk",t);var s,c,d,u,h,g=e._readableState;if(null===t)g.reading=!1,function(e,t){if(l("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?_(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,x(e)))}}(e,g);else{if(a||(s=g,c=t,n.isBuffer(c)||c instanceof r||"string"==typeof c||void 0===c||s.objectMode||(d=new f("chunk",["string","Buffer","Uint8Array"],c)),h=d),h)y(e,h);else if(g.objectMode||t&&t.length>0)if("string"==typeof t||g.objectMode||Object.getPrototypeOf(t)===n.prototype||(u=t,t=n.from(u)),o)g.endEmitted?y(e,new m):C(e,g,t,!0);else if(g.ended)y(e,new p);else{if(g.destroyed)return!1;g.reading=!1,g.decoder&&!i?(t=g.decoder.write(t),g.objectMode||0!==t.length?C(e,g,t,!1):k(e,g)):C(e,g,t,!1)}else o||(g.reading=!1,k(e,g))}return!g.ended&&(g.length<g.highWaterMark||0===g.length)}function C(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&_(e)),k(e,t)}function S(e,t){var n;return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&((n=e)>=0x40000000?n=0x40000000:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),t.highWaterMark=n),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function _(e){var t=e._readableState;l("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,i6.nextTick(x,e))}function x(e){var t=e._readableState;l("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function k(e,t){t.readingMore||(t.readingMore=!0,i6.nextTick(M,e,t))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(l("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function A(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){l("readable nexttick read 0"),e.read(0)}function R(e,t){l("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){var n;return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n)}function O(e){var t=e._readableState;l("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i6.nextTick(T,t,e))}function T(e,t){if(l("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function N(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return -1}return Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=d.destroy,E.prototype._undestroy=d.undestroy,E.prototype._destroy=function(e,t){t(e)},E.prototype.push=function(e,t){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=n.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},E.prototype.unshift=function(e){return w(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(e){o||(o=sM.StringDecoder);var t=new o(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;
vendor: 2,616 bytes, line 5
5for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},E.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):_(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(n,t))),null===(r=e>0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},E.prototype._read=function(e){y(this,new g("_read()"))},E.prototype.pipe=function(t,n){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,l("pipe count=%d opts=%j",i.pipesCount,n);var o=n&&!1===n.end||t===i6.stdout||t===i6.stderr?p:a;function a(){l("onend"),t.end()}i.endEmitted?i6.nextTick(o):r.once("end",o),t.on("unpipe",function e(n,o){l("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,l("cleanup"),t.removeListener("close",h),t.removeListener("finish",f),t.removeListener("drain",s),t.removeListener("error",u),t.removeListener("unpipe",e),r.removeListener("end",a),r.removeListener("end",p),r.removeListener("data",d),c=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&s())});var s=function(){var t=r._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e(r,"data")&&(t.flowing=!0,L(r))};t.on("drain",s);var c=!1;function d(e){l("ondata");var n=t.write(e);l("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==N(i.pipes,t))&&!c&&(l("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function u(n){l("onerror",n),p(),t.removeListener("error",u),0===e(t,"error")&&y(t,n)}function h(){t.removeListener("finish",f),p()}function f(){l("onfinish"),t.removeListener("close",h),p()}function p(){l("unpipe"),r.unpipe(t)}return r.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prepe
vendor: 4,554 bytes, line 5
5ndListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(t,"error",u),t.once("close",h),t.once("finish",f),t.emit("pipe",r),i.flowing||(l("pipe resume"),r.resume()),t},E.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=N(t.pipes,e);return -1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},E.prototype.on=function(e,n){var r=t.prototype.on.call(this,e,n),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,l("on readable",i.length,i.reading),i.length?_(this):i.reading||i6.nextTick(I,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,n){var r=t.prototype.removeListener.call(this,e,n);return"readable"===e&&i6.nextTick(A,this),r},E.prototype.removeAllListeners=function(e){var n=t.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i6.nextTick(A,this),n},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!e.readableListening,e.resumeScheduled||(e.resumeScheduled=!0,i6.nextTick(R,this,e))),e.paused=!1,this},E.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(l("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){l("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<v.length;o++)e.on(v[o],this.emit.bind(this,v[o]));return this._read=function(t){l("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return void 0===a&&(a=function(){if(sL)return sR;function e(e,t,n){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}sL=1;var t,n=Symbol("lastResolve"),r=Symbol("lastReject"),i=Symbol("error"),o=Symbol("ended"),a=Symbol("lastPromise"),s=Symbol("handlePromise"),l=Symbol("stream");function c(e,t){return{value:e,done:t}}function d(e){var t=e[n];if(null!==t){var i=e[l].read();null!==i&&(e[a]=null,e[n]=null,e[r]=null,t(c(i,!1)))}}function u(e){i6.nextTick(d,e)}var h=Object.getPrototypeOf(function(){}),f=Object.setPrototypeOf((e(t={get stream(){return this[l]},next:function(){var e,t=this,n=this[i];if(null!==n)return Promise.reject(n);if(this[o])return Promise.resolve(c(void 0,!0));if(this[l].destroyed)return new Promise(function(e,n){i6.nextTick(function(){t[i]?n(t[i]):e(c(void 0,!0))})});var r,d=this[a];if(d)r=new Promise((e=this,function(t,n){d.then(function(){e[o]?t(c(void 0,!0)):e[s](t,n)},n)}));else{var u=this[l].read();if(null!==u)return Promise.resolve(c(u,!1));r=new Promise(this[s])}return this[a]=r,r}},Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var e=this;return new Promise(function(t,n){e[l].destroy(null,function(e){e?n(e):t(c(void 0,!0))})})}),t),h);return sR=function(t){var d,h=Object.create(f,(e(d={},l,{value:t,writable:!0}),e(d,n,{value:null,writable:!0}),e(d,r,{value:null,writable:!0}),e(d,i,{value:null,writable:!0}),e(d,o,{value:t._readableState.endEmitted,writable:!0}),e(d,s,{value:function(e,t){var i=h[l].read();i?(h[a]=null,h[n]=null,h[r]=null,e(c(i,!1))):(h[n]=e,h[r]=t)},writable:!0}),d));
5return h[a]=null,sD(t,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=h[r];return null!==t&&(h[a]=null,h[n]=null,h[r]=null,t(e)),void(h[i]=e)}var s=h[n];null!==s&&(h[a]=null,h[n]=null,h[r]=null,s(c(void 0,!0))),h[o]=!0}),t.on("readable",u.bind(null,h)),h}}()),a(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=P,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(E.from=function(e,t){return void 0===s&&(s=sO?sP:(sO=1,sP=function(){throw Error("Readable.from is not available in the browser")})),s(E,e,t)}),sT}var sB=sl.codes,sK=sB.ERR_METHOD_NOT_IMPLEMENTED,sj=sB.ERR_MULTIPLE_CALLBACK,sU=sB.ERR_TRANSFORM_ALREADY_TRANSFORMING,sH=sB.ERR_TRANSFORM_WITH_LENGTH_0,sF=sw();function sz(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new sj);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function sq(e){if(!(this instanceof sq))return new sq(e);sF.call(this,e),this._transformState={afterTransform:sz.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",sW)}function sW(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?sV(this,null,null):this._flush(function(t,n){sV(e,t,n)})}function sV(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new sH;if(e._transformState.transforming)throw new sU;return e.push(null)}function sG(e){if(!(this instanceof sG))return new sG(e);sq.call(this,e)}sb(sq,sF),sq.prototype.push=function(e,t){return this._transformState.needTransform=!1,sF.prototype.push.call(this,e,t)},sq.prototype._transform=function(e,t,n){n(new sK("_transform()"))},sq.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},sq.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},sq.prototype._destroy=function(e,t){sF.prototype._destroy.call(this,e,function(e){t(e)})},sb(sG,sq),sG.prototype._transform=function(e,t,n){n(null,e)};var sZ=sl.codes,sY=sZ.ERR_MISSING_ARGS,sJ=sZ.ERR_STREAM_DESTROYED;function sX(e){if(e)throw e}function sQ(e){e()}function s0(e,t){return e.pipe(t)}var s1=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i,o=(r=t).length?"function"!=typeof r[r.length-1]?sX:r.pop():sX;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new sY("streams");var a=t.map(function(e,n){var r,s,l,c,d,u=n<t.length-1;return s=r=function(e){i||(i=e),e&&a.forEach(sQ),u||(a.forEach(sQ),o(i))},l=!1,r=function(){l||(l=!0,s.apply(void 0,arguments))},c=!1,e.on("close",function(){c=!0}),void 0===ll&&(ll=sD),ll(e,{readable:u,writable:n>0},function(e){if(e)return r(e);c=!0,r()}),d=!1,function(t){if(!c&&!d)return d=!0,e.setHeader&&"function"==typeof e.abort?e.abort():"function"==typeof e.destroy?e.destroy():void r(t||new sJ("pipe"))}});return t.reduce(s0)};!function(e,t){(t=aC.exports=s$()).Stream=t,t.Readable=t,t.Writable=sE(),t.Duplex=sw(),t.Transform=sq,t.PassThrough=sG,t.finished=sD,t.pipeline=s1}
5(0,aC.exports);var s2=aC.exports,s3={},s5={exports:{}},s8=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw TypeError("need wrapper function");return Object.keys(t).forEach(function(e){r[e]=t[e]}),r;function r(){for(var e=Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];var r=t.apply(this,e),i=e[e.length-1];return"function"==typeof r&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}};function s4(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function s6(e){var t=function(){if(t.called)throw Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)};return t.onceError=(e.name||"Function wrapped with `once`")+" shouldn't be called more than once",t.called=!1,t}s5.exports=s8(s4),s5.exports.strict=s8(s6),s4.proto=s4(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return s4(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s6(this)},configurable:!0})});var s7=s5.exports,s9={};Object.defineProperty(s9,"__esModule",{value:!0}),s9.Substream=void 0;let le=s2;class lt extends le.Duplex{constructor({parent:e,name:t}){super({objectMode:!0}),this._parent=e,this._name=t}_read(){}_write(e,t,n){this._parent.push({name:this._name,data:e}),n()}}s9.Substream=lt;var ln=er&&er.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s3,"__esModule",{value:!0}),s3.ObjectMultiplex=void 0;
5let lr=s2,li=ln(s7),lo=Symbol("IGNORE_SUBSTREAM");s3.ObjectMultiplex=class extends lr.Duplex{constructor(e={}){super(Object.assign(Object.assign({},e),{objectMode:!0})),this._substreams={}}createStream(e){if(this.destroyed)throw Error(`ObjectMultiplex - parent stream for name "${e}" already destroyed`);if(this._readableState.ended||this._writableState.ended)throw Error(`ObjectMultiplex - parent stream for name "${e}" already ended`);if(!e)throw Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw Error(`ObjectMultiplex - Substream for name "${e}" already exists`);let t=new s9.Substream({parent:this,name:e});return this._substreams[e]=t,function(e,t){let n=(0,li.default)(t);(0,lr.finished)(e,{readable:!1},n),(0,lr.finished)(e,{writable:!1},n)}(this,e=>t.destroy(e||void 0)),t}ignoreStream(e){if(!e)throw Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw Error(`ObjectMultiplex - Substream for name "${e}" already exists`);this._substreams[e]=lo}_read(){}_write(e,t,n){let{name:r,data:i}=e;if(!r)return console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),n();let o=this._substreams[r];return o?o!==lo&&o.push(i):console.warn(`ObjectMultiplex - orphaned data for stream "${r}"`),n()}};var la=ei(s3.ObjectMultiplex);let ls=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;ls.writable=e=>ls(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState,ls.readable=e=>ls(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState,ls.duplex=e=>ls.writable(e)&&ls.readable(e),ls.transform=e=>ls.duplex(e)&&"function"==typeof e._transform;var ll,lc,ld=class extends aw{constructor(e,{jsonRpcStreamName:t,logger:n=console,maxEventListeners:r=100,rpcMiddleware:i=[]}){if(super({logger:n,maxEventListeners:r,rpcMiddleware:i}),!ls.duplex(e))throw Error(r7.errors.invalidDuplexStream());this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this);let o=new la;s2.pipeline(e,o,e,this._handleStreamDisconnect.bind(this,"MetaMask")),this._jsonRpcConnection=function(e={}){let t={},n=new s2.Duplex({objectMode:!0,read:()=>{},write:function(i,o,a){let s=null;try{i.id?function(e){let{id:n}=e;if(null===n)return;let r=t[n];if(!r)return console.warn(`StreamMiddleware - Unknown response id "${n}"`);delete t[n],Object.assign(r.res,e),setTimeout(r.end)}(i):(e?.retryOnMessage&&i.method===e.retryOnMessage&&Object.values(t).forEach(({req:e,retryCount:r=0})=>{var i;if(!e.id)return;if(r>=3)throw Error(`StreamMiddleware - Retry limit exceeded for request id "${e.id}"`);let o=t[e.id];o&&(o.retryCount=r+1),i=e,n.push(i)}),r.emit("notification",i))}catch(e){s=e}a(s)}}),r=new o7;return{events:r,middleware:(e,r,i,o)=>{var a;t[e.id]={req:e,res:r,next:i,end:o},a=e,n.push(a)},stream:n}}({retryOnMessage:"METAMASK_EXTENSION_CONNECT_CAN_RETRY"}),s2.pipeline(this._jsonRpcConnection.stream,o.createStream(t),this._jsonRpcConnection.stream,this._handleStreamDisconnect.bind(this,"MetaMask RpcProvider")),this._rpcEngine.push(this._jsonRpcConnection.middleware),this._jsonRpcConnection.events.on("notification",t=>{let{method:n,params:r}=t;"metamask_accountsChanged"===n?this._handleAccountsChanged(r):"metamask_unlockStateChanged"===n?this._handleUnlockStateChanged(r):"metamask_chainChanged"===n?this._handleChainChanged(r):at.includes(n)?this.emit("message",{type:n,data:r}):"METAMASK_STREAM_FAILURE"===n&&e.destroy(Error(r7.errors.permanentlyDisconnected()))})}async _initializeStateAsync(){let e;try{e=await this.request({method:"metamask_getProviderState"})}catch(e){this._log.error("MetaMask: Failed to get initial state. Please report this bug.",e)}this._initializeState(e)}_handleStreamDisconnect(e,t){let n=`MetaMask: Lost connection to "${e}".`;t?.stack&&(n+=`
6${t.stack}`),this._log.warn(n),this.listenerCount("error")>0&&this.emit("error",n),this._handleDisconnect(!1,t?t.message:void 0)}_handleChainChanged({chainId:e,networkVersion:t}={}){let n;ai(e)&&(n=t)&&"string"==typeof n?"loading"===t?this._handleDisconnect(!0):super._handleChainChanged({chainId:e}):this._log.error(r7.errors.invalidNetworkParams(),{chainId:e,networkVersion:t})}},lu=class extends ld{constructor(e,{jsonRpcStreamName:t="metamask-provider",logger:n=console,maxEventListeners:r=100,shouldSe
6ndMetadata:i}={}){if(super(e,{jsonRpcStreamName:t,logger:n,maxEventListeners:r,rpcMiddleware:an(n)}),this._sentWarnings={chainId:!1,networkVersion:!1,selectedAddress:!1,enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},au(this,lc,void 0),this._initializeStateAsync(),ah(this,lc,null),this.isMetaMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._metamask=this._getExperimentalApi(),this._jsonRpcConnection.events.on("notification",e=>{let{method:t}=e;at.includes(t)&&(this.emit("data",e),this.emit("notification",e.params.result))}),i)if("complete"===document.readyState)aa(this._rpcEngine,this._log);else{let e=()=>{aa(this._rpcEngine,this._log),window.removeEventListener("DOMContentLoaded",e)};window.addEventListener("DOMContentLoaded",e)}}get chainId(){return this._sentWarnings.chainId||(this._log.warn(r7.warnings.chainIdDeprecation),this._sentWarnings.chainId=!0),super.chainId}get networkVersion(){return this._sentWarnings.networkVersion||(this._log.warn(r7.warnings.networkVersionDeprecation),this._sentWarnings.networkVersion=!0),ad(this,lc)}get selectedAddress(){return this._sentWarnings.selectedAddress||(this._log.warn(r7.warnings.selectedAddressDeprecation),this._sentWarnings.selectedAddress=!0),super.selectedAddress}sendAsync(e,t){this._rpcRequest(e,t)}addListener(e,t){return this._warnOfDeprecation(e),super.addListener(e,t)}on(e,t){return this._warnOfDeprecation(e),super.on(e,t)}once(e,t){return this._warnOfDeprecation(e),super.once(e,t)}prependListener(e,t){return this._warnOfDeprecation(e),super.prependListener(e,t)}prependOnceListener(e,t){return this._warnOfDeprecation(e),super.prependOnceListener(e,t)}_handleDisconnect(e,t){super._handleDisconnect(e,t),ad(this,lc)&&!e&&ah(this,lc,null)}_warnOfDeprecation(e){!1===this._sentWarnings?.events[e]&&(this._log.warn(r7.warnings.events[e]),this._sentWarnings.events[e]=!0)}async enable(){return this._sentWarnings.enable||(this._log.warn(r7.warnings.enableDeprecation),this._sentWarnings.enable=!0),new Promise((e,t)=>{try{this._rpcRequest({method:"eth_requestAccounts",params:[]},ar(e,t))}catch(e){t(e)}})}send(e,t){return this._sentWarnings.send||(this._log.warn(r7.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof e||t&&!Array.isArray(t)?e&&"object"==typeof e&&"function"==typeof t?this._rpcRequest(e,t):this._sendSync(e):new Promise((n,r)=>{try{this._rpcRequest({method:e,params:t},ar(n,r,!1))}catch(e){r(e)}})}_sendSync(e){let t;switch(e.method){case"eth_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":t=this.selectedAddress??null;break;case"eth_uninstallFilter":this._rpcRequest(e,ao),t=!0;break;case"net_version":t=ad(this,lc)??null;break;default:throw Error(r7.errors.unsupportedSync(e.method))}return{id:e.id,jsonrpc:e.jsonrpc,result:t}}_getExperimentalApi(){return new Proxy({isUnlocked:async()=>(this._state.initialized||await new Promise(e=>{this.on("_initialized",()=>e())}),this._state.isUnlocked),requestBatch:async e=>{if(!Array.isArray(e))throw oL({message:"Batch requests must be made with an array of request objects.",data:e});return new Promise((t,n)=>{this._rpcRequest(e,ar(t,n))})}},{get:(e,t,...n)=>(this._sentWarnings.experimentalMethods||(this._log.warn(r7.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(e,t,...n))})}_handleChainChanged({chainId:e,networkVersion:t}={}){super._handleChainChanged({chainId:e,networkVersion:t}),this._state.isConnected&&t!==ad(this,lc)&&(ah(this,lc,t),this._state.initialized&&this.emit("networkChanged",ad(this,lc)))}};lc=new WeakMap;let lh=s()("MM_SDK");lh.color="#FFAC1C";var lf={},lp={};Object.defineProperty(lp,"__esModule",{value:!0}),lp.EthereumProviderError=lp.EthereumRpcError=void 0;class lg extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}serialize(){let e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return oS.default(this.serialize(),lm,2)}}function lm(e,t){if("[Circular]"!==t)return t}lp.EthereumRpcError=lg,lp.EthereumProviderError=class extends lg{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw Error('"code" must be an integer such that: 1000 <= code 
6<= 4999');super(e,t,n)}};var ly={},lv={};Object.defineProperty(lv,"__esModule",{value:!0}),lv.errorValues=lv.errorCodes=void 0,lv.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},lv.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;let t=lv.errorCodes.rpc.internal,n={code:t,message:r(t)};function r(t,n="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(t)){var i;let n=t.toString();if(a(lv.errorValues,n))return lv.errorValues[n].message;if((i=t)>=-32099&&i<=-32e3)return e.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function i(e){var t;if(!Number.isInteger(e))return!1;let n=e.toString();return!!lv.errorValues[n]||!!((t=e)>=-32099&&t<=-32e3)}function o(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=r,e.isValidCode=i,e.serializeError=function(e,{fallbackError:t=n,shouldIncludeStack:s=!1}={}){if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw Error("Must provide fallback error with integer number code and string message.");if(e instanceof lp.EthereumRpcError)return e.serialize();let l={};if(e&&"object"==typeof e&&!Array.isArray(e)&&a(e,"code")&&i(e.code))l.code=e.code,e.message&&"string"==typeof e.message?(l.message=e.message,a(e,"data")&&(l.data=e.data)):(l.message=r(l.code),l.data={originalError:o(e)});else{l.code=t.code;let n=null==e?void 0:e.message;l.message=n&&"string"==typeof n?n:t.message,l.data={originalError:o(e)}}let c=null==e?void 0:e.stack;return s&&e&&c&&"string"==typeof c&&(l.stack=c),l}}(ly);var lb={};function lE(e,t){let[n,r]=lC(t);return new lp.EthereumRpcError(e,n||ly.getMessageFromCode(e),r)}function lw(e,t){let[n,r]=lC(t);return new lp.EthereumProviderError(e,n||ly.getMessageFromCode(e),r)}function lC(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:n}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t||void 0,n]}}return[]}Object.defineProperty(lb,"__esModule",{value:!0}),lb.ethErrors=void 0,lb.ethErrors={rpc:{parse:e=>lE(lv.errorCodes.rpc.parse,e),invalidRequest:e=>lE(lv.errorCodes.rpc.invalidRequest,e),invalidParams:e=>lE(lv.errorCodes.rpc.invalidParams,e),methodNotFound:e=>lE(lv.errorCodes.rpc.methodNotFound,e),internal:e=>lE(lv.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code 
6<= -32005');return lE(t,e)},invalidInput:e=>lE(lv.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>lE(lv.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>lE(lv.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>lE(lv.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>lE(lv.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>lE(lv.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>lw(lv.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>lw(lv.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>lw(lv.errorCodes.provider.unsupportedMethod,e),disconnected:e=>lw(lv.errorCodes.provider.disconnected,e),chainDisconnected:e=>lw(lv.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:n,data:r}=e;if(!n||"string"!=typeof n)throw Error('"message" must be a nonempty string');return new lp.EthereumProviderError(t,n,r)}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0,Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return lp.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return lp.EthereumProviderError}}),Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return ly.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return ly.getMessageFromCode}}),Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return lb.ethErrors}}),Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return lv.errorCodes}})}(lf);var lS={exports:{}};lS.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18);t.default=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),a=Math.max(i,o),s=0,l=e.map([t,n],function(t){var n=a-e.getVersionPrecision(t),r=t+Array(n+1).join(".0");return e.map(r.split("."),function(e){return Array(20-e.length).join("0")+e}).reverse()});for(r&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===s)return 0;a-=1}else if(l[0][a]<l[1][a])return -1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(i));for(t=0,n=i.length;t<n;t+=1)(function(){var n=i[t];
6"object"==typeof n&&null!==n&&Object.keys(n).forEach(function(t){e[t]=n[t]})})();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}(),e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},o=n(18);t.default=function(){function e(){}return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}]),e}(),e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=l(n(92)),i=l(n(93)),o=l(n(94)),a=l(n(95)),s=l(n(17));function l(e){return e&&e.__esModule?e:{default:e}}t.default=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(r.default,function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some(function(t){return e.test(t)});throw Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,function(t){if("function"==typeof t.test)return t.test(e);
vendor: 17,757 bytes, line 6
6if(t.test instanceof Array)return t.test.some(function(t){return e.test(t)});throw Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(o.default,function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some(function(t){return e.test(t)});throw Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(a.default,function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some(function(t){return e.test(t)});throw Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},o=0;if(Object.keys(e).forEach(function(t){var a=e[t];"string"==typeof a?(i[t]=a,o+=1):"object"==typeof a&&(n[t]=a,r+=1)}),r>0){var a=Object.keys(n),l=s.default.find(a,function(e){return t.isOS(e)});if(l){var c=this.satisfies(n[l]);if(void 0!==c)return c}var d=s.default.find(a,function(e){return t.isPlatform(e)});if(d){var u=this.satisfies(n[d]);if(void 0!==u)return u}}if(o>0){var h=Object.keys(i),f=s.default.find(h,function(e){return t.isBrowser(e,!0)});if(void 0!==f)return this.compareVersion(i[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some(function(e){return t.is(e)})},e}(),e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i;t.default=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}],e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18);t.default=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}],e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18);t.default=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}],e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18);t.default=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}],e.exports=t.default}});var l_=ei(lS.exports);let lx={Initialized:"initialized",DisplayURI:"display_uri",ProviderUpdate:"provider_update",ConnectWithResponse:"connectWithResponse",ConnectionStatus:"connection_status",ServiceStatus:"service_status"};class lk{constructor({shouldSetOnWindow:e,connectionStream:t,shouldSe
6ndMetadata:n=!1,shouldShimWeb3:r,sdkInstance:i}){let o=new lI({connectionStream:t,shouldSendMetadata:n,shouldSetOnWindow:e,shouldShimWeb3:r,autoRequestAccounts:!1}),a=new Proxy(o,{deleteProperty:()=>!0});if(this.provider=a,this.sdkInstance=i,e&&"undefined"!=typeof window)try{window.ethereum=o,window.dispatchEvent(new Event("ethereum#initialized"))}catch(e){lh("[Ethereum] Unable to set global provider - window.ethereum may be read-only",e)}if(r&&"undefined"!=typeof window)try{!function(e,t=console){let n=!1,r=!1;if(!window.web3){let i="__isMetaMaskShim__",o={currentProvider:e};Object.defineProperty(o,i,{value:!0,enumerable:!0,configurable:!1,writable:!1}),o=new Proxy(o,{get:(o,a,...s)=>("currentProvider"!==a||n?"currentProvider"===a||a===i||r||(r=!0,t.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),e.request({method:"metamask_logWeb3ShimUsage"}).catch(e=>{t.debug("MetaMask: Failed to log web3 shim usage.",e)})):(n=!0,t.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")),Reflect.get(o,a,...s)),set:(...e)=>(t.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),Reflect.set(...e))}),Object.defineProperty(window,"web3",{value:o,enumerable:!1,configurable:!0,writable:!0})}}(this.provider)}catch(e){lh("[Ethereum] Unable to shim web3 - window.web3 may be read-only",e)}this.provider.on("display_uri",e=>{this.sdkInstance.emit(lx.DisplayURI,e)}),this.provider.on("_initialized",()=>{let e={chainId:this.provider.getChainId(),isConnected:this.provider.isConnected(),isMetaMask:this.provider.isMetaMask,selectedAddress:this.provider.getSelectedAddress(),networkVersion:this.provider.getNetworkVersion()};this.sdkInstance.emit(lx.Initialized,e),lh("[Ethereum: constructor()] provider initialized",e)})}static init(e){var t;return lh("[Ethereum: init()] Initializing Ethereum service"),this.instance=new lk(e),null===(t=this.instance)||void 0===t?void 0:t.provider}static destroy(){}static getInstance(){var e;if(!(null===(e=this.instance)||void 0===e?void 0:e.provider))throw Error("Ethereum instance not intiialized - call Ethereum.factory first.");return this.instance}static getProvider(){var e;if(!(null===(e=this.instance)||void 0===e?void 0:e.provider))throw Error("Ethereum instance not intiialized - call Ethereum.factory first.");return this.instance.provider}}class lM{constructor({useDeepLink:e,preferredOpenLink:t,debug:n=!1}){this.state={platformType:void 0,useDeeplink:!1,preferredOpenLink:void 0,debug:!1},this.state.platformType=this.getPlatformType(),this.state.useDeeplink=e,this.state.preferredOpenLink=t,this.state.debug=n}openDeeplink(e,t,n){let{state:r}=this;lh(`[PlatfformManager: openDeeplink()] universalLink --> ${e}`),lh(`[PlatfformManager: openDeeplink()] deepLink --> ${t}`);try{if(r.preferredOpenLink)return void r.preferredOpenLink(r.useDeeplink?t:e,n);if(lh(`[PlatfformManager: openDeeplink()] open link now useDeepLink=${r.useDeeplink} link=${r.useDeeplink?t:e}`),r.useDeeplink)"undefined"!=typeof window&&(window.location.href=t);else if("undefined"!=typeof document){let t=document.createElement("a");t.href=e,t.target="_self",t.rel="noreferrer noopener",t.click()}}catch(e){console.log("[PlatfformManager: openDeeplink()] can't open link",e)}}isReactNative(){var e;return this.isNotBrowser()&&"undefined"!=typeof window&&(null==window?void 0:window.navigator)&&"ReactNative"===(null===(e=window.navigator)||void 0===e?void 0:e.product)}isMetaMaskInstalled(){let e=lk.getProvider()||(null==window?void 0:window.ethereum);return lh(`[PlatfformManager: isMetaMaskInstalled()] isMetaMask=${null==e?void 0:e.isMetaMask} isConnected=${null==e?void 0:e.isConnected()}`),(null==e?void 0:e.isMetaMask)&&(null==e?void 0:e.isConnected())}isDesktopWeb(){return this.isBrowser()&&!this.isMobileWeb()}isMobile(){var e,t;let n=l_.parse(window.navigator.userAgent);return"mobile"===(null===(e=null==n?void 0:n.platform)||void 0===e?void 0:e.type)||"tablet"===(null===(t=null==n?void 0:n.platform)||void 0===t?void 0:t.type)}isSecure(){return this.isReactNative()||this.isMobileWeb()}isMetaMaskMobileWebView(){return"undefined"!=typeof window&&!!window.ReactNativeWebView&&!!navigator.userAgent.endsWith("MetaMaskMobile")}isMobileWeb(){return this.state.platformType===iG.MobileWeb}static isNotBrowser(){var e;return"undefined"==typeof window||!(null==window?void 0:window.navigator)||void 0!==p&&"ReactNative"===(null===(e=null==p?void 0:p.navigator)||void 0===e?void 0:e.product)||"ReactNative"===(null==navigator?void 0:navigator.product)}isNotBrowser(){return lM.isNotBrowser()}static isBrowser(){return!this.isNotBrowser()}isBrowser(){return lM.isBrowser()}isNodeJS(){return this.isNotBrowser()&&!this.isReactNative()}isUseDeepLink(){return this.state.useDeeplink}getPlatformType(){let{state:e}=this;return e.platformType?e.platformType:this.isReactNative()?iG.ReactNative:this.isNotBrowser()?iG.NonBrowser:this.isMetaMaskMobileWebView()?iG.MetaMaskMobileWebview:this.isMobile()?iG.MobileWeb:iG.DesktopWeb}}let lA=e=>f(void 0,void 0,void 0,function*(){if(lM.isBrowser()){let{StorageManagerWeb:t}=yield Promise.resolve().then(function(){return cf});return new t(e)}return Promise.resolve({persistChannelConfig:()=>f(void 0,void 0,void 0,function*(){}),getPersistedChannelConfig:()=>f(void 0,void 0,void 0,function*(){}),persistAccounts:()=>f(void 0,void 0,void 0,function*(){}),getCachedAccounts:()=>f(void 0,void 0,void 0,function*(){return[]}
6),persistChainId:()=>f(void 0,void 0,void 0,function*(){}),getCachedChainId:()=>f(void 0,void 0,void 0,function*(){}),terminate:()=>f(void 0,void 0,void 0,function*(){})})});class lI extends lu{constructor({connectionStream:e,shouldSendMetadata:t,autoRequestAccounts:n=!1}){super(e,{logger:console,maxEventListeners:100,shouldSendMetadata:t}),this.state={accounts:null,autoRequestAccounts:!1,providerStateRequested:!1,chainId:"",networkVersion:""},lh(`[SDKProvider: constructor()] autoRequestAccounts=${n}`),this.state.autoRequestAccounts=n}forceInitializeState(){return f(this,void 0,void 0,function*(){return lh(`[SDKProvider: forceInitializeState()] autoRequestAccounts=${this.state.autoRequestAccounts}`),this._initializeStateAsync()})}_setConnected(){lh("[SDKProvider: _setConnected()] Setting connected state"),this._state.isConnected=!0}getState(){return this._state}getSDKProviderState(){return this.state}getSelectedAddress(){var e;let{accounts:t}=this._state;return t&&0!==t.length?(null===(e=t[0])||void 0===e?void 0:e.toLowerCase())||"":(lh("[SDKProvider: getSelectedAddress] No accounts found"),null)}getChainId(){return this.state.chainId}getNetworkVersion(){return this.state.networkVersion}setSDKProviderState(e){this.state=Object.assign(Object.assign({},this.state),e)}handleAccountsChanged(e,t){return this._handleAccountsChanged(e,t)}handleDisconnect({terminate:e=!1}){!function({terminate:e=!1,instance:t}){let{state:n}=t;lh(`[SDKProvider: handleDisconnect()] cleaning up provider state terminate=${e}`,t),e&&(t._state.accounts=null,t._state.isUnlocked=!1,t._state.isPermanentlyDisconnected=!0,t._state.initialized=!1),t._handleAccountsChanged([]),t._state.isConnected=!1,t.emit("disconnect",lf.ethErrors.provider.disconnected()),n.providerStateRequested=!1}({terminate:e,instance:this})}_initializeStateAsync(){return f(this,void 0,void 0,function*(){return function(e){var t,n;return f(this,void 0,void 0,function*(){let r;void 0===e.state&&(e.state={accounts:null,autoRequestAccounts:!1,providerStateRequested:!1,chainId:""});let{state:i}=e;if(i.providerStateRequested)lh("[SDKProvider: initializeStateAsync()] initialization already in progress");else{let o;i.providerStateRequested=!0;let a=null,s=!1,l=!1,c=yield lA({enabled:!0});if(c){let e=yield c.getPersistedChannelConfig({});s=null!==(t=null==e?void 0:e.relayPersistence)&&void 0!==t&&t,o=yield c.getCachedChainId();let n=yield c.getCachedAccounts();n.length>0&&(a=n[0])}if(lh(`[SDKProvider: initializeStateAsync()] relayPersistence=${s}`,{relayPersistence:s,cachedChainId:o,cachedSelectedAddress:a}),s)if(o&&a)r={accounts:[a],chainId:o,isUnlocked:!1},l=!0;else try{r=yield e.request({method:"metamask_getProviderState"})}catch(t){return e._log.error("MetaMask: Failed to get initial state. Please report this bug.",t),void(i.providerStateRequested=!1)}if(0===(null===(n=null==r?void 0:r.accounts)||void 0===n?void 0:n.length))if(e.getSelectedAddress())r.accounts=[e.getSelectedAddress()];else{lh("[SDKProvider: initializeStateAsync()] Fetch accounts remotely.");let t=yield e.request({method:"eth_requestAccounts",params:[]});r.accounts=t}e._initializeState(r),i.providerStateRequested=!1,l&&(e._state.isConnected=!0,e.emit("connect",{chainId:null==r?void 0:r.chainId}))}})}(this)})}_initializeState(e){var t;return lh("[SDKProvider: _initializeState()]",e),t=super._initializeState.bind(this),lh("[SDKProvider: initializeState()] set state._initialized to false"),this._state.initialized=!1,t(e)}_handleChainChanged({chainId:e,networkVersion:t}={}){this.state.chainId=e,this.state.networkVersion=t,function({instance:e,chainId:t,networkVersion:n,superHandleChainChanged:r}){lh(`[SDKProvider: handleChainChanged()] chainId=${t} networkVersion=${n}`);let i=n;n||(lh("[SDKProvider: handleChainChanged()] forced network version to prevent provider error"),i="1"),e._state.isConnected=!0,e.emit("connect",{chainId:t}),r({chainId:t,networkVersion:i})}({instance:this,chainId:e,networkVersion:t,superHandleChainChanged:super._handleChainChanged.bind(this)})}}var lR,lL={version:"0.32.0"};!function(e){e.INPAGE="metamask-inpage",e.CONTENT_SCRIPT="metamask-contentscript",e.PROVIDER="metamask-provider"}(lR||(lR={}));let lP="direct",lO="https://metamask.app.link/connect",lT="metamask://connect",lN={NAME:"MetaMask",RDNS:["io.metamask","io.metamask.flask"]},lD=/(?:^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}$)|(?:^0{8}-0{4}-0{4}-0{4}-0{12}$)/u,l$={METAMASK_GETPROVIDERSTATE:"metamask_getProviderState",METAMASK_CONNECTSIGN:"metamask_connectSign",METAMASK_CONNECTWITH:"metamask_connectWith",METAMASK_OPEN:"metamask_open",METAMASK_BATCH:"metamask_batch",PERSONAL_SIGN:"personal_sign",WALLET_REQUESTPERMISSIONS:"wallet_requestPermissions",WALLET_REVOKEPERMISSIONS:"wallet_revokePermissions",WALLET_GETPE
6RMISSIONS:"wallet_getPermissions",WALLET_WATCHASSET:"wallet_watchAsset",WALLET_ADDETHEREUMCHAIN:"wallet_addEthereumChain",WALLET_SWITCHETHETHEREUMCHAIN:"wallet_switchEthereumChain",ETH_REQUESTACCOUNTS:"eth_requestAccounts",ETH_ACCOUNTS:"eth_accounts",ETH_CHAINID:"eth_chainId",ETH_SENDTRANSACTION:"eth_sendTransaction",ETH_SIGNTYPEDDATA:"eth_signTypedData",ETH_SIGNTYPEDDATA_V3:"eth_signTypedData_v3",ETH_SIGNTYPEDDATA_V4:"eth_signTypedData_v4",ETH_SIGNTRANSACTION:"eth_signTransaction",ETH_SIGN:"eth_sign",PERSONAL_EC_RECOVER:"personal_ecRecover"},lB={[l$.ETH_REQUESTACCOUNTS]:!0,[l$.ETH_SENDTRANSACTION]:!0,[l$.ETH_SIGNTRANSACTION]:!0,[l$.ETH_SIGN]:!0,[l$.PERSONAL_SIGN]:!0,[l$.ETH_ACCOUNTS]:!1,[l$.ETH_CHAINID]:!1,[l$.PERSONAL_SIGN]:!0,[l$.ETH_SIGNTYPEDDATA]:!0,[l$.ETH_SIGNTYPEDDATA_V3]:!0,[l$.ETH_SIGNTYPEDDATA_V4]:!0,[l$.WALLET_REQUESTPERMISSIONS]:!0,[l$.WALLET_GETPERMISSIONS]:!0,[l$.WALLET_WATCHASSET]:!0,[l$.WALLET_ADDETHEREUMCHAIN]:!0,[l$.WALLET_SWITCHETHETHEREUMCHAIN]:!0,[l$.METAMASK_CONNECTSIGN]:!0,[l$.METAMASK_CONNECTWITH]:!0,[l$.PERSONAL_EC_RECOVER]:!0,[l$.METAMASK_BATCH]:!0,[l$.METAMASK_OPEN]:!0},lK=Object.keys(lB).map(e=>e.toLowerCase()),lj=["eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sign"].map(e=>e.toLowerCase()),lU=".sdk-comm",lH="providerType",lF=".MMSDK_cached_address",lz=".MMSDK_cached_chainId",lq={CHAIN_CHANGED:"chainChanged",ACCOUNTS_CHANGED:"accountsChanged",DISCONNECT:"disconnect",CONNECT:"connect",CONNECTED:"connected"};!function(e){e.TERMINATE="terminate",e.EXTENSION="extension",e.INITIALIZED="initialized"}(cj||(cj={}));let lW="undefined"!=typeof window&&window.localStorage;function lV(e){var t,n;return f(this,void 0,void 0,function*(){lh("[MetaMaskSDK: connectWithExtensionProvider()] ",e),e.sdkProvider=e.activeProvider,e.activeProvider=window.extension,window.ethereum=window.extension;try{let e=yield null===(t=window.extension)||void 0===t?void 0:t.request({method:"eth_requestAccounts"});lh(`[MetaMaskSDK: connectWithExtensionProvider()] accounts=${e}`)}catch(e){return void console.warn("[MetaMaskSDK: connectWithExtensionProvider()] can't request accounts error",e)}localStorage.setItem(lH,"extension"),e.extensionActive=!0,e.emit(lx.ProviderUpdate,cj.EXTENSION),e.options.enableAnalytics&&(null===(n=e.analytics)||void 0===n||n.send({event:iz.SDK_USE_EXTENSION}))})}function lG(e){let t;if(void 0!==A)t=A.from(e,"utf8").toString("base64");else if("function"==typeof btoa)t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/gu,(e,t)=>String.fromCharCode(parseInt(t,16))));else{if("object"!=typeof p||!("Buffer"in p))throw Error("Unable to base64 encode: No available method.");t=p.Buffer.from(e,"utf8").toString("base64")}return t}class lZ extends s2.Duplex{constructor({name:e,remote:t,deeplinkProtocol:n,platformManager:r}){super({objectMode:!0}),this.state={_name:null,remote:null,deeplinkProtocol:!1,platformManager:null},this.state._name=e,this.state.remote=t,this.state.deeplinkProtocol=n,this.state.platformManager=r,this._onMessage=this._onMessage.bind(this),this.state.remote.on(ij.MESSAGE,this._onMessage)}_write(e,t,n){return f(this,void 0,void 0,function*(){return function(e,t,n,r){var i,o,a,s,l,c,d,u,h,p,g,m,y,v,b,E,w,C,S,_;return f(this,void 0,void 0,function*(){let n=null===(i=e.state.remote)||void 0===i?void 0:i.isReady(),f=null===(o=e.state.remote)||void 0===o?void 0:o.isConnected(),x=null===(a=e.state.remote)||void 0===a?void 0:a.isPaused(),k=lk.getProvider(),M=null===(s=e.state.remote)||void 0===s?void 0:s.getChannelId(),I=null===(l=e.state.remote)||void 0===l?void 0:l.isAuthorized(),{deeplinkProtocol:R}=e.state,{method:L,data:P,triggeredInstaller:O}=(e=>{var t,n,r,i;let o;A.isBuffer(e)?(o=e.toJSON())._isBuffer=!0:o=e;let a=null===(t=null==o?void 0:o.data)||void 0===t?void 0:t.method,s=!1;return"object"==typeof(null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.params)&&!0===(null===(i=null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.params)||void 0===i?void 0:i.__triggeredInstaller)&&(s=!0,o.data.params=o.data.params.wrappedParams),{method:a,data:o,triggeredInstaller:s}})(t);if(lh(`[RCPMS: write()] method='${L}' isRemoteReady=${n} channelId=${M} isSocketConnected=${f} isRemotePaused=${x} providerConnected=${k.isConnected()}`,t),!M)return L!==l$.METAMASK_GETPROVIDERSTATE&&lh(`[RCPMS: write()] ${L} --> channelId is undefined`),r(Error("disconnected"));
6lh(`[RCPMS: write()] remote.isPaused()=${null===(c=e.state.remote)||void 0===c?void 0:c.isPaused()} authorized=${I} ready=${n} socketConnected=${f}`,t);let T=null===(d=e.state.platformManager)||void 0===d?void 0:d.isSecure(),N=null!==(h=null===(u=e.state.platformManager)||void 0===u?void 0:u.isMobileWeb())&&void 0!==h&&h,D=null!==(g=null===(p=e.state.remote)||void 0===p?void 0:p.hasDeeplinkProtocol())&&void 0!==g&&g&&N&&I;try{if(!O){let t=JSON.stringify(null==P?void 0:P.data);if(t.length>1e6)return r(Error(`Message size ${t.length} exceeds maximum allowed size of 1000000 bytes`));null===(m=e.state.remote)||void 0===m||m.sendMessage(null==P?void 0:P.data).then(()=>{lh(`[RCPMS: _write()] ${L} sent successfully`)}).catch(e=>{lh("[RCPMS: _write()] error sending message",e)})}if(!T)return lh(`[RCPMS: _write()] unsecure platform for method ${L} -- return callback`),r();if(O)return lh("[RCPMS: _write()] prevent deeplink -- installation completed separately."),r();let t=null!==(b=null===(v=null===(y=e.state.remote)||void 0===y?void 0:y.getKeyInfo())||void 0===v?void 0:v.ecies.public)&&void 0!==b?b:"",n=encodeURI(`channelId=${M}&pubkey=${t}&comm=socket&t=d&v=2`);if(D){let t=JSON.stringify(null==P?void 0:P.data),i=null===(E=e.state.remote)||void 0===E?void 0:E.encrypt(t);if(!i)return lh("[RCPMS: _write()] error encrypting message"),r(Error("RemoteCommunicationPostMessageStream - disconnected"));n+=`&scheme=${R}&rpc=${lG(i)}`}if(!(null===(w=e.state.platformManager)||void 0===w?void 0:w.isMetaMaskInstalled()))return lh("[RCPMS: _write()] prevent deeplink until installation is completed."),r();lB[L]?(lh(`[RCPMS: _write()] redirect link for '${L}' socketConnected=${f} connect?${n}`),null===(C=e.state.platformManager)||void 0===C||C.openDeeplink(`${lO}?${n}`,`${lT}?${n}`,"_self")):(null===(S=e.state.remote)||void 0===S?void 0:S.isPaused())?(lh(`[RCPMS: _write()] MM is PAUSED! deeplink with connect! targetMethod=${L}`),null===(_=e.state.platformManager)||void 0===_||_.openDeeplink(`${lO}?redirect=true&${n}`,`${lT}?redirect=true&${n}`,"_self")):lh(`[RCPMS: _write()] method ${L} doesn't need redirect.`)}catch(e){return lh("[RCPMS: _write()] error sending message",e),r(Error("RemoteCommunicationPostMessageStream - disconnected"))}return r()})}(this,e,0,n)})}_read(){}_onMessage(e){try{if(lh("[RCPMS: onMessage()] message",e),!e||"object"!=typeof e||"object"!=typeof(null==e?void 0:e.data))return;if(!(null==e?void 0:e.name))return void lh("[RCPMS: onMessage()] ignore message without name",e);if((null==e?void 0:e.name)!==lR.PROVIDER)return void lh(`[RCPMS: onMessage()] ignore message with wrong name message=${e}`);if(A.isBuffer(e)){let t=A.from(e);this.push(t)}else this.push(e)}catch(e){lh(`[RCPMS: onMessage()] ignore message error err=${e}`)}}start(){}}let lY=1,lJ=e=>new Promise(t=>{setTimeout(()=>{t(!0)},e)}),lX=({checkInstallationOnAllCalls:e=!1,communicationLayerPreference:t,injectProvider:n,shouldShimWeb3:r,platformManager:i,installer:a,sdk:s,remoteConnection:l,debug:c})=>f(void 0,void 0,void 0,function*(){var d,u;let h=(({name:e,remoteConnection:t})=>{if(!t||!(null==t?void 0:t.getConnector()))throw Error("Missing remote connection parameter");return new lZ({name:e,remote:null==t?void 0:t.getConnector(),deeplinkProtocol:null==t?void 0:t.state.deeplinkProtocol,platformManager:null==t?void 0:t.getPlatformManager()})})({name:lR.INPAGE,target:lR.CONTENT_SCRIPT,platformManager:i,communicationLayerPreference:t,remoteConnection:l}),p=i.getPlatformType(),g=s.options.dappMetadata,m=`Sdk/Javascript SdkVersion/${lL.version} Platform/${p} dApp/${null!==(d=g.url)&&void 0!==d?d:g.name} dAppTitle/${g.name}`,y=null,v=null,b=null===(u=s.options.storage)||void 0===u?void 0:u.storageManager;if(b){try{let e=yield b.getCachedAccounts();e.length>0&&(y=e[0])}catch(e){console.error(`[initializeMobileProvider] failed to get cached addresses: ${e}`)}try{let e=yield b.getCachedChainId();e&&(v=e)}catch(e){console.error(`[initializeMobileProvider] failed to parse cached chainId: ${e}`)}}lh(`[initializeMobileProvider] cachedAccountAddress: ${y}, cachedChainId: ${v}`);let E=!(!n||p===iG.NonBrowser||p===iG.ReactNative),w=lk.init({shouldSetOnWindow:E,connectionStream:h,shouldShimWeb3:r,sdkInstance:s}),C=!1,S=e=>{C=e},_=()=>C,x=(t,n,r,c)=>f(void 0,void 0,void 0,function*(){var d,u,h,p,g,E,w,x,k;let M=lk.getProvider();if(C){M.emit("display_uri",(null==l?void 0:l.state.qrcodeLink)||""),null==l||l.showActiveModal();let e=_();for(;e;){let t=_(),n=null==l?void 0:l.isAuthorized();e=t&&!n,lh(`[initializeMobileProvider: sendRequest()] waiting for initialization to complete - initializing: ${t} authorized: ${n}`),yield lJ(1e3)}return lh("[initializeMobileProvider: sendRequest()] initial method completed -- prevent installation and call provider"),r(...n)}let A=i.isMetaMaskInstalled(),I=null==l?void 0:l.isConnected(),R=null,
6L=null,P=null;if(R=null!==(d=M.getSelectedAddress())&&void 0!==d?d:y,P=M.getChainId()||v,R&&b&&R!==y&&b.persistAccounts([R]).catch(e=>{console.error(`[initializeMobileProvider] failed to persist account: ${e}`)}),P&&(v=P,b&&b.persistChainId(P).catch(e=>{console.error(`[initializeMobileProvider] failed to persist chainId: ${e}`)})),lh("[initializeMobileProvider: sendRequest()]",{selectedAddress:R,chainId:P}),c&&lh(`[initializeMobileProvider: sendRequest()] method=${t} ongoing=${C} selectedAddress=${R} isInstalled=${A} checkInstallationOnAllCalls=${e} socketConnected=${I}`),R&&t.toLowerCase()===l$.ETH_ACCOUNTS.toLowerCase())return[R];if(P&&t.toLowerCase()===l$.ETH_CHAINID.toLowerCase())return P;let O=[l$.ETH_REQUESTACCOUNTS,l$.WALLET_REQUESTPERMISSIONS,l$.METAMASK_CONNECTSIGN,l$.METAMASK_CONNECTWITH],T=!lB[t],N=null===(u=s.options.readonlyRPCMap)||void 0===u?void 0:u[P];if(N&&T)try{let e=null===(h=null==n?void 0:n[0])||void 0===h?void 0:h.params,r=yield(({rpcEndpoint:e,method:t,sdkInfo:n,params:r})=>f(void 0,void 0,void 0,function*(){let i,a=JSON.stringify({jsonrpc:"2.0",method:t,params:r,id:lY+=1}),s={Accept:"application/json","Content-Type":"application/json"};e.includes("infura")&&(s["Metamask-Sdk-Info"]=n);try{i=yield o()(e,{method:"POST",headers:s,body:a})}catch(e){throw e instanceof Error?Error(`Failed to fetch from RPC: ${e.message}`):Error(`Failed to fetch from RPC: ${e}`)}if(!i.ok)throw Error(`Server responded with a status of ${i.status}`);return(yield i.json()).result}))({rpcEndpoint:N,sdkInfo:m,method:t,params:e||[]});return c&&lh(`initializeProvider::ReadOnlyRPCResponse ${r}`),r}catch(e){console.warn(`[initializeMobileProvider: sendRequest()] method=${t} readOnlyRPCRequest failed:`,e)}if((!A||A&&!I)&&t!==l$.METAMASK_GETPROVIDERSTATE){let o=(null===(p=null==n?void 0:n[0])||void 0===p?void 0:p.params)||[];if(-1!==O.indexOf(t)||e){S(!0);let e=t===l$.METAMASK_CONNECTWITH,i=`${Date.now()}`;try{yield a.start({wait:!1,connectWith:e?{method:t,id:i,params:o}:void 0}),yield new Promise((e,t)=>{(null==l?void 0:l.isAuthorized())&&(lh("[initializeMobileProvider: sendRequest()] already authorized"),e(!0)),null==l||l.getConnector().once(ij.AUTHORIZED,()=>{e(!0)}),s.once(ij.PROVIDER_UPDATE,e=>{lh(`[initializeMobileProvider: sendRequest()] PROVIDER_UPDATE --- remote provider request interupted type=${e}`),e===cj.EXTENSION?t(ij.PROVIDER_UPDATE):t(Error("Connection Terminated"))})})}catch(e){if(cj.EXTENSION===e){if(lh(`[initializeMobileProvider: sendRequest()] extension provider detect: re-create ${t} on the active provider`),t.toLowerCase()===l$.METAMASK_CONNECTSIGN.toLowerCase()){let e=yield null===(g=s.getProvider())||void 0===g?void 0:g.request({method:l$.ETH_REQUESTACCOUNTS,params:[]});if(!e.length)throw Error("SDK state invalid -- undefined accounts");let t=yield null===(E=s.getProvider())||void 0===E?void 0:E.request({method:l$.PERSONAL_SIGN,params:[o[0],e[0]]});return s.emit(lx.ConnectWithResponse,t),t}if(t.toLowerCase()===l$.METAMASK_CONNECTWITH.toLowerCase()){let[e]=o,t=yield(({method:e,sdk:t,params:n})=>f(void 0,void 0,void 0,function*(){var r,i,o,a;if(!t.isExtensionActive())throw Error("SDK state invalid -- extension is not active");lh("[MetaMaskProvider: extensionConnectWithOverwrite()] Overwriting request method",e,n);let s=yield null===(r=t.getProvider())||void 0===r?void 0:r.request({method:l$.ETH_REQUESTACCOUNTS,params:[]});if(!s.length)throw Error("SDK state invalid -- undefined accounts");if((null==e?void 0:e.toLowerCase())===l$.PERSONAL_SIGN.toLowerCase()){let r={method:e,params:[n[0],s[0]]};return yield null===(i=t.getProvider())||void 0===i?void 0:i.request(r)}if((null==e?void 0:e.toLowerCase())===l$.ETH_SENDTRANSACTION.toLowerCase()){let r={method:e,params:[Object.assign(Object.assign({},n[0]),{from:s[0]})]};return yield null===(o=t.getProvider())||void 0===o?void 0:o.request(r)}return lj.includes(e.toLowerCase())?(console.warn(`MetaMaskSDK connectWith method=${e} -- not handled by the extension -- call separately`),s):yield null===(a=t.getProvider())||void 0===a?void 0:a.request({method:e,params:n})}))({method:e.method,sdk:s,params:e.params});return s.emit(lx.ConnectWithResponse,t),t}return lh(`[initializeMobileProvider: sendRequest()] sending '${t}' on active provider`,o),yield null===(w=s.getProvider())||void 0===w?void 0:w.request({method:t,params:o})}if(e===ij.REJECTED)throw null==l||l.closeModal(),null===(x=s.getProvider())||void 0===x||x.handleDisconnect({terminate:!1}),Object.assign(Error("User rejected connection"),{code:4001});throw lh(`[initializeMobileProvider: sendRequest()] failed to start installer: ${e}`),e}finally{S(!1)}
6if(t===l$.ETH_REQUESTACCOUNTS)return L=yield new Promise(e=>{let t=setInterval(()=>{let{accounts:n}=M.getState();n&&(clearInterval(t),e(n))},100)}),lh(`[initializeMobileProvider: sendRequest()] selectedAddress: ${R} --- SKIP rpc call`),L;if(t===l$.METAMASK_CONNECTWITH)try{let e,t,n=0,r=({resolve:e,reject:t})=>{n+=1;let r=null==l?void 0:l.getConnector().getRPCMethodTracker(),o=null==r?void 0:r[i];return lh(`TRACKER: update method ${i}`,o),(null==o?void 0:o.result)?(lh("[initializeMobileProvider: sendRequest()] found result",o.result),s.emit(lx.ConnectWithResponse,o.result),void e(o.result)):(null==o?void 0:o.error)?(lh("[initializeMobileProvider: sendRequest()] found error",o.error),void t(o.error)):n>=5?(lh("[initializeMobileProvider: sendRequest()] max message count reached without result"),void t(Error("Max message count reached without result"))):void lh("[initializeMobileProvider: sendRequest()] not found yet, need to wait for next update")},o=yield new Promise((n,o)=>{let a=null==l?void 0:l.getConnector().getRPCMethodTracker();lh(`TRACKER: method ${i}`,a),(null==a?void 0:a[i].result)?(lh("[initializeMobileProvider: sendRequest()] found result",null==a?void 0:a[i].result),n(null==a?void 0:a[i].result)):(null==a?void 0:a[i].error)&&(lh("[initializeMobileProvider: sendRequest()] found error",null==a?void 0:a[i].error),o(null==a?void 0:a[i].error)),t=()=>r({resolve:n,reject:o}),e=null==l?void 0:l.getConnector().on(ij.RPC_UPDATE,t)});return t&&(null==e||e.off(ij.RPC_UPDATE,t)),lh("TRACKER: result",o),o}catch(e){throw lh("[initializeMobileProvider: sendRequest()] error:",e),e}return n[0]&&"object"==typeof n[0]&&(n[0].params={__triggeredInstaller:!0,wrappedParams:n[0].params}),r(...n)}if(i.isSecure()&&lB[t])return r(...n);if(s.isExtensionActive())return lh(`[initializeMobileProvider: sendRequest()] EXTENSION active - redirect request '${t}' to it`,n,o),yield null===(k=s.getProvider())||void 0===k?void 0:k.request({method:t,params:o});throw lh(`[initializeMobileProvider: sendRequest()] method=${t} --- skip --- not connected/installed`),Error("MetaMask is not connected/installed, please call eth_requestAccounts to connect first.")}try{let e=yield r(...n);if(lh(`[initializeMobileProvider: sendRequest()] method=${t} rpcResponse`,e),t===l$.WALLET_REQUESTPERMISSIONS){let t=e.reduce((e,t)=>{var n;if("eth_accounts"===t.parentCapability){let r=null===(n=t.caveats.find(e=>"restrictReturnedAccounts"===e.type))||void 0===n?void 0:n.value;r&&e.push(...r)}return e},[]);lh("[initializeMobileProvider: sendRequest()] accountsToPersist:",t),t.length>0&&(M.handleAccountsChanged(t,!1),null==b||b.persistAccounts(t))}return e}catch(e){throw console.error("[initializeMobileProvider: sendRequest()] error:",e),e}}),{request:k}=w;w.request=(...e)=>f(void 0,void 0,void 0,function*(){return x(null==e?void 0:e[0].method,e,k,c)});let{send:M}=w;return w.send=(...e)=>f(void 0,void 0,void 0,function*(){return x(null==e?void 0:e[0],e,M,c)}),lh("[initializeMobileProvider: sendRequest()] metamaskStream.start()"),h.start(),w});class lQ{constructor({serverUrl:e,enabled:t,originatorInfo:n}){this.serverURL=rz,this.serverURL=e,this.originatorInfo=n,this.enabled=null==t||t}send({event:e,params:t}){if(!this.enabled)return;let n=Object.assign(Object.assign({id:"sdk",event:e,sdkVersion:lL.version},this.originatorInfo),{params:t});lh(`[Analytics: send()] event: ${e}`,n),rU(n,this.serverURL).catch(e=>{lh(`[Analytics: send()] error: ${e}`)})}}let l0=()=>{let e;if("undefined"==typeof document)return;let t=document.getElementsByTagName("link");for(let n=0;n<t.length;n++)"icon"!==t[n].getAttribute("rel")&&"shortcut icon"!==t[n].getAttribute("rel")||(e=t[n].getAttribute("href"));return e};function l1(e){var t,n,r;let{dappMetadata:i}=e,o=function({url:e,name:t}){var n;let r=lG(e+t);if(!localStorage)return"";let i=null!==(n=localStorage.getItem(r))&&void 0!==n?n:"";if(!i){i=(0,d.A)();try{localStorage.setItem(r,i)}catch(e){return""}}return i}({url:null!==(t=null==i?void 0:i.url)&&void 0!==t?t:"no_url",name:null!==(n=null==i?void 0:i.name)&&void 0!==n?n:"no_name"}),a=null===(r=e.platformManager)||void 0===r?void 0:r.getPlatformType(),s=a===iG.DesktopWeb,l=a===iG.MetaMaskMobileWebview,c="N/A";return s?c="extension":l&&(c="mobile"),{id:o,from:c}}let l2=({provider:e,sdkInstance:t})=>{if("state"in e)throw Error("INVALID EXTENSION PROVIDER");return new Proxy(e,{get:(n,r)=>"request"===r?function(e){var r,i;return f(this,void 0,void 0,function*(){let o;lh("[wrapExtensionProvider()] Overwriting request method",e);let{method:a,params:s}=e,l=lK.includes(a.toLowerCase()),{id:c,from:d}=l1(t);if(l&&(null===(r=t.analytics)||void 0===r||r.send({event:iz.SDK_RPC_REQUEST,params:{method:a,from:d,id:c}})),a===l$.METAMASK_BATCH&&Array.isArray(s))return(({target:e,args:t,trackEvent:n,sdkInstance:r})=>f(void 0,void 0,void 0,function*(){var i,o;if("metamask_batch"!==t.method)throw Error("Invalid usage");let a=[];for(let n of null!==(i=null==t?void 0:t.params)&&void 0!==i?i:[]){let t=yield null==e?void 0:e.request({method:n.method,params:n.params});a.push(t)}let{id:s,from:l}=l1(r);return n&&(null===(o=r.analytics)||void 0===o||o.send({event:iz.SDK_RPC_REQUEST_DONE,params:{method:t.method,from:l,id:s}})),a}))({target:n,args:e,trackEvent:l,sdkInstance:t});if(a.toLowerCase()===l$.METAMASK_CONNECTSIGN.toLowerCase()&&Array.isArray(s))return(({target:e,params:t})=>f(void 0,void 0,void 0,function*(){let n=yield e.request({method:l$.ETH_REQUESTACCOUNTS,params:[]});if(!n.length)throw Error("SDK state invalid -- undefined accounts");return yield e.request({method:l$.PERSONAL_SIGN,params:[t[0],n[0]]})}))({target:n,params:s});if(a.toLowerCase()===l$.METAMASK_CONNECTWITH.toLowerCase()&&Array.isArray(s))return(({target:e,params:t})=>f(void 0,void 0,void 0,function*(){let[n]=t,r=n.method,i=n.params,o=yield e.request({method:l$.ETH_REQUESTACCOUNTS,params:[]});if(!o.length)throw Error("SDK state invalid -- undefined accounts");return(null==r?void 0:r.toLowerCase())===l$.PERSONAL_SIGN.toLowerCase()?yield e.request({method:r,params:[i[0],o[0]]}):(null==r?void 0:r.toLowerCase())===l$.ETH_SENDTRANSACTION.toLowerCase()?yield e.request({method:r,params:[Object.assign(Object.assign({},i[0]),{from:o[0]})]}):lj.includes(r.toLowerCase())?(console.warn(`MetaMaskSDK connectWith method=${r} -- not handled by the extension -- call separately`),o):yield e.request({method:r,params:i})}))({target:n,params:s});try{return yield n.request(e)}finally{l&&(null===(i=t.analytics)||void 0===i||i.send({event:iz.SDK_RPC_REQUEST_DONE,params:{method:a,from:d,id:c}}))}})}:"getChainId"===r?function(){return e.chainId}:"getNetworkVersion"===r?function(){return e.networkVersion}:"getSelectedAddress"===r?function(){return e.selectedAddress}:"isConnected"===r?function(){return e._state.isConnected}:n[r]})};!function(e){e.Announce="eip6963:announceProvider",e.Request="eip6963:requestProvider"}(cU||(cU={}));let l3=e=>f(void 0,void 0,void 0,function*(){let{options:t}=e,{infuraAPIKey:n}=t;if(!n)return;let r={"0x1":`https://mainnet.infura.io/v3/${n}`,"0x5":`https://goerli.infura.io/v3/${n}`,"0xaa36a7":`https://sepolia.infura.io/v3/${n}`,"0xe708":`https://linea-mainnet.infura.io/v3/${n}`,"0xe704":`https://linea-goerli.infura.io/v3/${n}`,"0x89":`https://polygon-mainnet.infura.io/v3/${n}`,"0x13881":`https://polygon-mumbai.infura.io/v3/${n}`,"0x45":`https://optimism-mainnet.infura.io/v3/${n}`,"0x1a4":`https://optimism-goerli.infura.io/v3/${n}`,"0xa4b1":`https://arbitrum-mainnet.infura.io/v3/${n}`,"0x66eed":`https://arbitrum-goerli.infura.io/v3/${n}`,"0x2a15c308d":`https://palm-mainnet.infura.io/v3/${n}`,"0x2a15c3083":`https://palm-testnet.infura.io/v3/${n}`,"0xa86a":`https://avalanche-mainnet.infura.io/v3/${n}`,"0xa869":`https://avalanche-fuji.infura.io/v3/${n}`,"0x4e454152":`https://aurora-mainnet.infura.io/v3/${n}`,"0x4e454153":`https://aurora-testnet.infura.io/v3/${n}`,"0x534e5f4d41494e":`https://starknet-mainnet.infura.io/v3/${n}`,"0x534e5f474f45524c49":`https://starknet-goerli.infura.io/v3/${n}`,"0x534e5f474f45524c4932":`https://starknet-goerli2.infura.io/v3/${n}`,"0xa4ec":`https://celo-mainnet.infura.io/v3/${n}`,"0xaef3":`https://celo-alfajores.infura.io/v3/${n}`};e.options.readonlyRPCMap?e.options.readonlyRPCMap=Object.assign(Object.assign({},e.options.readonlyRPCMap),r):e.options.readonlyRPCMap=r}),l5=e=>f(void 0,void 0,void 0,function*(){let{options:t}=e,{readonlyRPCMap:n}=t;if(n)try{lh("[MetaMaskSDK: setupReadOnlyRPCProviders()] Setting up Readonly RPC Providers",n),e.setReadOnlyRPCCalls(!0)}catch(e){throw Error("Invalid Infura Settings")}});var l8="INSTALLED",l4="NOT_INSTALLED",l6="REGISTERED",l7="REGISTERING",l9="RELOADING",ce={CHROME:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",FIREFOX:"https://addons.mozilla.org/firefox/addon/ether-metamask/",DEFAULT:"https://metamask.io"},ct="REGISTRATION_IN_PROGRESS",cn="FORWARDER_ID",cr=function(){function e(t){var n=void 0===t?{}:t,r=n.forwarderOrigin,i=n.forwarderMode,o=void 0===i?e.FORWARDER_MODE.INJECT:i;this.forwarderOrigin=void 0===r?"https://fwd.metamask.io":r,this.forwarderMode=o,this.state=e.isMetaMaskInstalled()?l8:l4;var a=e._detectBrowser();this.downloadUrl=a?ce[a]:ce.DEFAULT,this._onMessage=this._onMessage.bind(this),this._onMessageFromForwarder=this._onMessageFromForwarder.bind(this),this._openForwarder=this._openForwarder.bind(this),this._openDownloadPage=this._openDownloadPage.bind(this),this.startOnboarding=this.startOnboarding.bind(this),this.stopOnboarding=this.stopOnboarding.bind(this),window.addEventListener("message",this._onMessage),o===e.FORWARDER_MODE.INJECT&&"true"===sessionStorage.getItem(ct)&&e._injectForwarder(this.forwarderOrigin)}return e.prototype._onMessage=function(e){if(e.origin===this.forwarderOrigin)return"metamask:reload"===e.data.type?this._onMessageFromForwarder(e):void console.debug("Unknown message from '"+e.origin+"' with data "+JSON.stringify(e.data))},e.prototype._onMessageUnknownStateError=function(e){throw Error("Unknown state: '"+e+"'")},e.prototype._onMessageFromForwarder=function(t){var n,r,i;return n=this,r=void 0,i=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){var l=[o,s];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){a.label=l[1];break}if(6===l[0]&&a.label<i[1]){a.label=i[1],i=l;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(l);break}i[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:switch(this.state){case l9:return[3,1];case l4:return[3,2];case l8:return[3,3];case l7:return[3,5];case l6:return[3,6]}return[3,7];case 1:return console.debug("Ignoring message while reloading"),[3,8];case 2:return console.debug("Reloading now to register with MetaMask"),this.state=l9,location.reload(),[3,8];case 3:return console.debug("Registering with MetaMask"),this.state=l7,[4,e._register()];case 4:return n.sent(),this.state=l6,t.source.postMessage({type:"metamask:registrationCompleted"},t.origin),this.stopOnboarding(),[3,8];case 5:return console.debug("Already registering - ignoring reload message"),[3,8];case 6:return console.debug("Already registered - ignoring reload message"),[3,8];case 7:this._onMessageUnknownStateError(this.state),n.label=8;case 8:return[2]}})},new(r||(r=Promise))(function(e,t){function o(e){try{s(i.next(e))}catch(e){t(e)}}function a(e){try{s(i.throw(e))}catch(e){t(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof r?n:new r(function(e){e(n)})).then(o,a)}s((i=i.apply(n,[])).next())})},e.prototype.startOnboarding=function(){sessionStorage.setItem(ct,"true"),this._openDownloadPage(),this._openForwarder()},e.prototype.stopOnboarding=function(){"true"===sessionStorage.getItem(ct)&&(this.forwarderMode===e.FORWARDER_MODE.INJECT&&(console.debug("Removing forwarder"),e._removeForwarder()),sessionStorage.setItem(ct,"false"))},e.prototype._openForwarder=function(){this.forwarderMode===e.FORWARDER_MODE.OPEN_TAB?window.open(this.forwarderOrigin,"_blank"):e._injectForwarder(this.forwarderOrigin)},e.prototype._openDownloadPage=function(){window.open(this.downloadUrl,"_blank")},e.isMetaMaskInstalled=function(){return!!(window.ethereum&&window.ethereum.isMetaMask)},e._register=function(){return window.ethereum.request({method:"wallet_registerOnboarding"})},e._injectForwarder=function(e){var t=document.body,n=document.createElement("iframe");n.setAttribute("height","0"),n.setAttribute("width","0"),n.setAttribute("style","display: none;"),n.setAttribute("src",e),n.setAttribute("id",cn),t.insertBefore(n,t.children[0])},e._removeForwarder=function(){var e;null===(e=document.getElementById(cn))||void 0===e||e.remove()},e._detectBrowser=function(){var e=l_.parse(window.navigator.userAgent);return"Firefox"===e.browser.name?"FIREFOX":["Chrome","Chromium"].includes(e.browser.name||"")?"CHROME":null},e.FORWARDER_MODE={INJECT:"INJECT",OPEN_TAB:"OPEN_TAB"},e}();class ci{constructor({remote:e,preferDesktop:t,platformManager:n,debug:r=!1}){this.state={isInstalling:!1,hasInstalled:!1,resendRequest:null,preferDesktop:!1,platformManager:null,remote:null,debug:!1,connectWith:void 0},this.state.remote=e,this.state.preferDesktop=t,this.state.platformManager=n,this.state.debug=r}startDesktopOnboarding(){return function(){return f(this,void 0,void 0,function*(){lh("[MetamaskInstaller: startDesktopOnboarding() starting desktop onboarding"),window.ethereum&&(window.ethereum=void 0),(new cr).startOnboarding()})}()}redirectToProperInstall(){return f(this,void 0,void 0,function*(){return function(e){var t,n;return f(this,void 0,void 0,function*(){let{state:r}=e,i=null===(t=r.platformManager)||void 0===t?void 0:t.getPlatformType();if(lh(`[MetamaskInstaller: redirectToProperInstall()] platform=${i}`),i===iG.MetaMaskMobileWebview)return!1;r.isInstalling=!0;try{yield null===(n=r.remote)||void 0===n?void 0:n.startConnection({connectWith:r.connectWith}),r.isInstalling=!1,r.hasInstalled=!0}catch(e){throw r.isInstalling=!1,e}return!0})}(this)})}checkInstallation(){return f(this,void 0,void 0,function*(){return function(e){var t;return f(this,void 0,void 0,function*(){let{state:n}=e,r=null===(t=n.platformManager)||void 0===t?void 0:t.isMetaMaskInstalled();return lh(`[MetamaskInstaller: checkInstallation()] isInstalled=${r}`),!!r||(yield e.redirectToProperInstall())})}(this)})}start({wait:e=!1,connectWith:t}){return f(this,void 0,void 0,function*(){this.state.connectWith=t,lh(`[MetaMaskInstaller: start()] w
6ait=${e}`,t),yield function(e,{wait:t=!1}){return f(this,void 0,void 0,function*(){return lh(`[MetamaskInstaller: startInstaller()] wait=${t}`),t&&(yield lJ(1e3)),yield e.checkInstallation()})}(this,{wait:e})})}}class co{constructor({debug:e,sdkVersion:t}){this.containers={install:void 0,pending:void 0,select:void 0},this.defined={install:!1,pending:!1,select:!1},this.debug=null!=e&&e,this.sdkVersion=t}loadComponent(e){return f(this,void 0,void 0,function*(){if(!this.defined[e]){this.defined[e]=!0;try{let e=yield Promise.resolve().then(function(){return dA});console.log("loader",e),e.defineCustomElements()}catch(t){console.error(`Failed to load ${e} modal:`,t)}}})}renderInstallModal(e){var t;return f(this,void 0,void 0,function*(){this.debug&&console.debug("ModalLoader: renderInstallModal",e),this.containers.install=e.parentElement,yield this.loadComponent("install");let n=document.createElement("mm-install-modal");n.link=e.link,n.preferDesktop=e.preferDesktop,n.sdkVersion=null!==(t=e.sdkVersion)&&void 0!==t?t:this.sdkVersion,n.addEventListener("close",({detail:{shouldTerminate:t}})=>e.onClose(t)),n.addEventListener("startDesktopOnboarding",e.metaMaskInstaller.startDesktopOnboarding),n.addEventListener("trackAnalytics",t=>{var n;return null===(n=e.onAnalyticsEvent)||void 0===n?void 0:n.call(e,t.detail)}),e.parentElement.appendChild(n)})}renderSelectModal(e){var t;return f(this,void 0,void 0,function*(){this.containers.select=e.parentElement,yield this.loadComponent("select");let n=document.createElement("mm-select-modal");n.link=e.link,n.sdkVersion=null!==(t=e.sdkVersion)&&void 0!==t?t:this.sdkVersion,n.preferDesktop=e.preferDesktop,n.addEventListener("close",({detail:{shouldTerminate:t}})=>e.onClose(t)),n.addEventListener("connectWithExtension",e.connectWithExtension),e.parentElement.appendChild(n),setTimeout(()=>this.updateQRCode(e.link),100)})}renderPendingModal(e){var t;return f(this,void 0,void 0,function*(){this.containers.pending=e.parentElement,yield this.loadComponent("pending");let n=document.createElement("mm-pending-modal");n.sdkVersion=null!==(t=e.sdkVersion)&&void 0!==t?t:this.sdkVersion,n.displayOTP=e.displayOTP,n.addEventListener("close",e.onClose),n.addEventListener("updateOTPValue",({detail:{otpValue:t}})=>e.updateOTPValue(t)),e.onDisconnect&&n.addEventListener("disconnect",e.onDisconnect),e.parentElement.appendChild(n)})}updateOTPValue(e){let t=()=>{var t;let n=null===(t=this.containers.pending)||void 0===t?void 0:t.querySelector("mm-pending-modal");return!!n&&(n.otpCode=e,!0)};setTimeout(()=>{t()},800)}updateQRCode(e){var t,n;let r=null===(t=this.containers.install)||void 0===t?void 0:t.querySelector("mm-install-modal");if(r)r.link=e;else{let t=null===(n=this.containers.select)||void 0===n?void 0:n.querySelector("mm-select-modal");t&&(t.link=e)}}unmount(){Object.entries(this.containers).forEach(([e,t])=>{var n;null===(n=null==t?void 0:t.parentNode)||void 0===n||n.removeChild(t),this.containers[e]=void 0})}}let ca=({link:e,debug:t,installer:n,terminate:r,connectWithExtension:i,preferDesktop:o,onAnalyticsEvent:a})=>{let s=null,l=null;lh("[UI: InstallModal-web: sdkWebInstallModal()] ################## Installing Modal #################"),lh(`[UI: InstallModal-web: sdkWebInstallModal()] link=${e}`),lh(`[UI: InstallModal-web: sdkWebInstallModal()] npx uri-scheme open "${e}" --ios`),lh(`[UI: InstallModal-web: sdkWebInstallModal()] npx uri-scheme open "${e}" --android`),lh(`[UI: InstallModal-web: sdkWebInstallModal()] adb shell am start -a android.intent.action.VIEW -d "${e}"`);let c=e=>{var t;lh("[UI: InstallModal-web: sdkWebInstallModal()] installModal-web unmounting install modal -- shouldTerminate:",e,l),(null==l?void 0:l.parentNode)&&(null===(t=l.parentNode)||void 0===t||t.removeChild(l)),l=null,s=null,!0===e&&(null==r||r())};return{mount:r=>{if(lh("[UI: InstallModal-web: sdkWebInstallModal()] installModal-web mounting install modal",l),l)return l.style.display="block",void(null==s||s.updateQRCode(r));s=new co({debug:t,sdkVersion:lL.version}),l=document.createElement("div"),document.body.appendChild(l),window.extension?s.renderSelectModal({parentElement:l,connectWithExtension:()=>{c(),null==i||i()},onClose:c,link:e,preferDesktop:null!=o&&o}).catch(e=>{console.error(e)}):s.renderInstallModal({parentElement:l,preferDesktop:null!=o&&o,link:e,metaMaskInstaller:n,onClose:c,onAnalyticsEvent:a}).catch(e=>{console.error("[UI: InstallModal-web: sdkWebInstallModal()]",e)})},unmount:c}},cs=({onDisconnect:e,debug:t})=>{let n=null,r=null,i=()=>{lh("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web unmount",n),(null==n?void 0:n.parentNode)&&n.parentNode.removeChild(n),n=null,r=null},o=e=>{lh("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web updateOTPValue",e),r&&r.updateOTPValue(e)},a=({displayOTP:a}={displayOTP:!0})=>{lh("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web mount",n),n?n.style.display="block":(r=new co({debug:t,sdkVersion:lL.version}),n=document.createElement("div"),document.body.appendChild(n),r.renderPendingModal({parentElement:n,onClose:i,onDisconnect:e,updateOTPValue:o,displayOTP:a}).catch(e=>{console.error("[UI: pendingModal-web: sdkWebPendingModal()]",e)}))};return a(),{mount:a,unmount:i,updateOTPValue:o}};function cl(e,t){var n,r,i,o;e.connector||(lh("[RemoteConnection: initializeConnector()] initialize connector"),e.connector=new r6({platformType:t.platformManager.getPlatformType(),communicationLayerPreference:t.communicationLayerPreference,transports:t.transports,dappMetadata:Object.assign(Object.assign({},t.dappMetadata),{source:t._source}),analytics:t.enableAnalytics,communicationServerUrl:t.communicationServerUrl,sdkVersion:lL.version,context:"dapp",ecies:t.ecies,storage:t.storage,logging:t.logging}),t.timer&&(lh("[RemoteConnection: initializeConnector()] reset background timer",t.timer),null===(r=null===(n=t.timer)||void 0===n?void 0:n.stopBackgroun
6dTimer)||void 0===r||r.call(n),null===(o=null===(i=t.timer)||void 0===i?void 0:i.runBackgroundTimer)||void 0===o||o.call(i,()=>!1,1e4)))}function cc(e){e.listeners.forEach(({event:t,handler:n})=>{var r;null===(r=e.connector)||void 0===r||r.off(t,n)}),e.listeners=[]}function cd(e,t){function n(t,n){var r;null===(r=e.connector)||void 0===r||r.on(t,n),e.listeners.push({event:t,handler:n})}e.connector&&(cc(e),n(ij.WALLET_INIT,({accounts:e,chainId:t})=>f(this,void 0,void 0,function*(){lh(`[RemoteConnection: setupListeners() => EventType.WALLET_INIT] 'wallet_init' accounts=${e} chainId=${t}`);let n=lk.getProvider();n._setConnected(),n._initializeState({accounts:e,chainId:t,isUnlocked:!1}),n.emit("chainChanged",t),n.emit("accountsChanged",e)})),n(ij.AUTHORIZED,()=>f(this,void 0,void 0,function*(){var t,n,r,i;try{lh("[RemoteConnection: setupListeners() => EventType.AUTHORIZED] 'authorized' closing modals",e.pendingModal,e.installModal);let o=lk.getProvider();o._setConnected(),null===(n=null===(t=e.pendingModal)||void 0===t?void 0:t.unmount)||void 0===n||n.call(t),null===(i=null===(r=e.installModal)||void 0===r?void 0:r.unmount)||void 0===i||i.call(r,!1),e.otpAnswer=void 0,e.authorized=!0,lh("[RemoteConnection: setupListeners() => EventType.AUTHORIZED] 'authorized' provider.state",o.getState()),yield o.forceInitializeState()}catch(e){}})),n(ij.TERMINATE,()=>{var t,n,r,i,o;null===(n=null===(t=e.pendingModal)||void 0===t?void 0:t.unmount)||void 0===n||n.call(t),null===(i=null===(r=e.installModal)||void 0===r?void 0:r.unmount)||void 0===i||i.call(r,!0),e.pendingModal=void 0,e.installModal=void 0,e.otpAnswer=void 0,null===(o=e.connector)||void 0===o||o.disconnect({terminate:!0}),e.authorized=!1,lk.getProvider().handleDisconnect({terminate:!0}),cc(e),lh("[RemoteConnection: setupListeners()] All listeners cleaned up")}))}class cu{constructor(e){var t,n,r;this.state={connector:void 0,qrcodeLink:void 0,analytics:void 0,developerMode:!1,authorized:!1,reconnection:!1,preferDesktop:!1,deeplinkProtocol:!1,listeners:[],communicationLayerPreference:void 0,platformManager:void 0,pendingModal:void 0,installModal:void 0,otpAnswer:void 0},this.options=e;let i=!0===(null===(t=e.logging)||void 0===t?void 0:t.developerMode)||!0===(null===(n=e.logging)||void 0===n?void 0:n.sdk);this.state.developerMode=i,this.state.analytics=e.analytics,this.state.preferDesktop=null!==(r=e.preferDesktop)&&void 0!==r&&r,this.state.useDeeplink=e.sdk.options.useDeeplink,this.state.communicationLayerPreference=e.communicationLayerPreference,this.state.platformManager=e.platformManager,e.modals.install||(e.modals.install=ca),e.modals.otp||(e.modals.otp=cs)}startConnection(e){return f(this,void 0,void 0,function*(){return function(e,t,{initialCheck:n,connectWith:r}={}){var i,o,a,s,l,c,d,u,h,p,g,m,y,v,b,E,w,C,S;return f(this,void 0,void 0,function*(){try{if(cl(e,t),!e.connector)throw Error("no connector defined");cd(e);let _=lk.getProvider();e.authorized=!1,_.emit("connecting");let x=yield null===(i=e.connector)||void 0===i?void 0:i.originatorSessionConnect();lh(`[RemoteConnection: startConnection()] after originatorSessionConnect initialCheck=${n}`,x);let k=null!==(o=null==x?void 0:x.channelId)&&void 0!==o?o:"",M=null!==(s=null===(a=e.connector.getKeyInfo())||void 0===a?void 0:a.ecies.public)&&void 0!==s?s:"",A=null!==(c=null===(l=e.connector.getKeyInfo())||void 0===l?void 0:l.ecies.private)&&void 0!==c?c:"";if(n&&!x)return Promise.resolve();if(!x&&!n){let t=yield e.connector.generateChannelIdConnect();k=null!==(d=t.channelId)&&void 0!==d?d:"",M=null!==(u=t.pubKey)&&void 0!==u?u:"",A=null!==(h=t.privKey)&&void 0!==h?h:"";let n=Date.now();null===(p=e.connector.state.storageManager)||void 0===p||p.persistChannelConfig({channelId:k,localKey:A,lastActive:n,validUntil:n+6048e5})}if(n&&(null==x?void 0:x.channelId))return(null===(g=e.connector)||void 0===g?void 0:g.isConnected())||(lh(`[RemoteConnection: startConnection()] reconnecting to channel initialCheck=${n}`,x),yield null===(m=e.connector)||void 0===m?void 0:m.connectToChannel({channelId:k})),Promise.resolve();!x||(null===(y=e.connector)||void 0===y?void 0:y.isConnected())||(lh("[RemoteConnection: startConnection()] reconnecting to channel",x),yield null===(v=e.connector)||void 0===v?void 0:v.connectToChannel
6({channelId:k}));let I=(null===(b=e.platformManager)||void 0===b?void 0:b.isSecure())?"":"&t=q",R=lL.version,{iconUrl:L,name:P,url:O,scheme:T}=t.dappMetadata||{},N=null===(E=e.platformManager)||void 0===E?void 0:E.getPlatformType(),D="N/A";"undefined"!=typeof window&&window.location&&window.location.hostname?D=window.location.hostname:void 0!==P?D=P:void 0!==O&&(D=O);let $={url:null!=O?O:"",title:null!=P?P:"",icon:L,scheme:null!=T?T:"",apiVersion:R,dappId:D||O||"N/A",platform:null!=N?N:"",source:null!==(w=t._source)&&void 0!==w?w:""},B=lG(JSON.stringify($)),K=`channelId=${k}&v=2&comm=${null!==(C=e.communicationLayerPreference)&&void 0!==C?C:""}&pubkey=${M}${I}&originatorInfo=${B}`;if(r){K+=`&rpc=${lG(JSON.stringify(r))}`;let t=e.connector.getRPCMethodTracker();t&&(t[`${r.id}`]=Object.assign(Object.assign({},r),{id:`${r.id}`,timestamp:Date.now()}))}let j=encodeURI(K),U=`${e.useDeeplink?lT:lO}?${K}`;return e.qrcodeLink=U,e.developerMode&&lh(`[RemoteConnection: startConnection()] qrcodeLink=${j}`),_.emit("display_uri",U),(null===(S=e.platformManager)||void 0===S?void 0:S.isSecure())?(yield function(e,t){var n,r;return f(this,void 0,void 0,function*(){let i=`${lO}?${t}`,o=`${lT}?${t}`;null===(r=null===(n=e.platformManager)||void 0===n?void 0:n.openDeeplink)||void 0===r||r.call(n,i,o,"_self")})}(e,j),new Promise((t,n)=>{var r,i,o;(null===(r=e.connector)||void 0===r?void 0:r.isAuthorized())?t():(null===(i=e.connector)||void 0===i||i.once(ij.AUTHORIZED,()=>{t()}),null===(o=e.connector)||void 0===o||o.once(ij.REJECTED,()=>{n(ij.REJECTED)}))})):function(e,t,n){return f(this,void 0,void 0,function*(){return new Promise((r,i)=>{var o,a,s,l;if(!e.connector)return void i(Error("No connector available"));lh("[RemoteConnection: connectWithModalInstaller()]",{state:e,options:t,linkParams:n});let c=`${e.useDeeplink?lT:lO}?${n}`;e.installModal=null===(a=(o=t.modals).install)||void 0===a?void 0:a.call(o,{link:c,preferDesktop:e.preferDesktop,installer:t.getMetaMaskInstaller(),terminate:()=>{lh("[RemoteConnection: showInstallModal() => terminate()] terminate connection"),t.sdk.terminate().catch(e=>{console.warn("[MMSDK] failed to terminate connection",e)})},debug:e.developerMode,connectWithExtension:()=>{var e;return null===(e=t.connectWithExtensionProvider)||void 0===e||e.call(t),!1},onAnalyticsEvent:({event:n,params:r})=>{var i,o,a;let s=Object.assign(Object.assign({},r),{sdkVersion:t.sdk.getVersion(),dappId:null===(i=t.dappMetadata)||void 0===i?void 0:i.name,source:t._source,url:null===(o=t.dappMetadata)||void 0===o?void 0:o.url});null===(a=e.analytics)||void 0===a||a.send({event:n,params:s})}}),null===(l=null===(s=e.installModal)||void 0===s?void 0:s.mount)||void 0===l||l.call(s,c),t.sdk.once(ij.PROVIDER_UPDATE,e=>f(this,void 0,void 0,function*(){(lh("[RemoteConnection: connectWithModalInstaller()] once provider_update -- resolving startConnection promise"),e!==cj.TERMINATE)?i(e):i({code:4001,message:"User rejected the request."})})),e.connector.once(ij.AUTHORIZED,()=>{r()}),e.connector.once(ij.REJECTED,()=>{i(ij.REJECTED)}),e.connector.once(ij.CLIENTS_READY,()=>f(this,void 0,void 0,function*(){lh("[RemoteConnection: connectWithModalInstaller()] once clients_ready -- resolving startConnection promise"),r()}))})})}(e,t,j)}catch(e){throw console.error("[startConnection] error",e),e}})}(this.state,this.options,e)})}initRemoteCommunication({sdkInstance:e}){var t,n,r;return f(this,void 0,void 0,function*(){let i=yield null===(n=null===(t=e.options.storage)||void 0===t?void 0:t.storageManager)||void 0===n?void 0:n.getPersistedChannelConfig();if(!this.options.ecies){let e={privateKey:null==i?void 0:i.localKey};this.options.ecies=e}cl(this.state,this.options),yield null===(r=this.getConnector())||void 0===r?void 0:r.initFromDappStorage(),cd(this.state,this.options)})}showActiveModal(){var e,t,n,r,i;(e=this.state).authorized?lh("[RemoteConnection: showActiveModal()] already authorized"):e.pendingModal?null===(n=(t=e.pendingModal).mount)||void 0===n||n.call(t):e.installModal&&(null===(i=(r=e.installModal).mount)||void 0===i||i.call(r,e.qrcodeLink||""))}closeModal(){var e,t,n,r;null===(t=null===(e=this.state.pendingModal)||void 0===e?void 0:e.unmount)||void 0===t||t.call(e),null===(r=null===(n=this.state.installModal)||void 0===n?void 0:n.unmount)||void 0===r||r.call(n,!1)}getUniversalLink(){if(!this.state.qrcodeLink)throw Error("connection not started. run startConnection() first.");return this.state.qrcodeLink}getChannelConfig(){var e;return null===(e=this.state.connector)||void 0===e?void 0:e.getChannelConfig()}
6getKeyInfo(){var e;return null===(e=this.state.connector)||void 0===e?void 0:e.getKeyInfo()}getConnector(){if(!this.state.connector)throw Error("invalid remote connector");return this.state.connector}getPlatformManager(){if(!this.state.platformManager)throw Error("PlatformManager not available");return this.state.platformManager}isConnected(){var e;return(null===(e=this.state.connector)||void 0===e?void 0:e.isReady())||!1}isAuthorized(){var e;return(null===(e=this.state.connector)||void 0===e?void 0:e.isAuthorized())||!1}isPaused(){var e;return null===(e=this.state.connector)||void 0===e?void 0:e.isPaused()}disconnect(e){var t,n,r,i;lh("[RemoteConnection: disconnect()]",e),(null==e?void 0:e.terminate)&&(lk.getProvider().handleDisconnect({terminate:!0}),null===(n=null===(t=this.state.pendingModal)||void 0===t?void 0:t.unmount)||void 0===n||n.call(t),this.state.otpAnswer=void 0),null===(r=this.state.connector)||void 0===r||r.disconnect(e),i=this.state,lh("[RemoteConnection: cleanupConnector()] cleaning up connector"),i.connector&&(cc(i),i.connector.disconnect({terminate:!0}).catch(e=>{lh("[RemoteConnection: cleanupConnector()] error disconnecting connector",e)}))}}class ch extends c(){constructor(e={storage:{enabled:!0},injectProvider:!0,forceInjectProvider:!1,enableAnalytics:!0,shouldShimWeb3:!0,useDeeplink:!0,extensionOnly:!0,headless:!1,dappMetadata:{name:"",url:"",iconUrl:""},_source:lP,i18nOptions:{enabled:!1}}){var t,n,r;super(),this.extensionActive=!1,this._initialized=!1,this.sdkInitPromise=void 0,this.debug=!1,this.readonlyRPCCalls=!1,this.availableLanguages=["en"],s().disable();let i=!0===(null===(t=e.logging)||void 0===t?void 0:t.developerMode);if(((null===(n=e.logging)||void 0===n?void 0:n.sdk)||i)&&s().enable("MM_SDK"),lh("[MetaMaskSDK: constructor()]: begin."),this.setMaxListeners(50),!(null===(r=e.dappMetadata)||void 0===r?void 0:r.url)){if("undefined"==typeof window||"undefined"==typeof document)throw Error("You must provide dAppMetadata url");e.dappMetadata=Object.assign(Object.assign({},e.dappMetadata),{url:`${window.location.protocol}//${window.location.host}`})}this.options=e,this.options._source||(e._source=lP),this.init().then(()=>{lh("[MetaMaskSDK: constructor()]: initialized successfully."),"undefined"!=typeof window&&(window.mmsdk=this)}).catch(e=>{console.error("[MetaMaskSDK: constructor()] error during initialization",e)})}init(){return f(this,void 0,void 0,function*(){return function(e){var t;return f(this,void 0,void 0,function*(){if("undefined"!=typeof window&&(null===(t=window.mmsdk)||void 0===t?void 0:t.isInitialized()))return lh("[MetaMaskSDK: initializeMetaMaskSDK()] already initialized"),Promise.resolve(window.mmsdk);if(e._initialized)return lh("[MetaMaskSDK: initializeMetaMaskSDK()] already initialized"),e.sdkInitPromise;if(e.sdkInitPromise)return lh("[MetaMaskSDK: initializeMetaMaskSDK()] already initializing"),e.sdkInitPromise;try{e.sdkInitPromise=function(e){var t,n,r,i,o,a,l,c,d,u,h;return f(this,void 0,void 0,function*(){let{options:p}=e;if(p.logging=null!==(t=p.logging)&&void 0!==t?t:{},p.communicationLayerPreference=null!==(n=p.communicationLayerPreference)&&void 0!==n?n:iV.SOCKET,void 0!==p.enableDebug&&(s().enable("MM_SDK"),console.warn("enableDebug is removed. Please use enableAnalytics instead.")),p.enableAnalytics=null===(r=p.enableAnalytics)||void 0===r||r,p.injectProvider=null===(i=p.injectProvider)||void 0===i||i,p.shouldShimWeb3=null===(o=p.shouldShimWeb3)||void 0===o||o,p.extensionOnly=null===(a=p.extensionOnly)||void 0===a||a,p.useDeeplink=null===(l=p.useDeeplink)||void 0===l||l,p.storage=null!==(c=p.storage)&&void 0!==c?c:{enabled:!0},p.headless){s()("[MetaMaskSDK: performSDKInitialization()] headless mode enabled");let e=()=>{};p.modals={install:()=>({mount:e,unmount:e})},p.ui={installer:e}}let g=!0===(null===(d=p.logging)||void 0===d?void 0:d.developerMode);e.debug=(null===(u=p.logging)||void 0===u?void 0:u.sdk)||g,lh("[MetaMaskSDK: performSDKInitialization()] options",e.options);let m=Object.assign({},p.logging);g&&(m.sdk=!0,m.eciesLayer=!0,m.keyExchangeLayer=!0,m.remoteLayer=!0,m.serviceLayer=!0,m.plaintext=!0),yield function(e){var t;return f(this,void 0,void 0,function*(){let{options:n}=e;e.platformManager=new lM({useDeepLink:null!==(t=n.useDeeplink)&&void 0!==t&&t,preferredOpenLink:n.openDeeplink,debug:e.debug})})}(e),yield function(e){var t,n,r,i,o,a,s,l,c;return f(this,void 0,void 0,function*(){let{options:d}=e,u=null===(t=e.platformManager)||void 0===t?void 0:t.getPlatformType();e.analytics=new lQ({serverUrl:null!==(n=d.communicationServerUrl)&&void 0!==n?n:rz,enabled:d.enableAnalytics,originatorInfo:{url:null!==(r=d.dappMetadata.url)&&void 0!==r?r:"",title:null!==(i=d.dappMetadata.name)&&void 0!==i?i:"",dappId:"undefined"==typeof window||void 0===window.location?null!==(l=null!==(a=null===(o=d.dappMetadata)||void 0===o?void 0:o.name)&&void 0!==a?a:null===(s=d.dappMetadata)||void 0===s?void 0:s.url)&&void 0!==l?l:"N/A":window.location.hostname,platform:null!=u?u:"",source:null!==(c=d._source)&&void 0!==c?c:""}})})}(e),yield function(e){var t;return f(this,void 0,void 0,function*(){let{options:n}=e;!0!==(null===(t=n.storage)||void 0===t?void 0:t.enabled)||n.storage.storageManager||(n.storage.storageManager=yield lA(n.storage))})}(e),yield function(e){return f(this,void 0,void 0,function*(){let{options:t}=e,n=/^(http|https):\/\/[^\s]*$/;if(t.dappMetadata){t.dappMetadata.iconUrl&&!n.test(t.dappMetadata.iconUrl)&&(console.warn("Invalid dappMetadata.iconUrl: URL must start with http:// or https://"),t.dappMetadata.iconUrl=void 0),t.dappMetadata.base64Icon&&t.dappMetadata.base64Icon.length>163400&&(console.warn("Invalid dappMetadata.base64Icon: Base64-encoded icon string length must be less than 163400 characters"),t.dappMetadata.base64Icon=void 0),t.dappMetadata.url&&!n.test(t.dappMetadata.url)&&console.warn("Invalid dappMetadata.url: URL must start with http:// or https://");let e=l0();if(e&&!t.dappMetadata.iconUrl&&!t.dappMetadata.base64Icon){let n=`${window.location.protocol}//${window.location.host}${e}`;t.dappMetadata.iconUrl=n}}e.dappMetadata=t.dappMetadata})}(e),yield l3(e),yield l5(e);let{metamaskBrowserExtension:y,preferExtension:v,shouldReturn:b}=yield function(e){var t,n,r,i;return f(this,void 0,void 0,function*(){let{options:o}=e,a,s=!1,l=!1;if("undefined"==typeof window||!window.ethereum||(null===(t=e.platformManager)||void 0===t?void 0:t.isMetaMaskMobileWebView()))(null===(n=e.platformManager)||void 0===n?void 0:n.isMetaMaskMobileWebView())&&(null===(r=e.anal
6ytics)||void 0===r||r.send({event:iz.SDK_USE_INAPP_BROWSER}),e.activeProvider=l2({provider:window.ethereum,sdkInstance:e}),e._initialized=!0,l=!0);else{s="extension"===localStorage.getItem(lH);try{a=yield function({mustBeMetaMask:e,sdkInstance:t}){return f(this,void 0,void 0,function*(){if("undefined"==typeof window)throw Error("window not available");try{let e=yield new Promise((e,t)=>{let n=setTimeout(()=>{t(Error("eip6963RequestProvider timed out"))},500);window.addEventListener(cU.Announce,t=>{let{detail:{info:r,provider:i}={}}=t,{name:o,rdns:a,uuid:s}=null!=r?r:{};lD.test(s)&&o.startsWith(lN.NAME)&&lN.RDNS.includes(a)&&(clearTimeout(n),e(i))}),window.dispatchEvent(new Event(cU.Request))});return l2({provider:e,sdkInstance:t})}catch(n){if(!e&&window.ethereum)return l2({provider:window.ethereum,sdkInstance:t});throw Error("Provider not found")}})}({mustBeMetaMask:!0,sdkInstance:e}),window.extension=a,a.on(lq.CHAIN_CHANGED,t=>{lh(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE chainChanged chainId=${t}`),e.sdkProvider&&e.getMobileProvider().emit(lq.CHAIN_CHANGED,t)}),a.on(lq.ACCOUNTS_CHANGED,t=>f(this,void 0,void 0,function*(){var n;lh(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE accountsChanged accounts=${t}`);let r=!!e.sdkProvider,i=!!e.extensionActive;if(r&&e.getMobileProvider().emit(lq.ACCOUNTS_CHANGED,t),i&&0===(null==t?void 0:t.length)&&0===(yield null===(n=e.getProvider())||void 0===n?void 0:n.request({method:l$.WALLET_GETPERMISSIONS,params:[]})).length)try{yield e.terminate()}catch(e){lh("[MetaMaskSDK: setupExtensionPreferences()] error terminating on permissions revoked",e)}})),a.on(lq.DISCONNECT,t=>{lh(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE disconnect error=${t}`),e.sdkProvider&&e.getMobileProvider().emit(lq.DISCONNECT,t)}),a.on(lq.CONNECT,t=>{lh(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE connect args=${t}`),e.sdkProvider&&e.getMobileProvider().emit(lq.CONNECT,t)}),a.on(lq.CONNECTED,t=>{lh("[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE connected",t),e.sdkProvider&&e.getMobileProvider().emit(lq.CONNECTED,t)})}catch(e){window.extension=void 0}}return a&&o.extensionOnly&&(lh("[MetaMaskSDK: setupExtensionPreferences()] EXTENSION ONLY --- prevent sdk initialization"),null===(i=e.analytics)||void 0===i||i.send({event:iz.SDK_USE_EXTENSION}),e.activeProvider=a,e.extensionActive=!0,e.extension=a,e._initialized=!0,l=!0),{preferExtension:s,shouldReturn:l,metamaskBrowserExtension:a}})}(e);if(b)lh("[MetaMaskSDK: performSDKInitialization()] shouldReturn=true --- prevent sdk initialization");else{yield function(e,t){var n,r,i,o,a;return f(this,void 0,void 0,function*(){let{options:s}=e,l=Object.assign({},s.logging);e.remoteConnection=new cu({preferDesktop:null!==(n=s.preferDesktop)&&void 0!==n&&n,communicationLayerPreference:null!==(r=s.communicationLayerPreference)&&void 0!==r?r:iV.SOCKET,analytics:e.analytics,dappMetadata:s.dappMetadata,_source:s._source,enableAnalytics:null===(i=s.enableAnalytics)||void 0===i||i,timer:s.timer,sdk:e,platformManager:e.platformManager,transports:s.transports,communicationServerUrl:s.communicationServerUrl,storage:null!==(o=s.storage)&&void 0!==o?o:{enabled:!0},getMetaMaskInstaller:()=>{if(!e.installer)throw Error("Invalid SDK status -- installer not initialized");return e.installer},logging:l,connectWithExtensionProvider:void 0===t?void 0:()=>lV(e),modals:Object.assign(Object.assign({},s.modals),{onPendingModalDisconnect:e.terminate.bind(e)})}),yield e.remoteConnection.initRemoteCommunication({sdkInstance:e}),e.installer=new ci({remote:e.remoteConnection,preferDesktop:null!==(a=s.preferDesktop)&&void 0!==a&&a,platformManager:e.platformManager,debug:e.debug})})}(e,y),yield function(e){var t,n,r,i;return f(this,void 0,void 0,function*(){var o,a,s,l;let{options:c}=e,d={communicationLayerPreference:null!==(t=c.communicationLayerPreference)&&void 0!==t?t:iV.SOCKET,platformManager:e.platformManager,sdk:e,checkInstallationOnAllCalls:c.checkInstallationOnAllCalls,injectProvider:null===(n=c.injectProvider)||void 0===n||n,shouldShimWeb3:null===(r=c.shouldShimWeb3)||void 0===r||r,extensionOnly:null===(i=c.extensionOnly)||void 0===i||i,installer:e.installer,remoteConnection:e.remoteConnection,debug:e.debug};e.activeProvider=yield lX(d),null===(a=null===(o=e.remoteConnection)||void 0===o?void 0:o.getConnector())||void 0===a||a.on(lx.ConnectionStatus,t=>{e.emit(lx.ConnectionStatus,t)}),null===(l=null===(s=e.remoteConnection)||void 0===s?void 0:s.getConnector())||void 0===l||l.on(lx.ServiceStatus,t=>{e.emit(lx.ServiceStatus,t)})})}(e),yield function(e,t){var n,r;return f(this,void 0,void 0,function*(){let{options:i}=e;t?(lh("[MetaMaskSDK: handleAutoAndExtensionConnections()] preferExtension is detected -- connect with it."),null===(n=e.analytics)||void 0===n||n.send({event:iz.SDK_EXTENSION_UTILIZED}),lV(e).catch(e=>{console.warn("Can't connect with MetaMask extension...",e),localStorage.removeItem(lH)})):i.checkInstallationImmediately&&((null===(r=e.platformManager)||void 0===r?void 0:r.isDesktopWeb())?(lh("[MetaMaskSDK: handleAutoAndExtensionConnections()] checkInstallationImmediately"),e.connect().catch(e=>{lh(`[MetaMaskSDK: handleAutoAndExtensionConnections()] checkInstallationImmediately --- IGNORED --- error on autoconnect _err=${e}`)})):console.warn("[handleAutoAndExtensionConnections()] checkInstallationImmediately --- IGNORED --- only for web desktop")),e._initialized=!0})}(e,v);try{yield null===(h=e.remoteConnection)||void 0===h?void 0:h.startConnection({initialCheck:!0})}catch(e){console.error("[MetaMaskSDK: setupRemoteConnectionAndInstaller()] Error while checking installation",e)}
6e.emit(lx.ProviderUpdate,cj.INITIALIZED)}})}(e),yield e.sdkInitPromise}catch(e){throw console.error(e),e}return e.sdkInitPromise})}(this)})}isExtensionActive(){return this.extensionActive}checkExtensionAvailability(){var e;return"undefined"!=typeof window&&!!(null===(e=window.ethereum)||void 0===e?void 0:e.isMetaMask)}connect(){return f(this,void 0,void 0,function*(){return function(e){return f(this,void 0,void 0,function*(){if(e._initialized||(lh("[MetaMaskSDK: connect()] provider not ready -- wait for init()"),yield e.init()),lh(`[MetaMaskSDK: connect()] isExtensionActive=${e.isExtensionActive()} activeProvider`,e.activeProvider),!e.activeProvider)throw Error("SDK state invalid -- undefined provider");let t=e.activeProvider.getSelectedAddress();return t?[t]:e.activeProvider.request({method:l$.ETH_REQUESTACCOUNTS,params:[]})})}(this)})}connectAndSign({msg:e}){return f(this,void 0,void 0,function*(){return function({instance:e,msg:t}){return f(this,void 0,void 0,function*(){if(e._initialized||(lh("[MetaMaskSDK: connectAndSign()] provider not ready -- wait for init()"),yield e.init()),lh(`[MetaMaskSDK: connectAndSign()] activeProvider=${e.activeProvider}`),!e.activeProvider)throw Error("SDK state invalid -- undefined provider");let n=/^0x([0-9A-Fa-f]{2})*$/u.test(t)?t:function(e){let t;if(void 0!==A)t=A.from(e,"utf8").toString("hex");else if("undefined"!=typeof TextEncoder)t=Array.from((new TextEncoder).encode(e)).map(e=>e.toString(16).padStart(2,"0")).join("");else{if("object"!=typeof p||!("Buffer"in p))throw Error("Unable to convert string to hex: No available method.");t=p.Buffer.from(e,"utf8").toString("hex")}return`0x${t}`}(t);return e.activeProvider.request({method:l$.METAMASK_CONNECTWITH,params:[{method:l$.PERSONAL_SIGN,params:[n]}]})})}({instance:this,msg:e})})}connectWith(e){return f(this,void 0,void 0,function*(){return function({instance:e,rpc:t}){return f(this,void 0,void 0,function*(){if(e._initialized||(lh("[MetaMaskSDK: connectWith()] provider not ready -- wait for init()"),yield e.init()),lh(`[MetaMaskSDK: connectWith()] method: ${t.method} rpc=${t}`),!e.activeProvider)throw Error("SDK state invalid -- undefined provider");return e.activeProvider.request({method:l$.METAMASK_CONNECTWITH,params:[t]})})}({instance:this,rpc:e})})}resume(){return function(e){var t,n,r;return f(this,void 0,void 0,function*(){if(!(null===(n=null===(t=e.remoteConnection)||void 0===t?void 0:t.getConnector())||void 0===n?void 0:n.isReady()))return lh("[MetaMaskSDK: resume()] channel is not ready -- starting connection"),void(null===(r=e.remoteConnection)||void 0===r||r.startConnection());lh("[MetaMaskSDK: resume()] channel is ready")})}(this)}disconnect(){return console.warn("MetaMaskSDK.disconnect() is deprecated, use terminate()"),this.terminate()}isAuthorized(){var e;null===(e=this.remoteConnection)||void 0===e||e.isAuthorized()}terminate(){return function(e){var t,n,r;return f(this,void 0,void 0,function*(){if(!(null===(t=e.platformManager)||void 0===t?void 0:t.isMetaMaskMobileWebView())){if(lW&&(window.localStorage.removeItem(lH),window.localStorage.removeItem(lz),window.localStorage.removeItem(lF)),e.extensionActive){try{yield null===(n=e.activeProvider)||void 0===n?void 0:n.request({method:l$.WALLET_REVOKEPERMISSIONS,params:[{eth_accounts:{}}]})}catch(e){lh("[MetaMaskSDK: terminate()] error revoking permissions",e)}return e.options.extensionOnly?(e.emit(lx.ProviderUpdate,cj.TERMINATE),void lh("[MetaMaskSDK: terminate()] extensionOnly --- prevent switching providers")):(e.activeProvider=e.sdkProvider,window.ethereum=e.activeProvider,e.extensionActive=!1,void e.emit(lx.ProviderUpdate,cj.TERMINATE))}e.emit(lx.ProviderUpdate,cj.TERMINATE),lh(`[MetaMaskSDK: terminate()] remoteConnection=${e.remoteConnection}`),null===(r=e.remoteConnection)||void 0===r||r.disconnect({terminate:!0,sendMessage:!0})}})}(this)}isInitialized(){return this._initialized}setReadOnlyRPCCalls(e){this.readonlyRPCCalls=e}hasReadOnlyRPCCalls(){return this.readonlyRPCCalls}
6getProvider(){if(this.activeProvider)return this.activeProvider;console.warn("MetaMaskSDK: No active provider found")}getMobileProvider(){if(!this.sdkProvider)throw Error("SDK state invalid -- undefined mobile provider");return this.sdkProvider}getUniversalLink(){var e;let t=null===(e=this.remoteConnection)||void 0===e?void 0:e.getUniversalLink();if(!t)throw Error("No Universal Link available, please call eth_requestAccounts first.");return t}getChannelId(){var e,t;return null===(t=null===(e=this.remoteConnection)||void 0===e?void 0:e.getChannelConfig())||void 0===t?void 0:t.channelId}getRPCHistory(){var e,t;return null===(t=null===(e=this.remoteConnection)||void 0===e?void 0:e.getConnector())||void 0===t?void 0:t.getRPCMethodTracker()}getVersion(){return lL.version}getWalletStatus(){var e,t;return null===(t=null===(e=this.remoteConnection)||void 0===e?void 0:e.getConnector())||void 0===t?void 0:t.getConnectionStatus()}_getChannelConfig(){var e;return null===(e=this.remoteConnection)||void 0===e?void 0:e.getChannelConfig()}_ping(){var e,t;null===(t=null===(e=this.remoteConnection)||void 0===e?void 0:e.getConnector())||void 0===t||t.ping()}_keyCheck(){var e,t;null===(t=null===(e=this.remoteConnection)||void 0===e?void 0:e.getConnector())||void 0===t||t.keyCheck()}_getServiceStatus(){var e,t;return null===(t=null===(e=this.remoteConnection)||void 0===e?void 0:e.getConnector())||void 0===t?void 0:t.getServiceStatus()}_getRemoteConnection(){return this.remoteConnection}_getDappMetadata(){return this.dappMetadata}_getKeyInfo(){var e;return null===(e=this.remoteConnection)||void 0===e?void 0:e.getKeyInfo()}_resetKeys(){var e,t;null===(t=null===(e=this.remoteConnection)||void 0===e?void 0:e.getConnector())||void 0===t||t.resetKeys()}_getConnection(){return this.remoteConnection}emit(e,t){return super.emit(e,t)}on(e,t){return super.on(e,t)}}var cf=Object.freeze({__proto__:null,StorageManagerWeb:class{constructor({enabled:e}={enabled:!1}){this.enabled=!1,this.enabled=e}persistChannelConfig(e){return f(this,void 0,void 0,function*(){let t=JSON.stringify(e);lh(`[StorageManagerWeb: persistChannelConfig()] enabled=${this.enabled}`,e),localStorage.setItem(lU,t)})}getPersistedChannelConfig(){return f(this,void 0,void 0,function*(){let e;try{if(lh(`[StorageManagerWeb: getPersistedChannelConfig()] enabled=${this.enabled}`),e=localStorage.getItem(lU),lh("[StorageManagerWeb: getPersistedChannelConfig()]",e),!e)return;let t=JSON.parse(e);return lh("[StorageManagerWeb: getPersistedChannelConfig()] channelConfig",t),t}catch(e){return void console.error("[StorageManagerWeb: getPersistedChannelConfig()] Can't find existing channel config",e)}})}persistAccounts(e){return f(this,void 0,void 0,function*(){lh(`[StorageManagerWeb: persistAccounts()] enabled=${this.enabled}`,e);let t=JSON.stringify(e);localStorage.setItem(lF,t)})}getCachedAccounts(){return f(this,void 0,void 0,function*(){try{let e=localStorage.getItem(lF);return e?JSON.parse(e):[]}catch(e){throw console.error("[StorageManagerWeb: getCachedAccounts()] Error reading cached accounts",e),e}})}persistChainId(e){return f(this,void 0,void 0,function*(){lh(`[StorageManagerWeb: persistChainId()] enabled=${this.enabled}`,e),localStorage.setItem(lz,e)})}getCachedChainId(){return f(this,void 0,void 0,function*(){try{let e=localStorage.getItem(lz);return null!=e?e:void 0}catch(e){throw console.error("[StorageManagerWeb: getCachedChainId()] Error reading cached chainId",e),e}})}terminate(){return f(this,void 0,void 0,function*(){lh(`[StorageManagerWeb: terminate()] enabled=${this.enabled}`),localStorage.removeItem(lU)})}}}),cp=Object.defineProperty,cg=new WeakMap,cm=e=>cg.get(e),cy=(e,t)=>cg.set(t.$lazyInstance$=e,t),cv=(e,t)=>t in e,cb=(e,t)=>(0,console.error)(e,t),cE=new Map,cw=new Map,cC="slot-fb{display:contents}slot-fb[hidden]{display:none}",cS="undefined"!=typeof window?window:{},c_=cS.document||{head:{}},cx={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,r)=>e.addEventListener(t,n,r),rel:(e,t,n,r)=>e.removeEventListener(t,n,r),ce:(e,t)=>new CustomEvent(e,t)},ck=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),cM=!1,cA=[],cI=[],cR=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){cb(e)}e.length=0},cL=()=>{cR(cA),cR(cI),(cM=cA.length>0)&&cx.raf(cL)},cP=e=>Promise.resolve(void 0).then(e),cO=e=>{cI.push(e),cM||(cM=!0,4&cx.$flags$?cP(cL):cx.raf(cL))},cT={},cN=e=>"object"==(e=typeof e)||"function"===e;function cD(e){var t,n,r;return null!=(r=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?r:void 0}((e,t)=>{for(var n in t)cp(e,n,{get:t[n],enumerable:!0})})({},{err:()=>cB,map:()=>cK,ok:()=>c$,unwrap:()=>cz,unwrapErr:()=>cq});var c$=e=>({isOk:!0,isErr:!1,value:e}),cB=e=>({isOk:!1,isErr:!0,value:e});function cK(e,t){if(e.isOk){let n=t(e.value);return n instanceof Promise?n.then(e=>c$(e)):c$(n)}if(e.isErr)return cB(e.value);throw"should never get here"}var cj,cU,cH,cF,cz=e=>{if(e.isOk)return e.value;throw e.value},cq=e=>{if(e.isErr)return e.value;throw e.value},cW=(e,t,...n)=>{let r=null,i=!1,o=!1,a=[],s=t=>{for(let n=0;n<t.length;n++)Array.isArray(r=t[n])?s(r):null!=r&&"boolean"!=typeof r&&((i="function"!=typeof e&&!cN(r))&&(r=String(r)),i&&o?a[a.length-1].$text$+=r:a.push(i?cV(null,r):r),o=i)};if(s(n),t){let e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter(t=>e[t]).join(" "))}if("function"==typeof e)return e(null===t?{}:t,a,cZ);let l=cV(e,null);return l.$attrs$=t,a.length>0&&(l.$children$=a),l},cV=(e,t)=>({$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null}),cG={},cZ={forEach:(e,t)=>e.map(cY).forEach(t),map:(e,t)=>e.map(cY).map(t).map(cJ)},cY=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),cJ=e=>{if("function"==typeof e.vtag){let t={...e.vattrs};
6return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),cW(e.vtag,t,...e.vchildren||[])}let t=cV(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},cX=e=>cm(e).$hostElement$,cQ=(e,t,n)=>{let r=cX(e);return{emit:e=>c0(r,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},c0=(e,t,n)=>{let r=cx.ce(t,n);return e.dispatchEvent(r),r},c1=new WeakMap,c2=e=>{let t=e.$cmpMeta$,n=e.$hostElement$,r=t.$flags$,i=(t.$tagName$,()=>{}),o=((e,t,n)=>{var r;let i=c3(t),o=cw.get(i);if(e=11===e.nodeType?e:c_,o)if("string"==typeof o){e=e.head||e;let n,a=c1.get(e);if(a||c1.set(e,a=new Set),!a.has(i)){{(n=c_.createElement("style")).innerHTML=o;let i=null!=(r=cx.$nonce$)?r:cD(c_);if(null!=i&&n.setAttribute("nonce",i),!(1&t.$flags$))if("HEAD"===e.nodeName){let t=e.querySelectorAll("link[rel=preconnect]"),r=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(n,r)}else if("host"in e)if(ck){let t=new CSSStyleSheet;t.replaceSync(o),e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{let t=e.querySelector("style");t?t.innerHTML=o+t.innerHTML:e.prepend(n)}else e.append(n);1&t.$flags$&&"HEAD"!==e.nodeName&&e.insertBefore(n,null)}4&t.$flags$&&(n.innerHTML+=cC),a&&a.add(i)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return i})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&r&&2&r&&(n["s-sc"]=o,n.classList.add(o+"-h")),i()},c3=(e,t)=>"sc-"+e.$tagName$,c5=(e,t,n,r,i,o)=>{if(n!==r){let a=cv(e,t),s=t.toLowerCase();if("class"===t){let t=e.classList,i=c4(n),o=c4(r);t.remove(...i.filter(e=>e&&!o.includes(e))),t.add(...o.filter(e=>e&&!i.includes(e)))}else if("style"===t){for(let t in n)r&&null!=r[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(let t in r)n&&r[t]===n[t]||(t.includes("-")?e.style.setProperty(t,r[t]):e.style[t]=r[t])}else if(a||"o"!==t[0]||"n"!==t[1]){let s=cN(r);if((a||s&&null!==r)&&!i)try{if(e.tagName.includes("-"))e[t]=r;else{let i=null==r?"":r;"list"===t?a=!1:null!=n&&e[t]==i||("function"==typeof e.__lookupSetter__(t)?e[t]=i:e.setAttribute(t,i))}}catch(e){}null==r||!1===r?!1===r&&""!==e.getAttribute(t)||e.removeAttribute(t):(!a||4&o||i)&&!s&&(r=!0===r?"":r,e.setAttribute(t,r))}else if(t="-"===t[2]?t.slice(3):cv(cS,s)?s.slice(2):s[2]+t.slice(3),n||r){let i=t.endsWith(c6);t=t.replace(c7,""),n&&cx.rel(e,t,n,i),r&&cx.ael(e,t,r,i)}}},c8=/\s/,c4=e=>e?e.split(c8):[],c6="Capture",c7=RegExp(c6+"$"),c9=(e,t,n)=>{let r=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||cT,o=t.$attrs$||cT;for(let e of de(Object.keys(i)))e in o||c5(r,e,i[e],void 0,n,t.$flags$);for(let e of de(Object.keys(o)))c5(r,e,i[e],o[e],n,t.$flags$)};function de(e){return e.includes("ref")?[...e.filter(e=>"ref"!==e),"ref"]:e}var dt=!1,dn=!1,dr=(e,t,n,r)=>{let i=t.$children$[n],o,a,s=0;if(null!==i.$text$)o=i.$elm$=c_.createTextNode(i.$text$);else{if(dn||(dn="svg"===i.$tag$),o=i.$elm$=c_.createElementNS(dn?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i.$tag$),dn&&"foreignObject"===i.$tag$&&(dn=!1),c9(null,i,dn),o.getRootNode().querySelector("body"),i.$children$)for(s=0;s<i.$children$.length;++s)(a=dr(e,i,s))&&o.appendChild(a);"svg"===i.$tag$?dn=!1:"foreignObject"===o.tagName&&(dn=!0)}return o["s-hn"]=cF,o},di=(e,t,n,r,i,o)=>{let a,s=e;for(s.shadowRoot&&s.tagName===cF&&(s=s.shadowRoot);i<=o;++i)r[i]&&(a=dr(null,n,i))&&(r[i].$elm$=a,dc(s,a,t))},da=(e,t,n)=>{for(let r=t;r<=n;++r){let t=e[r];if(t){let e=t.$elm$;e&&e.remove()}}},ds=(e,t,n=!1)=>e.$tag$===t.$tag$,dl=(e,t,n=!1)=>{let r=t.$elm$=e.$elm$,i=e.$children$,o=t.$children$,a=t.$tag$,s=t.$text$;null===s?(c9(e,t,dn="svg"===a||"foreignObject"!==a&&dn),null!==i&&null!==o?((e,t,n,r,i=!1)=>{let o,a=0,s=0,l=t.length-1,c=t[0],d=t[l],u=r.length-1,h=r[0],f=r[u];for(;a<=l&&s<=u;)null==c?c=t[++a]:null==d?d=t[--l]:null==h?h=r[++s]:null==f?f=r[--u]:ds(c,h,i)?(dl(c,h,i),c=t[++a],h=r[++s]):ds(d,f,i)?(dl(d,f,i),d=t[--l],f=r[--u]):ds(c,f,i)?(dl(c,f,i),dc(e,c.$elm$,d.$elm$.nextSibling),c=t[++a],f=r[--u]):ds(d,h,i)?(dl(d,h,i),dc(e,d.$elm$,c.$elm$),d=t[--l],h=r[++s]):(o=dr(t&&t[s],n,s),h=r[++s],o&&dc(c.$elm$.parentNode,o,c.$elm$));a>l?di(e,null==r[u+1]?null:r[u+1].$elm$,n,r,s,u):s>u&&da(t,a,l)})(r,i,t,o,n):null!==o?(null!==e.$text$&&(r.textContent=""),di(r,null,t,o,0,o.length-1)):n||null===i||da(i,0,i.length-1),dn&&"svg"===a&&(dn=!1)):e.$text$!==s&&(r.data=s)},dc=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),dd=(e,t,n=!1)=>{let r=e.$hostElement$,i=e.$cmpMeta$,o=e.$vnode$||cV(null,null),a=t&&t.$tag$===cG?t:cW(null,null,t);if(cF=r.tagName,n&&a.$attrs$)for(let e of Object.keys(a.$attrs$))r.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(a.$attrs$[e]=r[e]);a.$tag$=null,a.$flags$|=4,e.$vnode$=a,a.$elm$=o.$elm$=r.shadowRoot||r,r["s-sc"],i.$flags$,dl(o,a,n)},du=(e,t)=>
6{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise(t=>e.$onRenderResolve$=t))},dh=(e,t)=>(e.$flags$|=16,4&e.$flags$)?void(e.$flags$|=512):(du(e,e.$ancestorComponent$),cO(()=>df(e,t))),df=(e,t)=>{let n=e.$hostElement$,r=(e.$cmpMeta$.$tagName$,()=>{}),i=e.$lazyInstance$;if(!i)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);return r(),dp(void 0,()=>dm(e,i,t))},dp=(e,t)=>dg(e)?e.then(t).catch(e=>{console.error(e),t()}):t(),dg=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,dm=async(e,t,n)=>{var r;let i=e.$hostElement$,o=(e.$cmpMeta$.$tagName$,()=>{}),a=i["s-rc"];n&&c2(e);let s=(e.$cmpMeta$.$tagName$,()=>{});dy(e,t,i,n),a&&(a.map(e=>e()),i["s-rc"]=void 0),s(),o();{let t=null!=(r=i["s-p"])?r:[],n=()=>dv(e);0===t.length?n():(Promise.all(t).then(n),e.$flags$|=4,t.length=0)}},dy=(e,t,n,r)=>{try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,dd(e,t,r)}catch(t){cb(t,e.$hostElement$)}return null},dv=e=>{e.$cmpMeta$.$tagName$;let t=e.$hostElement$,n=()=>{},r=e.$lazyInstance$,i=e.$ancestorComponent$;64&e.$flags$?n():(e.$flags$|=64,dw(t),dE(r,"componentDidLoad"),n(),e.$onReadyResolve$(t),i||db()),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&cP(()=>dh(e,!1)),e.$flags$&=-517},db=e=>{dw(c_.documentElement),cP(()=>c0(cS,"appload",{detail:{namespace:"sdk-install-modal-web"}}))},dE=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){cb(e)}},dw=e=>e.classList.add("hydrated"),dC=(e,t,n,r)=>{var i,o;let a=cm(e);if(!a)throw Error(`Couldn't find host element for "${r.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);let s=a.$hostElement$,l=a.$instanceValues$.get(t),c=a.$flags$,d=a.$lazyInstance$;i=n,o=r.$members$[t][0],n=null==i||cN(i)?i:4&o?"false"!==i&&(""===i||!!i):1&o?String(i):i;let u=Number.isNaN(l)&&Number.isNaN(n);if((!(8&c)||void 0===l)&&n!==l&&!u&&(a.$instanceValues$.set(t,n),d)){if(r.$watchers$&&128&c){let e=r.$watchers$[t];e&&e.map(e=>{try{d[e](n,l,t)}catch(e){cb(e,s)}})}2==(18&c)&&dh(a,!1)}},dS=(e,t,n)=>{var r,i;let o=e.prototype;if(t.$members$||t.$watchers$||e.watchers){e.watchers&&!t.$watchers$&&(t.$watchers$=e.watchers);let a=Object.entries(null!=(r=t.$members$)?r:{});if(a.map(([e,[r]])=>{(31&r||2&n&&32&r)&&Object.defineProperty(o,e,{get(){return cm(this).$instanceValues$.get(e)},set(n){dC(this,e,n,t)},configurable:!0,enumerable:!0})}),1&n){let n=new Map;o.attributeChangedCallback=function(e,r,i){cx.jmp(()=>{var a;let s=n.get(e);if(this.hasOwnProperty(s))i=this[s],delete this[s];else{if(o.hasOwnProperty(s)&&"number"==typeof this[s]&&this[s]==i)return;if(null==s){let n=cm(this),o=null==n?void 0:n.$flags$;if(o&&!(8&o)&&128&o&&i!==r){let o=n.$lazyInstance$,s=null==(a=t.$watchers$)?void 0:a[e];null==s||s.forEach(t=>{null!=o[t]&&o[t].call(o,i,r,e)})}return}}this[s]=(null!==i||"boolean"!=typeof this[s])&&i})},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=t.$watchers$)?i:{}),...a.filter(([e,t])=>15&t[0]).map(([e,t])=>{let r=t[1]||e;return n.set(r,e),r})]))}}return e},d_=async(e,t,n,r)=>{let i;if(0==(32&t.$flags$)){if(t.$flags$|=32,n.$lazyBundleId$){let e=((e,t,n)=>{let r=e.$tagName$.replace(/-/g,"_"),i=e.$lazyBundleId$;if(!i)return;let o=cE.get(i);return o?o[r]:"mm-install-modal_3"===i?Promise.resolve().then(function(){return ue}).then(e=>(cE.set(i,e),e[r]),cb):import(`./${i}.entry.js`).then(e=>(cE.set(i,e),e[r]),cb)})(n);if(!(i=e&&"then"in e?await e:e))throw Error(`Constructor for "${n.$tagName$}#${t.$modeName$}" was not found`);i.isProxied||(n.$watchers$=i.watchers,dS(i,n,2),i.isProxied=!0);let r=(n.$tagName$,()=>{});t.$flags$|=8;try{new i(t)}catch(e){cb(e)}t.$flags$&=-9,t.$flags$|=128,r(),dx(t.$lazyInstance$)}else{i=e.constructor;let n=e.localName;customElements.whenDefined(n).then(()=>t.$flags$|=128)}if(i&&i.style){let e;"string"==typeof i.style&&(e=i.style);let t=c3(n);if(!cw.has(t)){let r=(n.$tagName$,()=>{});
6((e,t,n)=>{let r=cw.get(e);ck&&n?"string"==typeof(r=r||new CSSStyleSheet)?r=t:r.replaceSync(t):r=t,cw.set(e,r)})(t,e,!!(1&n.$flags$)),r()}}}let o=t.$ancestorComponent$,a=()=>dh(t,!0);o&&o["s-rc"]?o["s-rc"].push(a):a()},dx=e=>{dE(e,"connectedCallback")},dk=e=>{dE(e,"disconnectedCallback")},dM=(e,t={})=>{var n;let r=[],i=t.exclude||[],o=cS.customElements,a=c_.head,s=a.querySelector("meta[charset]"),l=c_.createElement("style"),c=[],d,u=!0;Object.assign(cx,t),cx.$resourcesUrl$=new URL(t.resourcesUrl||"./",c_.baseURI).href;let h=!1;if(e.map(e=>{e[1].map(t=>{var n;let a={$flags$:t[0],$tagName$:t[1],$members$:t[2],$listeners$:t[3]};4&a.$flags$&&(h=!0),a.$members$=t[2],a.$watchers$=null!=(n=t[4])?n:{};let s=a.$tagName$,l=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,t)=>{let n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};n.$onReadyPromise$=new Promise(e=>n.$onReadyResolve$=e),e["s-p"]=[],e["s-rc"]=[],cg.set(e,n)})(e=this,a),1&a.$flags$)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${a.$tagName$}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){cm(this),this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),d&&(clearTimeout(d),d=null),u?c.push(this):cx.jmp(()=>(e=>{if(0==(1&cx.$flags$)){let t=cm(e),n=t.$cmpMeta$,r=(n.$tagName$,()=>{});if(1&t.$flags$)(null==t?void 0:t.$lazyInstance$)?dx(t.$lazyInstance$):(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then(()=>dx(t.$lazyInstance$));else{t.$flags$|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){du(t,t.$ancestorComponent$=n);break}}n.$members$&&Object.entries(n.$members$).map(([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){let n=e[t];delete e[t],e[t]=n}}),d_(e,t,n)}r()}})(this))}disconnectedCallback(){cx.jmp(()=>(async e=>{if(0==(1&cx.$flags$)){let t=cm(e);(null==t?void 0:t.$lazyInstance$)?dk(t.$lazyInstance$):(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then(()=>dk(t.$lazyInstance$))}})(this))}componentOnReady(){return cm(this).$onReadyPromise$}};a.$lazyBundleId$=e[0],i.includes(s)||o.get(s)||(r.push(s),o.define(s,dS(l,a,1)))})}),r.length>0&&(h&&(l.textContent+=cC),l.textContent+=r.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",l.innerHTML.length)){l.setAttribute("data-styles","");let e=null!=(n=cx.$nonce$)?n:cD(c_);null!=e&&l.setAttribute("nonce",e),a.insertBefore(l,s?s.nextSibling:a.firstChild)}u=!1,c.length?c.map(e=>e.connectedCallback()):cx.jmp(()=>d=setTimeout(db,30))};!function(){if("undefined"!=typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}();var dA=Object.freeze({__proto__:null,defineCustomElements:async(e,t)=>{if("undefined"!=typeof window)return await void 0,dM([["mm-install-modal_3",[[1,"mm-install-modal",{link:[1],sdkVersion:[1,"sdk-version"],preferDesktop:[4,"prefer-desktop"],tab:[32],isDefaultTab:[32],translationsLoaded:[32]},null,{preferDesktop:["updatePreferDesktop"]}],[1,"mm-pending-modal",{displayOTP:[4,"display-o-t-p"],sdkVersion:[1,"sdk-version"],otpCode:[1,"otp-code"],translationsLoaded:[32]}],[1,"mm-select-modal",{link:[1],sdkVersion:[1,"sdk-version"],preferDesktop:[4,"prefer-desktop"],tab:[32],isDefaultTab:[32],translationsLoaded:[32]},null,{preferDesktop:["updatePreferDesktop"]}]]]],t)},setNonce:e=>cx.$nonce$=e});let dI={fontFamily:"Roboto, sans-serif"},dR=({className:e},t)=>cW("div",{style:dI,class:e},t),dL=({Icon:e,text:t})=>cW("div",{class:"flexContainer",style:{padding:"6",flexDirection:"row"}},cW("div",{class:"flexItem1"},cW(e,null)),cW("div",{class:"flexItem11"},cW("span",{style:{lineHeight:"2",color:"black"}},t))),dP=()=>cW("svg",{width:"20",height:"18",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cW("path",{d:"M20.0002 7.9702V10.0302C20.0002 10.5802 19.5602 11.0302 19.0002 11.0502H17.0402C15.9602 11.0502 14.9702 10.2602 14.8802 9.1802C14.8202 8.5502 15.0602 7.9602 15.4802 7.5502
6C15.8502 7.1702 16.3602 6.9502 16.9202 6.9502H19.0002C19.5602 6.9702 20.0002 7.4202 20.0002 7.9702Z",fill:"#037DD6"}),cW("path",{d:"M18.47 12.55H17.04C15.14 12.55 13.54 11.12 13.38 9.3C13.29 8.26 13.67 7.22 14.43 6.48C15.07 5.82 15.96 5.45 16.92 5.45H18.47C18.76 5.45 19 5.21 18.97 4.92C18.75 2.49 17.14 0.83 14.75 0.55C14.51 0.51 14.26 0.5 14 0.5H5C4.72 0.5 4.45 0.52 4.19 0.56C1.64 0.88 0 2.78 0 5.5V12.5C0 15.26 2.24 17.5 5 17.5H14C16.8 17.5 18.73 15.75 18.97 13.08C19 12.79 18.76 12.55 18.47 12.55ZM11 6.75H5C4.59 6.75 4.25 6.41 4.25 6C4.25 5.59 4.59 5.25 5 5.25H11C11.41 5.25 11.75 5.59 11.75 6C11.75 6.41 11.41 6.75 11 6.75Z",fill:"#037DD6"})),dO=()=>cW("svg",{width:"20",height:"18",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cW("path",{d:"M14.44 0.0999756C12.63 0.0999756 11.01 0.979976 10 2.32998C8.99 0.979976 7.37 0.0999756 5.56 0.0999756C2.49 0.0999756 0 2.59998 0 5.68998C0 6.87998 0.19 7.97998 0.52 8.99998C2.1 14 6.97 16.99 9.38 17.81C9.72 17.93 10.28 17.93 10.62 17.81C13.03 16.99 17.9 14 19.48 8.99998C19.81 7.97998 20 6.87998 20 5.68998C20 2.59998 17.51 0.0999756 14.44 0.0999756Z",fill:"#037DD6"})),dT=()=>cW("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cW("path",{d:"M16.28 7.53V6.28C16.28 3.58 15.63 0 10 0C4.37 0 3.72 3.58 3.72 6.28V7.53C0.92 7.88 0 9.3 0 12.79V14.65C0 18.75 1.25 20 5.35 20H14.65C18.75 20 20 18.75 20 14.65V12.79C20 9.3 19.08 7.88 16.28 7.53ZM10 16.74C8.33 16.74 6.98 15.38 6.98 13.72C6.98 12.05 8.34 10.7 10 10.7C11.66 10.7 13.02 12.06 13.02 13.72C13.02 15.39 11.67 16.74 10 16.74ZM5.35 7.44C5.27 7.44 5.2 7.44 5.12 7.44V6.28C5.12 3.35 5.95 1.4 10 1.4C14.05 1.4 14.88 3.35 14.88 6.28V7.45C14.8 7.45 14.73 7.45 14.65 7.45H5.35V7.44Z",fill:"#037DD6"})),dN=()=>cW("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cW("path",{d:"M16.4405 8.8999C20.0405 9.2099 21.5105 11.0599 21.5105 15.1099V15.2399C21.5105 19.7099 19.7205 21.4999 15.2505 21.4999H8.74047C4.27047 21.4999 2.48047 19.7099 2.48047 15.2399V15.1099C2.48047 11.0899 3.93047 9.2399 7.47047 8.9099",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M12 2V14.88",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M15.3504 12.6499L12.0004 15.9999L8.65039 12.6499",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));function dD({version:e}){return cW("div",{style:{textAlign:"center",color:"#BBC0C5",fontSize:"12"}},"SDK Version ",e?`v${e}`:"unknown")}let d$=()=>cW("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cW("rect",{width:"16",height:"16",fill:"white"}),cW("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.40554 2.40554C2.94627 1.86482 3.82296 1.86482 4.36369 2.40554L8 6.04186L11.6363 2.40554C12.177 1.86482 13.0537 1.86482 13.5945 2.40554C14.1352 2.94627 14.1352 3.82296 13.5945 4.36369L9.95814 8L13.5945 11.6363C14.1352 12.177 14.1352 13.0537 13.5945 13.5945C13.0537 14.1352 12.177 14.1352 11.6363 13.5945L8 9.95814L4.36369 13.5945C3.82296 14.1352 2.94627 14.1352 2.40554 13.5945C1.86482 13.0537 1.86482 12.177 2.40554 11.6363L6.04186 8L2.40554 4.36369C1.86482 3.82296 1.86482 2.94627 2.40554 2.40554Z",fill:"#BBC0C5"})),dB=()=>cW("svg",{width:"273",height:"51",viewBox:"0 0 273 51",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cW("path",{d:"M240.882 25.9263C239.472 24.997 237.916 24.3361 236.443 23.5101C235.489 22.9731 234.473 22.4982 233.643 21.8167C232.233 20.6602 232.524 18.3885 233.996 17.3973C236.112 15.993 239.617 16.7777 239.99 19.6483C239.99 19.7102 240.052 19.7515 240.114 19.7515H243.308C243.391 19.7515 243.454 19.6896 243.433 19.607C243.267 17.6244 242.5 15.9723 241.089 14.9191C239.741 13.9072 238.206 13.3702 236.568 13.3702C228.127 13.3702 227.359 22.271 231.901 25.0796C232.42 25.41 236.879 27.6404 238.455 28.611C240.032 29.5816 240.529 31.3576 239.845 32.7619C239.223 34.0423 237.605 34.9303 235.987 34.8271C234.224 34.7238 232.855 33.7738 232.378 32.2869C232.295 32.0185 232.254 31.5022 232.254 31.275C232.254 31.2131 232.192 31.1511 232.129 31.1511H228.666C228.604 31.1511 228.541 31.2131 228.541 31.275C228.541 33.7738 229.164 35.1575 230.864 36.4172C232.461 37.615 234.203 38.1106 236.008 38.1106C240.737 38.1106 243.184 35.4466 243.682 32.6793C244.117 29.974 243.308 27.5371 240.882 25.9263Z",fill:"#24292E"}),cW("path",{d:"M90.4943 13.8246H88.9595H87.2795C87.2173 13.8246 87.1758 13.8659 87.1551 13.9072L84.3
6137 23.2416C84.2722 23.3655 84.1063 23.3655 84.0648 23.2416L81.2234 13.9072C81.2026 13.8452 81.1612 13.8246 81.0989 13.8246H79.419H77.8842H75.8102C75.748 13.8246 75.6857 13.8865 75.6857 13.9485V37.7802C75.6857 37.8422 75.748 37.9041 75.8102 37.9041H79.2738C79.336 37.9041 79.3982 37.8422 79.3982 37.7802V19.6689C79.3982 19.5244 79.6056 19.5037 79.6471 19.6276L82.5093 29.024L82.7167 29.6849C82.7374 29.7468 82.7789 29.7675 82.8411 29.7675H85.4959C85.5581 29.7675 85.5996 29.7262 85.6203 29.6849L85.8277 29.024L88.6899 19.6276C88.7313 19.4831 88.9387 19.5244 88.9387 19.6689V37.7802C88.9387 37.8422 89.001 37.9041 89.0632 37.9041H92.5268C92.589 37.9041 92.6513 37.8422 92.6513 37.7802V13.9485C92.6513 13.8865 92.589 13.8246 92.5268 13.8246H90.4943Z",fill:"#24292E"}),cW("path",{d:"M187.849 13.8246C187.787 13.8246 187.745 13.8659 187.725 13.9072L184.883 23.2416C184.842 23.3655 184.676 23.3655 184.634 23.2416L181.793 13.9072C181.772 13.8452 181.731 13.8246 181.668 13.8246H176.4C176.338 13.8246 176.276 13.8865 176.276 13.9485V37.7802C176.276 37.8422 176.338 37.9041 176.4 37.9041H179.864C179.926 37.9041 179.988 37.8422 179.988 37.7802V19.6689C179.988 19.5244 180.196 19.5037 180.237 19.6276L183.099 29.024L183.307 29.6849C183.328 29.7468 183.369 29.7675 183.431 29.7675H186.086C186.148 29.7675 186.19 29.7262 186.211 29.6849L186.418 29.024L189.28 19.6276C189.322 19.4831 189.529 19.5244 189.529 19.6689V37.7802C189.529 37.8422 189.591 37.9041 189.653 37.9041H193.117C193.179 37.9041 193.241 37.8422 193.241 37.7802V13.9485C193.241 13.8865 193.179 13.8246 193.117 13.8246H187.849Z",fill:"#24292E"}),cW("path",{d:"M143.174 13.8246H136.724H133.261H126.81C126.748 13.8246 126.686 13.8865 126.686 13.9485V16.9223C126.686 16.9843 126.748 17.0462 126.81 17.0462H133.136V37.7802C133.136 37.8422 133.198 37.9041 133.261 37.9041H136.724C136.786 37.9041 136.849 37.8422 136.849 37.7802V17.0462H143.174C143.237 17.0462 143.299 16.9843 143.299 16.9223V13.9485C143.299 13.8865 143.257 13.8246 143.174 13.8246Z",fill:"#24292E"}),cW("path",{d:"M163.604 37.9041H166.756C166.839 37.9041 166.901 37.8215 166.881 37.7389L160.368 13.8245C160.347 13.7626 160.306 13.7419 160.244 13.7419H159.041H156.925H155.722C155.66 13.7419 155.619 13.7832 155.598 13.8245L149.085 37.7389C149.065 37.8215 149.127 37.9041 149.21 37.9041H152.362C152.425 37.9041 152.466 37.8628 152.487 37.8215L154.374 30.862C154.395 30.8 154.436 30.7794 154.499 30.7794H161.467C161.53 30.7794 161.571 30.8207 161.592 30.862L163.479 37.8215C163.5 37.8628 163.562 37.9041 163.604 37.9041ZM155.328 27.3719L157.859 18.0581C157.9 17.9342 158.066 17.9342 158.107 18.0581L160.638 27.3719C160.659 27.4545 160.596 27.5371 160.513 27.5371H155.453C155.37 27.5371 155.308 27.4545 155.328 27.3719Z",fill:"#24292E"}),cW("path",{d:"M217.362 37.9041H220.515C220.598 37.9041 220.66 37.8215 220.639 37.7389L214.127 13.8245C214.106 13.7626 214.065 13.7419 214.002 13.7419H212.8H210.684H209.481C209.419 13.7419 209.377 13.7832 209.357 13.8245L202.844 37.7389C202.823 37.8215 202.886 37.9041 202.969 37.9041H206.121C206.183 37.9041 206.225 37.8628 206.246 37.8215L208.133 30.862C208.154 30.8 208.195 30.7794 208.257 30.7794H215.226C215.288 30.7794 215.33 30.8207 215.351 30.862L217.238 37.8215C217.259 37.8628 217.3 37.9041 217.362 37.9041ZM209.087 27.3719L211.617 18.0581C211.659 17.9342 211.825 17.9342 211.866 18.0581L214.397 27.3719C214.417 27.4545 214.355 27.5371 214.272 27.5371H209.211C209.129 27.5371 209.066 27.4545 209.087 27.3719Z",fill:"#24292E"}),cW("path",{d:"M106.713 34.3727V26.9795C106.713 26.9176 106.775 26.8556 106.837 26.8556H116.067C116.129 26.8556 116.191 26.7936 116.191 26.7317V23.7579C116.191 23.6959 116.129 23.634 116.067 23.634H106.837C106.775 23.634 106.713 23.572 106.713 23.5101V17.1907C106.713 17.1288 106.775 17.0668 106.837 17.0668H117.332C117.394 17.0668 117.457 17.0049 117.457 16.9429V13.9691C117.457 13.9072 117.394 13.8452 117.332 13.8452H106.713H103.125C103.063 13.8452 103.001 13.9072 103.001 13.9691V17.0668V23.6546V26.8763V34.5173V37.7802C103.001 37.8422 103.063 37.9041 103.125 37.9041H106.713H117.768C117.83 37.9041 117.892 37.8422 117.892 37.7802V34.6412C117.892 34.5792 117.83 34.5173 117.768 34.5173H106.817C106.755 34.4966 106.713 34.4553 106.713 34.3727Z",fill:"#24292E"}),cW("path",{d:"M272.532 37.6976L260.544 25.3687C260.502 25.3274 260.502 25.2448 260.544 25.2035L271.329 14.0517C271.412 13.9691 271.349 13.8452 271.246 13.8452H266.828C266.787 13.8452 266.766 13.8659 266.745 13.8865L257.599 23.3449C257.516 23.4275 257.391 23.3655 257.391 23.2623V13.9691C257.391 13.9072 257.329 13.8452 257.267 13.8452H253.803C253.741 13.8452 253.679 13.9072 253.679 13.9691V37.8009C253.679 37.8628 253.741 37.9248 253.803 37.9248H257.267C257.329 37.9248 257.391 37.8628 257.391 37.8009V27.3099C257.391 27.2067 257.536 27.1447 257.599 27.2273L267.969 37.8835C267.989 37.9041 268.031 37.9248 268.052 37.9248H272.469C272.552 37.9041 272.615 37.7596 272.532 37.6976Z",fill:"#24292E"}
6),cW("path",{d:"M52.021 1L31.0526 16.4886L34.9517 7.36063L52.021 1Z",fill:"#E17726",stroke:"#E17726","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M3.65491 1L24.4366 16.6331L20.7241 7.36063L3.65491 1Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M44.4716 36.9127L38.8925 45.4211L50.8389 48.7047L54.261 37.0986L44.4716 36.9127Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M1.43555 37.0986L4.83695 48.7047L16.7626 45.4211L11.2042 36.9127L1.43555 37.0986Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M16.1197 22.5395L12.8013 27.5371L24.6232 28.074L24.2292 15.3734L16.1197 22.5395Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M39.5561 22.5394L31.3222 15.2288L31.0526 28.0739L42.8746 27.537L39.5561 22.5394Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M16.7626 45.4212L23.918 41.9724L17.7582 37.1813L16.7626 45.4212Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M31.7578 41.9724L38.8925 45.4212L37.9177 37.1813L31.7578 41.9724Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M38.8923 45.4212L31.7577 41.9724L32.3384 46.5983L32.2762 48.5602L38.8923 45.4212Z",fill:"#D5BFB2",stroke:"#D5BFB2","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M16.7625 45.4212L23.3994 48.5602L23.3579 46.5983L23.9179 41.9724L16.7625 45.4212Z",fill:"#D5BFB2",stroke:"#D5BFB2","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M23.5239 34.1249L17.5922 32.3902L21.7818 30.4696L23.5239 34.1249Z",fill:"#233447",stroke:"#233447","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M32.1517 34.1249L33.8939 30.4696L38.1042 32.3902L32.1517 34.1249Z",fill:"#233447",stroke:"#233447","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M16.7626 45.4212L17.7996 36.9128L11.2042 37.0987L16.7626 45.4212Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M37.8761 36.9128L38.8924 45.4212L44.4715 37.0987L37.8761 36.9128Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M42.8745 27.5371L31.0526 28.074L32.1518 34.1249L33.894 30.4696L38.1042 32.3902L42.8745 27.5371Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M17.5922 32.3902L21.7817 30.4696L23.5239 34.1249L24.6232 28.074L12.8012 27.5371L17.5922 32.3902Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M12.8013 27.5371L17.7582 37.1813L17.5923 32.3902L12.8013 27.5371Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M38.1044 32.3902L37.9177 37.1813L42.8746 27.5371L38.1044 32.3902Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M24.6232 28.0741L23.524 34.125L24.9136 41.2703L25.2247 31.8533L24.6232 28.0741Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M31.0526 28.0741L30.4719 31.8327L30.7623 41.2703L32.1519 34.125L31.0526 28.0741Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M32.1519 34.1249L30.7623 41.2702L31.7578 41.9724L37.9177 37.1813L38.1043 32.3901L32.1519 34.1249Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M17.5922 32.3901L17.7581 37.1813L23.918 41.9724L24.9135 41.2702L23.5239 34.1249L17.5922 32.3901Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M32.2763 48.5602L32.3385 46.5983L31.7993 46.1439H23.8765L23.358 46.5983L23.3995 48.5602L16.7626 45.4211L19.0855 47.3211L23.7935 50.5633H31.8615L36.5903 47.3211L38.8924 45.4211L32.2763 48.5602Z",fill:"#C0AC9D",stroke:"#C0AC9D","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M31.7578 41.9724L30.7622 41.2703H24.9135L23.918 41.9724L23.358 46.5983L23.8765 46.144H31.7993L32.3385 46.5983L31.7578 41.9724Z",fill:"#24292E",stroke:"#24292E","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M52.9128 17.5005L54.6757 8.95079L52.021 1L31.7578 15.9723L39.5561 22.5394L50.5692 25.7404L52.9958 22.9111L51.938 22.147L53.618 20.6188L52.3321 19.6276L54.0121 18.3472L52.9128 17.5005Z",fill:"#763E1A",stroke:"#763E1A","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M1 8.95079L2.78366 17.5005L1.64295 18.3472L3.34365 19.6276L2.05775 20.6188L3.73771 22.147L2.67996 22.9111L5.10657 25.7404L16.1196 22.5394L23.918 15.9723L3.65475 1L1 8.95079Z",fill:"#763E1A",stroke:"#763E1A","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M50.5692 25.7404L39.5561 22.5394L42.8746 27.5371L37.9177 37.
61813L44.4716 37.0987H54.261L50.5692 25.7404Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M16.1196 22.5394L5.10651 25.7404L1.43549 37.0987H11.2041L17.7581 37.1813L12.8011 27.5371L16.1196 22.5394Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M31.0526 28.0741L31.7578 15.9724L34.9518 7.36072H20.7239L23.9179 15.9724L24.6231 28.0741L24.8927 31.8739L24.9135 41.2703H30.7622L30.783 31.8739L31.0526 28.0741Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}));function dK(e,t){return e.toString(2).padStart(t,"0")}function dj(e,t){let n=e%t;return n>=0?n:t+n}function dU(e,t){return Array(e).fill(t)}function dH(...e){let t=0;for(let n of e)t=Math.max(t,n.length);let n=[];for(let r=0;r<t;r++)for(let t of e)r>=t.length||n.push(t[r]);return new Uint8Array(n)}function dF(e,t,n){if(n<0||n+t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[n+r])return!1;return!0}function dz(e){return{has:t=>e.includes(t),decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw Error("alphabet.decode input should be array of strings");return t.map(t=>{if("string"!=typeof t)throw Error(`alphabet.decode: not string element=${t}`);let n=e.indexOf(t);if(-1===n)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return n})},encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw Error("alphabet.encode input should be an array of numbers");return t.map(t=>{if(function(e){if(!Number.isSafeInteger(e))throw Error(`Wrong integer: ${e}`)}(t),t<0||t>=e.length)throw Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]})}}}class dq{static size(e,t){if("number"==typeof e&&(e={height:e,width:e}),!Number.isSafeInteger(e.height)&&e.height!==1/0)throw Error(`Bitmap: wrong height=${e.height} (${typeof e.height})`);if(!Number.isSafeInteger(e.width)&&e.width!==1/0)throw Error(`Bitmap: wrong width=${e.width} (${typeof e.width})`);return void 0!==t&&(e={width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}),e}static fromString(e){let t,n=(e=e.replace(/^\n+/g,"").replace(/\n+$/g,"")).split("\n"),r=n.length,i=Array(r);for(let e of n){let n=e.split("").map(e=>{if("X"===e)return!0;if(" "===e)return!1;if("?"!==e)throw Error(`Bitmap.fromString: unknown symbol=${e}`)});if(t&&n.length!==t)throw Error(`Bitmap.fromString different row sizes: width=${t} cur=${n.length}`);t=n.length,i.push(n)}return t||(t=0),new dq({height:r,width:t},i)}constructor(e,t){let{height:n,width:r}=dq.size(e);this.data=t||Array.from({length:n},()=>dU(r,void 0)),this.height=n,this.width=r}point(e){return this.data[e.y][e.x]}isInside(e){return 0<=e.x&&e.x<this.width&&0<=e.y&&e.y<this.height}size(e){if(!e)return{height:this.height,width:this.width};let{x:t,y:n}=this.xy(e);return{height:this.height-n,width:this.width-t}}xy(e){if("number"==typeof e&&(e={x:e,y:e}),!Number.isSafeInteger(e.x))throw Error(`Bitmap: wrong x=${e.x}`);if(!Number.isSafeInteger(e.y))throw Error(`Bitmap: wrong y=${e.y}`);return e.x=dj(e.x,this.width),e.y=dj(e.y,this.height),e}rect(e,t,n){let{x:r,y:i}=this.xy(e),{height:o,width:a}=dq.size(t,this.size({x:r,y:i}));for(let e=0;e<o;e++)for(let t=0;t<a;t++)this.data[i+e][r+t]="function"==typeof n?n({x:t,y:e},this.data[i+e][r+t]):n;return this}rectRead(e,t,n){return this.rect(e,t,(e,t)=>(n(e,t),t))}hLine(e,t,n){return this.rect(e,{width:t,height:1},n)}vLine(e,t,n){return this.rect(e,{width:1,height:t},n)}border(e=2,t){let n=this.height+2*e,r=this.width+2*e,i=dU(e,t),o=Array.from({length:e},()=>dU(r,t));return new dq({height:n,width:r},[...o,...this.data.map(e=>[...i,...e,...i]),...o])}embed(e,t){return this.rect(e,t.size(),({x:e,y:n})=>t.data[n][e])}rectSlice(e,t=this.size()){let n=new dq(dq.size(t,this.size(this.xy(e))));return this.rect(e,t,({x:e,y:t},r)=>n.data[t][e]=r),n}inverse(){let{height:e,width:t}=this;return new dq({height:t,width:e}).rect({x:0,y:0},1/0,({x:e,y:t})=>this.data[e][t])}scale(e){if(!Number.isSafeInteger(e)||e>1024)throw Error(`Wrong scale factor: ${e}`);let{height:t,width:n}=this;return new dq({height:e*t,width:e*n}).rect({x:0,y:0},1/0,({x:t,y:n})=>this.data[Math.floor(n/e)][Math.floor(t/e)])}clone(){return new dq(this.size()).rect({x:0,y:0},this.size(),({x:e,y:t})=>this.data[t][e])}
6assertDrawn(){this.rectRead(0,1/0,(e,t)=>{if("boolean"!=typeof t)throw Error("Invalid color type="+typeof t)})}toString(){return this.data.map(e=>e.map(e=>void 0===e?"?":e?"X":" ").join("")).join("\n")}toASCII(){let{height:e,width:t,data:n}=this,r="";for(let i=0;i<e;i+=2){for(let o=0;o<t;o++){let t=n[i][o],a=i+1>=e||n[i+1][o];t||a?!t&&a?r+="▀":t&&!a?r+="▄":t&&a&&(r+=" "):r+="█"}r+="\n"}return r}toTerm(){let e="\x1b[0m",t=`�[1;47m  ${e}`,n=`�[40m  ${e}`;return this.data.map(e=>e.map(e=>e?n:t).join("")).join("\n")}toSVG(){let e=`<svg xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 ${this.width} ${this.height}" version="1.1" xmlns="http://www.w3.org/2000/svg">`;return this.rectRead(0,1/0,({x:t,y:n},r)=>{r&&(e+=`<rect x="${t}" y="${n}" width="1" height="1" />`)}),e+="</svg>"}toGIF(){let e=e=>[255&e,e>>>8&255],t=[...e(this.width),...e(this.height)],n=[];this.rectRead(0,1/0,(e,t)=>n.push(+(!0===t)));let r=[71,73,70,56,55,97,...t,246,0,0,255,255,255,...dU(381,0),44,0,0,0,0,...t,0,7],i=Math.floor(n.length/126);for(let e=0;e<i;e++)r.push(127,128,...n.slice(126*e,126*(e+1)).map(e=>+e));return r.push(n.length%126+1,128,...n.slice(126*i).map(e=>+e)),r.push(1,129,0,59),new Uint8Array(r)}toImage(e=!1){let{height:t,width:n}=this.size(),r=new Uint8Array(t*n*(e?3:4)),i=0;for(let o=0;o<t;o++)for(let t=0;t<n;t++){let n=255*!this.data[o][t];r[i++]=n,r[i++]=n,r[i++]=n,e||(r[i++]=255)}return{height:t,width:n,data:r}}}let dW=["low","medium","quartile","high"],dV=["numeric","alphanumeric","byte","kanji","eci"],dG=[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],dZ={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},dY={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},dJ={size:{encode:e=>21+4*(e-1),decode:e=>(e-17)/4},sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(1===e)return[];let t=dJ.size.encode(e)-6-1,n=t-6,r=Math.ceil(n/28),i=Math.floor(n/r);i%2?i+=1:n%r*2>=r&&(i+=2);let o=[6];for(let e=1;e<r;e++)o.push(t-(r-e)*i);return o.push(t),o},ECCode:{low:1,medium:0,quartile:3,high:2},formatMask:21522,formatBits(e,t){let n=dJ.ECCode[e]<<3|t,r=n;for(let e=0;e<10;e++)r=r<<1^1335*(r>>9);return(n<<10|r)^dJ.formatMask},versionBits(e){let t=e;for(let e=0;e<12;e++)t=t<<1^7973*(t>>11);return e<<12|t},alphabet:{numeric:dz("0123456789"),alphanumerc:dz("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")},lengthBits:(e,t)=>({numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]})[t][dJ.sizeType(e)],modeBits:{numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"},capacity(e,t){let n=dG[e-1],r=dZ[t][e-1],i=dY[t][e-1],o=Math.floor(n/i)-r,a=i-n%i;return{words:r,numBlocks:i,shortBlocks:a,blockLen:o,capacity:8*(n-r*i),total:(r+o)*i+i-a}}},dX=[(e,t)=>(e+t)%2==0,(e,t)=>t%2==0,(e,t)=>e%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0],dQ={tables:(e=>{let t=dU(256,0),n=dU(256,0);for(let e=0,r=1;e<256;e++)t[e]=r,n[r]=e,256&(r<<=1)&&(r^=285);return{exp:t,log:n}})(),exp:e=>dQ.tables.exp[e],log(e){if(0===e)throw Error(`GF.log: wrong arg=${e}`);return dQ.tables.log[e]%255},mul:(e,t)=>
60===e||0===t?0:dQ.tables.exp[(dQ.tables.log[e]+dQ.tables.log[t])%255],add:(e,t)=>e^t,pow:(e,t)=>dQ.tables.exp[dQ.tables.log[e]*t%255],inv(e){if(0===e)throw Error(`GF.inverse: wrong arg=${e}`);return dQ.tables.exp[255-dQ.tables.log[e]]},polynomial(e){if(0==e.length)throw Error("GF.polymomial: wrong length");if(0!==e[0])return e;let t=0;for(;t<e.length-1&&0==e[t];t++);return e.slice(t)},monomial(e,t){if(e<0)throw Error(`GF.monomial: wrong degree=${e}`);if(0==t)return[0];let n=dU(e+1,0);return n[0]=t,dQ.polynomial(n)},degree:e=>e.length-1,coefficient:(e,t)=>e[dQ.degree(e)-t],mulPoly(e,t){if(0===e[0]||0===t[0])return[0];let n=dU(e.length+t.length-1,0);for(let r=0;r<e.length;r++)for(let i=0;i<t.length;i++)n[r+i]=dQ.add(n[r+i],dQ.mul(e[r],t[i]));return dQ.polynomial(n)},mulPolyScalar(e,t){if(0==t)return[0];if(1==t)return e;let n=dU(e.length,0);for(let r=0;r<e.length;r++)n[r]=dQ.mul(e[r],t);return dQ.polynomial(n)},mulPolyMonomial(e,t,n){if(t<0)throw Error("GF.mulPolyMonomial: wrong degree");if(0==n)return[0];let r=dU(e.length+t,0);for(let t=0;t<e.length;t++)r[t]=dQ.mul(e[t],n);return dQ.polynomial(r)},addPoly(e,t){if(0===e[0])return t;if(0===t[0])return e;let n=e,r=t;n.length>r.length&&([n,r]=[r,n]);let i=dU(r.length,0),o=r.length-n.length,a=r.slice(0,o);for(let e=0;e<a.length;e++)i[e]=a[e];for(let e=o;e<r.length;e++)i[e]=dQ.add(n[e-o],r[e]);return dQ.polynomial(i)},remainderPoly(e,t){let n=Array.from(e);for(let r=0;r<e.length-t.length+1;r++){let e=n[r];if(0!==e)for(let i=1;i<t.length;i++)0!==t[i]&&(n[r+i]=dQ.add(n[r+i],dQ.mul(t[i],e)))}return n.slice(e.length-t.length+1,n.length)},divisorPoly(e){let t=[1];for(let n=0;n<e;n++)t=dQ.mulPoly(t,[1,dQ.pow(2,n)]);return t},evalPoly(e,t){if(0==t)return dQ.coefficient(e,0);let n=e[0];for(let r=1;r<e.length;r++)n=dQ.add(dQ.mul(t,n),e[r]);return n},euclidian(e,t,n){dQ.degree(e)<dQ.degree(t)&&([e,t]=[t,e]);let r=e,i=t,o=[0],a=[1];for(;2*dQ.degree(i)>=n;){let e=r,t=o;if(r=i,o=a,0===r[0])throw Error("rLast[0] === 0");i=e;let n=[0],s=dQ.inv(r[0]);for(;dQ.degree(i)>=dQ.degree(r)&&0!==i[0];){let e=dQ.degree(i)-dQ.degree(r),t=dQ.mul(i[0],s);n=dQ.addPoly(n,dQ.monomial(e,t)),i=dQ.addPoly(i,dQ.mulPolyMonomial(r,e,t))}if(n=dQ.mulPoly(n,o),a=dQ.addPoly(n,t),dQ.degree(i)>=dQ.degree(r))throw Error(`Division failed r: ${i}, rLast: ${r}`)}let s=dQ.coefficient(a,0);if(0==s)throw Error("sigmaTilde(0) was zero");let l=dQ.inv(s);return[dQ.mulPolyScalar(a,l),dQ.mulPolyScalar(i,l)]}};function d0(e,t,n,r){let i="",o=n.length;if("numeric"===r){let e=dJ.alphabet.numeric.decode(n.split("")),t=e.length;for(let n=0;n<t-2;n+=3)i+=dK(100*e[n]+10*e[n+1]+e[n+2],10);t%3==1?i+=dK(e[t-1],4):t%3==2&&(i+=dK(10*e[t-2]+e[t-1],7))}else if("alphanumeric"===r){let e=dJ.alphabet.alphanumerc.decode(n.split("")),t=e.length;for(let n=0;n<t-1;n+=2)i+=dK(45*e[n]+e[n+1],11);t%2==1&&(i+=dK(e[t-1],6))}else{if("byte"!==r)throw Error("encode: unsupported type");{let e=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(n);o=e.length,i=Array.from(e).map(e=>dK(e,8)).join("")}}let{capacity:a}=dJ.capacity(e,t),s=dK(o,dJ.lengthBits(e,r)),l=dJ.modeBits[r]+s+i;if(l.length>a)throw Error("Capacity overflow");(l+="0".repeat(Math.min(4,Math.max(0,a-l.length)))).length%8&&(l+="0".repeat(8-l.length%8));for(let e=0;l.length!==a;e++)l+="1110110000010001"[e%16];let c=Uint8Array.from(l.match(/(.{8})/g).map(e=>Number(`0b${e}`)));return(function(e,t){let{words:n,shortBlocks:r,numBlocks:i,blockLen:o,total:a}=dJ.capacity(e,t),s={encode(e){let t=dQ.divisorPoly(n),r=Array.from(e);return r.push(...t.slice(0,-1).fill(0)),Uint8Array.from(dQ.remainderPoly(r,t))},decode(e){let t=e.slice(),r=dQ.polynomial(Array.from(e)),i=dU(n,0),o=!1;for(let e=0;e<n;e++){let t=dQ.evalPoly(r,dQ.exp(e));i[i.length-1-e]=t,0!==t&&(o=!0)}if(!o)return t;i=dQ.polynomial(i);let a=dQ.monomial(n,1),[s,l]=dQ.euclidian(a,i,n),c=dU(dQ.degree(s),0),d=0;for(let e=1;e<256&&d<c.length;e++)0===dQ.evalPoly(s,e)&&(c[d++]=dQ.inv(e));if(d!==c.length)throw Error("RS.decode: wrong errors number");for(let e=0;e<c.length;e++){let n=t.length-1-dQ.log(c[e]);if(n<0)throw Error("RS.decode: wrong error location");let r=dQ.inv(c[e]),i=1;for(let t=0;t<c.length;t++)e!==t&&(i=dQ.mul(i,dQ.add(1,dQ.mul(c[t],r))));t[n]=dQ.add(t[n],dQ.mul(dQ.evalPoly(l,r),dQ.inv(i)))}return t}};return{encode(e){let t=[],n=[];for(let a=0;a<i;a++){let i=o+(a<r?0:1);t.push(e.subarray(0,i)),n.push(s.encode(e.subarray(0,i))),e=e.subarray(i)}let a=dH(...t),l=dH(...n),c=new Uint8Array(a.length+l.length);return c.set(a),c.set(l,a.length),c},decode(e){if(e.length!==a)throw Error(`interleave.decode: len(data)=${e.length}, total=${a}`);let t=[];for(let e=0;e<i;e++){let i=e<r;t.push(new Uint8Array(n+o+ +!i))}let l=0;for(let n=0;n<o;n++)for(let r=0;r<i;r++)t[r][n]=e[l++];for(let n=r;n<i;n++)t[n][o]=e[l++];for(let a=o;a<o+n;a++)for(let n=0;n<i;n++){let i=n<r;t[n][a+ +!i]=e[l++]}let c=[];for(let e of t)c.push(...Array.from(s.decode(e)).slice(0,-n));return Uint8Array.from(c)}}})(e,t).encode(c)}function d1(e,t,n,r,i=!1){let o=function(e,t,n,r=!1){let i=dJ.size.encode(e),o=new dq(i+2),a=new dq(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);o=(o=o.embed(0,a).embed({x:-a.width,y:0},a).embed({x:0,y:-a.height},a)).rectSlice(1,i);let s=new dq(1).rect(0,1,!0).border(1,!1).border(1,!0),l=dJ.alignmentPatterns(e);for(let e of l)for(let t of l)void 0===o.data[e][t]&&o.embed({x:t-2,y:e-2},s);o=o.hLine({x:0,y:6},1/0,({x:e},t)=>void 0===t?e%2==0:t).vLine({x:6,y:0},1/0,({y:e},t)=>void 0===t?e%2==0:t);
6{let e=dJ.formatBits(t,n),a=t=>!r&&1==(e>>t&1);for(let e=0;e<6;e++)o.data[e][8]=a(e);for(let e=6;e<8;e++)o.data[e+1][8]=a(e);for(let e=8;e<15;e++)o.data[i-15+e][8]=a(e);for(let e=0;e<8;e++)o.data[8][i-e-1]=a(e);for(let e=8;e<9;e++)o.data[8][15-e-1+1]=a(e);for(let e=9;e<15;e++)o.data[8][15-e-1]=a(e);o.data[i-8][8]=!r}if(e>=7){let t=dJ.versionBits(e);for(let e=0;e<18;e+=1){let n=!r&&1==(t>>e&1),a=Math.floor(e/3),s=e%3+i-8-3;o.data[a][s]=n,o.data[s][a]=n}}return o}(e,t,r,i),a=0,s=8*n.length;if(function(e,t,n){let r=e.height,i=dX[t],o=-1,a=r-1;for(let t=r-1;t>0;t-=2){for(6==t&&(t=5);;a+=o){for(let r=0;r<2;r+=1){let o=t-r;void 0===e.data[a][o]&&n(o,a,i(o,a))}if(a+o<0||a+o>=r)break}o=-o}}(o,r,(e,t,r)=>{let i=!1;a<s&&(i=0!=(n[a>>>3]>>(7-a&7)&1),a++),o.data[t][e]=i!==r}),a!==s)throw Error("QR: bytes left after draw");return o}function d2(e,t="raw",n={}){let r=void 0!==n.ecc?n.ecc:"medium";if(!dW.includes(r))throw Error(`Invalid error correction mode=${r}. Expected: ${dW}`);let i=void 0!==n.encoding?n.encoding:function(e){let t="numeric";for(let n of e)if(!dJ.alphabet.numeric.has(n)&&(t="alphanumeric",!dJ.alphabet.alphanumerc.has(n)))return"byte";return t}(e);!function(e){if(!dV.includes(e))throw Error(`Encoding: invalid mode=${e}. Expected: ${dV}`);if("kanji"===e||"eci"===e)throw Error(`Encoding: ${e} is not supported (yet?).`)}(i),void 0!==n.mask&&function(e){if(![0,1,2,3,4,5,6,7].includes(e)||!dX[e])throw Error(`Invalid mask=${e}. Expected number [0..7]`)}(n.mask);let o,a=n.version,s=Error("Unknown error");if(void 0!==a)!function(e){if(!Number.isSafeInteger(e)||e<1||e>40)throw Error(`Invalid version=${e}. Expected number [1..40]`)}(a),o=d0(a,r,e,i);else for(let t=1;t<=40;t++)try{o=d0(t,r,e,i),a=t;break}catch(e){s=e}if(!a||!o)throw s;let l=function(e,t,n,r){if(void 0===r){let i,o,a=(o=1/0,{add(e,t){e>=o||(i=t,o=e)},get:()=>i,score:()=>o});for(let r=0;r<dX.length;r++)a.add(function(e){let t=e.inverse(),n=e=>{let t=0;for(let n,r=0,i=1;r<e.length;r++)n===e[r]&&(i++,r!==e.length-1)||(i>=5&&(t+=i-5+3),n=e[r],i=1);return t},r=0;e.data.forEach(e=>r+=n(e)),t.data.forEach(e=>r+=n(e));let i=0,o=e.data,a=e.width-1,s=e.height-1;for(let e=0;e<a;e++)for(let t=0;t<s;t++){let n=e+1,r=t+1;o[e][t]===o[n][t]&&o[n][t]===o[e][r]&&o[n][t]===o[n][r]&&(i+=3)}let l=e=>{let t=[!0,!1,!0,!0,!0,!1,!0],n=[!1,!1,!1,!1],r=[...t,...n],i=[...n,...t],o=0;for(let t=0;t<e.length;t++)dF(e,r,t)&&(o+=40),dF(e,i,t)&&(o+=40);return o},c=0;for(let t of e.data)c+=l(t);for(let e of t.data)c+=l(e);let d=0;e.rectRead(0,1/0,(e,t)=>d+=+!!t);let u=10*Math.floor(Math.abs(d/(e.height*e.width)*100-50)/5);return r+i+c+u}(d1(e,t,n,r,!0)),r);r=a.get()}if(void 0===r)throw Error("Cannot find mask");return d1(e,t,n,r)}(a,r,o,n.mask);l.assertDrawn();let c=void 0===n.border?2:n.border;if(!Number.isSafeInteger(c))throw Error("Wrong border type="+typeof c);if(l=l.border(c,!1),void 0!==n.scale&&(l=l.scale(n.scale)),"raw"===t)return l.data;if("ascii"===t)return l.toASCII();if("svg"===t)return l.toSVG();if("gif"===t)return l.toGIF();if("term"===t)return l.toTerm();throw Error(`Unknown output: ${t}`)}let d3={DESKTOP:"Desktop",MOBILE:"Mobile",META_MASK_MOBILE_APP:"MetaMask mobile app",SCAN_TO_CONNECT:"Scan to connect and sign with",CONNECT_WITH_EXTENSION:"Connect With MetaMask Extension",INSTALL_MODAL:{TRUSTED_BY_USERS:"Trusted by over 30 million users to buy, store, send and swap crypto securely",LEADING_CRYPTO_WALLET:"The leading crypto wallet & gateway to blockchain apps built on Ethereum Mainnet, Polygon, Optimism, and many other networks",CONTROL_DIGITAL_INTERACTIONS:"Puts you in control of your digital interactions by making power of cryptography more accessible",INSTALL_META_MASK_EXTENSION:"Install MetaMask Extension"},PENDING_MODAL:{OPEN_META_MASK_SELECT_CODE:"Please open the MetaMask wallet app and select the code on the screen OR disconnect",OPEN_META_MASK_CONTINUE:"Open the MetaMask app to continue with your session.",NUMBER_AFTER_OPEN_NOTICE:"If a number doesn't appear after opening MetaMask, please click disconnect and re-scan the QRCode.",DISCONNECT:"Disconnect"},SELECT_MODAL:{CRYPTO_TAKE_CONTROL_TEXT:"Take control of your crypto and explore the blockchain with the wallet trusted by over 30 million people worldwide"},META_MASK_MODAL:{ADDRESS_COPIED:"Address copied to clipboard!",DISCONNECT:"Disconnect",ACTIVE_NETWORK:"Active Network"}};class d5{constructor(e){var t;this.translations=d3,this.supportedLocales=["es","fr","he","it","pt","tr"],this.baseUrl=null!==(t=null==e?void 0:e.baseUrl)&&void 0!==t?t:"https://raw.githubusercontent.com/MetaMask/metamask-sdk/refs/heads/gh-pages/locales"}getBrowserLanguage(){if((navigator.languages||[navigator.language]).some(e=>e.toLowerCase().startsWith("en")))return"en";let e=navigator.language.toLowerCase().split("-")[0];return this.supportedLocales.includes(e)?e:"en"}async init(e){let t=this.getBrowserLanguage()||e.fallbackLng;await this.loadTranslations(t)}async loadTranslations(e){let t=e.split("-")[0];if("en"!==t&&this.supportedLocales.includes(t))try{let e=`${this.baseUrl}/${t}.json`,n=await fetch(e);if(!n.ok)throw Error(`HTTP error! status: ${n.status}`);this.translations=await n.json()}catch(e){console.warn(`❌ Failed to load ${t} translations, falling back to English:`,e),this.translations=d3}else this.translations=d3}t(e){return this.getNestedTranslation(e,this.translations)||e}getNestedTranslation(e,t){let n=e.split("."),r=t;for(let e of n){if("object"!=typeof r)return"";r=r[e]}return"string"==typeof r?r:""}}!function(e){e.SDK_MODAL_VIEWED="sdk_modal_viewed",e.SDK_MODAL_BUTTON_CLICKED="sdk_modal_button_clicked",e.SDK_MODAL_TOGGLE_CHANGED="sdk_modal_toggle_changed"}(r||(r={}));let d8=class{constructor(e){cy(this,e),this.close=cQ(this,"close",7),this.startDesktopOnboarding=cQ(this,"startDesktopOnboarding",7),this.trackAnalytics=cQ(this,"trackA
6nalytics",7),this.link=void 0,this.sdkVersion=void 0,this.preferDesktop=void 0,this.tab=1,this.isDefaultTab=!0,this.translationsLoaded=!1,this.onClose=this.onClose.bind(this),this.onStartDesktopOnboardingHandler=this.onStartDesktopOnboardingHandler.bind(this),this.setTab=this.setTab.bind(this),this.render=this.render.bind(this),this.setTab(this.preferDesktop?1:2),this.i18nInstance=new d5}componentDidLoad(){this.trackAnalytics.emit({event:r.SDK_MODAL_VIEWED,params:{extensionInstalled:!1,tab:1===this.tab?"desktop":"mobile"}})}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}updatePreferDesktop(e){e?this.setTab(1):this.setTab(2)}onClose(e=!1){this.close.emit({shouldTerminate:e})}onStartDesktopOnboardingHandler(){this.trackAnalytics.emit({event:r.SDK_MODAL_BUTTON_CLICKED,params:{button_type:"install_extension",tab:"desktop"}}),this.startDesktopOnboarding.emit()}setTab(e,t=!1){t&&this.trackAnalytics.emit({event:r.SDK_MODAL_TOGGLE_CHANGED,params:{toggle:1===this.tab?"desktop_to_mobile":"mobile_to_desktop"}}),this.tab=e,this.isDefaultTab=!1}render(){if(!this.translationsLoaded)return null;let e=e=>this.i18nInstance.t(e),t=this.isDefaultTab?this.preferDesktop?1:2:this.tab,n=d2(this.link,"svg",{ecc:"medium",scale:2});return cW(dR,{className:"install-model"},cW("div",{class:"backdrop",onClick:()=>this.onClose(!0)}),cW("div",{class:"modal"},cW("div",{class:"closeButtonContainer"},cW("div",{class:"right"},cW("span",{class:"closeButton",onClick:()=>this.onClose(!0)},cW(d$,null)))),cW("div",{class:"logoContainer"},cW(dB,null)),cW("div",null,cW("div",{class:"tabcontainer"},cW("div",{class:"flexContainer"},cW("div",{onClick:()=>this.setTab(1,!0),class:"tab flexItem "+(1===t?"tabactive":"")},e("DESKTOP")),cW("div",{onClick:()=>this.setTab(2,!0),class:"tab flexItem "+(2===t?"tabactive":"")},e("MOBILE")))),cW("div",{style:{display:1===t?"none":"block"}},cW("div",{class:"flexContainer"},cW("div",{class:"flexItem",style:{textAlign:"center",marginTop:"4"}},n&&cW("div",{id:"sdk-mm-qrcode",class:"center",innerHTML:n}),cW("div",{class:"connectMobileText"},e("SCAN_TO_CONNECT")," ",cW("br",null),cW("span",{class:"blue"},cW("b",null,e("META_MASK_MOBILE_APP"))))))),cW("div",{style:{display:2===t?"none":"block"}},cW("div",{class:"item"},cW(dL,{Icon:dO,text:e("INSTALL_MODAL.TRUSTED_BY_USERS")})),cW("div",{class:"item"},cW(dL,{Icon:dP,text:e("INSTALL_MODAL.LEADING_CRYPTO_WALLET")})),cW("div",{class:"item"},cW(dL,{Icon:dT,text:e("INSTALL_MODAL.CONTROL_DIGITAL_INTERACTIONS")})),cW("button",{class:"button",onClick:()=>this.onStartDesktopOnboardingHandler()},cW(dN,null),cW("span",{class:"installExtensionText"},e("INSTALL_MODAL.INSTALL_META_MASK_EXTENSION"))))),cW(dD,{version:this.sdkVersion})))}get el(){return cX(this)}static get watchers(){return{preferDesktop:["updatePreferDesktop"]}}};d8.style=
vendor: 3,083 bytes, line 6
6".flexContainer {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    flex-direction: row;\n}\n\n.flexItem {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem11 {\n    flex: 11;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem1 {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.tab {\n    padding: 8px;\n    cursor: pointer;\n    background-color: #F2F4F6;\n    font-size: 12px;\n    text-align: center;\n    color: #24292E;\n}\n\n.tabcontainer {\n    padding: 4px;\n    background-color: #F2F4F6;\n    border-radius: 8px;\n    margin-bottom: 30px;\n    margin-top: 30px;\n}\n\n.tabactive {\n    background-color: white;\n    -webkit-transition: background-color 300ms linear;\n    -ms-transition: background-color 300ms linear;\n    transition: background-color 300ms linear;\n    border-radius: 8px;\n}\n\n.item {\n    font-size: 12px;\n    margin-bottom: 16px;\n    border-radius: 8px;\n    padding: 10px;\n    border: 2px #F2F4F6 solid;\n    color: #24292E;\n}\n\n.extensionLabel {\n    font-style: normal;\n    font-weight: bold;\n    font-size: 14px;\n    text-align: cetner;\n    color: #24272A;\n}\n\n.notice {\n    font-size: 12px;\n    margin-left: 10px;\n    margin-right: 10px;\n    color: grey;\n}\n\n.button {\n    margin-top: 41.5px;\n    margin-bottom: 20px;\n    width: 100%;\n    display: flex;\n    flex-direction: row;\n    justify-content: center;\n    align-items: center;\n    padding: 12px 20px;\n    background: #037DD6;\n    border-radius: 32px;\n    color: white;\n    border: 0;\n    font-size: 14px;\n    cursor: pointer;\n}\n\n.backdrop {\n    visibility: visible;\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    width: 100%;\n    z-index: 99998;\n    background: rgba(0, 0, 0, 0.87);\n    opacity: 0.3;\n}\n\n.modal {\n    visibility: visible;\n    position: fixed;\n    left: 50%;\n    transform: translate(-50%, -50%);\n    z-index: 99999;\n    background: white;\n    padding: 20px;\n    border-radius: 8px;\n    top: 50%;\n    max-width: 100%;\n    width: 460px;\n    min-width: 300px;\n    box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;\n    -webkit-font-smoothing: antialiased;\n}\n\n.closeButton {\n    color: #BBC0C5;\n    cursor: pointer;\n}\n\n.logoContainer {\n    margin-left: 24px;\n    margin-right: 24px;\n    margin-top: 24px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.connectMobileText {\n    font-size: 14px;\n    color: black;\n    margin-top: 28px;\n    margin-bottom: 28px;\n    line-height: 2;\n}\n\n.blue {\n    color: #037DD6;\n    font-weight: 700;\n}\n\n.installExtensionText {\n    margin-left: 10px;\n}\n\n.center {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.right {\n    display: flex;\n    align-items: center;\n    justify-content: right;\n}\n\n#sdk-mm-qrcode {\n    svg {\n        width: 50%;\n    }\n}";
6let d4=class{constructor(e){cy(this,e),this.close=cQ(this,"close",7),this.disconnect=cQ(this,"disconnect",7),this.updateOTPValue=cQ(this,"updateOTPValue",7),this.displayOTP=void 0,this.sdkVersion=void 0,this.otpCode=void 0,this.translationsLoaded=!1,this.i18nInstance=new d5}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}onClose(){this.close.emit()}onDisconnect(){this.disconnect.emit()}onUpdateOTPValueHandler(e){this.updateOTPValue.emit({otpValue:e})}disconnectedCallback(){this.onClose()}render(){var e;if(!this.translationsLoaded)return null;let t=null===(e=this.displayOTP)||void 0===e||e,n=this.sdkVersion,r=e=>this.i18nInstance.t(e);return cW(dR,{className:"pending-modal"},cW("div",{class:"backdrop",onClick:()=>this.onClose()}),cW("div",{class:"modal"},cW("div",{class:"closeButtonContainer"},cW("div",{class:"right"},cW("span",{class:"closeButton",onClick:()=>this.onClose()},cW(d$,null)))),cW("div",{class:"logoContainer"},cW(dB,null)),cW("div",null,cW("div",{class:"flexContainer",style:{flexDirection:"column",color:"black"}},cW("div",{class:"flexItem",style:{textAlign:"center",marginTop:"30px",marginBottom:"30px",fontSize:"16px"}},r(t?"PENDING_MODAL.OPEN_META_MASK_SELECT_CODE":"PENDING_MODAL.OPEN_META_MASK_CONTINUE")),cW("div",{id:"sdk-mm-otp-value",style:{padding:"10px",fontSize:"32px",display:this.otpCode?"block":"none"}},this.otpCode),t&&cW("div",{class:"notice"},"* ",r("PENDING_MODAL.NUMBER_AFTER_OPEN_NOTICE"))),cW("div",{style:{marginTop:"20px"}},cW("button",{class:"button blue",style:{marginTop:"5px",color:"#0376C9",borderColor:"#0376C9",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white"},onClick:()=>this.onDisconnect()},r("PENDING_MODAL.DISCONNECT")))),cW(dD,{version:n})))}get el(){return cX(this)}};d4.style=
vendor: 3,083 bytes, line 6
6".flexContainer {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    flex-direction: row;\n}\n\n.flexItem {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem11 {\n    flex: 11;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem1 {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.tab {\n    padding: 8px;\n    cursor: pointer;\n    background-color: #F2F4F6;\n    font-size: 12px;\n    text-align: center;\n    color: #24292E;\n}\n\n.tabcontainer {\n    padding: 4px;\n    background-color: #F2F4F6;\n    border-radius: 8px;\n    margin-bottom: 30px;\n    margin-top: 30px;\n}\n\n.tabactive {\n    background-color: white;\n    -webkit-transition: background-color 300ms linear;\n    -ms-transition: background-color 300ms linear;\n    transition: background-color 300ms linear;\n    border-radius: 8px;\n}\n\n.item {\n    font-size: 12px;\n    margin-bottom: 16px;\n    border-radius: 8px;\n    padding: 10px;\n    border: 2px #F2F4F6 solid;\n    color: #24292E;\n}\n\n.extensionLabel {\n    font-style: normal;\n    font-weight: bold;\n    font-size: 14px;\n    text-align: cetner;\n    color: #24272A;\n}\n\n.notice {\n    font-size: 12px;\n    margin-left: 10px;\n    margin-right: 10px;\n    color: grey;\n}\n\n.button {\n    margin-top: 41.5px;\n    margin-bottom: 20px;\n    width: 100%;\n    display: flex;\n    flex-direction: row;\n    justify-content: center;\n    align-items: center;\n    padding: 12px 20px;\n    background: #037DD6;\n    border-radius: 32px;\n    color: white;\n    border: 0;\n    font-size: 14px;\n    cursor: pointer;\n}\n\n.backdrop {\n    visibility: visible;\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    width: 100%;\n    z-index: 99998;\n    background: rgba(0, 0, 0, 0.87);\n    opacity: 0.3;\n}\n\n.modal {\n    visibility: visible;\n    position: fixed;\n    left: 50%;\n    transform: translate(-50%, -50%);\n    z-index: 99999;\n    background: white;\n    padding: 20px;\n    border-radius: 8px;\n    top: 50%;\n    max-width: 100%;\n    width: 460px;\n    min-width: 300px;\n    box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;\n    -webkit-font-smoothing: antialiased;\n}\n\n.closeButton {\n    color: #BBC0C5;\n    cursor: pointer;\n}\n\n.logoContainer {\n    margin-left: 24px;\n    margin-right: 24px;\n    margin-top: 24px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.connectMobileText {\n    font-size: 14px;\n    color: black;\n    margin-top: 28px;\n    margin-bottom: 28px;\n    line-height: 2;\n}\n\n.blue {\n    color: #037DD6;\n    font-weight: 700;\n}\n\n.installExtensionText {\n    margin-left: 10px;\n}\n\n.center {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.right {\n    display: flex;\n    align-items: center;\n    justify-content: right;\n}\n\n#sdk-mm-qrcode {\n    svg {\n        width: 50%;\n    }\n}";
6let d6=()=>cW("svg",{width:"21",height:"15",viewBox:"0 0 21 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cW("path",{d:"M14.1364 14.9851C13.5909 14.9851 13.2273 14.5851 13.2273 13.9851C13.2273 13.3851 13.5909 12.9851 14.1364 12.9851C16.6818 12.9851 18.6818 10.7851 18.6818 7.98508C18.6818 5.18508 16.6818 2.98508 14.1364 2.98508C11.5909 2.98508 9.59091 5.18508 9.59091 7.98508C9.59091 8.58508 9.22727 8.98508 8.68182 8.98508C8.13636 8.98508 7.77273 8.58508 7.77273 7.98508C7.77273 4.08508 10.5909 0.985077 14.1364 0.985077C17.6818 0.985077 20.5 4.08508 20.5 7.98508C20.5 11.8851 17.6818 14.9851 14.1364 14.9851ZM6.68182 14.7851C3.22727 14.7851 0.5 11.6851 0.5 7.98508C0.5 4.28508 3.22727 1.18508 6.68182 1.18508C7.22727 1.18508 7.59091 1.58508 7.59091 2.18508C7.59091 2.78508 7.22727 3.18508 6.68182 3.18508C4.22727 3.18508 2.31818 5.38508 2.31818 7.98508C2.31818 10.5851 4.22727 12.7851 6.68182 12.7851C9.13636 12.7851 11.0455 10.6851 11.0455 7.98508C11.0455 7.38508 11.4091 6.98508 11.9545 6.98508C12.5 6.98508 12.8636 7.38508 12.8636 7.98508C12.7727 11.6851 10.0455 14.7851 6.68182 14.7851Z",fill:"white"})),d7=()=>cW("svg",{width:"400",height:"300",viewBox:"0 0 467 300",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cW("path",{d:"M312.387 280.629C312.549 280.583 312.247 280.735 312.387 280.629L339.678 260.425C340.088 260.118 340.132 259.156 340.07 258.647C340.008 258.138 339.573 258.257 339.106 258.084L311.712 247.455C311.292 247.301 311.308 247.402 310.939 247.673C310.569 247.944 310.356 248.21 310.356 248.672L310.459 279.504C310.461 280.025 311.163 280.619 311.614 280.847C311.913 280.996 312.072 280.718 312.387 280.629ZM336.204 259.736L312.979 276.292L313.439 251.139L336.204 259.736Z",fill:"url(#paint0_linear_1356_14057)"}),cW("path",{d:"M324.639 260.342C324.358 259.547 323.485 258.91 322.707 259.215C319.6 260.432 318.17 262.313 317.287 264.066C316.482 265.665 316.197 267.482 314.188 268.269C312.178 269.055 310.763 268.663 309.162 268.007C307.406 267.287 305.504 266.182 302.397 267.399C299.289 268.616 297.859 270.497 296.976 272.25C296.171 273.849 295.697 274.886 293.685 275.673C291.675 276.459 290.261 276.067 288.659 275.411C286.903 274.691 284.999 273.587 281.894 274.803C278.789 276.019 277.549 278.681 276.666 280.434C275.861 282.034 275.386 283.07 273.374 283.857C272.596 284.161 271.931 285.055 272.211 285.849C272.492 286.644 273.365 287.281 274.143 286.977C277.25 285.76 278.68 283.879 279.563 282.125C280.368 280.526 280.65 278.71 282.662 277.923C284.672 277.136 286.087 277.528 287.688 278.184C289.444 278.904 291.348 280.009 294.453 278.793C297.561 277.576 298.991 275.695 299.874 273.941C300.679 272.342 301.153 271.306 303.165 270.519C305.175 269.732 306.589 270.124 308.191 270.78C309.947 271.5 311.849 272.605 314.956 271.388C318.063 270.172 319.301 267.511 320.184 265.757C320.989 264.158 321.466 263.121 323.476 262.335C324.254 262.032 324.919 261.137 324.639 260.342Z",fill:"url(#paint1_linear_1356_14057)"}),cW("path",{d:"M389.034 111.124C388.968 112.406 387.342 113.113 386.324 113.549C384.297 114.419 382.089 114.493 379.942 114.5C376.607 114.509 373.215 114.163 369.89 113.976C366.712 113.798 363.156 113.311 360.03 114.232C357.705 114.919 355.667 116.762 353.452 117.739C351.129 118.765 348.957 119.198 346.489 119.687C335.569 121.85 323.587 120.825 312.656 119.977C311.92 119.92 312.539 118.997 313.237 118.981C313.207 118.815 313.001 118.394 313.045 118.201C313.086 118.029 312.781 117.586 312.853 117.421C312.67 117.198 313.316 117.427 313.626 117.204C315.912 115.557 318.721 114.79 321.363 115.041C324.677 115.355 327.293 116.04 330.641 115.781C334.392 115.491 338.125 114.787 341.857 114.312C345.142 113.892 349.09 113.941 352.106 112.28C352.916 111.834 353.137 111.262 353.269 110.287C353.331 109.828 353.672 108.969 353.658 108.511C353.629 107.529 354.191 107.886 355.013 107.298C356.857 105.981 358.274 105.516 360.428 105.784C362.841 106.083 365.264 107.273 367.578 107.953C370.761 108.888 374.328 108.646 377.631 108.477C380.517 108.329 383.141 107.901 385.944 108.653C387.013 108.941 389.104 109.745 389.034 111.124Z",fill:"url(#paint2_linear_1356_14057)"}),cW("path",{d:"M278.118 85.4414C280.313 83.8186 283.302 83.9 285.853 83.2728C290.501 82.127 295.644 78.4476 300.549 79.1524C301.299 79.2595 300.904 81.0355 300.159 80.9295C300.131 80.9256 300.187 80.9333 300.159 80.9295C300.089 81.0185 299.516 81.1051 299.385 81.1463C294.999 82.515 292.895 87.5083 289.126 89.8598C287.799 90.688 286.771 90.8351 285.258 90.9441C283.515 91.0691 28
60.964 90.5775 279.269 90.1219C277.15 89.5532 275.965 87.034 278.118 85.4414Z",fill:"url(#paint3_linear_1356_14057)"}),cW("path",{d:"M122.567 166.093C113.597 172.832 104.535 179.836 99.517 190.092C98.5342 192.099 97.519 195.019 97.9533 197.204C98.9699 202.316 105.76 203.049 110.691 201.96C113.468 201.347 116.325 199.231 115.921 196.319C115.576 193.81 113.158 192.986 112.072 190.73C110.779 188.04 112.35 184.97 114.218 182.62C128.134 165.099 150.074 157.394 171.093 151.607C175.385 150.425 180.897 147.69 180.581 143.099C180.372 140.072 177.118 137.683 174.221 137.383C171.324 137.082 168.481 138.773 165.715 139.776C158.416 142.419 151.17 143.799 143.489 143.526C136.865 143.29 130.976 143.316 129.562 150.781C128.138 158.276 129.53 160.863 122.567 166.093Z",fill:"url(#paint4_linear_1356_14057)"}),cW("path",{d:"M79.1056 153.531C60.3932 164.378 43.7478 178.354 32.8214 197.415C30.3313 201.76 27.9216 206.554 27.1821 211.512C26.4448 216.47 27.7591 222.525 30.8133 226.337C34.908 231.446 41.6938 232.915 48.1811 233.125C50.7248 233.208 53.0035 233.066 55.3316 231.947C57.6602 230.83 59.7548 228.359 59.5978 225.742C59.3303 221.315 54.5491 219.665 50.9271 217.34C42.6566 212.037 40.4958 199.493 44.2381 190.032C47.9803 180.57 55.8228 173.173 63.2316 166.338C67.229 162.651 71.5194 158.372 76.777 157.522C79.9167 157.015 83.4706 157.589 86.6295 157.252C93.9004 156.479 99.64 151.404 105.588 146.912C115.048 139.765 126.045 134.283 137.501 132.093C141.913 131.248 146.293 130.493 149.682 127.831C151.37 126.507 150.803 123.567 148.726 123.93C138.542 125.713 128.652 131.135 119.142 134.758C105.627 139.914 91.7133 146.223 79.1056 153.531Z",fill:"url(#paint5_linear_1356_14057)"}),cW("path",{d:"M96.3677 117.321C96.0315 116.64 95.2914 116.612 94.6293 116.975C91.9858 118.417 91.5452 120.509 90.9466 122.178C90.4004 123.702 89.3647 124.67 87.6542 125.604C85.9437 126.538 85.0983 126.316 83.5956 125.91C81.9481 125.465 79.8603 125.424 77.2168 126.866C74.5734 128.309 74.1348 130.401 73.5341 132.07C72.9879 133.593 71.9522 134.562 70.2417 135.496C68.5313 136.43 67.6859 136.208 66.1832 135.801C64.5357 135.357 62.2569 134.538 59.6128 135.978C56.9694 137.42 56.5308 139.512 55.9301 141.181C55.3839 142.705 54.5398 144.454 52.8293 145.388C52.1667 145.748 52.1006 146.485 52.439 147.165C52.7752 147.845 53.5153 147.874 54.1773 147.511C56.8208 146.069 57.2594 143.977 57.86 142.307C58.4062 140.784 59.4419 139.815 61.1524 138.881C62.8629 137.948 63.7083 138.17 65.211 138.576C66.8585 139.021 68.9458 139.059 71.5898 137.619C74.2333 136.177 74.6718 134.085 75.2725 132.416C75.8187 130.892 76.8544 129.924 78.5649 128.99C80.2754 128.056 81.1207 128.278 82.6235 128.684C84.2709 129.129 86.5503 129.95 89.1938 128.507C91.8373 127.065 92.2779 124.973 92.8765 123.304C93.4227 121.78 94.2663 120.03 95.9773 119.098C96.6378 118.738 96.7039 118.001 96.3677 117.321Z",fill:"#FBC49D"}),cW("path",{d:"M391.827 164.699C392.04 164.639 392.39 164.573 392.6 164.481C393.87 163.921 395.363 162.429 395.893 161.051C396.421 159.673 396.237 158.321 395.712 156.931C394.629 154.061 391.777 152.62 389.155 153.775C386.531 154.931 384.962 158.455 386.042 161.325C387.038 163.963 389.369 165.392 391.827 164.699ZM394.166 157.367C394.529 158.332 394.52 159.751 394.156 160.706C393.792 161.662 393.1 162.534 392.218 162.921C390.398 163.723 388.338 162.878 387.589 160.889C387.226 159.925 387.234 158.506 387.599 157.55C387.963 156.594 388.654 155.723 389.536 155.336C391.356 154.534 393.416 155.376 394.166 157.367Z",fill:"#86E29B"}),cW("path",{d:"M62.7198 108.691C64.4912 108.191 66.6152 106.609 67.5596 104.824C68.4273 103.187 68.465 101.455 67.9609 99.7066C67.4547 97.9586 66.0792 96.5141 64.4963 95.6786C62.9135 94.843 61.2077 94.8578 59.4756 95.4255C57.7435 95.9933 56.2768 97.4364 55.409 99.074C53.6185 102.456 55.2032 106.494 58.4723 108.22C60.0142 109.035 61.1315 109.138 62.7198 108.691ZM60.6304 96.7682C61.819 96.4332 63.0232 96.8871 64.1048 97.4571C65.2463 98.0603 66.0495 98.8796 66.4145 100.142C66.7791 101.403 66.4488 103.299 65.8224 104.48C64.5299 106.919 61.2212 107.686 58.8638 106.441C56.5063 105.197 55.8538 101.858 57.1462 99.4185C57.7726 98.2375 58.6059 97.3957 59.8573 96.9862C59.9214 96.9635 60.5631 96.7872 60.6304 96.7682Z",fill:"#FFB0EB"}),cW("path",{d:"M77.0217 242.979C75.9542 243.28 75.1664 242.151 74.9029 241.074C74.6394 239.996 75 239.378 76.0676 239.077C77.1351 238.776 78.5053 238.907 78.7688 239.984C79.0323 241.061 78.0893 242.678 77.0217 242.979Z",fill:"url(#paint6_linear_1356_14057)"}),cW("path",{d:"M380.506 184.577C379.439 184.878 378.651 183.749 378.387 182.672C378.124 181.594 378.484 180.976 379.552 180.675C380.619 180.374 381.99 180.50
65 382.253 181.582C382.517 182.659 381.574 184.276 380.506 184.577Z",fill:"url(#paint7_linear_1356_14057)"}),cW("path",{d:"M348.82 246.969C347.752 247.27 346.382 247.14 346.119 246.063C345.855 244.985 346.798 243.369 347.866 243.068C348.933 242.767 349.721 243.896 349.985 244.973C350.248 246.05 349.888 246.669 348.82 246.969Z",fill:"url(#paint8_linear_1356_14057)"}),cW("path",{d:"M140.419 282.412C139.351 282.713 138.754 282.365 138.491 281.288C138.227 280.21 138.397 278.812 139.464 278.511C140.532 278.21 142.093 279.121 142.357 280.198C142.62 281.275 141.486 282.111 140.419 282.412Z",fill:"url(#paint9_linear_1356_14057)"}),cW("path",{d:"M121.462 101.679C120.395 101.979 119.798 101.631 119.534 100.554C119.271 99.4764 119.44 98.0779 120.508 97.777C121.575 97.4761 123.136 98.3868 123.4 99.4642C123.663 100.542 122.53 101.378 121.462 101.679Z",fill:"url(#paint10_linear_1356_14057)"}),cW("path",{d:"M370.749 159.005C369.682 159.306 368.311 159.175 368.048 158.098C367.784 157.021 368.727 155.404 369.795 155.103C370.863 154.802 371.65 155.931 371.914 157.008C372.177 158.086 371.817 158.704 370.749 159.005Z",fill:"url(#paint11_linear_1356_14057)"}),cW("path",{d:"M384.211 245.345C383.143 245.646 381.773 245.515 381.51 244.438C381.246 243.361 382.189 241.744 383.257 241.443C384.324 241.142 385.112 242.271 385.376 243.348C385.639 244.426 385.278 245.044 384.211 245.345Z",fill:"url(#paint12_linear_1356_14057)"}),cW("path",{d:"M364.771 41.3873C363.063 41.8687 361.337 40.8616 360.915 39.1378C360.493 37.414 361.536 35.6263 363.244 35.1449C364.953 34.6634 366.679 35.6706 367.101 37.3944C367.522 39.1182 366.479 40.9059 364.771 41.3873Z",fill:"url(#paint13_linear_1356_14057)"}),cW("path",{d:"M404.311 77.905C404.602 77.8231 404.875 77.9236 405.084 77.6871C405.437 77.2908 404.814 76.6385 404.703 76.1265L401.277 58.7418C401.149 58.163 400.687 57.5371 400.123 57.3991C399.558 57.2611 398.969 57.3812 398.576 57.835L385.784 73.1179C385.395 73.564 385.199 74.3453 385.393 74.8964C385.585 75.4481 385.978 76.1646 386.548 76.2391L403.538 78.123C403.744 78.1479 404.114 77.9607 404.311 77.905ZM398.948 62.7348L401.811 74.4394L389.841 72.8085L398.948 62.7348Z",fill:"#FFB0EB"}),cW("path",{d:"M97.5393 295.311C97.7108 295.263 97.4284 295.461 97.5393 295.311L108.785 280.464C108.975 280.211 108.718 279.972 108.594 279.684C108.47 279.396 108.124 279.917 107.821 279.902L88.5106 278.672C88.2101 278.659 87.895 278.62 87.7374 278.89C87.5798 279.159 87.7755 279.402 87.9283 279.67L96.5753 294.749C96.7102 294.99 97.2696 295.297 97.5393 295.311C97.6283 295.319 97.4556 295.335 97.5393 295.311ZM106.465 281.118L96.9667 292.97L90.6295 280.577L106.465 281.118Z",fill:"#86E29B"}),cW("path",{d:"M393.699 108.848C389.518 104.446 414.629 114.366 413.945 120.659C413.259 126.952 401.355 129.102 403.894 123.491C406.042 118.747 400.376 115.876 393.699 108.848Z",fill:"#FBC49D"}),cW("path",{d:"M139.414 115.959C139.434 115.953 139.392 115.965 139.414 115.959C141.963 115.2 143.436 111.976 142.717 109.189C142.37 107.839 141.526 107.199 140.408 106.504C139.289 105.808 138.171 105.449 136.933 105.815C135.698 106.182 134.85 107.033 134.222 108.247C133.595 109.461 133.282 111.234 133.63 112.585C133.978 113.935 134.821 114.574 135.94 115.27C137.04 115.952 138.199 116.301 139.414 115.959ZM137.315 107.375C138.222 107.12 139.005 106.994 139.825 107.502C140.661 108.02 140.912 108.618 141.171 109.625C141.708 111.704 140.935 113.834 139.032 114.398C138.11 114.675 137.356 114.791 136.522 114.272C135.686 113.753 135.436 113.155 135.176 112.149C134.917 111.142 134.718 109.714 135.186 108.81C135.654 107.905 136.394 107.649 137.315 107.375C137.329 107.371 137.299 107.38 137.315 107.375Z",fill:"#75C4FD"}),cW("path",{d:"M308.981 78.7519C310.052 78.4043 311.158 78.7096 312.265 78.6613C313.655 78.6006 314.936 78.517 316.323 78.3531C319.497 77.9795 322.798 77.4906 325.984 77.3012C329.309 77.1025 332.514 76.8551 335.836 77.0295C338.809 77.1842 342.163 77.3405 345.105 77.7558C352.129 78.7468 359.331 79.0578 366.347 80.1158C372.252 81.008 377.93 82.1319 383.722 83.5644C385.925 84.0054 388.267 85.0754 389.126 85.3792C389.421 85.4833 389.37 85.8347 389.317 86.1595C389.306 86.2271 389.353 86.1146 389.317 86.1595C388.269 87.414 386.564 86.8124 385.259 86.4677C384.406 86.241 381.488 85.9494 381.011 85.9957C380.14 86.0815 379.277 86.014 379.656 87.2114C380.122 88.6824 382.391 89.7375 383.704 90.2419C385.883 91.0803 388.771 91.2561 390.845 92.4015C392.968 92.821 395.425 93.5002 397.022 93.9986C402.83 95.8103 407.806 98.8678 413.033 102.002C415.503 103.482 417.829 104.764 419.973 106.72C421.647 108.248 423.771 109.882 424.595 112.091C425.113 113.482 424.451 115.471 422.848 115.085C420.353 114.488 419.638 111.665 418.227 109.714C415.003 105.251 410.067 102.067 405.118 100.06C402.64 99.0556 399.803 98.729 397.204 98.1176C394.411 97.4613 391.597 97.0442 388.707 97.1736C385.646 97.3097 382.846 97.5534 379.819 98.0078C377.027 98.4264 374.252 98.4441 371.514 97.8441C368.766 97.2421 366.276 96.7553 363.6 95.9021C361.662 95.2848 359.013 94.5583 357.232 93.5247C355.699 92.6339 355.631 91.2381 357.241 90.186C359.87 88.4656 362.778 89.8021 365.546 90.3497C365.561 90.3527 365.532 90.3468 365.546 90.3497C367.858 90.804 369.649 90.098 371.923 89.3884C372.489 89.2128 373.255 89.0482 373.47 88.953C374.383 88.5432 375.895 87.8227 375.407 86.7394C374.868 85.5457 372.659 84.8846 371.55 84.4891C369.74 83.8428 368.053 82.9215 366.147 82.6743C365.654 82.6095 365.109 83.1606 364.6 83.1097C363.36 83.1121 361.769 83.348 360.543 83.418C357.43 83.5916 354.583 83.6228 351.464 83.4719C348.714 83.3377 346.432 82.8542 343.741 82.3102C340.773 81.7101 337.52 81.5879 334.471 81.5839C331.393 81.5811 328.6 81.7214 325.583 82.4181C322.758 83.0702 319.757 83.6198 316.887 84.0326C314.698 84.3481 312.467 84.6054 310.319 84.2137C309.079 83.9871 306.994 83.3394 306.461 81.9635C305.846 80.3659 307.736 79.1556 308.981 78.7519Z",fill:"url(#paint14_linear_1356_14057)"}),cW("path",{d:"M242.269 242.95C242.295 242.947 242.244 242.955 242.269 242.95C244.934 242.606 247.53 241.858 250.2 241.574C253.133 241.264 256.006 240.56 258.906 239.982C263.26 239.117 268.026 238.52 272.254 237.097C274.429 236.365 276.067 235.298 278.251 234.592C280.361 233.909 283.058 233.12 285.216 232.652C289.317 231.764 293.049 231.66 297.016 230.198C301.109 228.69 305.088 226.673 308.819 224.409C312.645 222.086 316.282 219.769 320.622 218.62C322.381 218.154 323.919 218.219 325.65 218.886C327.016 219.413 327.739 220.337 327.196 221.79C326.557 223.504 324.659 224.7 323.131 225.423C320.854 226.5 319.53 227.184 317.134 227.927C314.619 228.707 311.888 229.24 309.395 230.083C308.226 230.947 307.17 232.522 306.105 233.501C303.996 235.441 301.666 237.03 298.945 237.996C292.934 240.129 286.354 238.602 280.183 239.056C279.661 239.095 279.162 239.442 278.635 239.487C275.592 240.135 272.2 240.63 269.156 241.294C264.546 242.299 260.456 243.409 255.808 244.179C251.971 244.814 243.815 245.854 243.815 245.854L242.074 245.505C240.575 245.281 240.751 243.152 242.269 242.95Z",fill:"url(#paint15_linear_1356_14057)"}),cW("path",{d:"M432.985 171.626C438.212 165.465 445.109 153.64 442.906 144.649C442.162 137.999 433.671 132.912 424.963 135.518C420.16 136.957 416.435 142.146 419.724 144.498
6C420.656 145.164 422.187 145.591 423.391 145.969C434.204 149.375 434.925 162.538 425.069 169.683C421.087 172.569 416.347 174.292 411.914 176.719C400.151 183.162 399.887 196.847 387.7 202.712C382.326 205.298 375.761 206.838 370.297 209.275C359.98 213.88 352.555 221.733 342.241 226.341C337.225 228.584 330.266 231.632 323.483 234.12C321.475 234.855 321.999 237.058 324.056 236.46C324.098 236.449 324.017 236.474 324.056 236.46C329.079 234.971 334.437 233.161 339.331 231.33C352.278 226.48 365.28 220.971 377.43 214.775C401.78 202.367 416.881 190.609 432.985 171.626Z",fill:"url(#paint16_linear_1356_14057)"}),cW("path",{d:"M343.644 241.104C348.002 234.144 357.126 232.455 364.343 231.134C368.176 230.431 372.406 229.878 376.137 228.662C380.691 227.175 384.558 224.095 388.327 221.077C389.452 220.177 391.204 218.466 392.393 217.436C393.185 216.748 393.644 216.026 394.33 215.225C396 213.275 399.599 209.812 401.687 208.16C403.263 206.914 407.779 204.758 408.259 207.986C408.611 210.359 406.379 213.087 404.961 214.747C402.224 217.953 398.998 221.079 395.475 223.243C391.749 225.531 387.701 227.439 383.674 229.051C381.672 229.853 379.519 230.073 377.486 230.785C376.001 231.307 374.486 232.236 373.037 232.866C371.034 233.738 368.99 234.28 367.041 235.38C364.436 236.849 361.782 238.783 359.108 240.105C356.331 241.477 353.823 242.691 350.791 243.27C348.6 243.687 345.501 243.641 343.836 241.884C343.526 241.554 343.389 241.51 343.644 241.104Z",fill:"url(#paint17_linear_1356_14057)"}),cW("path",{d:"M190.163 273.219C222.905 268.849 232.64 262.943 213.962 259.057C195.285 255.172 187.5 262.08 188.434 266.2C189.366 270.32 180.381 271.326 169.286 272.39C158.193 273.454 157.141 276.354 190.163 273.219Z",fill:"url(#paint18_linear_1356_14057)"}),cW("path",{d:"M295.952 95.4242L241.395 135.226L251.54 111.77L295.952 95.4242Z",fill:"#E17726",stroke:"#E17726","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M170.111 95.4242L224.181 135.598L214.522 111.77L170.111 95.4242Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M276.309 187.712L261.793 209.576L292.876 218.014L301.78 188.189L276.309 187.712Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M164.336 188.189L173.186 218.014L204.215 209.576L189.753 187.712L164.336 188.189Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M202.542 150.776L193.908 163.618L224.667 164.998L223.642 132.36L202.542 150.776Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M263.52 150.775L242.097 131.989L241.395 164.998L272.154 163.618L263.52 150.775Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M204.215 209.576L222.832 200.714L206.805 188.402L204.215 209.576Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M243.23 200.714L261.793 209.576L259.257 188.402L243.23 200.714Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M261.793 209.576L243.23 200.714L244.741 212.601L244.579 217.643L261.793 209.576Z",fill:"#D5BFB2",stroke:"#D5BFB2","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M204.215 209.576L221.483 217.643L221.375 212.601L222.832 200.714L204.215 209.576Z",fill:"#D5BFB2",stroke:"#D5BFB2","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M221.807 180.547L206.373 176.09L217.274 171.154L221.807 180.547Z",fill:"#233447",stroke:"#233447","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M244.255 180.547L248.788 171.154L259.742 176.09L244.255 180.547Z",fill:"#233447",stroke:"#233447","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M204.215 209.576L206.913 187.712L189.753 188.189L204.215 209.576Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M259.149 187.712L261.793 209.576L276.309 188.189L259.149 187.712Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M272.154 163.618L241.395 164.998L244.255 180.547L248.788 171.154L259.742 176.09L272.154 163.618Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M206.373 176.09L217.274 171.154L221.807 180.547L224.667 164.998L193.908 163.618L206.373 176.09Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M193.908 163.618L206.805 188.402L206.373 176.09L193.908 163.618Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M259.743 176.09L259.257 188.402L272.154 163.618L259.743 176.09Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M224.667 164.998L221.807 180.548L225.422 198.909L226.232 174.71L224.667 164.998Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M241.395 164.998L239.884 174.657L240.64 198.909L244.255 180.548L241.395 164.998Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M244.255 180.547L240.64 198.909L243.23 200.714L259.257 188.402L259.743 176.09L244.255 180.547Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M206.373 176.09L206.805 188.402L222.832 200.714L225.422 198.909L221.807 180.547L206.373 176.09Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M244.579 217.643L244.741 212.601L243.338 211.434H222.724L221.375 212.601L221.483 217.643L204.215 209.576L210.259 214.459L222.508 222.791H243.5L255.803 214.459L261.793 209.576L244.579 217.643Z",fill:"#C0AC9D",stroke:"#C0AC9D","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M243.23 200.714L240.64 198.909H225.422L222.832 200.714L221.375 212.601L222.724 211.434H243.338L244.741 212.601L243.23 200.714Z",fill:"#161616",stroke:"#161616","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M298.272 137.827L302.859 115.856L295.952 95.4242L243.23 133.899L263.52 150.775L292.174 159.001L298.488 151.731L295.736 149.767L300.107 145.84L296.761 143.293L301.
6132 140.002L298.272 137.827Z",fill:"#763E1A",stroke:"#763E1A","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M163.203 115.856L167.844 137.827L164.876 140.002L169.301 143.293L165.955 145.84L170.326 149.767L167.574 151.731L173.888 159.001L202.542 150.775L222.832 133.899L170.11 95.4242L163.203 115.856Z",fill:"#763E1A",stroke:"#763E1A","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M292.175 159.001L263.52 150.775L272.154 163.618L259.257 188.402L276.309 188.189H301.78L292.175 159.001Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M202.542 150.775L173.888 159.001L164.336 188.189H189.753L206.805 188.402L193.908 163.618L202.542 150.775Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("path",{d:"M241.395 164.998L243.23 133.9L251.54 111.77H214.522L222.832 133.9L224.667 164.998L225.368 174.763L225.422 198.909H240.64L240.694 174.763L241.395 164.998Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),cW("defs",null,cW("linearGradient",{id:"paint0_linear_1356_14057",x1:"335.991",y1:"250.487",x2:"303.873",y2:"266.801",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#FFE466"}),cW("stop",{offset:"1","stop-color":"#FFAFEA"})),cW("linearGradient",{id:"paint1_linear_1356_14057",x1:"276.993",y1:"303.722",x2:"205.254",y2:"401.574",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"0.0929","stop-color":"#81C2F6"}),cW("stop",{offset:"1","stop-color":"#F0B8BD"})),cW("linearGradient",{id:"paint2_linear_1356_14057",x1:"271.074",y1:"119.924",x2:"553.077",y2:"104.53",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#FFE466"}),cW("stop",{offset:"1","stop-color":"#FFAFEA"})),cW("linearGradient",{id:"paint3_linear_1356_14057",x1:"264.209",y1:"91.0943",x2:"357.834",y2:"72.8792",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#FFE466"}),cW("stop",{offset:"1","stop-color":"#FFAFEA"})),cW("linearGradient",{id:"paint4_linear_1356_14057",x1:"212.46",y1:"121.997",x2:"92.6119",y2:"183.406",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#FFE466"}),cW("stop",{offset:"1","stop-color":"#FFAFEA"})),cW("linearGradient",{id:"paint5_linear_1356_14057",x1:"23.0498",y1:"204.411",x2:"161.86",y2:"163.003",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"0.0929","stop-color":"#81C2F6"}),cW("stop",{offset:"1","stop-color":"#F0B8BD"})),cW("linearGradient",{id:"paint6_linear_1356_14057",x1:"78.8647",y1:"240.375",x2:"74.9655",y2:"241.328",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"1","stop-color":"#75C3FC"})),cW("linearGradient",{id:"paint7_linear_1356_14057",x1:"382.349",y1:"181.971",x2:"378.45",y2:"182.925",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"1","stop-color":"#75C3FC"})),cW("linearGradient",{id:"paint8_linear_1356_14057",x1:"349.889",y1:"244.583",x2:"345.99",y2:"245.537",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"1","stop-color":"#75C3FC"})),cW("linearGradient",{id:"paint9_linear_1356_14057",x1:"142.262",y1:"279.808",x2:"138.362",y2:"280.762",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"1","stop-color":"#75C3FC"})),cW("linearGradient",{id:"paint10_linear_1356_14057",x1:"123.305",y1:"99.0746",x2:"119.406",y2:"100.028",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"1","stop-color":"#75C3FC"})),cW("linearGradient",{id:"paint11_linear_1356_14057",x1:"371.818",y1:"156.617",x2:"367.919",y2:"157.571",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"1","stop-color":"#75C3FC"})),cW("linearGradient",{id:"paint12_linear_1356_14057",x1:"385.281",y1:"242.958",x2:"381.382",y2:"243.911",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"1","stop-color":"#75C3FC"})),cW("linearGradient",{id:"paint13_linear_1356_14057",x1:"367.125",y1:"37.5052",x2:"360.843",y2:"38.8076",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"1","stop-color":"#75C3FC"})),cW("linearGradient",{id:"paint14_linear_1356_14057",x1:"300.182",y1:"91.321",x2:"479.464",y2:"104.041",gradientUnits:"userSpaceOnUse"}
6,cW("stop",{"stop-color":"#FFE466"}),cW("stop",{offset:"1","stop-color":"#FFAFEA"})),cW("linearGradient",{id:"paint15_linear_1356_14057",x1:"363.434",y1:"201.232",x2:"102.977",y2:"302.269",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#FFE466"}),cW("stop",{offset:"1","stop-color":"#FFAFEA"})),cW("linearGradient",{id:"paint16_linear_1356_14057",x1:"447.962",y1:"165.159",x2:"313.049",y2:"197.95",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"0.0929","stop-color":"#81C2F6"}),cW("stop",{offset:"1","stop-color":"#F0B8BD"})),cW("linearGradient",{id:"paint17_linear_1356_14057",x1:"410.211",y1:"215.859",x2:"341.378",y2:"232.788",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#75C3FC"}),cW("stop",{offset:"0.0929","stop-color":"#81C2F6"}),cW("stop",{offset:"1","stop-color":"#F0B8BD"})),cW("linearGradient",{id:"paint18_linear_1356_14057",x1:"222.282",y1:"258.986",x2:"162.257",y2:"273.774",gradientUnits:"userSpaceOnUse"},cW("stop",{"stop-color":"#FFE466"}),cW("stop",{offset:"1","stop-color":"#FFAFEA"})))),d9=class{constructor(e){cy(this,e),this.close=cQ(this,"close",7),this.connectWithExtension=cQ(this,"connectWithExtension",7),this.link=void 0,this.sdkVersion=void 0,this.preferDesktop=void 0,this.tab=1,this.isDefaultTab=!0,this.translationsLoaded=!1,this.i18nInstance=new d5,this.setTab(this.preferDesktop?1:2)}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}onClose(e=!1){this.close.emit({shouldTerminate:e})}connectWithExtensionHandler(){this.connectWithExtension.emit()}setTab(e){this.tab=e,this.isDefaultTab=!1}disconnectedCallback(){this.onClose()}updatePreferDesktop(e){e?this.setTab(1):this.setTab(2)}render(){if(!this.translationsLoaded)return null;let e=e=>this.i18nInstance.t(e),t=this.sdkVersion,n=this.isDefaultTab?this.preferDesktop?1:2:this.tab,r=d2(this.link,"svg",{ecc:"medium",scale:2});return cW(dR,{className:"select-modal"},cW("div",{class:"backdrop",onClick:()=>this.onClose(!0)}),cW("div",{class:"modal"},cW("div",{class:"closeButtonContainer"},cW("div",{class:"right"},cW("span",{class:"closeButton",onClick:()=>this.onClose(!0)},cW(d$,null)))),cW("div",{class:"logoContainer"},cW(dB,null)),cW("div",null,cW("div",{class:"tabcontainer"},cW("div",{class:"flexContainer"},cW("div",{onClick:()=>this.setTab(1),class:"tab flexItem "+(1===n?"tabactive":"")},e("DESKTOP")),cW("div",{onClick:()=>this.setTab(2),class:"tab flexItem "+(2===n?"tabactive":"")},e("MOBILE")))),cW("div",{style:{display:1===n?"none":"block"}},cW("div",{class:"flexContainer"},cW("div",{class:"flexItem",style:{textAlign:"center",marginTop:"4"}},cW("div",{class:"center",id:"sdk-mm-qrcode",innerHTML:r}),cW("div",{class:"connectMobileText"},e("SCAN_TO_CONNECT"),cW("br",null),cW("span",{class:"blue"},cW("b",null,e("META_MASK_MOBILE_APP"))))))),cW("div",{style:{display:2===n?"none":"block"}},cW("div",{style:{display:"flex",justifyContent:"center",height:"300",marginTop:"-20"}},cW(d7,null)),cW("div",{class:"extensionLabel"},e("SELECT_MODAL.CRYPTO_TAKE_CONTROL_TEXT")),cW("button",{class:"button",onClick:()=>this.connectWithExtensionHandler()},cW(d6,null),cW("span",{class:"installExtensionText"},e("CONNECT_WITH_EXTENSION"))))),cW(dD,{version:t})))}get el(){return cX(this)}static get watchers(){return{preferDesktop:["updatePreferDesktop"]}}};d9.style=
vendor: 3,083 bytes, line 6
6".flexContainer {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    flex-direction: row;\n}\n\n.flexItem {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem11 {\n    flex: 11;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem1 {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.tab {\n    padding: 8px;\n    cursor: pointer;\n    background-color: #F2F4F6;\n    font-size: 12px;\n    text-align: center;\n    color: #24292E;\n}\n\n.tabcontainer {\n    padding: 4px;\n    background-color: #F2F4F6;\n    border-radius: 8px;\n    margin-bottom: 30px;\n    margin-top: 30px;\n}\n\n.tabactive {\n    background-color: white;\n    -webkit-transition: background-color 300ms linear;\n    -ms-transition: background-color 300ms linear;\n    transition: background-color 300ms linear;\n    border-radius: 8px;\n}\n\n.item {\n    font-size: 12px;\n    margin-bottom: 16px;\n    border-radius: 8px;\n    padding: 10px;\n    border: 2px #F2F4F6 solid;\n    color: #24292E;\n}\n\n.extensionLabel {\n    font-style: normal;\n    font-weight: bold;\n    font-size: 14px;\n    text-align: cetner;\n    color: #24272A;\n}\n\n.notice {\n    font-size: 12px;\n    margin-left: 10px;\n    margin-right: 10px;\n    color: grey;\n}\n\n.button {\n    margin-top: 41.5px;\n    margin-bottom: 20px;\n    width: 100%;\n    display: flex;\n    flex-direction: row;\n    justify-content: center;\n    align-items: center;\n    padding: 12px 20px;\n    background: #037DD6;\n    border-radius: 32px;\n    color: white;\n    border: 0;\n    font-size: 14px;\n    cursor: pointer;\n}\n\n.backdrop {\n    visibility: visible;\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    width: 100%;\n    z-index: 99998;\n    background: rgba(0, 0, 0, 0.87);\n    opacity: 0.3;\n}\n\n.modal {\n    visibility: visible;\n    position: fixed;\n    left: 50%;\n    transform: translate(-50%, -50%);\n    z-index: 99999;\n    background: white;\n    padding: 20px;\n    border-radius: 8px;\n    top: 50%;\n    max-width: 100%;\n    width: 460px;\n    min-width: 300px;\n    box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;\n    -webkit-font-smoothing: antialiased;\n}\n\n.closeButton {\n    color: #BBC0C5;\n    cursor: pointer;\n}\n\n.logoContainer {\n    margin-left: 24px;\n    margin-right: 24px;\n    margin-top: 24px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.connectMobileText {\n    font-size: 14px;\n    color: black;\n    margin-top: 28px;\n    margin-bottom: 28px;\n    line-height: 2;\n}\n\n.blue {\n    color: #037DD6;\n    font-weight: 700;\n}\n\n.installExtensionText {\n    margin-left: 10px;\n}\n\n.center {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.right {\n    display: flex;\n    align-items: center;\n    justify-content: right;\n}\n\n#sdk-mm-qrcode {\n    svg {\n        width: 50%;\n    }\n}";
6var ue=Object.freeze({__proto__:null,mm_install_modal:d8,mm_pending_modal:d4,mm_select_modal:d9})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.