1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,34582,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=l(t),r=e[0],i=e[1];return(r+i)*3/4-i},r.toByteArray=function(t){var e,r,i=l(t),s=i[0],a=i[1],u=new o((s+a)*3/4-a),f=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=0,a=r-n;s<a;s+=16383)o.push(function(t,e,r){for(var n,o=[],s=e;s<r;s+=3)n=(t[s]<<16&0xff0000)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(i[n>>18&63]+i[n>>12&63]+i[n>>6&63]+i[63&n]);return o.join("")}(t,s,s+16383>a?a:s+16383));return 1===n?o.push(i[(e=t[r-1])>>2]+i[e<<4&63]+"=="):2===n&&o.push(i[(e=(t[r-2]<<8)+t[r-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),o.join("")};for(var i=[],n=[],o="u">typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)i[a]=s[a],n[s.charCodeAt(a)]=a;function l(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var i=r===e?0:4-r%4;return[r,i]}n[45]=62,n[95]=63},38492,(t,e,r)=>{r.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,l=u>>1,f=-7,c=r?n-1:0,h=r?-1:1,d=t[e+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[e+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=l}return(d?-1:1)*s*Math.pow(2,o-i)},r.write=function(t,e,r,i,n,o){var s,a,u,l=8*o-n-1,f=(1<<l)-1,c=f>>1,h=5960464477539062e-23*(23===n),d=i?0:o-1,p=i?1:-1,g=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+c>=1?e+=h/u:e+=h*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*u-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<<n|a,l+=n;l>0;t[r+d]=255&s,d+=p,s/=256,l-=8);t[r+d-p]|=128*g}},43943,(t,e,r)=>{"use strict";let i=t.r(34582),n=t.r(38492),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t){var i=t,n=e;if(("string"!=typeof n||""===n)&&(n="utf8"),!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);let r=0|p(i,n),o=s(r),u=o.write(i,n);return u!==r&&(o=o.slice(0,u)),o}if(ArrayBuffer.isView(t)){var o=t;if(N(o,Uint8Array)){let t=new Uint8Array(o);return h(t.buffer,t.byteOffset,t.byteLength)}return c(o)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(t,SharedArrayBuffer)||t&&N(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let u=t.valueOf&&t.valueOf();if(null!=u&&u!==t)return a.from(u,e,r);let l=function(t){if(a.isBuffer(t)){let e=0|d(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?s(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(l)return l;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');
vendor: 65,893 bytes, line 1
1if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return l(t),s(t<0?0:0|d(t))}function c(t){let e=t.length<0?0:0|d(t.length),r=s(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function h(t,e,r){let i;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),a.prototype),i}function d(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(n)return i?-1:L(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=q[t[i]];return n}(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return function(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}(this,e,r);case"latin1":case"binary":return function(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}(this,e,r);case"base64":var o,s,a;return o=this,s=e,a=r,0===s&&a===o.length?i.fromByteArray(o):i.fromByteArray(o.slice(s,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let i=t.slice(e,r),n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+256*i[t+1]);return n}(this,e,r);default:if(n)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function m(t,e,r,i,n){var o;if(0===t.length)return -1;if("string"==typeof r?(i=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(n)return -1;else r=t.length-1;else if(r<0)if(!n)return -1;else r=0;if("string"==typeof e&&(e=a.from(e,i)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,i,n);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(n)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return b(t,[e],r,i,n)}throw TypeError("val must be string, number or Buffer")}function b(t,e,r,i,n){let o,s=1,a=t.length,u=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return -1;s=2,a/=2,u/=2,r/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){let i=-1;for(o=r;o<a;o++)if(l(t,o)===l(e,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===u)return i*s}else -1!==i&&(o-=o-i),i=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let i=0;i<u;i++)if(l(t,o+i)!==l(e,i)){r=!1;break}if(r)return o}return -1}function w(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let e=t[n],o=null,s=e>239?4:e>223?3:e>191?2:1;if(n+s<=r){let r,i,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:(192&(r=t[n+1]))==128&&(u=(31&e)<<6|63&r)>127&&(o=u);break;case 3:r=t[n+1],i=t[n+2],(192&r)==128&&(192&i)==128&&(u=(15&e)<<12|(63&r)<<6|63&i)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],(192&r)==128&&(192&i)==128&&(192&a)==128&&(u=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}var o=i;let s=o.length;if(s<=4096)return String.fromCharCode.apply(String,o);let a="",u=0;for(;u<s;)a+=String.fromCharCode.apply(String,o.slice(u,u+=4096));return a}function v(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function x(t,e,r,i,n,o){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw RangeError('"value" argument is out of bounds');if(r+i>t.length)throw RangeError("Index out of range")}function S(t,e,r,i,n){O(e,i,n,t,r,7);let o=Number(e&BigInt(0xffffffff));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function E(t,e,r,i,n){O(e,i,n,t,r,7);let o=Number(e&BigInt(0xffffffff));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function k(t,e,r,i,n,o){if(r+i>t.length||r<0)throw RangeError("Index out of range")}function B(t,e,r,i,o){return e*=1,r>>>=0,o||k(t,e,r,4,34028234663852886e22,-34028234663852886e22),n.write(t,e,r,i,23,4),r+4}function A(t,e,r,i,o){return e*=1,r>>>=0,o||k(t,e,r,8,17976931348623157e292,-17976931348623157e292),n.write(t,e,r,i,52,8),r+8}r.Buffer=a,r.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(l(t),t<=0)?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)},a.allocUnsafe=function(t){return f(t)},a.allocUnsafeSlow=function(t){return f(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:+(i<r)},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let i=a.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){let e=t[r];if(N(e,Uint8Array))n+e.length>i.length?(a.isBuffer(e)||(e=a.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else if(a.isBuffer(e))e.copy(i,n);else throw TypeError('"list" argument must be an Array of Buffers');n+=e.length}return i},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},a.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},a.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},a.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?w(this,0,t):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){let t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(t,e,r,i,n){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,n>>>=0,this===t)return 0;let o=n-i,s=r-e,u=Math.min(o,s),l=this.slice(i,n),f=t.slice(e,r);for(let t=0;t<u;++t)if(l[t]!==f[t]){o=l[t],s=f[t];break}return o<s?-1:+(s<o)},a.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},a.prototype.write=function(t,e,r,i){var n,o,s,a,u,l,f,c;if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-e;if((void 0===r||r>h)&&(r=h),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let d=!1;for(;;)switch(i){case"hex":return function(t,e,r,i){let n;r=Number(r)||0;let o=t.length-r;i?(i=Number(i))>o&&(i=o):i=o;let s=e.length;for(i>s/2&&(i=s/2),n=0;n<i;++n){var a;let i=parseInt(e.substr(2*n,2),16);if((a=i)!=a)break;t[r+n]=i}return n}(this,t,e,r);case"utf8":case"utf-8":return n=e,o=r,C(L(t,this.length-n),this,n,o);case"ascii":case"latin1":case"binary":return s=e,a=r,C(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,s,a);case"base64":return u=e,l=r,C(P(t),this,u,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f=e,c=r,C(function(t,e){let r,i,n=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)i=(r=t.charCodeAt(o))>>8,n.push(r%256),n.push(i);return n}(t,this.length-f),this,f,c);default:if(d)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,a.prototype),i},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let i=this[t],n=1,o=0;for(;++o<e&&(n*=256);)i+=this[t+o]*n;return i},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readBigUInt64LE=z(function(t){R(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&T(t,this.length-8);let i=e+256*this[++t]+65536*this[++t]+0x1000000*this[++t],n=this[++t]+256*this[++t]+65536*this[++t]+0x1000000*r;return BigInt(i)+(BigInt(n)<<BigInt(32))}),a.prototype.readBigUInt64BE=z(function(t){R(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&T(t,this.length-8);let i=0x1000000*e+65536*this[++t]+256*this[++t]+this[++t],n=0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)}),a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let i=this[t],n=1,o=0;for(;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let i=e,n=1,o=this[t+--i];for(;i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return(t>>>=0,e||v(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readBigInt64LE=z(function(t){R(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&T(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+0x1000000*this[++t])}),a.prototype.readBigInt64BE=z(function(t){R(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&T(t,this.length-8),(BigInt((e<<24)+65536*this[++t]+256*this[++t]+this[++t])<<BigInt(32))+BigInt(0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r)}),a.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;x(this,t,e,r,i,0)}let n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;x(this,t,e,r,i,0)}let n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigUInt64LE=z(function(t,e=0){return S(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=z(function(t,e=0){return E(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(t,e,r,i){if(t*=1,e>>>=0,!i){let i=Math.pow(2,8*r-1);x(this,t,e,r,i-1,-i)}let n=0,o=1,s=0;for(this[e]=255&t;++n<r&&(o*=256);)t<0&&0===s&&0!==this[e+n-1]&&(s=1),this[e+n]=(t/o|0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,i){if(t*=1,e>>>=0,!i){let i=Math.pow(2,8*r-1);x(this,t,e,r,i-1,-i)}let n=r-1,o=1,s=0;for(this[e+n]=255&t;--n>=0&&(o*=256);)t<0&&0===s&&0!==this[e+n+1]&&(s=1),this[e+n]=(t/o|0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigInt64LE=z(function(t,e=0){return S(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=z(function(t,e=0){return E(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return A(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return A(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,i){if(!a.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);let n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},a.prototype.fill=function(t,e,r,i){let n;if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===t.length){let e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{let o=a.isBuffer(t)?t:a.from(t,i),s=o.length;if(0===s)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=o[n%s]}return this};let I={};function _(t,e,r){I[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function M(t){let e="",r=t.length,i=+("-"===t[0]);for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function O(t,e,r,i,n,o){if(t>r||t<e){let i,n="bigint"==typeof e?"n":"";throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${(o+1)*8}${n}`:`>= -(2${n} ** ${(o+1)*8-1}${n}) and < 2 ** ${(o+1)*8-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new I.ERR_OUT_OF_RANGE("value",i,t)}R(n,"offset"),(void 0===i[n]||void 0===i[n+o])&&T(n,i.length-(o+1))}function R(t,e){if("number"!=typeof t)throw new I.ERR_INVALID_ARG_TYPE(e,"number",t)}function T(t,e,r){if(Math.floor(t)!==t)throw R(t,r),new I.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new I.ERR_BUFFER_OUT_OF_BOUNDS;throw new I.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${e}`,t)}_("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),_("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?n=M(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=M(n)),n+="n"),i+=` It must be ${e}. Received ${n}`},RangeError);let U=/[^+/0-9A-Za-z-_]/g;function L(t,e){let r;e=e||1/0;let i=t.length,n=null,o=[];for(let s=0;s<i;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319||s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function P(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function C(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length)&&!(n>=t.length);++n)e[n+r]=t[n];return n}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let q=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function z(t){return"u"<typeof BigInt?W:t}function W(){throw Error("BigInt not supported")}},59341,(t,e,r)=>{!function(t,e){"use strict";function r(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}t.exports=n,n.BN=n,n.wordSize=26;try{f="u">typeof window&&void 0!==window.Buffer?window.Buffer:void 0}catch(t){}function o(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function s(t,e,r){var i=o(t,r);return r-1>=e&&(i|=o(t,r-1)<<4),i}function a(t,e,i,n){for(var o=0,s=0,a=Math.min(t.length,i),u=e;u<a;u++){var l=t.charCodeAt(u)-48;o*=n,s=l>=49?l-49+10:l>=17?l-17+10:l,r(l>=0&&s<n,"Invalid character"),o+=s}return o}function u(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return 0>t.cmp(e)?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},n.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<0x4000000?(this.words=[0x3ffffff&t],this.length=1):t<0x10000000000000?(this.words=[0x3ffffff&t,t/0x4000000&0x3ffffff],this.length=2):(r(t<0x20000000000000),this.words=[0x3ffffff&t,t/0x4000000&0x3ffffff,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},n.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var n,o,s=0;s<this.length;s++)this.words[s]=0;var a=0;if("be"===i)for(s=t.length-1,n=0;s>=0;s-=3)o=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[n]|=o<<a&0x3ffffff,this.words[n+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(s=0,n=0;s<t.length;s+=3)o=t[s]|t[s+1]<<8|t[s+2]<<16,this.words[n]|=o<<a&0x3ffffff,this.words[n+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);return this._strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var i,n=0;n<this.length;n++)this.words[n]=0;var o=0,a=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=s(t,e,n)<<o,this.words[a]|=0x3ffffff&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=s(t,e,n)<<o,this.words[a]|=0x3ffffff&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,u=Math.min(o,o-s)+r,l=0,f=r;f<u;f+=i)l=a(t,f,f+i,e),this.imuln(n),this.words[0]+l<0x4000000?this.words[0]+=l:this._iaddn(l);if(0!==s){var c=1;for(l=a(t,f,t.length,e),f=0;f<s;f++)c*=e;this.imuln(c),this.words[0]+l<0x4000000?this.words[0]+=l:this._iaddn(l)}this._strip()},n.prototype.copy=function(t){t.words=Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype._move=function(t){u(t,this)},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){n.prototype.inspect=l}else n.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f,c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=0x3ffffff&s,u=s/0x4000000|0;r.words[0]=a;for(var l=1;l<i;l++){for(var f=u>>>26,c=0x3ffffff&u,h=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=h;d++){var p=l-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+c)/0x4000000|0,c=0x3ffffff&s}r.words[l]=0|c,u=0|f}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}n.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){for(var i="",n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=((a<<n|o)&0xffffff).toString(16);o=a>>>24-n&0xffffff,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?c[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var l=h[t],f=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(f).toString(t);i=(p=p.idivn(f)).isZero()?g+i:c[l-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?t+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},f&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(f,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,i){this._strip();var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=t.allocUnsafe?t.allocUnsafe(o):new t(o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r<t.length)for(t[r++]=i;r<t.length;)t[r++]=0},n.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},n.prototype.ior=function(t){return r((this.negative|t.negative)==0),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},n.prototype.iand=function(t){return r((this.negative|t.negative)==0),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this._strip()},n.prototype.ixor=function(t){return r((this.negative|t.negative)==0),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=0x3ffffff&~this.words[n];for(i>0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i,n++);n<this.length;n++)this.words[n]=0;return this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),e?this.words[i]=this.words[i]|1<<n:this.words[i]=this.words[i]&~(1<<n),this._strip()},n.prototype.iadd=function(t){if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var e,r,i,n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=0x3ffffff&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=0x3ffffff&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(i=(0|e.words[s])-(0|r.words[s])+o)>>26,this.words[s]=0x3ffffff&i;for(;0!==o&&s<e.length;s++)o=(i=(0|e.words[s])+o)>>26,this.words[s]=0x3ffffff&i;if(0===o&&s<e.length&&e!==this)for(;s<e.length;s++)this.words[s]=e.words[s];return this.length=Math.max(this.length,s),e!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,l=0,f=0|s[0],c=8191&f,h=f>>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,b=y>>>13,w=0|s[3],v=8191&w,x=w>>>13,S=0|s[4],E=8191&S,k=S>>>13,B=0|s[5],A=8191&B,I=B>>>13,_=0|s[6],M=8191&_,O=_>>>13,R=0|s[7],T=8191&R,U=R>>>13,L=0|s[8],P=8191&L,C=L>>>13,N=0|s[9],q=8191&N,z=N>>>13,W=0|a[0],F=8191&W,K=W>>>13,j=0|a[1],D=8191&j,$=j>>>13,V=0|a[2],H=8191&V,Z=V>>>13,G=0|a[3],Y=8191&G,J=G>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,te=0|a[5],tr=8191&te,ti=te>>>13,tn=0|a[6],to=8191&tn,ts=tn>>>13,ta=0|a[7],tu=8191&ta,tl=ta>>>13,tf=0|a[8],tc=8191&tf,th=tf>>>13,td=0|a[9],tp=8191&td,tg=td>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(c,F);var ty=(l+i|0)+((8191&(n=(n=Math.imul(c,K))+Math.imul(h,F)|0))<<13)|0;l=((o=Math.imul(h,K))+(n>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,i=Math.imul(p,F),n=(n=Math.imul(p,K))+Math.imul(g,F)|0,o=Math.imul(g,K),i=i+Math.imul(c,D)|0;var tm=(l+i|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(h,D)|0))<<13)|0;l=((o=o+Math.imul(h,$)|0)+(n>>>13)|0)+(tm>>>26)|0,tm&=0x3ffffff,i=Math.imul(m,F),n=(n=Math.imul(m,K))+Math.imul(b,F)|0,o=Math.imul(b,K),i=i+Math.imul(p,D)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(g,D)|0,o=o+Math.imul(g,$)|0,i=i+Math.imul(c,H)|0;var tb=(l+i|0)+((8191&(n=(n=n+Math.imul(c,Z)|0)+Math.imul(h,H)|0))<<13)|0;l=((o=o+Math.imul(h,Z)|0)+(n>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,i=Math.imul(v,F),n=(n=Math.imul(v,K))+Math.imul(x,F)|0,o=Math.imul(x,K),i=i+Math.imul(m,D)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(b,D)|0,o=o+Math.imul(b,$)|0,i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(c,Y)|0;var tw=(l+i|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(h,Y)|0))<<13)|0;l=((o=o+Math.imul(h,J)|0)+(n>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,i=Math.imul(E,F),n=(n=Math.imul(E,K))+Math.imul(k,F)|0,o=Math.imul(k,K),i=i+Math.imul(v,D)|0,n=(n=n+Math.imul(v,$)|0)+Math.imul(x,D)|0,o=o+Math.imul(x,$)|0,i=i+Math.imul(m,H)|0,n=(n=n+Math.imul(m,Z)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,J)|0,i=i+Math.imul(c,Q)|0;var tv=(l+i|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(h,Q)|0))<<13)|0;l=((o=o+Math.imul(h,tt)|0)+(n>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,i=Math.imul(A,F),n=(n=Math.imul(A,K))+Math.imul(I,F)|0,o=Math.imul(I,K),i=i+Math.imul(E,D)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(k,D)|0,o=o+Math.imul(k,$)|0,i=i+Math.imul(v,H)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(m,Y)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,i=i+Math.imul(c,tr)|0;var tx=(l+i|0)+((8191&(n=(n=n+Math.imul(c,ti)|0)+Math.imul(h,tr)|0))<<13)|0;l=((o=o+Math.imul(h,ti)|0)+(n>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,i=Math.imul(M,F),n=(n=Math.imul(M,K))+Math.imul(O,F)|0,o=Math.imul(O,K),i=i+Math.imul(A,D)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(I,D)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(E,H)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,i=i+Math.imul(p,tr)|0,n=(n=n+Math.imul(p,ti)|0)+Math.imul(g,tr)|0,o=o+Math.imul(g,ti)|0,i=i+Math.imul(c,to)|0;var tS=(l+i|0)+((8191&(n=(n=n+Math.imul(c,ts)|0)+Math.imul(h,to)|0))<<13)|0;l=((o=o+Math.imul(h,ts)|0)+(n>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,i=Math.imul(T,F),n=(n=Math.imul(T,K))+Math.imul(U,F)|0,o=Math.imul(U,K),i=i+Math.imul(M,D)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(O,D)|0,o=o+Math.imul(O,$)|0,i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,Z)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(m,tr)|0,n=(n=n+Math.imul(m,ti)|0)+Math.imul(b,tr)|0,o=o+Math.imul(b,ti)|0,i=i+Math.imul(p,to)|0,n=(n=n+Math.imul(p,ts)|0)+Math.imul(g,to)|0,o=o+Math.imul(g,ts)|0,i=i+Math.imul(c,tu)|0;var tE=(l+i|0)+((8191&(n=(n=n+Math.imul(c,tl)|0)+Math.imul(h,tu)|0))<<13)|0;l=((o=o+Math.imul(h,tl)|0)+(n>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,i=Math.imul(P,F),n=(n=Math.imul(P,K))+Math.imul(C,F)|0,o=Math.imul(C,K),i=i+Math.imul(T,D)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(U,D)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(M,H)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,Z)|0,i=i+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(v,tr)|0,n=(n=n+Math.imul(v,ti)|0)+Math.imul(x,tr)|0,o=o+Math.imul(x,ti)|0,i=i+Math.imul(m,to)|0,n=(n=n+Math.imul(m,ts)|0)+Math.imul(b,to)|0,o=o+Math.imul(b,ts)|0,i=i+Math.imul(p,tu)|0,n=(n=n+Math.imul(p,tl)|0)+Math.imul(g,tu)|0,o=o+Math.imul(g,tl)|0,i=i+Math.imul(c,tc)|0;var tk=(l+i|0)+((8191&(n=(n=n+Math.imul(c,th)|0)+Math.imul(h,tc)|0))<<13)|0;l=((o=o+Math.imul(h,th)|0)+(n>>>13)|0)+(tk>>>26)|0,tk&=0x3ffffff,i=Math.imul(q,F),n=(n=Math.imul(q,K))+Math.imul(z,F)|0,o=Math.imul(z,K),i=i+Math.imul(P,D)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(C,D)|0,o=o+Math.imul(C,$)|0,i=i+Math.imul(T,H)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(U,H)|0,o=o+Math.imul(U,Z)|0,i=i+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,J)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(E,tr)|0,n=(n=n+Math.imul(E,ti)|0)+Math.imul(k,tr)|0,o=o+Math.imul(k,ti)|0,i=i+Math.imul(v,to)|0,n=(n=n+Math.imul(v,ts)|0)+Math.imul(x,to)|0,o=o+Math.imul(x,ts)|0,i=i+Math.imul(m,tu)|0,n=(n=n+Math.imul(m,tl)|0)+Math.imul(b,tu)|0,o=o+Math.imul(b,tl)|0,i=i+Math.imul(p,tc)|0,n=(n=n+Math.imul(p,th)|0)+Math.imul(g,tc)|0,o=o+Math.imul(g,th)|0,i=i+Math.imul(c,tp)|0;var tB=(l+i|0)+((8191&(n=(n=n+Math.imul(c,tg)|0)+Math.imul(h,tp)|0))<<13)|0;l=((o=o+Math.imul(h,tg)|0)+(n>>>13)|0)+(tB>>>26)|0,tB&=0x3ffffff,i=Math.imul(q,D),n=(n=Math.imul(q,$))+Math.imul(z,D)|0,o=Math.imul(z,$),i=i+Math.imul(P,H)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,Z)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(U,Y)|0,o=o+Math.imul(U,J)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(A,tr)|0,n=(n=n+Math.imul(A,ti)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,ti)|0,i=i+Math.imul(E,to)|0,n=(n=n+Math.imul(E,ts)|0)+Math.imul(k,to)|0,o=o+Math.imul(k,ts)|0,i=i+Math.imul(v,tu)|0,n=(n=n+Math.imul(v,tl)|0)+Math.imul(x,tu)|0,o=o+Math.imul(x,tl)|0,i=i+Math.imul(m,tc)|0,n=(n=n+Math.imul(m,th)|0)+Math.imul(b,tc)|0,o=o+Math.imul(b,th)|0,i=i+Math.imul(p,tp)|0;var tA=(l+i|0)+((8191&(n=(n=n+Math.imul(p,tg)|0)+Math.imul(g,tp)|0))<<13)|0;l=((o=o+Math.imul(g,tg)|0)+(n>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,i=Math.imul(q,H),n=(n=Math.imul(q,Z))+Math.imul(z,H)|0,o=Math.imul(z,Z),i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(M,tr)|0,n=(n=n+Math.imul(M,ti)|0)+Math.imul(O,tr)|0,o=o+Math.imul(O,ti)|0,i=i+Math.imul(A,to)|0,n=(n=n+Math.imul(A,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,i=i+Math.imul(E,tu)|0,n=(n=n+Math.imul(E,tl)|0)+Math.imul(k,tu)|0,o=o+Math.imul(k,tl)|0,i=i+Math.imul(v,tc)|0,n=(n=n+Math.imul(v,th)|0)+Math.imul(x,tc)|0,o=o+Math.imul(x,th)|0,i=i+Math.imul(m,tp)|0;var tI=(l+i|0)+((8191&(n=(n=n+Math.imul(m,tg)|0)+Math.imul(b,tp)|0))<<13)|0;l=((o=o+Math.imul(b,tg)|0)+(n>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,i=Math.imul(q,Y),n=(n=Math.imul(q,J))+Math.imul(z,Y)|0,o=Math.imul(z,J),i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,i=i+Math.imul(T,tr)|0,n=(n=n+Math.imul(T,ti)|0)+Math.imul(U,tr)|0,o=o+Math.imul(U,ti)|0,i=i+Math.imul(M,to)|0,n=(n=n+Math.imul(M,ts)|0)+Math.imul(O,to)|0,o=o+Math.imul(O,ts)|0,i=i+Math.imul(A,tu)|0,n=(n=n+Math.imul(A,tl)|0)+Math.imul(I,tu)|0,o=o+Math.imul(I,tl)|0,i=i+Math.imul(E,tc)|0,n=(n=n+Math.imul(E,th)|0)+Math.imul(k,tc)|0,o=o+Math.imul(k,th)|0,i=i+Math.imul(v,tp)|0;var t_=(l+i|0)+((8191&(n=(n=n+Math.imul(v,tg)|0)+Math.imul(x,tp)|0))<<13)|0;l=((o=o+Math.imul(x,tg)|0)+(n>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(z,Q)|0,o=Math.imul(z,tt),i=i+Math.imul(P,tr)|0,n=(n=n+Math.imul(P,ti)|0)+Math.imul(C,tr)|0,o=o+Math.imul(C,ti)|0,i=i+Math.imul(T,to)|0,n=(n=n+Math.imul(T,ts)|0)+Math.imul(U,to)|0,o=o+Math.imul(U,ts)|0,i=i+Math.imul(M,tu)|0,n=(n=n+Math.imul(M,tl)|0)+Math.imul(O,tu)|0,o=o+Math.imul(O,tl)|0,i=i+Math.imul(A,tc)|0,n=(n=n+Math.imul(A,th)|0)+Math.imul(I,tc)|0,o=o+Math.imul(I,th)|0,i=i+Math.imul(E,tp)|0;var tM=(l+i|0)+((8191&(n=(n=n+Math.imul(E,tg)|0)+Math.imul(k,tp)|0))<<13)|0;l=((o=o+Math.imul(k,tg)|0)+(n>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,i=Math.imul(q,tr),n=(n=Math.imul(q,ti))+Math.imul(z,tr)|0,o=Math.imul(z,ti),i=i+Math.imul(P,to)|0,n=(n=n+Math.imul(P,ts)|0)+Math.imul(C,to)|0,o=o+Math.imul(C,ts)|0,i=i+Math.imul(T,tu)|0,n=(n=n+Math.imul(T,tl)|0)+Math.imul(U,tu)|0,o=o+Math.imul(U,tl)|0,i=i+Math.imul(M,tc)|0,n=(n=n+Math.imul(M,th)|0)+Math.imul(O,tc)|0,o=o+Math.imul(O,th)|0,i=i+Math.imul(A,tp)|0;var tO=(l+i|0)+((8191&(n=(n=n+Math.imul(A,tg)|0)+Math.imul(I,tp)|0))<<13)|0;l=((o=o+Math.imul(I,tg)|0)+(n>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,i=Math.imul(q,to),n=(n=Math.imul(q,ts))+Math.imul(z,to)|0,o=Math.imul(z,ts),i=i+Math.imul(P,tu)|0,n=(n=n+Math.imul(P,tl)|0)+Math.imul(C,tu)|0,o=o+Math.imul(C,tl)|0,i=i+Math.imul(T,tc)|0,n=(n=n+Math.imul(T,th)|0)+Math.imul(U,tc)|0,o=o+Math.imul(U,th)|0,i=i+Math.imul(M,tp)|0;var tR=(l+i|0)+((8191&(n=(n=n+Math.imul(M,tg)|0)+Math.imul(O,tp)|0))<<13)|0;l=((o=o+Math.imul(O,tg)|0)+(n>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,i=Math.imul(q,tu),n=(n=Math.imul(q,tl))+Math.imul(z,tu)|0,o=Math.imul(z,tl),i=i+Math.imul(P,tc)|0,n=(n=n+Math.imul(P,th)|0)+Math.imul(C,tc)|0,o=o+Math.imul(C,th)|0,i=i+Math.imul(T,tp)|0;var tT=(l+i|0)+((8191&(n=(n=n+Math.imul(T,tg)|0)+Math.imul(U,tp)|0))<<13)|0;l=((o=o+Math.imul(U,tg)|0)+(n>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,i=Math.imul(q,tc),n=(n=Math.imul(q,th))+Math.imul(z,tc)|0,o=Math.imul(z,th),i=i+Math.imul(P,tp)|0;var tU=(l+i|0)+((8191&(n=(n=n+Math.imul(P,tg)|0)+Math.imul(C,tp)|0))<<13)|0;l=((o=o+Math.imul(C,tg)|0)+(n>>>13)|0)+(tU>>>26)|0,tU&=0x3ffffff,i=Math.imul(q,tp);var tL=(l+i|0)+((8191&(n=(n=Math.imul(q,tg))+Math.imul(z,tp)|0))<<13)|0;return l=((o=Math.imul(z,tg))+(n>>>13)|0)+(tL>>>26)|0,tL&=0x3ffffff,u[0]=ty,u[1]=tm,u[2]=tb,u[3]=tw,u[4]=tv,u[5]=tx,u[6]=tS,u[7]=tE,u[8]=tk,u[9]=tB,u[10]=tA,u[11]=tI,u[12]=t_,u[13]=tM,u[14]=tO,u[15]=tR,u[16]=tT,u[17]=tU,u[18]=tL,0!==l&&(u[19]=l,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=0x3ffffff&i,u=Math.min(o,e.length-1),l=Math.max(0,o-t.length+1);l<=u;l++){var f=o-l,c=(0|t.words[f])*(0|e.words[l]),h=0x3ffffff&c;s=s+(c/0x4000000|0)|0,a=0x3ffffff&(h=h+a|0),n+=(s=s+(h>>>26)|0)>>>26,s&=0x3ffffff}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function m(t,e){this.x=t,this.y=e}Math.imul||(g=p),n.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return 10===this.length&&10===t.length?r=g(this,t,e):i<63?r=p(this,t,e):r=y(this,t,e),r},m.prototype.makeRBT=function(t){for(var e=Array(t),r=n.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},m.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),l=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var c=u,h=l,d=0;d<s;d++){var p=r[f+d],g=i[f+d],y=r[f+d+s],m=i[f+d+s],b=c*y-h*m;m=c*m+h*y,y=b,r[f+d]=p+y,i[f+d]=g+m,r[f+d+s]=p-y,i[f+d+s]=g-m,d!==a&&(b=u*c-l*h,h=u*h+l*c,c=b)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},m.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=0x3ffffff&n,r=n<0x4000000?0:n/0x4000000|0}return t},m.prototype.convert13b=function(t,e,i,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)i[s]=0;r(0===o),r((-8192&o)==0)},m.prototype.stub=function(t){for(var e=Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=Array(i),a=Array(i),u=Array(i),l=Array(i),f=Array(i),c=Array(i),h=r.words;h.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,l,i),this.transform(s,o,a,u,i,n),this.transform(l,o,f,c,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,h,o,i,n),this.conjugate(h,o,i),this.normalize13b(h,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},n.prototype.mul=function(t){var e=new n(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=Array(this.length+t.length),y(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<0x4000000);for(var i=0,n=0;n<this.length;n++){var o=(0|this.words[n])*t,s=(0x3ffffff&o)+(0x3ffffff&i);i>>=26,i+=(o/0x4000000|0)+(s>>>26),this.words[n]=0x3ffffff&s}return 0!==i&&(this.words[n]=i,this.length++),this.length=0===t?1:this.length,e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=t.words[i]>>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var o=r.sqr();i<e.length;i++,o=o.sqr())0!==e[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,o=0x3ffffff>>>26-i<<26-i;if(0!==i){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<i;this.words[e]=u|s,s=a>>>26-i}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,e,i){r("number"==typeof t&&t>=0);var n=e?(e-e%26)/26:0,o=t%26,s=Math.min((t-o)/26,this.length),a=0x3ffffff^0x3ffffff>>>o<<o;if(n-=s,n=Math.max(0,n),i){for(var u=0;u<s;u++)i.words[u]=this.words[u];i.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return i&&0!==l&&(i.words[i.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;return!(this.length<=i)&&!!(this.words[i]&1<<e)},n.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==e&&i++,this.length=Math.min(i,this.length),0!==e&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>e<<e),0===this.length&&(this.words[0]=0,this.length=1),this._strip())},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.prototype.iaddn=function(t){return(r("number"==typeof t),r(t<0x4000000),t<0)?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=0x4000000;e++)this.words[e]-=0x4000000,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<0x4000000),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=0x4000000,this.words[e+1]-=1;return this._strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,e,i){var n,o,s=t.length+i;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+i])+a;var u=(0|t.words[n])*e;o-=0x3ffffff&u,a=(o>>26)-(u/0x4000000|0),this.words[n+i]=0x3ffffff&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=0x3ffffff&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=0x3ffffff&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r,i=this.length-t.length,o=this.clone(),s=t,a=0|s.words[s.length-1];0!=(i=26-this._countBits(a))&&(s=s.ushln(i),o.iushln(i),a=0|s.words[s.length-1]);var u=o.length-s.length;if("mod"!==e){(r=new n(null)).length=u+1,r.words=Array(r.length);for(var l=0;l<r.length;l++)r.words[l]=0}var f=o.clone()._ishlnsubmul(s,1,u);0===f.negative&&(o=f,r&&(r.words[u]=1));for(var c=u-1;c>=0;c--){var h=(0|o.words[s.length+c])*0x4000000+(0|o.words[s.length+c-1]);for(h=Math.min(h/a|0,0x3ffffff),o._ishlnsubmul(s,h,c);0!==o.negative;)h--,o.negative=0,o._ishlnsubmul(s,1,c),o.isZero()||(o.negative^=1);r&&(r.words[c]=h)}return r&&r._strip(),o._strip(),"div"!==e&&0!==i&&o.iushrn(i),{div:r||null,mod:o}},n.prototype.divmod=function(t,e,i){var o,s,a;return(r(!t.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e)},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0x4000000%t,n=0,o=this.length-1;o>=0;o--)n=(i*n+(0|this.words[o]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+0x4000000*i;this.words[n]=o/t|0,i=o%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var f=i.clone(),c=e.clone();!e.isZero();){for(var h=0,d=1;(e.words[0]&d)==0&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(c)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;(i.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a),s.isub(u)):(i.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(l)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,i=this,o=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var s=new n(1),a=new n(0),u=o.clone();i.cmpn(1)>0&&o.cmpn(1)>0;){for(var l=0,f=1;(i.words[0]&f)==0&&l<26;++l,f<<=1);if(l>0)for(i.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,h=1;(o.words[0]&h)==0&&c<26;++c,h<<=1);if(c>0)for(o.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);i.cmp(o)>=0?(i.isub(o),s.isub(a)):(o.isub(i),a.isub(s))}return 0>(e=0===i.cmpn(1)?s:a).cmpn(0)&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];a+=o,o=a>>>26,a&=0x3ffffff,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=0x3ffffff,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return -1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return -1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return -1===this.cmpn(t)},n.prototype.lt=function(t){return -1===this.cmp(t)},n.prototype.lten=function(t){return 0>=this.cmpn(t)},n.prototype.lte=function(t){return 0>=this.cmp(t)},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new k(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function B(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var t=new n(null);return t.words=Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n)var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},i(v,w),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9){t.words[0]=0,t.length=1;return}var n=t.words[9];for(i=10,e.words[e.length++]=4194303&n;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=0x3ffffff&e,e=64*i+(e/0x4000000|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(x,w),i(S,w),i(E,w),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=(0|t.words[r])*19+e,n=0x3ffffff&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){var e;if(b[t])return b[t];if("k256"===t)e=new v;else if("p224"===t)e=new x;else if("p192"===t)e=new S;else if("p25519"===t)e=new E;else throw Error("Unknown prime "+t);return b[t]=e,e},k.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){r((t.negative|e.negative)==0,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,l).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,o),h=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();r(y<p);var m=this.pow(c,new n(1).iushln(p-y-1));h=h.redMul(m),c=m.redSqr(),d=d.redMul(c),p=y}return h},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new n(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=Array(16);r[0]=new n(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var o=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var l=e.words[i],f=u-1;f>=0;f--){var c=l>>f&1;if(o!==r[0]&&(o=this.sqr(o)),0===c&&0===s){a=0;continue}s<<=1,s|=c,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)}u=26}return o},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new B(t)},i(B,k),B.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},B.prototype.convertFrom=function(t){var e=
1this.imod(t.mul(this.rinv));return e.red=null,e},B.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},B.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):0>o.cmpn(0)&&(s=o.iadd(this.m)),s._forceRed(this)},B.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,t.e)},42524,(t,e,r)=>{var i=t.r(43943),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=i:(o(i,r),r.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i.SlowBuffer(t)}},13227,(t,e,r)=>{"use strict";var i=t.r(42524).Buffer;e.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var o=t.charAt(n),s=o.charCodeAt(0);if(255!==e[s])throw TypeError(o+" is ambiguous");e[s]=n}var a=t.length,u=t.charAt(0),l=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function c(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return i.alloc(0);for(var r=0,n=0,o=0;t[r]===u;)n++,r++;for(var s=(t.length-r)*l+1>>>0,f=new Uint8Array(s);r<t.length;){var c=t.charCodeAt(r);if(c>255)return;var h=e[c];if(255===h)return;for(var d=0,p=s-1;(0!==h||d<o)&&-1!==p;p--,d++)h+=a*f[p]>>>0,f[p]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");o=d,r++}for(var g=s-o;g!==s&&0===f[g];)g++;var y=i.allocUnsafe(n+(s-g));y.fill(0,0,n);for(var m=n;g!==s;)y[m++]=f[g++];return y}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=i.from(e)),!i.isBuffer(e))throw TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,n=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var l=(s-o)*f+1>>>0,c=new Uint8Array(l);o!==s;){for(var h=e[o],d=0,p=l-1;(0!==h||d<n)&&-1!==p;p--,d++)h+=256*c[p]>>>0,c[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw Error("Non-zero carry");n=d,o++}for(var g=l-n;g!==l&&0===c[g];)g++;for(var y=u.repeat(r);g<l;++g)y+=t.charAt(c[g]);return y},decodeUnsafe:c,decode:function(t){var e=c(t);if(e)return e;throw Error("Non-base"+a+" character")}}}},35030,(t,e,r)=>{e.exports=t.r(13227)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},67034,(t,e,r)=>{var i={675:function(t,e){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return(r+i)*3/4-i},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],l=new n((s+a)*3/4-a),f=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],l[f++]=e>>16&255,l[f++]=e>>8&255,l[f++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[f++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[f++]=e>>8&255,l[f++]=255&e),l},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,o=[],s=0,a=i-n;s<a;s+=16383)o.push(function(t,e,i){for(var n,o=[],s=e;s<i;s+=3)n=(t[s]<<16&0xff0000)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(r[n>>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return o.join("")}(t,s,s+16383>a?a:s+16383));return 1===n?o.push(r[(e=t[i-1])>>2]+r[e<<4&63]+"=="):2===n&&o.push(r[(e=(t[i-2]<<8)+t[i-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),o.join("")};for(var r=[],i=[],n="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/",s=0,a=o.length;s<a;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var i=r===e?0:4-r%4;return[r,i]}i[45]=62,i[95]=63},72:function(t,e,r){"use strict";var i=r(675),n=r(783),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t){var i=t,n=e;if(("string"!=typeof n||""===n)&&(n="utf8"),!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);var o=0|d(i,n),u=s(o),l=u.write(i,n);return l!==o&&(u=u.slice(0,l)),u}if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(M(t,ArrayBuffer)||t&&M(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(M(t,SharedArrayBuffer)||t&&M(t.buffer,SharedArrayBuffer)))return function(t,e,r){var i;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),a.prototype),i}(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var f=t.valueOf&&t.valueOf();if(null!=f&&f!==t)return a.from(f,e,r);var p=function(t){if(a.isBuffer(t)){var e=0|h(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?s(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return l(t),s(t<0?0:0|h(t))}function c(t){for(var e=t.length<0?0:0|h(t.length),r=s(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}e.Buffer=a,e.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(l(t),t<=0)?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)},a.allocUnsafe=function(t){return f(t)},a.allocUnsafeSlow=function(t){return f(t)};function h(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||M(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(t).length;default:if(n)return i?-1:B(t).length;e=(""+e).toLowerCase(),n=!0}}function p(t,e,r){var n,o,s,a=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;++o)n+=O[t[o]];return n}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}(this,e,r);case"latin1":case"binary":return function(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}(this,e,r);case"base64":return n=this,o=e,s=r,0===o&&s===n.length?i.fromByteArray(n):i.fromByteArray(n.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}(this,e,r);default:if(a)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),a=!0}}function g(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){var o;if(0===t.length)return -1;if("string"==typeof r?(i=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(n)return -1;else r=t.length-1;else if(r<0)if(!n)return -1;else r=0;
vendor: 13,054 bytes, line 1
1if("string"==typeof e&&(e=a.from(e,i)),a.isBuffer(e))return 0===e.length?-1:m(t,e,r,i,n);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(n)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return m(t,[e],r,i,n)}throw TypeError("val must be string, number or Buffer")}function m(t,e,r,i,n){var o,s=1,a=t.length,u=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return -1;s=2,a/=2,u/=2,r/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var f=-1;for(o=r;o<a;o++)if(l(t,o)===l(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else -1!==f&&(o-=o-f),f=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var c=!0,h=0;h<u;h++)if(l(t,o+h)!==l(e,h)){c=!1;break}if(c)return o}return -1}a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(M(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),M(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:+(i<r)},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;var r,i=a.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var o=t[r];if(M(o,Uint8Array)&&(o=a.from(o)),!a.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(i,n),n+=o.length}return i},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(t,e,r,i,n){if(M(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,n>>>=0,this===t)return 0;for(var o=n-i,s=r-e,u=Math.min(o,s),l=this.slice(i,n),f=t.slice(e,r),c=0;c<u;++c)if(l[c]!==f[c]){o=l[c],s=f[c];break}return o<s?-1:+(s<o)},a.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)};function b(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o,s,a,u,l=t[n],f=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:(192&(o=t[n+1]))==128&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=t[n+1],s=t[n+2],(192&o)==128&&(192&s)==128&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=c}var h=i,d=h.length;if(d<=4096)return String.fromCharCode.apply(String,h);for(var p="",g=0;g<d;)p+=String.fromCharCode.apply(String,h.slice(g,g+=4096));return p}function w(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function v(t,e,r,i,n,o){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw RangeError('"value" argument is out of bounds');if(r+i>t.length)throw RangeError("Index out of range")}function x(t,e,r,i,n,o){if(r+i>t.length||r<0)throw RangeError("Index out of range")}function S(t,e,r,i,o){return e*=1,r>>>=0,o||x(t,e,r,4,34028234663852886e22,-34028234663852886e22),n.write(t,e,r,i,23,4),r+4}function E(t,e,r,i,o){return e*=1,r>>>=0,o||x(t,e,r,8,17976931348623157e292,-17976931348623157e292),n.write(t,e,r,i,52,8),r+8}a.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var n,o,s,a,u,l,f,c,h=this.length-e;if((void 0===r||r>h)&&(r=h),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var d=!1;;)switch(i){case"hex":return function(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=e.length;i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a,u=parseInt(e.substr(2*s,2),16);if((a=u)!=a)break;t[r+s]=u}return s}(this,t,e,r);case"utf8":case"utf-8":return n=e,o=r,_(B(t,this.length-n),this,n,o);case"ascii":return s=e,a=r,_(A(t),this,s,a);case"latin1":case"binary":return function(t,e,r,i){return _(A(e),t,r,i)}(this,t,e,r);case"base64":return u=e,l=r,_(I(t),this,u,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f=e,c=r,_(function(t,e){for(var r,i,n=[],o=0;o<t.length&&!((e-=2)<0);++o)i=(r=t.charCodeAt(o))>>8,n.push(r%256),n.push(i);return n}(t,this.length-f),this,f,c);default:if(d)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var i=this.subarray(t,e);return Object.setPrototypeOf(i,a.prototype),i},a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i},a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},a.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return(t>>>=0,e||w(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;v(this,t,e,r,n,0)}var o=1,s=0;for(this[e]=255&t;++s<r&&(o*=256);)this[e+s]=t/o&255;return e+r},a.prototype.writeUIntBE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;v(this,t,e,r,n,0)}var o=r-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,i){if(t*=1,e>>>=0,!i){var n=Math.pow(2,8*r-1);v(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s|0)-a&255;return e+r},a.prototype.writeIntBE=function(t,e,r,i){if(t*=1,e>>>=0,!i){var n=Math.pow(2,8*r-1);v(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s|0)-a&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return S(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return S(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return E(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return E(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,i){if(!a.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n=i-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,i);else if(this===t&&r<e&&e<i)for(var o=n-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,i),e);return n},a.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===t.length){var n,o=t.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{var s=a.isBuffer(t)?t:a.from(t,i),u=s.length;
1if(0===u)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=s[n%u]}return this};var k=/[^+/0-9A-Za-z-_]/g;function B(t,e){e=e||1/0;for(var r,i=t.length,n=null,o=[],s=0;s<i;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319||s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function A(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function I(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function _(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length)&&!(n>=t.length);++n)e[n+r]=t[n];return n}function M(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var O=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)e[i+n]=t[r]+t[n];return e}()},783:function(t,e){e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,l=u>>1,f=-7,c=r?n-1:0,h=r?-1:1,d=t[e+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[e+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=l}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,u,l=8*o-n-1,f=(1<<l)-1,c=f>>1,h=5960464477539062e-23*(23===n),d=i?0:o-1,p=i?1:-1,g=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+c>=1?e+=h/u:e+=h*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*u-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<<n|a,l+=n;l>0;t[r+d]=255&s,d+=p,s/=256,l-=8);t[r+d-p]|=128*g}}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={exports:{}},s=!0;try{i[t](r,r.exports,o),s=!1}finally{s&&delete n[t]}return r.exports}o.ab="/ROOT/node_modules/next/dist/compiled/buffer/",e.exports=o(72)},17944,(t,e,r)=>{"use strict";var i=t.r(42524).Buffer;e.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var o=t.charAt(n),s=o.charCodeAt(0);if(255!==e[s])throw TypeError(o+" is ambiguous");e[s]=n}var a=t.length,u=t.charAt(0),l=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function c(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return i.alloc(0);for(var r=0,n=0,o=0;t[r]===u;)n++,r++;for(var s=(t.length-r)*l+1>>>0,f=new Uint8Array(s);r<t.length;){var c=t.charCodeAt(r);if(c>255)return;var h=e[c];if(255===h)return;for(var d=0,p=s-1;(0!==h||d<o)&&-1!==p;p--,d++)h+=a*f[p]>>>0,f[p]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");o=d,r++}for(var g=s-o;g!==s&&0===f[g];)g++;var y=i.allocUnsafe(n+(s-g));y.fill(0,0,n);for(var m=n;g!==s;)y[m++]=f[g++];return y}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=i.from(e)),!i.isBuffer(e))throw TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,n=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var l=(s-o)*f+1>>>0,c=new Uint8Array(l);o!==s;){for(var h=e[o],d=0,p=l-1;(0!==h||d<n)&&-1!==p;p--,d++)h+=256*c[p]>>>0,c[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw Error("Non-zero carry");n=d,o++}for(var g=l-n;g!==l&&0===c[g];)g++;for(var y=u.repeat(r);g<l;++g)y+=t.charAt(c[g]);return y},decodeUnsafe:c,decode:function(t){var e=c(t);if(e)return e;throw Error("Non-base"+a+" character")}}}},1262,(t,e,r)=>{e.exports=t.r(17944)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},72766,(t,e,r)=>{"use strict";function i(t,e,r){return e<=t&&t<=r}function n(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function o(t){this.tokens=[].slice.call(t)}function s(t,e){if(t)throw TypeError("Decoder error");return e||65533}
vendor: 4,303 bytes, line 1
1o.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.push(t.shift());else this.tokens.push(t)}};var a="utf-8";function u(t,e){if(!(this instanceof u))return new u(t,e);if((t=void 0!==t?String(t).toLowerCase():a)!==a)throw Error("Encoding not supported. Only utf-8 is supported");e=n(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function l(t,e){if(!(this instanceof l))return new l(t,e);if((t=void 0!==t?String(t).toLowerCase():a)!==a)throw Error("Encoding not supported. Only utf-8 is supported");e=n(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function f(t){var e=t.fatal,r=0,n=0,o=0,a=128,u=191;this.handler=function(t,l){if(-1===l&&0!==o)return o=0,s(e);if(-1===l)return -1;if(0===o){if(i(l,0,127))return l;if(i(l,194,223))o=1,r=l-192;else if(i(l,224,239))224===l&&(a=160),237===l&&(u=159),o=2,r=l-224;else{if(!i(l,240,244))return s(e);240===l&&(a=144),244===l&&(u=143),o=3,r=l-240}return r<<=6*o,null}if(!i(l,a,u))return r=o=n=0,a=128,u=191,t.prepend(l),s(e);if(a=128,u=191,n+=1,r+=l-128<<6*(o-n),n!==o)return null;var f=r;return r=o=n=0,f}}function c(t){t.fatal,this.handler=function(t,e){if(-1===e)return -1;if(i(e,0,127))return e;i(e,128,2047)?(r=1,n=192):i(e,2048,65535)?(r=2,n=224):i(e,65536,1114111)&&(r=3,n=240);for(var r,n,o=[(e>>6*r)+n];r>0;){var s=e>>6*(r-1);o.push(128|63&s),r-=1}return o}}u.prototype={decode:function(t,e){r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=n(e),this._streaming||(this._decoder=new f({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var r,i,s=new o(r),a=[];!s.endOfStream()&&-1!==(i=this._decoder.handler(s,s.read()));)null!==i&&(Array.isArray(i)?a.push.apply(a,i):a.push(i));if(!this._streaming){do{if(-1===(i=this._decoder.handler(s,s.read())))break;if(null===i)continue;Array.isArray(i)?a.push.apply(a,i):a.push(i)}while(!s.endOfStream())this._decoder=null}!a.length||-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0);for(var u="",l=0;l<a.length;++l){var c=a[l];c<=65535?u+=String.fromCharCode(c):(c-=65536,u+=String.fromCharCode((c>>10)+55296,(1023&c)+56320))}return u}},l.prototype={encode:function(t,e){t=t?String(t):"",e=n(e),this._streaming||(this._encoder=new c(this._options)),this._streaming=!!e.stream;for(var r,i=[],s=new o(function(t){for(var e=String(t),r=e.length,i=0,n=[];i<r;){var o=e.charCodeAt(i);if(o<55296||o>57343)n.push(o);else if(56320<=o&&o<=57343)n.push(65533);else if(55296<=o&&o<=56319)if(i===r-1)n.push(65533);else{var s=t.charCodeAt(i+1);if(56320<=s&&s<=57343){var a=1023&o,u=1023&s;n.push(65536+(a<<10)+u),i+=1}else n.push(65533)}i+=1}return n}(t));!s.endOfStream()&&-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?i.push.apply(i,r):i.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?i.push.apply(i,r):i.push(r);this._encoder=null}return new Uint8Array(i)}},r.TextEncoder=l,r.TextDecoder=u},54119,(t,e,r)=>{"use strict";var i=t.i(67034),n=t.e&&t.e.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),o=t.e&&t.e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=t.e&&t.e.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;
1a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},a=t.e&&t.e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e},u=t.e&&t.e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.deserializeUnchecked=r.deserialize=r.serialize=r.BinaryReader=r.BinaryWriter=r.BorshError=r.baseDecode=r.baseEncode=void 0;let l=u(t.r(59341)),f=u(t.r(1262)),c=a(t.r(72766)),h=new("function"!=typeof TextDecoder?c.TextDecoder:TextDecoder)("utf-8",{fatal:!0});r.baseEncode=function(t){return"string"==typeof t&&(t=i.Buffer.from(t,"utf8")),f.default.encode(i.Buffer.from(t))},r.baseDecode=function(t){return i.Buffer.from(f.default.decode(t))};class d extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}r.BorshError=d;class p{constructor(){this.buf=i.Buffer.alloc(1024),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=i.Buffer.concat([this.buf,i.Buffer.alloc(1024)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new l.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new l.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new l.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new l.default(t).toArray("le",64)))}writeBuffer(t){this.buf=i.Buffer.concat([i.Buffer.from(this.buf.subarray(0,this.length)),t,i.Buffer.alloc(1024)]),this.length+=t.length}writeString(t){this.maybeResize();let e=i.Buffer.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(i.Buffer.from(t))}writeArray(t,e){for(let r of(this.maybeResize(),this.writeU32(t.length),t))this.maybeResize(),e(r)}toArray(){return this.buf.subarray(0,this.length)}}function g(t,e,r){let i=r.value;r.value=function(...t){try{return i.apply(this,t)}catch(t){if(t instanceof RangeError&&["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t.code)>=0)throw new d("Reached the end of buffer when deserializing");throw t}}}r.BinaryWriter=p;class y{constructor(t){this.buf=t,this.offset=0}readU8(){let t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){let t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){let t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){let t=this.readBuffer(8);return new l.default(t,"le")}readU128(){let t=this.readBuffer(16);return new l.default(t,"le")}readU256(){let t=this.readBuffer(32);return new l.default(t,"le")}readU512(){let t=this.readBuffer(64);return new l.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new d(`Expected buffer length ${t} isn't within bounds`);let e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){let t=this.readU32(),e=this.readBuffer(t);try{return h.decode(e)}catch(t){throw new d(`Error decoding UTF-8 string: ${t}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){let e=this.readU32(),r=[];for(let i=0;i<e;++i)r.push(t());return r}}function m(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e,r,i,n){try{if("string"==typeof i)n[`write${m(i)}`](r);else if(i instanceof Array)if("number"==typeof i[0]){if(r.length!==i[0])throw new d(`Expecting byte array of length ${i[0]}, but got ${r.length} bytes`);n.writeFixedArray(r)}else if(2===i.length&&"number"==typeof i[1]){if(r.length!==i[1])throw new d(`Expecting byte array of length ${i[1]}, but got ${r.length} bytes`);for(let e=0;e<i[1];e++)b(t,null,r[e],i[0],n)}else n.writeArray(r,r=>{b(t,e,r,i[0],n)});else if(void 0!==i.kind)switch(i.kind){case"option":null==r?n.writeU8(0):(n.writeU8(1),b(t,e,r,i.type,n));break;case"map":n.writeU32(r.size),r.forEach((r,o)=>{b(t,e,o,i.key,n),b(t,e,r,i.value,n)});break;default:throw new d(`FieldType ${i} unrecognized`)}else w(t,r,n)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function w(t,e,r){if("function"==typeof e.borshSerialize)return void e.borshSerialize(r);let i=t.get(e.constructor);if(!i)throw new d(`Class ${e.constructor.name} is missing in schema`);if("struct"===i.kind)i.fields.map(([i,n])=>{b(t,i,e[i],n,r)});else if("enum"===i.kind){let n=e[i.field];for(let o=0;o<i.values.length;++o){let[s,a]=i.values[o];if(s===n){r.writeU8(o),b(t,s,e[s],a,r);break}}}else throw new d(`Unexpected schema kind: ${i.kind} for ${e.constructor.name}`)}function v(t,e,r,i){try{if("string"==typeof r)return i[`read${m(r)}`]();if(r instanceof Array)if("number"==typeof r[0])return i.readFixedArray(r[0]);else{if("number"!=typeof r[1])return i.readArray(()=>v(t,e,r[0],i));let n=[];for(let e=0;e<r[1];e++)n.push(v(t,null,r[0],i));return n}if("option"===r.kind){if(i.readU8())return v(t,e,r.type,i);return}if("map"===r.kind){let n=new Map,o=i.readU32();for(let s=0;s<o;s++){let o=v(t,e,r.key,i),s=v(t,e,r.value,i);n.set(o,s)}return n}return x(t,r,i)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function x(t,e,r){if("function"==typeof e.borshDeserialize)return e.borshDeserialize(r);let i=t.get(e);if(!i)throw new d(`Class ${e.name} is missing in schema`);if("struct"===i.kind){let i={};for(let[n,o]of t.get(e).fields)i[n]=v(t,n,o,r);return new e(i)}if("enum"===i.kind){let n=r.readU8();if(n>
1=i.values.length)throw new d(`Enum index: ${n} is out of range`);let[o,s]=i.values[n],a=v(t,o,s,r);return new e({[o]:a})}throw new d(`Unexpected schema kind: ${i.kind} for ${e.constructor.name}`)}s([g],y.prototype,"readU8",null),s([g],y.prototype,"readU16",null),s([g],y.prototype,"readU32",null),s([g],y.prototype,"readU64",null),s([g],y.prototype,"readU128",null),s([g],y.prototype,"readU256",null),s([g],y.prototype,"readU512",null),s([g],y.prototype,"readString",null),s([g],y.prototype,"readFixedArray",null),s([g],y.prototype,"readArray",null),r.BinaryReader=y,r.serialize=function(t,e,r=p){let i=new r;return w(t,e,i),i.toArray()},r.deserialize=function(t,e,r,i=y){let n=new i(r),o=x(t,e,n);if(n.offset<r.length)throw new d(`Unexpected ${r.length-n.offset} bytes after deserialized data`);return o},r.deserializeUnchecked=function(t,e,r,i=y){return x(t,e,new i(r))}},44610,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.s16=r.s8=r.nu64be=r.u48be=r.u40be=r.u32be=r.u24be=r.u16be=r.nu64=r.u48=r.u40=r.u32=r.u24=r.u16=r.u8=r.offset=r.greedy=r.Constant=r.UTF8=r.CString=r.Blob=r.Boolean=r.BitField=r.BitStructure=r.VariantLayout=r.Union=r.UnionLayoutDiscriminator=r.UnionDiscriminator=r.Structure=r.Sequence=r.DoubleBE=r.Double=r.FloatBE=r.Float=r.NearInt64BE=r.NearInt64=r.NearUInt64BE=r.NearUInt64=r.IntBE=r.Int=r.UIntBE=r.UInt=r.OffsetLayout=r.GreedyCount=r.ExternalLayout=r.bindConstructorLayout=r.nameWithProperty=r.Layout=r.uint8ArrayToBuffer=r.checkUint8Array=void 0,r.constant=r.utf8=r.cstr=r.blob=r.unionLayoutDiscriminator=r.union=r.seq=r.bits=r.struct=r.f64be=r.f64=r.f32be=r.f32=r.ns64be=r.s48be=r.s40be=r.s32be=r.s24be=r.s16be=r.ns64=r.s48=r.s40=r.s32=r.s24=void 0;let i=t.r(43943);function n(t){if(!(t instanceof Uint8Array))throw TypeError("b must be a Uint8Array")}function o(t){return n(t),i.Buffer.from(t.buffer,t.byteOffset,t.length)}r.checkUint8Array=n,r.uint8ArrayToBuffer=o;class s{constructor(t,e){if(!Number.isInteger(t))throw TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw RangeError("indeterminate span");return this.span}replicate(t){let e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}}function a(t,e){return e.property?t+"["+e.property+"]":t}r.Layout=s,r.nameWithProperty=a,r.bindConstructorLayout=function(t,e){if("function"!=typeof t)throw TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(t,"layout_"))throw Error("Class is already bound to a layout");if(!(e&&e instanceof s))throw TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw Error("layout is already bound to a constructor");t.layout_=e,e.boundConstructor_=t,e.makeDestinationObject=()=>new t,Object.defineProperty(t.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(t,"decode",{value:(t,r)=>e.decode(t,r),writable:!0})};class u extends s{isCount(){throw Error("ExternalLayout is abstract")}}r.ExternalLayout=u;class l extends u{constructor(t=1,e){if(!Number.isInteger(t)||0>=t)throw TypeError("elementSpan must be a (positive) integer");super(-1,e),this.elementSpan=t}isCount(){return!0}decode(t,e=0){return n(t),Math.floor((t.length-e)/this.elementSpan)}encode(t,e,r){return 0}}r.GreedyCount=l;class f extends u{constructor(t,e=0,r){if(!(t instanceof s))throw TypeError("layout must be a Layout");if(!Number.isInteger(e))throw TypeError("offset must be integer or undefined");super(t.span,r||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof c||this.layout instanceof h}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,r=0){return this.layout.encode(t,e,r+this.offset)}}r.OffsetLayout=f;class c extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntLE(t,r,this.span),this.span}}r.UInt=c;class h extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntBE(t,r,this.span),this.span}}r.UIntBE=h;class d extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeIntLE(t,r,this.span),this.span}}r.Int=d;class p extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeIntBE(t,r,this.span),this.span}}function g(t){let e=Math.floor(t/0x100000000);return{hi32:e,lo32:t-0x100000000*e}}function y(t,e){return 0x100000000*t+e}r.IntBE=p;class m extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),i=r.readUInt32LE(e);return y(r.readUInt32LE(e+4),i)}encode(t,e,r=0){let i=g(t),n=o(e);return n.writeUInt32LE(i.lo32,r),n.writeUInt32LE(i.hi32,r+4),8}}r.NearUInt64=m;class b extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t);return y(r.readUInt32BE(e),r.readUInt32BE(e+4))}encode(t,e,r=0){let i=g(t),n=o(e);return n.writeUInt32BE(i.hi32,r),n.writeUInt32BE(i.lo32,r+4),8}}r.NearUInt64BE=b;class w extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),i=r.readUInt32LE(e);return y(r.readInt32LE(e+4),i)}encode(t,e,r=0){let i=g(t),n=o(e);return n.writeUInt32LE(i.lo32,r),n.writeInt32LE(i.hi32,r+4),8}}r.NearInt64=w;class v extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t);return y(r.readInt32BE(e),r.readUInt32BE(e+4))}encode(t,e,r=0){let i=g(t),n=o(e);return n.writeInt32BE(i.hi32,r),n.writeUInt32BE(i.lo32,r+4),8}}r.NearInt64BE=v;class x extends s{constructor(t){super(4,t)}decode(t,e=0){return o(t).readFloatLE(e)}encode(t,e,r=0){return o(e).writeFloatLE(t,r),4}}r.Float=x;class S extends s{constructor(t){super(4,t)}decode(t,e=0){return o(t).readFloatBE(e)}encode(t,e,r=0){return o(e).writeFloatBE(t,r),4}}r.FloatBE=S;class E extends s{constructor(t){super(8,t)}decode(t,e=0){return o(t).readDoubleLE(e)}encode(t,e,r=0){return o(e).writeDoubleLE(t,r),8}}r.Double=E;class k extends s{constructor(t){super(8,t)}decode(t,e=0){return o(t).readDoubleBE(e)}encode(t,e,r=0){return o(e).writeDoubleBE(t,r),8}}r.DoubleBE=k;class B extends s{constructor(t,e,r){if(!(t instanceof s))throw TypeError("elementLayout must be a Layout");if(!(e instanceof u&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let i=-1;e instanceof u||!(0<t.span)||(i=e*t.span),super(i,r),this.elementLayout=t,this.count=e}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0,i=this.count;if(i instanceof u&&(i=i.decode(t,e)),0<this.elementLayout.span)r=i*this.elementLayout.span;else{let n=0;for(;n<i;)r+=this.elementLayout.getSpan(t,e+r),++n}return r}decode(t,e=0){let r=[],i=0,n=this.count;for(n instanceof u&&(n=n.decode(t,e));i<n;)r.push(this.elementLayout.decode(t,e)),e+=this.elementLayout.getSpan(t,e),i+=1;return r}encode(t,e,r=0){let i=this.elementLayout,n=t.reduce((t,n)=>t+i.encode(n,e,r+t),0);return this.count instanceof u&&this.count.encode(t.length,e,r),n}}r.Sequence=B;class A extends s{constructor(t,e,r){if(!(Array.isArray(t)&&t.reduce((t,e)=>t&&e instanceof s,!0)))throw TypeError("fields must be array of Layout instances");for(const i of("boolean"==typeof e&&void 0===r&&(r=e,e=void 0),t))if(0>
1i.span&&void 0===i.property)throw Error("fields cannot contain unnamed variable-length layout");let i=-1;try{i=t.reduce((t,e)=>t+e.getSpan(),0)}catch(t){}super(i,e),this.fields=t,this.decodePrefixes=!!r}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((r,i)=>{let n=i.getSpan(t,e);return e+=n,r+n},0)}catch(t){throw RangeError("indeterminate span")}return r}decode(t,e=0){n(t);let r=this.makeDestinationObject();for(let i of this.fields)if(void 0!==i.property&&(r[i.property]=i.decode(t,e)),e+=i.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return r}encode(t,e,r=0){let i=r,n=0,o=0;for(let i of this.fields){let s=i.span;if(o=0<s?s:0,void 0!==i.property){let n=t[i.property];void 0!==n&&(o=i.encode(n,e,r),0>s&&(s=i.getSpan(e,r)))}n=r,r+=s}return n+o-i}fromArray(t){let e=this.makeDestinationObject();for(let r of this.fields)void 0!==r.property&&0<t.length&&(e[r.property]=t.shift());return e}layoutFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}offsetOf(t){if("string"!=typeof t)throw TypeError("property must be string");let e=0;for(let r of this.fields){if(r.property===t)return e;0>r.span?e=-1:0<=e&&(e+=r.span)}}}r.Structure=A;class I{constructor(t){this.property=t}decode(t,e){throw Error("UnionDiscriminator is abstract")}encode(t,e,r){throw Error("UnionDiscriminator is abstract")}}r.UnionDiscriminator=I;class _ extends I{constructor(t,e){if(!(t instanceof u&&t.isCount()))throw TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,r){return this.layout.encode(t,e,r)}}r.UnionLayoutDiscriminator=_;class M extends s{constructor(t,e,r){let i;if(t instanceof c||t instanceof h)i=new _(new f(t));else if(t instanceof u&&t.isCount())i=new _(t);else if(t instanceof I)i=t;else throw TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===e&&(e=null),!(null===e||e instanceof s))throw TypeError("defaultLayout must be null or a Layout");if(null!==e){if(0>e.span)throw Error("defaultLayout must have constant span");void 0===e.property&&(e=e.replicate("content"))}let n=-1;e&&0<=(n=e.span)&&(t instanceof c||t instanceof h)&&(n+=i.layout.span),super(n,r),this.discriminator=i,this.usesPrefixDiscriminator=t instanceof c||t instanceof h,this.defaultLayout=e,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(t){return o(t)},this.configGetSourceVariant=function(t){o=t.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;let r=this.getVariant(t,e);if(!r)throw Error("unable to determine span for unrecognized variant");return r.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;let e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(let e in this.registry){let r=this.registry[e];if(r.property&&Object.prototype.hasOwnProperty.call(t,r.property))return r}throw Error("unable to infer src variant")}decode(t,e=0){let r,i=this.discriminator,n=i.decode(t,e),o=this.registry[n];if(void 0===o){let o=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=i.layout.span),(r=this.makeDestinationObject())[i.property]=n,r[o.property]=o.decode(t,e+s)}else r=o.decode(t,e);return r}encode(t,e,r=0){let i=this.getSourceVariant(t);if(void 0===i){let i=this.discriminator,n=this.defaultLayout,o=0;return this.usesPrefixDiscriminator&&(o=i.layout.span),i.encode(t[i.property],e,r),o+n.encode(t[n.property],e,r+o)}return i.encode(t,e,r)}addVariant(t,e,r){let i=new O(this,t,e,r);return this.registry[t]=i,i}getVariant(t,e=0){let r;return r=t instanceof Uint8Array?this.discriminator.decode(t,e):t,this.registry[r]}}r.Union=M;class O extends s{constructor(t,e,r,i){if(!(t instanceof M))throw TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw TypeError("variant must be a (non-negative) integer");if("string"==typeof r&&void 0===i&&(i=r,r=null),r){if(!(r instanceof s))throw TypeError("layout must be a Layout");
1if(null!==t.defaultLayout&&0<=r.span&&r.span>t.defaultLayout.span)throw Error("variant span exceeds span of containing union");if("string"!=typeof i)throw TypeError("variant must have a String property")}let n=t.span;0>t.span&&0<=(n=r?r.span:0)&&t.usesPrefixDiscriminator&&(n+=t.discriminator.layout.span),super(n,i),this.union=t,this.variant=e,this.layout=r||null}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let i=0;return this.layout&&(i=this.layout.getSpan(t,e+r)),r+i}decode(t,e=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw Error("variant mismatch");let i=0;return this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(t,e+i):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(t,e,r=0){let i=0;if(this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,r);let n=i;if(this.layout&&(this.layout.encode(t[this.property],e,r+i),n+=this.layout.getSpan(e,r+i),0<=this.union.span&&n>this.union.span))throw Error("encoded variant overruns containing union");return n}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}function R(t){return 0>t&&(t+=0x100000000),t}r.VariantLayout=O;class T extends s{constructor(t,e,r){if(!(t instanceof c||t instanceof h))throw TypeError("word must be a UInt or UIntBE layout");if("string"==typeof e&&void 0===r&&(r=e,e=!1),4<t.span)throw RangeError("word cannot exceed 32 bits");super(t.span,r),this.word=t,this.msb=!!e,this.fields=[];let i=0;this._packedSetValue=function(t){return i=R(t),this},this._packedGetValue=function(){return i}}decode(t,e=0){let r=this.makeDestinationObject(),i=this.word.decode(t,e);for(let e of(this._packedSetValue(i),this.fields))void 0!==e.property&&(r[e.property]=e.decode(t));return r}encode(t,e,r=0){let i=this.word.decode(e,r);for(let e of(this._packedSetValue(i),this.fields))if(void 0!==e.property){let r=t[e.property];void 0!==r&&e.encode(r)}return this.word.encode(this._packedGetValue(),e,r)}addField(t,e){let r=new U(this,t,e);return this.fields.push(r),r}addBoolean(t){let e=new L(this,t);return this.fields.push(e),e}fieldFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}}r.BitStructure=T;class U{constructor(t,e,r){if(!(t instanceof T))throw TypeError("container must be a BitStructure");if(!Number.isInteger(e)||0>=e)throw TypeError("bits must be positive integer");const i=8*t.span,n=t.fields.reduce((t,e)=>t+e.bits,0);if(e+n>i)throw Error("bits too long for span remainder ("+(i-n)+" of "+i+" remain)");this.container=t,this.bits=e,this.valueMask=(1<<e)-1,32===e&&(this.valueMask=0xffffffff),this.start=n,this.container.msb&&(this.start=i-n-e),this.wordMask=R(this.valueMask<<this.start),this.property=r}decode(t,e){return R(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(t){if("number"!=typeof t||!Number.isInteger(t)||t!==R(t&this.valueMask))throw TypeError(a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),r=R(t<<this.start);this.container._packedSetValue(R(e&~this.wordMask)|r)}}r.BitField=U;class L extends U{constructor(t,e){super(t,1,e)}decode(t,e){return!!super.decode(t,e)}encode(t){"boolean"==typeof t&&(t*=1),super.encode(t)}}r.Boolean=L;class P extends s{constructor(t,e){if(!(t instanceof u&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;t instanceof u||(r=t),super(r,e),this.length=t}getSpan(t,e){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),r}decode(t,e=0){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),o(t).slice(e,e+r)}encode(t,e,r){let i=this.length;if(this.length instanceof u&&(i=t.length),!(t instanceof Uint8Array&&i===t.length))throw TypeError(a("Blob.encode",this)+" requires (length "+i+") Uint8Array as src");if(r+i>e.length)throw RangeError("encoding overruns Uint8Array");let n=o(t);return o(e).write(n.toString("hex"),r,i,"hex"),this.length instanceof u&&this.length.encode(i,e,r),i}}r.Blob=P;class C extends s{constructor(t){super(-1,t)}getSpan(t,e=0){n(t);let r=e;for(;r<t.length&&0!==t[r];)r+=1;return 1+r-e}decode(t,e=0){let r=this.getSpan(t,e);return o(t).slice(e,e+r-1).toString("utf-8")}encode(t,e,r=0){"string"!=typeof t&&(t=String(t));let n=i.Buffer.from(t,"utf8"),s=n.length;if(r+s>e.length)throw RangeError("encoding overruns Buffer");let a=o(e);return n.copy(a,r),a[r+s]=0,s+1}}r.CString=C;class N extends s{constructor(t,e){if("string"==typeof t&&void 0===e&&(e=t,t=void 0),void 0===t)t=-1;else if(!Number.isInteger(t))throw TypeError("maxSpan must be an integer");super(-1,e),this.maxSpan=t}getSpan(t,e=0){return n(t),t.length-e}decode(t,e=0){let r=this.getSpan(t,e);if(0<=this.maxSpan&&this.maxSpan<r)throw RangeError("text length exceeds maxSpan");return o(t).slice(e,e+r).toString("utf-8")}encode(t,e,r=0){"string"!=typeof t&&(t=String(t));let n=i.Buffer.from(t,"utf8"),s=n.length;if(0<=this.maxSpan&&this.maxSpan<s)throw RangeError("text length exceeds maxSpan");if(r+s>e.length)throw RangeError("encoding overruns Buffer");return n.copy(o(e),r),s}}r.UTF8=N;class q extends s{constructor(t,e){super(0,e),this.value=t}decode(t,e){return this.value}encode(t,e,r){return 0}}r.Constant=q,r.greedy=(t,e)=>new l(t,e),r.offset=(t,e,r)=>new f(t,e,r),r.u8=t=>new c(1,t),r.u16=t=>new c(2,t),r.u24=t=>new c(3,t),r.u32=t=>new c(4,t),r.u40=t=>new c(5,t),r.u48=t=>new c(6,t),r.nu64=t=>new m(t),r.u16be=t=>new h(2,t),r.u24be=t=>new h(3,t),r.u32be=t=>new h(4,t),r.u40be=t=>new h(5,t),r.u48be=t=>new h(6,t),r.nu64be=t=>new b(t),r.s8=t=>new d(1,t),r.s16=t=>new d(2,t),r.s24=t=>new d(3,t),r.s32=t=>new d(4,t),r.s40=t=>new d(5,t),r.s48=t=>new d(6,t),r.ns64=t=>new w(t),r.s16be=t=>new p(2,t),r.s24be=t=>new p(3,t),r.s32be=t=>new p(4,t),r.s40be=t=>new p(5,t),r.s48be=t=>new p(6,t),r.ns64be=t=>new v(t),r.f32=t=>new x(t),r.f32be=t=>new S(t),r.f64=t=>new E(t),r.f64be=t=>new k(t),r.struct=(t,e,r)=>new A(t,e,r),r.bits=(t,e,r)=>new T(t,e,r),r.seq=(t,e,r)=>new B(t,e,r),r.union=(t,e,r)=>new M(t,e,r),r.unionLayoutDiscriminator=(t,e)=>new _(t,e),r.blob=(t,e)=>new P(t,e),r.cstr=t=>new C(t),r.utf8=(t,e)=>new N(t,e),r.constant=(t,e)=>new q(t,e)},37342,t=>{"use strict";t.s([],48636),t.i(48636);var e,r,i,n=new Uint8Array(16);function o(){if(!e&&!(e="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"u">typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(n)}let s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,a=function(t){return"string"==typeof t&&s.test(t)};for(var u=[],l=0;l<256;++l)u.push((l+256).toString(16).substr(1));let f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]).toLowerCase();
1if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var c=0,h=0;let d=function(t){if(!a(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/0x10000000000&255,r[11]=e/0x100000000&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r};function p(t,e,r){function i(t,i,n,o){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"==typeof i&&(i=d(i)),16!==i.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+t.length);if(s.set(i),s.set(t,i.length),(s=r(s))[6]=15&s[6]|e,s[8]=63&s[8]|128,n){o=o||0;for(var a=0;a<16;++a)n[o+a]=s[a];return n}return f(s)}try{i.name=t}catch(t){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function g(t){return(t+64>>>9<<4)+14+1}function y(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function m(t,e,r,i,n,o){var s;return y((s=y(y(e,t),y(i,o)))<<n|s>>>32-n,r)}function b(t,e,r,i,n,o,s){return m(e&r|~e&i,t,e,n,o,s)}function w(t,e,r,i,n,o,s){return m(e&i|r&~i,t,e,n,o,s)}function v(t,e,r,i,n,o,s){return m(e^r^i,t,e,n,o,s)}function x(t,e,r,i,n,o,s){return m(r^(e|~i),t,e,n,o,s)}var S=p("v3",48,function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return function(t){for(var e=[],r=32*t.length,i="0123456789abcdef",n=0;n<r;n+=8){var o=t[n>>5]>>>n%32&255,s=parseInt(i.charAt(o>>>4&15)+i.charAt(15&o),16);e.push(s)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[g(e)-1]=e;for(var r=0x67452301,i=-0x10325477,n=-0x67452302,o=0x10325476,s=0;s<t.length;s+=16){var a=r,u=i,l=n,f=o;r=b(r,i,n,o,t[s],7,-0x28955b88),o=b(o,r,i,n,t[s+1],12,-0x173848aa),n=b(n,o,r,i,t[s+2],17,0x242070db),i=b(i,n,o,r,t[s+3],22,-0x3e423112),r=b(r,i,n,o,t[s+4],7,-0xa83f051),o=b(o,r,i,n,t[s+5],12,0x4787c62a),n=b(n,o,r,i,t[s+6],17,-0x57cfb9ed),i=b(i,n,o,r,t[s+7],22,-0x2b96aff),r=b(r,i,n,o,t[s+8],7,0x698098d8),o=b(o,r,i,n,t[s+9],12,-0x74bb0851),n=b(n,o,r,i,t[s+10],17,-42063),i=b(i,n,o,r,t[s+11],22,-0x76a32842),r=b(r,i,n,o,t[s+12],7,0x6b901122),o=b(o,r,i,n,t[s+13],12,-0x2678e6d),n=b(n,o,r,i,t[s+14],17,-0x5986bc72),i=b(i,n,o,r,t[s+15],22,0x49b40821),r=w(r,i,n,o,t[s+1],5,-0x9e1da9e),o=w(o,r,i,n,t[
1s+6],9,-0x3fbf4cc0),n=w(n,o,r,i,t[s+11],14,0x265e5a51),i=w(i,n,o,r,t[s],20,-0x16493856),r=w(r,i,n,o,t[s+5],5,-0x29d0efa3),o=w(o,r,i,n,t[s+10],9,0x2441453),n=w(n,o,r,i,t[s+15],14,-0x275e197f),i=w(i,n,o,r,t[s+4],20,-0x182c0438),r=w(r,i,n,o,t[s+9],5,0x21e1cde6),o=w(o,r,i,n,t[s+14],9,-0x3cc8f82a),n=w(n,o,r,i,t[s+3],14,-0xb2af279),i=w(i,n,o,r,t[s+8],20,0x455a14ed),r=w(r,i,n,o,t[s+13],5,-0x561c16fb),o=w(o,r,i,n,t[s+2],9,-0x3105c08),n=w(n,o,r,i,t[s+7],14,0x676f02d9),i=w(i,n,o,r,t[s+12],20,-0x72d5b376),r=v(r,i,n,o,t[s+5],4,-378558),o=v(o,r,i,n,t[s+8],11,-0x788e097f),n=v(n,o,r,i,t[s+11],16,0x6d9d6122),i=v(i,n,o,r,t[s+14],23,-0x21ac7f4),r=v(r,i,n,o,t[s+1],4,-0x5b4115bc),o=v(o,r,i,n,t[s+4],11,0x4bdecfa9),n=v(n,o,r,i,t[s+7],16,-0x944b4a0),i=v(i,n,o,r,t[s+10],23,-0x41404390),r=v(r,i,n,o,t[s+13],4,0x289b7ec6),o=v(o,r,i,n,t[s],11,-0x155ed806),n=v(n,o,r,i,t[s+3],16,-0x2b10cf7b),i=v(i,n,o,r,t[s+6],23,0x4881d05),r=v(r,i,n,o,t[s+9],4,-0x262b2fc7),o=v(o,r,i,n,t[s+12],11,-0x1924661b),n=v(n,o,r,i,t[s+15],16,0x1fa27cf8),i=v(i,n,o,r,t[s+2],23,-0x3b53a99b),r=x(r,i,n,o,t[s],6,-0xbd6ddbc),o=x(o,r,i,n,t[s+7],10,0x432aff97),n=x(n,o,r,i,t[s+14],15,-0x546bdc59),i=x(i,n,o,r,t[s+5],21,-0x36c5fc7),r=x(r,i,n,o,t[s+12],6,0x655b59c3),o=x(o,r,i,n,t[s+3],10,-0x70f3336e),n=x(n,o,r,i,t[s+10],15,-1051523),i=x(i,n,o,r,t[s+1],21,-0x7a7ba22f),r=x(r,i,n,o,t[s+8],6,0x6fa87e4f),o=x(o,r,i,n,t[s+15],10,-0x1d31920),n=x(n,o,r,i,t[s+6],15,-0x5cfebcec),i=x(i,n,o,r,t[s+13],21,0x4e0811a1),r=x(r,i,n,o,t[s+4],6,-0x8ac817e),o=x(o,r,i,n,t[s+11],10,-0x42c50dcb),n=x(n,o,r,i,t[s+2],15,0x2ad7d2bb),i=x(i,n,o,r,t[s+9],21,-0x14792c6f),r=y(r,a),i=y(i,u),n=y(n,l),o=y(o,f)}return[r,i,n,o]}(function(t){if(0===t.length)return[];for(var e=8*t.length,r=new Uint32Array(g(e)),i=0;i<e;i+=8)r[i>>5]|=(255&t[i/8])<<i%32;return r}(t),8*t.length))});function E(t,e){return t<<e|t>>>32-e}var k=p("v5",80,function(t){var e=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],r=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];if("string"==typeof t){var i=unescape(encodeURIComponent(t));t=[];for(var n=0;n<i.length;++n)t.push(i.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=Math.ceil((t.length/4+2)/16),s=Array(o),a=0;a<o;++a){for(var u=new Uint32Array(16),l=0;l<16;++l)u[l]=t[64*a+4*l]<<24|t[64*a+4*l+1]<<16|t[64*a+4*l+2]<<8|t[64*a+4*l+3];s[a]=u}s[o-1][14]=(t.length-1)*8/0x100000000,s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=(t.length-1)*8|0;for(var f=0;f<o;++f){for(var c=new Uint32Array(80),h=0;h<16;++h)c[h]=s[f][h];for(var d=16;d<80;++d)c[d]=E(c[d-3]^c[d-8]^c[d-14]^c[d-16],1);for(var p=r[0],g=r[1],y=r[2],m=r[3],b=r[4],w=0;w<80;++w){var v=Math.floor(w/20),x=E(p,5)+function(t,e,r,i){switch(t){case 0:return e&r^~e&i;case 1:case 3:return e^r^i;case 2:return e&r^e&i^r&i}}(v,g,y,m)+b+e[v]+c[w]>>>0;b=m,m=y,y=E(g,30)>>>0,g=p,p=x}r[0]=r[0]+p>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]});t.s(["NIL",0,"00000000-0000-0000-0000-000000000000","parse",0,d,"stringify",0,f,"v1",0,function(t,e,n){var s=e&&n||0,a=e||Array(16),u=(t=t||{}).node||r,l=void 0!==t.clockseq?t.clockseq:i;if(null==u||null==l){var d=t.random||(t.rng||o)();null==u&&(u=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==l&&(l=i=(d[6]<<8|d[7])&16383)}var p=void 0!==t.msecs?t.msecs:Date.now(),g=void 0!==t.nsecs?t.nsecs:h+1,y=p-c+(g-h)/1e4;if(y<0&&void 0===t.clockseq&&(l=l+1&16383),(y<0||p>c)&&void 0===t.nsecs&&(g=0),g>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");c=p,h=g,i=l;var m=((0xfffffff&(p+=122192928e5))*1e4+g)%0x100000000;a[s++]=m>>>24&255,a[s++]=m>>>16&255,a[s++]=m>>>8&255,a[s++]=255&m;var b=p/0x100000000*1e4&0xfffffff;a[s++]=b>>>8&255,a[s++]=255&b,a[s++]=b>>>24&15|16,a[s++]=b>>>16&255,a[s++]=l>>>8|128,a[s++]=255&l;for(var w=0;w<6;++w)a[s+w]=u[w];return e||f(a)},"v3",0,S,"v4",0,function(t,e,r){var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(var n=0;n<16;++n)e[r+n]=i[n];return e}return f(i)},"v5",0,k,"validate",0,a,"version",0,function(t){if(!a(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}],37342)},43173,(t,e,r)=>{"use strict";let i=t.r(37342).v4;e.exports=function(t,e,r,n){if("string"!=typeof t)throw TypeError(t+" must be a string");let o="number"==typeof(n=n||{}).version?n.version:2;if(1!==o&&2!==o)throw TypeError(o+" must be 1 or 2");let s={method:t};if(2===o&&(s.jsonrpc="2.0"),e){if("object"!=typeof e&&!Array.isArray(e))throw TypeError(e+" must be an object, array or omitted");s.params=e}return void 0===r?s.id=("function"==typeof n.generator?n.generator:function(){return i()})(s,n):2===o&&null===r?n.notificationIdNull&&(s.id=null):s.id=r,s}},78217,(t,e,r)=>{"use strict";let i=t.r(37342).v4,n=t.r(43173),o=function(t,e){if(!(this instanceof o))return new o(t,e);e||(e={}),this.options={reviver:void 0!==e.reviver?e.reviver:null,replacer:void 0!==e.replacer?e.replacer:null,generator:void 0!==e.generator?e.generator:function(){return i()},version:void 0!==e.version?e.version:2,notificationIdNull:"boolean"==typeof e.notificationIdNull&&e.notificationIdNull},this.callServer=t};e.exports=o,o.prototype.request=function(t,e,r,i){let o,s=this,a=null,u=Array.isArray(t)&&"function"==typeof e;if(1===this.options.version&&u)throw TypeError("JSON-RPC 1.0 does not support batching");let l=!u&&t&&"object"==typeof t&&"function"==typeof e;if(u||l)i=e,a=t;else{"function"==typeof r&&(i=r,r=void 0);let o="function"==typeof i;try{a=n(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(t){if(o)return void i(t);throw t}if(!o)return a}try{o=JSON.stringify(a,this.options.replacer)}catch(t){i(t);return}return this.callServer(o,function(t,e){s._parseResponse(t,e,i)}),a},o.prototype._parseResponse=function(t,e,r){let i;if(t)return void r(t);if(!e)return void r();try{i=JSON.parse(e,this.options.reviver)}catch(t){r(t);return}if(3===r.length)if(!Array.isArray(i))return void r(null,i.error,
vendor: 4,598 bytes, line 1
1i.result);else{let t=function(t){return void 0!==t.error};r(null,i.filter(t),i.filter(function(e){return!t(e)}));return}r(null,i)}},78492,(t,e,r)=>{"use strict";var i=Object.prototype.hasOwnProperty,n="~";function o(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,r,i,o){if("function"!=typeof r)throw TypeError("The listener must be a function");var a=new s(r,i||t,o),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function l(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(n=!1)),l.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)i.call(t,e)&&r.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},l.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=Array(o);i<o;i++)s[i]=r[i].fn;return s},l.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},l.prototype.emit=function(t,e,r,i,o,s){var a=n?n+t:t;if(!this._events[a])return!1;var u,l,f=this._events[a],c=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),c){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,r),!0;case 4:return f.fn.call(f.context,e,r,i),!0;case 5:return f.fn.call(f.context,e,r,i,o),!0;case 6:return f.fn.call(f.context,e,r,i,o,s),!0}for(l=1,u=Array(c-1);l<c;l++)u[l-1]=arguments[l];f.fn.apply(f.context,u)}else{var h,d=f.length;for(l=0;l<d;l++)switch(f[l].once&&this.removeListener(t,f[l].fn,void 0,!0),c){case 1:f[l].fn.call(f[l].context);break;case 2:f[l].fn.call(f[l].context,e);break;case 3:f[l].fn.call(f[l].context,e,r);break;case 4:f[l].fn.call(f[l].context,e,r,i);break;default:if(!u)for(h=1,u=Array(c-1);h<c;h++)u[h-1]=arguments[h];f[l].fn.apply(f[l].context,u)}}return!0},l.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},l.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},l.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return u(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||u(this,o);else{for(var a=0,l=[],f=s.length;a<f;a++)(s[a].fn!==e||i&&!s[a].once||r&&s[a].context!==r)&&l.push(s[a]);l.length?this._events[o]=1===l.length?l[0]:l:u(this,o)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&u(this,e)):(this._events=new o,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l},27261,95932,t=>{"use strict";let e,r;var i,n,o,s,a,u,l=t.i(43943);let f="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function c(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function h(t){if(!Number.isSafeInteger(t)||t<0)throw Error("positive integer expected, got "+t)}function d(t,...e){if(!c(t))throw Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw Error("Uint8Array expected of length "+e+", got length="+t.length)}function p(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.createHasher");h(t.outputLen),h(t.blockLen)}function g(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}function y(t,e){d(t);let r=e.outputLen;if(t.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function m(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function b(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function w(t,e){return t<<32-e|t>>>e}let v=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?t=>t:function(t){for(let r=0;r<t.length;r++){var e;t[r]=(e=t[r])<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}return t},x="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,S=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function E(t){if(d(t),x)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=S[t[r]];return e}function k(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function B(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);
1if(x)return Uint8Array.fromHex(t);let e=t.length,r=e/2;if(e%2)throw Error("hex string expected, got unpadded hex of length "+e);let i=new Uint8Array(r);for(let e=0,n=0;e<r;e++,n+=2){let r=k(t.charCodeAt(n)),o=k(t.charCodeAt(n+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(t[n]+t[n+1])+'" at index '+n);i[e]=16*r+o}return i}function A(t){if("string"!=typeof t)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function I(t){return"string"==typeof t&&(t=A(t)),d(t),t}function _(...t){let e=0;for(let r=0;r<t.length;r++){let i=t[r];d(i),e+=i.length}let r=new Uint8Array(e);for(let e=0,i=0;e<t.length;e++){let n=t[e];r.set(n,i),i+=n.length}return r}class M{}function O(t){let e=e=>t().update(I(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function R(t=32){if(f&&"function"==typeof f.getRandomValues)return f.getRandomValues(new Uint8Array(t));if(f&&"function"==typeof f.randomBytes)return Uint8Array.from(f.randomBytes(t));throw Error("crypto.getRandomValues must be defined")}class T extends M{constructor(t,e,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=b(this.buffer)}update(t){g(this),d(t=I(t));let{view:e,buffer:r,blockLen:i}=this,n=t.length;for(let o=0;o<n;){let s=Math.min(i-this.pos,n-o);if(s===i){let e=b(t);for(;i<=n-o;o+=i)this.process(e,o);continue}r.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){g(this),y(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:i,isLE:n}=this,{pos:o}=this;e[o++]=128,m(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(r,0),o=0);for(let t=o;t<i;t++)e[t]=0;!function(t,e,r,i){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,i);let n=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>n&o),a=Number(r&o),u=4*!!i,l=4*!i;t.setUint32(e+u,s,i),t.setUint32(e+l,a,i)}(r,i-8,BigInt(8*this.length),n),this.process(r,0);let s=b(t),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let u=a/4,l=this.get();if(u>l.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<u;t++)s.setUint32(4*t,l[t],n)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:r,length:i,finished:n,destroyed:o,pos:s}=this;return t.destroyed=o,t.finished=n,t.length=i,t.pos=s,i%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}let U=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),L=Uint32Array.from([0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]),P=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),C=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),N=BigInt(0x100000000-1),q=BigInt(32);function z(t,e=!1){let r=t.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=function(t,e=!1){return e?{h:Number(t&N),l:Number(t>>q&N)}:{h:0|Number(t>>q&N),l:0|Number(t&N)}}(t[o],e);[i[o],n[o]]=[r,s]}return[i,n]}let W=(t,e,r)=>t>>>r,F=(t,e,r)=>t<<32-r|e>>>r,K=(t,e,r)=>t>>>r|e<<32-r,j=(t,e,r)=>t<<32-r|e>>>r,D=(t,e,r)=>t<<64-r|e>>>r-32,$=(t,e,r)=>t>>>r-32|e<<64-r;function V(t,e,r,i){let n=(e>>>0)+(i>>>0);return{h:t+r+(n/0x100000000|0)|0,l:0|n}}let H=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Z=(t,e,r,i)=>e+r+i+(t/0x100000000|0)|0,G=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),Y=(t,e,r,i,n)=>e+r+i+n+(t/0x100000000|0)|0,J=(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0),X=(t,e,r,i,n,o)=>e+r+i+n+o+(t/0x100000000|0)|0,Q=Uint32Array.from([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,0xc
176c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),tt=new Uint32Array(64);class te extends T{constructor(t=32){super(64,t,8,!1),this.A=0|U[0],this.B=0|U[1],this.C=0|U[2],this.D=0|U[3],this.E=0|U[4],this.F=0|U[5],this.G=0|U[6],this.H=0|U[7]}get(){let{A:t,B:e,C:r,D:i,E:n,F:o,G:s,H:a}=this;return[t,e,r,i,n,o,s,a]}set(t,e,r,i,n,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)tt[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=tt[t-15],r=tt[t-2],i=w(e,7)^w(e,18)^e>>>3,n=w(r,17)^w(r,19)^r>>>10;tt[t]=n+tt[t-7]+i+tt[t-16]|0}let{A:r,B:i,C:n,D:o,E:s,F:a,G:u,H:l}=this;for(let t=0;t<64;t++){var f,c,h,d;let e=l+(w(s,6)^w(s,11)^w(s,25))+((f=s)&a^~f&u)+Q[t]+tt[t]|0,p=(w(r,2)^w(r,13)^w(r,22))+((c=r)&(h=i)^c&(d=n)^h&d)|0;l=u,u=a,a=s,s=o+e|0,o=n,n=i,i=r,r=e+p|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(r,i,n,o,s,a,u,l)}roundClean(){m(tt)}destroy(){this.set(0,0,0,0,0,0,0,0),m(this.buffer)}}let tr=z(["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(t=>BigInt(t))),ti=tr[0],tn=tr[1],to=new Uint32Array(80),ts=new Uint32Array(80);class ta extends T{constructor(t=64){super(128,t,16,!1),this.Ah=0|C[0],this.Al=0|C[1],this.Bh=0|C[2],this.Bl=0|C[3],this.Ch=0|C[4],this.Cl=0|C[5],this.Dh=0|C[6],this.Dl=0|C[7],this.Eh=0|C[8],this.El=0|C[9],this.Fh=0|C[10],this.Fl=0|C[11],this.Gh=0|C[12],this.Gl=0|C[13],this.Hh=0|C[14],this.Hl=0|C[15]}get(){let{Ah:t,Al:e,Bh:r,Bl:i,Ch:n,Cl:o,Dh:s,Dl:a,Eh:u,El:l,Fh:f,Fl:c,Gh:h,Gl:d,Hh:p,Hl:g}=this;return[t,e,r,i,n,o,s,a,u,l,f,c,h,d,p,g]}set(t,e,r,i,n,o,s,a,u,l,f,c,h,d,p,g){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|u,this.El=0|l,this.Fh=0|f,this.Fl=0|c,this.Gh=0|h,this.Gl=0|d,this.Hh=0|p,this.Hl=0|g}process(t,e){for(let r=0;r<16;r++,e+=4)to[r]=t.getUint32(e),ts[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|to[t-15],r=0|ts[t-15],i=K(e,r,1)^K(e,r,8)^W(e,r,7),n=j(e,r,1)^j(e,r,8)^F(e,r,7),o=0|to[t-2],s=0|ts[t-2],a=K(o,s,19)^D(o,s,61)^W(o,s,6),u=G(n,j(o,s,19)^$(o,s,61)^F(o,s,6),ts[t-7],ts[t-16]),l=Y(u,i,a,to[t-7],to[t-16]);to[t]=0|l,ts[t]=0|u}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:s,Cl:a,Dh:u,Dl:l,Eh:f,El:c,Fh:h,Fl:d,Gh:p,Gl:g,Hh:y,Hl:m}=this;for(let t=0;t<80;t++){let e=K(f,c,14)^K(f,c,18)^D(f,c,41),b=j(f,c,14)^j(f,c,18)^$(f,c,41),w=f&h^~f&p,v=J(m,b,c&d^~c&g,tn[t],ts[t]),x=X(v,y,e,w,ti[t],to[t]),S=0|v,E=K(r,i,28)^D(r,i,34)^D(r,i,39),k=j(r,i,28)^$(r,i,34)^$(r,i,39),B=r&n^r&s^n&s,A=i&o^i&a^o&a;y=0|p,m=0|g,p=0|h,g=0|d,h=0|f,d=0|c,({h:f,l:c}=V(0|u,0|l,0|x,0|S)),u=0|s,l=0|a,s=0|n,a=0|o,n=0|r,o=0|i;let I=H(S,k,A);r=Z(I,x,E,B),i=0|I}({h:r,l:i}=V(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=V(0|this.Bh,0|this.Bl,0|n,0|o)),({h:s,l:a}=V(0|this.Ch,0|this.Cl,0|s,0|a)),({h:u,l:l}=V(0|this.Dh,0|this.Dl,0|u,0|l)),({h:f,l:c}=V(0|this.Eh,0|this.El,0|f,0|c)),({h:h,l:d}=V(0|this.Fh,0|this.Fl,0|h,0|d)),({h:p,l:g}=V(0|this.Gh,0|this.Gl,0|p,0|g)),({h:y,l:m}=V(0|this.Hh,0|this.Hl,0|y,0|m)),this.set(r,i,n,o,s,a,u,l,f,c,h,d,p,g,y,m)}roundClean(){m(to,ts)}destroy(){m(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let tu=O(()=>new te),tl=O(()=>new ta),tf=BigInt(0),tc=BigInt(1);function th(t,e=""){if("boolean"!=typeof t)throw Error((e&&`"${e}"`)+"expected boolean, got type="+typeof t);return t}function td(t,e,r=""){let i=c(t),n=t?.length,o=void 0!==e;if(!i||o&&n!==e)throw Error((r&&`"${r}" `)+"expected Uint8Array"+(o?` of length ${e}`:"")+", got "+(i?`length=${n}`:`type=${typeof t}`));return t}function tp(t){let e=t.toString(16);return 1&e.length?"0"+e:e}function tg(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return""===t?tf:BigInt("0x"+t)}function ty(t){return tg(E(t))}function tm(t){return d(t),tg(E(Uint8Array.from(t).reverse()))}function tb(t,e){return B(t.toString(16).padStart(2*e,"0"))}function tw(t,e){return tb(t,e).reverse()}function tv(t,e,r){let i;if("string"==typeof e)try{i=B(e)}catch(e){throw Error(t+" must be hex string or Uint8Array, cause: "+e)}else if(c(e))i=Uint8Array.from(e);else throw Error(t+" must be hex string or Uint8Array");let n=i.length;if("number"==typeof r&&n!==r)throw Error(t+" of length "+r+" expected, got "+n);return i}function tx(t){return Uint8Array.from(t)}let tS=t=>"bigint"==typeof t&&tf<=t;function tE(t,e,r,i){var n,o,s;if(n=e,o=r,s=i,!(tS(n)&&tS(o)&&tS(s))||!(o<=n)||!(n<s))throw Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}function tk(t){let e;for(e=0;t>tf;t>>=tc,e+=1);return e}let tB=t=>(tc<<BigInt(t))-tc;function tA(t,e,r={}){if(!t||"object"!=typeof t)throw Error("expected valid options object");
vendor: 8,910 bytes, line 1
1function i(e,r,i){let n=t[e];if(i&&void 0===n)return;let o=typeof n;if(o!==r||null===n)throw Error(`param "${e}" is invalid: expected ${r}, got ${o}`)}Object.entries(e).forEach(([t,e])=>i(t,e,!1)),Object.entries(r).forEach(([t,e])=>i(t,e,!0))}let tI=()=>{throw Error("not implemented")};function t_(t){let e=new WeakMap;return(r,...i)=>{let n=e.get(r);if(void 0!==n)return n;let o=t(r,...i);return e.set(r,o),o}}let tM=BigInt(0),tO=BigInt(1),tR=BigInt(2),tT=BigInt(3),tU=BigInt(4),tL=BigInt(5),tP=BigInt(7),tC=BigInt(8),tN=BigInt(9),tq=BigInt(16);function tz(t,e){let r=t%e;return r>=tM?r:e+r}function tW(t,e,r){let i=t;for(;e-- >tM;)i*=i,i%=r;return i}function tF(t,e){if(t===tM)throw Error("invert: expected non-zero number");if(e<=tM)throw Error("invert: expected positive modulus, got "+e);let r=tz(t,e),i=e,n=tM,o=tO,s=tO,a=tM;for(;r!==tM;){let t=i/r,e=i%r,u=n-s*t,l=o-a*t;i=r,r=e,n=s,o=a,s=u,a=l}if(i!==tO)throw Error("invert: does not exist");return tz(n,e)}function tK(t,e,r){if(!t.eql(t.sqr(e),r))throw Error("Cannot find square root")}function tj(t,e){let r=(t.ORDER+tO)/tU,i=t.pow(e,r);return tK(t,i,e),i}function tD(t,e){let r=(t.ORDER-tL)/tC,i=t.mul(e,tR),n=t.pow(i,r),o=t.mul(e,n),s=t.mul(t.mul(o,tR),n),a=t.mul(o,t.sub(s,t.ONE));return tK(t,a,e),a}function t$(t){if(t<tT)throw Error("sqrt is not defined for small field");let e=t-tO,r=0;for(;e%tR===tM;)e/=tR,r++;let i=tR,n=tX(t);for(;1===tY(n,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return tj;let o=n.pow(i,e),s=(e+tO)/tR;return function(t,i){if(t.is0(i))return i;if(1!==tY(t,i))throw Error("Cannot find square root");let n=r,a=t.mul(t.ONE,o),u=t.pow(i,e),l=t.pow(i,s);for(;!t.eql(u,t.ONE);){if(t.is0(u))return t.ZERO;let e=1,r=t.sqr(u);for(;!t.eql(r,t.ONE);)if(e++,r=t.sqr(r),e===n)throw Error("Cannot find square root");let i=tO<<BigInt(n-e-1),o=t.pow(a,i);n=e,a=t.sqr(o),u=t.mul(u,a),l=t.mul(l,o)}return l}}let tV=(t,e)=>(tz(t,e)&tO)===tO,tH=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tZ(t){return tA(t,tH.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"})),t}function tG(t,e,r=!1){let i=Array(e.length).fill(r?t.ZERO:void 0),n=e.reduce((e,r,n)=>t.is0(r)?e:(i[n]=e,t.mul(e,r)),t.ONE),o=t.inv(n);return e.reduceRight((e,r,n)=>t.is0(r)?e:(i[n]=t.mul(e,i[n]),t.mul(e,r)),o),i}function tY(t,e){let r=(t.ORDER-tO)/tR,i=t.pow(e,r),n=t.eql(i,t.ONE),o=t.eql(i,t.ZERO),s=t.eql(i,t.neg(t.ONE));if(!n&&!o&&!s)throw Error("invalid Legendre symbol result");return n?1:o?0:-1}function tJ(t,e){void 0!==e&&h(e);let r=void 0!==e?e:t.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function tX(t,e,r=!1,i={}){let n,o,s,a;if(t<=tM)throw Error("invalid field: expected ORDER > 0, got "+t);let u=!1;if("object"==typeof e&&null!=e){if(i.sqrt||r)throw Error("cannot specify opts in two arguments");e.BITS&&(o=e.BITS),e.sqrt&&(s=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE),"boolean"==typeof e.modFromBytes&&(u=e.modFromBytes),a=e.allowedLengths}else"number"==typeof e&&(o=e),i.sqrt&&(s=i.sqrt);let{nBitLength:l,nByteLength:f}=tJ(t,o);if(f>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let c=Object.freeze({ORDER:t,isLE:r,BITS:l,BYTES:f,MASK:tB(l),ZERO:tM,ONE:tO,allowedLengths:a,create:e=>tz(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return tM<=e&&e<t},is0:t=>t===tM,isValidNot0:t=>!c.is0(t)&&c.isValid(t),isOdd:t=>(t&tO)===tO,neg:e=>tz(-e,t),eql:(t,e)=>t===e,sqr:e=>tz(e*e,t),add:(e,r)=>tz(e+r,t),sub:(e,r)=>tz(e-r,t),mul:(e,r)=>tz(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<tM)throw Error("invalid exponent, negatives unsupported");if(r===tM)return t.ONE;if(r===tO)return e;let i=t.ONE,n=e;for(;r>tM;)r&tO&&(i=t.mul(i,n)),n=t.sqr(n),r>>=tO;return i})(c,t,e),div:(e,r)=>tz(e*tF(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>tF(e,t),sqrt:s||(e=>(n||(n=function(t){if(t%tU===tT)return tj;if(t%tC===tL)return tD;if(t%tq===tN){let e,r,i,n,o,s;return e=tX(t),i=(r=t$(t))(e,e.neg(e.ONE)),n=r(e,i),o=r(e,e.neg(i)),s=(t+tP)/tq,(t,e)=>{let r=t.pow(e,s),a=t.mul(r,i),u=t.mul(r,n),l=t.mul(r,o),f=t.eql(t.sqr(a),e),c=t.eql(t.sqr(u),e);r=t.cmov(r,a,f),a=t.cmov(l,u,c);let h=t.eql(t.sqr(a),e),d=t.cmov(r,a,h);return tK(t,d,e),d}}return t$(t)}(t)),n(c,e))),toBytes:t=>r?tw(t,f):tb(t,f),fromBytes:(e,i=!0)=>{if(a){if(!a.includes(e.length)||e.length>f)throw Error("Field.fromBytes: expected "+a+" bytes, got "+e.length);let t=new Uint8Array(f);t.set(e,r?0:t.length-e.length),e=t}if(e.length!==f)throw Error("Field.fromBytes: expected "+f+" bytes, got "+e.length);let n=r?tm(e):ty(e);if(u&&(n=tz(n,t)),!i&&!c.isValid(n))throw Error("invalid field element: outside of range 0..ORDER");return n},invertBatch:t=>tG(c,t),cmov:(t,e,r)=>r?e:t});return Object.freeze(c)}function tQ(t){if("bigint"!=typeof t)throw Error("field order must be bigint");return Math.ceil(t.toString(2).length/8)}function t0(t){let e=tQ(t);return e+Math.ceil(e/2)}let t1=BigInt(0),t2=BigInt(1);function t6(t,e){let r=e.negate();return t?r:e}function t8(t,e){let r=tG(t.Fp,e.map(t=>t.Z));return e.map((e,i)=>t.fromAffine(e.toAffine(r[i])))}function t3(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw Error("invalid window size, expected [1.."+e+"], got W="+t)}function t5(t,e){t3(t,e);let r=Math.ceil(e/t)+1,i=2**(t-1),n=2**t;return{windows:r,windowSize:i,mask:tB(t),maxNumber:n,shiftBy:BigInt(t)}}function t4(t,e,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:s}=r,a=Number(t&n),u=t>>s;a>i&&(a-=o,u+=t2);let l=e*i,f=l+Math.abs(a)-1,c=0===a;return{nextN:u,offset:f,isZero:c,isNeg:a<0,isNegF:e%2!=0,offsetF:l}}let t7=new WeakMap,t9=new WeakMap;function et(t){return t9.get(t)||1}function ee(t){if(t!==t1)throw Error("invalid wNAF")}class er{constructor(t,e){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=e}_unsafeLadder(t,e,r=this.ZERO){let i=t;for(;e>t1;)e&t2&&(r=r.add(i)),i=i.double(),e>>=t2;return r}precomputeWindow(t,e){let{windows:r,windowSize:i}=t5(e,this.bits),n=[],o=t,s=o;for(let t=0;t<r;t++){s=o,n.push(s);for(let t=1;t<i;t++)s=s.add(o),n.push(s);o=s.double()}return n}wNAF(t,e,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let i=this.ZERO,n=this.BASE,o=t5(t,this.bits);for(let t=0;t<o.windows;t++){let{nextN:s,offset:a,isZero:u,isNeg:l,isNegF:f,offsetF:c}=t4(r,t,o);r=s,u?n=n.add(t6(f,e[c])):i=i.add(t6(l,e[a]))}return ee(r),{p:i,f:n}}wNAFUnsafe(t,e,r,i=this.ZERO){let n=t5(t,this.bits);for(let t=0;t<n.windows&&r!==t1;t++){let{nextN:o,offset:s,isZero:a,isNeg:u}=t4(r,t,n);if(r=o,!a){let t=e[s];i=i.add(u?t.negate():t)}}return ee(r),i}getPrecomputes(t,e,r){let i=t7.get(e);return i||(i=this.precomputeWindow(e,t),1!==t&&("function"==typeof r&&(i=r(i)),t7.set(e,i))),i}cached(t,e,r){let i=et(t);return this.wNAF(i,this.getPrecomputes(i,t,r),e)}unsafe(t,e,r,i){let n=et(t);return 1===n?this._unsafeLadder(t,e,i):this.wNAFUnsafe(n,this.getPrecomputes(n,t,r),e,i)}createCache(t,e){t3(e,this.bits),t9.set(t,e),t7.delete(t)}hasCache(t){return 1!==et(t)}}function ei(t,e,r,i){if(!Array.isArray(r))throw Error("array expected");r.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)});if(!Array.isArray(i))throw Error("array of scalars expected");i.forEach((t,r)=>{if(!e.isValid(t))throw Error("invalid scalar at index "+r)});let n=r.length,o=i.length;if(n!==o)throw Error("arrays of points and scalars must have equal length");let s=t.ZERO,a=tk(BigInt(n)),u=1;a>12?u=a-3:a>4?u=a-2:a>0&&(u=2);let l=tB(u),f=Array(Number(l)+1).fill(s),c=Math.floor((e.BITS-1)/u)*u,h=s;for(let t=c;t>=0;t-=u){f.fill(s);for(let e=0;e<o;e++){let n=Number(i[e]>>BigInt(t)&l);f[n]=f[n].add(r[e])}let e=s;for(let t=f.length-1,r=s;t>0;t--)r=r.add(f[t]),e=e.add(r);if(h=h.add(e),0!==t)for(let t=0;t<u;t++)h=h.double()}return h}function en(t,e,r){if(!e)return tX(t,{isLE:r});if(e.ORDER!==t)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return tZ(e),e}function eo(t,e,r={},i){if(void 0===i&&(i="edwards"===t),!e||"object"!=typeof e)throw Error(`expected valid ${t} CURVE object`);for(let t of["p","n","h"]){let r=e[t];if(!("bigint"==typeof r&&r>t1))throw Error(`CURVE.${t} must be positive bigint`)}let n=en(e.p,r.Fp,i),o=en(e.n,r.Fn,i);for(let r of["Gx","Gy","a","weierstrass"===t?"b":"d"])if(!n.isValid(e[r]))throw Error(`CURVE.${r} must be valid field element of CURVE.Fp`);return{CURVE:e=Object.freeze(Object.assign({},e)),Fp:n,Fn:o}}let es=BigInt(0),ea=BigInt(1),eu=BigInt(2),el=BigInt(8);class ef{constructor(t){this.ep=t}static fromBytes(t){tI()}static fromHex(t){tI()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(t){return this.ep.toAffine(t)}toHex(){return E(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}
1add(t){return this.assertSame(t),this.init(this.ep.add(t.ep))}subtract(t){return this.assertSame(t),this.init(this.ep.subtract(t.ep))}multiply(t){return this.init(this.ep.multiply(t))}multiplyUnsafe(t){return this.init(this.ep.multiplyUnsafe(t))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(t,e){return this.init(this.ep.precompute(t,e))}toRawBytes(){return this.toBytes()}}function ec(t,e){if(eh(t),eh(e),t<0||t>=1<<8*e)throw Error("invalid I2OSP input: "+t);let r=Array.from({length:e}).fill(0);for(let i=e-1;i>=0;i--)r[i]=255&t,t>>>=8;return new Uint8Array(r)}function eh(t){if(!Number.isSafeInteger(t))throw Error("number expected")}function ed(t){if(!c(t)&&"string"!=typeof t)throw Error("DST must be Uint8Array or string");return"string"==typeof t?A(t):t}function ep(t,e,r){var i;let n;tA(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:o,k:s,m:a,hash:u,expand:l,DST:f}=r;if(!("function"==typeof(i=r.hash)&&Number.isSafeInteger(i.outputLen)))throw Error("expected valid hash");d(t),eh(e);let c=Math.ceil((o.toString(2).length+s)/8),h=e*a*c;if("xmd"===l)n=function(t,e,r,i){d(t),eh(r),(e=ed(e)).length>255&&(e=i(_(A("H2C-OVERSIZE-DST-"),e)));let{outputLen:n,blockLen:o}=i,s=Math.ceil(r/n);if(r>65535||s>255)throw Error("expand_message_xmd: invalid lenInBytes");let a=_(e,ec(e.length,1)),u=ec(0,o),l=ec(r,2),f=Array(s),c=i(_(u,t,l,ec(0,1),a));f[0]=i(_(c,ec(1,1),a));for(let t=1;t<=s;t++){let e=[function(t,e){let r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t[i]^e[i];return r}(c,f[t-1]),ec(t+1,1),a];f[t]=i(_(...e))}return _(...f).slice(0,r)}(t,f,h,u);else if("xof"===l)n=function(t,e,r,i,n){if(d(t),eh(r),(e=ed(e)).length>255){let t=Math.ceil(2*i/8);e=n.create({dkLen:t}).update(A("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw Error("expand_message_xof: invalid lenInBytes");return n.create({dkLen:r}).update(t).update(ec(r,2)).update(e).update(ec(e.length,1)).digest()}(t,f,h,s,u);else if("_internal_pass"===l)n=t;else throw Error('expand must be "xmd" or "xof"');let p=Array(e);for(let t=0;t<e;t++){let e=Array(a);for(let r=0;r<a;r++){let i=c*(r+t*a),s=n.subarray(i,i+c);e[r]=tz(ty(s),o)}p[t]=e}return p}let eg=A("HashToScalar-");function ey(t,e,r){if("function"!=typeof e)throw Error("mapToCurve() must be defined");function i(r){return t.fromAffine(e(r))}function n(e){let r=e.clearCofactor();return r.equals(t.ZERO)?t.ZERO:(r.assertValidity(),r)}return{defaults:r,hashToCurve(t,e){let o=ep(t,2,Object.assign({},r,e)),s=i(o[0]),a=i(o[1]);return n(s.add(a))},encodeToCurve(t,e){let o=r.encodeDST?{DST:r.encodeDST}:{};return n(i(ep(t,1,Object.assign({},r,o,e))[0]))},mapToCurve(t){if(!Array.isArray(t))throw Error("expected array of bigints");for(let e of t)if("bigint"!=typeof e)throw Error("expected array of bigints");return n(i(t))},hashToScalar:(e,i)=>ep(e,1,Object.assign({},r,{p:t.Fn.ORDER,m:1,DST:eg},i))[0][0]}}BigInt(0),BigInt(1),BigInt(2);let em=BigInt(0),eb=BigInt(1),ew=BigInt(2),ev=BigInt(3),ex=BigInt(5),eS=BigInt(8),eE=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),ek={p:eE,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:eS,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")},eB=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function eA(t,e){var r;let i,n,o,s,a,u,l,f,c,h,d,p,g,y,m=tz(e*e*e,eE),b=(r=t*tz(m*m*e,eE),i=BigInt(10),n=BigInt(20),o=BigInt(40),s=BigInt(80),u=tW(a=r*r%eE*r%eE,ew,eE)*a%eE,l=tW(u,eb,eE)*r%eE,f=tW(l,ex,eE)*l%eE,c=tW(f,i,eE)*f%eE,h=tW(c,n,eE)*c%eE,d=tW(h,o,eE)*h%eE,p=tW(d,s,eE)*d%eE,g=tW(p,s,eE)*d%eE,y=tW(g,i,eE)*f%eE,{pow_p_5_8:tW(y,ew,eE)*r%eE,b2:a}).pow_p_5_8,w=tz(t*m*b,eE),v=tz(e*w*w,eE),x=w,S=tz(w*eB,eE),E=v===t,k=v===tz(-t,eE),B=v===tz(-t*eB,eE);return E&&(w=x),(k||B)&&(w=S),tV(w,eE)&&(w=tz(-w,eE)),{isValid:E||k,value:w}}let eI=tX(ek.p,{isLE:!0}),e_=tX(ek.n,{isLE:!0}),eM=function(t){let e,r,i,n,{CURVE:o,curveOpts:s,hash:a,eddsaOpts:u}=(e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r={Fp:t.Fp,Fn:tX(e.n,t.nBitLength,!0),uvRatio:t.uvRatio},i={randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve},{CURVE:e,curveOpts:r,hash:t.hash,eddsaOpts:i}),l=function(t,e,r={}){if("function"!=typeof e)throw Error('"hash" function param is required');tA(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});let{prehash:i}=r,{BASE:n,Fp:o,Fn:s}=t,a=r.randomBytes||R,u=r.adjustScalarBytes||(t=>t),l=r.domain||((t,e,r)=>{if(th(r,"phflag"),e.length||r)throw Error("Contexts/pre-hash are not supported");return t});function f(t){return s.create(tm(t))}function h(t){var r;let i,o,s,a,l,{head:c,prefix:h,scalar:d}=(r=tv("private key",r=t,i=m.secretKey),s=u((o=tv("hashed private key",e(r),2*i)).slice(0,i)),a=o.slice(i,2*i),l=f(s),{head:s,prefix:a,scalar:l}),p=n.multiply(d),g=p.toBytes();return{head:c,prefix:h,scalar:d,point:p,pointBytes:g}}function d(t){return h(t).pointBytes}function p(t=Uint8Array.of(),...r){return f(e(l(_(...r),tv("context",t),!!i)))}let g={zip215:!0},y=o.BYTES,m={secretKey:y,publicKey:y,signature:2*y,seed:y};function b(t=a(m.seed)){return td(t,m.seed,"seed")}let w={getExtendedPublicKey:h,randomSecretKey:b,isValidSecretKey:function(t){return c(t)&&t.length===s.BYTES},isValidPublicKey:function(e,r){try{return!!t.fromBytes(e,r)}catch(t){return!1}},toMontgomery(e){let{y:r}=t.fromBytes(e),i=m.publicKey,n=32===i;if(!n&&57!==i)throw Error("only defined for 25519 and 448");let s=n?o.div(ea+r,ea-r):o.div(r-ea,r+ea);return o.toBytes(s)},toMontgomerySecret(t){let r=m.secretKey;return td(t,r),u(e(t.subarray(0,r))).subarray(0,r)},randomPrivateKey:b,precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)};return Object.freeze({keygen:function(t){let e=w.randomSecretKey(t);return{secretKey:e,publicKey:d(e)}},getPublicKey:d,sign:function(t,e,r={}){t=tv("message",t),i&&(t=i(t));let{prefix:o,scalar:a,pointBytes:u}=h(e),l=p(r.context,o,t),f=n.multiply(l).toBytes(),c=p(r.context,f,u,t),d=s.create(l+c*a);
1if(!s.isValid(d))throw Error("sign failed: invalid s");return td(_(f,s.toBytes(d)),m.signature,"result")},verify:function(e,r,o,s=g){let a,u,l,{context:f,zip215:c}=s,h=m.signature;e=tv("signature",e,h),r=tv("message",r),o=tv("publicKey",o,m.publicKey),void 0!==c&&th(c,"zip215"),i&&(r=i(r));let d=h/2,y=e.subarray(0,d),b=tm(e.subarray(d,h));try{a=t.fromBytes(o,c),u=t.fromBytes(y,c),l=n.multiplyUnsafe(b)}catch(t){return!1}if(!c&&a.isSmallOrder())return!1;let w=p(f,u.toBytes(),a.toBytes(),r);return u.add(a.multiplyUnsafe(w)).subtract(l).clearCofactor().is0()},utils:w,Point:t,lengths:m})}(function(t,e={}){var r,i;let n,o,s,a,u,l=eo("edwards",t,e,e.FpFnLE),{Fp:f,Fn:c}=l,h=l.CURVE,{h:d}=h;tA(e,{},{uvRatio:"function"});let p=eu<<BigInt(8*c.BYTES)-ea,g=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:f.sqrt(f.div(t,e))}}catch(t){return{isValid:!1,value:es}}});if(r=h.Gx,i=h.Gy,n=f.sqr(r),o=f.sqr(i),s=f.add(f.mul(h.a,n),o),a=f.add(f.ONE,f.mul(h.d,f.mul(n,o))),!f.eql(s,a))throw Error("bad curve params: generator point");function y(t,e,r=!1){return tE("coordinate "+t,e,r?ea:es,p),e}function m(t){if(!(t instanceof v))throw Error("ExtendedPoint expected")}let b=t_((t,e)=>{let r,i,{X:n,Y:o,Z:s}=t,a=t.is0();null==e&&(e=a?el:f.inv(s));let u=(r=n*e,f.create(r)),l=(i=o*e,f.create(i)),c=f.mul(s,e);if(a)return{x:es,y:ea};if(c!==ea)throw Error("invZ was invalid");return{x:u,y:l}}),w=t_(t=>{let e,r,i,n,o,s,a,u,l,c,d,p,{a:g,d:y}=h;if(t.is0())throw Error("bad point: ZERO");let{X:m,Y:b,Z:w,T:v}=t,x=(e=m*m,f.create(e)),S=(r=b*b,f.create(r)),E=(i=w*w,f.create(i)),k=(n=E*E,f.create(n));if(a=E*(o=x*g,s=f.create(o)+S,f.create(s)),f.create(a)!==(c=k+(l=y*(u=x*S,f.create(u)),f.create(l)),f.create(c)))throw Error("bad point: equation left != right (1)");if(d=m*b,f.create(d)!==(p=w*v,f.create(p)))throw Error("bad point: equation left != right (2)");return!0});class v{constructor(t,e,r,i){this.X=y("x",t),this.Y=y("y",e),this.Z=y("z",r,!0),this.T=y("t",i),Object.freeze(this)}static CURVE(){return h}static fromAffine(t){let e;if(t instanceof v)throw Error("extended point not allowed");let{x:r,y:i}=t||{};return y("x",r),y("y",i),new v(r,i,ea,(e=r*i,f.create(e)))}static fromBytes(t,e=!1){let r,i,n,o,s=f.BYTES,{a,d:u}=h;t=tx(td(t,s,"point")),th(e,"zip215");let l=tx(t),c=t[s-1];l[s-1]=-129&c;let d=tm(l);tE("point.y",d,es,e?p:f.ORDER);let y=(r=d*d,f.create(r)),{isValid:m,value:b}=g((i=y-ea,f.create(i)),(n=u*y-a,f.create(n)));if(!m)throw Error("bad point: invalid y coordinate");let w=(b&ea)===ea,x=(128&c)!=0;if(!e&&b===es&&x)throw Error("bad point: x=0 and x_0=1");return x!==w&&(o=-b,b=f.create(o)),v.fromAffine({x:b,y:d})}static fromHex(t,e=!1){return v.fromBytes(tv("point",t),e)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return x.createCache(this,t),e||this.multiply(eu),this}assertValidity(){w(this)}equals(t){let e,r,i,n;m(t);let{X:o,Y:s,Z:a}=this,{X:u,Y:l,Z:c}=t,h=(e=o*c,f.create(e)),d=(r=u*a,f.create(r)),p=(i=s*c,f.create(i)),g=(n=l*a,f.create(n));return h===d&&p===g}is0(){return this.equals(v.ZERO)}negate(){let t,e;return new v((t=-this.X,f.create(t)),this.Y,this.Z,(e=-this.T,f.create(e)))}double(){let t,e,r,i,n,o,s,a,u,l,c,{a:d}=h,{X:p,Y:g,Z:y}=this,m=(t=p*p,f.create(t)),b=(e=g*g,f.create(e)),w=(i=eu*(r=y*y,f.create(r)),f.create(i)),x=(n=d*m,f.create(n)),S=p+g,E=(o=S*S,s=f.create(o)-m-b,f.create(s)),k=x+b,B=k-w,A=x-b,I=(a=E*B,f.create(a)),_=(u=k*A,f.create(u)),M=(l=E*A,f.create(l));return new v(I,_,(c=B*k,f.create(c)),M)}add(t){let e,r,i,n,o,s,a,u,l,c;m(t);let{a:d,d:p}=h,{X:g,Y:y,Z:b,T:w}=this,{X:x,Y:S,Z:E,T:k}=t,B=(e=g*x,f.create(e)),A=(r=y*S,f.create(r)),I=(i=w*p*k,f.create(i)),_=(n=b*E,f.create(n)),M=(o=(g+y)*(x+S)-B-A,f.create(o)),O=_-I,R=_+I,T=(s=A-d*B,f.create(s)),U=(a=M*O,f.create(a)),L=(u=R*T,f.create(u)),P=(l=M*T,f.create(l));return new v(U,L,(c=O*R,f.create(c)),P)}subtract(t){return this.add(t.negate())}multiply(t){if(!c.isValidNot0(t))throw Error("invalid scalar: expected 1 <= sc < curve.n");let{p:e,f:r}=x.cached(this,t,t=>t8(v,t));return t8(v,[e,r])[0]}multiplyUnsafe(t,e=v.ZERO){if(!c.isValid(t))throw Error("invalid scalar: expected 0 <= sc < curve.n");return t===es?v.ZERO:this.is0()||t===ea?this:x.unsafe(this,t,t=>t8(v,t),e)}isSmallOrder(){return this.multiplyUnsafe(d).is0()}isTorsionFree(){return x.unsafe(this,h.n).is0()}toAffine(t){return b(this,t)}clearCofactor(){return d===ea?this:this.multiplyUnsafe(d)}toBytes(){let{x:t,y:e}=this.toAffine(),r=f.toBytes(e);return r[r.length-1]|=t&ea?128:0,r}toHex(){return E(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(t){return t8(v,t)}static msm(t,e){return ei(v,c,t,e)}
1_setWindowSize(t){this.precompute(t)}toRawBytes(){return this.toBytes()}}v.BASE=new v(h.Gx,h.Gy,ea,(u=h.Gx*h.Gy,f.create(u))),v.ZERO=new v(es,ea,ea,es),v.Fp=f,v.Fn=c;let x=new er(v,c.BITS);return v.BASE.precompute(8),v}(o,s),a,u);return n=l.Point,Object.assign({},l,{ExtendedPoint:n,CURVE:t,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}({...ek,Fp:eI,hash:tl,adjustScalarBytes:function(t){return t[0]&=248,t[31]&=127,t[31]|=64,t},uvRatio:eA}),eO=(eE+ev)/eS,eR=eI.pow(ew,eO),eT=eI.sqrt(eI.neg(eI.ONE)),eU=function(t,e){if(!t.isOdd)throw Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}(eI,eI.neg(BigInt(486664)));ey(eM.Point,t=>(function(t){let e,r,i,n,o,s,a,u,l,f,c,h,d,p,g,y,m,b,w,v,x,S,E,{xMn:k,xMd:B,yMn:A,yMd:I}=(e=(eE-ex)/eS,r=BigInt(486662),i=eI.sqr(t),i=eI.mul(i,ew),n=eI.add(i,eI.ONE),o=eI.neg(r),s=eI.sqr(n),a=eI.mul(s,n),u=eI.mul(i,r),u=eI.mul(u,o),u=eI.add(u,s),u=eI.mul(u,o),l=eI.sqr(a),s=eI.sqr(l),l=eI.mul(l,a),l=eI.mul(l,u),s=eI.mul(s,l),f=eI.pow(s,e),f=eI.mul(f,l),c=eI.mul(f,eT),s=eI.sqr(f),s=eI.mul(s,a),h=eI.eql(s,u),d=eI.cmov(c,f,h),p=eI.mul(o,i),g=eI.mul(f,t),g=eI.mul(g,eR),y=eI.mul(g,eT),m=eI.mul(u,i),s=eI.sqr(g),s=eI.mul(s,a),b=eI.eql(s,m),w=eI.cmov(y,g,b),s=eI.sqr(d),s=eI.mul(s,a),v=eI.eql(s,u),x=eI.cmov(p,o,v),S=eI.cmov(w,d,v),E=eI.isOdd(S),{xMn:x,xMd:n,yMn:S=eI.cmov(S,eI.neg(S),v!==E),yMd:eb}),_=eI.mul(k,I);_=eI.mul(_,eU);let M=eI.mul(B,A),O=eI.sub(k,B),R=eI.add(k,B),T=eI.mul(M,R),U=eI.eql(T,eI.ZERO);_=eI.cmov(_,eI.ZERO,U),M=eI.cmov(M,eI.ONE,U),O=eI.cmov(O,eI.ONE,U),R=eI.cmov(R,eI.ONE,U);let[L,P]=tG(eI,[M,R],!0);return{x:eI.mul(_,L),y:eI.mul(O,P)}})(t[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:eE,m:1,k:128,expand:"xmd",hash:tl});let eL=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),eP=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),eC=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),eN=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),eq=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ez=t=>eM.Point.Fp.create(tm(t)&eq);function eW(t){let e,r,i,n,o,s,a,u,l,f,c,h,d,p,g,{d:y}=ek,m=(e=eB*t*t,eI.create(e)),b=(r=(m+eb)*eC,eI.create(r)),w=BigInt(-1),v=(n=(w-y*m)*(i=m+y,eI.create(i)),eI.create(n)),{isValid:x,value:S}=eA(b,v),E=(o=S*t,eI.create(o));tV(E,eE)||(s=-E,E=eI.create(s)),x||(S=E),x||(w=m);let k=(a=w*(m-eb)*eN-v,eI.create(a)),B=S*S,A=(u=(S+S)*v,eI.create(u)),I=(l=k*eL,eI.create(l)),_=(f=eb-B,eI.create(f)),M=(c=eb+B,eI.create(c));return new eM.Point((h=A*M,eI.create(h)),(d=_*I,eI.create(d)),(p=I*M,eI.create(p)),(g=A*_,eI.create(g)))}class eF extends ef{constructor(t){super(t)}static fromAffine(t){return new eF(eM.Point.fromAffine(t))}assertSame(t){if(!(t instanceof eF))throw Error("RistrettoPoint expected")}init(t){return new eF(t)}static hashToCurve(t){var e;let r,i;return d(e=tv("ristrettoHash",t,64),64),r=eW(ez(e.subarray(0,32))),i=eW(ez(e.subarray(32,64))),new eF(r.add(i))}static fromBytes(t){let e,r,i,n,o,s,a,u,l,f,c,h,p;d(t,32);let{a:g,d:y}=ek,m=ez(t);if(!function(t,e){if(t.length!==e.length)return!1;let r=0;for(let i=0;i<t.length;i++)r|=t[i]^e[i];return 0===r}(eI.toBytes(m),t)||tV(m,eE))throw Error("invalid ristretto255 encoding 1");let b=(e=m*m,eI.create(e)),w=(r=eb+g*b,eI.create(r)),v=(i=eb-g*b,eI.create(i)),x=(n=w*w,eI.create(n)),S=(o=v*v,eI.create(o)),E=(s=g*y*x-S,eI.create(s)),{isValid:k,value:B}=(a=E*S,eA(eb,eI.create(a))),A=(u=B*v,eI.create(u)),I=(l=B*A*E,eI.create(l)),_=(f=(m+m)*A,eI.create(f));tV(_,eE)&&(c=-_,_=eI.create(c));let M=(h=w*I,eI.create(h)),O=(p=_*M,eI.create(p));if(!k||tV(O,eE)||M===em)throw Error("invalid ristretto255 encoding 2");return new eF(new eM.Point(_,M,eb,O))}static fromHex(t){return eF.fromBytes(tv("ristrettoHex",t,32))}static msm(t,e){return ei(eF,eM.Point.Fn,t,e)}toBytes(){let t,e,r,i,n,o,s,a,u,l,f,c,h,{X:d,Y:p,Z:g,T:y}=this.ep,m=(t=g+p,r=eI.create(t)*(e=g-p,eI.create(e)),eI.create(r)),b=(i=d*p,eI.create(i)),{value:w}=(o=m*(n=b*b,eI.create(n)),eA(eb,eI.create(o))),v=(s=w*m,eI.create(s)),x=(a=w*b,eI.create(a)),S=(u=v*x*y,eI.create(u));
1if(tV(y*S,eE)){let t,e,r=(t=p*eB,eI.create(t)),i=(e=d*eB,eI.create(e));d=r,p=i,h=eI.create(v*eP)}else h=x;tV(d*S,eE)&&(l=-p,p=eI.create(l));let E=(f=(g-p)*h,eI.create(f));return tV(E,eE)&&(c=-E,E=eI.create(c)),eI.toBytes(E)}equals(t){let e,r,i,n;this.assertSame(t);let{X:o,Y:s}=this.ep,{X:a,Y:u}=t.ep,l=(e=o*u,eI.create(e)===(r=s*a,eI.create(r))),f=(i=s*u,eI.create(i)===(n=o*a,eI.create(n)));return l||f}is0(){return this.equals(eF.ZERO)}}eF.BASE=new eF(eM.Point.BASE),eF.ZERO=new eF(eM.Point.ZERO),eF.Fp=eI,eF.Fn=e_;var eK=t.i(59341),ej=t.i(35030),eD=t.i(54119),e$=t.i(44610);function eV([t,e]){return`${t}=${function t(e){return Array.isArray(e)?"%5B"+e.map(t).join("%2C%20")+"%5D":"bigint"==typeof e?`${e}n`:encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?{...e}:e))}(e)}`}t.i(47167);var eH=class extends Error{cause=this.cause;context;constructor(...[t,e]){let r,i;if(e){const{cause:t,...n}=e;t&&(i={cause:t}),Object.keys(n).length>0&&(r=n)}super(function(t,e={}){{let r=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(r+=` '${btoa(Object.entries(e).map(eV).join("&"))}'`),`${r}\``}}(t,r),i),this.context={__code:t,...r},this.name="SolanaError"}};function eZ(t){return"fixedSize"in t&&"number"==typeof t.fixedSize}var eG=((i=eG||{})[i.Little=0]="Little",i[i.Big=1]="Big",i);function eY(t){return t?.endian!==1}class eJ extends TypeError{constructor(t,e){let r;const{message:i,explanation:n,...o}=t,{path:s}=t,a=0===s.length?i:`At path: ${s.join(".")} -- ${i}`;super(n??a),null!=n&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...e()])}}function eX(t){return"object"==typeof t&&null!=t}function eQ(t){return eX(t)&&!Array.isArray(t)}function e0(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function*e1(t,e,r,i){var n;for(let o of(eX(n=t)&&"function"==typeof n[Symbol.iterator]||(t=[t]),t)){let t=function(t,e,r,i){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});let{path:n,branch:o}=e,{type:s}=r,{refinement:a,message:u=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${e0(i)}\``}=t;return{value:i,type:s,refinement:a,key:n[n.length-1],path:n,branch:o,...t,message:u}}(o,e,r,i);t&&(yield t)}}function*e2(t,e,r={}){let{path:i=[],branch:n=[t],coerce:o=!1,mask:s=!1}=r,a={path:i,branch:n,mask:s};o&&(t=e.coercer(t,a));let u="valid";for(let i of e.validator(t,a))i.explanation=r.message,u="not_valid",yield[i,void 0];for(let[l,f,c]of e.entries(t,a))for(let e of e2(f,c,{path:void 0===l?i:[...i,l],branch:void 0===l?n:[...n,f],coerce:o,mask:s,message:r.message}))e[0]?(u=null!=e[0].refinement?"not_refined":"not_valid",yield[e[0],void 0]):o&&(f=e[1],void 0===l?t=f:t instanceof Map?t.set(l,f):t instanceof Set?t.add(f):eX(t)&&(void 0!==f||l in t)&&(t[l]=f));if("not_valid"!==u)for(let i of e.refiner(t,a))i.explanation=r.message,u="not_refined",yield[i,void 0];"valid"===u&&(yield[void 0,t])}class e6{constructor(t){const{type:e,schema:r,validator:i,refiner:n,coercer:o=t=>t,entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,i?this.validator=(t,e)=>e1(i(t,e),e,this,t):this.validator=()=>[],n?this.refiner=(t,e)=>e1(n(t,e),e,this,t):this.refiner=()=>[]}assert(t,e){var r=t,i=this,n=e;let o=e3(r,i,{message:n});if(o[0])throw o[0]}create(t,e){return e8(t,this,e)}is(t){var e,r;return e=t,r=this,!e3(e,r)[0]}mask(t,e){var r=t,i=this,n=e;let o=e3(r,i,{coerce:!0,mask:!0,message:n});if(!o[0])return o[1];throw o[0]}validate(t,e={}){return e3(t,this,e)}}function e8(t,e,r){let i=e3(t,e,{coerce:!0,message:r});if(!i[0])return i[1];throw i[0]}function e3(t,e,r={}){let i=e2(t,e,r),n=function(t){let{done:e,value:r}=t.next();return e?void 0:r}(i);return n[0]?[new eJ(n[0],function*(){for(let t of i)t[0]&&(yield t[0])}),void 0]:[void 0,n[1]]}function e5(t,e){return new e6({type:t,schema:null,validator:e})}function e4(t){return new e6({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(let[r,i]of e.entries())yield[r,i,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${e0(t)}`})}function e7(){return e5("boolean",t=>"boolean"==typeof t)}function e9(t){return e5("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${e0(e)}`)}function rt(t){let e=e0(t),r=typeof t;return new e6({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${e}\`, but received: ${e0(r)}`})}function re(t){return new e6({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})}function rr(){return e5("number",t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${e0(t)}`)}function ri(t){return new e6({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function rn(t,e){return new e6({type:"record",schema:null,*entries(r){if(eX(r))for(let i in r){let n=r[i];yield[i,i,t],yield[i,n,e]}},validator:t=>eQ(t)||`Expected an object, but received: ${e0(t)}`,coercer:t=>eQ(t)?{...t}:t})}function ro(){return e5("string",t=>"string"==typeof t||`Expected a string, but received: ${e0(t)}`)}function rs(t){let e=e5("never",()=>!1);return new e6({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let i=Math.max(t.length,r.length);for(let n=0;n<i;n++)yield[n,r[n],t[n]||e]}},validator:t=>Array.isArray(t)||`Expected an array, but received: ${e0(t)}`,coercer:t=>Array.isArray(t)?t.slice():t})}function ra(t){let e=Object.keys(t);return new e6({type:"type",schema:t,*entries(r){if(eX(r))for(let i of e)yield[i,r[i],t[i]]},validator:t=>eQ(t)||`Expected an object, but received: ${e0(t)}`,coercer:t=>eQ(t)?{...t}:t})}function ru(t){let e=t.map(t=>t.type).join(" | ");return new e6({type:"union",schema:null,coercer(e,r){for(let i of t){let[t,n]=i.validate(e,{coerce:!0,mask:r.mask});if(!t)return n}return e},validator(r,i){let n=[];
vendor: 5,299 bytes, line 1
1for(let e of t){let[...t]=e2(r,e,i),[o]=t;if(!o[0])return[];for(let[e]of t)e&&n.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${e0(r)}`,...n]}})}function rl(){return e5("unknown",()=>!0)}function rf(t,e,r){return new e6({...t,coercer:(i,n)=>e3(i,e)[0]?t.coercer(i,n):t.coercer(r(i,n),n)})}var rc=t.i(78217),rh=t.i(78492);let rd=rh.default;t.s(["default",0,rd],95932);var rp=rh,rg=class extends rp.default{socket;constructor(t,e){super(),this.socket=new window.WebSocket(t,e.protocols),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=t=>this.emit("message",t.data),this.socket.onerror=t=>this.emit("error",t),this.socket.onclose=t=>{this.emit("close",t.code,t.reason)}}send(t,e,r){let i=r||e;try{this.socket.send(t),i()}catch(t){i(t)}}close(t,e){this.socket.close(t,e)}addEventListener(t,e,r){this.socket.addEventListener(t,e,r)}},ry=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},rm=class extends rp.default{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(t,e="ws://localhost:8080",{autoconnect:r=!0,reconnect:i=!0,reconnect_interval:n=1e3,max_reconnects:o=5,...s}={},a,u){super(),this.webSocketFactory=t,this.queue={},this.rpc_id=0,this.address=e,this.autoconnect=r,this.ready=!1,this.reconnect=i,this.reconnect_timer_id=void 0,this.reconnect_interval=n,this.max_reconnects=o,this.rest_options=s,this.current_reconnects=0,this.generate_request_id=a||(()=>"number"==typeof this.rpc_id?++this.rpc_id:Number(this.rpc_id)+1),u?this.dataPack=u:this.dataPack=new ry,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(t,e,r,i){return i||"object"!=typeof r||(i=r,r=null),new Promise((n,o)=>{if(!this.ready)return o(Error("socket not ready"));let s=this.generate_request_id(t,e);this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e||void 0,id:s}),i,t=>{if(t)return o(t);this.queue[s]={promise:[n,o]},r&&(this.queue[s].timeout=setTimeout(()=>{delete this.queue[s],o(Error("reply timeout"))},r))})})}async login(t){let e=await this.call("rpc.login",t);if(!e)throw Error("authentication failed");return e}async listMethods(){return await this.call("__listMethods")}notify(t,e){return new Promise((r,i)=>{if(!this.ready)return i(Error("socket not ready"));this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e}),t=>{if(t)return i(t);r()})})}async subscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.on",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed subscribing to an event '"+t+"' with: "+e[t]);return e}async unsubscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.off",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed unsubscribing from an event with: "+e);return e}close(t,e){this.socket&&this.socket.close(t||1e3,e)}setAutoReconnect(t){this.reconnect=t}setReconnectInterval(t){this.reconnect_interval=t}setMaxReconnects(t){this.max_reconnects=t}getCurrentReconnects(){return this.current_reconnects}getMaxReconnects(){return this.max_reconnects}isReconnecting(){return void 0!==this.reconnect_timer_id}willReconnect(){return this.reconnect&&(0===this.max_reconnects||this.current_reconnects<this.max_reconnects)}_connect(t,e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:t})=>{t instanceof ArrayBuffer&&(t=l.Buffer.from(t).toString());try{t=this.dataPack.decode(t)}catch(t){return}if(t.notification&&this.listeners(t.notification).length){if(!Object.keys(t.params).length)return this.emit(t.notification);let e=[t.notification];if(t.params.constructor===Object)e.push(t.params);else for(let r=0;r<t.params.length;r++)e.push(t.params[r]);return Promise.resolve().then(()=>{this.emit.apply(this,e)})}if(!this.queue[t.id])return t.method?Promise.resolve().then(()=>{this.emit(t.method,t?.params)}):void 0;"error"in t=="result"in t&&this.queue[t.id].promise[1](Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[t.id].timeout&&clearTimeout(this.queue[t.id].timeout),t.error?this.queue[t.id].promise[1](t.error):this.queue[t.id].promise[0](t.result),delete this.queue[t.id]}),this.socket.addEventListener("error",t=>this.emit("error",t)),this.socket.addEventListener("close",({code:r,reason:i})=>{this.ready&&setTimeout(()=>this.emit("close",r,i),0),this.ready=!1,this.socket=void 0,1e3!==r&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||0===this.max_reconnects)?this.reconnect_timer_id=setTimeout(()=>this._connect(t,e),this.reconnect_interval):this.reconnect&&this.max_reconnects>0&&this.current_reconnects>=this.max_reconnects&&setTimeout(()=>
1this.emit("max_reconnects_reached",r,i),1))})}};let rb=BigInt(0),rw=BigInt(1),rv=BigInt(2),rx=BigInt(7),rS=BigInt(256),rE=BigInt(113),rk=[],rB=[],rA=[];for(let t=0,e=rw,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],rk.push(2*(5*i+r)),rB.push((t+1)*(t+2)/2%64);let n=rb;for(let t=0;t<7;t++)(e=(e<<rw^(e>>rx)*rE)%rS)&rv&&(n^=rw<<(rw<<BigInt(t))-rw);rA.push(n)}let rI=z(rA,!0),r_=rI[0],rM=rI[1],rO=(t,e,r)=>r>32?e<<r-32|t>>>64-r:t<<r|e>>>32-r,rR=(t,e,r)=>r>32?t<<r-32|e>>>64-r:e<<r|t>>>32-r;class rT extends M{constructor(t,e,r,i=!1,n=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=i,this.rounds=n,h(r),!(0<t&&t<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}(this.state)}clone(){return this._cloneInto()}keccak(){v(this.state32),function(t,e=24){let r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){let i=(e+8)%10,n=(e+2)%10,o=r[n],s=r[n+1],a=rO(o,s,1)^r[i],u=rR(o,s,1)^r[i+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=u}let e=t[2],n=t[3];for(let r=0;r<24;r++){let i=rB[r],o=rO(e,n,i),s=rR(e,n,i),a=rk[r];e=t[a],n=t[a+1],t[a]=o,t[a+1]=s}for(let e=0;e<50;e+=10){for(let i=0;i<10;i++)r[i]=t[e+i];for(let i=0;i<10;i++)t[e+i]^=~r[(i+2)%10]&r[(i+4)%10]}t[0]^=r_[i],t[1]^=rM[i]}m(r)}(this.state32,this.rounds),v(this.state32),this.posOut=0,this.pos=0}update(t){g(this),d(t=I(t));let{blockLen:e,state:r}=this,i=t.length;for(let n=0;n<i;){let o=Math.min(e-this.pos,i-n);for(let e=0;e<o;e++)r[this.pos++]^=t[n++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:r,blockLen:i}=this;t[r]^=e,(128&e)!=0&&r===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){g(this,!1),d(t),this.finish();let e=this.state,{blockLen:r}=this;for(let i=0,n=t.length;i<n;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,n-i);t.set(e.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return h(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(y(t,this),this.finished)throw Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,m(this.state)}_cloneInto(t){let{blockLen:e,suffix:r,outputLen:i,rounds:n,enableXOF:o}=this;return t||(t=new rT(e,r,i,o,n)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=n,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}}let rU=O(()=>new rT(136,1,32));class rL extends M{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,p(t);const r=I(e);if(this.iHash=t.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;const i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?t.create().update(r).digest():r);for(let t=0;t<n.length;t++)n[t]^=54;this.iHash.update(n),this.oHash=t.create();for(let t=0;t<n.length;t++)n[t]^=106;this.oHash.update(n),m(n)}update(t){return g(this),this.iHash.update(t),this}digestInto(t){g(this),d(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:s}=this;return t.finished=i,t.destroyed=n,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let rP=(t,e,r)=>new rL(t,e).update(r).digest();rP.create=(t,e)=>new rL(t,e);let rC=(t,e)=>(t+(t>=0?e:-e)/rK)/e;function rN(t){if(!["compact","recovered","der"].includes(t))throw Error('Signature format must be "compact", "recovered", or "der"');return t}function rq(t,e){let r={};for(let i of Object.keys(e))r[i]=void 0===t[i]?e[i]:t[i];return th(r.lowS,"lowS"),th(r.prehash,"prehash"),void 0!==r.format&&rN(r.format),r}
vendor: 6,262 bytes, line 1
1let rz={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(t,e)=>{let{Err:r}=rz;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(1&e.length)throw new r("tlv.encode: unpadded data");let i=e.length/2,n=tp(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?tp(n.length/2|128):"";return tp(t)+o+n+e},decode(t,e){let{Err:r}=rz,i=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[i++]!==t)throw new r("tlv.decode: wrong tlv");let n=e[i++],o=0;if(128&n){let t=127&n;if(!t)throw new r("tlv.decode(long): indefinite length not supported");if(t>4)throw new r("tlv.decode(long): byte length is too big");let s=e.subarray(i,i+t);if(s.length!==t)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let t of s)o=o<<8|t;if(i+=t,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=n;let s=e.subarray(i,i+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(i+o)}}},_int:{encode(t){let{Err:e}=rz;if(t<rW)throw new e("integer: negative integers are not allowed");let r=tp(t);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=rz;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return ty(t)}},toSig(t){let{Err:e,_int:r,_tlv:i}=rz,n=tv("signature",t),{v:o,l:s}=i.decode(48,n);if(s.length)throw new e("invalid signature: left bytes after parsing");let{v:a,l:u}=i.decode(2,o),{v:l,l:f}=i.decode(2,u);if(f.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(t){let{_tlv:e,_int:r}=rz,i=e.encode(2,r.encode(t.r)),n=e.encode(2,r.encode(t.s));return e.encode(48,i+n)}},rW=BigInt(0),rF=BigInt(1),rK=BigInt(2),rj=BigInt(3),rD=BigInt(4);function r$(t,e){let r,{BYTES:i}=t;if("bigint"==typeof e)r=e;else{let n=tv("private key",e);try{r=t.fromBytes(n)}catch(t){throw Error(`invalid private key: expected ui8a of size ${i}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw Error("invalid private key: out of range [1..N-1]");return r}function rV(t){return Uint8Array.of(t?2:3)}function rH(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}let rZ={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},rG={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},rY=BigInt(0),rJ=BigInt(2),rX=tX(rZ.p,{sqrt:function(t){let e=rZ.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),u=BigInt(88),l=t*t*t%e,f=l*l*t%e,c=tW(f,r,e)*f%e,h=tW(c,r,e)*f%e,d=tW(h,rJ,e)*l%e,p=tW(d,n,e)*d%e,g=tW(p,o,e)*p%e,y=tW(g,a,e)*g%e,m=tW(y,u,e)*y%e,b=tW(m,a,e)*g%e,w=tW(b,r,e)*f%e,v=tW(w,s,e)*p%e,x=tW(v,i,e)*l%e,S=tW(x,rJ,e);if(!rX.eql(rX.sqr(S),t))throw Error("Cannot find square root");return S}}),rQ=(n={...rZ,Fp:rX,lowS:!0,endo:rG},{...(e=t=>(function(t){let e,{CURVE:r,curveOpts:i,hash:n,ecdsaOpts:o}=function(t){let e,r,i,n,{CURVE:o,curveOpts:s}=(e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r=t.Fp,i=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(t=>Math.ceil(t/2)))):void 0,n={Fp:r,Fn:tX(e.n,{BITS:t.nBitLength,allowedLengths:i,modFromBytes:t.wrapPrivateKey}),allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes},{CURVE:e,curveOpts:n}),a={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:o,curveOpts:s,hash:t.hash,ecdsaOpts:a}}(t),s=function(t,e,r={}){p(e),tA(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let i=r.randomBytes||R,n=r.hmac||((t,...r)=>rP(e,t,_(...r))),{Fp:o,Fn:s}=t,{ORDER:a,BITS:u}=s,{keygen:l,getPublicKey:f,getSharedSecret:h,utils:d,lengths:g}=function(t,e={}){let{Fn:r}=t,i=e.randomBytes||R,n=Object.assign(rH(t.Fp,r),{seed:t0(r.ORDER)});function o(t){try{return!!r$(r,t)}catch(t){return!1}}function s(t=i(n.seed)){return function(t,e,r=!1){let i=t.length,n=tQ(e),o=t0(e);if(i<16||i<o||i>1024)throw Error("expected "+o+"-1024 bytes of input, got "+i);let s=tz(r?tm(t):ty(t),e-tO)+tO;return r?tw(s,n):tb(s,n)}(td(t,n.seed,"seed"),r.ORDER)}function a(e,i=!0){return t.BASE.multiply(r$(r,e)).toBytes(i)}function u(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;let{secretKey:i,publicKey:o,publicKeyUncompressed:s}=n;if(r.allowedLengths||i===o)return;let a=tv("key",e).length;return a===o||a===s}return Object.freeze({getPublicKey:a,getSharedSecret:function(e,i,n=!0){if(!0===u(e))throw Error("first arg must be private key");if(!1===u(i))throw Error("second arg must be public key");let o=r$(r,e);return t.fromHex(i).multiply(o).toBytes(n)},keygen:function(t){let e=s(t);return{secretKey:e,publicKey:a(e)}},Point:t,utils:{isValidSecretKey:o,isValidPublicKey:function(e,r){let{publicKey:i,publicKeyUncompressed:o}=n;try{let n=e.length;if(!0===r&&n!==i||!1===r&&n!==o)return!1;return!!t.fromBytes(e)}catch(t){return!1}},randomSecretKey:s,isValidPrivateKey:o,randomPrivateKey:s,normPrivateKeyToScalar:t=>r$(r,t),precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)},lengths:n})}(t,r),y={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},m="compact";function b(t,e){if(!s.isValidNot0(e))throw Error(`invalid signature ${t}: out of range 1..Point.Fn.ORDER`);return e}class w{constructor(t,e,r){this.r=b("r",t),this.s=b("s",e),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(t,e=m){var r,i;let n,o;
vendor: 6,055 bytes, line 1
1if(r=t,rN(i=e),o=g.signature,td(r,"compact"===i?o:"recovered"===i?o+1:void 0,`${i} signature`),"der"===e){let{r:e,s:r}=rz.toSig(td(t));return new w(e,r)}"recovered"===e&&(n=t[0],e="compact",t=t.subarray(1));let a=s.BYTES,u=t.subarray(0,a),l=t.subarray(a,2*a);return new w(s.fromBytes(u),s.fromBytes(l),n)}static fromHex(t,e){return this.fromBytes(B(t),e)}addRecoveryBit(t){return new w(this.r,this.s,t)}recoverPublicKey(e){let r=o.ORDER,{r:i,s:n,recovery:u}=this;if(null==u||![0,1,2,3].includes(u))throw Error("recovery id invalid");if(a*rK<r&&u>1)throw Error("recovery id is ambiguous for h>1 curve");let l=2===u||3===u?i+a:i;if(!o.isValid(l))throw Error("recovery id 2 or 3 invalid");let f=o.toBytes(l),c=t.fromBytes(_(rV((1&u)==0),f)),h=s.inv(l),d=x(tv("msgHash",e)),p=s.create(-d*h),g=s.create(n*h),y=t.BASE.multiplyUnsafe(p).add(c.multiplyUnsafe(g));if(y.is0())throw Error("point at infinify");return y.assertValidity(),y}hasHighS(){return this.s>a>>rF}toBytes(t=m){if(rN(t),"der"===t)return B(rz.hexFromSig(this));let e=s.toBytes(this.r),r=s.toBytes(this.s);if("recovered"===t){if(null==this.recovery)throw Error("recovery bit must be present");return _(Uint8Array.of(this.recovery),e,r)}return _(e,r)}toHex(t){return E(this.toBytes(t))}assertValidity(){}static fromCompact(t){return w.fromBytes(tv("sig",t),"compact")}static fromDER(t){return w.fromBytes(tv("sig",t),"der")}normalizeS(){return this.hasHighS()?new w(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return E(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return E(this.toBytes("compact"))}}let v=r.bits2int||function(t){if(t.length>8192)throw Error("input is too large");let e=ty(t),r=8*t.length-u;return r>0?e>>BigInt(r):e},x=r.bits2int_modN||function(t){return s.create(v(t))},S=tB(u);function k(t){return tE("num < 2^"+u,t,rW,S),s.toBytes(t)}function A(t,r){return td(t,void 0,"message"),r?td(e(t),void 0,"prehashed message"):t}return Object.freeze({keygen:l,getPublicKey:f,getSharedSecret:h,utils:d,lengths:g,Point:t,sign:function(r,o,u={}){let{seed:l,k2sig:f}=function(e,r,n){if(["recovered","canonical"].some(t=>t in n))throw Error("sign() legacy options not supported");let{lowS:o,prehash:u,extraEntropy:l}=rq(n,y),f=x(e=A(e,u)),c=r$(s,r),h=[k(c),k(f)];if(null!=l&&!1!==l){let t=!0===l?i(g.secretKey):l;h.push(tv("extraEntropy",t))}return{seed:_(...h),k2sig:function(e){let r=v(e);if(!s.isValidNot0(r))return;let i=s.inv(r),n=t.BASE.multiply(r).toAffine(),u=s.create(n.x);if(u===rW)return;let l=s.create(i*s.create(f+u*c));if(l===rW)return;let h=2*(n.x!==u)|Number(n.y&rF),d=l;return o&&l>a>>rF&&(d=s.neg(l),h^=1),new w(u,d,h)}}}(r=tv("message",r),o,u);return(function(t,e,r){if("number"!=typeof t||t<2)throw Error("hashLen must be a number");if("number"!=typeof e||e<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let i=t=>new Uint8Array(t),n=i(t),o=i(t),s=0,a=()=>{n.fill(1),o.fill(0),s=0},u=(...t)=>r(o,n,...t),l=(t=i(0))=>{(o=u(Uint8Array.of(0),t),n=u(),0!==t.length)&&(o=u(Uint8Array.of(1),t),n=u())},f=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(n=u()).slice();r.push(e),t+=n.length}return _(...r)};return(t,e)=>{let r;for(a(),l(t);!(r=e(f()));)l();return a(),r}})(e.outputLen,s.BYTES,n)(l,f)},verify:function(e,r,i,n={}){let{lowS:o,prehash:a,format:u}=rq(n,y);if(i=tv("publicKey",i),r=A(tv("message",r),a),"strict"in n)throw Error("options.strict was renamed to lowS");let l=void 0===u?function(t){let e,r="string"==typeof t||c(t),i=!r&&null!==t&&"object"==typeof t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!r&&!i)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(i)e=new w(t.r,t.s);else if(r){try{e=w.fromBytes(tv("sig",t),"der")}catch(t){if(!(t instanceof rz.Err))throw t}if(!e)try{e=w.fromBytes(tv("sig",t),"compact")}catch(t){return!1}}return!!e&&e}(e):w.fromBytes(tv("sig",e),u);if(!1===l)return!1;try{let e=t.fromBytes(i);if(o&&l.hasHighS())return!1;let{r:n,s:a}=l,u=x(r),f=s.inv(a),c=s.create(u*f),h=s.create(n*f),d=t.BASE.multiplyUnsafe(c).add(e.multiplyUnsafe(h));if(d.is0())return!1;return s.create(d.x)===n}catch(t){return!1}},recoverPublicKey:function(t,e,r={}){let{prehash:i}=rq(r,y);return e=A(e,i),w.fromBytes(t,"recovered").recoverPublicKey(e).toBytes()},Signature:w,hash:e})}(function(t,e={}){let r=eo("weierstrass",t,e),{Fp:i,Fn:n}=r,o=r.CURVE,{h:s,n:a}=o;tA(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:u}=e;if(u&&(!i.is0(o.a)||"bigint"!=typeof u.beta||!Array.isArray(u.basises)))throw Error('invalid endo: expected "beta": bigint and "basises": array');let l=rH(i,n);function f(){if(!i.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let c=e.toBytes||function(t,e,r){let{x:n,y:o}=e.toAffine(),s=i.toBytes(n);return(th(r,"isCompressed"),r)?(f(),_(rV(!i.isOdd(o)),s)):_(Uint8Array.of(4),s,i.toBytes(o))},h=e.fromBytes||function(t){td(t,void 0,"Point");let{publicKey:e,publicKeyUncompressed:r}=l,n=t.length,o=t[0],s=t.subarray(1);if(n===e&&(2===o||3===o)){let t,e=i.fromBytes(s);if(!i.isValid(e))throw Error("bad point: is not on curve, wrong x");let r=d(e);try{t=i.sqrt(r)}catch(t){throw Error("bad point: is not on curve, sqrt error"+(t instanceof Error?": "+t.message:""))}return f(),(1&o)==1!==i.isOdd(t)&&(t=i.neg(t)),{x:e,y:t}}if(n===r&&4===o){let t=i.BYTES,e=i.fromBytes(s.subarray(0,t)),r=i.fromBytes(s.subarray(t,2*t));if(!p(e,r))throw Error("bad point: is not on curve");return{x:e,y:r}}throw Error(`bad point: got length ${n}, expected compressed=${e} or uncompressed=${r}`)};function d(t){let e=i.sqr(t),r=i.mul(e,t);return i.add(i.add(r,i.mul(t,o.a)),o.b)}function p(t,e){let r=i.sqr(e),n=d(t);return i.eql(r,n)}if(!p(o.Gx,o.Gy))throw Error("bad curve params: generator point");let g=i.mul(i.pow(o.a,rj),rD),y=i.mul(i.sqr(o.b),BigInt(27));
vendor: 3,221 bytes, line 1
1if(i.is0(i.add(g,y)))throw Error("bad curve params: a or b");function m(t,e,r=!1){if(!i.isValid(e)||r&&i.is0(e))throw Error(`bad point coordinate ${t}`);return e}function b(t){if(!(t instanceof k))throw Error("ProjectivePoint expected")}function w(t){if(!u||!u.basises)throw Error("no endo");return function(t,e,r){let[[i,n],[o,s]]=e,a=rC(s*t,r),u=rC(-n*t,r),l=t-a*i-u*o,f=-a*n-u*s,c=l<rW,h=f<rW;c&&(l=-l),h&&(f=-f);let d=tB(Math.ceil(tk(r)/2))+rF;if(l<rW||l>=d||f<rW||f>=d)throw Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:c,k1:l,k2neg:h,k2:f}}(t,u.basises,n.ORDER)}let v=t_((t,e)=>{let{X:r,Y:n,Z:o}=t;if(i.eql(o,i.ONE))return{x:r,y:n};let s=t.is0();null==e&&(e=s?i.ONE:i.inv(o));let a=i.mul(r,e),u=i.mul(n,e),l=i.mul(o,e);if(s)return{x:i.ZERO,y:i.ZERO};if(!i.eql(l,i.ONE))throw Error("invZ was invalid");return{x:a,y:u}}),x=t_(t=>{if(t.is0()){if(e.allowInfinityPoint&&!i.is0(t.Y))return;throw Error("bad point: ZERO")}let{x:r,y:n}=t.toAffine();if(!i.isValid(r)||!i.isValid(n))throw Error("bad point: x or y not field elements");if(!p(r,n))throw Error("bad point: equation left != right");if(!t.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function S(t,e,r,n,o){return r=new k(i.mul(r.X,t),r.Y,r.Z),e=t6(n,e),r=t6(o,r),e.add(r)}class k{constructor(t,e,r){this.X=m("x",t),this.Y=m("y",e,!0),this.Z=m("z",r),Object.freeze(this)}static CURVE(){return o}static fromAffine(t){let{x:e,y:r}=t||{};if(!t||!i.isValid(e)||!i.isValid(r))throw Error("invalid affine point");if(t instanceof k)throw Error("projective point not allowed");return i.is0(e)&&i.is0(r)?k.ZERO:new k(e,r,i.ONE)}static fromBytes(t){let e=k.fromAffine(h(td(t,void 0,"point")));return e.assertValidity(),e}static fromHex(t){return k.fromBytes(tv("pointHex",t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return A.createCache(this,t),e||this.multiply(rj),this}assertValidity(){x(this)}hasEvenY(){let{y:t}=this.toAffine();if(!i.isOdd)throw Error("Field doesn't support isOdd");return!i.isOdd(t)}equals(t){b(t);let{X:e,Y:r,Z:n}=this,{X:o,Y:s,Z:a}=t,u=i.eql(i.mul(e,a),i.mul(o,n)),l=i.eql(i.mul(r,a),i.mul(s,n));return u&&l}negate(){return new k(this.X,i.neg(this.Y),this.Z)}double(){let{a:t,b:e}=o,r=i.mul(e,rj),{X:n,Y:s,Z:a}=this,u=i.ZERO,l=i.ZERO,f=i.ZERO,c=i.mul(n,n),h=i.mul(s,s),d=i.mul(a,a),p=i.mul(n,s);return p=i.add(p,p),f=i.mul(n,a),f=i.add(f,f),u=i.mul(t,f),l=i.mul(r,d),l=i.add(u,l),u=i.sub(h,l),l=i.add(h,l),l=i.mul(u,l),u=i.mul(p,u),f=i.mul(r,f),d=i.mul(t,d),p=i.sub(c,d),p=i.mul(t,p),p=i.add(p,f),f=i.add(c,c),c=i.add(f,c),c=i.add(c,d),c=i.mul(c,p),l=i.add(l,c),d=i.mul(s,a),d=i.add(d,d),c=i.mul(d,p),u=i.sub(u,c),f=i.mul(d,h),f=i.add(f,f),new k(u,l,f=i.add(f,f))}add(t){b(t);let{X:e,Y:r,Z:n}=this,{X:s,Y:a,Z:u}=t,l=i.ZERO,f=i.ZERO,c=i.ZERO,h=o.a,d=i.mul(o.b,rj),p=i.mul(e,s),g=i.mul(r,a),y=i.mul(n,u),m=i.add(e,r),w=i.add(s,a);m=i.mul(m,w),w=i.add(p,g),m=i.sub(m,w),w=i.add(e,n);let v=i.add(s,u);return w=i.mul(w,v),v=i.add(p,y),w=i.sub(w,v),v=i.add(r,n),l=i.add(a,u),v=i.mul(v,l),l=i.add(g,y),v=i.sub(v,l),c=i.mul(h,w),l=i.mul(d,y),c=i.add(l,c),l=i.sub(g,c),c=i.add(g,c),f=i.mul(l,c),g=i.add(p,p),g=i.add(g,p),y=i.mul(h,y),w=i.mul(d,w),g=i.add(g,y
1),y=i.sub(p,y),y=i.mul(h,y),w=i.add(w,y),p=i.mul(g,w),f=i.add(f,p),p=i.mul(v,w),l=i.mul(m,l),l=i.sub(l,p),p=i.mul(m,g),c=i.mul(v,c),new k(l,f,c=i.add(c,p))}subtract(t){return this.add(t.negate())}is0(){return this.equals(k.ZERO)}multiply(t){let r,i,{endo:o}=e;if(!n.isValidNot0(t))throw Error("invalid scalar: out of range");let s=t=>A.cached(this,t,t=>t8(k,t));if(o){let{k1neg:e,k1:n,k2neg:a,k2:u}=w(t),{p:l,f:f}=s(n),{p:c,f:h}=s(u);i=f.add(h),r=S(o.beta,l,c,e,a)}else{let{p:e,f:n}=s(t);r=e,i=n}return t8(k,[r,i])[0]}multiplyUnsafe(t){let{endo:r}=e;if(!n.isValid(t))throw Error("invalid scalar: out of range");if(t===rW||this.is0())return k.ZERO;if(t===rF)return this;if(A.hasCache(this))return this.multiply(t);if(!r)return A.unsafe(this,t);{let{k1neg:e,k1:i,k2neg:n,k2:o}=w(t),{p1:s,p2:a}=function(t,e,r,i){let n=e,o=t.ZERO,s=t.ZERO;for(;r>t1||i>t1;)r&t2&&(o=o.add(n)),i&t2&&(s=s.add(n)),n=n.double(),r>>=t2,i>>=t2;return{p1:o,p2:s}}(k,this,i,o);return S(r.beta,s,a,e,n)}}multiplyAndAddUnsafe(t,e,r){let i=this.multiplyUnsafe(e).add(t.multiplyUnsafe(r));return i.is0()?void 0:i}toAffine(t){return v(this,t)}isTorsionFree(){let{isTorsionFree:t}=e;return s===rF||(t?t(k,this):A.unsafe(this,a).is0())}clearCofactor(){let{clearCofactor:t}=e;return s===rF?this:t?t(k,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(t=!0){return th(t,"isCompressed"),this.assertValidity(),c(k,this,t)}toHex(t=!0){return E(this.toBytes(t))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(t=!0){return this.toBytes(t)}_setWindowSize(t){this.precompute(t)}static normalizeZ(t){return t8(k,t)}static msm(t,e){return ei(k,n,t,e)}static fromPrivateKey(t){return k.BASE.multiply(r$(n,t))}}k.BASE=new k(o.Gx,o.Gy,i.ONE),k.ZERO=new k(i.ZERO,i.ONE,i.ZERO),k.Fp=i,k.Fn=n;let B=n.BITS,A=new er(k,e.endo?Math.ceil(B/2):B);return k.BASE.precompute(8),k}(r,i),n,o);return e=s.Point,Object.assign({},s,{ProjectivePoint:e,CURVE:Object.assign({},t,tJ(e.Fn.ORDER,e.Fn.BITS))})})({...n,hash:t}))(tu),create:e});rQ.Point;let r0=(r=[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(t=>BigInt(t))).map(t=>Array.from(t).reverse()),(t,e)=>{let[i,n,o,s]=r.map(e=>e.reduce((e,r)=>rX.add(rX.mul(e,t),r))),[a,u]=tG(rX,[n,s],!0);return t=rX.mul(i,a),e=rX.mul(e,rX.mul(o,u)),{x:t,y:e}}),r1=function(t,e){tZ(t);let{A:r,B:i,Z:n}=e;if(!t.isValid(r)||!t.isValid(i)||!t.isValid(n))throw Error("mapToCurveSimpleSWU: invalid opts");let o=function(t,e){let r=t.ORDER,i=rW;for(let t=r-rF;t%rK===rW;t/=rK)i+=rF;let n=i,o=rK<<n-rF-rF,s=o*rK,a=(r-rF)/s,u=(a-rF)/rK,l=s-rF,f=t.pow(e,a),c=t.pow(e,(a+rF)/rK),h=(e,r)=>{let i=f,s=t.pow(r,l),a=t.sqr(s);a=t.mul(a,r);let h=t.mul(e,a);h=t.pow(h,u),h=t.mul(h,s),s=t.mul(h,r),a=t.mul(h,e);let d=t.mul(a,s);h=t.pow(d,o);let p=t.eql(h,t.ONE);s=t.mul(a,c),h=t.mul(d,i),a=t.cmov(s,a,p),d=t.cmov(h,d,p);for(let e=n;e>rF;e--){let r=e-rK;r=rK<<r-rF;let n=t.pow(d,r),o=t.eql(n,t.ONE);s=t.mul(a,i),i=t.mul(i,i),n=t.mul(d,i),a=t.cmov(s,a,o),d=t.cmov(n,d,o)}return{isValid:p,value:a}};if(t.ORDER%rD===rj){let r=(t.ORDER-rj)/rD,i=t.sqrt(t.neg(e));h=(e,n)=>{let o=t.sqr(n),s=t.mul(e,n);o=t.mul(o,s);let a=t.pow(o,r);a=t.mul(a,s);let u=t.mul(a,i),l=t.mul(t.sqr(a),n),f=t.eql(l,e),c=t.cmov(u,a,f);return{isValid:f,value:c}}}return h}(t,n);if(!t.isOdd)throw Error("Field does not have .isOdd()");return e=>{let s,a,u,l,f,c,h,d;s=t.sqr(e),s=t.mul(s,n),a=t.sqr(s),a=t.add(a,s),u=t.add(a,t.ONE),u=t.mul(u,i
1),l=t.cmov(n,t.neg(a),!t.eql(a,t.ZERO)),l=t.mul(l,r),a=t.sqr(u),c=t.sqr(l),f=t.mul(c,r),a=t.add(a,f),a=t.mul(a,u),c=t.mul(c,l),f=t.mul(c,i),a=t.add(a,f),h=t.mul(s,u);let{isValid:p,value:g}=o(a,c);d=t.mul(s,e),d=t.mul(d,g),h=t.cmov(h,u,p),d=t.cmov(d,g,p);let y=t.isOdd(e)===t.isOdd(d);d=t.cmov(t.neg(d),d,y);let m=tG(t,[l],!0)[0];return{x:h=t.mul(h,m),y:d}}}(rX,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:rX.create(BigInt("-11"))});ey(rQ.Point,t=>{let{x:e,y:r}=r1(rX.create(t[0]));return r0(e,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:rX.ORDER,m:1,k:128,expand:"xmd",hash:tu}),eM.utils.randomPrivateKey;let r2=()=>{let t=eM.utils.randomPrivateKey(),e=r6(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),{publicKey:e,secretKey:r}},r6=eM.getPublicKey;function r8(t){try{return eM.ExtendedPoint.fromHex(t),!0}catch{return!1}}let r3=(t,e)=>eM.sign(t,e.slice(0,32)),r5=eM.verify,r4=t=>l.Buffer.isBuffer(t)?t:t instanceof Uint8Array?l.Buffer.from(t.buffer,t.byteOffset,t.byteLength):l.Buffer.from(t);class r7{constructor(t){Object.assign(this,t)}
1encode(){return l.Buffer.from((0,eD.serialize)(r9,this))}static decode(t){return(0,eD.deserialize)(r9,this,t)}static decodeUnchecked(t){return(0,eD.deserializeUnchecked)(r9,this,t)}}let r9=new Map,it=1;class ie extends r7{constructor(t){if(super({}),this._bn=void 0,function(t){return void 0!==t._bn}(t))this._bn=t._bn;else{if("string"==typeof t){const e=ej.default.decode(t);if(32!=e.length)throw Error("Invalid public key input");this._bn=new eK.default(e)}else this._bn=new eK.default(t);if(this._bn.byteLength()>32)throw Error("Invalid public key input")}}static unique(){let t=new ie(it);return it+=1,new ie(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return ej.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){let t=this._bn.toArrayLike(l.Buffer);if(32===t.length)return t;let e=l.Buffer.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,r){return new ie(tu(l.Buffer.concat([t.toBuffer(),l.Buffer.from(e),r.toBuffer()])))}static createProgramAddressSync(t,e){let r=l.Buffer.alloc(0);t.forEach(function(t){if(t.length>32)throw TypeError("Max seed length exceeded");r=l.Buffer.concat([r,r4(t)])});let i=tu(r=l.Buffer.concat([r,e.toBuffer(),l.Buffer.from("ProgramDerivedAddress")]));if(r8(i))throw Error("Invalid seeds, address must fall off the curve");return new ie(i)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let r,i=255;for(;0!=i;){try{let n=t.concat(l.Buffer.from([i]));r=this.createProgramAddressSync(n,e)}catch(t){if(t instanceof TypeError)throw t;i--;continue}return[r,i]}throw Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){return r8(new ie(t).toBytes())}}ie.default=new ie("11111111111111111111111111111111"),r9.set(ie,{kind:"struct",fields:[["_bn","u256"]]}),new ie("BPFLoader1111111111111111111111111111111111");class ir extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(ir.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});
vendor: 6,463 bytes, line 1
1class ii extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}}Object.defineProperty(ii.prototype,"name",{value:"TransactionExpiredTimeoutError"});class io extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}}Object.defineProperty(io.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class is{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){let t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(let e of this.keySegments())if(t<e.length)return e[t];else t-=e.length}get length(){return this.keySegments().flat().length}compileInstructions(t){if(this.length>256)throw Error("Account index overflow encountered during compilation");let e=new Map;this.keySegments().flat().forEach((t,r)=>{e.set(t.toBase58(),r)});let r=t=>{let r=e.get(t.toBase58());if(void 0===r)throw Error("Encountered an unknown instruction account key during compilation");return r};return t.map(t=>({programIdIndex:r(t.programId),accountKeyIndexes:t.keys.map(t=>r(t.pubkey)),data:t.data}))}}let ia=(t="publicKey")=>e$.blob(32,t),iu=(t="string")=>{let e=e$.struct([e$.u32("length"),e$.u32("lengthPadding"),e$.blob(e$.offset(e$.u32(),-8),"chars")],t),r=e.decode.bind(e),i=e.encode.bind(e);return e.decode=(t,e)=>r(t,e).chars.toString(),e.encode=(t,e,r)=>i({chars:l.Buffer.from(t,"utf8")},e,r),e.alloc=t=>e$.u32().span+e$.u32().span+l.Buffer.from(t,"utf8").length,e};function il(t){let e=0,r=0;for(;;){let i=t.shift();if(e|=(127&i)<<7*r,r+=1,(128&i)==0)break}return e}function ic(t,e){let r=e;for(;;){let e=127&r;if(0==(r>>=7)){t.push(e);break}e|=128,t.push(e)}}function ih(t,e){if(!t)throw Error(e||"Assertion failed")}class id{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){let r=new Map,i=t=>{let e=t.toBase58(),i=r.get(e);return void 0===i&&(i={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(e,i)),i},n=i(e);for(let e of(n.isSigner=!0,n.isWritable=!0,t))for(let t of(i(e.programId).isInvoked=!0,e.keys)){let e=i(t.pubkey);e.isSigner||=t.isSigner,e.isWritable||=t.isWritable}return new id(e,r)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];ih(t.length<=256,"Max static account keys length exceeded");let e=t.filter(([,t])=>t.isSigner&&t.isWritable),r=t.filter(([,t])=>t.isSigner&&!t.isWritable),i=t.filter(([,t])=>!t.isSigner&&t.isWritable),n=t.filter(([,t])=>!t.isSigner&&!t.isWritable),o={numRequiredSignatures:e.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:n.length};{ih(e.length>0,"Expected at least one writable signer key");let[t]=e[0];ih(t===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...e.map(([t])=>new ie(t)),...r.map(([t])=>new ie(t)),...i.map(([t])=>new ie(t)),...n.map(([t])=>new ie(t))]]}extractTableLookup(t){let[e,r]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&t.isWritable),[i,n]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&!t.isWritable);if(0!==e.length||0!==i.length)return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:i},{writable:r,readonly:n}]}drainKeysFoundInLookupTable(t,e){let r=[],i=[];for(let[n,o]of this.keyMetaMap.entries())if(e(o)){let e=new ie(n),o=t.findIndex(t=>t.equals(e));o>=0&&(ih(o<256,"Max lookup table index exceeded"),r.push(o),i.push(e),this.keyMetaMap.delete(n))}return[r,i]}}let ip="Reached end of buffer unexpectedly";function ig(t){if(0===t.length)throw Error(ip);return t.shift()}function iy(t,...e){let[r]=e;if(2===e.length?r+(e[1]??0)>t.length:r>=t.length)throw Error(ip);return t.splice(...e)}class im{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(t=>new ie(t)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:ej.default.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new is(this.staticAccountKeys)}static compile(t){let[e,r]=id.compile(t.instructions,t.payerKey).getMessageComponents(),i=new is(r).compileInstructions(t.instructions).map(t=>({programIdIndex:t.programIdIndex,accounts:t.accountKeyIndexes,data:ej.default.encode(t.data)}));return new im({header:e,accountKeys:r,recentBlockhash:t.recentBlockhash,instructions:i})}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures;if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let r=this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts;return t-e<r}}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((t,e)=>!this.isProgramId(e))}serialize(){let t=this.accountKeys.length,e=[];ic(e,t);let r=this.instructions.map(t=>{let{accounts:e,programIdIndex:r}=t,i=Array.from(ej.default.decode(t.data)),n=[];ic(n,e.length);let o=[];return ic(o,i.length),{programIdIndex:r,keyIndicesCount:l.Buffer.from(n),keyIndices:e,dataLength:l.Buffer.from(o),data:i}}),i=[];ic(i,r.length);let n=l.Buffer.alloc(1232);l.Buffer.from(i).copy(n);let o=i.length;r.forEach(t=>{let e=e$.struct([e$.u8("programIdIndex"),e$.blob(t.keyIndicesCount.length,"keyIndicesCount"),e$.seq(e$.u8("keyIndex"),t.keyIndices.length,"keyIndices"),e$.blob(t.dataLength.length,"dataLength"),e$.seq(e$.u8("userdatum"),t.data.length,"data")]).encode(t,n,o);o+=e}),n=n.slice(0,o);let s=e$.struct([e$.blob(1,"numRequiredSignatures"),e$.blob(1,"numReadonlySignedAccounts"),e$.blob(1,"numReadonlyUnsignedAccounts"),e$.blob(e.length,"keyCount"),e$.seq(ia("
1key"),t,"keys"),ia("recentBlockhash")]),a={numRequiredSignatures:l.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:l.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:l.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:l.Buffer.from(e),keys:this.accountKeys.map(t=>r4(t.toBytes())),recentBlockhash:ej.default.decode(this.recentBlockhash)},u=l.Buffer.alloc(2048),f=s.encode(a,u);return n.copy(u,f),u.slice(0,f+n.length)}static from(t){let e=[...t],r=ig(e);if(r!==(127&r))throw Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let i=ig(e),n=ig(e),o=il(e),s=[];for(let t=0;t<o;t++){let t=iy(e,0,32);s.push(new ie(l.Buffer.from(t)))}let a=iy(e,0,32),u=il(e),f=[];for(let t=0;t<u;t++){let t=ig(e),r=il(e),i=iy(e,0,r),n=il(e),o=iy(e,0,n),s=ej.default.encode(l.Buffer.from(o));f.push({programIdIndex:t,accounts:i,data:s})}return new im({header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:n},recentBlockhash:ej.default.encode(l.Buffer.from(a)),accountKeys:s,instructions:f})}}class ib{constructor(t){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let t=0;for(let e of this.addressTableLookups)t+=e.readonlyIndexes.length+e.writableIndexes.length;return t}getAccountKeys(t){let e;if(t&&"accountKeysFromLookups"in t&&t.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=t.accountKeysFromLookups.writable.length+t.accountKeysFromLookups.readonly.length)throw Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");e=t.accountKeysFromLookups}else if(t&&"addressLookupTableAccounts"in t&&t.addressLookupTableAccounts)e=this.resolveAddressTableLookups(t.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw Error("Failed to get account keys because address table lookups were not resolved");return new is(this.staticAccountKeys,e)}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(t>=r)return t-r<this.addressTableLookups.reduce((t,e)=>t+e.writableIndexes.length,0);if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let i=r-e-this.header.numReadonlyUnsignedAccounts;return t-e<i}}resolveAddressTableLookups(t){let e={writable:[],readonly:[]};for(let r of this.addressTableLookups){let i=t.find(t=>t.key.equals(r.accountKey));if(!i)throw Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(let t of r.writableIndexes)if(t<i.state.addresses.length)e.writable.push(i.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`);for(let t of r.readonlyIndexes)if(t<i.state.addresses.length)e.readonly.push(i.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`)}return e}static compile(t){let e=id.compile(t.instructions,t.payerKey),r=[],i={writable:[],readonly:[]};for(let n of t.addressLookupTableAccounts||[]){let t=e.extractTableLookup(n);if(void 0!==t){let[e,{writable:n,readonly:o}]=t;r.push(e),i.writable.push(...n),i.readonly.push(...o)}}let[n,o]=e.getMessageComponents(),s=new is(o,i).compileInstructions(t.instructions);return new ib({header:n,staticAccountKeys:o,recentBlockhash:t.recentBlockhash,compiledInstructions:s,addressTableLookups:r})}serialize(){let t=[];ic(t,this.staticAccountKeys.length);let e=this.serializeInstructions(),r=[];ic(r,this.compiledInstructions.length);let i=this.serializeAddressTableLookups(),n=[];ic(n,this.addressTableLookups.length);let o=e$.struct([e$.u8("prefix"),e$.struct([e$.u8("numRequiredSignatures"),e$.u8("numReadonlySignedAccounts"),e$.u8("numReadonlyUnsignedAccounts")],"header"),e$.blob(t.length,"staticAccountKeysLength"),e$.seq(ia(),this.staticAccountKeys.length,"staticAccountKeys"),ia("recentBlockhash"),e$.blob(r.length,"instructionsLength"),e$.blob(e.length,"serializedInstructions"),e$.blob(n.length,"addressTableLookupsLength"),e$.blob(i.length,"serializedAddressTableLookups")]),s=new Uint8Array(1232),a=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(t),staticAccountKeys:this.staticAccountKeys.map(t=>t.toBytes()),recentBlockhash:ej.default.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:e,addressTableLookupsLength:new Uint8Array(n),serializedAddressTableLookups:i},s);return s.slice(0,a)}serializeInstructions(){let t=0,e=new Uint8Array(1232);for(let r of this.compiledInstructions){let i=[];ic(i,r.accountKeyIndexes.length);let n=[];ic(n,r.data.length);let o=e$.struct([e$.u8("programIdIndex"),e$.blob(i.length,"encodedAccountKeyIndexesLength"),e$.seq(e$.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),e$.blob(n.length,"encodedDataLength"),e$.blob(r.data.length,"data")]);t+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(i),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(n),data:r.data},e,t)}return e.slice(0,t)}serializeAddressTableLookups(){let t=0,e=new Uint8Array(1232);for(let r of this.addressTableLookups){let i=[];ic(i,r.writableIndexes.length);let n=[];ic(n,r.readonlyIndexes.length);let o=e$.struct([ia("accountKey"),e$.blob(i.length,"encodedWritableIndexesLength"),e$.seq(e$.u8(),r.writableIndexes.length,"writableIndexes"),e$.blob(n.length,"encodedReadonlyIndexesLength"),e$.seq(e$.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);t+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(i),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(n),readonlyIndexes:r.readonlyIndexes},e,t)}return e.slice(0,t)}static deserialize(t){let e=[...t],r=ig(e),i=127&r;ih(r!==i,"Expected versioned message but received legacy message"),ih(0===i,`Expected versioned message with version 0 but found version ${i}`);let n={numRequiredSignatures:ig(e),numReadonlySignedAccounts:ig(e),numReadonlyUnsignedAccounts:ig(e)},o=[],s=il(e);for(let t=0;t<s;t++)o.push(new ie(iy(e,0,32)));let a=ej.default.encode(iy(e,0,32)),u=il(e),l=[];for(let t=0;t<u;t++){let t=ig(e),r=il(e),i=iy(e,0,r),n=il(e),o=new Uint8Array(iy(e,0,n));l.push({programIdIndex:t,accountKeyIndexes:i,data:o})}let f=il(e),c=[];for(let t=0;t<f;t++){let t=new ie(iy(e,0,32)),r=il(e),i=iy(e,0,r),n=il(e),o=iy(e,0,n);c.push({accountKey:t,writableIndexes:i,readonlyIndexes:o})}return new ib({header:n,staticAccountKeys:o,recentBlockhash:a,compiledInstructions:l,addressTableLookups:c})}}let iw={deserializeMessageVersion(t){let e=t[0],r=127&e;return r===e?"legacy":r},deserialize:t=>{let e=iw.deserializeMessageVersion(t);if("legacy"===e)return im.from(t);if(0===e)return ib.deserialize(t);throw Error(`Transaction message version ${e} deserialization is not supported`)}},iv=((o={})[o.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",o[o.PROCESSED=1]="PROCESSED",o[o.TIMED_OUT=2]="TIMED_OUT",o[o.NONCE_INVALID=3]="NONCE_INVALID",o),ix=l.Buffer.alloc(64).fill(0);class iS{constructor(t){this.keys=void 0,this.programId=void 0,this.data=l.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map(({pubkey:t,isSigner:e,isWritable:r})=>({pubkey:t.toJSON(),isSigner:e,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class iE{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!t)return;if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){const{minContextSlot:e,nonceInfo:r}=t;this.minNonceContextSlot=e,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){const{blockhash:e,lastValidBlockHeight:r}=t;this.recentBlockhash=e,this.lastValidBlockHeight=r}else{const{recentBlockhash:e,nonceInfo:r}=t;r&&(this.nonceInfo=r),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstru
vendor: 4,683 bytes, line 1
1ction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(0===t.length)throw Error("No instructions");return t.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new iS(t))}),this}compileMessage(){let t,e,r;if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;if(this.nonceInfo?(t=this.nonceInfo.nonce,e=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw Error("Transaction recentBlockhash required");if(e.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw Error("Transaction fee payer required");for(let t=0;t<e.length;t++)if(void 0===e[t].programId)throw Error(`Transaction instruction index ${t} has undefined program id`);let i=[],n=[];e.forEach(t=>{t.keys.forEach(t=>{n.push({...t})});let e=t.programId.toString();i.includes(e)||i.push(e)}),i.forEach(t=>{n.push({pubkey:new ie(t),isSigner:!1,isWritable:!1})});let o=[];n.forEach(t=>{let e=t.pubkey.toString(),r=o.findIndex(t=>t.pubkey.toString()===e);r>-1?(o[r].isWritable=o[r].isWritable||t.isWritable,o[r].isSigner=o[r].isSigner||t.isSigner):o.push(t)}),o.sort(function(t,e){return t.isSigner!==e.isSigner?t.isSigner?-1:1:t.isWritable!==e.isWritable?t.isWritable?-1:1:t.pubkey.toBase58().localeCompare(e.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})});let s=o.findIndex(t=>t.pubkey.equals(r));if(s>-1){let[t]=o.splice(s,1);t.isSigner=!0,t.isWritable=!0,o.unshift(t)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(let t of this.signatures){let e=o.findIndex(e=>e.pubkey.equals(t.publicKey));if(e>-1)o[e].isSigner||(o[e].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw Error(`unknown signer: ${t.publicKey.toString()}`)}let a=0,u=0,l=0,f=[],c=[];o.forEach(({pubkey:t,isSigner:e,isWritable:r})=>{e?(f.push(t.toString()),a+=1,r||(u+=1)):(c.push(t.toString()),r||(l+=1))});let h=f.concat(c),d=e.map(t=>{let{data:e,programId:r}=t;return{programIdIndex:h.indexOf(r.toString()),accounts:t.keys.map(t=>h.indexOf(t.pubkey.toString())),data:ej.default.encode(e)}});return d.forEach(t=>{ih(t.programIdIndex>=0),t.accounts.forEach(t=>ih(t>=0))}),new im({header:{numRequiredSignatures:a,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:l},accountKeys:h,recentBlockhash:t,instructions:d})}_compile(){let t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every((t,r)=>e[r].equals(t.publicKey))?t:(this.signatures=e.map(t=>({signature:null,publicKey:t})),t)}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(0===t.length)throw Error("No signers");let e=new Set;this.signatures=t.filter(t=>{let r=t.toString();return!e.has(r)&&(e.add(r),!0)}).map(t=>({signature:null,publicKey:t}))}sign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let i of t){let t=i.publicKey.toString();e.has(t)||(e.add(t),r.push(i))}this.signatures=r.map(t=>({signature:null,publicKey:t.publicKey}));let i=this._compile();this._partialSign(i,...r)}partialSign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let i of t){let t=i.publicKey.toString();e.has(t)||(e.add(t),r.push(i))}let i=this._compile();this._partialSign(i,...r)}_partialSign(t,...e){let r=t.serialize();e.forEach(t=>{let e=r3(r,t.secretKey);this._addSignature(t.publicKey,r4(e))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){ih(64===e.length);let r=this.signatures.findIndex(e=>t.equals(e.publicKey));if(r<0)throw Error(`unknown signer: ${t.toString()}`);this.signatures[r].signature=l.Buffer.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){let r={};for(let{signature:i,publicKey:n}of this.signatures)null===i?e&&(r.missing||=[]).push(n):r5(i,t,n.toBytes())||(r.invali
1d||=[]).push(n);return r.invalid||r.missing?r:void 0}serialize(t){let{requireAllSignatures:e,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),i=this.serializeMessage();if(r){let t=this._getMessageSignednessErrors(i,e);if(t){let e="Signature verification failed.";throw t.invalid&&(e+=` 2Invalid signature for public key${1===t.invalid.length?"":"(s)"} [\`${t.invalid.map(t=>t.toBase58()).join("`, `")}\`].`),t.missing&&(e+=` 3Missing signature for public key${1===t.missing.length?"":"(s)"} [\`${t.missing.map(t=>t.toBase58()).join("`, `")}\`].`),Error(e)}}return this._serialize(i)}_serialize(t){let{signatures:e}=this,r=[];ic(r,e.length);let i=r.length+64*e.length+t.length,n=l.Buffer.alloc(i);return ih(e.length<256),l.Buffer.from(r).copy(n,0),e.forEach(({signature:t},e)=>{null!==t&&(ih(64===t.length,"signature has invalid length"),l.Buffer.from(t).copy(n,r.length+64*e))}),t.copy(n,r.length+64*e.length),ih(n.length<=1232,`Transaction too large: ${n.length} > 1232`),n}get keys(){return ih(1===this.instructions.length),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return ih(1===this.instructions.length),this.instructions[0].programId}get data(){return ih(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t],r=il(e),i=[];for(let t=0;t<r;t++){let t=iy(e,0,64);i.push(ej.default.encode(l.Buffer.from(t)))}return iE.populate(im.from(e),i)}static populate(t,e=[]){let r=new iE;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),e.forEach((e,i)=>{let n={signature:e==ej.default.encode(ix)?null:ej.default.decode(e),publicKey:t.accountKeys[i]};r.signatures.push(n)}),t.instructions.forEach(e=>{let i=e.accounts.map(e=>{let i=t.accountKeys[e];return{pubkey:i,isSigner:r.signatures.some(t=>t.publicKey.toString()===i.toString())||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}});r.instructions.push(new iS({keys:i,programId:t.accountKeys[e.programIdIndex],data:ej.default.decode(e.data)}))}),r._message=t,r._json=r.toJSON(),r}}class ik{constructor(t){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}static decompile(t,e){let{header:r,compiledInstructions:i,recentBlockhash:n}=t,{numRequiredSignatures:o,numReadonlySignedAccounts:s,numReadonlyUnsignedAccounts:a}=r,u=o-s;ih(u>0,"Message header is invalid");let l=t.staticAccountKeys.length-o-a;ih(l>=0,"Message header is invalid");let f=t.getAccountKeys(e),c=f.get(0);if(void 0===c)throw Error("Failed to decompile message because no account keys were found");let h=[];for(let t of i){let e=[];for(let i of t.accountKeyIndexes){let t,n=f.get(i);if(void 0===n)throw Error(`Failed to find key for account key index ${i}`);t=i<o?i<u:i<f.staticAccountKeys.length?i-o<l:i-f.staticAccountKeys.length<f.accountKeysFromLookups.writable.length,e.push({pubkey:n,isSigner:i<r.numRequiredSignatures,isWritable:t})}let i=f.get(t.programIdIndex);if(void 0===i)throw Error(`Failed to find program id for program id index ${t.programIdIndex}`);h.push(new iS({programId:i,data:r4(t.data),keys:e}))}return new ik({payerKey:c,instructions:h,recentBlockhash:n})}compileToLegacyMessage(){return im.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(t){return ib.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:t})}}class iB{get version(){return this.message.version}constructor(t,e){if(this.signatures=void 0,this.message=void 0,void 0!==e)ih(e.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=e;else{const e=[];for(let r=0;r<t.header.numRequiredSignatures;r++)e.push(new Uint8Array(64));this.signatures=e}this.message=t}serialize(){let t=this.message.serialize(),e=[];ic(e,this.signatures.length);let r=e$.struct([e$.blob(e.length,"encodedSignaturesLength"),e$.seq(((t="signature")=>e$.blob(64,t))(),this.signatures.length,"signatures"),e$.blob(t.length,"serializedMessage")]),i=new Uint8Array(2048),n=r.encode({encodedSignaturesLength:new Uint8Array(e),signatures:this.signatures,serializedMessage:t},i);return i.slice(0,n)}static deserialize(t){let e=[...t],r=[],i=il(e);for(let t=0;t<i;t++)r.push(new Uint8Array(iy(e,0,64)));return new iB(iw.deserialize(new Uint8Array(e)),r)}sign(t){let e=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(let i of t){let t=r.findIndex(t=>t.equals(i.publicKey));ih(t>=0,`Cannot sign with non signer key ${i.publicKey.toBase58()}`),this.signatures[t]=r3(e,i.secretKey)}}addSignature(t,e){ih(64===e.byteLength,"Signature must be 64 bytes long");let r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(e=>e.equals(t));ih(r>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=e}}let iA=new ie("SysvarC1ock11111111111111111111111111111111");new ie("SysvarEpochSchedu1e111111111111111111111111"),new ie("Sysvar1nstructions1111111111111111111111111");let iI=new ie("SysvarRecentB1ockHashes11111111111111111111"),i_=new ie("SysvarRent111111111111111111111111111111111");new ie("SysvarRewards111111111111111111111111111111"),new ie("SysvarS1otHashes111111111111111111111111111"),new ie("SysvarS1otHistory11111111111111111111111111");let iM=new ie("SysvarStakeHistory1111111111111111111111111");
vendor: 77,689 bytes, lines 3-7
3class iO extends Error{constructor({action:t,signature:e,transactionMessage:r,logs:i}){let n;const o=i?`Logs: 4${JSON.stringify(i.slice(-10),null,2)}. `:"",s="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";switch(t){case"send":n=`Transaction ${e} resulted in an error. 5${r}. `+o+s;break;case"simulate":n=`Simulation failed. 6Message: ${r}. 7`+o+s;break;default:n=`Unknown action '${(t=>t)(t)}'`}super(n),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=e,this.transactionMessage=r,this.transactionLogs=i||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let t=this.transactionLogs;if(null==t||"object"!=typeof t||!("then"in t))return t}async getLogs(t){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((e,r)=>{t.getTransaction(this.signature).then(t=>{if(t&&t.meta&&t.meta.logMessages){let r=t.meta.logMessages;this.transactionLogs=r,e(r)}else r(Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}class iR extends Error{constructor({code:t,message:e,data:r},i){super(null!=i?`${i}: ${e}`:e),this.code=void 0,this.data=void 0,this.code=t,this.data=r,this.name="SolanaJSONRPCError"}}async function iT(t,e,r,i){let n,o=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment,maxRetries:i.maxRetries,minContextSlot:i.minContextSlot},s=await t.sendTransaction(e,r,o);if(null!=e.recentBlockhash&&null!=e.lastValidBlockHeight)n=(await t.confirmTransaction({abortSignal:i?.abortSignal,signature:s,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},i&&i.commitment)).value;else if(null!=e.minNonceContextSlot&&null!=e.nonceInfo){let{nonceInstruction:r}=e.nonceInfo,o=r.keys[0].pubkey;n=(await t.confirmTransaction({abortSignal:i?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:o,nonceValue:e.nonceInfo.nonce,signature:s},i&&i.commitment)).value}else i?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),n=(await t.confirmTransaction(s,i&&i.commitment)).value;if(n.err){if(null!=s)throw new iO({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(n)})`});throw Error(`Transaction ${s} failed (${JSON.stringify(n)})`)}return s}function iU(t){return new Promise(e=>setTimeout(e,t))}function iL(t,e){let r=t.layout.span>=0?t.layout.span:function t(e,r){let i=e=>{if(e.span>=0)return e.span;if("function"==typeof e.alloc)return e.alloc(r[e.property]);if("count"in e&&"elementLayout"in e){let t=r[e.property];if(Array.isArray(t))return t.length*i(e.elementLayout)}else if("fields"in e)return t({layout:e},r[e.property]);return 0},n=0;return e.layout.fields.forEach(t=>{n+=i(t)}),n}(t,e),i=l.Buffer.alloc(r),n=Object.assign({instruction:t.index},e);return t.layout.encode(n,i),i}let iP=e$.nu64("lamportsPerSignature"),iC=e$.struct([e$.u32("version"),e$.u32("state"),ia("authorizedPubkey"),ia("nonce"),e$.struct([iP],"feeCalculator")]),iN=iC.span;class iq{constructor(t){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}static fromAccountData(t){let e=iC.decode(r4(t),0);return new iq({authorizedPubkey:new ie(e.authorizedPubkey),nonce:new ie(e.nonce).toString(),feeCalculator:e.feeCalculator})}}function iz(t){let e=(0,e$.blob)(8,t),r=e.decode.bind(e),i=e.encode.bind(e),n=((t={})=>(function(t,e){if(eZ(t)!==eZ(e))throw new eH(8078004);if(eZ(t)&&eZ(e)&&t.fixedSize!==e.fixedSize)throw new eH(8078005,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!eZ(t)&&!eZ(e)&&t.maxSize!==e.maxSize)throw new eH(8078006,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}})(((t={})=>{var e,r;return Object.freeze({...r={fixedSize:(e={config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,e,r)=>t.setBigUint64(0,BigInt(e),r),size:8}).size,write(t,r,i){e.range&&function(t,e,r,i){if(i<e||i>r)throw new eH(8078011,{codecDescription:t,max:r,min:e,value:i})}(e.name,e.range[0],e.range[1],t);let n=new ArrayBuffer(e.size);return e.set(new DataView(n),t,eY(e.config)),r.set(new Uint8Array(n),i),i+e.size}},encode:t=>{let e=new Uint8Array("fixedSize"in r?r.fixedSize:r.getSizeFromValue(t));return r.write(t,e,0),e}})})(t),((t={})=>{var e,r;return Object.freeze({...r={fixedSize:(e={config:t,get:(t,e)=>t.getBigUint64(0,e),name:"u64",size:8}).size,read(t,r=0){var i,n,o;let s,a;!function(t,e,r=0){if(e.length-r<=0)throw new eH(8078e3,{codecDescription:t})}(e.name,t,r),function(t,e,r,i=0){let n=r.length-i;if(n<e)throw new eH(8078001,{bytesLength:n,codecDescription:t,expected:e})}(e.name,e.size,t,r);let u=new DataView((i=t,n=r,o=e.size,s=i.byteOffset+(n??0),a=o??i.byteLength,i.buffer.slice(s,s+a)));return[e.get(u,eY(e.config)),r+e.size]}},decode:(t,e=0)=>r.read(t,e)[0]})})(t)))();return e.decode=(t,e)=>{let i=r(t,e);return n.decode(i)},e.encode=(t,e,r)=>i(n.encode(t),e,r),e}let iW=Object.freeze({Create:{index:0,layout:e$.struct([e$.u32("instruction"),e$.ns64("lamports"),e$.ns64("space"),ia("programId")])},Assign:{index:1,layout:e$.struct([e$.u32("instruction"),ia("programId")])},Transfer:{index:2,layout:e$.struct([e$.u32("instruction"),iz("lamports")])},CreateWithSeed:{index:3,layout:e$.struct([e$.u32("instruction"),ia("base"),iu("seed"),e$.ns64("lamports"),e$.ns64("space"),ia("programId")])},AdvanceNonceAccount:{index:4,layout:e$.struct([e$.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:e$.struct([e$.u32("instruction"),e$.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:e$.struct([e$.u32("instruction"),ia("authorized")])},AuthorizeNonceAccount:{index:7,layout:e$.struct([e$.u32("instruction"),ia("authorized")])},Allocate:{index:8,layout:e$.struct([e$.u32("instruction"),e$.ns64("space")])},AllocateWithSeed:{index:9,layout:e$.struct([e$.u32("instruction"),ia("base"),iu("seed"),e$.ns64("space"),ia("programId")])},AssignWithSeed:{index:10,layout:e$.struct([e$.u32("instruction"),ia("base"),iu("seed"),ia("programId")])},TransferWithSeed:{index:11,layout:e$.struct([e$.u32("instruction"),iz("lamports"),iu("seed"),ia("programId")])},UpgradeNonceAccount:{index:12,layout:e$.struct([e$.u32("instruction")])}});class iF{static createAccount(t){let e=iL(iW.Create,{lamports:t.lamports,space:t.space,programId:r4(t.programId.toBuffer())});return new iS({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:e})}static transfer(t){let e,r;return"basePubkey"in t?(e=iL(iW.TransferWithSeed,{lamports:BigInt(t.lamports),seed:t.seed,programId:r4(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]):(e=iL(iW.Transfer,{lamports:BigInt(t.lamports)}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]),new iS({keys:r,programId:this.programId,data:e})}static assign(t){let e,r;return"basePubkey"in t?(e=iL(iW.AssignWithSeed,{base:r4(t.basePubkey.toBuffer()),seed:t.seed,programId:r4(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=iL(iW.Assign,{programId:r4(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new iS({keys:r,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=iL(iW.CreateWithSeed,{base:r4(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:r4(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey.equals(t.fromPubkey)||r.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new iS({keys:r,programId:this.programId,data:e})}static createNonceAccount(t){let e=new iE;"basePubkey"in t&&"seed"in t?e.add(iF.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:iN,programId:this.programId})):e.add(iF.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:iN,programId:this.programId}));let r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(r)),e}static nonceInitialize(t){let e=iL(iW.InitializeNonceAccount,{authorized:r4(t.authorizedPubkey.toBuffer())});return new iS({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:iI,isSigner:!1,isWritable:!1},{pubkey:i_,isSigner:!1,isWritable:!1}],programId:this.programId,data:e})}static nonceAdvance(t){let e=iL(iW.AdvanceNonceAccount);return new iS({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:iI,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceWithdraw(t){let e=iL(iW.WithdrawNonceAccount,{lamports:t.lamports});return new iS({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:iI,isSigner:!1,isWritable:!1},{pubkey:i_,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceAuthorize(t){let e=iL(iW.AuthorizeNonceAccount,{authorized:r4(t.newAuthorizedPubkey.toBuffer())});return new iS({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static allocate(t){let e,r;return"basePubkey"in t?(e=iL(iW.AllocateWithSeed,{base:r4(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:r4(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=iL(iW.Allocate,{space:t.space}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new iS({keys:r,programId:this.programId,data:e})}}iF.programId=new ie("11111111111111111111111111111111");class iK{static getMinNumSignatures(t){return 2*(Math.ceil(t/iK.chunkSize)+1+1)}static async load(t,e,r,i,n){{let o=await t.getMinimumBalanceForRentExemption(n.length),s=await t.getAccountInfo(r.publicKey,"confirmed"),a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==n.length&&(a=a||new iE).add(iF.allocate({accountPubkey:r.publicKey,space:n.length})),s.owner.equals(i)||(a=a||new iE).add(iF.assign({accountPubkey:r.publicKey,programId:i})),s.lamports<o&&(a=a||new iE).add(iF.transfer({fromPubkey:e.publicKey,toPubkey:r.publicKey,lamports:o-s.lamports}))}else a=new iE().add(iF.createAccount({fromPubkey:e.publicKey,newAccountPubkey:r.publicKey,lamports:o>0?o:1,space:n.length,programId:i}));null!==a&&await iT(t,a,[e,r],{commitment:"confirmed"})}let o=e$.struct([e$.u32("instruction"),e$.u32("offset"),e$.u32("bytesLength"),e$.u32("bytesLengthPadding"),e$.seq(e$.u8("byte"),e$.offset(e$.u32(),-8),"bytes")]),s=iK.chunkSize,a=0,u=n,f=[];for(;u.length>0;){let n=u.slice(0,s),c=l.Buffer.alloc(s+16);o.encode({instruction:0,offset:a,bytes:n,bytesLength:0,bytesLengthPadding:0},c);let h=new iE().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:c});f.push(iT(t,h,[e,r],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await iU(250),a+=s,u=u.slice(s)}await Promise.all(f);{let n=e$.struct([e$.u32("instruction")]),o=l.Buffer.alloc(n.span);n.encode({instruction:1},o);let s=new iE().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:i_,isSigner:!1,isWritable:!1}],programId:i,data:o}),a="processed",u=await t.sendTransaction(s,[e,r],{preflightCommitment:a}),{context:f,value:c}=await t.confirmTransaction({signature:u,lastValidBlockHeight:s.lastValidBlockHeight,blockhash:s.recentBlockhash},a);if(c.err)throw Error(`Transaction ${u} failed (${JSON.stringify(c)})`);for(;;){try{if(await t.getSlot({commitment:a})>f.slot)break}catch{}await new Promise(t=>setTimeout(t,Math.round(200)))}}return!0}}iK.chunkSize=932,new ie("BPFLoader2111111111111111111111111111111111");var ij=(s=function(){if(u)return a;u=1;var t=Object.prototype.toString,e=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};return a=function(r){var i=function r(i,n){var o,s,a,u,l,f,c;if(!0===i)return"true";if(!1===i)return"false";switch(typeof i){case"object":if(null===i)return null;if(i.toJSON&&"function"==typeof i.toJSON)return r(i.toJSON(),n);if("[object Array]"===(c=t.call(i))){for(o=0,a="[",s=i.length-1;o<s;o++)a+=r(i[o],!0)+",";return s>-1&&(a+=r(i[o],!0)),a+"]"}if("[object Object]"!==c)return JSON.stringify(i);for(s=(u=e(i).sort()).length,a="",o=0;o<s;)void 0!==(f=r(i[l=u[o]],!1))&&(a&&(a+=","),a+=JSON.stringify(l)+":"+f),o++;return"{"+a+"}";case"function":case"undefined":return n?null:void 0;case"string":return JSON.stringify(i);default:return isFinite(i)?i:null}}(r,!1);if(void 0!==i)return""+i}}())&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s;function iD(t){let e=0;for(;t>1;)t/=2,e++;return e}class i${constructor(t,e,r,i,n){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=e,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=n}getEpoch(t){return this.getEpochAndSlotIndex(t)[0]}getEpochAndSlotIndex(t){if(t<this.firstNormalSlot){var e;let r=iD(0===(e=t+32+1)?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,(e|=e>>32)+1))-iD(32)-1,i=this.getSlotsInEpoch(r);return[r,t-(i-32)]}{let e=t-this.firstNormalSlot,r=Math.floor(e/this.slotsPerEpoch);return[this.firstNormalEpoch+r,e%this.slotsPerEpoch]}}getFirstSlotInEpoch(t){return t<=this.firstNormalEpoch?(Math.pow(2,t)-1)*32:(t-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(t){return this.getFirstSlotInEpoch(t)+this.getSlotsInEpoch(t)-1}getSlotsInEpoch(t){return t<this.firstNormalEpoch?Math.pow(2,t+iD(32)):this.slotsPerEpoch}}var iV=globalThis.fetch;class iH extends rm{constructor(t,e,r){super(t=>{let r=new rg(t,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...e});return"socket"in r?this.underlyingSocket=r.socket:this.underlyingSocket=r,r},t,e,r),this.underlyingSocket=void 0}call(...t){let e=this.underlyingSocket?.readyState;return 1===e?super.call(...t):Promise.reject(Error("Tried to call a JSON-RPC method `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}notify(...t){let e=this.underlyingSocket?.readyState;return 1===e?super.notify(...t):Promise.reject(Error("Tried to send a JSON-RPC notification `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}}class iZ{constructor(t){this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}isActive(){let t=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===t}static deserialize(t){let e=function(t,e){let r;try{r=t.layout.decode(e)}catch(t){throw Error("invalid instruction; "+t)}if(r.typeIndex!==t.index)throw Error(`invalid account data; account type mismatch ${r.typeIndex} != ${t.index}`);return r}(iG,t),r=t.length-56;ih(r>=0,"lookup table is invalid"),ih(r%32==0,"lookup table is invalid");let{addresses:i}=e$.struct([e$.seq(ia(),r/32,"addresses")]).decode(t.slice(56));return{deactivationSlot:e.deactivationSlot,lastExtendedSlot:e.lastExtendedSlot,lastExtendedSlotStartIndex:e.lastExtendedStartIndex,authority:0!==e.authority.length?new ie(e.authority[0]):void 0,addresses:i.map(t=>new ie(t))}}}let iG={index:1,layout:e$.struct([e$.u32("typeIndex"),iz("deactivationSlot"),e$.nu64("lastExtendedSlot"),e$.u8("lastExtendedStartIndex"),e$.u8(),e$.seq(ia(),e$.offset(e$.u8(),-1),"authority")])},iY=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i,iJ=rf(e9(ie),ro(),t=>new ie(t)),iX=rs([ro(),rt("base64")]),iQ=rf(e9(l.Buffer),iX,t=>l.Buffer.from(t[0],"base64"));function i0(t){let e,r;if("string"==typeof t)e=t;else if(t){let{commitment:i,...n}=t;e=i,r=n}return{commitment:e,config:r}}function i1(t){return t.map(t=>"memcmp"in t?{...t,memcmp:{...t.memcmp,encoding:t.memcmp.encoding??"base58"}}:t)}function i2(t){return ru([ra({jsonrpc:rt("2.0"),id:ro(),result:t}),ra({jsonrpc:rt("2.0"),id:ro(),error:ra({code:rl(),message:ro(),data:ri(e5("any",()=>!0))})})])}let i6=i2(rl());function i8(t){return rf(i2(t),i6,e=>"error"in e?e:{...e,result:e8(e.result,t)})}function i3(t){return i8(ra({context:ra({slot:rr()}),value:t}))}function i5(t){return ra({context:ra({slot:rr()}),value:t})}function i4(t,e){return 0===t?new ib({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new ie(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:ej.default.decode(t.data)})),addressTableLookups:e.addressTableLookups}):new im(e)}let i7=ra({foundation:rr(),foundationTerm:rr(),initial:rr(),taper:rr(),terminal:rr()}),i9=i8(e4(re(ra({epoch:rr(),effectiveSlot:rr(),amount:rr(),postBalance:rr(),commission:ri(re(rr()))})))),nt=e4(ra({slot:rr(),prioritizationFee:rr()})),ne=ra({total:rr(),validator:rr(),foundation:rr(),epoch:rr()}),nr=ra({epoch:rr(),slotIndex:rr(),slotsInEpoch:rr(),absoluteSlot:rr(),blockHeight:ri(rr()),transactionCount:ri(rr())}),ni=ra({slotsPerEpoch:rr(),leaderScheduleSlotOffset:rr(),warmup:e7(),firstNormalEpoch:rr(),firstNormalSlot:rr()}),nn=rn(ro(),e4(rr())),no=re(ru([ra({}),ro()])),ns=ra({err:no}),na=rt("receivedSignature"),nu=ra({"solana-core":ro(),"feature-set":ri(rr())}),nl=ra({program:ro(),programId:iJ,parsed:rl()}),nf=ra({programId:iJ,accounts:e4(iJ),data:ro()}),nc=i3(ra({err:re(ru([ra({}),ro()])),logs:re(e4(ro())),accounts:ri(re(e4(re(ra({executable:e7(),owner:ro(),lamports:rr(),data:e4(ro()),rentEpoch:ri(rr())}))))),unitsConsumed:ri(rr()),returnData:ri(re(ra({programId:ro(),data:rs([ro(),rt("base64")])}))),innerInstructions:ri(re(e4(ra({index:rr(),instructions:e4(ru([nl,nf]))}))))})),nh=i3(ra({byIdentity:rn(ro(),e4(rr())),range:ra({firstSlot:rr(),lastSlot:rr()})})),nd=i8(i7),np=i8(ne),ng=i8(nt),ny=i8(nr),nm=i8(ni),nb=i8(nn),nw=i8(rr()),nv=i3(ra({total:rr(),circulating:rr(),nonCirculating:rr(),nonCirculatingAccounts:e4(iJ)})),nx=ra({amount:ro(),uiAmount:re(rr()),decimals:rr(),uiAmountString:ri(ro())}),nS=i3(e4(ra({address:iJ,amount:ro(),uiAmount:re(rr()),decimals:rr(),uiAmountString:ri(ro())}))),nE=i3(e4(ra({pubkey:iJ,account:ra({executable:e7(),owner:iJ,lamports:rr(),data:iQ,rentEpoch:rr()})}))),nk=ra({program:ro(),parsed:rl(),space:rr()}),nB=i3(e4(ra({pubkey:iJ,account:ra({executable:e7(),owner:iJ,lamports:rr(),data:nk,rentEpoch:rr()})}))),nA=i3(e4(ra({lamports:rr(),address:iJ}))),nI=ra({executable:e7(),owner:iJ,lamports:rr(),data:iQ,rentEpoch:rr()}),n_=ra({pubkey:iJ,account:nI}),nM=rf(ru([e9(l.Buffer),nk]),ru([iX,nk]),t=>Array.isArray(t)?e8(t,iQ):t),nO=ra({executable:e7(),owner:iJ,lamports:rr(),data:nM,rentEpoch:rr()}),nR=ra({pubkey:iJ,account:nO}),nT=ra({state:ru([rt("active"),rt("inactive"),rt("activating"),rt("deactivating")]),active:rr(),inactive:rr()}),nU=i8(e4(ra({signature:ro(),slot:rr(),err:no,memo:re(ro()),blockTime:ri(re(rr()))}))),nL=i8(e4(ra({signature:ro(),slot:rr(),err:no,memo:re(ro()),blockTime:ri(re(rr()))}))),nP=ra({subscription:rr(),result:i5(nI)}),nC=ra({pubkey:iJ,account:nI}),nN=ra({subscription:rr(),result:i5(nC)}),nq=ra({parent:rr(),slot:rr(),root:rr()}),nz=ra({subscription:rr(),result:nq}),nW=ru([ra({type:ru([rt("firstShredReceived"),rt("completed"),rt("optimisticConfirmation"),rt("root")]),slot:rr(),timestamp:rr()}),ra({type:rt("createdBank"),parent:rr(),slot:rr(),timestamp:rr()}),ra({type:rt("frozen"),slot:rr(),timestamp:rr(),stats:ra({numTransactionEntries:rr(),numSuccessfulTransactions:rr(),numFailedTransactions:rr(),maxTransactionsPerEntry:rr()})}),ra({type:rt("dead"),slot:rr(),timestamp:rr(),err:ro()})]),nF=ra({subscription:rr(),result:nW}),nK=ra({subscription:rr(),result:i5(ru([ns,na]))}),nj=ra({subscription:rr(),result:rr()}),nD=ra({pubkey:ro(),gossip:re(ro()),tpu:re(ro()),rpc:re(ro()),version:re(ro())}),n$=ra({votePubkey:ro(),nodePubkey:ro(),activatedStake:rr(),epochVoteAccount:e7(),epochCredits:e4(rs([rr(),rr(),rr()])),commission:rr(),lastVote:rr(),rootSlot:re(rr())}),nV=i8(ra({current:e4(n$),delinquent:e4(n$)})),nH=ru([rt("processed"),rt("confirmed"),rt("finalized")]),nZ=ra({slot:rr(),confirmations:re(rr()),err:no,confirmationStatus:ri(nH)}),nG=i3(e4(re(nZ))),nY=i8(rr()),nJ=ra({accountKey:iJ,writableIndexes:e4(rr()),readonlyIndexes:e4(rr())}),nX=ra({signatures:e4(ro()),message:ra({accountKeys:e4(ro()),header:ra({numRequiredSignatures:rr(),numReadonlySignedAccounts:rr(),numReadonlyUnsignedAccounts:rr()}),instructions:e4(ra({accounts:e4(rr()),data:ro(),programIdIndex:rr()})),recentBlockhash:ro(),addressTableLookups:ri(e4(nJ))})}),nQ=ra({pubkey:iJ,signer:e7(),writable:e7(),source:ri(ru([rt("transaction"),rt("lookupTable")]))}),n0=ra({accountKeys:e4(nQ),signatures:e4(ro())}),n1=ra({parsed:rl(),program:ro(),programId:iJ}),n2=ra({accounts:e4(iJ),data:ro(),programId:iJ}),n6=rf(ru([n2,n1]),ru([ra({parsed:rl(),program:ro(),programId:ro()}),ra({accounts:e4(ro()),data:ro(),programId:ro()})]),t=>"accounts"in t?e8(t,n2):e8(t,n1)),n8=ra({signatures:e4(ro()),message:ra({accountKeys:e4(nQ),instructions:e4(n6),recentBlockhash:ro(),addressTableLookups:ri(re(e4(nJ)))})}),n3=ra({accountIndex:rr(),mint:ro(),owner:ri(ro()),programId:ri(ro()),uiTokenAmount:nx}),n5=ra({writable:e4(iJ),readonly:e4(iJ)}),n4=ra({err:no,fee:rr(),innerInstructions:ri(re(e4(ra({index:rr(),instructions:e4(ra({accounts:e4(rr()),data:ro(),programIdIndex:rr()}))})))),preBalances:e4(rr()),postBalances:e4(rr()),logMessages:ri(re(e4(ro()))),preTokenBalances:ri(re(e4(n3))),postTokenBalances:ri(re(e4(n3))),loadedAddresses:ri(n5),computeUnitsConsumed:ri(rr()),costUnits:ri(rr())}),n7=ra({err:no,fee:rr(),innerInstructions:ri(re(e4(ra({index:rr(),instructions:e4(n6)})))),preBalances:e4(rr()),postBalances:e4(rr()),logMessages:ri(re(e4(ro()))),preTokenBalances:ri(re(e4(n3))),postTokenBalances:ri(re(e4(n3))),loadedAddresses:ri(n5),computeUnitsConsumed:ri(rr()),costUnits:ri(rr())}),n9=ru([rt(0),rt("legacy")]),ot=ra({pubkey:ro(),lamports:rr(),postBalance:re(rr()),rewardType:re(ro()),commission:ri(re(rr()))}),oe=i8(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),transactions:e4(ra({transaction:nX,meta:re(n4),version:ri(n9)})),rewards:ri(e4(ot)),blockTime:re(rr()),blockHeight:re(rr())}))),or=i8(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),rewards:ri(e4(ot)),blockTime:re(rr()),blockHeight:re(rr())}))),oi=i8(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),transactions:e4(ra({transaction:n0,meta:re(n4),version:ri(n9)})),rewards:ri(e4(ot)),blockTime:re(rr()),blockHeight:re(rr())}))),on=i8(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),transactions:e4(ra({transaction:n8,meta:re(n7),version:ri(n9)})),rewards:ri(e4(ot)),blockTime:re(rr()),blockHeight:re(rr())}))),oo=i8(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),transactions:e4(ra({transaction:n0,meta:re(n7),version:ri(n9)})),rewards:ri(e4(ot)),blockTime:re(rr()),blockHeight:re(rr())}))),os=i8(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),rewards:ri(e4(ot)),blockTime:re(rr()),blockHeight:re(rr())}))),oa=i8(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),transactions:e4(ra({transaction:nX,meta:re(n4)})),rewards:ri(e4(ot)),blockTime:re(rr())}))),ou=i8(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),signatures:e4(ro()),blockTime:re(rr())}))),ol=i8(re(ra({slot:rr(),meta:re(n4),blockTime:ri(re(rr())),transaction:nX,version:ri(n9)}))),of=i8(re(ra({slot:rr(),transaction:n8,meta:re(n7),blockTime:ri(re(rr())),version:ri(n9)}))),oc=i3(ra({blockhash:ro(),lastValidBlockHeight:rr()})),oh=i3(e7()),od=i8(e4(ra({slot:rr(),numTransactions:rr(),numSlots:rr(),samplePeriodSecs:rr()}))),op=i3(re(ra({feeCalculator:ra({lamportsPerSignature:rr()})}))),og=i8(ro()),oy=i8(ro()),om=ra({err:no,logs:e4(ro()),signature:ro()}),ob=ra({result:i5(om),subscription:rr()}),ow={"solana-client":"js/1.0.0-maintenance"};class ov{constructor(t){this._keypair=void 0,this._keypair=t??r2()}static generate(){return new ov(r2())}static fromSecretKey(t,e){if(64!==t.byteLength)throw Error("bad secret key size");let r=t.slice(32,64);if(!e||!e.skipValidation){let e=r6(t.slice(0,32));for(let t=0;t<32;t++)if(r[t]!==e[t])throw Error("provided secretKey is invalid")}return new ov({publicKey:r,secretKey:t})}static fromSeed(t){let e=r6(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),new ov({publicKey:e,secretKey:r})}get publicKey(){return new ie(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}Object.freeze({CreateLookupTable:{index:0,layout:e$.struct([e$.u32("instruction"),iz("recentSlot"),e$.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:e$.struct([e$.u32("instruction")])},ExtendLookupTable:{index:2,layout:e$.struct([e$.u32("instruction"),iz(),e$.seq(ia(),e$.offset(e$.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:e$.struct([e$.u32("instruction")])},CloseLookupTable:{index:4,layout:e$.struct([e$.u32("instruction")])}}),new ie("AddressLookupTab1e1111111111111111111111111"),Object.freeze({RequestUnits:{index:0,layout:e$.struct([e$.u8("instruction"),e$.u32("units"),e$.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:e$.struct([e$.u8("instruction"),e$.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:e$.struct([e$.u8("instruction"),e$.u32("units")])},SetComputeUnitPrice:{index:3,layout:e$.struct([e$.u8("instruction"),iz("microLamports")])}}),new ie("ComputeBudget111111111111111111111111111111");let ox=e$.struct([e$.u8("numSignatures"),e$.u8("padding"),e$.u16("signatureOffset"),e$.u16("signatureInstructionIndex"),e$.u16("publicKeyOffset"),e$.u16("publicKeyInstructionIndex"),e$.u16("messageDataOffset"),e$.u16("messageDataSize"),e$.u16("messageInstructionIndex")]);class oS{static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:i,instructionIndex:n}=t;ih(32===e.length,`Public Key must be 32 bytes but received ${e.length} bytes`),ih(64===i.length,`Signature must be 64 bytes but received ${i.length} bytes`);let o=ox.span,s=o+e.length,a=s+i.length,u=l.Buffer.alloc(a+r.length),f=null==n?65535:n;return ox.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:f,publicKeyOffset:o,publicKeyInstructionIndex:f,messageDataOffset:a,messageDataSize:r.length,messageInstructionIndex:f},u),u.fill(e,o),u.fill(i,s),u.fill(r,a),new iS({keys:[],programId:oS.programId,data:u})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:i}=t;ih(64===e.length,`Private key must be 64 bytes but received ${e.length} bytes`);try{let t=ov.fromSecretKey(e),n=t.publicKey.toBytes(),o=r3(r,t.secretKey);return this.createInstructionWithPublicKey({publicKey:n,message:r,signature:o,instructionIndex:i})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}oS.programId=new ie("Ed25519SigVerify111111111111111111111111111"),rQ.utils.isValidPrivateKey;let oE=rQ.getPublicKey,ok=e$.struct([e$.u8("numSignatures"),e$.u16("signatureOffset"),e$.u8("signatureInstructionIndex"),e$.u16("ethAddressOffset"),e$.u8("ethAddressInstructionIndex"),e$.u16("messageDataOffset"),e$.u16("messageDataSize"),e$.u8("messageInstructionIndex"),e$.blob(20,"ethAddress"),e$.blob(64,"signature"),e$.u8("recoveryId")]);class oB{static publicKeyToEthAddress(t){ih(64===t.length,`Public key must be 64 bytes but received ${t.length} bytes`);try{return l.Buffer.from(rU(r4(t))).slice(-20)}catch(t){throw Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:i,recoveryId:n,instructionIndex:o}=t;return oB.createInstructionWithEthAddress({ethAddress:oB.publicKeyToEthAddress(e),message:r,signature:i,recoveryId:n,instructionIndex:o})}static createInstructionWithEthAddress(t){let e,{ethAddress:r,message:i,signature:n,recoveryId:o,instructionIndex:s=0}=t;ih(20===(e="string"==typeof r?r.startsWith("0x")?l.Buffer.from(r.substr(2),"hex"):l.Buffer.from(r,"hex"):r).length,`Address must be 20 bytes but received ${e.length} bytes`);let a=12+e.length,u=a+n.length+1,f=l.Buffer.alloc(ok.span+i.length);return ok.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:s,ethAddressOffset:12,ethAddressInstructionIndex:s,messageDataOffset:u,messageDataSize:i.length,messageInstructionIndex:s,signature:r4(n),ethAddress:r4(e),recoveryId:o},f),f.fill(r4(i),ok.span),new iS({keys:[],programId:oB.programId,data:f})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:i}=t;ih(32===e.length,`Private key must be 32 bytes but received ${e.length} bytes`);try{var n;let t,o=r4(e),s=oE(o,!1).slice(1),[a,u]=(n=l.Buffer.from(rU(r4(r))),[(t=rQ.sign(n,o)).toCompactRawBytes(),t.recovery]);return this.createInstructionWithPublicKey({publicKey:s,message:r,signature:a,recoveryId:u,instructionIndex:i})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}oB.programId=new ie("KeccakSecp256k11111111111111111111111111111");let oA=new ie("StakeConfig11111111111111111111111111111111");class oI{constructor(t,e,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=r}}oI.default=new oI(0,0,ie.default);let o_=Object.freeze({Initialize:{index:0,layout:e$.struct([e$.u32("instruction"),((t="authorized")=>e$.struct([ia("staker"),ia("withdrawer")],t))(),((t="lockup")=>e$.struct([e$.ns64("unixTimestamp"),e$.ns64("epoch"),ia("custodian")],t))()])},Authorize:{index:1,layout:e$.struct([e$.u32("instruction"),ia("newAuthorized"),e$.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:e$.struct([e$.u32("instruction")])},Split:{index:3,layout:e$.struct([e$.u32("instruction"),e$.ns64("lamports")])},Withdraw:{index:4,layout:e$.struct([e$.u32("instruction"),e$.ns64("lamports")])},Deactivate:{index:5,layout:e$.struct([e$.u32("instruction")])},Merge:{index:7,layout:e$.struct([e$.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:e$.struct([e$.u32("instruction"),ia("newAuthorized"),e$.u32("stakeAuthorizationType"),iu("authoritySeed"),ia("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class oM{static initialize(t){let{stakePubkey:e,authorized:r,lockup:i}=t,n=i||oI.default,o=iL(o_.Initialize,{authorized:{staker:r4(r.staker.toBuffer()),withdrawer:r4(r.withdrawer.toBuffer())},lockup:{unixTimestamp:n.unixTimestamp,epoch:n.epoch,custodian:r4(n.custodian.toBuffer())}});return new iS({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i_,isSigner:!1,isWritable:!1}],programId:this.programId,data:o})}static createAccountWithSeed(t){let e=new iE;e.add(iF.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:i,lockup:n}=t;return e.add(this.initialize({stakePubkey:r,authorized:i,lockup:n}))}static createAccount(t){let e=new iE;e.add(iF.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:i,lockup:n}=t;return e.add(this.initialize({stakePubkey:r,authorized:i,lockup:n}))}static delegate(t){let{stakePubkey:e,authorizedPubkey:r,votePubkey:i}=t,n=iL(o_.Delegate);return new iE().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!1},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:iM,isSigner:!1,isWritable:!1},{pubkey:oA,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static authorize(t){let{stakePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:i,stakeAuthorizationType:n,custodianPubkey:o}=t,s=iL(o_.Authorize,{newAuthorized:r4(i.toBuffer()),stakeAuthorizationType:n.index}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:iA,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),new iE().add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(t){let{stakePubkey:e,authorityBase:r,authoritySeed:i,authorityOwner:n,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=t,u=iL(o_.AuthorizeWithSeed,{newAuthorized:r4(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:i,authorityOwner:r4(n.toBuffer())}),l=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:iA,isSigner:!1,isWritable:!1}];return a&&l.push({pubkey:a,isSigner:!0,isWritable:!1}),new iE().add({keys:l,programId:this.programId,data:u})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:r,splitStakePubkey:i,lamports:n}=t,o=iL(o_.Split,{lamports:n});return new iS({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(t,e){let r=new iE;return r.add(iF.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:e,space:this.space,programId:this.programId})),r.add(this.splitInstruction(t))}static splitWithSeed(t,e){let{stakePubkey:r,authorizedPubkey:i,splitStakePubkey:n,basePubkey:o,seed:s,lamports:a}=t,u=new iE;return u.add(iF.allocate({accountPubkey:n,basePubkey:o,seed:s,space:this.space,programId:this.programId})),e&&e>0&&u.add(iF.transfer({fromPubkey:t.authorizedPubkey,toPubkey:n,lamports:e})),u.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:i,splitStakePubkey:n,lamports:a}))}static merge(t){let{stakePubkey:e,sourceStakePubKey:r,authorizedPubkey:i}=t,n=iL(o_.Merge);return new iE().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:iM,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static withdraw(t){let{stakePubkey:e,authorizedPubkey:r,toPubkey:i,lamports:n,custodianPubkey:o}=t,s=iL(o_.Withdraw,{lamports:n}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:iM,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),new iE().add({keys:a,programId:this.programId,data:s})}static deactivate(t){let{stakePubkey:e,authorizedPubkey:r}=t,i=iL(o_.Deactivate);return new iE().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}}oM.programId=new ie("Stake11111111111111111111111111111111111111"),oM.space=200;let oO=Object.freeze({InitializeAccount:{index:0,layout:e$.struct([e$.u32("instruction"),((t="voteInit")=>e$.struct([ia("nodePubkey"),ia("authorizedVoter"),ia("authorizedWithdrawer"),e$.u8("commission")],t))()])},Authorize:{index:1,layout:e$.struct([e$.u32("instruction"),ia("newAuthorized"),e$.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:e$.struct([e$.u32("instruction"),e$.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:e$.struct([e$.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:e$.struct([e$.u32("instruction"),((t="voteAuthorizeWithSeedArgs")=>e$.struct([e$.u32("voteAuthorizationType"),ia("currentAuthorityDerivedKeyOwnerPubkey"),iu("currentAuthorityDerivedKeySeed"),ia("newAuthorized")],t))()])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class oR{static initializeAccount(t){let{votePubkey:e,nodePubkey:r,voteInit:i}=t,n=iL(oO.InitializeAccount,{voteInit:{nodePubkey:r4(i.nodePubkey.toBuffer()),authorizedVoter:r4(i.authorizedVoter.toBuffer()),authorizedWithdrawer:r4(i.authorizedWithdrawer.toBuffer()),commission:i.commission}});return new iS({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i_,isSigner:!1,isWritable:!1},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static createAccount(t){let e=new iE;return e.add(iF.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){let{votePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:i,voteAuthorizationType:n}=t,o=iL(oO.Authorize,{newAuthorized:r4(i.toBuffer()),voteAuthorizationType:n.index});return new iE().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:i,newAuthorizedPubkey:n,voteAuthorizationType:o,votePubkey:s}=t,a=iL(oO.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:r4(r.toBuffer()),currentAuthorityDerivedKeySeed:i,newAuthorized:r4(n.toBuffer()),voteAuthorizationType:o.index}});return new iE().add({keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,lamports:i,toPubkey:n}=t,o=iL(oO.Withdraw,{lamports:i});return new iE().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static safeWithdraw(t,e,r){if(t.lamports>e-r)throw Error("Withdraw will leave vote account with insufficient funds.");return oR.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,nodePubkey:i}=t,n=iL(oO.UpdateValidatorIdentity);return new iE().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}oR.programId=new ie("Vote111111111111111111111111111111111111111"),oR.space=3762,new ie("Va1idator1nfo111111111111111111111111111111"),ra({name:ro(),website:ri(ro()),details:ri(ro()),iconUrl:ri(ro()),keybaseUsername:ri(ro())}),new ie("Vote111111111111111111111111111111111111111"),e$.struct([ia("nodePubkey"),ia("authorizedWithdrawer"),e$.u8("commission"),e$.nu64(),e$.seq(e$.struct([e$.nu64("slot"),e$.u32("confirmationCount")]),e$.offset(e$.u32(),-8),"votes"),e$.u8("rootSlotValid"),e$.nu64("rootSlot"),e$.nu64(),e$.seq(e$.struct([e$.nu64("epoch"),ia("authorizedVoter")]),e$.offset(e$.u32(),-8),"authorizedVoters"),e$.struct([e$.seq(e$.struct([ia("authorizedPubkey"),e$.nu64("epochOfLastAuthorizedSwitch"),e$.nu64("targetEpoch")]),32,"buf"),e$.nu64("idx"),e$.u8("isEmpty")],"priorVoters"),e$.nu64(),e$.seq(e$.struct([e$.nu64("epoch"),e$.nu64("credits"),e$.nu64("prevCredits")]),e$.offset(e$.u32(),-8),"epochCredits"),e$.struct([e$.nu64("slot"),e$.nu64("timestamp")],"lastTimestamp")]),t.s(["Connection",0,class{constructor(t,e){let r,i,n,o,s,a;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{let t={};return async e=>{let{commitment:r,config:i}=i0(e),n=this._buildArgs([],r,void 0,i),o=ij(n);return t[o]=t[o]??(async()=>{try{let t=await this._rpcRequest("getBlockHeight",n),e=e8(t,i8(rr()));if("error"in e)throw new iR(e.error,"failed to get block height information");return e.result}finally{delete t[o]}})(),await t[o]}})(),e&&"string"==typeof e?this._commitment=e:e&&(this._commitment=e.commitment,this._confirmTransactionInitialTimeout=e.confirmTransactionInitialTimeout,r=e.wsEndpoint,i=e.httpHeaders,n=e.fetch,o=e.fetchMiddleware,s=e.disableRetryOnRateLimit,a=e.httpAgent),this._rpcEndpoint=function(t){if(!1===/^https?:/.test(t))throw TypeError("Endpoint URL must start with `http:` or `https:`.");return t}(t),this._rpcWsEndpoint=r||function(t){let e=t.match(iY);if(null==e)throw TypeError(`Failed to validate endpoint URL \`${t}\``);let[r,i,n,o]=e,s=t.startsWith("https:")?"wss:":"ws:",a=null==n?null:parseInt(n.slice(1),10),u=null==a?"":`:${a+1}`;return`${s}//${i}${u}${o}`}(t),this._rpcClient=function(t,e,r,i,n,o){let s,a,u=r||iV;return null!=o&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),i&&(a=async(t,e)=>{let r=await new Promise((r,n)=>{try{i(t,e,(t,e)=>r([t,e]))}catch(t){n(t)}});return await u(...r)}),new rc.default(async(r,i)=>{let o={method:"POST",body:r,agent:s,headers:Object.assign({"Content-Type":"application/json"},e||{},ow)};try{let e,r=5,s=500;for(;(e=a?await a(t,o):await u(t,o),429===e.status&&!0!==n)&&(r-=1,0!==r);){;console.error(`Server responded with ${e.status} ${e.statusText}. Retrying after ${s}ms delay...`),await iU(s),s*=2}let l=await e.text();e.ok?i(null,l):i(Error(`${e.status} ${e.statusText}: ${l}`))}catch(t){t instanceof Error&&i(t)}},{})}(t,i,n,o,s,a),this._rpcRequest=function(t){return(e,r)=>new Promise((i,n)=>{t.request(e,r,(t,e)=>{t?n(t):i(e)})})}(this._rpcClient),this._rpcBatchRequest=function(t){return e=>new Promise((r,i)=>{0===e.length&&r([]);let n=e.map(e=>t.request(e.methodName,e.args));t.request(n,(t,e)=>{t?i(t):r(e)})})}(this._rpcClient),this._rpcWebSocket=new iH(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(t,e){let{commitment:r,config:i}=i0(e),n=this._buildArgs([t.toBase58()],r,void 0,i),o=e8(await this._rpcRequest("getBalance",n),i3(rr()));if("error"in o)throw new iR(o.error,`failed to get balance for ${t.toBase58()}`);return o.result}async getBalance(t,e){return await this.getBalanceAndContext(t,e).then(t=>t.value).catch(e=>{throw Error("failed to get balance of account "+t.toBase58()+": "+e)})}async getBlockTime(t){let e=e8(await this._rpcRequest("getBlockTime",[t]),i8(re(rr())));if("error"in e)throw new iR(e.error,`failed to get block time for slot ${t}`);return e.result}async getMinimumLedgerSlot(){let t=e8(await this._rpcRequest("minimumLedgerSlot",[]),i8(rr()));if("error"in t)throw new iR(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){let t=e8(await this._rpcRequest("getFirstAvailableBlock",[]),nw);if("error"in t)throw new iR(t.error,"failed to get first available block");return t.result}async getSupply(t){let e={};e="string"==typeof t?{commitment:t}:t?{...t,commitment:t&&t.commitment||this.commitment}:{commitment:this.commitment};let r=e8(await this._rpcRequest("getSupply",[e]),nv);if("error"in r)throw new iR(r.error,"failed to get supply");return r.result}async getTokenSupply(t,e){let r=this._buildArgs([t.toBase58()],e),i=e8(await this._rpcRequest("getTokenSupply",r),i3(nx));if("error"in i)throw new iR(i.error,"failed to get token supply");return i.result}async getTokenAccountBalance(t,e){let r=this._buildArgs([t.toBase58()],e),i=e8(await this._rpcRequest("getTokenAccountBalance",r),i3(nx));if("error"in i)throw new iR(i.error,"failed to get token account balance");return i.result}async getTokenAccountsByOwner(t,e,r){let{commitment:i,config:n}=i0(r),o=[t.toBase58()];"mint"in e?o.push({mint:e.mint.toBase58()}):o.push({programId:e.programId.toBase58()});let s=this._buildArgs(o,i,"base64",n),a=e8(await this._rpcRequest("getTokenAccountsByOwner",s),nE);if("error"in a)throw new iR(a.error,`failed to get token accounts owned by account ${t.toBase58()}`);return a.result}async getParsedTokenAccountsByOwner(t,e,r){let i=[t.toBase58()];"mint"in e?i.push({mint:e.mint.toBase58()}):i.push({programId:e.programId.toBase58()});let n=this._buildArgs(i,r,"jsonParsed"),o=e8(await this._rpcRequest("getTokenAccountsByOwner",n),nB);if("error"in o)throw new iR(o.error,`failed to get token accounts owned by account ${t.toBase58()}`);return o.result}async getLargestAccounts(t){let e={...t,commitment:t&&t.commitment||this.commitment},r=e.filter||e.commitment?[e]:[],i=e8(await this._rpcRequest("getLargestAccounts",r),nA);if("error"in i)throw new iR(i.error,"failed to get largest accounts");return i.result}async getTokenLargestAccounts(t,e){let r=this._buildArgs([t.toBase58()],e),i=e8(await this._rpcRequest("getTokenLargestAccounts",r),nS);if("error"in i)throw new iR(i.error,"failed to get token largest accounts");return i.result}async getAccountInfoAndContext(t,e){let{commitment:r,config:i}=i0(e),n=this._buildArgs([t.toBase58()],r,"base64",i),o=e8(await this._rpcRequest("getAccountInfo",n),i3(re(nI)));if("error"in o)throw new iR(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getParsedAccountInfo(t,e){let{commitment:r,config:i}=i0(e),n=this._buildArgs([t.toBase58()],r,"jsonParsed",i),o=e8(await this._rpcRequest("getAccountInfo",n),i3(re(nO)));if("error"in o)throw new iR(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getAccountInfo(t,e){try{return(await this.getAccountInfoAndContext(t,e)).value}catch(e){throw Error("failed to get info about account "+t.toBase58()+": "+e)}}async getMultipleParsedAccounts(t,e){let{commitment:r,config:i}=i0(e),n=t.map(t=>t.toBase58()),o=this._buildArgs([n],r,"jsonParsed",i),s=e8(await this._rpcRequest("getMultipleAccounts",o),i3(e4(re(nO))));if("error"in s)throw new iR(s.error,`failed to get info for accounts ${n}`);return s.result}async getMultipleAccountsInfoAndContext(t,e){let{commitment:r,config:i}=i0(e),n=t.map(t=>t.toBase58()),o=this._buildArgs([n],r,"base64",i),s=e8(await this._rpcRequest("getMultipleAccounts",o),i3(e4(re(nI))));if("error"in s)throw new iR(s.error,`failed to get info for accounts ${n}`);return s.result}async getMultipleAccountsInfo(t,e){return(await this.getMultipleAccountsInfoAndContext(t,e)).value}async getStakeActivation(t,e,r){let{commitment:i,config:n}=i0(e),o=this._buildArgs([t.toBase58()],i,void 0,{...n,epoch:null!=r?r:n?.epoch}),s=e8(await this._rpcRequest("getStakeActivation",o),i8(nT));if("error"in s)throw new iR(s.error,`failed to get Stake Activation ${t.toBase58()}`);return s.result}async getProgramAccounts(t,e){let{commitment:r,config:i}=i0(e),{encoding:n,...o}=i||{},s=this._buildArgs([t.toBase58()],r,n||"base64",{...o,...o.filters?{filters:i1(o.filters)}:null}),a=await this._rpcRequest("getProgramAccounts",s),u=e4(n_),l=!0===o.withContext?e8(a,i3(u)):e8(a,i8(u));if("error"in l)throw new iR(l.error,`failed to get accounts owned by program ${t.toBase58()}`);return l.result}async getParsedProgramAccounts(t,e){let{commitment:r,config:i}=i0(e),n=this._buildArgs([t.toBase58()],r,"jsonParsed",i),o=e8(await this._rpcRequest("getProgramAccounts",n),i8(e4(nR)));if("error"in o)throw new iR(o.error,`failed to get accounts owned by program ${t.toBase58()}`);return o.result}async confirmTransaction(t,e){let r,i;if("string"==typeof t)r=t;else{if(t.abortSignal?.aborted)return Promise.reject(t.abortSignal.reason);r=t.signature}try{i=ej.default.decode(r)}catch(t){throw Error("signature must be base58 encoded: "+r)}return(ih(64===i.length,"signature has invalid length"),"string"==typeof t)?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:e||this.commitment,signature:r}):"lastValidBlockHeight"in t?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e||this.commitment,strategy:t}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:e||this.commitment,strategy:t})}getCancellationPromise(t){return new Promise((e,r)=>{null!=t&&(t.aborted?r(t.reason):t.addEventListener("abort",()=>{r(t.reason)}))})}getTransactionConfirmationPromise({commitment:t,signature:e}){let r,i,n=!1;return{abortConfirmation:()=>{i&&(i(),i=void 0),null!=r&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:new Promise((o,s)=>{try{r=this.onSignature(e,(t,e)=>{r=void 0,o({__type:iv.PROCESSED,response:{context:e,value:t}})},t);let a=new Promise(t=>{null==r?t():i=this._onSubscriptionStateChange(r,e=>{"subscribed"===e&&t()})});(async()=>{if(await a,n)return;let r=await this.getSignatureStatus(e);if(n||null==r)return;let{context:i,value:u}=r;if(null!=u)if(u?.err)s(u.err);else{switch(t){case"confirmed":case"single":case"singleGossip":if("processed"===u.confirmationStatus)return;break;case"finalized":case"max":case"root":if("processed"===u.confirmationStatus||"confirmed"===u.confirmationStatus)return}n=!0,o({__type:iv.PROCESSED,response:{context:i,value:u}})}})()}catch(t){s(t)}})}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t,strategy:{abortSignal:e,lastValidBlockHeight:r,signature:i}}){let n,o=!1,s=new Promise(e=>{let i=async()=>{try{return await this.getBlockHeight(t)}catch(t){return -1}};(async()=>{let t=await i();if(!o){for(;t<=r;)if(await iU(1e3),o||(t=await i(),o))return;e({__type:iv.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:t,signature:i}),l=this.getCancellationPromise(e);try{let t=await Promise.race([l,u,s]);if(t.__type===iv.PROCESSED)n=t.response;else throw new ir(i)}finally{o=!0,a()}return n}async confirmTransactionUsingDurableNonceStrategy({commitment:t,strategy:{abortSignal:e,minContextSlot:r,nonceAccountPubkey:i,nonceValue:n,signature:o}}){let s,a=!1,u=new Promise(e=>{let o=n,s=null,u=async()=>{try{let{context:e,value:n}=await this.getNonceAndContext(i,{commitment:t,minContextSlot:r});return s=e.slot,n?.nonce}catch(t){return o}};(async()=>{if(o=await u(),!a)for(;;){if(n!==o)return void e({__type:iv.NONCE_INVALID,slotInWhichNonceDidAdvance:s});if(await iU(2e3),a||(o=await u(),a))return}})()}),{abortConfirmation:l,confirmationPromise:f}=this.getTransactionConfirmationPromise({commitment:t,signature:o}),c=this.getCancellationPromise(e);try{let e=await Promise.race([c,f,u]);if(e.__type===iv.PROCESSED)s=e.response;else{let i;for(;;){let t=await this.getSignatureStatus(o);if(null==t)break;if(t.context.slot<(e.slotInWhichNonceDidAdvance??r)){await iU(400);continue}i=t;break}if(i?.value){let e=t||"finalized",{confirmationStatus:r}=i.value;switch(e){case"processed":case"recent":if("processed"!==r&&"confirmed"!==r&&"finalized"!==r)throw new io(o);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==r&&"finalized"!==r)throw new io(o);break;case"finalized":case"max":case"root":if("finalized"!==r)throw new io(o)}s={context:i.context,value:{err:i.value.err}}}else throw new io(o)}}finally{a=!0,l()}return s}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:t,signature:e}){let r,i,n=new Promise(e=>{let i=this._confirmTransactionInitialTimeout||6e4;switch(t){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":i=this._confirmTransactionInitialTimeout||3e4}r=setTimeout(()=>e({__type:iv.TIMED_OUT,timeoutMs:i}),i)}),{abortConfirmation:o,confirmationPromise:s}=this.getTransactionConfirmationPromise({commitment:t,signature:e});try{let t=await Promise.race([s,n]);if(t.__type===iv.PROCESSED)i=t.response;else throw new ii(e,t.timeoutMs/1e3)}finally{clearTimeout(r),o()}return i}async getClusterNodes(){let t=e8(await this._rpcRequest("getClusterNodes",[]),i8(e4(nD)));if("error"in t)throw new iR(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(t){let e=this._buildArgs([],t),r=e8(await this._rpcRequest("getVoteAccounts",e),nV);if("error"in r)throw new iR(r.error,"failed to get vote accounts");return r.result}async getSlot(t){let{commitment:e,config:r}=i0(t),i=this._buildArgs([],e,void 0,r),n=e8(await this._rpcRequest("getSlot",i),i8(rr()));if("error"in n)throw new iR(n.error,"failed to get slot");return n.result}async getSlotLeader(t){let{commitment:e,config:r}=i0(t),i=this._buildArgs([],e,void 0,r),n=e8(await this._rpcRequest("getSlotLeader",i),i8(ro()));if("error"in n)throw new iR(n.error,"failed to get slot leader");return n.result}async getSlotLeaders(t,e){let r=e8(await this._rpcRequest("getSlotLeaders",[t,e]),i8(e4(iJ)));if("error"in r)throw new iR(r.error,"failed to get slot leaders");return r.result}async getSignatureStatus(t,e){let{context:r,value:i}=await this.getSignatureStatuses([t],e);return ih(1===i.length),{context:r,value:i[0]}}async getSignatureStatuses(t,e){let r=[t];e&&r.push(e);let i=e8(await this._rpcRequest("getSignatureStatuses",r),nG);if("error"in i)throw new iR(i.error,"failed to get signature status");return i.result}async getTransactionCount(t){let{commitment:e,config:r}=i0(t),i=this._buildArgs([],e,void 0,r),n=e8(await this._rpcRequest("getTransactionCount",i),i8(rr()));if("error"in n)throw new iR(n.error,"failed to get transaction count");return n.result}async getTotalSupply(t){return(await this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(t){let e=this._buildArgs([],t),r=e8(await this._rpcRequest("getInflationGovernor",e),nd);if("error"in r)throw new iR(r.error,"failed to get inflation");return r.result}async getInflationReward(t,e,r){let{commitment:i,config:n}=i0(r),o=this._buildArgs([t.map(t=>t.toBase58())],i,void 0,{...n,epoch:null!=e?e:n?.epoch}),s=e8(await this._rpcRequest("getInflationReward",o),i9);if("error"in s)throw new iR(s.error,"failed to get inflation reward");return s.result}async getInflationRate(){let t=e8(await this._rpcRequest("getInflationRate",[]),np);if("error"in t)throw new iR(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(t){let{commitment:e,config:r}=i0(t),i=this._buildArgs([],e,void 0,r),n=e8(await this._rpcRequest("getEpochInfo",i),ny);if("error"in n)throw new iR(n.error,"failed to get epoch info");return n.result}async getEpochSchedule(){let t=e8(await this._rpcRequest("getEpochSchedule",[]),nm);if("error"in t)throw new iR(t.error,"failed to get epoch schedule");let e=t.result;return new i$(e.slotsPerEpoch,e.leaderScheduleSlotOffset,e.warmup,e.firstNormalEpoch,e.firstNormalSlot)}async getLeaderSchedule(){let t=e8(await this._rpcRequest("getLeaderSchedule",[]),nb);if("error"in t)throw new iR(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(t,e){let r=this._buildArgs([t],e),i=e8(await this._rpcRequest("getMinimumBalanceForRentExemption",r),nY);return"error"in i?(console.warn("Unable to fetch minimum balance for rent exemption"),0):i.result}async getRecentBlockhashAndContext(t){let{context:e,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(t);return{context:e,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON:()=>({})}}}}async getRecentPerformanceSamples(t){let e=e8(await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),od);if("error"in e)throw new iR(e.error,"failed to get recent performance samples");return e.result}async getFeeCalculatorForBlockhash(t,e){let r=this._buildArgs([t],e),i=e8(await this._rpcRequest("getFeeCalculatorForBlockhash",r),op);if("error"in i)throw new iR(i.error,"failed to get fee calculator");let{context:n,value:o}=i.result;return{context:n,value:null!==o?o.feeCalculator:null}}async getFeeForMessage(t,e){let r=r4(t.serialize()).toString("base64"),i=this._buildArgs([r],e),n=e8(await this._rpcRequest("getFeeForMessage",i),i3(re(rr())));if("error"in n)throw new iR(n.error,"failed to get fee for message");if(null===n.result)throw Error("invalid blockhash");return n.result}async getRecentPrioritizationFees(t){let e=t?.lockedWritableAccounts?.map(t=>t.toBase58()),r=e?.length?[e]:[],i=e8(await this._rpcRequest("getRecentPrioritizationFees",r),ng);if("error"in i)throw new iR(i.error,"failed to get recent prioritization fees");return i.result}async getRecentBlockhash(t){try{return(await this.getRecentBlockhashAndContext(t)).value}catch(t){throw Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(t){try{return(await this.getLatestBlockhashAndContext(t)).value}catch(t){throw Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(t){let{commitment:e,config:r}=i0(t),i=this._buildArgs([],e,void 0,r),n=e8(await this._rpcRequest("getLatestBlockhash",i),oc);if("error"in n)throw new iR(n.error,"failed to get latest blockhash");return n.result}async isBlockhashValid(t,e){let{commitment:r,config:i}=i0(e),n=this._buildArgs([t],r,void 0,i),o=e8(await this._rpcRequest("isBlockhashValid",n),oh);if("error"in o)throw new iR(o.error,"failed to determine if the blockhash `"+t+"`is valid");return o.result}async getVersion(){let t=e8(await this._rpcRequest("getVersion",[]),i8(nu));if("error"in t)throw new iR(t.error,"failed to get version");return t.result}async getGenesisHash(){let t=e8(await this._rpcRequest("getGenesisHash",[]),i8(ro()));if("error"in t)throw new iR(t.error,"failed to get genesis hash");return t.result}async getBlock(t,e){let{commitment:r,config:i}=i0(e),n=this._buildArgsAtLeastConfirmed([t],r,void 0,i),o=await this._rpcRequest("getBlock",n);try{switch(i?.transactionDetails){case"accounts":{let t=e8(o,oi);if("error"in t)throw t.error;return t.result}case"none":{let t=e8(o,or);if("error"in t)throw t.error;return t.result}default:{let t=e8(o,oe);if("error"in t)throw t.error;let{result:e}=t;return e?{...e,transactions:e.transactions.map(({transaction:t,meta:e,version:r})=>({meta:e,transaction:{...t,message:i4(r,t.message)},version:r}))}:null}}}catch(t){throw new iR(t,"failed to get confirmed block")}}async getParsedBlock(t,e){let{commitment:r,config:i}=i0(e),n=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i),o=await this._rpcRequest("getBlock",n);try{switch(i?.transactionDetails){case"accounts":{let t=e8(o,oo);if("error"in t)throw t.error;return t.result}case"none":{let t=e8(o,os);if("error"in t)throw t.error;return t.result}default:{let t=e8(o,on);if("error"in t)throw t.error;return t.result}}}catch(t){throw new iR(t,"failed to get block")}}async getBlockProduction(t){let e,r;if("string"==typeof t)r=t;else if(t){let{commitment:i,...n}=t;r=i,e=n}let i=this._buildArgs([],r,"base64",e),n=e8(await this._rpcRequest("getBlockProduction",i),nh);if("error"in n)throw new iR(n.error,"failed to get block production information");return n.result}async getTransaction(t,e){let{commitment:r,config:i}=i0(e),n=this._buildArgsAtLeastConfirmed([t],r,void 0,i),o=e8(await this._rpcRequest("getTransaction",n),ol);if("error"in o)throw new iR(o.error,"failed to get transaction");let s=o.result;return s?{...s,transaction:{...s.transaction,message:i4(s.version,s.transaction.message)}}:s}async getParsedTransaction(t,e){let{commitment:r,config:i}=i0(e),n=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i),o=e8(await this._rpcRequest("getTransaction",n),of);if("error"in o)throw new iR(o.error,"failed to get transaction");return o.result}async getParsedTransactions(t,e){let{commitment:r,config:i}=i0(e),n=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i)}));return(await this._rpcBatchRequest(n)).map(t=>{let e=e8(t,of);if("error"in e)throw new iR(e.error,"failed to get transactions");return e.result})}async getTransactions(t,e){let{commitment:r,config:i}=i0(e),n=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,void 0,i)}));return(await this._rpcBatchRequest(n)).map(t=>{let e=e8(t,ol);if("error"in e)throw new iR(e.error,"failed to get transactions");let r=e.result;return r?{...r,transaction:{...r.transaction,message:i4(r.version,r.transaction.message)}}:r})}async getConfirmedBlock(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),i=e8(await this._rpcRequest("getBlock",r),oa);if("error"in i)throw new iR(i.error,"failed to get confirmed block");let n=i.result;if(!n)throw Error("Confirmed block "+t+" not found");let o={...n,transactions:n.transactions.map(({transaction:t,meta:e})=>{let r=new im(t.message);return{meta:e,transaction:{...t,message:r}}})};return{...o,transactions:o.transactions.map(({transaction:t,meta:e})=>({meta:e,transaction:iE.populate(t.message,t.signatures)}))}}async getBlocks(t,e,r){let i=this._buildArgsAtLeastConfirmed(void 0!==e?[t,e]:[t],r),n=e8(await this._rpcRequest("getBlocks",i),i8(e4(rr())));if("error"in n)throw new iR(n.error,"failed to get blocks");return n.result}async getBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),i=e8(await this._rpcRequest("getBlock",r),ou);if("error"in i)throw new iR(i.error,"failed to get block");let n=i.result;if(!n)throw Error("Block "+t+" not found");return n}async getConfirmedBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),i=e8(await this._rpcRequest("getBlock",r),ou);if("error"in i)throw new iR(i.error,"failed to get confirmed block");let n=i.result;if(!n)throw Error("Confirmed block "+t+" not found");return n}async getConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),i=e8(await this._rpcRequest("getTransaction",r),ol);if("error"in i)throw new iR(i.error,"failed to get transaction");let n=i.result;if(!n)return n;let o=new im(n.transaction.message),s=n.transaction.signatures;return{...n,transaction:iE.populate(o,s)}}async getParsedConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,"jsonParsed"),i=e8(await this._rpcRequest("getTransaction",r),of);if("error"in i)throw new iR(i.error,"failed to get confirmed transaction");return i.result}async getParsedConfirmedTransactions(t,e){let r=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],e,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(t=>{let e=e8(t,of);if("error"in e)throw new iR(e.error,"failed to get confirmed transactions");return e.result})}async getConfirmedSignaturesForAddress(t,e,r){let i={},n=await this.getFirstAvailableBlock();for(;!("until"in i)&&!(--e<=0)&&!(e<n);)try{let t=await this.getConfirmedBlockSignatures(e,"finalized");t.signatures.length>0&&(i.until=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}let o=await this.getSlot("finalized");for(;!("before"in i)&&!(++r>o);)try{let t=await this.getConfirmedBlockSignatures(r);t.signatures.length>0&&(i.before=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}return(await this.getConfirmedSignaturesForAddress2(t,i)).map(t=>t.signature)}async getConfirmedSignaturesForAddress2(t,e,r){let i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),n=e8(await this._rpcRequest("getConfirmedSignaturesForAddress2",i),nU);if("error"in n)throw new iR(n.error,"failed to get confirmed signatures for address");return n.result}async getSignaturesForAddress(t,e,r){let i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),n=e8(await this._rpcRequest("getSignaturesForAddress",i),nL);if("error"in n)throw new iR(n.error,"failed to get signatures for address");return n.result}async getAddressLookupTable(t,e){let{context:r,value:i}=await this.getAccountInfoAndContext(t,e),n=null;return null!==i&&(n=new iZ({key:t,state:iZ.deserialize(i.data)})),{context:r,value:n}}async getNonceAndContext(t,e){let{context:r,value:i}=await this.getAccountInfoAndContext(t,e),n=null;return null!==i&&(n=iq.fromAccountData(i.data)),{context:r,value:n}}async getNonce(t,e){return await this.getNonceAndContext(t,e).then(t=>t.value).catch(e=>{throw Error("failed to get nonce for account "+t.toBase58()+": "+e)})}async requestAirdrop(t,e){let r=e8(await this._rpcRequest("requestAirdrop",[t.toBase58(),e]),og);if("error"in r)throw new iR(r.error,`airdrop to ${t.toBase58()} failed`);return r.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await iU(100);let t=Date.now()-this._blockhashInfo.lastFetch;if(null!==this._blockhashInfo.latestBlockhash&&!(t>=3e4))return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{let t=Date.now(),e=this._blockhashInfo.latestBlockhash,r=e?e.blockhash:null;for(let t=0;t<50;t++){let t=await this.getLatestBlockhash("finalized");if(r!==t.blockhash)return this._blockhashInfo={latestBlockhash:t,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},t;await iU(200)}throw Error(`Unable to obtain a new blockhash after ${Date.now()-t}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(t){let{commitment:e,config:r}=i0(t),i=this._buildArgs([],e,"base64",r),n=e8(await this._rpcRequest("getStakeMinimumDelegation",i),i3(rr()));if("error"in n)throw new iR(n.error,"failed to get stake minimum delegation");return n.result}async simulateTransaction(t,e,r){let i;if("message"in t){let i=t.serialize(),n=l.Buffer.from(i).toString("base64");if(Array.isArray(e)||void 0!==r)throw Error("Invalid arguments");let o=e||{};o.encoding="base64","commitment"in o||(o.commitment=this.commitment),e&&"object"==typeof e&&"innerInstructions"in e&&(o.innerInstructions=e.innerInstructions);let s=[n,o],a=e8(await this._rpcRequest("simulateTransaction",s),nc);if("error"in a)throw Error("failed to simulate transaction: "+a.error.message);return a.result}if(t instanceof iE?((i=new iE).feePayer=t.feePayer,i.instructions=t.instructions,i.nonceInfo=t.nonceInfo,i.signatures=t.signatures):(i=iE.populate(t))._message=i._json=void 0,void 0!==e&&!Array.isArray(e))throw Error("Invalid arguments");if(i.nonceInfo&&e)i.sign(...e);else{let t=this._disableBlockhashCaching;for(;;){let r=await this._blockhashWithExpiryBlockHeight(t);if(i.lastValidBlockHeight=r.lastValidBlockHeight,i.recentBlockhash=r.blockhash,!e)break;if(i.sign(...e),!i.signature)throw Error("!signature");let n=i.signature.toString("base64");if(this._blockhashInfo.simulatedSignatures.includes(n)||this._blockhashInfo.transactionSignatures.includes(n))t=!0;else{this._blockhashInfo.simulatedSignatures.push(n);break}}}let n=i._compile(),o=n.serialize(),s=i._serialize(o).toString("base64"),a={encoding:"base64",commitment:this.commitment};r&&(a.accounts={encoding:"base64",addresses:(Array.isArray(r)?r:n.nonProgramIds()).map(t=>t.toBase58())}),e&&(a.sigVerify=!0),e&&"object"==typeof e&&"innerInstructions"in e&&(a.innerInstructions=e.innerInstructions);let u=[s,a],f=e8(await this._rpcRequest("simulateTransaction",u),nc);if("error"in f){let t;if("data"in f.error&&(t=f.error.data.logs)&&Array.isArray(t)){let e="\n ",r=e+t.join(e);console.error(f.error.message,r)}throw new iO({action:"simulate",signature:"",transactionMessage:f.error.message,logs:t})}return f.result}async sendTransaction(t,e,r){if("version"in t){if(e&&Array.isArray(e))throw Error("Invalid arguments");let r=t.serialize();return await this.sendRawTransaction(r,e)}if(void 0===e||!Array.isArray(e))throw Error("Invalid arguments");if(t.nonceInfo)t.sign(...e);else{let r=this._disableBlockhashCaching;for(;;){let i=await this._blockhashWithExpiryBlockHeight(r);if(t.lastValidBlockHeight=i.lastValidBlockHeight,t.recentBlockhash=i.blockhash,t.sign(...e),!t.signature)throw Error("!signature");let n=t.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(n))r=!0;else{this._blockhashInfo.transactionSignatures.push(n);break}}}let i=t.serialize();return await this.sendRawTransaction(i,r)}async sendRawTransaction(t,e){let r=r4(t).toString("base64");return await this.sendEncodedTransaction(r,e)}async sendEncodedTransaction(t,e){let r={encoding:"base64"},i=e&&e.skipPreflight,n=!0===i?"processed":e&&e.preflightCommitment||this.commitment;e&&null!=e.maxRetries&&(r.maxRetries=e.maxRetries),e&&null!=e.minContextSlot&&(r.minContextSlot=e.minContextSlot),i&&(r.skipPreflight=i),n&&(r.preflightCommitment=n);let o=[t,r],s=e8(await this._rpcRequest("sendTransaction",o),oy);if("error"in s){let t;throw"data"in s.error&&(t=s.error.data.logs),new iO({action:i?"send":"simulate",signature:"",transactionMessage:s.error.message,logs:t})}return s.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(t){this._rpcWebSocketConnected=!1,console.error("ws error:",t.message)}_wsOnClose(t){(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3===t)?this._updateSubscriptions():(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([t,e])=>{this._setSubscription(t,{...e,state:"pending"})}))}_setSubscription(t,e){let r=this._subscriptionsByHash[t]?.state;if(this._subscriptionsByHash[t]=e,r!==e.state){let r=this._subscriptionStateChangeCallbacksByHash[t];r&&r.forEach(t=>{try{t(e.state)}catch{}})}}_onSubscriptionStateChange(t,e){let r=this._subscriptionHashByClientSubscriptionId[t];if(null==r)return()=>{};let i=this._subscriptionStateChangeCallbacksByHash[r]||=new Set;return i.add(e),()=>{i.delete(e),0===i.size&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(t){t instanceof Error&&console.log(`Error when closing socket connection: ${t.message}`)}},500));return}if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();let t=this._rpcWebSocketGeneration,e=()=>t===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async t=>{let r=this._subscriptionsByHash[t];if(void 0!==r)switch(r.state){case"pending":case"unsubscribed":if(0===r.callbacks.size){delete this._subscriptionsByHash[t],"unsubscribed"===r.state&&delete this._subscriptionCallbacksByServerSubscriptionId[r.serverSubscriptionId],await this._updateSubscriptions();return}await (async()=>{let{args:i,method:n}=r;try{this._setSubscription(t,{...r,state:"subscribing"});let e=await this._rpcWebSocket.call(n,i);this._setSubscription(t,{...r,serverSubscriptionId:e,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[e]=r.callbacks,await this._updateSubscriptions()}catch(o){if(console.error(`Received ${o instanceof Error?"":"JSON-RPC "}error calling \`${n}\``,{args:i,error:o}),!e())return;this._setSubscription(t,{...r,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":0===r.callbacks.size&&await (async()=>{let{serverSubscriptionId:i,unsubscribeMethod:n}=r;if(this._subscriptionsAutoDisposedByRpc.has(i))this._subscriptionsAutoDisposedByRpc.delete(i);else{this._setSubscription(t,{...r,state:"unsubscribing"}),this._setSubscription(t,{...r,state:"unsubscribing"});try{await this._rpcWebSocket.call(n,[i])}catch(i){if(i instanceof Error&&console.error(`${n} error:`,i.message),!e())return;this._setSubscription(t,{...r,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(t,{...r,state:"unsubscribed"}),await this._updateSubscriptions()})()}}))}_handleServerNotification(t,e){let r=this._subscriptionCallbacksByServerSubscriptionId[t];void 0!==r&&r.forEach(t=>{try{t(...e)}catch(t){console.error(t)}})}_wsOnAccountNotification(t){let{result:e,subscription:r}=e8(t,nP);this._handleServerNotification(r,[e.value,e.context])}_makeSubscription(t,e){let r=this._nextClientSubscriptionId++,i=ij([t.method,e]),n=this._subscriptionsByHash[i];return void 0===n?this._subscriptionsByHash[i]={...t,args:e,callbacks:new Set([t.callback]),state:"pending"}:n.callbacks.add(t.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];let e=this._subscriptionsByHash[i];ih(void 0!==e,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),e.callbacks.delete(t.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(t,e,r){let{commitment:i,config:n}=i0(r),o=this._buildArgs([t.toBase58()],i||this._commitment||"finalized","base64",n);return this._makeSubscription({callback:e,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"account change")}_wsOnProgramAccountNotification(t){let{result:e,subscription:r}=e8(t,nN);this._handleServerNotification(r,[{accountId:e.value.pubkey,accountInfo:e.value.account},e.context])}onProgramAccountChange(t,e,r,i){let{commitment:n,config:o}=i0(r),s=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64",o||(i?{filters:i1(i)}:void 0));return this._makeSubscription({callback:e,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},s)}async removeProgramAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"program account change")}onLogs(t,e,r){let i=this._buildArgs(["object"==typeof t?{mentions:[t.toString()]}:t],r||this._commitment||"finalized");return this._makeSubscription({callback:e,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},i)}async removeOnLogsListener(t){await this._unsubscribeClientSubscription(t,"logs")}_wsOnLogsNotification(t){let{result:e,subscription:r}=e8(t,ob);this._handleServerNotification(r,[e.value,e.context])}_wsOnSlotNotification(t){let{result:e,subscription:r}=e8(t,nz);this._handleServerNotification(r,[e])}onSlotChange(t){return this._makeSubscription({callback:t,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(t){await this._unsubscribeClientSubscription(t,"slot change")}_wsOnSlotUpdatesNotification(t){let{result:e,subscription:r}=e8(t,nF);this._handleServerNotification(r,[e])}onSlotUpdate(t){return this._makeSubscription({callback:t,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(t){await this._unsubscribeClientSubscription(t,"slot update")}async _unsubscribeClientSubscription(t,e){let r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${t}\` for '${e}' events could not be found.`)}_buildArgs(t,e,r,i){let n=e||this._commitment;if(n||r||i){let e={};r&&(e.encoding=r),n&&(e.commitment=n),i&&(e=Object.assign(e,i)),t.push(e)}return t}_buildArgsAtLeastConfirmed(t,e,r,i){let n=e||this._commitment;if(n&&!["confirmed","finalized"].includes(n))throw Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(t,e,r,i)}_wsOnSignatureNotification(t){let{result:e,subscription:r}=e8(t,nK);"receivedSignature"!==e.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===e.value?[{type:"received"},e.context]:[{type:"status",result:e.value},e.context])}onSignature(t,e,r){let i=this._buildArgs([t],r||this._commitment||"finalized"),n=this._makeSubscription({callback:(t,r)=>{if("status"===t.type){e(t.result,r);try{this.removeSignatureListener(n)}catch(t){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return n}
7onSignatureWithOptions(t,e,r){let{commitment:i,...n}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([t],i,void 0,n),s=this._makeSubscription({callback:(t,r)=>{e(t,r);try{this.removeSignatureListener(s)}catch(t){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return s}async removeSignatureListener(t){await this._unsubscribeClientSubscription(t,"signature result")}_wsOnRootNotification(t){let{result:e,subscription:r}=e8(t,nj);this._handleServerNotification(r,[e])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}},"Keypair",0,ov,"LAMPORTS_PER_SOL",0,1e9,"PublicKey",0,ie,"SYSVAR_RENT_PUBKEY",0,i_,"SystemProgram",0,iF,"Transaction",0,iE,"TransactionInstruction",0,iS,"TransactionMessage",0,ik,"VersionedMessage",0,iw,"VersionedTransaction",0,iB],27261)}]);
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.