1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="07336767-34b6-ee21-4fec-0caea479aa47")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,734582,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=h(t),r=e[0],i=e[1];return(r+i)*3/4-i},r.toByteArray=function(t){var e,r,i=h(t),s=i[0],a=i[1],u=new o((s+a)*3/4-a),l=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[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=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 h(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},638492,(t,e,r)=>{r.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,h=u>>1,l=-7,c=r?n-1:0,f=r?-1:1,d=t[e+c];for(c+=f,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+t[e+c],c+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=i;l>0;s=256*s+t[e+c],c+=f,l-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=h}return(d?-1:1)*s*Math.pow(2,o-i)},r.write=function(t,e,r,i,n,o){var s,a,u,h=8*o-n-1,l=(1<<h)-1,c=l>>1,f=5960464477539062e-23*(23===n),d=i?0:o-1,p=i?1:-1,m=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+c>=1?e+=f/u:e+=f*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=l?(a=0,s=l):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,h+=n;h>0;t[r+d]=255&s,d+=p,s/=256,h-=8);t[r+d-p]|=128*m}},843943,(t,e,r)=>{"use strict";let i=t.r(734582),n=t.r(638492),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 l(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 f(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 f(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 h=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(h)return h;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 h(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');
vendor: 66,441 bytes, line 2
2if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return h(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 f(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 C(t).length;default:if(n)return i?-1:L(t).length;e=(""+e).toLowerCase(),n=!0}}function m(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+=z[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 g(t,e,r){let 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;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 h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){let i=-1;for(o=r;o<a;o++)if(h(t,o)===h(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(h(t,o+i)!==h(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 k(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){R(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 S(t,e,r,i,n){R(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 M(t,e,r,i,n,o){if(r+i>t.length||r<0)throw RangeError("Index out of range")}function E(t,e,r,i,o){return e*=1,r>>>=0,o||M(t,e,r,4,34028234663852886e22,-34028234663852886e22),n.write(t,e,r,i,23,4),r+4}function _(t,e,r,i,o){return e*=1,r>>>=0,o||M(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(h(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 l(t)},a.allocUnsafeSlow=function(t){return l(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)g(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)g(this,e,e+3),g(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)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(){let t=this.length;return 0===t?"":0==arguments.length?w(this,0,t):m.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),h=this.slice(i,n),l=t.slice(e,r);for(let t=0;t<u;++t)if(h[t]!==l[t]){o=h[t],s=l[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 y(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},a.prototype.write=function(t,e,r,i){var n,o,s,a,u,h,l,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 f=this.length-e;if((void 0===r||r>f)&&(r=f),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,U(L(t,this.length-n),this,n,o);case"ascii":case"latin1":case"binary":return s=e,a=r,U(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,h=r,U(C(t),this,u,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=e,c=r,U(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-l),this,l,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=q(function(t){P(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=q(function(t){P(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=q(function(t){P(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=q(function(t){P(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;k(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;k(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||k(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||k(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||k(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||k(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||k(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=q(function(t,e=0){return x(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=q(function(t,e=0){return S(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);k(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);k(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||k(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||k(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||k(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||k(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||k(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=q(function(t,e=0){return x(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=q(function(t,e=0){return S(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(t,e,r){return E(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return E(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return _(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return _(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 A(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 B(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 R(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)}P(n,"offset"),(void 0===i[n]||void 0===i[n+o])&&T(n,i.length-(o+1))}function P(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 P(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)}A("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),A("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),A("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=B(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=B(n)),n+="n"),i+=` It must be ${e}. Received ${n}`},RangeError);let O=/[^+/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 C(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(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 z=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 q(t){return"u"<typeof BigInt?K:t}function K(){throw Error("BigInt not supported")}},776284,(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{l="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 h=t.charCodeAt(u)-48;o*=n,s=h>=49?h-49+10:h>=17?h-17+10:h,r(h>=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,h=0,l=r;l<u;l+=i)h=a(t,l,l+i,e),this.imuln(n),this.words[0]+h<0x4000000?this.words[0]+=h:this._iaddn(h);if(0!==s){var c=1;for(h=a(t,l,t.length,e),l=0;l<s;l++)c*=e;this.imuln(c),this.words[0]+h<0x4000000?this.words[0]+=h:this._iaddn(h)}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")]=h}catch(t){n.prototype.inspect=h}else n.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l,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"],f=[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 h=1;h<i;h++){for(var l=u>>>26,c=0x3ffffff&u,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[d])+c)/0x4000000|0,c=0x3ffffff&s}r.words[h]=0|c,u=0|l}return 0!==u?r.words[h]=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 h=f[t],l=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(t);i=(p=p.idivn(l)).isZero()?m+i:c[h-m.length]+m+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)},l&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(l,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];return i>0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),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 m=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,h=0,l=0|s[0],c=8191&l,f=l>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,w=0|s[3],v=8191&w,k=w>>>13,x=0|s[4],S=8191&x,M=x>>>13,E=0|s[5],_=8191&E,I=E>>>13,A=0|s[6],B=8191&A,R=A>>>13,P=0|s[7],T=8191&P,O=P>>>13,L=0|s[8],C=8191&L,U=L>>>13,N=0|s[9],z=8191&N,q=N>>>13,K=0|a[0],W=8191&K,F=K>>>13,D=0|a[1],V=8191&D,j=D>>>13,$=0|a[2],H=8191&$,Z=$>>>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,th=ta>>>13,tl=0|a[8],tc=8191&tl,tf=tl>>>13,td=0|a[9],tp=8191&td,tm=td>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(c,W);var tg=(h+i|0)+((8191&(n=(n=Math.imul(c,F))+Math.imul(f,W)|0))<<13)|0;h=((o=Math.imul(f,F))+(n>>>13)|0)+(tg>>>26)|0,tg&=0x3ffffff,i=Math.imul(p,W),n=(n=Math.imul(p,F))+Math.imul(m,W)|0,o=Math.imul(m,F),i=i+Math.imul(c,V)|0;var ty=(h+i|0)+((8191&(n=(n=n+Math.imul(c,j)|0)+Math.imul(f,V)|0))<<13)|0;h=((o=o+Math.imul(f,j)|0)+(n>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,i=Math.imul(y,W),n=(n=Math.imul(y,F))+Math.imul(b,W)|0,o=Math.imul(b,F),i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,j)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,j)|0,i=i+Math.imul(c,H)|0;var tb=(h+i|0)+((8191&(n=(n=n+Math.imul(c,Z)|0)+Math.imul(f,H)|0))<<13)|0;h=((o=o+Math.imul(f,Z)|0)+(n>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,i=Math.imul(v,W),n=(n=Math.imul(v,F))+Math.imul(k,W)|0,o=Math.imul(k,F),i=i+Math.imul(y,V)|0,n=(n=n+Math.imul(y,j)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,j)|0,i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,Z)|0,i=i+Math.imul(c,Y)|0;var tw=(h+i|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(f,Y)|0))<<13)|0;h=((o=o+Math.imul(f,J)|0)+(n>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,i=Math.imul(S,W),n=(n=Math.imul(S,F))+Math.imul(M,W)|0,o=Math.imul(M,F),i=i+Math.imul(v,V)|0,n=(n=n+Math.imul(v,j)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,j)|0,i=i+Math.imul(y,H)|0,n=(n=n+Math.imul(y,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(m,Y)|0,o=o+Math.imul(m,J)|0,i=i+Math.imul(c,Q)|0;var tv=(h+i|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,i=Math.imul(_,W),n=(n=Math.imul(_,F))+Math.imul(I,W)|0,o=Math.imul(I,F),i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,j)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,j)|0,i=i+Math.imul(v,H)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,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(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(c,tr)|0;var tk=(h+i|0)+((8191&(n=(n=n+Math.imul(c,ti)|0)+Math.imul(f,tr)|0))<<13)|0;h=((o=o+Math.imul(f,ti)|0)+(n>>>13)|0)+(tk>>>26)|0,tk&=0x3ffffff,i=Math.imul(B,W),n=(n=Math.imul(B,F))+Math.imul(R,W)|0,o=Math.imul(R,F),i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,j)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,j)|0,i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,Z)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,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(m,tr)|0,o=o+Math.imul(m,ti)|0,i=i+Math.imul(c,to)|0;var tx=(h+i|0)+((8191&(n=(n=n+Math.imul(c,ts)|0)+Math.imul(f,to)|0))<<13)|0;h=((o=o+Math.imul(f,ts)|0)+(n>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,i=Math.imul(T,W),n=(n=Math.imul(T,F))+Math.imul(O,W)|0,o=Math.imul(O,F),i=i+Math.imul(B,V)|0,n=(n=n+Math.imul(B,j)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,j)|0,i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,Z)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(y,tr)|0,n=(n=n+Math.imul(y,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(m,to)|0,o=o+Math.imul(m,ts)|0,i=i+Math.imul(c,tu)|0;var tS=(h+i|0)+((8191&(n=(n=n+Math.imul(c,th)|0)+Math.imul(f,tu)|0))<<13)|0;h=((o=o+Math.imul(f,th)|0)+(n>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,i=Math.imul(C,W),n=(n=Math.imul(C,F))+Math.imul(U,W)|0,o=Math.imul(U,F),i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,j)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,j)|0,i=i+Math.imul(B,H)|0,n=(n=n+Math.imul(B,Z)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(v,tr)|0,n=(n=n+Math.imul(v,ti)|0)+Math.imul(k,tr)|0,o=o+Math.imul(k,ti)|0,i=i+Math.imul(y,to)|0,n=(n=n+Math.imul(y,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,th)|0)+Math.imul(m,tu)|0,o=o+Math.imul(m,th)|0,i=i+Math.imul(c,tc)|0;var tM=(h+i|0)+((8191&(n=(n=n+Math.imul(c,tf)|0)+Math.imul(f,tc)|0))<<13)|0;h=((o=o+Math.imul(f,tf)|0)+(n>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,i=Math.imul(z,W),n=(n=Math.imul(z,F))+Math.imul(q,W)|0,o=Math.imul(q,F),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,j)|0)+Math.imul(U,V)|0,o=o+Math.imul(U,j)|0,i=i+Math.imul(T,H)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,Z)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,J)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(S,tr)|0,n=(n=n+Math.imul(S,ti)|0)+Math.imul(M,tr)|0,o=o+Math.imul(M,ti)|0,i=i+Math.imul(v,to)|0,n=(n=n+Math.imul(v,ts)|0)+Math.imul(k,to)|0,o=o+Math.imul(k,ts)|0,i=i+Math.imul(y,tu)|0,n=(n=n+Math.imul(y,th)|0)+Math.imul(b,tu)|0,o=o+Math.imul(b,th)|0,i=i+Math.imul(p,tc)|0,n=(n=n+Math.imul(p,tf)|0)+Math.imul(m,tc)|0,o=o+Math.imul(m,tf)|0,i=i+Math.imul(c,tp)|0;var tE=(h+i|0)+((8191&(n=(n=n+Math.imul(c,tm)|0)+Math.imul(f,tp)|0))<<13)|0;h=((o=o+Math.imul(f,tm)|0)+(n>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,i=Math.imul(z,V),n=(n=Math.imul(z,j))+Math.imul(q,V)|0,o=Math.imul(q,j),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(U,H)|0,o=o+Math.imul(U,Z)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,J)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(_,tr)|0,n=(n=n+Math.imul(_,ti)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,ti)|0,i=i+Math.imul(S,to)|0,n=(n=n+Math.imul(S,ts)|0)+Math.imul(M,to)|0,o=o+Math.imul(M,ts)|0,i=i+Math.imul(v,tu)|0,n=(n=n+Math.imul(v,th)|0)+Math.imul(k,tu)|0,o=o+Math.imul(k,th)|0,i=i+Math.imul(y,tc)|0,n=(n=n+Math.imul(y,tf)|0)+Math.imul(b,tc)|0,o=o+Math.imul(b,tf)|0,i=i+Math.imul(p,tp)|0;var t_=(h+i|0)+((8191&(n=(n=n+Math.imul(p,tm)|0)+Math.imul(m,tp)|0))<<13)|0;h=((o=o+Math.imul(m,tm)|0)+(n>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,i=Math.imul(z,H),n=(n=Math.imul(z,Z))+Math.imul(q,H)|0,o=Math.imul(q,Z),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(U,Y)|0,o=o+Math.imul(U,J)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(B,tr)|0,n=(n=n+Math.imul(B,ti)|0)+Math.imul(R,tr)|0,o=o+Math.imul(R,ti)|0,i=i+Math.imul(_,to)|0,n=(n=n+Math.imul(_,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,i=i+Math.imul(S,tu)|0,n=(n=n+Math.imul(S,th)|0)+Math.imul(M,tu)|0,o=o+Math.imul(M,th)|0,i=i+Math.imul(v,tc)|0,n=(n=n+Math.imul(v,tf)|0)+Math.imul(k,tc)|0,o=o+Math.imul(k,tf)|0,i=i+Math.imul(y,tp)|0;var tI=(h+i|0)+((8191&(n=(n=n+Math.imul(y,tm)|0)+Math.imul(b,tp)|0))<<13)|0;h=((o=o+Math.imul(b,tm)|0)+(n>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,i=Math.imul(z,Y),n=(n=Math.imul(z,J))+Math.imul(q,Y)|0,o=Math.imul(q,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(T,tr)|0,n=(n=n+Math.imul(T,ti)|0)+Math.imul(O,tr)|0,o=o+Math.imul(O,ti)|0,i=i+Math.imul(B,to)|0,n=(n=n+Math.imul(B,ts)|0)+Math.imul(R,to)|0,o=o+Math.imul(R,ts)|0,i=i+Math.imul(_,tu)|0,n=(n=n+Math.imul(_,th)|0)+Math.imul(I,tu)|0,o=o+Math.imul(I,th)|0,i=i+Math.imul(S,tc)|0,n=(n=n+Math.imul(S,tf)|0)+Math.imul(M,tc)|0,o=o+Math.imul(M,tf)|0,i=i+Math.imul(v,tp)|0;var tA=(h+i|0)+((8191&(n=(n=n+Math.imul(v,tm)|0)+Math.imul(k,tp)|0))<<13)|0;h=((o=o+Math.imul(k,tm)|0)+(n>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,i=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(q,Q)|0,o=Math.imul(q,tt),i=i+Math.imul(C,tr)|0,n=(n=n+Math.imul(C,ti)|0)+Math.imul(U,tr)|0,o=o+Math.imul(U,ti)|0,i=i+Math.imul(T,to)|0,n=(n=n+Math.imul(T,ts)|0)+Math.imul(O,to)|0,o=o+Math.imul(O,ts)|0,i=i+Math.imul(B,tu)|0,n=(n=n+Math.imul(B,th)|0)+Math.imul(R,tu)|0,o=o+Math.imul(R,th)|0,i=i+Math.imul(_,tc)|0,n=(n=n+Math.imul(_,tf)|0)+Math.imul(I,tc)|0,o=o+Math.imul(I,tf)|0,i=i+Math.imul(S,tp)|0;var tB=(h+i|0)+((8191&(n=(n=n+Math.imul(S,tm)|0)+Math.imul(M,tp)|0))<<13)|0;h=((o=o+Math.imul(M,tm)|0)+(n>>>13)|0)+(tB>>>26)|0,tB&=0x3ffffff,i=Math.imul(z,tr),n=(n=Math.imul(z,ti))+Math.imul(q,tr)|0,o=Math.imul(q,ti),i=i+Math.imul(C,to)|0,n=(n=n+Math.imul(C,ts)|0)+Math.imul(U,to)|0,o=o+Math.imul(U,ts)|0,i=i+Math.imul(T,tu)|0,n=(n=n+Math.imul(T,th)|0)+Math.imul(O,tu)|0,o=o+Math.imul(O,th)|0,i=i+Math.imul(B,tc)|0,n=(n=n+Math.imul(B,tf)|0)+Math.imul(R,tc)|0,o=o+Math.imul(R,tf)|0,i=i+Math.imul(_,tp)|0;var tR=(h+i|0)+((8191&(n=(n=n+Math.imul(_,tm)|0)+Math.imul(I,tp)|0))<<13)|0;h=((o=o+Math.imul(I,tm)|0)+(n>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,i=Math.imul(z,to),n=(n=Math.imul(z,ts))+Math.imul(q,to)|0,o=Math.imul(q,ts),i=i+Math.imul(C,tu)|0,n=(n=n+Math.imul(C,th)|0)+Math.imul(U,tu)|0,o=o+Math.imul(U,th)|0,i=i+Math.imul(T,tc)|0,n=(n=n+Math.imul(T,tf)|0)+Math.imul(O,tc)|0,o=o+Math.imul(O,tf)|0,i=i+Math.imul(B,tp)|0;var tP=(h+i|0)+((8191&(n=(n=n+Math.imul(B,tm)|0)+Math.imul(R,tp)|0))<<13)|0;h=((o=o+Math.imul(R,tm)|0)+(n>>>13)|0)+(tP>>>26)|0,tP&=0x3ffffff,i=Math.imul(z,tu),n=(n=Math.imul(z,th))+Math.imul(q,tu)|0,o=Math.imul(q,th),i=i+Math.imul(C,tc)|0,n=(n=n+Math.imul(C,tf)|0)+Math.imul(U,tc)|0,o=o+Math.imul(U,tf)|0,i=i+Math.imul(T,tp)|0;var tT=(h+i|0)+((8191&(n=(n=n+Math.imul(T,tm)|0)+Math.imul(O,tp)|0))<<13)|0;h=((o=o+Math.imul(O,tm)|0)+(n>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,i=Math.imul(z,tc),n=(n=Math.imul(z,tf))+Math.imul(q,tc)|0,o=Math.imul(q,tf),i=i+Math.imul(C,tp)|0;var tO=(h+i|0)+((8191&(n=(n=n+Math.imul(C,tm)|0)+Math.imul(U,tp)|0))<<13)|0;h=((o=o+Math.imul(U,tm)|0)+(n>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,i=Math.imul(z,tp);var tL=(h+i|0)+((8191&(n=(n=Math.imul(z,tm))+Math.imul(q,tp)|0))<<13)|0;return h=((o=Math.imul(q,tm))+(n>>>13)|0)+(tL>>>26)|0,tL&=0x3ffffff,u[0]=tg,u[1]=ty,u[2]=tb,u[3]=tw,u[4]=tv,u[5]=tk,u[6]=tx,u[7]=tS,u[8]=tM,u[9]=tE,u[10]=t_,u[11]=tI,u[12]=tA,u[13]=tB,u[14]=tR,u[15]=tP,u[16]=tT,u[17]=tO,u[18]=tL,0!==h&&(u[19]=h,r.length++),r};function g(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),h=Math.max(0,o-t.length+1);h<=u;h++){var l=o-h,c=(0|t.words[l])*(0|e.words[h]),f=0x3ffffff&c;s=s+(c/0x4000000|0)|0,a=0x3ffffff&(f=f+a|0),n+=(s=s+(f>>>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 y(t,e){this.x=t,this.y=e}Math.imul||(m=p),n.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return 10===this.length&&10===t.length?r=m(this,t,e):i<63?r=p(this,t,e):r=g(this,t,e),r},y.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},y.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},y.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]]},y.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),h=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=u,f=h,d=0;d<s;d++){var p=r[l+d],m=i[l+d],g=r[l+d+s],y=i[l+d+s],b=c*g-f*y;y=c*y+f*g,g=b,r[l+d]=p+g,i[l+d]=m+y,r[l+d+s]=p-g,i[l+d+s]=m-y,d!==a&&(b=u*c-h*f,f=u*f+h*c,c=b)}},y.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},y.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}},y.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},y.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)},y.prototype.stub=function(t){for(var e=Array(t),r=0;r<t;r++)e[r]=0;return e},y.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),h=Array(i),l=Array(i),c=Array(i),f=r.words;f.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,l,c,i,n);for(var d=0;d<i;d++){var p=a[d]*l[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,f,o,i,n),this.conjugate(f,o,i),this.normalize13b(f,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),g(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 h=0;for(u=this.length-1;u>=0&&(0!==h||u>=n);u--){var l=0|this.words[u];this.words[u]=h<<26-o|l>>>o,h=l&a}return i&&0!==h&&(i.words[i.length++]=h),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 h=0;h<r.length;h++)r.words[h]=0}var l=o.clone()._ishlnsubmul(s,1,u);0===l.negative&&(o=l,r&&(r.words[u]=1));for(var c=u-1;c>=0;c--){var f=(0|o.words[s.length+c])*0x4000000+(0|o.words[s.length+c-1]);for(f=Math.min(f/a|0,0x3ffffff),o._ishlnsubmul(s,f,c);0!==o.negative;)f--,o.negative=0,o._ishlnsubmul(s,1,c),o.isZero()||(o.negative^=1);r&&(r.words[c]=f)}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),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var l=i.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;(e.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(c)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;(i.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),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(h)}},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 h=0,l=1;(i.words[0]&l)==0&&h<26;++h,l<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,f=1;(o.words[0]&f)==0&&c<26;++c,f<<=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 M(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 k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(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 E(t){M.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(k,w),i(x,w),i(S,w),S.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 k;else if("p192"===t)e=new x;else if("p25519"===t)e=new S;else throw Error("Unknown prime "+t);return b[t]=e,e},M.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},M.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")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.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)},M.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},M.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)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.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(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var c=this.pow(l,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(c,new n(1).iushln(p-g-1));f=f.redMul(y),c=y.redSqr(),d=d.redMul(c),p=g}return f},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.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 h=e.words[i],l=u-1;l>=0;l--){var c=h>>l&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===l)&&(o=this.mul(o,r[s]),a=0,s=0)}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new E(t)},i(E,M),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.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)},E.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(
2this.m):0>o.cmpn(0)&&(s=o.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,t.e)},242524,(t,e,r)=>{var i=t.r(843943),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)}},450889,(t,e,r)=>{"use strict";var i=t.r(242524).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),h=Math.log(a)/Math.log(256),l=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)*h+1>>>0,l=new Uint8Array(s);r<t.length;){var c=t.charCodeAt(r);if(c>255)return;var f=e[c];if(255===f)return;for(var d=0,p=s-1;(0!==f||d<o)&&-1!==p;p--,d++)f+=a*l[p]>>>0,l[p]=f%256>>>0,f=f/256>>>0;if(0!==f)throw Error("Non-zero carry");o=d,r++}for(var m=s-o;m!==s&&0===l[m];)m++;var g=i.allocUnsafe(n+(s-m));g.fill(0,0,n);for(var y=n;m!==s;)g[y++]=l[m++];return g}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 h=(s-o)*l+1>>>0,c=new Uint8Array(h);o!==s;){for(var f=e[o],d=0,p=h-1;(0!==f||d<n)&&-1!==p;p--,d++)f+=256*c[p]>>>0,c[p]=f%a>>>0,f=f/a>>>0;if(0!==f)throw Error("Non-zero carry");n=d,o++}for(var m=h-n;m!==h&&0===c[m];)m++;for(var g=u.repeat(r);m<h;++m)g+=t.charAt(c[m]);return g},decodeUnsafe:c,decode:function(t){var e=c(t);if(e)return e;throw Error("Non-base"+a+" character")}}}},635030,(t,e,r)=>{e.exports=t.r(450889)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},32184,(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"))}
vendor: 43,555 bytes, line 2
2t.exports=n,n.BN=n,n.wordSize=26;try{l="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 h=t.charCodeAt(u)-48;o*=n,s=h>=49?h-49+10:h>=17?h-17+10:h,r(h>=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,h=0,l=r;l<u;l+=i)h=a(t,l,l+i,e),this.imuln(n),this.words[0]+h<0x4000000?this.words[0]+=h:this._iaddn(h);if(0!==s){var c=1;for(h=a(t,l,t.length,e),l=0;l<s;l++)c*=e;this.imuln(c),this.words[0]+h<0x4000000?this.words[0]+=h:this._iaddn(h)}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")]=h}catch(t){n.prototype.inspect=h}else n.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l,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"],f=[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 h=1;h<i;h++){for(var l=u>>>26,c=0x3ffffff&u,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[d])+c)/0x4000000|0,c=0x3ffffff&s}r.words[h]=0|c,u=0|l}return 0!==u?r.words[h]=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 h=f[t],l=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(t);i=(p=p.idivn(l)).isZero()?m+i:c[h-m.length]+m+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)},l&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(l,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];return i>0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),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 m=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,h=0,l=0|s[0],c=8191&l,f=l>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,w=0|s[3],v=8191&w,k=w>>>13,x=0|s[4],S=8191&x,M=x>>>13,E=0|s[5],_=8191&E,I=E>>>13,A=0|s[6],B=8191&A,R=A>>>13,P=0|s[7],T=8191&P,O=P>>>13,L=0|s[8],C=8191&L,U=L>>>13,N=0|s[9],z=8191&N,q=N>>>13,K=0|a[0],W=8191&K,F=K>>>13,D=0|a[1],V=8191&D,j=D>>>13,$=0|a[2],H=8191&$,Z=$>>>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,th=ta>>>13,tl=0|a[8],tc=8191&tl,tf=tl>>>13,td=0|a[9],tp=8191&td,tm=td>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(c,W);var tg=(h+i|0)+((8191&(n=(n=Math.imul(c,F))+Math.imul(f,W)|0))<<13)|0;h=((o=Math.imul(f,F))+(n>>>13)|0)+(tg>>>26)|0,tg&=0x3ffffff,i=Math.imul(p,W),n=(n=Math.imul(p,F))+Math.imul(m,W)|0,o=Math.imul(m,F),i=i+Math.imul(c,V)|0;var ty=(h+i|0)+((8191&(n=(n=n+Math.imul(c,j)|0)+Math.imul(f,V)|0))<<13)|0;h=((o=o+Math.imul(f,j)|0)+(n>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,i=Math.imul(y,W),n=(n=Math.imul(y,F))+Math.imul(b,W)|0,o=Math.imul(b,F),i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,j)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,j)|0,i=i+Math.imul(c,H)|0;var tb=(h+i|0)+((8191&(n=(n=n+Math.imul(c,Z)|0)+Math.imul(f,H)|0))<<13)|0;h=((o=o+Math.imul(f,Z)|0)+(n>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,i=Math.imul(v,W),n=(n=Math.imul(v,F))+Math.imul(k,W)|0,o=Math.imul(k,F),i=i+Math.imul(y,V)|0,n=(n=n+Math.imul(y,j)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,j)|0,i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,Z)|0,i=i+Math.imul(c,Y)|0;var tw=(h+i|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(f,Y)|0))<<13)|0;h=((o=o+Math.imul(f,J)|0)+(n>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,i=Math.imul(S,W),n=(n=Math.imul(S,F))+Math.imul(M,W)|0,o=Math.imul(M,F),i=i+Math.imul(v,V)|0,n=(n=n+Math.imul(v,j)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,j)|0,i=i+Math.imul(y,H)|0,n=(n=n+Math.imul(y,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(m,Y)|0,o=o+Math.imul(m,J)|0,i=i+Math.imul(c,Q)|0;var tv=(h+i|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,i=Math.imul(_,W),n=(n=Math.imul(_,F))+Math.imul(I,W)|0,o=Math.imul(I,F),i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,j)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,j)|0,i=i+Math.imul(v,H)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,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(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(c,tr)|0;var tk=(h+i|0)+((8191&(n=(n=n+Math.imul(c,ti)|0)+Math.imul(f,tr)|0))<<13)|0;h=((o=o+Math.imul(f,ti)|0)+(n>>>13)|0)+(tk>>>26)|0,tk&=0x3ffffff,i=Math.imul(B,W),n=(n=Math.imul(B,F))+Math.imul(R,W)|0,o=Math.imul(R,F),i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,j)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,j)|0,i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,Z)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,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(m,tr)|0,o=o+Math.imul(m,ti)|0,i=i+Math.imul(c,to)|0;var tx=(h+i|0)+((8191&(n=(n=n+Math.imul(c,ts)|0)+Math.imul(f,to)|0))<<13)|0;h=((o=o+Math.imul(f,ts)|0)+(n>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,i=Math.imul(T,W),n=(n=Math.imul(T,F))+Math.imul(O,W)|0,o=Math.imul(O,F),i=i+Math.imul(B,V)|0,n=(n=n+Math.imul(B,j)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,j)|0,i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,Z)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(y,tr)|0,n=(n=n+Math.imul(y,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(m,to)|0,o=o+Math.imul(m,ts)|0,i=i+Math.imul(c,tu)|0;var tS=(h+i|0)+((8191&(n=(n=n+Math.imul(c,th)|0)+Math.imul(f,tu)|0))<<13)|0;h=((o=o+Math.imul(f,th)|0)+(n>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,i=Math.imul(C,W),n=(n=Math.imul(C,F))+Math.imul(U,W)|0,o=Math.imul(U,F),i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,j)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,j)|0,i=i+Math.imul(B,H)|0,n=(n=n+Math.imul(B,Z)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(v,tr)|0,n=(n=n+Math.imul(v,ti)|0)+Math.imul(k,tr)|0,o=o+Math.imul(k,ti)|0,i=i+Math.imul(y,to)|0,n=(n=n+Math.imul(y,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,th)|0)+Math.imul(m,tu)|0,o=o+Math.imul(m,th)|0,i=i+Math.imul(c,tc)|0;var tM=(h+i|0)+((8191&(n=(n=n+Math.imul(c,tf)|0)+Math.imul(f,tc)|0))<<13)|0;h=((o=o+Math.imul(f,tf)|0)+(n>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,i=Math.imul(z,W),n=(n=Math.imul(z,F))+Math.imul(q,W)|0,o=Math.imul(q,F),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,j)|0)+Math.imul(U,V)|0,o=o+Math.imul(U,j)|0,i=i+Math.imul(T,H)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,Z)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,J)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(S,tr)|0,n=(n=n+Math.imul(S,ti)|0)+Math.imul(M,tr)|0,o=o+Math.imul(M,ti)|0,i=i+Math.imul(v,to)|0,n=(n=n+Math.imul(v,ts)|0)+Math.imul(k,to)|0,o=o+Math.imul(k,ts)|0,i=i+Math.imul(y,tu)|0,n=(n=n+Math.imul(y,th)|0)+Math.imul(b,tu)|0,o=o+Math.imul(b,th)|0,i=i+Math.imul(p,tc)|0,n=(n=n+Math.imul(p,tf)|0)+Math.imul(m,tc)|0,o=o+Math.imul(m,tf)|0,i=i+Math.imul(c,tp)|0;var tE=(h+i|0)+((8191&(n=(n=n+Math.imul(c,tm)|0)+Math.imul(f,tp)|0))<<13)|0;h=((o=o+Math.imul(f,tm)|0)+(n>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,i=Math.imul(z,V),n=(n=Math.imul(z,j))+Math.imul(q,V)|0,o=Math.imul(q,j),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(U,H)|0,o=o+Math.imul(U,Z)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,J)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(_,tr)|0,n=(n=n+Math.imul(_,ti)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,ti)|0,i=i+Math.imul(S,to)|0,n=(n=n+Math.imul(S,ts)|0)+Math.imul(M,to)|0,o=o+Math.imul(M,ts)|0,i=i+Math.imul(v,tu)|0,n=(n=n+Math.imul(v,th)|0)+Math.imul(k,tu)|0,o=o+Math.imul(k,th)|0,i=i+Math.imul(y,tc)|0,n=(n=n+Math.imul(y,tf)|0)+Math.imul(b,tc)|0,o=o+Math.imul(b,tf)|0,i=i+Math.imul(p,tp)|0;var t_=(h+i|0)+((8191&(n=(n=n+Math.imul(p,tm)|0)+Math.imul(m,tp)|0))<<13)|0;h=((o=o+Math.imul(m,tm)|0)+(n>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,i=Math.imul(z,H),n=(n=Math.imul(z,Z))+Math.imul(q,H)|0,o=Math.imul(q,Z),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(U,Y)|0,o=o+Math.imul(U,J)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(B,tr)|0,n=(n=n+Math.imul(B,ti)|0)+Math.imul(R,tr)|0,o=o+Math.imul(R,ti)|0,i=i+Math.imul(_,to)|0,n=(n=n+Math.imul(_,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,i=i+Math.imul(S,tu)|0,n=(n=n+Math.imul(S,th)|0)+Math.imul(M,tu)|0,o=o+Math.imul(M,th)|0,i=i+Math.imul(v,tc)|0,n=(n=n+Math.imul(v,tf)|0)+Math.imul(k,tc)|0,o=o+Math.imul(k,tf)|0,i=i+Math.imul(y,tp)|0;var tI=(h+i|0)+((8191&(n=(n=n+Math.imul(y,tm)|0)+Math.imul(b,tp)|0))<<13)|0;h=((o=o+Math.imul(b,tm)|0)+(n>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,i=Math.imul(z,Y),n=(n=Math.imul(z,J))+Math.imul(q,Y)|0,o=Math.imul(q,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(T,tr)|0,n=(n=n+Math.imul(T,ti)|0)+Math.imul(O,tr)|0,o=o+Math.imul(O,ti)|0,i=i+Math.imul(B,to)|0,n=(n=n+Math.imul(B,ts)|0)+Math.imul(R,to)|0,o=o+Math.imul(R,ts)|0,i=i+Math.imul(_,tu)|0,n=(n=n+Math.imul(_,th)|0)+Math.imul(I,tu)|0,o=o+Math.imul(I,th)|0,i=i+Math.imul(S,tc)|0,n=(n=n+Math.imul(S,tf)|0)+Math.imul(M,tc)|0,o=o+Math.imul(M,tf)|0,i=i+Math.imul(v,tp)|0;var tA=(h+i|0)+((8191&(n=(n=n+Math.imul(v,tm)|0)+Math.imul(k,tp)|0))<<13)|0;h=((o=o+Math.imul(k,tm)|0)+(n>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,i=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(q,Q)|0,o=Math.imul(q,tt),i=i+Math.imul(C,tr)|0,n=(n=n+Math.imul(C,ti)|0)+Math.imul(U,tr)|0,o=o+Math.imul(U,ti)|0,i=i+Math.imul(T,to)|0,n=(n=n+Math.imul(T,ts)|0)+Math.imul(O,to)|0,o=o+Math.imul(O,ts)|0,i=i+Math.imul(B,tu)|0,n=(n=n+Math.imul(B,th)|0)+Math.imul(R,tu)|0,o=o+Math.imul(R,th)|0,i=i+Math.imul(_,tc)|0,n=(n=n+Math.imul(_,tf)|0)+Math.imul(I,tc)|0,o=o+Math.imul(I,tf)|0,i=i+Math.imul(S,tp)|0;var tB=(h+i|0)+((8191&(n=(n=n+Math.imul(S,tm)|0)+Math.imul(M,tp)|0))<<13)|0;h=((o=o+Math.imul(M,tm)|0)+(n>>>13)|0)+(tB>>>26)|0,tB&=0x3ffffff,i=Math.imul(z,tr),n=(n=Math.imul(z,ti))+Math.imul(q,tr)|0,o=Math.imul(q,ti),i=i+Math.imul(C,to)|0,n=(n=n+Math.imul(C,ts)|0)+Math.imul(U,to)|0,o=o+Math.imul(U,ts)|0,i=i+Math.imul(T,tu)|0,n=(n=n+Math.imul(T,th)|0)+Math.imul(O,tu)|0,o=o+Math.imul(O,th)|0,i=i+Math.imul(B,tc)|0,n=(n=n+Math.imul(B,tf)|0)+Math.imul(R,tc)|0,o=o+Math.imul(R,tf)|0,i=i+Math.imul(_,tp)|0;var tR=(h+i|0)+((8191&(n=(n=n+Math.imul(_,tm)|0)+Math.imul(I,tp)|0))<<13)|0;h=((o=o+Math.imul(I,tm)|0)+(n>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,i=Math.imul(z,to),n=(n=Math.imul(z,ts))+Math.imul(q,to)|0,o=Math.imul(q,ts),i=i+Math.imul(C,tu)|0,n=(n=n+Math.imul(C,th)|0)+Math.imul(U,tu)|0,o=o+Math.imul(U,th)|0,i=i+Math.imul(T,tc)|0,n=(n=n+Math.imul(T,tf)|0)+Math.imul(O,tc)|0,o=o+Math.imul(O,tf)|0,i=i+Math.imul(B,tp)|0;var tP=(h+i|0)+((8191&(n=(n=n+Math.imul(B,tm)|0)+Math.imul(R,tp)|0))<<13)|0;h=((o=o+Math.imul(R,tm)|0)+(n>>>13)|0)+(tP>>>26)|0,tP&=0x3ffffff,i=Math.imul(z,tu),n=(n=Math.imul(z,th))+Math.imul(q,tu)|0,o=Math.imul(q,th),i=i+Math.imul(C,tc)|0,n=(n=n+Math.imul(C,tf)|0)+Math.imul(U,tc)|0,o=o+Math.imul(U,tf)|0,i=i+Math.imul(T,tp)|0;var tT=(h+i|0)+((8191&(n=(n=n+Math.imul(T,tm)|0)+Math.imul(O,tp)|0))<<13)|0;h=((o=o+Math.imul(O,tm)|0)+(n>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,i=Math.imul(z,tc),n=(n=Math.imul(z,tf))+Math.imul(q,tc)|0,o=Math.imul(q,tf),i=i+Math.imul(C,tp)|0;var tO=(h+i|0)+((8191&(n=(n=n+Math.imul(C,tm)|0)+Math.imul(U,tp)|0))<<13)|0;h=((o=o+Math.imul(U,tm)|0)+(n>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,i=Math.imul(z,tp);var tL=(h+i|0)+((8191&(n=(n=Math.imul(z,tm))+Math.imul(q,tp)|0))<<13)|0;return h=((o=Math.imul(q,tm))+(n>>>13)|0)+(tL>>>26)|0,tL&=0x3ffffff,u[0]=tg,u[1]=ty,u[2]=tb,u[3]=tw,u[4]=tv,u[5]=tk,u[6]=tx,u[7]=tS,u[8]=tM,u[9]=tE,u[10]=t_,u[11]=tI,u[12]=tA,u[13]=tB,u[14]=tR,u[15]=tP,u[16]=tT,u[17]=tO,u[18]=tL,0!==h&&(u[19]=h,r.length++),r};function g(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),h=Math.max(0,o-t.length+1);h<=u;h++){var l=o-h,c=(0|t.words[l])*(0|e.words[h]),f=0x3ffffff&c;s=s+(c/0x4000000|0)|0,a=0x3ffffff&(f=f+a|0),n+=(s=s+(f>>>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 y(t,e){this.x=t,this.y=e}Math.imul||(m=p),n.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return 10===this.length&&10===t.length?r=m(this,t,e):i<63?r=p(this,t,e):r=g(this,t,e),r},y.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},y.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},y.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]]},y.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),h=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=u,f=h,d=0;d<s;d++){var p=r[l+d],m=i[l+d],g=r[l+d+s],y=i[l+d+s],b=c*g-f*y;y=c*y+f*g,g=b,r[l+d]=p+g,i[l+d]=m+y,r[l+d+s]=p-g,i[l+d+s]=m-y,d!==a&&(b=u*c-h*f,f=u*f+h*c,c=b)}},y.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},y.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}},y.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},y.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)},y.prototype.stub=function(t){for(var e=Array(t),r=0;r<t;r++)e[r]=0;return e},y.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),h=Array(i),l=Array(i),c=Array(i),f=r.words;f.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,l,c,i,n);for(var d=0;d<i;d++){var p=a[d]*l[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,f,o,i,n),this.conjugate(f,o,i),this.normalize13b(f,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),g(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 h=0;for(u=this.length-1;u>=0&&(0!==h||u>=n);u--){var l=0|this.words[u];this.words[u]=h<<26-o|l>>>o,h=l&a}return i&&0!==h&&(i.words[i.length++]=h),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 h=0;h<r.length;h++)r.words[h]=0}var l=o.clone()._ishlnsubmul(s,1,u);0===l.negative&&(o=l,r&&(r.words[u]=1));for(var c=u-1;c>=0;c--){var f=(0|o.words[s.length+c])*0x4000000+(0|o.words[s.length+c-1]);for(f=Math.min(f/a|0,0x3ffffff),o._ishlnsubmul(s,f,c);0!==o.negative;)f--,o.negative=0,o._ishlnsubmul(s,1,c),o.isZero()||(o.negative^=1);r&&(r.words[c]=f)}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),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var l=i.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;(e.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(c)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;(i.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),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(h)}},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 h=0,l=1;(i.words[0]&l)==0&&h<26;++h,l<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,f=1;(o.words[0]&f)==0&&c<26;++c,f<<=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 M(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 k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(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 E(t){M.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(k,w),i(x,w),i(S,w),S.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 k;else if("p192"===t)e=new x;else if("p25519"===t)e=new S;else throw Error("Unknown prime "+t);return b[t]=e,e},M.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},M.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")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.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)},M.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},M.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)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.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(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var c=this.pow(l,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(c,new n(1).iushln(p-g-1));f=f.redMul(y),c=y.redSqr(),d=d.redMul(c),p=g}return f},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.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 h=e.words[i],l=u-1;l>=0;l--){var c=h>>l&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===l)&&(o=this.mul(o,r[s]),a=0,s=0)}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new E(t)},i(E,M),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.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)},E.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(
2this.m):0>o.cmpn(0)&&(s=o.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,t.e)},701262,(t,e,r)=>{e.exports=t.r(450889)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},572766,(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}o.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 h(t,e){if(!(this instanceof h))return new h(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 l(t){var e=t.fatal,r=0,n=0,o=0,a=128,u=191;this.handler=function(t,h){if(-1===h&&0!==o)return o=0,s(e);if(-1===h)return -1;if(0===o){if(i(h,0,127))return h;if(i(h,194,223))o=1,r=h-192;else if(i(h,224,239))224===h&&(a=160),237===h&&(u=159),o=2,r=h-224;else{if(!i(h,240,244))return s(e);240===h&&(a=144),244===h&&(u=143),o=3,r=h-240}return r<<=6*o,null}if(!i(h,a,u))return r=o=n=0,a=128,u=191,t.prepend(h),s(e);if(a=128,u=191,n+=1,r+=h-128<<6*(o-n),n!==o)return null;var l=r;return r=o=n=0,l}}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 l({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="",h=0;h<a.length;++h){var c=a[h];c<=65535?u+=String.fromCharCode(c):(c-=65536,u+=String.fromCharCode((c>>10)+55296,(1023&c)+56320))}return u}},h.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=h,r.TextDecoder=u},154119,(t,e,r)=>{"use strict";var i=t.i(467034),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;
2a--)(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 h=u(t.r(32184)),l=u(t.r(701262)),c=a(t.r(572766)),f=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")),l.default.encode(i.Buffer.from(t))},r.baseDecode=function(t){return i.Buffer.from(l.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 h.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new h.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new h.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new h.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 m(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 g{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 h.default(t,"le")}readU128(){let t=this.readBuffer(16);return new h.default(t,"le")}readU256(){let t=this.readBuffer(32);return new h.default(t,"le")}readU512(){let t=this.readBuffer(64);return new h.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 f.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 y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e,r,i,n){try{if("string"==typeof i)n[`write${y(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${y(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 k(t,r,i)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function k(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>
2=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([m],g.prototype,"readU8",null),s([m],g.prototype,"readU16",null),s([m],g.prototype,"readU32",null),s([m],g.prototype,"readU64",null),s([m],g.prototype,"readU128",null),s([m],g.prototype,"readU256",null),s([m],g.prototype,"readU512",null),s([m],g.prototype,"readString",null),s([m],g.prototype,"readFixedArray",null),s([m],g.prototype,"readArray",null),r.BinaryReader=g,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=g){let n=new i(r),o=k(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=g){return k(t,e,new i(r))}},444610,(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(843943);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 h 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=h;class l 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 f}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=l;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 f 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=f;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 m(t){let e=Math.floor(t/0x100000000);return{hi32:e,lo32:t-0x100000000*e}}function g(t,e){return 0x100000000*t+e}r.IntBE=p;class y extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),i=r.readUInt32LE(e);return g(r.readUInt32LE(e+4),i)}encode(t,e,r=0){let i=m(t),n=o(e);return n.writeUInt32LE(i.lo32,r),n.writeUInt32LE(i.hi32,r+4),8}}r.NearUInt64=y;class b extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t);return g(r.readUInt32BE(e),r.readUInt32BE(e+4))}encode(t,e,r=0){let i=m(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 g(r.readInt32LE(e+4),i)}encode(t,e,r=0){let i=m(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 g(r.readInt32BE(e),r.readUInt32BE(e+4))}encode(t,e,r=0){let i=m(t),n=o(e);return n.writeInt32BE(i.hi32,r),n.writeUInt32BE(i.lo32,r+4),8}}r.NearInt64BE=v;class k 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=k;class x 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=x;class S 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=S;class M 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=M;class E 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=E;class _ 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>
2i.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=_;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 A 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=A;class B extends s{constructor(t,e,r){let i;if(t instanceof c||t instanceof f)i=new A(new l(t));else if(t instanceof u&&t.isCount())i=new A(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 f)&&(n+=i.layout.span),super(n,r),this.discriminator=i,this.usesPrefixDiscriminator=t instanceof c||t instanceof f,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 R(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=B;class R extends s{constructor(t,e,r,i){if(!(t instanceof B))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");
2if(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 P(t){return 0>t&&(t+=0x100000000),t}r.VariantLayout=R;class T extends s{constructor(t,e,r){if(!(t instanceof c||t instanceof f))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=P(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 O(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 O{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=P(this.valueMask<<this.start),this.property=r}decode(t,e){return P(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(t){if("number"!=typeof t||!Number.isInteger(t)||t!==P(t&this.valueMask))throw TypeError(a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),r=P(t<<this.start);this.container._packedSetValue(P(e&~this.wordMask)|r)}}r.BitField=O;class L extends O{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 C 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=C;class U 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=U;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 z 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=z,r.greedy=(t,e)=>new h(t,e),r.offset=(t,e,r)=>new l(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 y(t),r.u16be=t=>new f(2,t),r.u24be=t=>new f(3,t),r.u32be=t=>new f(4,t),r.u40be=t=>new f(5,t),r.u48be=t=>new f(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 k(t),r.f32be=t=>new x(t),r.f64=t=>new S(t),r.f64be=t=>new M(t),r.struct=(t,e,r)=>new _(t,e,r),r.bits=(t,e,r)=>new T(t,e,r),r.seq=(t,e,r)=>new E(t,e,r),r.union=(t,e,r)=>new B(t,e,r),r.unionLayoutDiscriminator=(t,e)=>new A(t,e),r.blob=(t,e)=>new C(t,e),r.cstr=t=>new U(t),r.utf8=(t,e)=>new N(t,e),r.constant=(t,e)=>new z(t,e)},719679,t=>{"use strict";t.s([],448675),t.i(448675);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=[],h=0;h<256;
2++h)u.push((h+256).toString(16).substr(1));let l=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();if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var c=0,f=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 l(s)}try{i.name=t}catch(t){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function m(t){return(t+64>>>9<<4)+14+1}function g(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function y(t,e,r,i,n,o){var s;return g((s=g(g(e,t),g(i,o)))<<n|s>>>32-n,r)}function b(t,e,r,i,n,o,s){return y(e&r|~e&i,t,e,n,o,s)}function w(t,e,r,i,n,o,s){return y(e&i|r&~i,t,e,n,o,s)}function v(t,e,r,i,n,o,s){return y(e^r^i,t,e,n,o,s)}function k(t,e,r,i,n,o,s){return y(r^(e|~i),t,e,n,o,s)}var x=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[m(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,h=n,l=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[
2s+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=k(r,i,n,o,t[s],6,-0xbd6ddbc),o=k(o,r,i,n,t[
2s+7],10,0x432aff97),n=k(n,o,r,i,t[s+14],15,-0x546bdc59),i=k(i,n,o,r,t[s+5],21,-0x36c5fc7),r=k(r,i,n,o,t[s+12],6,0x655b59c3),o=k(o,r,i,n,t[s+3],10,-0x70f3336e),n=k(n,o,r,i,t[s+10],15,-1051523),i=k(i,n,o,r,t[s+1],21,-0x7a7ba22f),r=k(r,i,n,o,t[s+8],6,0x6fa87e4f),o=k(o,r,i,n,t[s+15],10,-0x1d31920),n=k(n,o,r,i,t[s+6],15,-0x5cfebcec),i=k(i,n,o,r,t[s+13],21,0x4e0811a1),r=k(r,i,n,o,t[s+4],6,-0x8ac817e),o=k(o,r,i,n,t[s+11],10,-0x42c50dcb),n=k(n,o,r,i,t[s+2],15,0x2ad7d2bb),i=k(i,n,o,r,t[s+9],21,-0x14792c6f),r=g(r,a),i=g(i,u),n=g(n,h),o=g(o,l)}return[r,i,n,o]}(function(t){if(0===t.length)return[];for(var e=8*t.length,r=new Uint32Array(m(e)),i=0;i<e;i+=8)r[i>>5]|=(255&t[i/8])<<i%32;return r}(t),8*t.length))});function S(t,e){return t<<e|t>>>32-e}var M=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),h=0;h<16;++h)u[h]=t[64*a+4*h]<<24|t[64*a+4*h+1]<<16|t[64*a+4*h+2]<<8|t[64*a+4*h+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 l=0;l<o;++l){for(var c=new Uint32Array(80),f=0;f<16;++f)c[f]=s[l][f];for(var d=16;d<80;++d)c[d]=S(c[d-3]^c[d-8]^c[d-14]^c[d-16],1);for(var p=r[0],m=r[1],g=r[2],y=r[3],b=r[4],w=0;w<80;++w){var v=Math.floor(w/20),k=S(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,m,g,y)+b+e[v]+c[w]>>>0;b=y,y=g,g=S(m,30)>>>0,m=p,p=k}r[0]=r[0]+p>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+y>>>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,l,"v1",0,function(t,e,n){var s=e&&n||0,a=e||Array(16),u=(t=t||{}).node||r,h=void 0!==t.clockseq?t.clockseq:i;if(null==u||null==h){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==h&&(h=i=(d[6]<<8|d[7])&16383)}var p=void 0!==t.msecs?t.msecs:Date.now(),m=void 0!==t.nsecs?t.nsecs:f+1,g=p-c+(m-f)/1e4;if(g<0&&void 0===t.clockseq&&(h=h+1&16383),(g<0||p>c)&&void 0===t.nsecs&&(m=0),m>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");c=p,f=m,i=h;var y=((0xfffffff&(p+=122192928e5))*1e4+m)%0x100000000;a[s++]=y>>>24&255,a[s++]=y>>>16&255,a[s++]=y>>>8&255,a[s++]=255&y;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++]=h>>>8|128,a[s++]=255&h;for(var w=0;w<6;++w)a[s+w]=u[w];return e||l(a)},"v3",0,x,"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 l(i)},"v5",0,M,"validate",0,a,"version",0,function(t){if(!a(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}],719679)},943173,(t,e,r)=>{"use strict";let i=t.r(719679).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}},578217,(t,e,r)=>{"use strict";let i=t.r(719679).v4,n=t.r(943173),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 h=!u&&t&&"object"==typeof t&&"function"==typeof e;if(u||h)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,
2i.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)}},127261,t=>{"use strict";let e,r;var i,n,o,s,a,u,h=t.i(843943);let l="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 f(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");f(t.outputLen),f(t.blockLen)}function m(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 g(t,e){d(t);let r=e.outputLen;if(t.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function y(...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},k="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,x=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function S(t){if(d(t),k)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=x[t[r]];return e}function M(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function E(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);if(k)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=M(t.charCodeAt(n)),o=M(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 _(t){if("string"!=typeof t)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function I(t){return"string"==typeof t&&(t=_(t)),d(t),t}function A(...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 B{}function R(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 P(t=32){if(l&&"function"==typeof l.getRandomValues)return l.getRandomValues(new Uint8Array(t));if(l&&"function"==typeof l.randomBytes)return Uint8Array.from(l.randomBytes(t));throw Error("crypto.getRandomValues must be defined")}class T extends B{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){m(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){m(this),g(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:i,isLE:n}=this,{pos:o}=this;e[o++]=128,y(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,h=4*!i;t.setUint32(e+u,s,i),t.setUint32(e+h,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,h=this.get();if(u>h.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<u;t++)s.setUint32(4*t,h[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()}}
2let O=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),L=Uint32Array.from([0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]),C=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),U=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),N=BigInt(0x100000000-1),z=BigInt(32);function q(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>>z&N)}:{h:0|Number(t>>z&N),l:0|Number(t&N)}}(t[o],e);[i[o],n[o]]=[r,s]}return[i,n]}let K=(t,e,r)=>t>>>r,W=(t,e,r)=>t<<32-r|e>>>r,F=(t,e,r)=>t>>>r|e<<32-r,D=(t,e,r)=>t<<32-r|e>>>r,V=(t,e,r)=>t<<64-r|e>>>r-32,j=(t,e,r)=>t>>>r-32|e<<64-r;function $(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,0xc76c51a3,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|O[0],this.B=0|O[1],this.C=0|O[2],this.D=0|O[3],this.E=0|O[4],this.F=0|O[5],this.G=0|O[6],this.H=0|O[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:h}=this;for(let t=0;t<64;t++){var l,c,f,d;let e=h+(w(s,6)^w(s,11)^w(s,25))+((l=s)&a^~l&u)+Q[t]+tt[t]|0,p=(w(r,2)^w(r,13)^w(r,22))+((c=r)&(f=i)^c&(d=n)^f&d)|0;h=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,h=h+this.H|0,this.set(r,i,n,o,s,a,u,h)}roundClean(){y(tt)}destroy(){this.set(0,0,0,0,0,0,0,0),y(this.buffer)}}let tr=q(["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
25771202a","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|U[0],this.Al=0|U[1],this.Bh=0|U[2],this.Bl=0|U[3],this.Ch=0|U[4],this.Cl=0|U[5],this.Dh=0|U[6],this.Dl=0|U[7],this.Eh=0|U[8],this.El=0|U[9],this.Fh=0|U[10],this.Fl=0|U[11],this.Gh=0|U[12],this.Gl=0|U[13],this.Hh=0|U[14],this.Hl=0|U[15]}get(){let{Ah:t,Al:e,Bh:r,Bl:i,Ch:n,Cl:o,Dh:s,Dl:a,Eh:u,El:h,Fh:l,Fl:c,Gh:f,Gl:d,Hh:p,Hl:m}=this;return[t,e,r,i,n,o,s,a,u,h,l,c,f,d,p,m]}set(t,e,r,i,n,o,s,a,u,h,l,c,f,d,p,m){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|h,this.Fh=0|l,this.Fl=0|c,this.Gh=0|f,this.Gl=0|d,this.Hh=0|p,this.Hl=0|m}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=F(e,r,1)^F(e,r,8)^K(e,r,7),n=D(e,r,1)^D(e,r,8)^W(e,r,7),o=0|to[t-2],s=0|ts[t-2],a=F(o,s,19)^V(o,s,61)^K(o,s,6),u=G(n,D(o,s,19)^j(o,s,61)^W(o,s,6),ts[t-7],ts[t-16]),h=Y(u,i,a,to[t-7],to[t-16]);to[t]=0|h,ts[t]=0|u}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:s,Cl:a,Dh:u,Dl:h,Eh:l,El:c,Fh:f,Fl:d,Gh:p,Gl:m,Hh:g,Hl:y}=this;for(let t=0;t<80;t++){let e=F(l,c,14)^F(l,c,18)^V(l,c,41),b=D(l,c,14)^D(l,c,18)^j(l,c,41),w=l&f^~l&p,v=J(y,b,c&d^~c&m,tn[t],ts[t]),k=X(v,g,e,w,ti[t],to[t]),x=0|v,S=F(r,i,28)^V(r,i,34)^V(r,i,39),M=D(r,i,28)^j(r,i,34)^j(r,i,39),E=r&n^r&s^n&s,_=i&o^i&a^o&a;g=0|p,y=0|m,p=0|f,m=0|d,f=0|l,d=0|c,({h:l,l:c}=$(0|u,0|h,0|k,0|x)),u=0|s,h=0|a,s=0|n,a=0|o,n=0|r,o=0|i;let I=H(x,M,_);r=Z(I,k,S,E),i=0|I}({h:r,l:i}=$(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=$(0|this.Bh,0|this.Bl,0|n,0|o)),({h:s,l:a}=$(0|this.Ch,0|this.Cl,0|s,0|a)),({h:u,l:h}=$(0|this.Dh,0|this.Dl,0|u,0|h)),({h:l,l:c}=$(0|this.Eh,0|this.El,0|l,0|c)),({h:f,l:d}=$(0|this.Fh,0|this.Fl,0|f,0|d)),({h:p,l:m}=$(0|this.Gh,0|this.Gl,0|p,0|m)),({h:g,l:y}=$(0|this.Hh,0|this.Hl,0|g,0|y)),this.set(r,i,n,o,s,a,u,h,l,c,f,d,p,m,g,y)}roundClean(){y(to,ts)}destroy(){y(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let tu=R(()=>new te),th=R(()=>new ta),tl=BigInt(0),tc=BigInt(1);function tf(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 tm(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return""===t?tl:BigInt("0x"+t)}function tg(t){return tm(S(t))}function ty(t){return d(t),tm(S(Uint8Array.from(t).reverse()))}function tb(t,e){return E(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=E(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 tk(t){return Uint8Array.from(t)}let tx=t=>"bigint"==typeof t&&tl<=t;function tS(t,e,r,i){var n,o,s;if(n=e,o=r,s=i,!(tx(n)&&tx(o)&&tx(s))||!(o<=n)||!(n<s))throw Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}function tM(t){let e;for(e=0;t>tl;t>>=tc,e+=1);return e}let tE=t=>(tc<<BigInt(t))-tc;function t_(t,e,r={}){if(!t||"object"!=typeof t)throw Error("expected valid options object");
vendor: 1,921 bytes, line 2
2function 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 tA(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 tB=BigInt(0),tR=BigInt(1),tP=BigInt(2),tT=BigInt(3),tO=BigInt(4),tL=BigInt(5),tC=BigInt(7),tU=BigInt(8),tN=BigInt(9),tz=BigInt(16);function tq(t,e){let r=t%e;return r>=tB?r:e+r}function tK(t,e,r){let i=t;for(;e-- >tB;)i*=i,i%=r;return i}function tW(t,e){if(t===tB)throw Error("invert: expected non-zero number");if(e<=tB)throw Error("invert: expected positive modulus, got "+e);let r=tq(t,e),i=e,n=tB,o=tR,s=tR,a=tB;for(;r!==tB;){let t=i/r,e=i%r,u=n-s*t,h=o-a*t;i=r,r=e,n=s,o=a,s=u,a=h}if(i!==tR)throw Error("invert: does not exist");return tq(n,e)}function tF(t,e,r){if(!t.eql(t.sqr(e),r))throw Error("Cannot find square root")}function tD(t,e){let r=(t.ORDER+tR)/tO,i=t.pow(e,r);return tF(t,i,e),i}function tV(t,e){let r=(t.ORDER-tL)/tU,i=t.mul(e,tP),n=t.pow(i,r),o=t.mul(e,n),s=t.mul(t.mul(o,tP),n),a=t.mul(o,t.sub(s,t.ONE));return tF(t,a,e),a}function tj(t){if(t<tT)throw Error("sqrt is not defined for small field");let e=t-tR,r=0;for(;e%tP===tB;)e/=tP,r++;let i=tP,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 tD;let o=n.pow(i,e),s=(e+tR)/tP;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),h=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=tR<<BigInt(n-e-1),o=t.pow(a,i);n=e,a=t.sqr(o),u=t.mul(u,a),h=t.mul(h,o)}return h}}
vendor: 4,793 bytes, line 2
2let t$=(t,e)=>(tq(t,e)&tR)===tR,tH=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tZ(t){return t_(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-tR)/tP,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&&f(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<=tB)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:h,nByteLength:l}=tJ(t,o);if(l>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let c=Object.freeze({ORDER:t,isLE:r,BITS:h,BYTES:l,MASK:tE(h),ZERO:tB,ONE:tR,allowedLengths:a,create:e=>tq(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return tB<=e&&e<t},is0:t=>t===tB,isValidNot0:t=>!c.is0(t)&&c.isValid(t),isOdd:t=>(t&tR)===tR,neg:e=>tq(-e,t),eql:(t,e)=>t===e,sqr:e=>tq(e*e,t),add:(e,r)=>tq(e+r,t),sub:(e,r)=>tq(e-r,t),mul:(e,r)=>tq(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<tB)throw Error("invalid exponent, negatives unsupported");if(r===tB)return t.ONE;if(r===tR)return e;let i=t.ONE,n=e;for(;r>tB;)r&tR&&(i=t.mul(i,n)),n=t.sqr(n),r>>=tR;return i})(c,t,e),div:(e,r)=>tq(e*tW(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>tW(e,t),sqrt:s||(e=>(n||(n=function(t){if(t%tO===tT)return tD;if(t%tU===tL)return tV;if(t%tz===tN){let e,r,i,n,o,s;return e=tX(t),i=(r=tj(t))(e,e.neg(e.ONE)),n=r(e,i),o=r(e,e.neg(i)),s=(t+tC)/tz,(t,e)=>{let r=t.pow(e,s),a=t.mul(r,i),u=t.mul(r,n),h=t.mul(r,o),l=t.eql(t.sqr(a),e),c=t.eql(t.sqr(u),e);r=t.cmov(r,a,l),a=t.cmov(h,u,c);let f=t.eql(t.sqr(a),e),d=t.cmov(r,a,f);return tF(t,d,e),d}}return tj(t)}(t)),n(c,e))),toBytes:t=>r?tw(t,l):tb(t,l),fromBytes:(e,i=!0)=>{if(a){if(!a.includes(e.length)||e.length>l)throw Error("Field.fromBytes: expected "+a+" bytes, got "+e.length);let t=new Uint8Array(l);t.set(e,r?0:t.length-e.length),e=t}if(e.length!==l)throw Error("Field.fromBytes: expected "+l+" bytes, got "+e.length);let n=r?ty(e):tg(e);if(u&&(n=tq(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 t3(t,e){let r=e.negate();return t?r:e}function t6(t,e){let r=tG(t.Fp,e.map(t=>t.Z));return e.map((e,i)=>t.fromAffine(e.toAffine(r[i])))}function t8(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){t8(t,e);let r=Math.ceil(e/t)+1,i=2**(t-1),n=2**t;return{windows:r,windowSize:i,mask:tE(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 h=e*i,l=h+Math.abs(a)-1,c=0===a;return{nextN:u,offset:l,isZero:c,isNeg:a<0,isNegF:e%2!=0,offsetF:h}}let t9=new WeakMap,t7=new WeakMap;function et(t){return t7.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:h,isNegF:l,offsetF:c}=t4(r,t,o);r=s,u?n=n.add(t3(l,e[c])):i=i.add(t3(h,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=t9.get(e);
2return i||(i=this.precomputeWindow(e,t),1!==t&&("function"==typeof r&&(i=r(i)),t9.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){t8(e,this.bits),t7.set(t,e),t9.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=tM(BigInt(n)),u=1;a>12?u=a-3:a>4?u=a-2:a>0&&(u=2);let h=tE(u),l=Array(Number(h)+1).fill(s),c=Math.floor((e.BITS-1)/u)*u,f=s;for(let t=c;t>=0;t-=u){l.fill(s);for(let e=0;e<o;e++){let n=Number(i[e]>>BigInt(t)&h);l[n]=l[n].add(r[e])}let e=s;for(let t=l.length-1,r=s;t>0;t--)r=r.add(l[t]),e=e.add(r);if(f=f.add(e),0!==t)for(let t=0;t<u;t++)f=f.double()}return f}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),eh=BigInt(8);class el{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 S(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(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(ef(t),ef(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 ef(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?_(t):t}function ep(t,e,r){var i;let n;t_(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:o,k:s,m:a,hash:u,expand:h,DST:l}=r;if(!("function"==typeof(i=r.hash)&&Number.isSafeInteger(i.outputLen)))throw Error("expected valid hash");d(t),ef(e);let c=Math.ceil((o.toString(2).length+s)/8),f=e*a*c;if("xmd"===h)n=function(t,e,r,i){d(t),ef(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=A(e,ec(e.length,1)),u=ec(0,o),h=ec(r,2),l=Array(s),c=i(A(u,t,h,ec(0,1),a));l[0]=i(A(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,l[t-1]),ec(t+1,1),a];l[t]=i(A(...e))}return A(...l).slice(0,r)}(t,l,f,u);else if("xof"===h)n=function(t,e,r,i,n){if(d(t),ef(r),(e=ed(e)).length>255){let t=Math.ceil(2*i/8);e=n.create({dkLen:t}).update(_("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,l,f,s,u);else if("_internal_pass"===h)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]=tq(tg(s),o)}p[t]=e}return p}let em=_("HashToScalar-");function eg(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:em},i))[0][0]}}BigInt(0),BigInt(1),BigInt(2);let ey=BigInt(0),eb=BigInt(1),ew=BigInt(2),ev=BigInt(3),ek=BigInt(5),ex=BigInt(8),eS=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),eM={p:eS,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:ex,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")},eE=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function e_(t,e){var r;let i,n,o,s,a,u,h,l,c,f,d,p,m,g,y=tq(e*e*e,eS),b=(r=t*tq(y*y*e,eS),i=BigInt(10),n=BigInt(20),o=BigInt(40),s=BigInt(80),u=tK(a=r*r%eS*r%eS,ew,eS)*a%eS,h=tK(u,eb,eS)*r%eS,l=tK(h,ek,eS)*h%eS,c=tK(l,i,eS)*l%eS,f=tK(c,n,eS)*c%eS,d=tK(f,o,eS)*f%eS,p=tK(d,s,eS)*d%eS,m=tK(p,s,eS)*d%eS,g=tK(m,i,eS)*l%eS,{pow_p_5_8:tK(g,ew,eS)*r%eS,b2:a}).pow_p_5_8,w=tq(t*y*b,eS),v=tq(e*w*w,eS),k=w,x=tq(w*eE,eS),S=v===t,M=v===tq(-t,eS),E=v===tq(-t*eE,eS);return S&&(w=k),(M||E)&&(w=x),t$(w,eS)&&(w=tq(-w,eS)),{isValid:S||M,value:w}}let eI=tX(eM.p,{isLE:!0}),eA=tX(eM.n,{isLE:!0}),eB=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}),h=function(t,e,r={}){if("function"!=typeof e)throw Error('"hash" function param is required');t_(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||P,u=r.adjustScalarBytes||(t=>t),h=r.domain||((t,e,r)=>{if(tf(r,"phflag"),e.length||r)throw Error("Contexts/pre-hash are not supported");return t});function l(t){return s.create(ty(t))}function f(t){var r;
2let i,o,s,a,h,{head:c,prefix:f,scalar:d}=(r=tv("private key",r=t,i=y.secretKey),s=u((o=tv("hashed private key",e(r),2*i)).slice(0,i)),a=o.slice(i,2*i),h=l(s),{head:s,prefix:a,scalar:h}),p=n.multiply(d),m=p.toBytes();return{head:c,prefix:f,scalar:d,point:p,pointBytes:m}}function d(t){return f(t).pointBytes}function p(t=Uint8Array.of(),...r){return l(e(h(A(...r),tv("context",t),!!i)))}let m={zip215:!0},g=o.BYTES,y={secretKey:g,publicKey:g,signature:2*g,seed:g};function b(t=a(y.seed)){return td(t,y.seed,"seed")}let w={getExtendedPublicKey:f,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=y.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=y.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}=f(e),h=p(r.context,o,t),l=n.multiply(h).toBytes(),c=p(r.context,l,u,t),d=s.create(h+c*a);if(!s.isValid(d))throw Error("sign failed: invalid s");return td(A(l,s.toBytes(d)),y.signature,"result")},verify:function(e,r,o,s=m){let a,u,h,{context:l,zip215:c}=s,f=y.signature;e=tv("signature",e,f),r=tv("message",r),o=tv("publicKey",o,y.publicKey),void 0!==c&&tf(c,"zip215"),i&&(r=i(r));let d=f/2,g=e.subarray(0,d),b=ty(e.subarray(d,f));try{a=t.fromBytes(o,c),u=t.fromBytes(g,c),h=n.multiplyUnsafe(b)}catch(t){return!1}if(!c&&a.isSmallOrder())return!1;let w=p(l,u.toBytes(),a.toBytes(),r);return u.add(a.multiplyUnsafe(w)).subtract(h).clearCofactor().is0()},utils:w,Point:t,lengths:y})}(function(t,e={}){var r,i;let n,o,s,a,u,h=eo("edwards",t,e,e.FpFnLE),{Fp:l,Fn:c}=h,f=h.CURVE,{h:d}=f;t_(e,{},{uvRatio:"function"});let p=eu<<BigInt(8*c.BYTES)-ea,m=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:l.sqrt(l.div(t,e))}}catch(t){return{isValid:!1,value:es}}});if(r=f.Gx,i=f.Gy,n=l.sqr(r),o=l.sqr(i),s=l.add(l.mul(f.a,n),o),a=l.add(l.ONE,l.mul(f.d,l.mul(n,o))),!l.eql(s,a))throw Error("bad curve params: generator point");function g(t,e,r=!1){return tS("coordinate "+t,e,r?ea:es,p),e}function y(t){if(!(t instanceof v))throw Error("ExtendedPoint expected")}let b=tA((t,e)=>{let r,i,{X:n,Y:o,Z:s}=t,a=t.is0();null==e&&(e=a?eh:l.inv(s));let u=(r=n*e,l.create(r)),h=(i=o*e,l.create(i)),c=l.mul(s,e);if(a)return{x:es,y:ea};if(c!==ea)throw Error("invZ was invalid");return{x:u,y:h}}),w=tA(t=>{let e,r,i,n,o,s,a,u,h,c,d,p,{a:m,d:g}=f;if(t.is0())throw Error("bad point: ZERO");let{X:y,Y:b,Z:w,T:v}=t,k=(e=y*y,l.create(e)),x=(r=b*b,l.create(r)),S=(i=w*w,l.create(i)),M=(n=S*S,l.create(n));if(a=S*(o=k*m,s=l.create(o)+x,l.create(s)),l.create(a)!==(c=M+(h=g*(u=k*x,l.create(u)),l.create(h)),l.create(c)))throw Error("bad point: equation left != right (1)");if(d=y*b,l.create(d)!==(p=w*v,l.create(p)))throw Error("bad point: equation left != right (2)");return!0});class v{constructor(t,e,r,i){this.X=g("x",t),this.Y=g("y",e),this.Z=g("z",r,!0),this.T=g("t",i),Object.freeze(this)}static CURVE(){return f}static fromAffine(t){let e;if(t instanceof v)throw Error("extended point not allowed");let{x:r,y:i}=t||{};return g("x",r),g("y",i),new v(r,i,ea,(e=r*i,l.create(e)))}static fromBytes(t,e=!1){let r,i,n,o,s=l.BYTES,{a,d:u}=f;t=tk(td(t,s,"point")),tf(e,"zip215");let h=tk(t),c=t[s-1];h[s-1]=-129&c;let d=ty(h);tS("point.y",d,es,e?p:l.ORDER);let g=(r=d*d,l.create(r)),{isValid:y,value:b}=m((i=g-ea,l.create(i)),(n=u*g-a,l.create(n)));if(!y)throw Error("bad point: invalid y coordinate");let w=(b&ea)===ea,k=(128&c)!=0;if(!e&&b===es&&k)throw Error("bad point: x=0 and x_0=1");return k!==w&&(o=-b,b=l.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 k.createCache(this,t),e||this.multiply(eu),this}assertValidity(){w(this)}equals(t){let e,r,i,n;y(t);let{X:o,Y:s,Z:a}=this,{X:u,Y:h,Z:c}
2=t,f=(e=o*c,l.create(e)),d=(r=u*a,l.create(r)),p=(i=s*c,l.create(i)),m=(n=h*a,l.create(n));return f===d&&p===m}is0(){return this.equals(v.ZERO)}negate(){let t,e;return new v((t=-this.X,l.create(t)),this.Y,this.Z,(e=-this.T,l.create(e)))}double(){let t,e,r,i,n,o,s,a,u,h,c,{a:d}=f,{X:p,Y:m,Z:g}=this,y=(t=p*p,l.create(t)),b=(e=m*m,l.create(e)),w=(i=eu*(r=g*g,l.create(r)),l.create(i)),k=(n=d*y,l.create(n)),x=p+m,S=(o=x*x,s=l.create(o)-y-b,l.create(s)),M=k+b,E=M-w,_=k-b,I=(a=S*E,l.create(a)),A=(u=M*_,l.create(u)),B=(h=S*_,l.create(h));return new v(I,A,(c=E*M,l.create(c)),B)}add(t){let e,r,i,n,o,s,a,u,h,c;y(t);let{a:d,d:p}=f,{X:m,Y:g,Z:b,T:w}=this,{X:k,Y:x,Z:S,T:M}=t,E=(e=m*k,l.create(e)),_=(r=g*x,l.create(r)),I=(i=w*p*M,l.create(i)),A=(n=b*S,l.create(n)),B=(o=(m+g)*(k+x)-E-_,l.create(o)),R=A-I,P=A+I,T=(s=_-d*E,l.create(s)),O=(a=B*R,l.create(a)),L=(u=P*T,l.create(u)),C=(h=B*T,l.create(h));return new v(O,L,(c=R*P,l.create(c)),C)}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}=k.cached(this,t,t=>t6(v,t));return t6(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:k.unsafe(this,t,t=>t6(v,t),e)}isSmallOrder(){return this.multiplyUnsafe(d).is0()}isTorsionFree(){return k.unsafe(this,f.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=l.toBytes(e);return r[r.length-1]|=t&ea?128:0,r}toHex(){return S(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 t6(v,t)}static msm(t,e){return ei(v,c,t,e)}_setWindowSize(t){this.precompute(t)}toRawBytes(){return this.toBytes()}}v.BASE=new v(f.Gx,f.Gy,ea,(u=f.Gx*f.Gy,l.create(u))),v.ZERO=new v(es,ea,ea,es),v.Fp=l,v.Fn=c;let k=new er(v,c.BITS);return v.BASE.precompute(8),v}(o,s),a,u);return n=h.Point,Object.assign({},h,{ExtendedPoint:n,CURVE:t,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}({...eM,Fp:eI,hash:th,adjustScalarBytes:function(t){return t[0]&=248,t[31]&=127,t[31]|=64,t},uvRatio:e_}),eR=(eS+ev)/ex,eP=eI.pow(ew,eR),eT=eI.sqrt(eI.neg(eI.ONE)),eO=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)));eg(eB.Point,t=>(function(t){let e,r,i,n,o,s,a,u,h,l,c,f,d,p,m,g,y,b,w,v,k,x,S,{xMn:M,xMd:E,yMn:_,yMd:I}=(e=(eS-ek)/ex,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),h=eI.sqr(a),s=eI.sqr(h),h=eI.mul(h,a),h=eI.mul(h,u),s=eI.mul(s,h),l=eI.pow(s,e),l=eI.mul(l,h),c=eI.mul(l,eT),s=eI.sqr(l),s=eI.mul(s,a),f=eI.eql(s,u),d=eI.cmov(c,l,f),p=eI.mul(o,i),m=eI.mul(l,t),m=eI.mul(m,eP),g=eI.mul(m,eT),y=eI.mul(u,i),s=eI.sqr(m),s=eI.mul(s,a),b=eI.eql(s,y),w=eI.cmov(g,m,b),s=eI.sqr(d),s=eI.mul(s,a),v=eI.eql(s,u),k=eI.cmov(p,o,v),x=eI.
2cmov(w,d,v),S=eI.isOdd(x),{xMn:k,xMd:n,yMn:x=eI.cmov(x,eI.neg(x),v!==S),yMd:eb}),A=eI.mul(M,I);A=eI.mul(A,eO);let B=eI.mul(E,_),R=eI.sub(M,E),P=eI.add(M,E),T=eI.mul(B,P),O=eI.eql(T,eI.ZERO);A=eI.cmov(A,eI.ZERO,O),B=eI.cmov(B,eI.ONE,O),R=eI.cmov(R,eI.ONE,O),P=eI.cmov(P,eI.ONE,O);let[L,C]=tG(eI,[B,P],!0);return{x:eI.mul(A,L),y:eI.mul(R,C)}})(t[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:eS,m:1,k:128,expand:"xmd",hash:th});let eL=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),eC=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),eU=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),eN=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),ez=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),eq=t=>eB.Point.Fp.create(ty(t)&ez);function eK(t){let e,r,i,n,o,s,a,u,h,l,c,f,d,p,m,{d:g}=eM,y=(e=eE*t*t,eI.create(e)),b=(r=(y+eb)*eU,eI.create(r)),w=BigInt(-1),v=(n=(w-g*y)*(i=y+g,eI.create(i)),eI.create(n)),{isValid:k,value:x}=e_(b,v),S=(o=x*t,eI.create(o));t$(S,eS)||(s=-S,S=eI.create(s)),k||(x=S),k||(w=y);let M=(a=w*(y-eb)*eN-v,eI.create(a)),E=x*x,_=(u=(x+x)*v,eI.create(u)),I=(h=M*eL,eI.create(h)),A=(l=eb-E,eI.create(l)),B=(c=eb+E,eI.create(c));return new eB.Point((f=_*B,eI.create(f)),(d=A*I,eI.create(d)),(p=I*B,eI.create(p)),(m=_*A,eI.create(m)))}class eW extends el{constructor(t){super(t)}static fromAffine(t){return new eW(eB.Point.fromAffine(t))}assertSame(t){if(!(t instanceof eW))throw Error("RistrettoPoint expected")}init(t){return new eW(t)}static hashToCurve(t){var e;let r,i;return d(e=tv("ristrettoHash",t,64),64),r=eK(eq(e.subarray(0,32))),i=eK(eq(e.subarray(32,64))),new eW(r.add(i))}static fromBytes(t){let e,r,i,n,o,s,a,u,h,l,c,f,p;d(t,32);let{a:m,d:g}=eM,y=eq(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(y),t)||t$(y,eS))throw Error("invalid ristretto255 encoding 1");let b=(e=y*y,eI.create(e)),w=(r=eb+m*b,eI.create(r)),v=(i=eb-m*b,eI.create(i)),k=(n=w*w,eI.create(n)),x=(o=v*v,eI.create(o)),S=(s=m*g*k-x,eI.create(s)),{isValid:M,value:E}=(a=S*x,e_(eb,eI.create(a))),_=(u=E*v,eI.create(u)),I=(h=E*_*S,eI.create(h)),A=(l=(y+y)*_,eI.create(l));t$(A,eS)&&(c=-A,A=eI.create(c));let B=(f=w*I,eI.create(f)),R=(p=A*B,eI.create(p));if(!M||t$(R,eS)||B===ey)throw Error("invalid ristretto255 encoding 2");return new eW(new eB.Point(A,B,eb,R))}static fromHex(t){return eW.fromBytes(tv("ristrettoHex",t,32))}static msm(t,e){return ei(eW,eB.Point.Fn,t,e)}toBytes(){let t,e,r,i,n,o,s,a,u,h,l,c,f,{X:d,Y:p,Z:m,T:g}=this.ep,y=(t=m+p,r=eI.create(t)*(e=m-p,eI.create(e)),eI.create(r)),b=(i=d*p,eI.create(i)),{value:w}=(o=y*(n=b*b,eI.create(n)),e_(eb,eI.create(o))),v=(s=w*y,eI.create(s)),k=(a=w*b,eI.create(a)),x=(u=v*k*g,eI.create(u));
2if(t$(g*x,eS)){let t,e,r=(t=p*eE,eI.create(t)),i=(e=d*eE,eI.create(e));d=r,p=i,f=eI.create(v*eC)}else f=k;t$(d*x,eS)&&(h=-p,p=eI.create(h));let S=(l=(m-p)*f,eI.create(l));return t$(S,eS)&&(c=-S,S=eI.create(c)),eI.toBytes(S)}equals(t){let e,r,i,n;this.assertSame(t);let{X:o,Y:s}=this.ep,{X:a,Y:u}=t.ep,h=(e=o*u,eI.create(e)===(r=s*a,eI.create(r))),l=(i=s*u,eI.create(i)===(n=o*a,eI.create(n)));return h||l}is0(){return this.equals(eW.ZERO)}}eW.BASE=new eW(eB.Point.BASE),eW.ZERO=new eW(eB.Point.ZERO),eW.Fp=eI,eW.Fn=eA;var eF=t.i(776284),eD=t.i(635030),eV=t.i(154119),ej=t.i(444610);function e$([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(247167);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(e$).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}var eJ=(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}})};class eX 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 eQ(t){return"object"==typeof t&&null!=t}function e0(t){return eQ(t)&&!Array.isArray(t)}function e1(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function*e2(t,e,r,i){var n;for(let o of(eQ(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: \`${e1(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*e3(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[h,l,c]of e.entries(t,a))for(let e of e3(l,c,{path:void 0===h?i:[...i,h],branch:void 0===h?n:[...n,l],coerce:o,mask:s,message:r.message}))e[0]?(u=null!=e[0].refinement?"not_refined":"not_valid",yield[e[0],void 0]):o&&(l=e[1],void 0===h?t=l:t instanceof Map?t.set(h,l):t instanceof Set?t.add(l):eQ(t)&&(void 0!==l||h in t)&&(t[h]=l));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)=>e2(i(t,e),e,this,t):this.validator=()=>[],n?this.refiner=(t,e)=>e2(n(t,e),e,this,t):this.refiner=()=>[]}assert(t,e){return e8(t,this,e)}create(t,e){return e5(t,this,e)}is(t){var e,r;return e=t,r=this,!e4(e,r)[0]}mask(t,e){var r=t,i=this,n=e;let o=e4(r,i,{coerce:!0,mask:!0,message:n});if(!o[0])return o[1];throw o[0]}validate(t,e={}){return e4(t,this,e)}}function e8(t,e,r){let i=e4(t,e,{message:r});if(i[0])throw i[0]}function e5(t,e,r){let i=e4(t,e,{coerce:!0,message:r});if(!i[0])return i[1];throw i[0]}function e4(t,e,r={}){let i=e3(t,e,r),n=function(t){let{done:e,value:r}=t.next();return e?void 0:r}(i);return n[0]?[new eX(n[0],function*(){for(let t of i)t[0]&&(yield t[0])}),void 0]:[void 0,n[1]]}function e9(t,e){return new e6({type:t,schema:null,validator:e})}function e7(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: ${e1(t)}`})}function rt(){return e9("boolean",t=>"boolean"==typeof t)}function re(t){return e9("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${e1(e)}`)}function rr(t){let e=e1(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: ${e1(r)}`})}function ri(t){return new e6({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})}function rn(){return e9("number",t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${e1(t)}`)}function ro(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 rs(t,e){return new e6({type:"record",schema:null,*entries(r){if(eQ(r))for(let i in r){let n=r[i];yield[i,i,t],yield[i,n,e]}},validator:t=>e0(t)||`Expected an object, but received: ${e1(t)}`,coercer:t=>e0(t)?{...t}:t})}function ra(){return e9("string",t=>"string"==typeof t||`Expected a string, but received: ${e1(t)}`)}function ru(t){let e=e9("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: ${e1(t)}`,coercer:t=>Array.isArray(t)?t.slice():t})}function rh(t){let e=Object.keys(t);return new e6({type:"type",schema:t,*entries(r){if(eQ(r))for(let i of e)yield[i,r[i],t[i]]},validator:t=>e0(t)||`Expected an object, but received: ${e1(t)}`,coercer:t=>e0(t)?{...t}:t})}function rl(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=[];for(let e of t){let[...t]=e3(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: ${e1(r)}`,...n]}})}function rc(){return e9("unknown",()=>!0)}function rf(t,e,r){return new e6({...t,coercer:(i,n)=>e4(i,e)[0]?t.coercer(i,n):t.coercer(r(i,n),n)})}var rd=t.i(578217);t.i(595932);var rp=t.i(87246),rm=class extends rp.EventEmitter{socket;constructor(t,e){super(),this.socket=new window.WebSocket(t,e.protocols),this.socket.onopen=()=>
vendor: 4,288 bytes, line 2
2this.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)}},rg=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},ry=class extends rp.EventEmitter{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 rg,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=h.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=>
2this.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(()=>this.emit("max_reconnects_reached",r,i),1))})}};let rb=BigInt(0),rw=BigInt(1),rv=BigInt(2),rk=BigInt(7),rx=BigInt(256),rS=BigInt(113),rM=[],rE=[],r_=[];for(let t=0,e=rw,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],rM.push(2*(5*i+r)),rE.push((t+1)*(t+2)/2%64);let n=rb;for(let t=0;t<7;t++)(e=(e<<rw^(e>>rk)*rS)%rx)&rv&&(n^=rw<<(rw<<BigInt(t))-rw);r_.push(n)}let rI=q(r_,!0),rA=rI[0],rB=rI[1],rR=(t,e,r)=>r>32?e<<r-32|t>>>64-r:t<<r|e>>>32-r,rP=(t,e,r)=>r>32?t<<r-32|e>>>64-r:e<<r|t>>>32-r;class rT extends B{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,f(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=rR(o,s,1)^r[i],u=rP(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=rE[r],o=rR(e,n,i),s=rP(e,n,i),a=rM[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]^=rA[i],t[1]^=rB[i]}y(r)}(this.state32,this.rounds),v(this.state32),this.posOut=0,this.pos=0}update(t){m(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){m(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 f(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(g(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,y(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 rO=R(()=>new rT(136,1,32));class rL extends B{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),y(n)}update(t){return m(this),this.iHash.update(t),this}digestInto(t){m(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 rC=(t,e,r)=>new rL(t,e).update(r).digest();rC.create=(t,e)=>new rL(t,e);let rU=(t,e)=>(t+(t>=0?e:-e)/rF)/e;function rN(t){if(!["compact","recovered","der"].includes(t))throw Error('Signature format must be "compact", "recovered", or "der"');return t}function rz(t,e){let r={};for(let i of Object.keys(e))r[i]=void 0===t[i]?e[i]:t[i];return tf(r.lowS,"lowS"),tf(r.prehash,"prehash"),void 0!==r.format&&rN(r.format),r}
vendor: 6,262 bytes, line 2
2let rq={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(t,e)=>{let{Err:r}=rq;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}=rq,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}=rq;if(t<rK)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}=rq;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 tg(t)}},toSig(t){let{Err:e,_int:r,_tlv:i}=rq,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:h,l:l}=i.decode(2,u);if(l.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(h)}},hexFromSig(t){let{_tlv:e,_int:r}=rq,i=e.encode(2,r.encode(t.r)),n=e.encode(2,r.encode(t.s));return e.encode(48,i+n)}},rK=BigInt(0),rW=BigInt(1),rF=BigInt(2),rD=BigInt(3),rV=BigInt(4);function rj(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 r$(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),h=t*t*t%e,l=h*h*t%e,c=tK(l,r,e)*l%e,f=tK(c,r,e)*l%e,d=tK(f,rJ,e)*h%e,p=tK(d,n,e)*d%e,m=tK(p,o,e)*p%e,g=tK(m,a,e)*m%e,y=tK(g,u,e)*g%e,b=tK(y,a,e)*m%e,w=tK(b,r,e)*l%e,v=tK(w,s,e)*p%e,k=tK(v,i,e)*h%e,x=tK(k,rJ,e);if(!rX.eql(rX.sqr(x),t))throw Error("Cannot find square root");return x}}),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),t_(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let i=r.randomBytes||P,n=r.hmac||((t,...r)=>rC(e,t,A(...r))),{Fp:o,Fn:s}=t,{ORDER:a,BITS:u}=s,{keygen:h,getPublicKey:l,getSharedSecret:f,utils:d,lengths:m}=function(t,e={}){let{Fn:r}=t,i=e.randomBytes||P,n=Object.assign(rH(t.Fp,r),{seed:t0(r.ORDER)});function o(t){try{return!!rj(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=tq(r?ty(t):tg(t),e-tR)+tR;return r?tw(s,n):tb(s,n)}(td(t,n.seed,"seed"),r.ORDER)}function a(e,i=!0){return t.BASE.multiply(rj(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=rj(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=>rj(r,t),precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)},lengths:n})}(t,r),g={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},y="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=y){var r,i;let n,o;
vendor: 6,829 bytes, line 2
2if(r=t,rN(i=e),o=m.signature,td(r,"compact"===i?o:"recovered"===i?o+1:void 0,`${i} signature`),"der"===e){let{r:e,s:r}=rq.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),h=t.subarray(a,2*a);return new w(s.fromBytes(u),s.fromBytes(h),n)}static fromHex(t,e){return this.fromBytes(E(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*rF<r&&u>1)throw Error("recovery id is ambiguous for h>1 curve");let h=2===u||3===u?i+a:i;if(!o.isValid(h))throw Error("recovery id 2 or 3 invalid");let l=o.toBytes(h),c=t.fromBytes(A(r$((1&u)==0),l)),f=s.inv(h),d=k(tv("msgHash",e)),p=s.create(-d*f),m=s.create(n*f),g=t.BASE.multiplyUnsafe(p).add(c.multiplyUnsafe(m));if(g.is0())throw Error("point at infinify");return g.assertValidity(),g}hasHighS(){return this.s>a>>rW}toBytes(t=y){if(rN(t),"der"===t)return E(rq.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 A(Uint8Array.of(this.recovery),e,r)}return A(e,r)}toHex(t){return S(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 S(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return S(this.toBytes("compact"))}}let v=r.bits2int||function(t){if(t.length>8192)throw Error("input is too large");let e=tg(t),r=8*t.length-u;return r>0?e>>BigInt(r):e},k=r.bits2int_modN||function(t){return s.create(v(t))},x=tE(u);function M(t){return tS("num < 2^"+u,t,rK,x),s.toBytes(t)}function _(t,r){return td(t,void 0,"message"),r?td(e(t),void 0,"prehashed message"):t}return Object.freeze({keygen:h,getPublicKey:l,getSharedSecret:f,utils:d,lengths:m,Point:t,sign:function(r,o,u={}){let{seed:h,k2sig:l}=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:h}=rz(n,g),l=k(e=_(e,u)),c=rj(s,r),f=[M(c),M(l)];if(null!=h&&!1!==h){let t=!0===h?i(m.secretKey):h;f.push(tv("extraEntropy",t))}return{seed:A(...f),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===rK)return;let h=s.create(i*s.create(l+u*c));if(h===rK)return;let f=2*(n.x!==u)|Number(n.y&rW),d=h;return o&&h>a>>rW&&(d=s.neg(h),f^=1),new w(u,d,f)}}}(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),h=(t=i(0))=>{(o=u(Uint8Array.of(0),t),n=u(),0!==t.length)&&(o=u(Uint8Array.of(1),t),n=u())},l=()=>{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 A(...r)};return(t,e)=>{let r;for(a(),h(t);!(r=e(l()));)h();return a(),r}})(e.outputLen,s.BYTES,n)(h,l)},verify:function(e,r,i,n={}){let{lowS:o,prehash:a,format:u}=rz(n,g);if(i=tv("publicKey",i),r=_(tv("message",r),a),"strict"in n)throw Error("options.strict was renamed to lowS");let h=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 rq.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===h)return!1;try{let e=t.fromBytes(i);if(o&&h.hasHighS())return!1;let{r:n,s:a}=h,u=k(r),l=s.inv(a),c=s.create(u*l),f=s.create(n*l),d=t.BASE.multiplyUnsafe(c).add(e.multiplyUnsafe(f));if(d.is0())return!1;return s.create(d.x)===n}catch(t){return!1}},recoverPublicKey:function(t,e,r={}){let{prehash:i}=rz(r,g);return e=_(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;t_(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 h=rH(i,n);function l(){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(tf(r,"isCompressed"),r)?(l(),A(r$(!i.isOdd(o)),s)):A(Uint8Array.of(4),s,i.toBytes(o))},f=e.fromBytes||function(t){td(t,void 0,"Point");let{publicKey:e,publicKeyUncompressed:r}=h,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 l(),(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 m=i.mul(i.pow(o.a,rD),rV),g=i.mul(i.sqr(o.b),BigInt(27));if(i.is0(i.add(m,g)))throw Error("bad curve params: a or b");function y(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 M))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=rU(s*t,r),u=rU(-n*t,r),h=t-a*i-u*o,l=-a*n-u*s,c=h<rK,f=l<rK;c&&(h=-h),f&&(l=-l);let d=tE(Math.ceil(tM(r)/2))+rW;if(h<rK||h>=d||l<rK||l>=d)throw Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:c,k1:h,k2neg:f,k2:l}}(t,u.basises,n.ORDER)}let v=tA((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),h=i.mul(o,e);if(s)return{x:i.ZERO,y:i.ZERO};
vendor: 4,076 bytes, line 2
2if(!i.eql(h,i.ONE))throw Error("invZ was invalid");return{x:a,y:u}}),k=tA(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 x(t,e,r,n,o){return r=new M(i.mul(r.X,t),r.Y,r.Z),e=t3(n,e),r=t3(o,r),e.add(r)}class M{constructor(t,e,r){this.X=y("x",t),this.Y=y("y",e,!0),this.Z=y("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 M)throw Error("projective point not allowed");return i.is0(e)&&i.is0(r)?M.ZERO:new M(e,r,i.ONE)}static fromBytes(t){let e=M.fromAffine(f(td(t,void 0,"point")));return e.assertValidity(),e}static fromHex(t){return M.fromBytes(tv("pointHex",t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return _.createCache(this,t),e||this.multiply(rD),this}assertValidity(){k(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)),h=i.eql(i.mul(r,a),i.mul(s,n));return u&&h}negate(){return new M(this.X,i.neg(this.Y),this.Z)}double(){let{a:t,b:e}=o,r=i.mul(e,rD),{X:n,Y:s,Z:a}=this,u=i.ZERO,h=i.ZERO,l=i.ZERO,c=i.mul(n,n),f=i.mul(s,s),d=i.mul(a,a),p=i.mul(n,s);return p=i.add(p,p),l=i.mul(n,a),l=i.add(l,l),u=i.mul(t,l),h=i.mul(r,d),h=i.add(u,h),u=i.sub(f,h),h=i.add(f,h),h=i.mul(u,h),u=i.mul(p,u),l=i.mul(r,l),d=i.mul(t,d),p=i.sub(c,d),p=i.mul(t,p),p=i.add(p,l),l=i.add(c,c),c=i.add(l,c),c=i.add(c,d),c=i.mul(c,p),h=i.add(h,c),d=i.mul(s,a),d=i.add(d,d),c=i.mul(d,p),u=i.sub(u,c),l=i.mul(d,f),l=i.add(l,l),new M(u,h,l=i.add(l,l))}add(t){b(t);let{X:e,Y:r,Z:n}=this,{X:s,Y:a,Z:u}=t,h=i.ZERO,l=i.ZERO,c=i.ZERO,f=o.a,d=i.mul(o.b,rD),p=i.mul(e,s),m=i.mul(r,a),g=i.mul(n,u),y=i.add(e,r),w=i.add(s,a);y=i.mul(y,w),w=i.add(p,m),y=i.sub(y,w),w=i.add(e,n);let v=i.add(s,u);return w=i.mul(w,v),v=i.add(p,g),w=i.sub(w,v),v=i.add(r,n),h=i.add(a,u),v=i.mul(v,h),h=i.add(m,g),v=i.sub(v,h),c=i.mul(f,w),h=i.mul(d,g),c=i.add(h,c),h=i.sub(m,c),c=i.add(m,c),l=i.mul(h,c),m=i.add(p,p),m=i.add(m,p),g=i.mul(f,g),w=i.mul(d,w),m=i.add(m,g),g=i.sub(p,g),g=i.mul(f,g),w=i.add(w,g),p=i.mul(m,w),l=i.add(l,p),p=i.mul(v,w),h=i.mul(y,h),h=i.sub(h,p),p=i.mul(y,m),c=i.mul(v,c),new M(h,l,c=i.add(c,p))}subtract(t){return this.add(t.negate())}is0(){return this.equals(M.ZERO)}multiply(t){let r,i,{endo:o}=e;if(!n.isValidNot0(t))throw Error("invalid scalar: out of range");let s=t=>_.cached(this,t,t=>t6(M,t));if(o){let{k1neg:e,k1:n,k2neg:a,k2:u}=w(t),{p:h,f:l}=s(n),{p:c,f:f}=s(u);i=l.add(f),r=x(o.beta,h,c,e,a)}else{let{p:e,f:n}=s(t);r=e,i=n}return t6(M,[r,i])[0]}multiplyUnsafe(t){let{endo:r}=e;if(!n.isValid(t))throw Error("invalid scalar: out of range");if(t===rK||this.is0())return M.ZERO;if(t===rW)return this;if(_.hasCache(this))return this.multiply(t);if(!r)return _.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}}(M,this,i,o);return x(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===rW||(t?t(M,this):_.unsafe(this,a).is0())}clearCofactor(){let{clearCofactor:t}=e;return s===rW?this:t?t(M,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(t=!0){return tf(t,"isCompressed"),this.assertValidity(),c(M,this,t)}toHex(t=!0){return S(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)}
2_setWindowSize(t){this.precompute(t)}static normalizeZ(t){return t6(M,t)}static msm(t,e){return ei(M,n,t,e)}static fromPrivateKey(t){return M.BASE.multiply(rj(n,t))}}M.BASE=new M(o.Gx,o.Gy,i.ONE),M.ZERO=new M(i.ZERO,i.ONE,i.ZERO),M.Fp=i,M.Fn=n;let E=n.BITS,_=new er(M,e.endo?Math.ceil(E/2):E);return M.BASE.precompute(8),M}(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=rK;for(let t=r-rW;t%rF===rK;t/=rF)i+=rW;let n=i,o=rF<<n-rW-rW,s=o*rF,a=(r-rW)/s,u=(a-rW)/rF,h=s-rW,l=t.pow(e,a),c=t.pow(e,(a+rW)/rF),f=(e,r)=>{let i=l,s=t.pow(r,h),a=t.sqr(s);a=t.mul(a,r);let f=t.mul(e,a);f=t.pow(f,u),f=t.mul(f,s),s=t.mul(f,r),a=t.mul(f,e);let d=t.mul(a,s);f=t.pow(d,o);let p=t.eql(f,t.ONE);s=t.mul(a,c),f=t.mul(d,i),a=t.cmov(s,a,p),d=t.cmov(f,d,p);for(let e=n;e>rW;e--){let r=e-rF;r=rF<<r-rW;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%rV===rD){let r=(t.ORDER-rD)/rV,i=t.sqrt(t.neg(e));f=(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),h=t.mul(t.sqr(a),n),l=t.eql(h,e),c=t.cmov(u,a,l);return{isValid:l,value:c}}}return f}(t,n);if(!t.isOdd)throw Error("Field does not have .isOdd()");return e=>{let s,a,u,h,l,c,f,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),h=t.cmov(n,t.neg(a),!t.eql(a,t.ZERO)),h=t.mul(h,r),a=t.sqr(u),c=t.sqr(h),l=t.mul(c,r),a=t.add(a,l),a=t.mul(a,u),c=t.mul(c,h),l=t.mul(c,i),a=t.add(a,l),f=t.mul(s,u);let{isValid:p,value:m}=o(a,c);d=t.mul(s,e),d=t.mul(d,m),f=t.cmov(f,u,p),d=t.cmov(d,m,p);let g=t.isOdd(e)===t.isOdd(d);d=t.cmov(t.neg(d),d,g);let y=tG(t,[h],!0)[0];return{x:f=t.mul(f,y),y:d}}}(rX,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:rX.create(BigInt("-11"))});eg(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});let r2=eB.utils.randomPrivateKey,r3=()=>{let t=eB.utils.randomPrivateKey(),e=r6(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),{publicKey:e,secretKey:r}},r6=eB.getPublicKey;function r8(t){try{return eB.ExtendedPoint.fromHex(t),!0}catch{return!1}}let r5=(t,e)=>eB.sign(t,e.slice(0,32)),r4=eB.verify,r9=t=>h.Buffer.isBuffer(t)?t:t instanceof Uint8Array?h.Buffer.from(t.buffer,t.byteOffset,t.byteLength):h.Buffer.from(t);class r7{constructor(t){Object.assign(this,t)}encode(){return h.Buffer.from((0,eV.serialize)(it,this))}static decode(t){return(0,eV.deserialize)(it,this,t)}
2static decodeUnchecked(t){return(0,eV.deserializeUnchecked)(it,this,t)}}let it=new Map,ie=1;class ir 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=eD.default.decode(t);if(32!=e.length)throw Error("Invalid public key input");this._bn=new eF.default(e)}else this._bn=new eF.default(t);if(this._bn.byteLength()>32)throw Error("Invalid public key input")}}static unique(){let t=new ir(ie);return ie+=1,new ir(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return eD.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(h.Buffer);if(32===t.length)return t;let e=h.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 ir(tu(h.Buffer.concat([t.toBuffer(),h.Buffer.from(e),r.toBuffer()])))}static createProgramAddressSync(t,e){let r=h.Buffer.alloc(0);t.forEach(function(t){if(t.length>32)throw TypeError("Max seed length exceeded");r=h.Buffer.concat([r,r9(t)])});let i=tu(r=h.Buffer.concat([r,e.toBuffer(),h.Buffer.from("ProgramDerivedAddress")]));if(r8(i))throw Error("Invalid seeds, address must fall off the curve");return new ir(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(h.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 ir(t).toBytes())}}ir.default=new ir("11111111111111111111111111111111"),it.set(ir,{kind:"struct",fields:[["_bn","u256"]]});let ii=new ir("BPFLoader1111111111111111111111111111111111");class io extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(io.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});
vendor: 19,953 bytes, line 2
2class is 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(is.prototype,"name",{value:"TransactionExpiredTimeoutError"});class ia extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}}Object.defineProperty(ia.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class iu{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 ih=(t="publicKey")=>ej.blob(32,t),il=(t="string")=>{let e=ej.struct([ej.u32("length"),ej.u32("lengthPadding"),ej.blob(ej.offset(ej.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:h.Buffer.from(t,"utf8")},e,r),e.alloc=t=>ej.u32().span+ej.u32().span+h.Buffer.from(t,"utf8").length,e};function ic(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 id(t,e){let r=e;for(;;){let e=127&r;if(0==(r>>=7)){t.push(e);break}e|=128,t.push(e)}}function ip(t,e){if(!t)throw Error(e||"Assertion failed")}class im{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 im(e,r)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];ip(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};{ip(e.length>0,"Expected at least one writable signer key");let[t]=e[0];ip(t===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...e.map(([t])=>new ir(t)),...r.map(([t])=>new ir(t)),...i.map(([t])=>new ir(t)),...n.map(([t])=>new ir(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 ir(n),o=t.findIndex(t=>t.equals(e));o>=0&&(ip(o<256,"Max lookup table index exceeded"),r.push(o),i.push(e),this.keyMetaMap.delete(n))}return[r,i]}}let ig="Reached end of buffer unexpectedly";function iy(t){if(0===t.length)throw Error(ig);return t.shift()}function ib(t,...e){let[r]=e;if(2===e.length?r+(e[1]??0)>t.length:r>=t.length)throw Error(ig);return t.splice(...e)}class iw{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 ir(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:eD.default.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new iu(this.staticAccountKeys)}static compile(t){let[e,r]=im.compile(t.instructions,t.payerKey).getMessageComponents(),i=new iu(r).compileInstructions(t.instructions).map(t=>({programIdIndex:t.programIdIndex,accounts:t.accountKeyIndexes,data:eD.default.encode(t.data)}));return new iw({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=[];id(e,t);let r=this.instructions.map(t=>{let{accounts:e,programIdIndex:r}=t,i=Array.from(eD.default.decode(t.data)),n=[];id(n,e.length);let o=[];return id(o,i.length),{programIdIndex:r,keyIndicesCount:h.Buffer.from(n),keyIndices:e,dataLength:h.Buffer.from(o),data:i}}),i=[];id(i,r.length);let n=h.Buffer.alloc(1232);h.Buffer.from(i).copy(n);let o=i.length;r.forEach(t=>{let e=ej.struct([ej.u8("programIdIndex"),ej.blob(t.keyIndicesCount.length,"keyIndicesCount"),ej.seq(ej.u8("keyIndex"),t.keyIndices.length,"keyIndices"),ej.blob(t.dataLength.length,"dataLength"),ej.seq(ej.u8("userdatum"),t.data.length,"data")]).encode(t,n,o);o+=e}),n=n.slice(0,o);let s=ej.struct([ej.blob(1,"numRequiredSignatures"),ej.blob(1,"numReadonlySignedAccounts"),ej.blob(1,"numReadonlyUnsignedAccounts"),ej.blob(e.length,"keyCount"),ej.seq(ih("key"),t,"keys"),ih("recentBlockhash")]),a={numRequiredSignatures:h.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:h.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:h.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:h.Buffer.from(e),keys:this.accountKeys.map(t=>r9(t.toBytes())),recentBlockhash:eD.default.decode(this.recentBlockhash)},u=h.Buffer.alloc(2048),l=s.encode(a,u);return n.copy(u,l),u.slice(0,l+n.length)}static from(t){let e=[...t],r=iy(e);if(r!==(127&r))throw Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let i=iy(e),n=iy(e),o=ic(e),s=[];for(let t=0;t<o;t++){let t=ib(e,0,32);s.push(new ir(h.Buffer.from(t)))}let a=ib(e,0,32),u=ic(e),l=[];for(let t=0;t<u;t++){let t=iy(e),r=ic(e),i=ib(e,0,r),n=ic(e),o=ib(e,0,n),s=eD.default.encode(h.Buffer.from(o));l.push({programIdIndex:t,accounts:i,data:s})}return new iw({header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:n},recentBlockhash:eD.default.encode(h.Buffer.from(a)),accountKeys:s,instructions:l})}}class iv{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 iu(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=im.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 iu(o,i).compileInstructions(t.instructions);return new iv({header:n,staticAccountKeys:o,recentBlockhash:t.recentBlockhash,compiledInstructions:s,addressTableLookups:r})}serialize(){let t=[];id(t,this.staticAccountKeys.length);let e=this.serializeInstructions(),r=[];id(r,this.compiledInstructions.length);let i=this.serializeAddressTableLookups(),n=[];id(n,this.addressTableLookups.length);let o=ej.struct([ej.u8("prefix"),ej.struct([ej.u8("numRequiredSignatures"),ej.u8("numReadonlySignedAccounts"),ej.u8("numReadonlyUnsignedAccounts")],"header"),ej.blob(t.length,"staticAccountKeysLength"),ej.seq(ih(),this.staticAccountKeys.length,"staticAccountKeys"),ih("recentBlockhash"),ej.blob(r.length,"instructionsLength"),ej.blob(e.length,"serializedInstructions"),ej.blob(n.length,"addressTableLookupsLength"),ej.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:eD.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=[];id(i,r.accountKeyIndexes.length);let n=[];id(n,r.data.length);let o=ej.struct([ej.u8("programIdIndex"),ej.blob(i.length,"encodedAccountKeyIndexesLength"),ej.seq(ej.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),ej.blob(n.length,"encodedDataLength"),ej.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=[];id(i,r.writableIndexes.length);let n=[];id(n,r.readonlyIndexes.length);let o=ej.struct([ih("accountKey"),ej.blob(i.length,"encodedWritableIndexesLength"),ej.seq(ej.u8(),r.writableIndexes.length,"writableIndexes"),ej.blob(n.length,"encodedReadonlyIndexesLength"),ej.seq(ej.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=iy(e),i=127&r;ip(r!==i,"Expected versioned message but received legacy message"),ip(0===i,`Expected versioned message with version 0 but found version ${i}`);let n={numRequiredSignatures:iy(e),numReadonlySignedAccounts:iy(e),numReadonlyUnsignedAccounts:iy(e)},o=[],s=ic(e);for(let t=0;t<s;t++)o.push(new ir(ib(e,0,32)));let a=eD.default.encode(ib(e,0,32)),u=ic(e),h=[];for(let t=0;t<u;t++){let t=iy(e),r=ic(e),i=ib(e,0,r),n=ic(e),o=new Uint8Array(ib(e,0,n));h.push({programIdIndex:t,accountKeyIndexes:i,data:o})}let l=ic(e),c=[];for(let t=0;t<l;t++){let t=new ir(ib(e,0,32)),r=ic(e),i=ib(e,0,r),n=ic(e),o=ib(e,0,n);c.push({accountKey:t,writableIndexes:i,readonlyIndexes:o})}return new iv({header:n,staticAccountKeys:o,recentBlockhash:a,compiledInstructions:h,addressTableLookups:c})}}let ik={deserializeMessageVersion(t){let e=t[0],r=127&e;return r===e?"legacy":r},deserialize:t=>{let e=ik.deserializeMessageVersion(t);if("legacy"===e)return iw.from(t);if(0===e)return iv.deserialize(t);throw Error(`Transaction message version ${e} deserialization is not supported`)}},ix=((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),iS=h.Buffer.alloc(64).fill(0);class iM{constructor(t){this.keys=void 0,this.programId=void 0,this.data=h.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,nonceInstruction: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 iM(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 ir(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,h=0,l=[],c=[];o.forEach(({pubkey:t,isSigner:e,isWritable:r})=>{e?(l.push(t.toString()),a+=1,r||(u+=1)):(c.push(t.toString()),r||(h+=1))});let f=l.concat(c),d=e.map(t=>{let{data:e,programId:r}=t;return{programIdIndex:f.indexOf(r.toString()),accounts:t.keys.map(t=>f.indexOf(t.pubkey.toString())),data:eD.default.encode(e)}});return d.forEach(t=>{ip(t.programIdIndex>=0),t.accounts.forEach(t=>ip(t>=0))}),new iw({header:{numRequiredSignatures:a,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:h},accountKeys:f,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=r5(r,t.secretKey);this._addSignature(t.publicKey,r9(e))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){ip(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=h.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):r4(i,t,n.toBytes())||(r.invali
2d||=[]).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+=` 3Invalid signature for public key${1===t.invalid.length?"":"(s)"} [\`${t.invalid.map(t=>t.toBase58()).join("`, `")}\`].`),t.missing&&(e+=` 4Missing 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=[];id(r,e.length);let i=r.length+64*e.length+t.length,n=h.Buffer.alloc(i);return ip(e.length<256),h.Buffer.from(r).copy(n,0),e.forEach(({signature:t},e)=>{null!==t&&(ip(64===t.length,"signature has invalid length"),h.Buffer.from(t).copy(n,r.length+64*e))}),t.copy(n,r.length+64*e.length),ip(n.length<=1232,`Transaction too large: ${n.length} > 1232`),n}get keys(){return ip(1===this.instructions.length),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return ip(1===this.instructions.length),this.instructions[0].programId}get data(){return ip(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t],r=ic(e),i=[];for(let t=0;t<r;t++){let t=ib(e,0,64);i.push(eD.default.encode(h.Buffer.from(t)))}return iE.populate(iw.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==eD.default.encode(iS)?null:eD.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 iM({keys:i,programId:t.accountKeys[e.programIdIndex],data:eD.default.decode(e.data)}))}),r._message=t,r._json=r.toJSON(),r}}class i_{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;ip(u>0,"Message header is invalid");let h=t.staticAccountKeys.length-o-a;ip(h>=0,"Message header is invalid");let l=t.getAccountKeys(e),c=l.get(0);if(void 0===c)throw Error("Failed to decompile message because no account keys were found");let f=[];for(let t of i){let e=[];for(let i of t.accountKeyIndexes){let t,n=l.get(i);if(void 0===n)throw Error(`Failed to find key for account key index ${i}`);t=i<o?i<u:i<l.staticAccountKeys.length?i-o<h:i-l.staticAccountKeys.length<l.accountKeysFromLookups.writable.length,e.push({pubkey:n,isSigner:i<r.numRequiredSignatures,isWritable:t})}let i=l.get(t.programIdIndex);if(void 0===i)throw Error(`Failed to find program id for program id index ${t.programIdIndex}`);f.push(new iM({programId:i,data:r9(t.data),keys:e}))}return new i_({payerKey:c,instructions:f,recentBlockhash:n})}compileToLegacyMessage(){return iw.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(t){return iv.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:t})}}class iI{get version(){return this.message.version}constructor(t,e){if(this.signatures=void 0,this.message=void 0,void 0!==e)ip(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=[];id(e,this.signatures.length);let r=ej.struct([ej.blob(e.length,"encodedSignaturesLength"),ej.seq(((t="signature")=>ej.blob(64,t))(),this.signatures.length,"signatures"),ej.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=ic(e);for(let t=0;t<i;t++)r.push(new Uint8Array(ib(e,0,64)));return new iI(ik.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));ip(t>=0,`Cannot sign with non signer key ${i.publicKey.toBase58()}`),this.signatures[t]=r5(e,i.secretKey)}}addSignature(t,e){ip(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));ip(r>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=e}}let iA=new ir("SysvarC1ock11111111111111111111111111111111"),iB=new ir("SysvarEpochSchedu1e111111111111111111111111"),iR=new ir("Sysvar1nstructions1111111111111111111111111"),iP=new ir("SysvarRecentB1ockHashes11111111111111111111"),iT=new ir("SysvarRent111111111111111111111111111111111"),iO=new ir("SysvarRewards111111111111111111111111111111"),iL=new ir("SysvarS1otHashes111111111111111111111111111"),iC=new ir("SysvarS1otHistory11111111111111111111111111"),iU=new ir("SysvarStakeHistory1111111111111111111111111");
vendor: 23,827 bytes, lines 4-8
4class iN extends Error{constructor({action:t,signature:e,transactionMessage:r,logs:i}){let n;const o=i?`Logs: 5${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. 6${r}. `+o+s;break;case"simulate":n=`Simulation failed. 7Message: ${r}. 8`+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 iz 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 iq(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 iN({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(n)})`});throw Error(`Transaction ${s} failed (${JSON.stringify(n)})`)}return s}function iK(t){return new Promise(e=>setTimeout(e,t))}function iW(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=h.Buffer.alloc(r),n=Object.assign({instruction:t.index},e);return t.layout.encode(n,i),i}function iF(t,e){let r;try{r=t.layout.decode(e)}catch(t){throw Error("invalid instruction; "+t)}if(r.instruction!==t.index)throw Error(`invalid instruction; instruction index mismatch ${r.instruction} != ${t.index}`);return r}let iD=ej.nu64("lamportsPerSignature"),iV=ej.struct([ej.u32("version"),ej.u32("state"),ih("authorizedPubkey"),ih("nonce"),ej.struct([iD],"feeCalculator")]),ij=iV.span;class i${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=iV.decode(r9(t),0);return new i$({authorizedPubkey:new ir(e.authorizedPubkey),nonce:new ir(e.nonce).toString(),feeCalculator:e.feeCalculator})}}function iH(t){let e=(0,ej.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}})(eJ(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 iZ=Object.freeze({Create:{index:0,layout:ej.struct([ej.u32("instruction"),ej.ns64("lamports"),ej.ns64("space"),ih("programId")])},Assign:{index:1,layout:ej.struct([ej.u32("instruction"),ih("programId")])},Transfer:{index:2,layout:ej.struct([ej.u32("instruction"),iH("lamports")])},CreateWithSeed:{index:3,layout:ej.struct([ej.u32("instruction"),ih("base"),il("seed"),ej.ns64("lamports"),ej.ns64("space"),ih("programId")])},AdvanceNonceAccount:{index:4,layout:ej.struct([ej.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:ej.struct([ej.u32("instruction"),ej.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:ej.struct([ej.u32("instruction"),ih("authorized")])},AuthorizeNonceAccount:{index:7,layout:ej.struct([ej.u32("instruction"),ih("authorized")])},Allocate:{index:8,layout:ej.struct([ej.u32("instruction"),ej.ns64("space")])},AllocateWithSeed:{index:9,layout:ej.struct([ej.u32("instruction"),ih("base"),il("seed"),ej.ns64("space"),ih("programId")])},AssignWithSeed:{index:10,layout:ej.struct([ej.u32("instruction"),ih("base"),il("seed"),ih("programId")])},TransferWithSeed:{index:11,layout:ej.struct([ej.u32("instruction"),iH("lamports"),il("seed"),ih("programId")])},UpgradeNonceAccount:{index:12,layout:ej.struct([ej.u32("instruction")])}});class iG{static createAccount(t){let e=iW(iZ.Create,{lamports:t.lamports,space:t.space,programId:r9(t.programId.toBuffer())});return new iM({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=iW(iZ.TransferWithSeed,{lamports:BigInt(t.lamports),seed:t.seed,programId:r9(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=iW(iZ.Transfer,{lamports:BigInt(t.lamports)}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]),new iM({keys:r,programId:this.programId,data:e})}static assign(t){let e,r;return"basePubkey"in t?(e=iW(iZ.AssignWithSeed,{base:r9(t.basePubkey.toBuffer()),seed:t.seed,programId:r9(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=iW(iZ.Assign,{programId:r9(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new iM({keys:r,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=iW(iZ.CreateWithSeed,{base:r9(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:r9(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 iM({keys:r,programId:this.programId,data:e})}static createNonceAccount(t){let e=new iE;"basePubkey"in t&&"seed"in t?e.add(iG.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:ij,programId:this.programId})):e.add(iG.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:ij,programId:this.programId}));let r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(r)),e}static nonceInitialize(t){let e=iW(iZ.InitializeNonceAccount,{authorized:r9(t.authorizedPubkey.toBuffer())});return new iM({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:iP,isSigner:!1,isWritable:!1},{pubkey:iT,isSigner:!1,isWritable:!1}],programId:this.programId,data:e})}static nonceAdvance(t){let e=iW(iZ.AdvanceNonceAccount);return new iM({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:iP,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceWithdraw(t){let e=iW(iZ.WithdrawNonceAccount,{lamports:t.lamports});return new iM({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:iP,isSigner:!1,isWritable:!1},{pubkey:iT,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceAuthorize(t){let e=iW(iZ.AuthorizeNonceAccount,{authorized:r9(t.newAuthorizedPubkey.toBuffer())});return new iM({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=iW(iZ.AllocateWithSeed,{base:r9(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:r9(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=iW(iZ.Allocate,{space:t.space}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new iM({keys:r,programId:this.programId,data:e})}}iG.programId=new ir("11111111111111111111111111111111");class iY{static getMinNumSignatures(t){return 2*(Math.ceil(t/iY.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(iG.allocate({accountPubkey:r.publicKey,space:n.length})),s.owner.equals(i)||(a=a||new iE).add(iG.assign({accountPubkey:r.publicKey,programId:i})),s.lamports<o&&(a=a||new iE).add(iG.transfer({fromPubkey:e.publicKey,toPubkey:r.publicKey,lamports:o-s.lamports}))}else a=new iE().add(iG.createAccount({fromPubkey:e.publicKey,newAccountPubkey:r.publicKey,lamports:o>0?o:1,space:n.length,programId:i}));null!==a&&await iq(t,a,[e,r],{commitment:"confirmed"})}let o=ej.struct([ej.u32("instruction"),ej.u32("offset"),ej.u32("bytesLength"),ej.u32("bytesLengthPadding"),ej.seq(ej.u8("byte"),ej.offset(ej.u32(),-8),"bytes")]),s=iY.chunkSize,a=0,u=n,l=[];for(;u.length>0;){let n=u.slice(0,s),c=h.Buffer.alloc(s+16);o.encode({instruction:0,offset:a,bytes:n,bytesLength:0,bytesLengthPadding:0},c);let f=new iE().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:c});l.push(iq(t,f,[e,r],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await iK(250),a+=s,u=u.slice(s)}await Promise.all(l);{let n=ej.struct([ej.u32("instruction")]),o=h.Buffer.alloc(n.span);n.encode({instruction:1},o);let s=new iE().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:iT,isSigner:!1,isWritable:!1}],programId:i,data:o}),a="processed",u=await t.sendTransaction(s,[e,r],{preflightCommitment:a}),{context:l,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})>l.slot)break}catch{}await new Promise(t=>setTimeout(t,Math.round(200)))}}return!0}}iY.chunkSize=932;let iJ=new ir("BPFLoader2111111111111111111111111111111111");var iX=(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,h,l,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!==(l=r(i[h=u[o]],!1))&&(a&&(a+=","),a+=JSON.stringify(h)+":"+l),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 iQ(t){let e=0;for(;t>1;)t/=2,e++;return e}class i0{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=iQ(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))-iQ(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+iQ(32)):this.slotsPerEpoch}}var i1=globalThis.fetch;class i2 extends ry{constructor(t,e,r){super(t=>{let r=new rm(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 i3{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}(i6,t),r=t.length-56;ip(r>=0,"lookup table is invalid"),ip(r%32==0,"lookup table is invalid");let{addresses:i}=ej.struct([ej.seq(ih(),r/32,"addresses")]).decode(t.slice(56));return{deactivationSlot:e.deactivationSlot,lastExtendedSlot:e.lastExtendedSlot,lastExtendedSlotStartIndex:e.lastExtendedStartIndex,authority:0!==e.authority.length?new ir(e.authority[0]):void 0,addresses:i.map(t=>new ir(t))}}}let i6={index:1,layout:ej.struct([ej.u32("typeIndex"),iH("deactivationSlot"),ej.nu64("lastExtendedSlot"),ej.u8("lastExtendedStartIndex"),ej.u8(),ej.seq(ih(),ej.offset(ej.u8(),-1),"authority")])},i8=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i,i5=rf(re(ir),ra(),t=>new ir(t)),i4=ru([ra(),rr("base64")]),i9=rf(re(h.Buffer),i4,t=>h.Buffer.from(t[0],"base64"));function i7(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 nt(t){return t.map(t=>"memcmp"in t?{...t,memcmp:{...t.memcmp,encoding:t.memcmp.encoding??"base58"}}:t)}function ne(t){return rl([rh({jsonrpc:rr("2.0"),id:ra(),result:t}),rh({jsonrpc:rr("2.0"),id:ra(),error:rh({code:rc(),message:ra(),data:ro(e9("any",()=>!0))})})])}let nr=ne(rc());function ni(t){return rf(ne(t),nr,e=>"error"in e?e:{...e,result:e5(e.result,t)})}function nn(t){return ni(rh({context:rh({slot:rn()}),value:t}))}function no(t){return rh({context:rh({slot:rn()}),value:t})}function ns(t,e){return 0===t?new iv({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new ir(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:eD.default.decode(t.data)})),addressTableLookups:e.addressTableLookups}):new iw(e)}let na=rh({foundation:rn(),foundationTerm:rn(),initial:rn(),taper:rn(),terminal:rn()}),nu=ni(e7(ri(rh({epoch:rn(),effectiveSlot:rn(),amount:rn(),postBalance:rn(),commission:ro(ri(rn()))})))),nh=e7(rh({slot:rn(),prioritizationFee:rn()})),nl=rh({total:rn(),validator:rn(),foundation:rn(),epoch:rn()}),nc=rh({epoch:rn(),slotIndex:rn(),slotsInEpoch:rn(),absoluteSlot:rn(),blockHeight:ro(rn()),transactionCount:ro(rn())}),nf=rh({slotsPerEpoch:rn(),leaderScheduleSlotOffset:rn(),warmup:rt(),firstNormalEpoch:rn(),firstNormalSlot:rn()}),nd=rs(ra(),e7(rn())),np=ri(rl([rh({}),ra()])),nm=rh({err:np}),ng=rr("receivedSignature"),ny=rh({"solana-core":ra(),"feature-set":ro(rn())}),nb=rh({program:ra(),programId:i5,parsed:rc()}),nw=rh({programId:i5,accounts:e7(i5),data:ra()}),nv=nn(rh({err:ri(rl([rh({}),ra()])),logs:ri(e7(ra())),accounts:ro(ri(e7(ri(rh({executable:rt(),owner:ra(),lamports:rn(),data:e7(ra()),rentEpoch:ro(rn())}))))),unitsConsumed:ro(rn()),returnData:ro(ri(rh({programId:ra(),data:ru([ra(),rr("base64")])}))),innerInstructions:ro(ri(e7(rh({index:rn(),instructions:e7(rl([nb,nw]))}))))})),nk=nn(rh({byIdentity:rs(ra(),e7(rn())),range:rh({firstSlot:rn(),lastSlot:rn()})})),nx=ni(na),nS=ni(nl),nM=ni(nh),nE=ni(nc),n_=ni(nf),nI=ni(nd),nA=ni(rn()),nB=nn(rh({total:rn(),circulating:rn(),nonCirculating:rn(),nonCirculatingAccounts:e7(i5)})),nR=rh({amount:ra(),uiAmount:ri(rn()),decimals:rn(),uiAmountString:ro(ra())}),nP=nn(e7(rh({address:i5,amount:ra(),uiAmount:ri(rn()),decimals:rn(),uiAmountString:ro(ra())}))),nT=nn(e7(rh({pubkey:i5,account:rh({executable:rt(),owner:i5,lamports:rn(),data:i9,rentEpoch:rn()})}))),nO=rh({program:ra(),parsed:rc(),space:rn()}),nL=nn(e7(rh({pubkey:i5,account:rh({executable:rt(),owner:i5,lamports:rn(),data:nO,rentEpoch:rn()})}))),nC=nn(e7(rh({lamports:rn(),address:i5}))),nU=rh({executable:rt(),owner:i5,lamports:rn(),data:i9,rentEpoch:rn()}),nN=rh({pubkey:i5,account:nU}),nz=rf(rl([re(h.Buffer),nO]),rl([i4,nO]),t=>Array.isArray(t)?e5(t,i9):t),nq=rh({executable:rt(),owner:i5,lamports:rn(),data:nz,rentEpoch:rn()}),nK=rh({pubkey:i5,account:nq}),nW=rh({state:rl([rr("active"),rr("inactive"),rr("activating"),rr("deactivating")]),active:rn(),inactive:rn()}),nF=ni(e7(rh({signature:ra(),slot:rn(),err:np,memo:ri(ra()),blockTime:ro(ri(rn()))}))),nD=ni(e7(rh({signature:ra(),slot:rn(),err:np,memo:ri(ra()),blockTime:ro(ri(rn()))}))),nV=rh({subscription:rn(),result:no(nU)}),nj=rh({pubkey:i5,account:nU}),n$=rh({subscription:rn(),result:no(nj)}),nH=rh({parent:rn(),slot:rn(),root:rn()}),nZ=rh({subscription:rn(),result:nH}),nG=rl([rh({type:rl([rr("firstShredReceived"),rr("completed"),rr("optimisticConfirmation"),rr("root")]),slot:rn(),timestamp:rn()}),rh({type:rr("createdBank"),parent:rn(),slot:rn(),timestamp:rn()}),rh({type:rr("frozen"),slot:rn(),timestamp:rn(),stats:rh({numTransactionEntries:rn(),numSuccessfulTransactions:rn(),numFailedTransactions:rn(),maxTransactionsPerEntry:rn()})}),rh({type:rr("dead"),slot:rn(),timestamp:rn(),err:ra()})]),nY=rh({subscription:rn(),result:nG}),nJ=rh({subscription:rn(),result:no(rl([nm,ng]))}),nX=rh({subscription:rn(),result:rn()}),nQ=rh({pubkey:ra(),gossip:ri(ra()),tpu:ri(ra()),rpc:ri(ra()),version:ri(ra())}),n0=rh({votePubkey:ra(),nodePubkey:ra(),activatedStake:rn(),epochVoteAccount:rt(),epochCredits:e7(ru([rn(),rn(),rn()])),commission:rn(),lastVote:rn(),rootSlot:ri(rn())}),n1=ni(rh({current:e7(n0),delinquent:e7(n0)})),n2=rl([rr("processed"),rr("confirmed"),rr("finalized")]),n3=rh({slot:rn(),confirmations:ri(rn()),err:np,confirmationStatus:ro(n2)}),n6=nn(e7(ri(n3))),n8=ni(rn()),n5=rh({accountKey:i5,writableIndexes:e7(rn()),readonlyIndexes:e7(rn())}),n4=rh({signatures:e7(ra()),message:rh({accountKeys:e7(ra()),header:rh({numRequiredSignatures:rn(),numReadonlySignedAccounts:rn(),numReadonlyUnsignedAccounts:rn()}),instructions:e7(rh({accounts:e7(rn()),data:ra(),programIdIndex:rn()})),recentBlockhash:ra(),addressTableLookups:ro(e7(n5))})}),n9=rh({pubkey:i5,signer:rt(),writable:rt(),source:ro(rl([rr("transaction"),rr("lookupTable")]))}),n7=rh({accountKeys:e7(n9),signatures:e7(ra())}),ot=rh({parsed:rc(),program:ra(),programId:i5}),oe=rh({accounts:e7(i5),data:ra(),programId:i5}),or=rf(rl([oe,ot]),rl([rh({parsed:rc(),program:ra(),programId:ra()}),rh({accounts:e7(ra()),data:ra(),programId:ra()})]),t=>"accounts"in t?e5(t,oe):e5(t,ot)),oi=rh({signatures:e7(ra()),message:rh({accountKeys:e7(n9),instructions:e7(or),recentBlockhash:ra(),addressTableLookups:ro(ri(e7(n5)))})}),on=rh({accountIndex:rn(),mint:ra(),owner:ro(ra()),programId:ro(ra()),uiTokenAmount:nR}),oo=rh({writable:e7(i5),readonly:e7(i5)}),os=rh({err:np,fee:rn(),innerInstructions:ro(ri(e7(rh({index:rn(),instructions:e7(rh({accounts:e7(rn()),data:ra(),programIdIndex:rn()}))})))),preBalances:e7(rn()),postBalances:e7(rn()),logMessages:ro(ri(e7(ra()))),preTokenBalances:ro(ri(e7(on))),postTokenBalances:ro(ri(e7(on))),loadedAddresses:ro(oo),computeUnitsConsumed:ro(rn()),costUnits:ro(rn())}),oa=rh({err:np,fee:rn(),innerInstructions:ro(ri(e7(rh({index:rn(),instructions:e7(or)})))),preBalances:e7(rn()),postBalances:e7(rn()),logMessages:ro(ri(e7(ra()))),preTokenBalances:ro(ri(e7(on))),postTokenBalances:ro(ri(e7(on))),loadedAddresses:ro(oo),computeUnitsConsumed:ro(rn()),costUnits:ro(rn())}),ou=rl([rr(0),rr("legacy")]),oh=rh({pubkey:ra(),lamports:rn(),postBalance:ri(rn()),rewardType:ri(ra()),commission:ro(ri(rn()))}),ol=ni(ri(rh({blockhash:ra(),previousBlockhash:ra(),parentSlot:rn(),transactions:e7(rh({transaction:n4,meta:ri(os),version:ro(ou)})),rewards:ro(e7(oh)),blockTime:ri(rn()),blockHeight:ri(rn())}))),oc=ni(ri(rh({blockhash:ra(),previousBlockhash:ra(),parentSlot:rn(),rewards:ro(e7(oh)),blockTime:ri(rn()),blockHeight:ri(rn())}))),of=ni(ri(rh({blockhash:ra(),previousBlockhash:ra(),parentSlot:rn(),transactions:e7(rh({transaction:n7,meta:ri(os),version:ro(ou)})),rewards:ro(e7(oh)),blockTime:ri(rn()),blockHeight:ri(rn())}))),od=ni(ri(rh({blockhash:ra(),previousBlockhash:ra(),parentSlot:rn(),transactions:e7(rh({transaction:oi,meta:ri(oa),version:ro(ou)})),rewards:ro(e7(oh)),blockTime:ri(rn()),blockHeight:ri(rn())}))),op=ni(ri(rh({blockhash:ra(),previousBlockhash:ra(),parentSlot:rn(),transactions:e7(rh({transaction:n7,meta:ri(oa),version:ro(ou)})),rewards:ro(e7(oh)),blockTime:ri(rn()),blockHeight:ri(rn())}))),om=ni(ri(rh({blockhash:ra(),previousBlockhash:ra(),parentSlot:rn(),rewards:ro(e7(oh)),blockTime:ri(rn()),blockHeight:ri(rn())}))),og=ni(ri(rh({blockhash:ra(),previousBlockhash:ra(),parentSlot:rn(),transactions:e7(rh({transaction:n4,meta:ri(os)})),rewards:ro(e7(oh)),blockTime:ri(rn())}))),oy=ni(ri(rh({blockhash:ra(),previousBlockhash:ra(),parentSlot:rn(),signatures:e7(ra()),blockTime:ri(rn())}))),ob=ni(ri(rh({slot:rn(),meta:ri(os),blockTime:ro(ri(rn())),transaction:n4,version:ro(ou)}))),ow=ni(ri(rh({slot:rn(),transaction:oi,meta:ri(oa),blockTime:ro(ri(rn())),version:ro(ou)}
8))),ov=nn(rh({blockhash:ra(),lastValidBlockHeight:rn()})),ok=nn(rt()),ox=ni(e7(rh({slot:rn(),numTransactions:rn(),numSlots:rn(),samplePeriodSecs:rn()}))),oS=nn(ri(rh({feeCalculator:rh({lamportsPerSignature:rn()})}))),oM=ni(ra()),oE=ni(ra()),o_=rh({err:np,logs:e7(ra()),signature:ra()}),oI=rh({result:no(o_),subscription:rn()}),oA={"solana-client":"js/1.0.0-maintenance"};class oB{constructor(t){this._keypair=void 0,this._keypair=t??r3()}static generate(){return new oB(r3())}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 oB({publicKey:r,secretKey:t})}static fromSeed(t){let e=r6(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),new oB({publicKey:e,secretKey:r})}get publicKey(){return new ir(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}let oR=Object.freeze({CreateLookupTable:{index:0,layout:ej.struct([ej.u32("instruction"),iH("recentSlot"),ej.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:ej.struct([ej.u32("instruction")])},ExtendLookupTable:{index:2,layout:ej.struct([ej.u32("instruction"),iH(),ej.seq(ih(),ej.offset(ej.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:ej.struct([ej.u32("instruction")])},CloseLookupTable:{index:4,layout:ej.struct([ej.u32("instruction")])}});class oP{static createLookupTable(t){let[e,r]=ir.findProgramAddressSync([t.authority.toBuffer(),eJ().encode(t.recentSlot)],this.programId),i=iW(oR.CreateLookupTable,{recentSlot:BigInt(t.recentSlot),bumpSeed:r}),n=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:iG.programId,isSigner:!1,isWritable:!1}];return[new iM({programId:this.programId,keys:n,data:i}),e]}static freezeLookupTable(t){let e=iW(oR.FreezeLookupTable),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new iM({programId:this.programId,keys:r,data:e})}static extendLookupTable(t){let e=iW(oR.ExtendLookupTable,{addresses:t.addresses.map(t=>t.toBytes())}),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return t.payer&&r.push({pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:iG.programId,isSigner:!1,isWritable:!1}),new iM({programId:this.programId,keys:r,data:e})}static deactivateLookupTable(t){let e=iW(oR.DeactivateLookupTable),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new iM({programId:this.programId,keys:r,data:e})}static closeLookupTable(t){let e=iW(oR.CloseLookupTable),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.recipient,isSigner:!1,isWritable:!0}];return new iM({programId:this.programId,keys:r,data:e})}}oP.programId=new ir("AddressLookupTab1e1111111111111111111111111");let oT=Object.freeze({RequestUnits:{index:0,layout:ej.struct([ej.u8("instruction"),ej.u32("units"),ej.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:ej.struct([ej.u8("instruction"),ej.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:ej.struct([ej.u8("instruction"),ej.u32("units")])},SetComputeUnitPrice:{index:3,layout:ej.struct([ej.u8("instruction"),iH("microLamports")])}});class oO{static requestUnits(t){let e=iW(oT.RequestUnits,t);return new iM({keys:[],programId:this.programId,data:e})}static requestHeapFrame(t){let e=iW(oT.RequestHeapFrame,t);return new iM({keys:[],programId:this.programId,data:e})}static setComputeUnitLimit(t){let e=iW(oT.SetComputeUnitLimit,t);return new iM({keys:[],programId:this.programId,data:e})}static setComputeUnitPrice(t){let e=iW(oT.SetComputeUnitPrice,{microLamports:BigInt(t.microLamports)});return new iM({keys:[],programId:this.programId,data:e})}}oO.programId=new ir("ComputeBudget111111111111111111111111111111");let oL=ej.struct([ej.u8("numSignatures"),ej.u8("padding"),ej.u16("signatureOffset"),ej.u16("signatureInstructionIndex"),ej.u16("publicKeyOffset"),ej.u16("publicKeyInstructionIndex"),ej.u16("messageDataOffset"),ej.u16("messageDataSize"),ej.u16("messageInstructionIndex")]
vendor: 8,875 bytes, line 8
8);class oC{static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:i,instructionIndex:n}=t;ip(32===e.length,`Public Key must be 32 bytes but received ${e.length} bytes`),ip(64===i.length,`Signature must be 64 bytes but received ${i.length} bytes`);let o=oL.span,s=o+e.length,a=s+i.length,u=h.Buffer.alloc(a+r.length),l=null==n?65535:n;return oL.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:l,publicKeyOffset:o,publicKeyInstructionIndex:l,messageDataOffset:a,messageDataSize:r.length,messageInstructionIndex:l},u),u.fill(e,o),u.fill(i,s),u.fill(r,a),new iM({keys:[],programId:oC.programId,data:u})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:i}=t;ip(64===e.length,`Private key must be 64 bytes but received ${e.length} bytes`);try{let t=oB.fromSecretKey(e),n=t.publicKey.toBytes(),o=r5(r,t.secretKey);return this.createInstructionWithPublicKey({publicKey:n,message:r,signature:o,instructionIndex:i})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}oC.programId=new ir("Ed25519SigVerify111111111111111111111111111"),rQ.utils.isValidPrivateKey;let oU=rQ.getPublicKey,oN=ej.struct([ej.u8("numSignatures"),ej.u16("signatureOffset"),ej.u8("signatureInstructionIndex"),ej.u16("ethAddressOffset"),ej.u8("ethAddressInstructionIndex"),ej.u16("messageDataOffset"),ej.u16("messageDataSize"),ej.u8("messageInstructionIndex"),ej.blob(20,"ethAddress"),ej.blob(64,"signature"),ej.u8("recoveryId")]);class oz{static publicKeyToEthAddress(t){ip(64===t.length,`Public key must be 64 bytes but received ${t.length} bytes`);try{return h.Buffer.from(rO(r9(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 oz.createInstructionWithEthAddress({ethAddress:oz.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;ip(20===(e="string"==typeof r?r.startsWith("0x")?h.Buffer.from(r.substr(2),"hex"):h.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,l=h.Buffer.alloc(oN.span+i.length);return oN.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:s,ethAddressOffset:12,ethAddressInstructionIndex:s,messageDataOffset:u,messageDataSize:i.length,messageInstructionIndex:s,signature:r9(n),ethAddress:r9(e),recoveryId:o},l),l.fill(r9(i),oN.span),new iM({keys:[],programId:oz.programId,data:l})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:i}=t;ip(32===e.length,`Private key must be 32 bytes but received ${e.length} bytes`);try{var n;let t,o=r9(e),s=oU(o,!1).slice(1),[a,u]=(n=h.Buffer.from(rO(r9(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}`)}}}oz.programId=new ir("KeccakSecp256k11111111111111111111111111111");let oq=new ir("StakeConfig11111111111111111111111111111111");class oK{constructor(t,e){this.staker=void 0,this.withdrawer=void 0,this.staker=t,this.withdrawer=e}}class oW{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}}oW.default=new oW(0,0,ir.default);let oF=Object.freeze({Initialize:{index:0,layout:ej.struct([ej.u32("instruction"),((t="authorized")=>ej.struct([ih("staker"),ih("withdrawer")],t))(),((t="lockup")=>ej.struct([ej.ns64("unixTimestamp"),ej.ns64("epoch"),ih("custodian")],t))()])},Authorize:{index:1,layout:ej.struct([ej.u32("instruction"),ih("newAuthorized"),ej.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:ej.struct([ej.u32("instruction")])},Split:{index:3,layout:ej.struct([ej.u32("instruction"),ej.ns64("lamports")])},Withdraw:{index:4,layout:ej.struct([ej.u32("instruction"),ej.ns64("lamports")])},Deactivate:{index:5,layout:ej.struct([ej.u32("instruction")])},Merge:{index:7,layout:ej.struct([ej.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:ej.struct([ej.u32("instruction"),ih("newAuthorized"),ej.u32("stakeAuthorizationType"),il("authoritySeed"),ih("authorityOwner")])}}),oD=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class oV{static initialize(t){let{stakePubkey:e,authorized:r,lockup:i}=t,n=i||oW.default,o=iW(oF.Initialize,{authorized:{staker:r9(r.staker.toBuffer()),withdrawer:r9(r.withdrawer.toBuffer())},lockup:{unixTimestamp:n.unixTimestamp,epoch:n.epoch,custodian:r9(n.custodian.toBuffer())}});return new iM({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:iT,isSigner:!1,isWritable:!1}],programId:this.programId,data:o})}static createAccountWithSeed(t){let e=new iE;e.add(iG.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(iG.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=iW(oF.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:iU,isSigner:!1,isWritable:!1},{pubkey:oq,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=iW(oF.Authorize,{newAuthorized:r9(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=iW(oF.AuthorizeWithSeed,{newAuthorized:r9(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:i,authorityOwner:r9(n.toBuffer())}),h=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:iA,isSigner:!1,isWritable:!1}];return a&&h.push({pubkey:a,isSigner:!0,isWritable:!1}),new iE().add({keys:h,programId:this.programId,data:u})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:r,splitStakePubkey:i,lamports:n}=t,o=iW(oF.Split,{lamports:n});return new iM({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(iG.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(iG.allocate({accountPubkey:n,basePubkey:o,seed:s,space:this.space,programId:this.programId})),e&&e>0&&u.add(iG.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=iW(oF.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:iU,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=iW(oF.Withdraw,{lamports:n}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:iU,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=iW(oF.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})}}oV.programId=new ir("Stake11111111111111111111111111111111111111"),oV.space=2
800;class oj{constructor(t,e,r,i){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=t,this.authorizedVoter=e,this.authorizedWithdrawer=r,this.commission=i}}let o$=Object.freeze({InitializeAccount:{index:0,layout:ej.struct([ej.u32("instruction"),((t="voteInit")=>ej.struct([ih("nodePubkey"),ih("authorizedVoter"),ih("authorizedWithdrawer"),ej.u8("commission")],t))()])},Authorize:{index:1,layout:ej.struct([ej.u32("instruction"),ih("newAuthorized"),ej.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:ej.struct([ej.u32("instruction"),ej.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:ej.struct([ej.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:ej.struct([ej.u32("instruction"),((t="voteAuthorizeWithSeedArgs")=>ej.struct([ej.u32("voteAuthorizationType"),ih("currentAuthorityDerivedKeyOwnerPubkey"),il("currentAuthorityDerivedKeySeed"),ih("newAuthorized")],t))()])}}),oH=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class oZ{static initializeAccount(t){let{votePubkey:e,nodePubkey:r,voteInit:i}=t,n=iW(o$.InitializeAccount,{voteInit:{nodePubkey:r9(i.nodePubkey.toBuffer()),authorizedVoter:r9(i.authorizedVoter.toBuffer()),authorizedWithdrawer:r9(i.authorizedWithdrawer.toBuffer()),commission:i.commission}});return new iM({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:iT,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(iG.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=iW(o$.Authorize,{newAuthorized:r9(i.toBuffer()),voteAuthorizationType:n.index}),s=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new iE().add({keys:s,programId:this.programId,data:o})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:i,newAuthorizedPubkey:n,voteAuthorizationType:o,votePubkey:s}=t,a=iW(o$.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:r9(r.toBuffer()),currentAuthorityDerivedKeySeed:i,newAuthorized:r9(n.toBuffer()),voteAuthorizationType:o.index}}),u=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}];return new iE().add({keys:u,programId:this.programId,data:a})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,lamports:i,toPubkey:n}=t,o=iW(o$.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 oZ.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,nodePubkey:i}=t,n=iW(o$.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})}}oZ.programId=new ir("Vote111111111111111111111111111111111111111"),oZ.space=3762;let oG=new ir("Va1idator1nfo111111111111111111111111111111"),oY=rh({name:ra(),website:ro(ra()),details:ro(ra()),iconUrl:ro(ra()),keybaseUsername:ro(ra())});class oJ{constructor(t,e){this.key=void 0,this.info=void 0,this.key=t,this.info=e}static fromConfigData(t){let e=[...t];if(2!==ic(e))return null;let r=[];for(let t=0;t<2;t++){let t=new ir(ib(e,0,32)),i=1===iy(e);r.push({publicKey:t,isSigner:i})}if(r[0].publicKey.equals(oG)&&r[1].isSigner){let t=JSON.parse(il().decode(h.Buffer.from(e)));return e8(t,oY),new oJ(r[1].publicKey,t)}return null}}let oX=new ir("Vote111111111111111111111111111111111111111"),oQ=ej.struct([ih("nodePubkey"),ih("authorizedWithdrawer"),ej.u8("commission"),ej.nu64(),ej.seq(ej.struct([ej.nu64("slot"),ej.u32("confirmationCount")]),ej.offset(ej.u32(),-8),"votes"),ej.u8("rootSlotValid"),ej.nu64("rootSlot"),ej.nu64(),ej.seq(ej.struct([ej.nu64("epoch"),ih("authorizedVoter")]),ej.offset(ej.u32(),-8),"authorizedVoters"),ej.struct([ej.seq(ej.struct([ih("authorizedPubkey"),ej.nu64("epochOfLastAuthorizedSwitch"),ej.nu64("targetEpoch")]),32,"buf"),ej.nu64("idx"),ej.u8("isEmpty")],"priorVoters"),ej.nu64(),ej.seq(ej.struct([ej.nu64("epoch"),ej.nu64("credits"),ej.nu64("prevCredits")]),ej.offset(ej.u32(),-8),"epochCredits"),ej.struct([ej.nu64("slot"),ej.nu64("timestamp")],"lastTimestamp")]);class o0{constructor(t){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=t.nodePubkey,this.authorizedWithdrawer=t.authorizedWithdrawer,this.commission=t.commission,this.rootSlot=t.rootSlot,this.votes=t.votes,this.authorizedVoters=t.authorizedVoters,this.priorVoters=t.priorVoters,this.epochCredits=t.epochCredits,this.lastTimestamp=t.lastTimestamp}static fromAccountData(t){let e=oQ.decode(r9(t),4),r=e.rootSlot;return e.rootSlotValid||(r=null),new o0({nodePubkey:new ir(e.nodePubkey),authorizedWithdrawer:new ir(e.authorizedWithdrawer),commission:e.commission,votes:e.votes,rootSlot:r,authorizedVoters:e.authorizedVoters.map(o1),priorVoters:function({buf:t,idx:e,isEmpty:r}){return r?[]:[...t.slice(e+1).map(o2),...t.slice(0,e).map(o2)]}(e.priorVoters),epochCredits:e.epochCredits,lastTimestamp:e.lastTimestamp})}}function o1({authorizedVoter:t,epoch:e}){return{epoch:e,authorizedVoter:new ir(t)}}function o2({authorizedPubkey:t,epochOfLastAuthorizedSwitch:e,targetEpoch:r}){return{authorizedPubkey:new ir(t),epochOfLastAuthorizedSwitch:e,targetEpoch:r}}let o3={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};async function o6(t,e,r,i){let n,o;r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")||r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(n=r,o=i):o=r;let s=o&&{skipPreflight:o.skipPreflight,preflightCommitment:o.preflightCommitment||o.commitment,minContextSlot:o.minContextSlot},a=await t.sendRawTransaction(e,s),u=o&&o.commitment,h=n?t.confirmTransaction(n,u):t.confirmTransaction(a,u),l=(await h).value;if(l.err){if(null!=a)throw new iN({action:s?.skipPreflight?"send":"simulate",signature:a,transactionMessage:`Status: (${JSON.stringify(l)})`});throw Error(`Raw transaction ${a} failed (${JSON.stringify(l)})`)}return a}t.s(["Account",0,class{constructor(t){if(this._publicKey=void 0,this._secretKey=void 0,t){const e=r9(t);if(64!==t.length)throw Error("bad secret key size");this._publicKey=e.slice(32,64),this._secretKey=e.slice(0,32)}else this._secretKey=r9(r2()),this._publicKey=r9(r6(this._secretKey))}get publicKey(){return new ir(this._publicKey)}get secretKey(){return h.Buffer.concat([this._secretKey,this._publicKey],64)}},"AddressLookupTableAccount",0,i3,"AddressLookupTableInstruction",0,class{static decodeInstructionType(t){let e;this.checkProgramId(t.programId);let r=ej.u32("instruction").decode(t.data);for(let[t,i]of Object.entries(oR))if(i.index==r){e=t;break}if(!e)throw Error("Invalid Instruction. Should be a LookupTable Instruction");return e}static decodeCreateLookupTable(t){this.checkProgramId(t.programId),this.checkKeysLength(t.keys,4);let{recentSlot:e}=iF(oR.CreateLookupTable,t.data);return{authority:t.keys[1].pubkey,payer:t.keys[2].pubkey,recentSlot:Number(e)}}static decodeExtendLookupTable(t){if(this.checkProgramId(t.programId),t.keys.length<2)throw Error(`invalid instruction; found ${t.keys.length} keys, expected at least 2`);let{addresses:e}=iF(oR.ExtendLookupTable,t.data);return{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey,payer:t.keys.length>2?t.keys[2].pubkey:void 0,addresses:e.map(t=>new ir(t))}}static decodeCloseLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,3),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey,recipient:t.keys[2].pubkey}}static decodeFreezeLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,2),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey}}static decodeDeactivateLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,2),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey}}static checkProgramId(t){if(!t.equals(oP.programId))throw Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(t,e){if(t.length<e)throw Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}},"AddressLookupTableProgram",0,oP,"Authorized",0,oK,"BLOCKHASH_CACHE_TIMEOUT_MS",0,3e4,"BPF_LOADER_DEPRECATED_PROGRAM_ID",0,ii,"BPF_LOADER_PROGRAM_ID",0,iJ,"BpfLoader",0,class{static getMinNumSignatures(t){return iY.getMinNumSignatures(t)}static load(t,e,r,i,n){return iY.load(t,e,r,n,i)}},"COMPUTE_BUDGET_INSTRUCTION_LAYOUTS",0,oT,"ComputeBudgetInstruction",0,class{static decodeInstructionType(t){let e;this.checkProgramId(t.programId);let r=ej.u8("instruction").decode(t.data);for(let[t,i]of Object.entries(oT))if(i.index==r){e=t;break}if(!e)throw Error("Instruction type incorrect; not a ComputeBudgetInstruction");return e}static decodeRequestUnits(t){this.checkProgramId(t.programId);let{units:e,additionalFee:r}=iF(oT.RequestUnits,t.data);return{units:e,additionalFee:r}}static decodeRequestHeapFrame(t){this.checkProgramId(t.programId);let{bytes:e}=iF(oT.RequestHeapFrame,t.data);return{bytes:e}}static decodeSetComputeUnitLimit(t){this.checkProgramId(t.programId);let{units:e}=iF(oT.SetComputeUnitLimit,t.data);return{units:e}}static decodeSetComputeUnitPrice(t){this.checkProgramId(t.programId);let{microLamports:e}=iF(oT.SetComputeUnitPrice,t.data);return{microLamports:e}}static checkProgramId(t){if(!t.equals(oO.programId))throw Error("invalid instruction; programId is not ComputeBudgetProgram")}},"ComputeBudgetProgram",0,oO,"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={}
vendor: 37,642 bytes, line 8
8,this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{let t={};return async e=>{let{commitment:r,config:i}=i7(e),n=this._buildArgs([],r,void 0,i),o=iX(n);return t[o]=t[o]??(async()=>{try{let t=await this._rpcRequest("getBlockHeight",n),e=e5(t,ni(rn()));if("error"in e)throw new iz(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(i8);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||i1;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 rd.default(async(r,i)=>{let o={method:"POST",body:r,agent:s,headers:Object.assign({"Content-Type":"application/json"},e||{},oA)};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 iK(s),s*=2}let h=await e.text();e.ok?i(null,h):i(Error(`${e.status} ${e.statusText}: ${h}`))}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 i2(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}=i7(e),n=this._buildArgs([t.toBase58()],r,void 0,i),o=e5(await this._rpcRequest("getBalance",n),nn(rn()));if("error"in o)throw new iz(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=e5(await this._rpcRequest("getBlockTime",[t]),ni(ri(rn())));if("error"in e)throw new iz(e.error,`failed to get block time for slot ${t}`);return e.result}async getMinimumLedgerSlot(){let t=e5(await this._rpcRequest("minimumLedgerSlot",[]),ni(rn()));if("error"in t)throw new iz(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){let t=e5(await this._rpcRequest("getFirstAvailableBlock",[]),nA);if("error"in t)throw new iz(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=e5(await this._rpcRequest("getSupply",[e]),nB);if("error"in r)throw new iz(r.error,"failed to get supply");return r.result}async getTokenSupply(t,e){let r=this._buildArgs([t.toBase58()],e),i=e5(await this._rpcRequest("getTokenSupply",r),nn(nR));if("error"in i)throw new iz(i.error,"failed to get token supply");return i.result}async getTokenAccountBalance(t,e){let r=this._buildArgs([t.toBase58()],e),i=e5(await this._rpcRequest("getTokenAccountBalance",r),nn(nR));if("error"in i)throw new iz(i.error,"failed to get token account balance");return i.result}async getTokenAccountsByOwner(t,e,r){let{commitment:i,config:n}=i7(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=e5(await this._rpcRequest("getTokenAccountsByOwner",s),nT);if("error"in a)throw new iz(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=e5(await this._rpcRequest("getTokenAccountsByOwner",n),nL);if("error"in o)throw new iz(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=e5(await this._rpcRequest("getLargestAccounts",r),nC);if("error"in i)throw new iz(i.error,"failed to get largest accounts");return i.result}async getTokenLargestAccounts(t,e){let r=this._buildArgs([t.toBase58()],e),i=e5(await this._rpcRequest("getTokenLargestAccounts",r),nP);if("error"in i)throw new iz(i.error,"failed to get token largest accounts");return i.result}async getAccountInfoAndContext(t,e){let{commitment:r,config:i}=i7(e),n=this._buildArgs([t.toBase58()],r,"base64",i),o=e5(await this._rpcRequest("getAccountInfo",n),nn(ri(nU)));if("error"in o)throw new iz(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getParsedAccountInfo(t,e){let{commitment:r,config:i}=i7(e),n=this._buildArgs([t.toBase58()],r,"jsonParsed",i),o=e5(await this._rpcRequest("getAccountInfo",n),nn(ri(nq)));if("error"in o)throw new iz(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}=i7(e),n=t.map(t=>t.toBase58()),o=this._buildArgs([n],r,"jsonParsed",i),s=e5(await this._rpcRequest("getMultipleAccounts",o),nn(e7(ri(nq))));if("error"in s)throw new iz(s.error,`failed to get info for accounts ${n}`);return s.result}async getMultipleAccountsInfoAndContext(t,e){let{commitment:r,config:i}=i7(e),n=t.map(t=>t.toBase58()),o=this._buildArgs([n],r,"base64",i),s=e5(await this._rpcRequest("getMultipleAccounts",o),nn(e7(ri(nU))));if("error"in s)throw new iz(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}=i7(e),o=this._buildArgs([t.toBase58()],i,void 0,{...n,epoch:null!=r?r:n?.epoch}),s=e5(await this._rpcRequest("getStakeActivation",o),ni(nW));if("error"in s)throw new iz(s.error,`failed to get Stake Activation ${t.toBase58()}`);return s.result}async getProgramAccounts(t,e){let{commitment:r,config:i}=i7(e),{encoding:n,...o}=i||{},s=this._buildArgs([t.toBase58()],r,n||"base64",{...o,...o.filters?{filters:nt(o.filters)}:null}),a=await this._rpcRequest("getProgramAccounts",s),u=e7(nN),h=!0===o.withContext?e5(a,nn(u)):e5(a,ni(u));if("error"in h)throw new iz(h.error,`failed to get accounts owned by program ${t.toBase58()}`);return h.result}async getParsedProgramAccounts(t,e){let{commitment:r,config:i}=i7(e),n=this._buildArgs([t.toBase58()],r,"jsonParsed",i),o=e5(await this._rpcRequest("getProgramAccounts",n),ni(e7(nK)));if("error"in o)throw new iz(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=eD.default.decode(r)}catch(t){throw Error("signature must be base58 encoded: "+r)}return(ip(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:ix.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:ix.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 iK(1e3),o||(t=await i(),o))return;e({__type:ix.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:t,signature:i}),h=this.getCancellationPromise(e);try{let t=await Promise.race([h,u,s]);if(t.__type===ix.PROCESSED)n=t.response;else throw new io(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:ix.NONCE_INVALID,slotInWhichNonceDidAdvance:s});if(await iK(2e3),a||(o=await u(),a))return}})()}),{abortConfirmation:h,confirmationPromise:l}=this.getTransactionConfirmationPromise({commitment:t,signature:o}),c=this.getCancellationPromise(e);try{let e=await Promise.race([c,l,u]);if(e.__type===ix.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 iK(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 ia(o);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==r&&"finalized"!==r)throw new ia(o);break;case"finalized":case"max":case"root":if("finalized"!==r)throw new ia(o)}s={context:i.context,value:{err:i.value.err}}}else throw new ia(o)}}finally{a=!0,h()}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:ix.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===ix.PROCESSED)i=t.response;else throw new is(e,t.timeoutMs/1e3)}finally{clearTimeout(r),o()}return i}async getClusterNodes(){let t=e5(await this._rpcRequest("getClusterNodes",[]),ni(e7(nQ)));if("error"in t)throw new iz(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(t){let e=this._buildArgs([],t),r=e5(await this._rpcRequest("getVoteAccounts",e),n1);if("error"in r)throw new iz(r.error,"failed to get vote accounts");return r.result}async getSlot(t){let{commitment:e,config:r}=i7(t),i=this._buildArgs([],e,void 0,r),n=e5(await this._rpcRequest("getSlot",i),ni(rn()));if("error"in n)throw new iz(n.error,"failed to get slot");return n.result}async getSlotLeader(t){let{commitment:e,config:r}=i7(t),i=this._buildArgs([],e,void 0,r),n=e5(await this._rpcRequest("getSlotLeader",i),ni(ra()));if("error"in n)throw new iz(n.error,"failed to get slot leader");return n.result}async getSlotLeaders(t,e){let r=e5(await this._rpcRequest("getSlotLeaders",[t,e]),ni(e7(i5)));if("error"in r)throw new iz(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 ip(1===i.length),{context:r,value:i[0]}}async getSignatureStatuses(t,e){let r=[t];e&&r.push(e);let i=e5(await this._rpcRequest("getSignatureStatuses",r),n6);if("error"in i)throw new iz(i.error,"failed to get signature status");return i.result}async getTransactionCount(t){let{commitment:e,config:r}=i7(t),i=this._buildArgs([],e,void 0,r),n=e5(await this._rpcRequest("getTransactionCount",i),ni(rn()));if("error"in n)throw new iz(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=e5(await this._rpcRequest("getInflationGovernor",e),nx);if("error"in r)throw new iz(r.error,"failed to get inflation");return r.result}async getInflationReward(t,e,r){let{commitment:i,config:n}=i7(r),o=this._buildArgs([t.map(t=>t.toBase58())],i,void 0,{...n,epoch:null!=e?e:n?.epoch}),s=e5(await this._rpcRequest("getInflationReward",o),nu);if("error"in s)throw new iz(s.error,"failed to get inflation reward");return s.result}async getInflationRate(){let t=e5(await this._rpcRequest("getInflationRate",[]),nS);if("error"in t)throw new iz(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(t){let{commitment:e,config:r}=i7(t),i=this._buildArgs([],e,void 0,r),n=e5(await this._rpcRequest("getEpochInfo",i),nE);if("error"in n)throw new iz(n.error,"failed to get epoch info");return n.result}async getEpochSchedule(){let t=e5(await this._rpcRequest("getEpochSchedule",[]),n_);if("error"in t)throw new iz(t.error,"failed to get epoch schedule");let e=t.result;return new i0(e.slotsPerEpoch,e.leaderScheduleSlotOffset,e.warmup,e.firstNormalEpoch,e.firstNormalSlot)}async getLeaderSchedule(){let t=e5(await this._rpcRequest("getLeaderSchedule",[]),nI);if("error"in t)throw new iz(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(t,e){let r=this._buildArgs([t],e),i=e5(await this._rpcRequest("getMinimumBalanceForRentExemption",r),n8);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=e5(await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),ox);if("error"in e)throw new iz(e.error,"failed to get recent performance samples");return e.result}async getFeeCalculatorForBlockhash(t,e){let r=this._buildArgs([t],e),i=e5(await this._rpcRequest("getFeeCalculatorForBlockhash",r),oS);if("error"in i)throw new iz(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=r9(t.serialize()).toString("base64"),i=this._buildArgs([r],e),n=e5(await this._rpcRequest("getFeeForMessage",i),nn(ri(rn())));if("error"in n)throw new iz(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=e5(await this._rpcRequest("getRecentPrioritizationFees",r),nM);if("error"in i)throw new iz(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}=i7(t),i=this._buildArgs([],e,void 0,r),n=e5(await this._rpcRequest("getLatestBlockhash",i),ov);if("error"in n)throw new iz(n.error,"failed to get latest blockhash");return n.result}async isBlockhashValid(t,e){let{commitment:r,config:i}=i7(e),n=this._buildArgs([t],r,void 0,i),o=e5(await this._rpcRequest("isBlockhashValid",n),ok);if("error"in o)throw new iz(o.error,"failed to determine if the blockhash `"+t+"`is valid");return o.result}async getVersion(){let t=e5(await this._rpcRequest("getVersion",[]),ni(ny));if("error"in t)throw new iz(t.error,"failed to get version");return t.result}async getGenesisHash(){let t=e5(await this._rpcRequest("getGenesisHash",[]),ni(ra()));if("error"in t)throw new iz(t.error,"failed to get genesis hash");return t.result}async getBlock(t,e){let{commitment:r,config:i}=i7(e),n=this._buildArgsAtLeastConfirmed([t],r,void 0,i),o=await this._rpcRequest("getBlock",n);try{switch(i?.transactionDetails){case"accounts":{let t=e5(o,of);if("error"in t)throw t.error;return t.result}case"none":{let t=e5(o,oc);if("error"in t)throw t.error;return t.result}default:{let t=e5(o,ol);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:ns(r,t.message)},version:r}))}:null}}}catch(t){throw new iz(t,"failed to get confirmed block")}}async getParsedBlock(t,e){let{commitment:r,config:i}=i7(e),n=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i),o=await this._rpcRequest("getBlock",n);try{switch(i?.transactionDetails){case"accounts":{let t=e5(o,op);if("error"in t)throw t.error;return t.result}case"none":{let t=e5(o,om);if("error"in t)throw t.error;return t.result}default:{let t=e5(o,od);if("error"in t)throw t.error;return t.result}}}catch(t){throw new iz(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=e5(await this._rpcRequest("getBlockProduction",i),nk);if("error"in n)throw new iz(n.error,"failed to get block production information");return n.result}async getTransaction(t,e){let{commitment:r,config:i}=i7(e),n=this._buildArgsAtLeastConfirmed([t],r,void 0,i),o=e5(await this._rpcRequest("getTransaction",n),ob);if("error"in o)throw new iz(o.error,"failed to get transaction");let s=o.result;return s?{...s,transaction:{...s.transaction,message:ns(s.version,s.transaction.message)}}:s}async getParsedTransaction(t,e){let{commitment:r,config:i}=i7(e),n=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i),o=e5(await this._rpcRequest("getTransaction",n),ow);if("error"in o)throw new iz(o.error,"failed to get transaction");return o.result}async getParsedTransactions(t,e){let{commitment:r,config:i}=i7(e),n=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i)}));return(await this._rpcBatchRequest(n)).map(t=>{let e=e5(t,ow);if("error"in e)throw new iz(e.error,"failed to get transactions");return e.result})}async getTransactions(t,e){let{commitment:r,config:i}=i7(e),n=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,void 0,i)}));return(await this._rpcBatchRequest(n)).map(t=>{let e=e5(t,ob);if("error"in e)throw new iz(e.error,"failed to get transactions");let r=e.result;return r?{...r,transaction:{...r.transaction,message:ns(r.version,r.transaction.message)}}:r})}async getConfirmedBlock(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),i=e5(await this._rpcRequest("getBlock",r),og);if("error"in i)throw new iz(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 iw(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=e5(await this._rpcRequest("getBlocks",i),ni(e7(rn())));if("error"in n)throw new iz(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=e5(await this._rpcRequest("getBlock",r),oy);if("error"in i)throw new iz(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=e5(await this._rpcRequest("getBlock",r),oy);if("error"in i)throw new iz(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=e5(await this._rpcRequest("getTransaction",r),ob);if("error"in i)throw new iz(i.error,"failed to get transaction");let n=i.result;if(!n)return n;let o=new iw(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=e5(await this._rpcRequest("getTransaction",r),ow);if("error"in i)throw new iz(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=e5(t,ow);if("error"in e)throw new iz(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=e5(await this._rpcRequest("getConfirmedSignaturesForAddress2",i),nF);if("error"in n)throw new iz(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=e5(await this._rpcRequest("getSignaturesForAddress",i),nD);if("error"in n)throw new iz(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 i3({key:t,state:i3.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=i$.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=e5(await this._rpcRequest("requestAirdrop",[t.toBase58(),e]),oM);if("error"in r)throw new iz(r.error,`airdrop to ${t.toBase58()} failed`);return r.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await iK(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 iK(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}=i7(t),i=this._buildArgs([],e,"base64",r),n=e5(await this._rpcRequest("getStakeMinimumDelegation",i),nn(rn()));if("error"in n)throw new iz(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=h.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=e5(await this._rpcRequest("simulateTransaction",s),nv);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],l=e5(await this._rpcRequest("simulateTransaction",u),nv);if("error"in l){let t;if("data"in l.error&&(t=l.error.data.logs)&&Array.isArray(t)){let e="\n ",r=e+t.join(e);console.error(l.error.message,r)}throw new iN({action:"simulate",signature:"",transactionMessage:l.error.message,logs:t})}return l.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=r9(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=e5(await this._rpcRequest("sendTransaction",o),oE);if("error"in s){let t;throw"data"in s.error&&(t=s.error.data.logs),new iN({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}=e5(t,nV);this._handleServerNotification(r,[e.value,e.context])}_makeSubscription(t,e){let r=this._nextClientSubscriptionId++,i=iX([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];ip(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}=i7(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}=e5(t,n$);this._handleServerNotification(r,[{accountId:e.value.pubkey,accountInfo:e.value.account},e.context])}onProgramAccountChange(t,e,r,i){let{commitment:n,config:o}=i7(r),s=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64",o||(i?{filters:nt(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}=e5(t,oI);this._handleServerNotification(r,[e.value,e.context])}_wsOnSlotNotification(t){let{result:e,subscription:r}=e5(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}=e5(t,nY);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}=e5(t,nJ);"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}
8onSignatureWithOptions(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}=e5(t,nX);this._handleServerNotification(r,[e])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}},"Ed25519Program",0,oC,"Enum",0,class extends r7{constructor(t){if(super(t),this.enum="",1!==Object.keys(t).length)throw Error("Enum can only take single value");Object.keys(t).map(t=>{this.enum=t})}},"EpochSchedule",0,i0,"FeeCalculatorLayout",0,iD,"Keypair",0,oB,"LAMPORTS_PER_SOL",0,1e9,"LOOKUP_TABLE_INSTRUCTION_LAYOUTS",0,oR,"Loader",0,iY,"Lockup",0,oW,"MAX_SEED_LENGTH",0,32,"Message",0,iw,"MessageAccountKeys",0,iu,"MessageV0",0,iv,"NONCE_ACCOUNT_LENGTH",0,ij,"NonceAccount",0,i$,"PACKET_DATA_SIZE",0,1232,"PUBLIC_KEY_LENGTH",0,32,"PublicKey",0,ir,"SIGNATURE_LENGTH_IN_BYTES",0,64,"SOLANA_SCHEMA",0,it,"STAKE_CONFIG_ID",0,oq,"STAKE_INSTRUCTION_LAYOUTS",0,oF,"SYSTEM_INSTRUCTION_LAYOUTS",0,iZ,"SYSVAR_CLOCK_PUBKEY",0,iA,"SYSVAR_EPOCH_SCHEDULE_PUBKEY",0,iB,"SYSVAR_INSTRUCTIONS_PUBKEY",0,iR,"SYSVAR_RECENT_BLOCKHASHES_PUBKEY",0,iP,"SYSVAR_RENT_PUBKEY",0,iT,"SYSVAR_REWARDS_PUBKEY",0,iO,"SYSVAR_SLOT_HASHES_PUBKEY",0,iL,"SYSVAR_SLOT_HISTORY_PUBKEY",0,iC,"SYSVAR_STAKE_HISTORY_PUBKEY",0,iU,"Secp256k1Program",0,oz,"SendTransactionError",0,iN,"SolanaJSONRPCError",0,iz,"SolanaJSONRPCErrorCode",0,{JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016},"StakeAuthorizationLayout",0,oD,"StakeInstruction",0,class{static decodeInstructionType(t){let e;this.checkProgramId(t.programId);let r=ej.u32("instruction").decode(t.data);for(let[t,i]of Object.entries(oF))if(i.index==r){e=t;break}if(!e)throw Error("Instruction type incorrect; not a StakeInstruction");return e}static decodeInitialize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{authorized:e,lockup:r}=iF(oF.Initialize,t.data);return{stakePubkey:t.keys[0].pubkey,authorized:new oK(new ir(e.staker),new ir(e.withdrawer)),lockup:new oW(r.unixTimestamp,r.epoch,new ir(r.custodian))}}static decodeDelegate(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,6),iF(oF.Delegate,t.data),{stakePubkey:t.keys[0].pubkey,votePubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[5].pubkey}}static decodeAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{newAuthorized:e,stakeAuthorizationType:r}=iF(oF.Authorize,t.data),i={stakePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey,newAuthorizedPubkey:new ir(e),stakeAuthorizationType:{index:r}};return t.keys.length>3&&(i.custodianPubkey=t.keys[3].pubkey),i}static decodeAuthorizeWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{newAuthorized:e,stakeAuthorizationType:r,authoritySeed:i,authorityOwner:n}=iF(oF.AuthorizeWithSeed,t.data),o={stakePubkey:t.keys[0].pubkey,authorityBase:t.keys[1].pubkey,authoritySeed:i,authorityOwner:new ir(n),newAuthorizedPubkey:new ir(e),stakeAuthorizationType:{index:r}};return t.keys.length>3&&(o.custodianPubkey=t.keys[3].pubkey),o}static decodeSplit(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{lamports:e}=iF(oF.Split,t.data);return{stakePubkey:t.keys[0].pubkey,splitStakePubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[2].pubkey,lamports:e}}static decodeMerge(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),iF(oF.Merge,t.data),{stakePubkey:t.keys[0].pubkey,sourceStakePubKey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey}}static decodeWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,5);let{lamports:e}=iF(oF.Withdraw,t.data),r={stakePubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey,lamports:e};return t.keys.length>5&&(r.custodianPubkey=t.keys[5].pubkey),r}static decodeDeactivate(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),iF(oF.Deactivate,t.data),{stakePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey}}static checkProgramId(t){if(!t.equals(oV.programId))throw Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(t,e){if(t.length<e)throw Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}},"StakeProgram",0,oV,"Struct",0,r7,"SystemInstruction",0,class{static decodeInstructionType(t){let e;this.checkProgramId(t.programId);let r=ej.u32("instruction").decode(t.data);for(let[t,i]of Object.entries(iZ))if(i.index==r){e=t;break}if(!e)throw Error("Instruction type incorrect; not a SystemInstruction");return e}static decodeCreateAccount(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{lamports:e,space:r,programId:i}=iF(iZ.Create,t.data);return{fromPubkey:t.keys[0].pubkey,newAccountPubkey:t.keys[1].pubkey,lamports:e,space:r,programId:new ir(i)}}static decodeTransfer(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{lamports:e}=iF(iZ.Transfer,t.data);return{fromPubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,lamports:e}}static decodeTransferWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{lamports:e,seed:r,programId:i}=iF(iZ.TransferWithSeed,t.data);return{fromPubkey:t.keys[0].pubkey,basePubkey:t.keys[1].pubkey,toPubkey:t.keys[2].pubkey,lamports:e,seed:r,programId:new ir(i)}}static decodeAllocate(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);let{space:e}=iF(iZ.Allocate,t.data);return{accountPubkey:t.keys[0].pubkey,space:e}}static decodeAllocateWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);let{base:e,seed:r,space:i,programId:n}=iF(iZ.AllocateWithSeed,t.data);return{accountPubkey:t.keys[0].pubkey,basePubkey:new ir(e),seed:r,space:i,programId:new ir(n)}}static decodeAssign(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);let{programId:e}=iF(iZ.Assign,t.data);return{accountPubkey:t.keys[0].pubkey,programId:new ir(e)}}static decodeAssignWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);let{base:e,seed:r,programId:i}=iF(iZ.AssignWithSeed,t.data);return{accountPubkey:t.keys[0].pubkey,basePubkey:new ir(e),seed:r,programId:new ir(i)}}static decodeCreateWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{base:e,seed:r,lamports:i,space:n,programId:o}=iF(iZ.CreateWithSeed,t.data);return{fromPubkey:t.keys[0].pubkey,newAccountPubkey:t.keys[1].pubkey,basePubkey:new ir(e),seed:r,lamports:i,space:n,programId:new ir(o)}}static decodeNonceInitialize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{authorized:e}=iF(iZ.InitializeNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,authorizedPubkey:new ir(e)}}static decodeNonceAdvance(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),iF(iZ.AdvanceNonceAccount,t.data),{noncePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey}}static decodeNonceWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,5);let{lamports:e}=iF(iZ.WithdrawNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey,lamports:e}}static decodeNonceAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{authorized:e}=iF(iZ.AuthorizeNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[1].pubkey,newAuthorizedPubkey:new ir(e)}}static checkProgramId(t){if(!t.equals(iG.programId))throw Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(t,e){if(t.length<e)throw Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}},"SystemProgram",0,iG,"Transaction",0,iE,"TransactionExpiredBlockheightExceededError",0,io,"TransactionExpiredNonceInvalidError",0,ia,"TransactionExpiredTimeoutError",0,is,"TransactionInstruction",0,iM,"TransactionMessage",0,i_,"TransactionStatus",0,ix,"VALIDATOR_INFO_KEY",0,oG,"VERSION_PREFIX_MASK",0,127,"VOTE_PROGRAM_ID",0,oX,"ValidatorInfo",0,oJ,"VersionedMessage",0,ik,"VersionedTransaction",0,iI,"VoteAccount",0,o0,"VoteAuthorizationLayout",0,oH,"VoteInit",0,oj,"VoteInstruction",0,class{static decodeInstructionType(t){let e;this.checkProgramId(t.programId);let r=ej.u32("instruction").decode(t.data);for(let[t,i]of Object.entries(o$))if(i.index==r){e=t;break}if(!e)throw Error("Instruction type incorrect; not a VoteInstruction");return e}static decodeInitializeAccount(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,4);let{voteInit:e}=iF(o$.InitializeAccount,t.data);return{votePubkey:t.keys[0].pubkey,nodePubkey:t.keys[3].pubkey,voteInit:new oj(new ir(e.nodePubkey),new ir(e.authorizedVoter),new ir(e.authorizedWithdrawer),e.commission)}}static decodeAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{newAuthorized:e,voteAuthorizationType:r}=iF(o$.Authorize,t.data);return{votePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey,newAuthorizedPubkey:new ir(e),voteAuthorizationType:{index:r}}}static decodeAuthorizeWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:e,currentAuthorityDerivedKeySeed:r,newAuthorized:i,voteAuthorizationType:n}}=iF(o$.AuthorizeWithSeed,t.data);return{currentAuthorityDerivedKeyBasePubkey:t.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new ir(e),currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:new ir(i),voteAuthorizationType:{index:n},votePubkey:t.keys[0].pubkey}}static decodeWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{lamports:e}=iF(o$.Withdraw,t.data);return{votePubkey:t.keys[0].pubkey,authorizedWithdrawerPubkey:t.keys[2].pubkey,lamports:e,toPubkey:t.keys[1].pubkey}}static checkProgramId(t){if(!t.equals(oZ.programId))throw Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(t,e){if(t.length<e)throw Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}},"VoteProgram",0,oZ,"clusterApiUrl",0,function(t,e){let r=!1===e?"http":"https";if(!t)return o3[r].devnet;let i=o3[r][t];if(!i)throw Error(`Unknown ${r} cluster: ${t}`);return i},"sendAndConfirmRawTransaction",0,o6,"sendAndConfirmTransaction",0,iq],127261)}]); 9 10//# debugId=07336767-34b6-ee21-4fec-0caea479aa47
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.