@onekeyfe/cross-inpage-provider-injected 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see injectedExtension.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,(function(){return(()=>{var e={9378:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},4563:(e,t,r)=>{var n=r(19).Symbol;e.exports=n},2325:(e,t,r)=>{var n=r(4563),i=r(6544),o=r(9252),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},6008:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},9723:(e,t,r)=>{var n=r(1539)(Object.getPrototypeOf,Object);e.exports=n},6544:(e,t,r)=>{var n=r(4563),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var i=s.call(e);return n&&(t?e[a]=r:delete e[a]),i}},9252:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},1539:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},19:(e,t,r)=>{var n=r(6008),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},9906:e=>{var t=Array.isArray;e.exports=t},5920:(e,t,r)=>{var n=r(2325),i=r(6464);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},6464:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},2612:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8395:(e,t,r)=>{var n=r(2325),i=r(9723),o=r(2612),s=Function.prototype,a=Object.prototype,u=s.toString,c=a.hasOwnProperty,h=u.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==h}},2788:(e,t,r)=>{var n=r(2325),i=r(9906),o=r(2612);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==n(e)}},4554:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,u,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&isFinite(e))return s.long?(a=e,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=n?o(a,u,n,"hour"):u>=r?o(a,u,r,"minute"):u>=t?o(a,u,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9439:e=>{e.exports=s,s.default=s,s.stable=h,s.stableStringify=h;var t="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=o()),u(e,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(e,t,r):JSON.stringify(e,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function a(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:e}),n.push([o,r,t,s])):i.push([t,r,e]):(o[r]=e,n.push([o,r,t]))}function u(e,n,i,o,s,c,h){var f;if(c+=1,"object"==typeof e&&null!==e){for(f=0;f<o.length;f++)if(o[f]===e)return void a(r,e,n,s);if(void 0!==h.depthLimit&&c>h.depthLimit)return void a(t,e,n,s);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void a(t,e,n,s);if(o.push(e),Array.isArray(e))for(f=0;f<e.length;f++)u(e[f],f,f,o,e,c,h);else{var d=Object.keys(e);for(f=0;f<d.length;f++){var l=d[f];u(e[l],l,f,o,e,c,h)}}o.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function h(e,t,r,s){void 0===s&&(s=o());var a,u=f(e,"",0,[],void 0,0,s)||e;try{a=0===i.length?JSON.stringify(u,t,r):JSON.stringify(u,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function f(e,i,o,s,u,h,d){var l;if(h+=1,"object"==typeof e&&null!==e){for(l=0;l<s.length;l++)if(s[l]===e)return void a(r,e,i,u);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&h>d.depthLimit)return void a(t,e,i,u);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void a(t,e,i,u);if(s.push(e),Array.isArray(e))for(l=0;l<e.length;l++)f(e[l],l,l,s,e,h,d);else{var p={},y=Object.keys(e).sort(c);for(l=0;l<y.length;l++){var g=y[l];f(e[g],g,l,s,e,h,d),p[g]=e[g]}if(void 0===u)return p;n.push([u,i,e]),u[i]=p}s.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===t&&o[0]===r){r=o[2],i.splice(n,1);break}}return e.call(this,t,r)}}},8298:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=s.length,c=h,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function l(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,h=p(u,c);for(r=0;r<c;++r)n(h[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},o.prototype.listenerCount=l,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),h=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[h++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return l(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return l(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return h(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return V(K(t,e.length-r),e,r,n)}function E(e,t,r,n){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function A(e,t,r,n){return V(G(t),e,r,n)}function S(e,t,r,n){return V(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(J(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),h=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==h[e]){o=c[e],s=h[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function T(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function z(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const q={};function j(e,t,r){q[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new q.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function $(e,t){if("number"!=typeof e)throw new q.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new q.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,h=-7,f=r?i-1:0,d=r?-1:1,l=e[t+f];for(f+=d,o=l&(1<<-h)-1,l>>=-h,h+=a;h>0;o=256*o+e[t+f],f+=d,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+e[t+f],f+=d,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=c}return(l?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,f=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+l]=255&a,l+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+l]=255&s,l+=p,s/=256,c-=8);e[r+l-p]|=128*y}},9926:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=i,t.hash=o,t.exists=s,t.output=a;const u={number:r,bool:n,bytes:i,hash:o,exists:s,output:a};t.default=u},5827:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(9926),i=r(5658);class o extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){n.default.exists(this);const{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){const a=Math.min(o-this.pos,s-n);if(a!==o)r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){n.default.exists(this),n.default.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:s}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(r,0),a=0);for(let e=a;e<o;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),u=n?4:0,c=n?0:4;e.setUint32(t+u,s,n),e.setUint32(t+c,a,n)}(r,o-8,BigInt(8*this.length),s),this.process(r,0);const u=(0,i.createView)(e);this.get().forEach(((e,t)=>u.setUint32(4*t,e,s)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.SHA2=o},2972:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:s,l:a}=i(e[o],t);[r[o],n[o]]=[s,a]}return[r,n]}function s(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.fromBig=i,t.split=o,t.toBig=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0),t.add=s;const a={fromBig:i,split:o,toBig:t.toBig,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:s,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};t.default=a},2103:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=void 0;const n=r(9926),i=r(5658);class o extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),!(this.iHash instanceof i.Hash))throw new TypeError("Expected instance of class which extends utils.Hash");const o=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const s=new Uint8Array(o);s.set(r.length>this.iHash.blockLen?e.create().update(r).digest():r);for(let e=0;e<s.length;e++)s[e]^=54;this.iHash.update(s),this.oHash=e.create();for(let e=0;e<s.length;e++)s[e]^=106;this.oHash.update(s),s.fill(0)}update(e){return n.default.exists(this),this.iHash.update(e),this}digestInto(e){n.default.exists(this),n.default.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.hmac=(e,t,r)=>new o(e,t).update(r).digest(),t.hmac.create=(e,t)=>new o(e,t)},2733:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;const n=r(9926),i=r(961),o=r(5658);function s(e,t,r,s){n.default.hash(e);const a=(0,o.checkOpts)({dkLen:32,asyncTick:10},s),{c:u,dkLen:c,asyncTick:h}=a;if(n.default.number(u),n.default.number(c),n.default.number(h),u<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const f=(0,o.toBytes)(t),d=(0,o.toBytes)(r),l=new Uint8Array(c),p=i.hmac.create(e,f),y=p._cloneInto().update(d);return{c:u,dkLen:c,asyncTick:h,DK:l,PRF:p,PRFSalt:y}}function a(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}t.pbkdf2=function(e,t,r,n){const{c:i,dkLen:u,DK:c,PRF:h,PRFSalt:f}=s(e,t,r,n);let d;const l=new Uint8Array(4),p=(0,o.createView)(l),y=new Uint8Array(h.outputLen);for(let e=1,t=0;t<u;e++,t+=h.outputLen){const r=c.subarray(t,t+h.outputLen);p.setInt32(0,e,!1),(d=f._cloneInto(d)).update(l).digestInto(y),r.set(y.subarray(0,r.length));for(let e=1;e<i;e++){h._cloneInto(d).update(y).digestInto(y);for(let e=0;e<r.length;e++)r[e]^=y[e]}}return a(h,f,c,d,y)},t.pbkdf2Async=async function(e,t,r,n){const{c:i,dkLen:u,asyncTick:c,DK:h,PRF:f,PRFSalt:d}=s(e,t,r,n);let l;const p=new Uint8Array(4),y=(0,o.createView)(p),g=new Uint8Array(f.outputLen);for(let e=1,t=0;t<u;e++,t+=f.outputLen){const r=h.subarray(t,t+f.outputLen);y.setInt32(0,e,!1),(l=d._cloneInto(l)).update(p).digestInto(g),r.set(g.subarray(0,r.length)),await(0,o.asyncLoop)(i-1,c,(e=>{f._cloneInto(l).update(g).digestInto(g);for(let e=0;e<r.length;e++)r[e]^=g[e]}))}return a(f,d,h,l,g)}},8435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(5827),i=r(5658),o=(e,t,r)=>e&t^e&r^t&r,s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class c extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=o+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:a,D:c,E:h,F:f,G:d,H:l}=this;for(let e=0;e<64;e++){const t=l+((0,i.rotr)(h,6)^(0,i.rotr)(h,11)^(0,i.rotr)(h,25))+((p=h)&f^~p&d)+s[e]+u[e]|0,y=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,a)|0;l=d,d=f,f=h,h=c+t|0,c=a,a=n,n=r,r=t+y|0}var p;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,c=c+this.D|0,h=h+this.E|0,f=f+this.F|0,d=d+this.G|0,l=l+this.H|0,this.set(r,n,a,c,h,f,d,l)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,i.wrapConstructor)((()=>new c))},6398:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512=t.SHA512=void 0;const n=r(5827),i=r(2972),o=r(5658),[s,a]=i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))),u=new Uint32Array(80),c=new Uint32Array(80);class h extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:u,El:c,Fh:h,Fl:f,Gh:d,Gl:l,Hh:p,Hl:y}=this;return[e,t,r,n,i,o,s,a,u,c,h,f,d,l,p,y]}set(e,t,r,n,i,o,s,a,u,c,h,f,d,l,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|u,this.El=0|c,this.Fh=0|h,this.Fl=0|f,this.Gh=0|d,this.Gl=0|l,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t),c[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|u[e-15],r=0|c[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),o=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),s=0|u[e-2],a=0|c[e-2],h=i.default.rotrSH(s,a,19)^i.default.rotrBH(s,a,61)^i.default.shrSH(s,a,6),f=i.default.rotrSL(s,a,19)^i.default.rotrBL(s,a,61)^i.default.shrSL(s,a,6),d=i.default.add4L(o,f,c[e-7],c[e-16]),l=i.default.add4H(d,n,h,u[e-7],u[e-16]);u[e]=0|l,c[e]=0|d}let{Ah:r,Al:n,Bh:o,Bl:h,Ch:f,Cl:d,Dh:l,Dl:p,Eh:y,El:g,Fh:b,Fl:m,Gh:v,Gl:w,Hh:_,Hl:E}=this;for(let e=0;e<80;e++){const t=i.default.rotrSH(y,g,14)^i.default.rotrSH(y,g,18)^i.default.rotrBH(y,g,41),A=i.default.rotrSL(y,g,14)^i.default.rotrSL(y,g,18)^i.default.rotrBL(y,g,41),S=y&b^~y&v,M=g&m^~g&w,x=i.default.add5L(E,A,M,a[e],c[e]),k=i.default.add5H(x,_,t,S,s[e],u[e]),I=0|x,R=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),B=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),T=r&o^r&f^o&f,U=n&h^n&d^h&d;_=0|v,E=0|w,v=0|b,w=0|m,b=0|y,m=0|g,({h:y,l:g}=i.default.add(0|l,0|p,0|k,0|I)),l=0|f,p=0|d,f=0|o,d=0|h,o=0|r,h=0|n;const O=i.default.add3L(I,B,U);r=i.default.add3H(O,k,R,T),n=0|O}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:h}=i.default.add(0|this.Bh,0|this.Bl,0|o,0|h)),({h:f,l:d}=i.default.add(0|this.Ch,0|this.Cl,0|f,0|d)),({h:l,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|l,0|p)),({h:y,l:g}=i.default.add(0|this.Eh,0|this.El,0|y,0|g)),({h:b,l:m}=i.default.add(0|this.Fh,0|this.Fl,0|b,0|m)),({h:v,l:w}=i.default.add(0|this.Gh,0|this.Gl,0|v,0|w)),({h:_,l:E}=i.default.add(0|this.Hh,0|this.Hl,0|_,0|E)),this.set(r,n,o,h,f,d,l,p,y,g,b,m,v,w,_,E)}roundClean(){u.fill(0),c.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=h;class f extends h{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class d extends h{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,o.wrapConstructor)((()=>new h)),t.sha512_256=(0,o.wrapConstructor)((()=>new f)),t.sha384=(0,o.wrapConstructor)((()=>new d))},5658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(2103);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function o(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=o(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t},t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=o,t.toBytes=s,t.concatBytes=function(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},1171:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function n(...e){const t=(e,t)=>r=>e(t(r));return{encode:Array.from(e).reverse().reduce(((e,r)=>e?t(e,r.encode):r.encode),void 0),decode:e.reduce(((e,r)=>e?t(e,r.decode):r.decode),void 0)}}function i(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(r(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const r=e.indexOf(t);if(-1===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}}function o(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function s(e,t="="){if(r(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let n=r.length;if(n*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if(!((n-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function a(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function u(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const o=[],s=Array.from(e);for(s.forEach((e=>{if(r(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,r=!0;for(let o=i;o<s.length;o++){const a=s[o],u=t*e+a;if(!Number.isSafeInteger(u)||t*e/t!==e||u-a!=t*e)throw new Error("convertRadix: carry overflow");if(e=u%n,s[o]=Math.floor(u/n),!Number.isSafeInteger(s[o])||s[o]*n+e!==u)throw new Error("convertRadix: carry overflow");r&&(s[o]?r=!1:i=o)}if(o.push(e),r)break}for(let t=0;t<e.length-1&&0===e[t];t++)o.push(0);return o.reverse()}Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64url=t.base64=t.base32crockford=t.base32hex=t.base32=t.base16=t.utils=t.assertNumber=void 0,t.assertNumber=r;const c=(e,t)=>t?c(t,e%t):e,h=(e,t)=>e+(t-c(e,t));function f(e,t,n,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(h(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${h(t,n)}`);let o=0,s=0;const a=2**n-1,u=[];for(const i of e){if(r(i),i>=2**t)throw new Error(`convertRadix2: invalid data word=${i} from=${t}`);if(o=o<<t|i,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=n;s-=n)u.push((o>>s-n&a)>>>0);o&=2**s-1}if(o=o<<n-s&a,!i&&s>=t)throw new Error("Excess padding");if(!i&&o)throw new Error(`Non-zero padding: ${o}`);return i&&s>0&&u.push(o>>>0),u}function d(e){return r(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return u(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(u(t,e,256))}}}function l(e,t=!1){if(r(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(h(8,e)>32||h(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return f(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(f(r,e,8,t))}}}function p(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch(e){}}}function y(e,t){if(r(e),"function"!=typeof t)throw new Error("checksum fn should be function");return{encode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const n=t(r).slice(0,e),i=new Uint8Array(r.length+e);return i.set(r),i.set(n,r.length),i},decode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const n=r.slice(0,-e),i=t(n).slice(0,e),o=r.slice(-e);for(let t=0;t<e;t++)if(i[t]!==o[t])throw new Error("Invalid checksum");return n}}}t.utils={alphabet:i,chain:n,checksum:y,radix:d,radix2:l,join:o,padding:s},t.base16=n(l(4),i("0123456789ABCDEF"),o("")),t.base32=n(l(5),i("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),s(5),o("")),t.base32hex=n(l(5),i("0123456789ABCDEFGHIJKLMNOPQRSTUV"),s(5),o("")),t.base32crockford=n(l(5),i("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),o(""),a((e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),t.base64=n(l(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s(6),o("")),t.base64url=n(l(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(6),o(""));const g=e=>n(d(58),i(e),o(""));t.base58=g("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=g("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=g("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const b=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(e){let r="";for(let n=0;n<e.length;n+=8){const i=e.subarray(n,n+8);r+=t.base58.encode(i).padStart(b[i.length],"1")}return r},decode(e){let r=[];for(let n=0;n<e.length;n+=11){const i=e.slice(n,n+11),o=b.indexOf(i.length),s=t.base58.decode(i);for(let e=0;e<s.length-o;e++)if(0!==s[e])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(r)}},t.base58check=e=>n(y(4,(t=>e(e(t)))),t.base58);const m=n(i("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),v=[996825010,642813549,513874426,1027748829,705979059];function w(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<v.length;e++)1==(t>>e&1)&&(r^=v[e]);return r}function _(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=w(i)^r>>5}i=w(i);for(let t=0;t<n;t++)i=w(i)^31&e.charCodeAt(t);for(let e of t)i=w(i)^e;for(let e=0;e<6;e++)i=w(i);return i^=r,m.encode(f([i%2**30],30,5,!1))}function E(e){const t="bech32"===e?1:734539939,r=l(5),n=r.decode,i=r.encode,o=p(n);function s(e,r=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==r&&e.length>r)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${r})`);const n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=(e=n).lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const o=e.slice(0,i),s=e.slice(i+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const a=m.decode(s).slice(0,-6),u=_(o,a,t);if(!s.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected "${u}"`);return{prefix:o,words:a}}return{encode:function(e,r,n=90){if("string"!=typeof e)throw new Error("bech32.encode prefix should be string, not "+typeof e);if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof r);const i=e.length+7+r.length;if(!1!==n&&i>n)throw new TypeError(`Length ${i} exceeds limit ${n}`);return`${e=e.toLowerCase()}1${m.encode(r)}${_(e,r,t)}`},decode:s,decodeToBytes:function(e){const{prefix:t,words:r}=s(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:p(s),fromWords:n,fromWordsUnsafe:o,toWords:i}}t.bech32=E("bech32"),t.bech32m=E("bech32m"),t.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},t.hex=n(l(4),i("0123456789abcdef"),o(""),a((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const A={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},S=`Invalid encoding type. Available types: ${Object.keys(A).join(", ")}`;t.bytesToString=(e,t)=>{if("string"!=typeof e||!A.hasOwnProperty(e))throw new TypeError(S);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return A[e].encode(t)},t.str=t.bytesToString,t.stringToBytes=(e,t)=>{if(!A.hasOwnProperty(e))throw new TypeError(S);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return A[e].decode(t)},t.bytes=t.stringToBytes},7184:(e,t,r)=>{"use strict";t.Z1=void 0;r(9926);const n=r(2733),i=(r(8435),r(6398));r(5658),r(1171);function o(e){if("string"!=typeof e)throw new TypeError("Invalid mnemonic type: "+typeof e);return e.normalize("NFKD")}function s(e){const t=o(e),r=t.split(" ");if(![12,15,18,21,24].includes(r.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:r}}t.Z1=function(e,t=""){return(0,n.pbkdf2)(i.sha512,s(e).nfkd,(e=>o(`mnemonic${e}`))(t),{c:2048,dkLen:64})}},7788:(e,t,r)=>{e.exports=r(2350)},4744:(e,t,r)=>{"use strict";var n=r(7217),i=r(6559),o=r(2646),s=r(7654),a=r(2774),u=r(9635),c=r(2654),h=r(8783),f=r(2699),d=r(6924),l=r(9251);e.exports=function(e){return new Promise((function(t,r){var p,y=e.data,g=e.headers,b=e.responseType;function m(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}n.isFormData(y)&&n.isStandardBrowserEnv()&&delete g["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";g.Authorization="Basic "+btoa(w+":"+_)}var E=a(e.baseURL,e.url);function A(){if(v){var n="getAllResponseHeaders"in v?u(v.getAllResponseHeaders()):null,o={data:b&&"text"!==b&&"json"!==b?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function(e){t(e),m()}),(function(e){r(e),m()}),o),v=null}}if(v.open(e.method.toUpperCase(),s(E,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=A:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(A)},v.onabort=function(){v&&(r(new f("Request aborted",f.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new f("Network Error",f.ERR_NETWORK,e,v,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||h;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new f(t,n.clarifyTimeoutError?f.ETIMEDOUT:f.ECONNABORTED,e,v)),v=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||c(E))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;S&&(g[e.xsrfHeaderName]=S)}"setRequestHeader"in v&&n.forEach(g,(function(e,t){void 0===y&&"content-type"===t.toLowerCase()?delete g[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),b&&"json"!==b&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){v&&(r(!e||e&&e.type?new d:e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),y||(y=null);var M=l(E);M&&-1===["http","https","file"].indexOf(M)?r(new f("Unsupported protocol "+M+":",f.ERR_BAD_REQUEST,e)):v.send(y)}))}},2350:(e,t,r)=>{"use strict";var n=r(7217),i=r(4046),o=r(8326),s=r(6044),a=function e(t){var r=new o(t),a=i(o.prototype.request,r);return n.extend(a,o.prototype,r),n.extend(a,r),a.create=function(r){return e(s(t,r))},a}(r(7741));a.Axios=o,a.CanceledError=r(6924),a.CancelToken=r(6829),a.isCancel=r(5700),a.VERSION=r(3542).version,a.toFormData=r(6289),a.AxiosError=r(2699),a.Cancel=a.CanceledError,a.all=function(e){return Promise.all(e)},a.spread=r(6728),a.isAxiosError=r(8667),e.exports=a,e.exports.default=a},6829:(e,t,r)=>{"use strict";var n=r(6924);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6924:(e,t,r)=>{"use strict";var n=r(2699);function i(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}r(7217).inherits(i,n,{__CANCEL__:!0}),e.exports=i},5700:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},8326:(e,t,r)=>{"use strict";var n=r(7217),i=r(7654),o=r(8874),s=r(4674),a=r(6044),u=r(2774),c=r(4671),h=c.validators;function f(e){this.defaults=e,this.interceptors={request:new o,response:new o}}f.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:h.transitional(h.boolean),forcedJSONParsing:h.transitional(h.boolean),clarifyTimeoutError:h.transitional(h.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)})),!i){var f=[s,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(u),o=Promise.resolve(t);f.length;)o=o.then(f.shift(),f.shift());return o}for(var d=t;n.length;){var l=n.shift(),p=n.shift();try{d=l(d)}catch(e){p(e);break}}try{o=s(d)}catch(e){return Promise.reject(e)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},f.prototype.getUri=function(e){e=a(this.defaults,e);var t=u(e.baseURL,e.url);return i(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(a(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}f.prototype[e]=t(),f.prototype[e+"Form"]=t(!0)})),e.exports=f},2699:(e,t,r)=>{"use strict";var n=r(7217);function i(e,t,r,n,i){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}n.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){s[e]={value:e}})),Object.defineProperties(i,s),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(e,t,r,s,a,u){var c=Object.create(o);return n.toFlatObject(e,c,(function(e){return e!==Error.prototype})),i.call(c,e.message,t,r,s,a),c.name=e.name,u&&Object.assign(c,u),c},e.exports=i},8874:(e,t,r)=>{"use strict";var n=r(7217);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},2774:(e,t,r)=>{"use strict";var n=r(5731),i=r(8451);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},4674:(e,t,r)=>{"use strict";var n=r(7217),i=r(2345),o=r(5700),s=r(7741),a=r(6924);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},6044:(e,t,r)=>{"use strict";var n=r(7217);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function s(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function u(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,i=t(e);n.isUndefined(i)&&t!==u||(r[e]=i)})),r}},6559:(e,t,r)=>{"use strict";var n=r(2699);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}},2345:(e,t,r)=>{"use strict";var n=r(7217),i=r(7741);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},7741:(e,t,r)=>{"use strict";var n=r(7217),i=r(7620),o=r(2699),s=r(8783),a=r(6289),u={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var h,f={transitional:s,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(h=r(4744)),h),transformRequest:[function(e,t){if(i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e))return e;if(n.isArrayBufferView(e))return e.buffer;if(n.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,o=n.isObject(e),s=t&&t["Content-Type"];if((r=n.isFileList(e))||o&&"multipart/form-data"===s){var u=this.env&&this.env.FormData;return a(r?{"files[]":e}:e,u&&new u)}return o||"application/json"===s?(c(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||f.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:r(4912)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){f.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){f.headers[e]=n.merge(u)})),e.exports=f},8783:e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},3542:e=>{e.exports={version:"0.27.2"}},4046:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},7654:(e,t,r)=>{"use strict";var n=r(7217);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},8451:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},2646:(e,t,r)=>{"use strict";var n=r(7217);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},5731:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},8667:(e,t,r)=>{"use strict";var n=r(7217);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},2654:(e,t,r)=>{"use strict";var n=r(7217);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},7620:(e,t,r)=>{"use strict";var n=r(7217);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},4912:e=>{e.exports=null},9635:(e,t,r)=>{"use strict";var n=r(7217),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},9251:e=>{"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},6728:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},6289:(e,t,r)=>{"use strict";var n=r(8764).Buffer,i=r(7217);e.exports=function(e,t){t=t||new FormData;var r=[];function o(e){return null===e?"":i.isDate(e)?e.toISOString():i.isArrayBuffer(e)||i.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):n.from(e):e}return function e(n,s){if(i.isPlainObject(n)||i.isArray(n)){if(-1!==r.indexOf(n))throw Error("Circular reference detected in "+s);r.push(n),i.forEach(n,(function(r,n){if(!i.isUndefined(r)){var a,u=s?s+"."+n:n;if(r&&!s&&"object"==typeof r)if(i.endsWith(n,"{}"))r=JSON.stringify(r);else if(i.endsWith(n,"[]")&&(a=i.toArray(r)))return void a.forEach((function(e){!i.isUndefined(e)&&t.append(u,o(e))}));e(r,u)}})),r.pop()}else t.append(s,o(n))}(e),t}},4671:(e,t,r)=>{"use strict";var n=r(3542).version,i=r(2699),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var s={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,a){if(!1===e)throw new i(o(n," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,a)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var s=n[o],a=t[s];if(a){var u=e[s],c=void 0===u||a(u,s,e);if(!0!==c)throw new i("option "+s+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i("Unknown option "+s,i.ERR_BAD_OPTION)}},validators:o}},7217:(e,t,r)=>{"use strict";var n,i=r(4046),o=Object.prototype.toString,s=(n=Object.create(null),function(e){var t=o.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())});function a(e){return e=e.toLowerCase(),function(t){return s(t)===e}}function u(e){return Array.isArray(e)}function c(e){return void 0===e}var h=a("ArrayBuffer");function f(e){return null!==e&&"object"==typeof e}function d(e){if("object"!==s(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var l=a("Date"),p=a("File"),y=a("Blob"),g=a("FileList");function b(e){return"[object Function]"===o.call(e)}var m=a("URLSearchParams");function v(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var w,_=(w="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return w&&e instanceof w});e.exports={isArray:u,isArrayBuffer:h,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||o.call(e)===t||b(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:f,isPlainObject:d,isUndefined:c,isDate:l,isFile:p,isBlob:y,isFunction:b,isStream:function(e){return f(e)&&b(e.pipe)},isURLSearchParams:m,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:v,merge:function e(){var t={};function r(r,n){d(t[n])&&d(r)?t[n]=e(t[n],r):d(r)?t[n]=e({},r):u(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)v(arguments[n],r);return t},extend:function(e,t,r){return v(t,(function(t,n){e[n]=r&&"function"==typeof t?i(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var n,i,o,s={};t=t||{};do{for(i=(n=Object.getOwnPropertyNames(e)).length;i-- >0;)s[o=n[i]]||(t[o]=e[o],s[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(c(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:_,isFileList:g}},9881:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},5857:(e,t,r)=>{var n;!function(){"use strict";var i="input is invalid type",o="object"==typeof window,s=o?window:{};s.JS_SHA3_NO_WINDOW&&(o=!1);var a=!o&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?s=r.g:a&&(s=self);var u=!s.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,h=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),d=[4,1024,262144,67108864],l=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],y=[224,256,384,512],g=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var v=function(e,t,r){return function(n){return new C(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,i){return new C(e,t,i).update(n)[r]()}},_=function(e,t,r){return function(t,n,i,o){return x["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return x["kmac"+e].update(t,n,i,o)[r]()}},A=function(e,t,r,n){for(var i=0;i<b.length;++i){var o=b[i];e[o]=t(r,n,o)}return e},S=function(e,t){var r=v(e,t,"hex");return r.create=function(){return new C(e,t,e)},r.update=function(e){return r.create().update(e)},A(r,v,e,t)},M=[{name:"keccak",padding:[1,256,65536,16777216],bits:y,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:y,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var r=w(e,t,"hex");return r.create=function(r){return new C(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},A(r,w,e,t)}},{name:"cshake",padding:d,bits:g,createMethod:function(e,t){var r=m[e],n=_(e,0,"hex");return n.create=function(n,i,o){return i||o?new C(e,t,n).bytepad([i,o],r):x["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},A(n,_,e,t)}},{name:"kmac",padding:d,bits:g,createMethod:function(e,t){var r=m[e],n=E(e,0,"hex");return n.create=function(n,i,o){return new P(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},A(n,E,e,t)}}],x={},k=[],I=0;I<M.length;++I)for(var R=M[I],B=R.bits,T=0;T<B.length;++T){var U=R.name+"_"+B[T];if(k.push(U),x[U]=R.createMethod(B[T],R.padding),"sha3"!==R.name){var O=R.name+B[T];k.push(O),x[O]=x[U]}}function C(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function P(e,t,r){C.call(this,e,t,r)}C.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,s=this.blocks,a=this.byteCount,u=e.length,c=this.blockCount,f=0,d=this.s;f<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<c+1;++n)s[n]=0;if(t)for(n=this.start;f<u&&n<a;++f)s[n>>2]|=e[f]<<l[3&n++];else for(n=this.start;f<u&&n<a;++f)(o=e.charCodeAt(f))<128?s[n>>2]|=o<<l[3&n++]:o<2048?(s[n>>2]|=(192|o>>6)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]):o<55296||o>=57344?(s[n>>2]|=(224|o>>12)<<l[3&n++],s[n>>2]|=(128|o>>6&63)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++f)),s[n>>2]|=(240|o>>18)<<l[3&n++],s[n>>2]|=(128|o>>12&63)<<l[3&n++],s[n>>2]|=(128|o>>6&63)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[c],n=0;n<c;++n)d[n]^=s[n];z(d),this.reset=!0}else this.start=n}return this},C.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},C.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,o=e.length;if(t)n=o;else for(var s=0;s<e.length;++s){var a=e.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(e),n},C.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];z(n)}},C.prototype.toString=C.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<t&&s<n;++o,++s)e=r[o],a+=f[e>>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];s%t==0&&(z(r),o=0)}return i&&(e=r[o],a+=f[e>>4&15]+f[15&e],i>1&&(a+=f[e>>12&15]+f[e>>8&15]),i>2&&(a+=f[e>>20&15]+f[e>>16&15])),a},C.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s<n;){for(o=0;o<t&&s<n;++o,++s)u[s]=r[o];s%t==0&&z(r)}return i&&(u[o]=r[o],e=e.slice(0,a)),e},C.prototype.buffer=C.prototype.arrayBuffer,C.prototype.digest=C.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)e=a<<2,t=n[s],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&z(n)}return o&&(e=a<<2,t=n[s],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},P.prototype=new C,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var z=function(e){var t,r,n,i,o,s,a,u,c,h,f,d,l,y,g,b,m,v,w,_,E,A,S,M,x,k,I,R,B,T,U,O,C,P,z,L,N,q,j,D,F,$,H,W,K,G,V,J,Y,Z,X,Q,ee,te,re,ne,ie,oe,se,ae,ue,ce,he;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(l=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(h<<1|f>>>31),r=a^(f<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(d<<1|l>>>31),r=c^(l<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,y=e[0],g=e[1],G=e[11]<<4|e[10]>>>28,V=e[10]<<4|e[11]>>>28,R=e[20]<<3|e[21]>>>29,B=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,$=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,P=e[2]<<1|e[3]>>>31,z=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,U=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,he=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,N=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,C=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,q=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,D=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=y^~b&v,e[1]=g^~m&w,e[10]=M^~k&R,e[11]=x^~I&B,e[20]=P^~L&q,e[21]=z^~N&j,e[30]=W^~G&J,e[31]=K^~V&Y,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=b^~v&_,e[3]=m^~w&E,e[12]=k^~R&T,e[13]=I^~B&U,e[22]=L^~q&D,e[23]=N^~j&F,e[32]=G^~J&Z,e[33]=V^~Y&X,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=v^~_&A,e[5]=w^~E&S,e[14]=R^~T&O,e[15]=B^~U&C,e[24]=q^~D&$,e[25]=j^~F&H,e[34]=J^~Z&Q,e[35]=Y^~X&ee,e[44]=oe^~ae&ce,e[45]=se^~ue&he,e[6]=_^~A&y,e[7]=E^~S&g,e[16]=T^~O&M,e[17]=U^~C&x,e[26]=D^~$&P,e[27]=F^~H&z,e[36]=Z^~Q&W,e[37]=X^~ee&K,e[46]=ae^~ce&te,e[47]=ue^~he&re,e[8]=A^~y&b,e[9]=S^~g&m,e[18]=O^~M&k,e[19]=C^~x&I,e[28]=$^~P&L,e[29]=H^~z&N,e[38]=Q^~W&G,e[39]=ee^~K&V,e[48]=ce^~te&ne,e[49]=he^~re&ie,e[0]^=p[n],e[1]^=p[n+1]};if(u)e.exports=x;else{for(I=0;I<k.length;++I)s[k[I]]=x[k[I]];c&&(void 0===(n=function(){return x}.call(t,r,t,e))||(e.exports=n))}}()},6254:(e,t,r)=>{!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),a=t([1]),u=t([56129,1]),c=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),l=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function y(e,t,r,n,i){var o,s=0;for(o=0;o<i;o++)s|=e[t+o]^r[n+o];return(1&s-1>>>8)-1}function g(e,t,r,n){return y(e,t,r,n,16)}function b(e,t,r,n){return y(e,t,r,n,32)}function m(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=o,E=s,A=a,S=u,M=c,x=h,k=f,I=d,R=l,B=p,T=y,U=g,O=b,C=m,P=v,z=w,L=0;L<20;L+=2)_^=(i=(O^=(i=(R^=(i=(M^=(i=_+O|0)<<7|i>>>25)+_|0)<<9|i>>>23)+M|0)<<13|i>>>19)+R|0)<<18|i>>>14,x^=(i=(E^=(i=(C^=(i=(B^=(i=x+E|0)<<7|i>>>25)+x|0)<<9|i>>>23)+B|0)<<13|i>>>19)+C|0)<<18|i>>>14,T^=(i=(k^=(i=(A^=(i=(P^=(i=T+k|0)<<7|i>>>25)+T|0)<<9|i>>>23)+P|0)<<13|i>>>19)+A|0)<<18|i>>>14,z^=(i=(U^=(i=(I^=(i=(S^=(i=z+U|0)<<7|i>>>25)+z|0)<<9|i>>>23)+S|0)<<13|i>>>19)+I|0)<<18|i>>>14,_^=(i=(S^=(i=(A^=(i=(E^=(i=_+S|0)<<7|i>>>25)+_|0)<<9|i>>>23)+E|0)<<13|i>>>19)+A|0)<<18|i>>>14,x^=(i=(M^=(i=(I^=(i=(k^=(i=x+M|0)<<7|i>>>25)+x|0)<<9|i>>>23)+k|0)<<13|i>>>19)+I|0)<<18|i>>>14,T^=(i=(B^=(i=(R^=(i=(U^=(i=T+B|0)<<7|i>>>25)+T|0)<<9|i>>>23)+U|0)<<13|i>>>19)+R|0)<<18|i>>>14,z^=(i=(P^=(i=(C^=(i=(O^=(i=z+P|0)<<7|i>>>25)+z|0)<<9|i>>>23)+O|0)<<13|i>>>19)+C|0)<<18|i>>>14;_=_+o|0,E=E+s|0,A=A+a|0,S=S+u|0,M=M+c|0,x=x+h|0,k=k+f|0,I=I+d|0,R=R+l|0,B=B+p|0,T=T+y|0,U=U+g|0,O=O+b|0,C=C+m|0,P=P+v|0,z=z+w|0,e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=M>>>0&255,e[17]=M>>>8&255,e[18]=M>>>16&255,e[19]=M>>>24&255,e[20]=x>>>0&255,e[21]=x>>>8&255,e[22]=x>>>16&255,e[23]=x>>>24&255,e[24]=k>>>0&255,e[25]=k>>>8&255,e[26]=k>>>16&255,e[27]=k>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=R>>>0&255,e[33]=R>>>8&255,e[34]=R>>>16&255,e[35]=R>>>24&255,e[36]=B>>>0&255,e[37]=B>>>8&255,e[38]=B>>>16&255,e[39]=B>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=U>>>0&255,e[45]=U>>>8&255,e[46]=U>>>16&255,e[47]=U>>>24&255,e[48]=O>>>0&255,e[49]=O>>>8&255,e[50]=O>>>16&255,e[51]=O>>>24&255,e[52]=C>>>0&255,e[53]=C>>>8&255,e[54]=C>>>16&255,e[55]=C>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,n)}function v(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=0;_<20;_+=2)o^=(i=(b^=(i=(l^=(i=(c^=(i=o+b|0)<<7|i>>>25)+o|0)<<9|i>>>23)+c|0)<<13|i>>>19)+l|0)<<18|i>>>14,h^=(i=(s^=(i=(m^=(i=(p^=(i=h+s|0)<<7|i>>>25)+h|0)<<9|i>>>23)+p|0)<<13|i>>>19)+m|0)<<18|i>>>14,y^=(i=(f^=(i=(a^=(i=(v^=(i=y+f|0)<<7|i>>>25)+y|0)<<9|i>>>23)+v|0)<<13|i>>>19)+a|0)<<18|i>>>14,w^=(i=(g^=(i=(d^=(i=(u^=(i=w+g|0)<<7|i>>>25)+w|0)<<9|i>>>23)+u|0)<<13|i>>>19)+d|0)<<18|i>>>14,o^=(i=(u^=(i=(a^=(i=(s^=(i=o+u|0)<<7|i>>>25)+o|0)<<9|i>>>23)+s|0)<<13|i>>>19)+a|0)<<18|i>>>14,h^=(i=(c^=(i=(d^=(i=(f^=(i=h+c|0)<<7|i>>>25)+h|0)<<9|i>>>23)+f|0)<<13|i>>>19)+d|0)<<18|i>>>14,y^=(i=(p^=(i=(l^=(i=(g^=(i=y+p|0)<<7|i>>>25)+y|0)<<9|i>>>23)+g|0)<<13|i>>>19)+l|0)<<18|i>>>14,w^=(i=(v^=(i=(m^=(i=(b^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+b|0)<<13|i>>>19)+m|0)<<18|i>>>14;e[0]=o>>>0&255,e[1]=o>>>8&255,e[2]=o>>>16&255,e[3]=o>>>24&255,e[4]=h>>>0&255,e[5]=h>>>8&255,e[6]=h>>>16&255,e[7]=h>>>24&255,e[8]=y>>>0&255,e[9]=y>>>8&255,e[10]=y>>>16&255,e[11]=y>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=f>>>0&255,e[17]=f>>>8&255,e[18]=f>>>16&255,e[19]=f>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(e,t,r,n,i,o,s){var a,u,c=new Uint8Array(16),h=new Uint8Array(64);for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=o[u];for(;i>=64;){for(m(h,c,s,w),u=0;u<64;u++)e[t+u]=r[n+u]^h[u];for(a=1,u=8;u<16;u++)a=a+(255&c[u])|0,c[u]=255&a,a>>>=8;i-=64,t+=64,n+=64}if(i>0)for(m(h,c,s,w),u=0;u<i;u++)e[t+u]=r[n+u]^h[u];return 0}function E(e,t,r,n,i){var o,s,a=new Uint8Array(16),u=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=n[s];for(;r>=64;){for(m(u,a,i,w),s=0;s<64;s++)e[t+s]=u[s];for(o=1,s=8;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,t+=64}if(r>0)for(m(u,a,i,w),s=0;s<r;s++)e[t+s]=u[s];return 0}function A(e,t,r,n,i){var o=new Uint8Array(32);v(o,n,i,w);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=n[a+16];return E(e,t,r,s,o)}function S(e,t,r,n,i,o,s){var a=new Uint8Array(32);v(a,o,s,w);for(var u=new Uint8Array(8),c=0;c<8;c++)u[c]=o[c+16];return _(e,t,r,n,i,u,a)}var M=function(e){var t,r,n,i,o,s,a,u;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,s=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(o>>>14|s<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(s>>>11|a<<5),u=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function x(e,t,r,n,i,o){var s=new M(o);return s.update(r,n,i),s.finish(e,t),0}function k(e,t,r,n,i,o){var s=new Uint8Array(16);return x(s,0,r,n,i,o),g(e,t,s,0)}function I(e,t,r,n,i){var o;if(r<32)return-1;for(S(e,0,t,0,r,n,i),x(e,16,e,32,r-32,e),o=0;o<16;o++)e[o]=0;return 0}function R(e,t,r,n,i){var o,s=new Uint8Array(32);if(r<32)return-1;if(A(s,0,32,n,i),0!==k(t,16,t,32,r-32,s))return-1;for(S(e,0,t,0,r,n,i),o=0;o<32;o++)e[o]=0;return 0}function B(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function T(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function U(e,t,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function O(e,r){var n,i,o,s=t(),a=t();for(n=0;n<16;n++)a[n]=r[n];for(T(a),T(a),T(a),i=0;i<2;i++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,U(a,s,1-o)}for(n=0;n<16;n++)e[2*n]=255&a[n],e[2*n+1]=a[n]>>8}function C(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return O(r,e),O(n,t),b(r,0,n,0)}function P(e){var t=new Uint8Array(32);return O(t,e),1&t[0]}function z(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function L(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function N(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function q(e,t,r){var n,i,o=0,s=0,a=0,u=0,c=0,h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,v=0,w=0,_=0,E=0,A=0,S=0,M=0,x=0,k=0,I=0,R=0,B=0,T=0,U=0,O=0,C=0,P=0,z=r[0],L=r[1],N=r[2],q=r[3],j=r[4],D=r[5],F=r[6],$=r[7],H=r[8],W=r[9],K=r[10],G=r[11],V=r[12],J=r[13],Y=r[14],Z=r[15];o+=(n=t[0])*z,s+=n*L,a+=n*N,u+=n*q,c+=n*j,h+=n*D,f+=n*F,d+=n*$,l+=n*H,p+=n*W,y+=n*K,g+=n*G,b+=n*V,m+=n*J,v+=n*Y,w+=n*Z,s+=(n=t[1])*z,a+=n*L,u+=n*N,c+=n*q,h+=n*j,f+=n*D,d+=n*F,l+=n*$,p+=n*H,y+=n*W,g+=n*K,b+=n*G,m+=n*V,v+=n*J,w+=n*Y,_+=n*Z,a+=(n=t[2])*z,u+=n*L,c+=n*N,h+=n*q,f+=n*j,d+=n*D,l+=n*F,p+=n*$,y+=n*H,g+=n*W,b+=n*K,m+=n*G,v+=n*V,w+=n*J,_+=n*Y,E+=n*Z,u+=(n=t[3])*z,c+=n*L,h+=n*N,f+=n*q,d+=n*j,l+=n*D,p+=n*F,y+=n*$,g+=n*H,b+=n*W,m+=n*K,v+=n*G,w+=n*V,_+=n*J,E+=n*Y,A+=n*Z,c+=(n=t[4])*z,h+=n*L,f+=n*N,d+=n*q,l+=n*j,p+=n*D,y+=n*F,g+=n*$,b+=n*H,m+=n*W,v+=n*K,w+=n*G,_+=n*V,E+=n*J,A+=n*Y,S+=n*Z,h+=(n=t[5])*z,f+=n*L,d+=n*N,l+=n*q,p+=n*j,y+=n*D,g+=n*F,b+=n*$,m+=n*H,v+=n*W,w+=n*K,_+=n*G,E+=n*V,A+=n*J,S+=n*Y,M+=n*Z,f+=(n=t[6])*z,d+=n*L,l+=n*N,p+=n*q,y+=n*j,g+=n*D,b+=n*F,m+=n*$,v+=n*H,w+=n*W,_+=n*K,E+=n*G,A+=n*V,S+=n*J,M+=n*Y,x+=n*Z,d+=(n=t[7])*z,l+=n*L,p+=n*N,y+=n*q,g+=n*j,b+=n*D,m+=n*F,v+=n*$,w+=n*H,_+=n*W,E+=n*K,A+=n*G,S+=n*V,M+=n*J,x+=n*Y,k+=n*Z,l+=(n=t[8])*z,p+=n*L,y+=n*N,g+=n*q,b+=n*j,m+=n*D,v+=n*F,w+=n*$,_+=n*H,E+=n*W,A+=n*K,S+=n*G,M+=n*V,x+=n*J,k+=n*Y,I+=n*Z,p+=(n=t[9])*z,y+=n*L,g+=n*N,b+=n*q,m+=n*j,v+=n*D,w+=n*F,_+=n*$,E+=n*H,A+=n*W,S+=n*K,M+=n*G,x+=n*V,k+=n*J,I+=n*Y,R+=n*Z,y+=(n=t[10])*z,g+=n*L,b+=n*N,m+=n*q,v+=n*j,w+=n*D,_+=n*F,E+=n*$,A+=n*H,S+=n*W,M+=n*K,x+=n*G,k+=n*V,I+=n*J,R+=n*Y,B+=n*Z,g+=(n=t[11])*z,b+=n*L,m+=n*N,v+=n*q,w+=n*j,_+=n*D,E+=n*F,A+=n*$,S+=n*H,M+=n*W,x+=n*K,k+=n*G,I+=n*V,R+=n*J,B+=n*Y,T+=n*Z,b+=(n=t[12])*z,m+=n*L,v+=n*N,w+=n*q,_+=n*j,E+=n*D,A+=n*F,S+=n*$,M+=n*H,x+=n*W,k+=n*K,I+=n*G,R+=n*V,B+=n*J,T+=n*Y,U+=n*Z,m+=(n=t[13])*z,v+=n*L,w+=n*N,_+=n*q,E+=n*j,A+=n*D,S+=n*F,M+=n*$,x+=n*H,k+=n*W,I+=n*K,R+=n*G,B+=n*V,T+=n*J,U+=n*Y,O+=n*Z,v+=(n=t[14])*z,w+=n*L,_+=n*N,E+=n*q,A+=n*j,S+=n*D,M+=n*F,x+=n*$,k+=n*H,I+=n*W,R+=n*K,B+=n*G,T+=n*V,U+=n*J,O+=n*Y,C+=n*Z,w+=(n=t[15])*z,s+=38*(E+=n*N),a+=38*(A+=n*q),u+=38*(S+=n*j),c+=38*(M+=n*D),h+=38*(x+=n*F),f+=38*(k+=n*$),d+=38*(I+=n*H),l+=38*(R+=n*W),p+=38*(B+=n*K),y+=38*(T+=n*G),g+=38*(U+=n*V),b+=38*(O+=n*J),m+=38*(C+=n*Y),v+=38*(P+=n*Z),o=(n=(o+=38*(_+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=u,e[4]=c,e[5]=h,e[6]=f,e[7]=d,e[8]=l,e[9]=p,e[10]=y,e[11]=g,e[12]=b,e[13]=m,e[14]=v,e[15]=w}function j(e,t){q(e,t,t)}function D(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)j(i,i),2!==n&&4!==n&&q(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function F(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)j(i,i),1!==n&&q(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function $(e,r,n){var i,o,s=new Uint8Array(32),a=new Float64Array(80),c=t(),h=t(),f=t(),d=t(),l=t(),p=t();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,z(a,n),o=0;o<16;o++)h[o]=a[o],d[o]=c[o]=f[o]=0;for(c[0]=d[0]=1,o=254;o>=0;--o)U(c,h,i=s[o>>>3]>>>(7&o)&1),U(f,d,i),L(l,c,f),N(c,c,f),L(f,h,d),N(h,h,d),j(d,l),j(p,c),q(c,f,c),q(f,h,l),L(l,c,f),N(c,c,f),j(h,c),N(f,d,p),q(c,f,u),L(c,c,d),q(f,f,c),q(c,d,p),q(d,h,a),j(h,l),U(c,h,i),U(f,d,i);for(o=0;o<16;o++)a[o+16]=c[o],a[o+32]=f[o],a[o+48]=h[o],a[o+64]=d[o];var y=a.subarray(32),g=a.subarray(16);return D(y,y),q(g,g,y),O(e,g),0}function H(e,t){return $(e,t,o)}function W(e,t){return n(t,32),H(e,t)}function K(e,t,r){var n=new Uint8Array(32);return $(n,r,t),v(e,i,n,w)}M.prototype.blocks=function(e,t,r){for(var n,i,o,s,a,u,c,h,f,d,l,p,y,g,b,m,v,w,_,E=this.fin?0:2048,A=this.h[0],S=this.h[1],M=this.h[2],x=this.h[3],k=this.h[4],I=this.h[5],R=this.h[6],B=this.h[7],T=this.h[8],U=this.h[9],O=this.r[0],C=this.r[1],P=this.r[2],z=this.r[3],L=this.r[4],N=this.r[5],q=this.r[6],j=this.r[7],D=this.r[8],F=this.r[9];r>=16;)d=f=0,d+=(A+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*O,d+=(S+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*F),d+=(M+=8191&(i>>>10|(o=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*D),d+=(x+=8191&(o>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*j),f=(d+=(k+=8191&(s>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*q))>>>13,d&=8191,d+=(I+=a>>>1&8191)*(5*N),d+=(R+=8191&(a>>>14|(u=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*L),d+=(B+=8191&(u>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),d+=(T+=8191&(c>>>8|(h=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*P),l=f+=(d+=(U+=h>>>5|E)*(5*C))>>>13,l+=A*C,l+=S*O,l+=M*(5*F),l+=x*(5*D),f=(l+=k*(5*j))>>>13,l&=8191,l+=I*(5*q),l+=R*(5*N),l+=B*(5*L),l+=T*(5*z),f+=(l+=U*(5*P))>>>13,l&=8191,p=f,p+=A*P,p+=S*C,p+=M*O,p+=x*(5*F),f=(p+=k*(5*D))>>>13,p&=8191,p+=I*(5*j),p+=R*(5*q),p+=B*(5*N),p+=T*(5*L),y=f+=(p+=U*(5*z))>>>13,y+=A*z,y+=S*P,y+=M*C,y+=x*O,f=(y+=k*(5*F))>>>13,y&=8191,y+=I*(5*D),y+=R*(5*j),y+=B*(5*q),y+=T*(5*N),g=f+=(y+=U*(5*L))>>>13,g+=A*L,g+=S*z,g+=M*P,g+=x*C,f=(g+=k*O)>>>13,g&=8191,g+=I*(5*F),g+=R*(5*D),g+=B*(5*j),g+=T*(5*q),b=f+=(g+=U*(5*N))>>>13,b+=A*N,b+=S*L,b+=M*z,b+=x*P,f=(b+=k*C)>>>13,b&=8191,b+=I*O,b+=R*(5*F),b+=B*(5*D),b+=T*(5*j),m=f+=(b+=U*(5*q))>>>13,m+=A*q,m+=S*N,m+=M*L,m+=x*z,f=(m+=k*P)>>>13,m&=8191,m+=I*C,m+=R*O,m+=B*(5*F),m+=T*(5*D),v=f+=(m+=U*(5*j))>>>13,v+=A*j,v+=S*q,v+=M*N,v+=x*L,f=(v+=k*z)>>>13,v&=8191,v+=I*P,v+=R*C,v+=B*O,v+=T*(5*F),w=f+=(v+=U*(5*D))>>>13,w+=A*D,w+=S*j,w+=M*q,w+=x*N,f=(w+=k*L)>>>13,w&=8191,w+=I*z,w+=R*P,w+=B*C,w+=T*O,_=f+=(w+=U*(5*F))>>>13,_+=A*F,_+=S*D,_+=M*j,_+=x*q,f=(_+=k*N)>>>13,_&=8191,_+=I*L,_+=R*z,_+=B*P,_+=T*C,A=d=8191&(f=(f=((f+=(_+=U*O)>>>13)<<2)+f|0)+(d&=8191)|0),S=l+=f>>>=13,M=p&=8191,x=y&=8191,k=g&=8191,I=b&=8191,R=m&=8191,B=v&=8191,T=w&=8191,U=_&=8191,t+=16,r-=16;this.h[0]=A,this.h[1]=S,this.h[2]=M,this.h[3]=x,this.h[4]=k,this.h[5]=I,this.h[6]=R,this.h[7]=B,this.h[8]=T,this.h[9]=U},M.prototype.finish=function(e,t){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},M.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var G=I,V=R,J=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Y(e,t,r,n){for(var i,o,s,a,u,c,h,f,d,l,p,y,g,b,m,v,w,_,E,A,S,M,x,k,I,R,B=new Int32Array(16),T=new Int32Array(16),U=e[0],O=e[1],C=e[2],P=e[3],z=e[4],L=e[5],N=e[6],q=e[7],j=t[0],D=t[1],F=t[2],$=t[3],H=t[4],W=t[5],K=t[6],G=t[7],V=0;n>=128;){for(E=0;E<16;E++)A=8*E+V,B[E]=r[A+0]<<24|r[A+1]<<16|r[A+2]<<8|r[A+3],T[E]=r[A+4]<<24|r[A+5]<<16|r[A+6]<<8|r[A+7];for(E=0;E<80;E++)if(i=U,o=O,s=C,a=P,u=z,c=L,h=N,d=j,l=D,p=F,y=$,g=H,b=W,m=K,x=65535&(M=G),k=M>>>16,I=65535&(S=q),R=S>>>16,x+=65535&(M=(H>>>14|z<<18)^(H>>>18|z<<14)^(z>>>9|H<<23)),k+=M>>>16,I+=65535&(S=(z>>>14|H<<18)^(z>>>18|H<<14)^(H>>>9|z<<23)),R+=S>>>16,x+=65535&(M=H&W^~H&K),k+=M>>>16,I+=65535&(S=z&L^~z&N),R+=S>>>16,x+=65535&(M=J[2*E+1]),k+=M>>>16,I+=65535&(S=J[2*E]),R+=S>>>16,S=B[E%16],k+=(M=T[E%16])>>>16,I+=65535&S,R+=S>>>16,I+=(k+=(x+=65535&M)>>>16)>>>16,x=65535&(M=_=65535&x|k<<16),k=M>>>16,I=65535&(S=w=65535&I|(R+=I>>>16)<<16),R=S>>>16,x+=65535&(M=(j>>>28|U<<4)^(U>>>2|j<<30)^(U>>>7|j<<25)),k+=M>>>16,I+=65535&(S=(U>>>28|j<<4)^(j>>>2|U<<30)^(j>>>7|U<<25)),R+=S>>>16,k+=(M=j&D^j&F^D&F)>>>16,I+=65535&(S=U&O^U&C^O&C),R+=S>>>16,f=65535&(I+=(k+=(x+=65535&M)>>>16)>>>16)|(R+=I>>>16)<<16,v=65535&x|k<<16,x=65535&(M=y),k=M>>>16,I=65535&(S=a),R=S>>>16,k+=(M=_)>>>16,I+=65535&(S=w),R+=S>>>16,O=i,C=o,P=s,z=a=65535&(I+=(k+=(x+=65535&M)>>>16)>>>16)|(R+=I>>>16)<<16,L=u,N=c,q=h,U=f,D=d,F=l,$=p,H=y=65535&x|k<<16,W=g,K=b,G=m,j=v,E%16==15)for(A=0;A<16;A++)S=B[A],x=65535&(M=T[A]),k=M>>>16,I=65535&S,R=S>>>16,S=B[(A+9)%16],x+=65535&(M=T[(A+9)%16]),k+=M>>>16,I+=65535&S,R+=S>>>16,w=B[(A+1)%16],x+=65535&(M=((_=T[(A+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),k+=M>>>16,I+=65535&(S=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),R+=S>>>16,w=B[(A+14)%16],k+=(M=((_=T[(A+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,I+=65535&(S=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,B[A]=65535&I|R<<16,T[A]=65535&x|k<<16;x=65535&(M=j),k=M>>>16,I=65535&(S=U),R=S>>>16,S=e[0],k+=(M=t[0])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[0]=U=65535&I|R<<16,t[0]=j=65535&x|k<<16,x=65535&(M=D),k=M>>>16,I=65535&(S=O),R=S>>>16,S=e[1],k+=(M=t[1])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[1]=O=65535&I|R<<16,t[1]=D=65535&x|k<<16,x=65535&(M=F),k=M>>>16,I=65535&(S=C),R=S>>>16,S=e[2],k+=(M=t[2])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[2]=C=65535&I|R<<16,t[2]=F=65535&x|k<<16,x=65535&(M=$),k=M>>>16,I=65535&(S=P),R=S>>>16,S=e[3],k+=(M=t[3])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[3]=P=65535&I|R<<16,t[3]=$=65535&x|k<<16,x=65535&(M=H),k=M>>>16,I=65535&(S=z),R=S>>>16,S=e[4],k+=(M=t[4])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[4]=z=65535&I|R<<16,t[4]=H=65535&x|k<<16,x=65535&(M=W),k=M>>>16,I=65535&(S=L),R=S>>>16,S=e[5],k+=(M=t[5])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[5]=L=65535&I|R<<16,t[5]=W=65535&x|k<<16,x=65535&(M=K),k=M>>>16,I=65535&(S=N),R=S>>>16,S=e[6],k+=(M=t[6])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[6]=N=65535&I|R<<16,t[6]=K=65535&x|k<<16,x=65535&(M=G),k=M>>>16,I=65535&(S=q),R=S>>>16,S=e[7],k+=(M=t[7])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[7]=q=65535&I|R<<16,t[7]=G=65535&x|k<<16,V+=128,n-=128}return n}function Z(e,t,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,Y(i,o,t,r),r%=128,n=0;n<r;n++)s[n]=t[a-r+n];for(s[r]=128,s[(r=256-128*(r<112?1:0))-9]=0,p(s,r-8,a/536870912|0,a<<3),Y(i,o,s,r),n=0;n<8;n++)p(e,8*n,i[n],o[n]);return 0}function X(e,r){var n=t(),i=t(),o=t(),s=t(),a=t(),u=t(),c=t(),f=t(),d=t();N(n,e[1],e[0]),N(d,r[1],r[0]),q(n,n,d),L(i,e[0],e[1]),L(d,r[0],r[1]),q(i,i,d),q(o,e[3],r[3]),q(o,o,h),q(s,e[2],r[2]),L(s,s,s),N(a,i,n),N(u,s,o),L(c,s,o),L(f,i,n),q(e[0],a,u),q(e[1],f,c),q(e[2],c,u),q(e[3],a,f)}function Q(e,t,r){var n;for(n=0;n<4;n++)U(e[n],t[n],r)}function ee(e,r){var n=t(),i=t(),o=t();D(o,r[2]),q(n,r[0],o),q(i,r[1],o),O(e,i),e[31]^=P(n)<<7}function te(e,t,r){var n,i;for(B(e[0],s),B(e[1],a),B(e[2],a),B(e[3],s),i=255;i>=0;--i)Q(e,t,n=r[i/8|0]>>(7&i)&1),X(t,e),X(e,e),Q(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];B(n[0],f),B(n[1],d),B(n[2],a),q(n[3],f,d),te(e,n,r)}function ne(e,r,i){var o,s=new Uint8Array(64),a=[t(),t(),t(),t()];for(i||n(r,32),Z(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,re(a,s),ee(e,a),o=0;o<32;o++)r[o+32]=e[o];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function oe(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*ie[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*ie[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ie[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function se(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;oe(e,r)}function ae(e,r,n,i){var o,s,a=new Uint8Array(64),u=new Uint8Array(64),c=new Uint8Array(64),h=new Float64Array(64),f=[t(),t(),t(),t()];Z(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var d=n+64;for(o=0;o<n;o++)e[64+o]=r[o];for(o=0;o<32;o++)e[32+o]=a[32+o];for(Z(c,e.subarray(32),n+32),se(c),re(f,c),ee(e,f),o=32;o<64;o++)e[o]=i[o];for(Z(u,e,n+64),se(u),o=0;o<64;o++)h[o]=0;for(o=0;o<32;o++)h[o]=c[o];for(o=0;o<32;o++)for(s=0;s<32;s++)h[o+s]+=u[o]*a[s];return oe(e.subarray(32),h),d}function ue(e,r,n,i){var o,u=new Uint8Array(32),h=new Uint8Array(64),f=[t(),t(),t(),t()],d=[t(),t(),t(),t()];if(n<64)return-1;if(function(e,r){var n=t(),i=t(),o=t(),u=t(),h=t(),f=t(),d=t();return B(e[2],a),z(e[1],r),j(o,e[1]),q(u,o,c),N(o,o,e[2]),L(u,e[2],u),j(h,u),j(f,h),q(d,f,h),q(n,d,o),q(n,n,u),F(n,n),q(n,n,o),q(n,n,u),q(n,n,u),q(e[0],n,u),j(i,e[0]),q(i,i,u),C(i,o)&&q(e[0],e[0],l),j(i,e[0]),q(i,i,u),C(i,o)?-1:(P(e[0])===r[31]>>7&&N(e[0],s,e[0]),q(e[3],e[0],e[1]),0)}(d,i))return-1;for(o=0;o<n;o++)e[o]=r[o];for(o=0;o<32;o++)e[o+32]=i[o];if(Z(h,e,n),se(h),te(f,d,h),re(d,r.subarray(32)),X(f,d),ee(u,f),n-=64,b(r,0,u,0)){for(o=0;o<n;o++)e[o]=0;return-1}for(o=0;o<n;o++)e[o]=r[o+64];return n}var ce=64,he=32,fe=64;function de(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function le(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function pe(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:v,crypto_stream_xor:S,crypto_stream:A,crypto_stream_salsa20_xor:_,crypto_stream_salsa20:E,crypto_onetimeauth:x,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:b,crypto_secretbox:I,crypto_secretbox_open:R,crypto_scalarmult:$,crypto_scalarmult_base:H,crypto_box_beforenm:K,crypto_box_afternm:G,crypto_box:function(e,t,r,n,i,o){var s=new Uint8Array(32);return K(s,i,o),G(e,t,r,n,s)},crypto_box_open:function(e,t,r,n,i,o){var s=new Uint8Array(32);return K(s,i,o),V(e,t,r,n,s)},crypto_box_keypair:W,crypto_hash:Z,crypto_sign:ae,crypto_sign_keypair:ne,crypto_sign_open:ue,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ce,crypto_sign_PUBLICKEYBYTES:he,crypto_sign_SECRETKEYBYTES:fe,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:c,L:ie,pack25519:O,unpack25519:z,M:q,A:L,S:j,Z:N,pow2523:F,add:X,set25519:B,modL:oe,scalarmult:te,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,r){le(e,t,r),de(r,t);for(var n=new Uint8Array(32+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+32]=e[o];return I(i,n,n.length,t,r),i.subarray(16)},e.secretbox.open=function(e,t,r){le(e,t,r),de(r,t);for(var n=new Uint8Array(16+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+16]=e[o];return n.length<32||0!==R(i,n,n.length,t,r)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(le(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return $(r,e,t),r},e.scalarMult.base=function(e){if(le(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox(t,r,o)},e.box.before=function(e,t){le(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return K(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox.open(t,r,o)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return W(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(le(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return H(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(le(e,t),t.length!==fe)throw new Error("bad secret key size");var r=new Uint8Array(ce+e.length);return ae(r,e,e.length,t),r},e.sign.open=function(e,t){if(le(e,t),t.length!==he)throw new Error("bad public key size");var r=new Uint8Array(e.length),n=ue(r,e,e.length,t);if(n<0)return null;for(var i=new Uint8Array(n),o=0;o<i.length;o++)i[o]=r[o];return i},e.sign.detached=function(t,r){for(var n=e.sign(t,r),i=new Uint8Array(ce),o=0;o<i.length;o++)i[o]=n[o];return i},e.sign.detached.verify=function(e,t,r){if(le(e,t,r),t.length!==ce)throw new Error("bad signature size");if(r.length!==he)throw new Error("bad public key size");var n,i=new Uint8Array(ce+e.length),o=new Uint8Array(ce+e.length);for(n=0;n<ce;n++)i[n]=t[n];for(n=0;n<e.length;n++)i[n+ce]=e[n];return ue(o,i,i.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(he),t=new Uint8Array(fe);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(le(e),e.length!==fe)throw new Error("bad secret key size");for(var t=new Uint8Array(he),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(le(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(he),r=new Uint8Array(fe),n=0;n<32;n++)r[n]=e[n];return ne(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=he,e.sign.secretKeyLength=fe,e.sign.seedLength=32,e.sign.signatureLength=ce,e.hash=function(e){le(e);var t=new Uint8Array(64);return Z(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return le(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===y(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=i[n];pe(i)})):(t=r(1160))&&t.randomBytes&&e.setPRNG((function(e,r){var n,i=t.randomBytes(r);for(n=0;n<r;n++)e[n]=i[n];pe(i)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},3744:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;const n=r(990);class i extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n.default(this.serialize(),o,2)}}function o(e,t){if("[Circular]"!==t)return t}t.EthereumRpcError=i,t.EthereumProviderError=class extends i{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},1770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},9620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;const n=r(3744),i=r(8649),o=r(1770);function s(e,t){const[r,o]=u(t);return new n.EthereumRpcError(e,r||i.getMessageFromCode(e),o)}function a(e,t){const[r,o]=u(t);return new n.EthereumProviderError(e,r||i.getMessageFromCode(e),o)}function u(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}t.ethErrors={rpc:{parse:e=>s(o.errorCodes.rpc.parse,e),invalidRequest:e=>s(o.errorCodes.rpc.invalidRequest,e),invalidParams:e=>s(o.errorCodes.rpc.invalidParams,e),methodNotFound:e=>s(o.errorCodes.rpc.methodNotFound,e),internal:e=>s(o.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:e=>s(o.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>s(o.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>s(o.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>s(o.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>s(o.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>s(o.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>a(o.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(o.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(o.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(o.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(o.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:i}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,i)}}}},8429:(e,t,r)=>{"use strict";t.Cg=t.Sy=void 0;const n=r(3744);Object.defineProperty(t,"Cg",{enumerable:!0,get:function(){return n.EthereumRpcError}});r(8649);const i=r(9620);Object.defineProperty(t,"Sy",{enumerable:!0,get:function(){return i.ethErrors}});r(1770)},8649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=r(1770),i=r(3744),o=n.errorCodes.rpc.internal,s={code:o,message:a(o)};function a(e,r="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const r=e.toString();if(f(n.errorValues,r))return n.errorValues[r].message;if(c(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function u(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!n.errorValues[t]||!!c(e)}function c(e){return e>=-32099&&e<=-32e3}function h(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=a,t.isValidCode=u,t.serializeError=function(e,{fallbackError:t=s,shouldIncludeStack:r=!1}={}){var n,o;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();const c={};if(e&&"object"==typeof e&&!Array.isArray(e)&&f(e,"code")&&u(e.code)){const t=e;c.code=t.code,t.message&&"string"==typeof t.message?(c.message=t.message,f(t,"data")&&(c.data=t.data)):(c.message=a(c.code),c.data={originalError:h(e)})}else{c.code=t.code;const r=null===(n=e)||void 0===n?void 0:n.message;c.message=r&&"string"==typeof r?r:t.message,c.data={originalError:h(e)}}const d=null===(o=e)||void 0===o?void 0:o.stack;return r&&e&&d&&"string"==typeof d&&(c.stack=d),c}},990:e=>{e.exports=s,s.default=s,s.stable=h,s.stableStringify=h;var t="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=o()),u(e,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(e,t,r):JSON.stringify(e,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function a(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:e}),n.push([o,r,t,s])):i.push([t,r,e]):(o[r]=e,n.push([o,r,t]))}function u(e,n,i,o,s,c,h){var f;if(c+=1,"object"==typeof e&&null!==e){for(f=0;f<o.length;f++)if(o[f]===e)return void a(r,e,n,s);if(void 0!==h.depthLimit&&c>h.depthLimit)return void a(t,e,n,s);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void a(t,e,n,s);if(o.push(e),Array.isArray(e))for(f=0;f<e.length;f++)u(e[f],f,f,o,e,c,h);else{var d=Object.keys(e);for(f=0;f<d.length;f++){var l=d[f];u(e[l],l,f,o,e,c,h)}}o.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function h(e,t,r,s){void 0===s&&(s=o());var a,u=f(e,"",0,[],void 0,0,s)||e;try{a=0===i.length?JSON.stringify(u,t,r):JSON.stringify(u,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function f(e,i,o,s,u,h,d){var l;if(h+=1,"object"==typeof e&&null!==e){for(l=0;l<s.length;l++)if(s[l]===e)return void a(r,e,i,u);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&h>d.depthLimit)return void a(t,e,i,u);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void a(t,e,i,u);if(s.push(e),Array.isArray(e))for(l=0;l<e.length;l++)f(e[l],l,l,s,e,h,d);else{var p={},y=Object.keys(e).sort(c);for(l=0;l<y.length;l++){var g=y[l];f(e[g],g,l,s,e,h,d),p[g]=e[g]}if(void 0===u)return p;n.push([u,i,e]),u[i]=p}s.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===t&&o[0]===r){r=o[2],i.splice(n,1);break}}return e.call(this,t,r)}}},7550:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},9012:e=>{function t(e,t,r,n,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,i)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(i,o){var s=e.apply(r,n);function a(e){t(s,i,o,a,u,"next",e)}function u(e){t(s,i,o,a,u,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6852:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},7599:e=>{function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},2905:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},3729:(e,t,r)=>{var n=r(7190);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},3148:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},7972:(e,t,r)=>{var n=r(9444).default,i=r(7550);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7190:e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9444:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9963:(e,t,r)=>{e.exports=r(6770)},4920:(e,t,r)=>{"use strict";t._O=t.Jq=t.KB=t.u8=t.cv=void 0,t.Ik=t.A9=t.n_=t.gM=void 0;const n=r(7487);function i(e){if(!(e instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function o(e){return i(e),n.Buffer.from(e.buffer,e.byteOffset,e.length)}class s{constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}function a(e,t){return t.property?e+"["+t.property+"]":e}class u extends s{isCount(){throw new Error("ExternalLayout is abstract")}}class c extends u{constructor(e,t=0,r){if(!(e instanceof s))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof h||this.layout instanceof f}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}}class h extends s{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return o(e).readUIntLE(t,this.span)}encode(e,t,r=0){return o(t).writeUIntLE(e,r,this.span),this.span}}class f extends s{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return o(e).readUIntBE(t,this.span)}encode(e,t,r=0){return o(t).writeUIntBE(e,r,this.span),this.span}}const d=Math.pow(2,32);function l(e){const t=Math.floor(e/d);return{hi32:t,lo32:e-t*d}}function p(e,t){return e*d+t}class y extends s{constructor(e){super(8,e)}decode(e,t=0){const r=o(e),n=r.readUInt32LE(t);return p(r.readUInt32LE(t+4),n)}encode(e,t,r=0){const n=l(e),i=o(t);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}}class g extends s{constructor(e){super(8,e)}decode(e,t=0){const r=o(e),n=r.readUInt32LE(t);return p(r.readInt32LE(t+4),n)}encode(e,t,r=0){const n=l(e),i=o(t);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}}class b extends s{constructor(e,t,r){if(!(e instanceof s))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof u&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;!(t instanceof u)&&0<e.span&&(n=t*e.span),super(n,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof u&&(n=n.decode(e,t)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let i=0;for(;i<n;)r+=this.elementLayout.getSpan(e,t+r),++i}return r}decode(e,t=0){const r=[];let n=0,i=this.count;for(i instanceof u&&(i=i.decode(e,t));n<i;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),n+=1;return r}encode(e,t,r=0){const n=this.elementLayout,i=e.reduce(((e,i)=>e+n.encode(i,t,r+e)),0);return this.count instanceof u&&this.count.encode(e.length,t,r),i}}class m extends s{constructor(e,t,r){if(!Array.isArray(e)||!e.reduce(((e,t)=>e&&t instanceof s),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof t&&void 0===r&&(r=t,t=void 0);for(const t of e)if(0>t.span&&void 0===t.property)throw new Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=e.reduce(((e,t)=>e+t.getSpan()),0)}catch(e){}super(n,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce(((r,n)=>{const i=n.getSpan(e,t);return t+=i,r+i}),0)}catch(e){throw new RangeError("indeterminate span")}return r}decode(e,t=0){i(e);const r=this.makeDestinationObject();for(const n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){const n=r;let i=0,o=0;for(const n of this.fields){let s=n.span;if(o=0<s?s:0,void 0!==n.property){const i=e[n.property];void 0!==i&&(o=n.encode(i,t,r),0>s&&(s=n.getSpan(t,r)))}i=r,r+=s}return i+o-n}fromArray(e){const t=this.makeDestinationObject();for(const r of this.fields)void 0!==r.property&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if("string"!=typeof e)throw new TypeError("property must be string");for(const t of this.fields)if(t.property===e)return t}offsetOf(e){if("string"!=typeof e)throw new TypeError("property must be string");let t=0;for(const r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}}class v extends s{constructor(e,t){if(!(e instanceof u&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof u||(r=e),super(r,t),this.length=e}getSpan(e,t){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),o(e).slice(t,t+r)}encode(e,t,r){let n=this.length;if(this.length instanceof u&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw new TypeError(a("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>t.length)throw new RangeError("encoding overruns Uint8Array");const i=o(e);return o(t).write(i.toString("hex"),r,n,"hex"),this.length instanceof u&&this.length.encode(n,t,r),n}}t.cv=(e,t,r)=>new c(e,t,r),t.u8=e=>new h(1,e),t.KB=e=>new h(2,e),t.Jq=e=>new h(4,e),t._O=e=>new y(e),t.gM=e=>new g(e),t.n_=(e,t,r)=>new m(e,t,r),t.A9=(e,t,r)=>new b(e,t,r),t.Ik=(e,t)=>new v(e,t)},7487:(e,t,r)=>{"use strict";const n=r(3350),i=r(3575),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return l(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return l(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return h(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return V(K(t,e.length-r),e,r,n)}function E(e,t,r,n){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function A(e,t,r,n){return V(G(t),e,r,n)}function S(e,t,r,n){return V(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(J(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),h=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==h[e]){o=c[e],s=h[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function T(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function z(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const q={};function j(e,t,r){q[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new q.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function $(e,t){if("number"!=typeof e)throw new q.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new q.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},6565:(e,t,r)=>{var n=r(6504);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},6504:(e,t,r)=>{"use strict";var n=r(7547).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==t[s])throw new TypeError(o+" is ambiguous");t[s]=i}var a=e.length,u=e.charAt(0),c=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,o=0;e[r]===u;)i++,r++;for(var s=(e.length-r)*c+1>>>0,h=new Uint8Array(s);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var d=0,l=s-1;(0!==f||d<o)&&-1!==l;l--,d++)f+=a*h[l]>>>0,h[l]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=d,r++}for(var p=s-o;p!==s&&0===h[p];)p++;var y=n.allocUnsafe(i+(s-p));y.fill(0,0,i);for(var g=i;p!==s;)y[g++]=h[p++];return y}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var c=(s-o)*h+1>>>0,f=new Uint8Array(c);o!==s;){for(var d=t[o],l=0,p=c-1;(0!==d||l<i)&&-1!==p;p--,l++)d+=256*f[p]>>>0,f[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");i=l,o++}for(var y=c-i;y!==c&&0===f[y];)y++;for(var g=u.repeat(r);y<c;++y)g+=e.charAt(f[y]);return g},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},3350:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),h=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[h++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7543:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(5377).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),u=t;u<a;u++){var c=e.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){h(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],l=[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],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,f=67108863&u,d=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=d;l++){var p=c-l|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[l])+f)/67108864|0,f=67108863&s}r.words[c]=0|f,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?d[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],h=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(h).toString(e);r=(f=f.idivn(h)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],f=8191&h,d=h>>>13,l=0|s[1],p=8191&l,y=l>>>13,g=0|s[2],b=8191&g,m=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],A=8191&E,S=E>>>13,M=0|s[5],x=8191&M,k=M>>>13,I=0|s[6],R=8191&I,B=I>>>13,T=0|s[7],U=8191&T,O=T>>>13,C=0|s[8],P=8191&C,z=C>>>13,L=0|s[9],N=8191&L,q=L>>>13,j=0|a[0],D=8191&j,F=j>>>13,$=0|a[1],H=8191&$,W=$>>>13,K=0|a[2],G=8191&K,V=K>>>13,J=0|a[3],Y=8191&J,Z=J>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],fe=8191&he,de=he>>>13,le=0|a[9],pe=8191&le,ye=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(f,D))|0)+((8191&(i=(i=Math.imul(f,F))+Math.imul(d,D)|0))<<13)|0;c=((o=Math.imul(d,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,F))+Math.imul(y,D)|0,o=Math.imul(y,F);var be=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;c=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,D),i=(i=Math.imul(b,F))+Math.imul(m,D)|0,o=Math.imul(m,F),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,W)|0;var me=(c+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(w,D),i=(i=Math.imul(w,F))+Math.imul(_,D)|0,o=Math.imul(_,F),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,V)|0;var ve=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,F))+Math.imul(S,D)|0,o=Math.imul(S,F),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Z)|0;var we=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,D),i=(i=Math.imul(x,F))+Math.imul(k,D)|0,o=Math.imul(k,F),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,D),i=(i=Math.imul(R,F))+Math.imul(B,D)|0,o=Math.imul(B,F),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,se)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,D),i=(i=Math.imul(U,F))+Math.imul(O,D)|0,o=Math.imul(O,F),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Ae=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,D),i=(i=Math.imul(P,F))+Math.imul(z,D)|0,o=Math.imul(z,F),n=n+Math.imul(U,H)|0,i=(i=i+Math.imul(U,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Se=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,D),i=(i=Math.imul(N,F))+Math.imul(q,D)|0,o=Math.imul(q,F),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(z,H)|0,o=o+Math.imul(z,W)|0,n=n+Math.imul(U,G)|0,i=(i=i+Math.imul(U,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,de)|0;var Me=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((o=o+Math.imul(d,ye)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,W))+Math.imul(q,H)|0,o=Math.imul(q,W),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(z,G)|0,o=o+Math.imul(z,V)|0,n=n+Math.imul(U,Y)|0,i=(i=i+Math.imul(U,Z)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(b,fe)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,G),i=(i=Math.imul(N,V))+Math.imul(q,G)|0,o=Math.imul(q,V),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(z,Y)|0,o=o+Math.imul(z,Z)|0,n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,de)|0;var ke=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,Y),i=(i=Math.imul(N,Z))+Math.imul(q,Y)|0,o=Math.imul(q,Z),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(z,Q)|0,o=o+Math.imul(z,ee)|0,n=n+Math.imul(U,re)|0,i=(i=i+Math.imul(U,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,de)|0;var Ie=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(N,Q),i=(i=Math.imul(N,ee))+Math.imul(q,Q)|0,o=Math.imul(q,ee),n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(z,re)|0,o=o+Math.imul(z,ne)|0,n=n+Math.imul(U,oe)|0,i=(i=i+Math.imul(U,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,de)|0;var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ye)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(N,re),i=(i=Math.imul(N,ne))+Math.imul(q,re)|0,o=Math.imul(q,ne),n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(z,oe)|0,o=o+Math.imul(z,se)|0,n=n+Math.imul(U,ue)|0,i=(i=i+Math.imul(U,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(B,fe)|0,o=o+Math.imul(B,de)|0;var Be=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(N,oe),i=(i=Math.imul(N,se))+Math.imul(q,oe)|0,o=Math.imul(q,se),n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(z,ue)|0,o=o+Math.imul(z,ce)|0,n=n+Math.imul(U,fe)|0,i=(i=i+Math.imul(U,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Te=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(N,ue),i=(i=Math.imul(N,ce))+Math.imul(q,ue)|0,o=Math.imul(q,ce),n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(z,fe)|0,o=o+Math.imul(z,de)|0;var Ue=(c+(n=n+Math.imul(U,pe)|0)|0)+((8191&(i=(i=i+Math.imul(U,ye)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ye)|0)+(i>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,n=Math.imul(N,fe),i=(i=Math.imul(N,de))+Math.imul(q,fe)|0,o=Math.imul(q,de);var Oe=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ye)|0)+Math.imul(z,pe)|0))<<13)|0;c=((o=o+Math.imul(z,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Ce=(c+(n=Math.imul(N,pe))|0)+((8191&(i=(i=Math.imul(N,ye))+Math.imul(q,pe)|0))<<13)|0;return c=((o=Math.imul(q,ye))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=ge,u[1]=be,u[2]=me,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Ae,u[8]=Se,u[9]=Me,u[10]=xe,u[11]=ke,u[12]=Ie,u[13]=Re,u[14]=Be,u[15]=Te,u[16]=Ue,u[17]=Oe,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,f=(0|e.words[h])*(0|t.words[c]),d=67108863&f;a=67108863&(d=d+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(e,t,r){return b(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=y),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?y(this,e,t):r<1024?b(this,e,t):m(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},v.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var f=u,d=c,l=0;l<s;l++){var p=r[h+l],y=n[h+l],g=r[h+l+s],b=n[h+l+s],m=f*g-d*b;b=f*b+d*g,g=m,r[h+l]=p+g,n[h+l]=y+b,r[h+l+s]=p-g,n[h+l+s]=y-b,l!==a&&(m=u*f-c*d,d=u*d+c*f,f=m)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},v.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,f,n,i);for(var l=0;l<n;l++){var p=a[l]*h[l]-u[l]*f[l];u[l]=a[l]*f[l]+u[l]*h[l],a[l]=p}return this.conjugate(a,u,n),this.transform(a,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),m(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var f=0|this.words[c];this.words[c]=h<<26-o|f>>>o,h=f&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),f=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(f)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0==(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new x(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}_.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(E,_),E.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},E.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(A,_),i(S,_),i(M,_),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new A;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return w[e]=t,t},x.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var f=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=s;0!==l.cmp(a);){for(var y=l,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));d=d.redMul(b),f=b.redSqr(),l=l.redMul(f),p=g}return d},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var f=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,x),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},9989:function(e,t,r){"use strict";var n=r(5326).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeUnchecked=t.deserialize=t.serialize=t.BinaryReader=t.BinaryWriter=t.BorshError=t.baseDecode=t.baseEncode=void 0;const c=u(r(7543)),h=u(r(3534)),f=a(r(9967)),d=new("function"!=typeof TextDecoder?f.TextDecoder:TextDecoder)("utf-8",{fatal:!0});t.baseEncode=function(e){return"string"==typeof e&&(e=n.from(e,"utf8")),h.default.encode(n.from(e))},t.baseDecode=function(e){return n.from(h.default.decode(e))};const l=1024;class p extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}t.BorshError=p;class y{constructor(){this.buf=n.alloc(l),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=n.concat([this.buf,n.alloc(l)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(n.from(new c.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(n.from(new c.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(n.from(new c.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(n.from(new c.default(e).toArray("le",64)))}writeBuffer(e){this.buf=n.concat([n.from(this.buf.subarray(0,this.length)),e,n.alloc(l)]),this.length+=e.length}writeString(e){this.maybeResize();const t=n.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(n.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(const r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}}function g(e,t,r){const n=r.value;r.value=function(...e){try{return n.apply(this,e)}catch(e){if(e instanceof RangeError){const t=e.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t)>=0)throw new p("Reached the end of buffer when deserializing")}throw e}}}t.BinaryWriter=y;class b{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new c.default(e,"le")}readU128(){const e=this.readBuffer(16);return new c.default(e,"le")}readU256(){const e=this.readBuffer(32);return new c.default(e,"le")}readU512(){const e=this.readBuffer(64);return new c.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new p(`Expected buffer length ${e} isn't within bounds`);const t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){const e=this.readU32(),t=this.readBuffer(e);try{return d.decode(t)}catch(e){throw new p(`Error decoding UTF-8 string: ${e}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const t=this.readU32(),r=Array();for(let n=0;n<t;++n)r.push(e());return r}}function m(e){return e.charAt(0).toUpperCase()+e.slice(1)}function v(e,t,r,n,i){try{if("string"==typeof n)i[`write${m(n)}`](r);else if(n instanceof Array)if("number"==typeof n[0]){if(r.length!==n[0])throw new p(`Expecting byte array of length ${n[0]}, but got ${r.length} bytes`);i.writeFixedArray(r)}else if(2===n.length&&"number"==typeof n[1]){if(r.length!==n[1])throw new p(`Expecting byte array of length ${n[1]}, but got ${r.length} bytes`);for(let t=0;t<n[1];t++)v(e,null,r[t],n[0],i)}else i.writeArray(r,(r=>{v(e,t,r,n[0],i)}));else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),v(e,t,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach(((r,o)=>{v(e,t,o,n.key,i),v(e,t,r,n.value,i)}));break;default:throw new p(`FieldType ${n} unrecognized`)}else w(e,r,i)}catch(e){throw e instanceof p&&e.addToFieldPath(t),e}}function w(e,t,r){if("function"==typeof t.borshSerialize)return void t.borshSerialize(r);const n=e.get(t.constructor);if(!n)throw new p(`Class ${t.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map((([n,i])=>{v(e,n,t[n],i,r)}));else{if("enum"!==n.kind)throw new p(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`);{const i=t[n.field];for(let o=0;o<n.values.length;++o){const[s,a]=n.values[o];if(s===i){r.writeU8(o),v(e,s,t[s],a,r);break}}}}}function _(e,t,r,n){try{if("string"==typeof r)return n[`read${m(r)}`]();if(r instanceof Array){if("number"==typeof r[0])return n.readFixedArray(r[0]);if("number"==typeof r[1]){const t=[];for(let i=0;i<r[1];i++)t.push(_(e,null,r[0],n));return t}return n.readArray((()=>_(e,t,r[0],n)))}if("option"===r.kind)return n.readU8()?_(e,t,r.type,n):void 0;if("map"===r.kind){let i=new Map;const o=n.readU32();for(let s=0;s<o;s++){const o=_(e,t,r.key,n),s=_(e,t,r.value,n);i.set(o,s)}return i}return E(e,r,n)}catch(e){throw e instanceof p&&e.addToFieldPath(t),e}}function E(e,t,r){if("function"==typeof t.borshDeserialize)return t.borshDeserialize(r);const n=e.get(t);if(!n)throw new p(`Class ${t.name} is missing in schema`);if("struct"===n.kind){const n={};for(const[i,o]of e.get(t).fields)n[i]=_(e,i,o,r);return new t(n)}if("enum"===n.kind){const i=r.readU8();if(i>=n.values.length)throw new p(`Enum index: ${i} is out of range`);const[o,s]=n.values[i];return new t({[o]:_(e,o,s,r)})}throw new p(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}s([g],b.prototype,"readU8",null),s([g],b.prototype,"readU16",null),s([g],b.prototype,"readU32",null),s([g],b.prototype,"readU64",null),s([g],b.prototype,"readU128",null),s([g],b.prototype,"readU256",null),s([g],b.prototype,"readU512",null),s([g],b.prototype,"readString",null),s([g],b.prototype,"readFixedArray",null),s([g],b.prototype,"readArray",null),t.BinaryReader=b,t.serialize=function(e,t,r=y){const n=new r;return w(e,t,n),n.toArray()},t.deserialize=function(e,t,r,n=b){const i=new n(r),o=E(e,t,i);if(i.offset<r.length)throw new p(`Unexpected ${r.length-i.offset} bytes after deserialized data`);return o},t.deserializeUnchecked=function(e,t,r,n=b){return E(e,t,new n(r))}},3534:(e,t,r)=>{var n=r(6504);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},2017:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(3325);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},5973:(e,t,r)=>{const n=r(5705);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},5705:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function h(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var r=0,n=0,i=0;e[r]===a;)n++,r++;for(var o=(e.length-r)*u+1>>>0,c=new Uint8Array(o);e[r];){var h=t[e.charCodeAt(r)];if(255===h)return;for(var f=0,d=o-1;(0!==h||f<i)&&-1!==d;d--,f++)h+=s*c[d]>>>0,c[d]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");i=f,r++}for(var l=o-i;l!==o&&0===c[l];)l++;for(var p=new Uint8Array(n+(o-l)),y=n;l!==o;)p[y++]=c[l++];return p}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var u=(o-i)*c+1>>>0,h=new Uint8Array(u);i!==o;){for(var f=t[i],d=0,l=u-1;(0!==f||d<n)&&-1!==l;l--,d++)f+=256*h[l]>>>0,h[l]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");n=d,i++}for(var p=u-n;p!==u&&0===h[p];)p++;for(var y=a.repeat(r);p<u;++p)y+=e.charAt(h[p]);return y},decodeUnsafe:h,decode:function(e){var t=h(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},5326:(e,t,r)=>{"use strict";const n=r(3350),i=r(3575),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return l(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return l(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return h(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return V(K(t,e.length-r),e,r,n)}function E(e,t,r,n){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function A(e,t,r,n){return V(G(t),e,r,n)}function S(e,t,r,n){return V(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(J(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),h=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==h[e]){o=c[e],s=h[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function T(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function z(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const q={};function j(e,t,r){q[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new q.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function $(e,t){if("number"!=typeof e)throw new q.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new q.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},2272:(e,t,r)=>{"use strict";var n=t;n.version=r(7330).i8,n.utils=r(7445),n.rand=r(2017),n.curve=r(3401),n.curves=r(3673),n.ec=r(2995),n.eddsa=r(303)},7017:(e,t,r)=>{"use strict";var n=r(2616),i=r(7445),o=i.getNAF,s=i.getJSF,a=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,u,c=[];for(s=0;s<n.length;s+=r.step){u=0;for(var h=s+r.step-1;h>=s;h--)u=(u<<1)+n[h];c.push(u)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(s=0;s<c.length;s++)(u=c[s])===l?d=d.mixedAdd(r.points[s]):u===-l&&(d=d.mixedAdd(r.points[s].neg()));f=f.add(d)}return f.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(t,r,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(var h=0;c>=0&&0===s[c];c--)h++;if(c>=0&&h++,u=u.dblp(h),c<0)break;var f=s[c];a(0!==f),u="affine"===e.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var a,u,c,h=this._wnafT1,f=this._wnafT2,d=this._wnafT3,l=0;for(a=0;a<n;a++){var p=(c=t[a])._getNAFPoints(e);h[a]=p.wnd,f[a]=p.points}for(a=n-1;a>=1;a-=2){var y=a-1,g=a;if(1===h[y]&&1===h[g]){var b=[t[y],null,null,t[g]];0===t[y].y.cmp(t[g].y)?(b[1]=t[y].add(t[g]),b[2]=t[y].toJ().mixedAdd(t[g].neg())):0===t[y].y.cmp(t[g].y.redNeg())?(b[1]=t[y].toJ().mixedAdd(t[g]),b[2]=t[y].add(t[g].neg())):(b[1]=t[y].toJ().mixedAdd(t[g]),b[2]=t[y].toJ().mixedAdd(t[g].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[y],r[g]);for(l=Math.max(v[0].length,l),d[y]=new Array(l),d[g]=new Array(l),u=0;u<l;u++){var w=0|v[0][u],_=0|v[1][u];d[y][u]=m[3*(w+1)+(_+1)],d[g][u]=0,f[y]=b}}else d[y]=o(r[y],h[y],this._bitLength),d[g]=o(r[g],h[g],this._bitLength),l=Math.max(d[y].length,l),l=Math.max(d[g].length,l)}var E=this.jpoint(null,null,null),A=this._wnafT4;for(a=l;a>=0;a--){for(var S=0;a>=0;){var M=!0;for(u=0;u<n;u++)A[u]=0|d[u][a],0!==A[u]&&(M=!1);if(!M)break;S++,a--}if(a>=0&&S++,E=E.dblp(S),a<0)break;for(u=0;u<n;u++){var x=A[u];0!==x&&(x>0?c=f[u][x-1>>1]:x<0&&(c=f[u][-x-1>>1].neg()),E="affine"===c.type?E.mixedAdd(c):E.add(c))}}for(a=0;a<n;a++)f[a]=null;return i?E:E.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},2418:(e,t,r)=>{"use strict";var n=r(7445),i=r(2616),o=r(3717),s=r(7017),a=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(t&&!u||!t&&u)&&(a=a.redNeg()),this.point(e,a)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,s.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),u=i.redMul(s),c=o.redMul(a),h=i.redMul(a),f=s.redMul(o);return this.curve.point(u,c,f,h)},c.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(e=s.redSub(a).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=s.redSub(a).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(t),c=o.redMul(s),h=a.redMul(u),f=o.redMul(u),d=s.redMul(a);return this.curve.point(c,h,d,f)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),c=i.redAdd(a),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),f=n.redMul(u).redMul(h);return this.curve.twisted?(t=n.redMul(c).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},3401:(e,t,r)=>{"use strict";var n=t;n.base=r(7017),n.short=r(1164),n.mont=r(7732),n.edwards=r(2418)},7732:(e,t,r)=>{"use strict";var n=r(2616),i=r(3717),o=r(7017),s=r(7445);function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new u(this,e,t)},a.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},1164:(e,t,r)=>{"use strict";var n=r(7445),i=r(2616),o=r(3717),s=r(7017),a=n.assert;function u(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,u,c,h,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,l=this.n.clone(),p=new i(1),y=new i(0),g=new i(0),b=new i(1),m=0;0!==d.cmpn(0);){var v=l.div(d);c=l.sub(v.mul(d)),h=g.sub(v.mul(p));var w=b.sub(v.mul(y));if(!n&&c.cmp(f)<0)t=u.neg(),r=p,n=c.neg(),o=h;else if(n&&2==++m)break;u=c,l=d,d=c,g=p,p=h,b=y,y=w}s=c.neg(),a=h;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),h=0;h<2*o;h++)n[h]=null,i[h]=null;return c},o(c,s.BasePoint),u.prototype.point=function(e,t,r){return new c(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,s.BasePoint),u.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),h=c.redMul(a),f=n.redMul(c),d=u.redSqr().redIAdd(h).redISub(f).redISub(f),l=u.redMul(f.redISub(d)).redISub(o.redMul(h)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,l,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=r.redMul(u),f=a.redSqr().redIAdd(c).redISub(h).redISub(h),d=a.redMul(h.redISub(f)).redISub(i.redMul(c)),l=this.z.redMul(s);return this.curve.jpoint(f,d,l)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),c=s.redAdd(s);for(t=0;t<e;t++){var h=o.redSqr(),f=c.redSqr(),d=f.redSqr(),l=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(u)),p=o.redMul(f),y=l.redSqr().redISub(p.redAdd(p)),g=p.redISub(y),b=l.redMul(g);b=b.redIAdd(b).redISub(d);var m=c.redMul(a);t+1<e&&(u=u.redMul(d)),o=y,a=m,c=b}return this.curve.jpoint(o,c.redMul(i),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),l=this.x.redAdd(f).redSqr().redISub(h).redISub(d);l=l.redIAdd(l);var p=h.redAdd(h).redIAdd(h),y=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),e=y.redISub(l).redISub(l),t=p.redMul(l.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},h.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),l=this.x.redSub(h).redMul(this.x.redAdd(h));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=l.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(h);var g=f.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=l.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(s),h=a.redSqr().redISub(c.redAdd(c)),f=c.redISub(h),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=a.redMul(f).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,l,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),h=t.redMul(c);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.x.redMul(a).redISub(h);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,d,l)},h.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},3673:(e,t,r)=>{"use strict";var n,i=t,o=r(1568),s=r(3401),a=r(7445).assert;function u(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(6517)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},2995:(e,t,r)=>{"use strict";var n=r(2616),i=r(7905),o=r(7445),s=r(3673),a=r(2017),u=o.assert,c=r(5467),h=r(309);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new c(this,e)},f.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),u=e.toArray("be",s),c=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(f)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var y=p.getX(),g=y.umod(this.n);if(0!==g.cmpn(0)){var b=l.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==y.cmp(g)?2:0);return o.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),m^=1),new h({r:g,s:b,recoveryParam:m})}}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new h(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),c=u.mul(e).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new h(t,i);var o=this.n,s=new n(e),a=t.r,c=t.s,f=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var l=t.r.invm(o),p=o.sub(s).mul(l).umod(o),y=c.mul(l).umod(o);return this.g.mulAdd(p,a,y)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new h(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},5467:(e,t,r)=>{"use strict";var n=r(2616),i=r(7445).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},309:(e,t,r)=>{"use strict";var n=r(2616),i=r(7445),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function h(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=u(e,r);if(!1===s)return!1;var c=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var h=u(e,r);if(!1===h)return!1;if(e.length!==h+r.place)return!1;var f=e.slice(r.place,h+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(c),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];h(n,t.length),(n=n.concat(t)).push(2),h(n,r.length);var o=n.concat(r),s=[48];return h(s,o.length),s=s.concat(o),i.encode(s,e)}},303:(e,t,r)=>{"use strict";var n=r(1568),i=r(3673),o=r(7445),s=o.assert,a=o.parseBytes,u=r(5624),c=r(3891);function h(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof h))return new h(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=h,h.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},h.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},h.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},h.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},h.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},h.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},h.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},h.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(e){return o.intFromLE(e)},h.prototype.isPoint=function(e){return e instanceof this.pointClass}},5624:(e,t,r)=>{"use strict";var n=r(7445),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},3891:(e,t,r)=>{"use strict";var n=r(2616),i=r(7445),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},6517:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},7445:(e,t,r)=>{"use strict";var n=t,i=r(2616),o=r(4076),s=r(1784);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),s=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(s),a=0==(1&c)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},2616:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(9312).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,f=67108863&u,d=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=d;l++){var p=c-l|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[l])+f)/67108864|0,f=67108863&s}r.words[c]=0|f,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],l=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],f=8191&h,d=h>>>13,l=0|s[1],p=8191&l,y=l>>>13,g=0|s[2],b=8191&g,m=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],A=8191&E,S=E>>>13,M=0|s[5],x=8191&M,k=M>>>13,I=0|s[6],R=8191&I,B=I>>>13,T=0|s[7],U=8191&T,O=T>>>13,C=0|s[8],P=8191&C,z=C>>>13,L=0|s[9],N=8191&L,q=L>>>13,j=0|a[0],D=8191&j,F=j>>>13,$=0|a[1],H=8191&$,W=$>>>13,K=0|a[2],G=8191&K,V=K>>>13,J=0|a[3],Y=8191&J,Z=J>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],fe=8191&he,de=he>>>13,le=0|a[9],pe=8191&le,ye=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(f,D))|0)+((8191&(i=(i=Math.imul(f,F))+Math.imul(d,D)|0))<<13)|0;c=((o=Math.imul(d,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,F))+Math.imul(y,D)|0,o=Math.imul(y,F);var be=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;c=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,D),i=(i=Math.imul(b,F))+Math.imul(m,D)|0,o=Math.imul(m,F),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,W)|0;var me=(c+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(w,D),i=(i=Math.imul(w,F))+Math.imul(_,D)|0,o=Math.imul(_,F),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,V)|0;var ve=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,F))+Math.imul(S,D)|0,o=Math.imul(S,F),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Z)|0;var we=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,D),i=(i=Math.imul(x,F))+Math.imul(k,D)|0,o=Math.imul(k,F),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,D),i=(i=Math.imul(R,F))+Math.imul(B,D)|0,o=Math.imul(B,F),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,se)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,D),i=(i=Math.imul(U,F))+Math.imul(O,D)|0,o=Math.imul(O,F),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Ae=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,D),i=(i=Math.imul(P,F))+Math.imul(z,D)|0,o=Math.imul(z,F),n=n+Math.imul(U,H)|0,i=(i=i+Math.imul(U,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Se=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,D),i=(i=Math.imul(N,F))+Math.imul(q,D)|0,o=Math.imul(q,F),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(z,H)|0,o=o+Math.imul(z,W)|0,n=n+Math.imul(U,G)|0,i=(i=i+Math.imul(U,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,de)|0;var Me=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((o=o+Math.imul(d,ye)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,W))+Math.imul(q,H)|0,o=Math.imul(q,W),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(z,G)|0,o=o+Math.imul(z,V)|0,n=n+Math.imul(U,Y)|0,i=(i=i+Math.imul(U,Z)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(b,fe)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,G),i=(i=Math.imul(N,V))+Math.imul(q,G)|0,o=Math.imul(q,V),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(z,Y)|0,o=o+Math.imul(z,Z)|0,n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,de)|0;var ke=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,Y),i=(i=Math.imul(N,Z))+Math.imul(q,Y)|0,o=Math.imul(q,Z),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(z,Q)|0,o=o+Math.imul(z,ee)|0,n=n+Math.imul(U,re)|0,i=(i=i+Math.imul(U,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,de)|0;var Ie=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(N,Q),i=(i=Math.imul(N,ee))+Math.imul(q,Q)|0,o=Math.imul(q,ee),n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(z,re)|0,o=o+Math.imul(z,ne)|0,n=n+Math.imul(U,oe)|0,i=(i=i+Math.imul(U,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,de)|0;var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ye)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(N,re),i=(i=Math.imul(N,ne))+Math.imul(q,re)|0,o=Math.imul(q,ne),n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(z,oe)|0,o=o+Math.imul(z,se)|0,n=n+Math.imul(U,ue)|0,i=(i=i+Math.imul(U,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(B,fe)|0,o=o+Math.imul(B,de)|0;var Be=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(N,oe),i=(i=Math.imul(N,se))+Math.imul(q,oe)|0,o=Math.imul(q,se),n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(z,ue)|0,o=o+Math.imul(z,ce)|0,n=n+Math.imul(U,fe)|0,i=(i=i+Math.imul(U,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Te=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(N,ue),i=(i=Math.imul(N,ce))+Math.imul(q,ue)|0,o=Math.imul(q,ce),n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(z,fe)|0,o=o+Math.imul(z,de)|0;var Ue=(c+(n=n+Math.imul(U,pe)|0)|0)+((8191&(i=(i=i+Math.imul(U,ye)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ye)|0)+(i>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,n=Math.imul(N,fe),i=(i=Math.imul(N,de))+Math.imul(q,fe)|0,o=Math.imul(q,de);var Oe=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ye)|0)+Math.imul(z,pe)|0))<<13)|0;c=((o=o+Math.imul(z,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Ce=(c+(n=Math.imul(N,pe))|0)+((8191&(i=(i=Math.imul(N,ye))+Math.imul(q,pe)|0))<<13)|0;return c=((o=Math.imul(q,ye))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=ge,u[1]=be,u[2]=me,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Ae,u[8]=Se,u[9]=Me,u[10]=xe,u[11]=ke,u[12]=Ie,u[13]=Re,u[14]=Be,u[15]=Te,u[16]=Ue,u[17]=Oe,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=l),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,f=(0|e.words[h])*(0|t.words[c]),d=67108863&f;a=67108863&(d=d+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var f=u,d=c,l=0;l<s;l++){var p=r[h+l],y=n[h+l],g=r[h+l+s],b=n[h+l+s],m=f*g-d*b;b=f*b+d*g,g=m,r[h+l]=p+g,n[h+l]=y+b,r[h+l+s]=p-g,n[h+l+s]=y-b,l!==a&&(m=u*f-c*d,d=u*d+c*f,f=m)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,f,n,i);for(var l=0;l<n;l++){var p=a[l]*h[l]-u[l]*f[l];u[l]=a[l]*f[l]+u[l]*h[l],a[l]=p}return this.conjugate(a,u,n),this.transform(a,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var f=0|this.words[c];this.words[c]=h<<26-o|f>>>o,h=f&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),f=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(f)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0==(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}m.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},i(v,m),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,m),i(_,m),i(E,m),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return b[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var f=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=s;0!==l.cmp(a);){for(var y=l,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));d=d.redMul(b),f=b.redSqr(),l=l.redMul(f),p=g}return d},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var f=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,A),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},8236:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||e,s),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],a]:e._events[u].push(a):(e._events[u]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,i,o,s){var a=r?r+e:e;if(!this._events[a])return!1;var u,c,h=this._events[a],f=arguments.length;if(h.fn){switch(h.once&&this.removeListener(e,h.fn,void 0,!0),f){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,t),!0;case 3:return h.fn.call(h.context,t,n),!0;case 4:return h.fn.call(h.context,t,n,i),!0;case 5:return h.fn.call(h.context,t,n,i,o),!0;case 6:return h.fn.call(h.context,t,n,i,o,s),!0}for(c=1,u=new Array(f-1);c<f;c++)u[c-1]=arguments[c];h.fn.apply(h.context,u)}else{var d,l=h.length;for(c=0;c<l;c++)switch(h[c].once&&this.removeListener(e,h[c].fn,void 0,!0),f){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,t);break;case 3:h[c].fn.call(h[c].context,t,n);break;case 4:h[c].fn.call(h[c].context,t,n,i);break;default:if(!u)for(d=1,u=new Array(f-1);d<f;d++)u[d-1]=arguments[d];h[c].fn.apply(h[c].context,u)}}return!0},a.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var u=0,c=[],h=a.length;u<h;u++)(a[u].fn!==t||i&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},1568:(e,t,r)=>{var n=t;n.utils=r(886),n.common=r(6925),n.sha=r(1036),n.ripemd=r(3020),n.hmac=r(9147),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},6925:(e,t,r)=>{"use strict";var n=r(886),i=r(4076);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},9147:(e,t,r)=>{"use strict";var n=r(886),i=r(4076);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},3020:(e,t,r)=>{"use strict";var n=r(886),i=r(6925),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function h(){if(!(this instanceof h))return new h;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(h,c),t.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],h=this.h[4],m=r,v=n,w=i,_=c,E=h,A=0;A<80;A++){var S=s(o(u(r,f(A,n,i,c),e[p[A]+t],d(A)),g[A]),h);r=h,h=c,c=o(i,10),i=n,n=S,S=s(o(u(m,f(79-A,v,w,_),e[y[A]+t],l(A)),b[A]),E),m=E,E=_,_=o(w,10),w=v,v=S}S=a(this.h[1],i,_),this.h[1]=a(this.h[2],c,E),this.h[2]=a(this.h[3],h,m),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=S},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],b=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},1036:(e,t,r)=>{"use strict";t.sha1=r(5654),t.sha224=r(8513),t.sha256=r(8221),t.sha384=r(7212),t.sha512=r(6439)},5654:(e,t,r)=>{"use strict";var n=r(886),i=r(6925),o=r(4389),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=o.ft_1,h=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,h),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],h=this.h[2],d=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=u(s(i,5),c(p,o,h,d),l,r[n],f[p]);l=d,d=h,h=s(o,30),o=i,i=y}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],l)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8513:(e,t,r)=>{"use strict";var n=r(886),i=r(8221);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},8221:(e,t,r)=>{"use strict";var n=r(886),i=r(6925),o=r(4389),s=r(4076),a=n.sum32,u=n.sum32_4,c=n.sum32_5,h=o.ch32,f=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,y=o.g1_256,g=i.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function m(){if(!(this instanceof m))return new m;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}n.inherits(m,g),e.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],b=this.h[3],m=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=c(_,l(m),h(m,v,w),this.k[n],r[n]),A=a(d(i),f(i,o,g));_=w,w=v,v=m,m=a(b,E),b=g,g=o,o=i,i=a(E,A)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],b),this.h[4]=a(this.h[4],m),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},m.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7212:(e,t,r)=>{"use strict";var n=r(886),i=r(6439);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},6439:(e,t,r)=>{"use strict";var n=r(886),i=r(6925),o=r(4076),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,h=n.sum64,f=n.sum64_hi,d=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,g=n.sum64_5_lo,b=i.BlockHash,m=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function _(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function A(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function S(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function k(e,t){var r=s(e,t,1)^s(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,1)^a(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=a(e,t,19)^a(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,b),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=(g=r[n-4],b=r[n-3],m=void 0,(m=s(g,b,19)^s(b,g,29)^u(g,b,6))<0&&(m+=4294967296),m),o=R(r[n-4],r[n-3]),a=r[n-14],c=r[n-13],h=k(r[n-30],r[n-29]),f=I(r[n-30],r[n-29]),d=r[n-32],y=r[n-31];r[n]=l(i,o,a,c,h,f,d,y),r[n+1]=p(i,o,a,c,h,f,d,y)}var g,b,m},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,i,a=this.W,u=this.h[0],c=this.h[1],l=this.h[2],p=this.h[3],b=this.h[4],m=this.h[5],v=this.h[6],k=this.h[7],I=this.h[8],R=this.h[9],B=this.h[10],T=this.h[11],U=this.h[12],O=this.h[13],C=this.h[14],P=this.h[15];o(this.k.length===a.length);for(var z=0;z<a.length;z+=2){var L=C,N=P,q=(i=void 0,(i=s(r=I,n=R,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),j=x(I,R),D=w(I,0,B,0,U),F=_(0,R,0,T,0,O),$=this.k[z],H=this.k[z+1],W=a[z],K=a[z+1],G=y(L,N,q,j,D,F,$,H,W,K),V=g(L,N,q,j,D,F,$,H,W,K);L=S(u,c),N=M(u,c),q=E(u,0,l,0,b),j=A(0,c,0,p,0,m);var J=f(L,N,q,j),Y=d(L,N,q,j);C=U,P=O,U=B,O=T,B=I,T=R,I=f(v,k,G,V),R=d(k,k,G,V),v=b,k=m,b=l,m=p,l=u,p=c,u=f(G,V,J,Y),c=d(G,V,J,Y)}h(this.h,0,u,c),h(this.h,2,l,p),h(this.h,4,b,m),h(this.h,6,v,k),h(this.h,8,I,R),h(this.h,10,B,T),h(this.h,12,U,O),h(this.h,14,C,P)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},4389:(e,t,r)=>{"use strict";var n=r(886).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},886:(e,t,r)=>{"use strict";var n=r(4076),i=r(3717);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=u(i.toString(16))}return r},t.zero2=a,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var s=new Array(o/4),a=0,u=t;a<s.length;a++,u+=4){var c;c="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],s[a]=c>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,u,c){var h=0,f=t;return h+=(f=f+n>>>0)<t?1:0,h+=(f=f+o>>>0)<o?1:0,h+=(f=f+a>>>0)<a?1:0,e+r+i+s+u+(h+=(f=f+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,u,c){return t+n+o+a+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},7905:(e,t,r)=>{"use strict";var n=r(1568),i=r(1784),o=r(4076);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},3575:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,h=-7,f=r?i-1:0,d=r?-1:1,l=e[t+f];for(f+=d,o=l&(1<<-h)-1,l>>=-h,h+=a;h>0;o=256*o+e[t+f],f+=d,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+e[t+f],f+=d,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=c}return(l?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,f=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+l]=255&a,l+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+l]=255&s,l+=p,s/=256,c-=8);e[r+l-p]|=128*y}},3717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6350:(e,t,r)=>{"use strict";const n=r(3141).v4,i=r(6661),o=function(e,t){if(!(this instanceof o))return new o(e,t);t||(t={}),this.options={reviver:void 0!==t.reviver?t.reviver:null,replacer:void 0!==t.replacer?t.replacer:null,generator:void 0!==t.generator?t.generator:function(){return n()},version:void 0!==t.version?t.version:2,notificationIdNull:"boolean"==typeof t.notificationIdNull&&t.notificationIdNull},this.callServer=e};e.exports=o,o.prototype.request=function(e,t,r,n){const o=this;let s=null;const a=Array.isArray(e)&&"function"==typeof t;if(1===this.options.version&&a)throw new TypeError("JSON-RPC 1.0 does not support batching");if(a||!a&&e&&"object"==typeof e&&"function"==typeof t)n=t,s=e;else{"function"==typeof r&&(n=r,r=void 0);const o="function"==typeof n;try{s=i(e,t,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(e){if(o)return n(e);throw e}if(!o)return s}let u;try{u=JSON.stringify(s,this.options.replacer)}catch(e){return n(e)}return this.callServer(u,(function(e,t){o._parseResponse(e,t,n)})),s},o.prototype._parseResponse=function(e,t,r){if(e)return void r(e);if(!t)return r();let n;try{n=JSON.parse(t,this.options.reviver)}catch(e){return r(e)}if(3===r.length){if(Array.isArray(n)){const e=function(e){return void 0!==e.error},t=function(t){return!e(t)};return r(null,n.filter(e),n.filter(t))}return r(null,n.error,n.result)}r(null,n)}},6661:(e,t,r)=>{"use strict";const n=r(3141).v4;e.exports=function(e,t,r,i){if("string"!=typeof e)throw new TypeError(e+" must be a string");const o="number"==typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw new TypeError(o+" must be 1 or 2");const s={method:e};if(2===o&&(s.jsonrpc="2.0"),t){if("object"!=typeof t&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");s.params=t}if(void 0===r){const e="function"==typeof i.generator?i.generator:function(){return n()};s.id=e(s,i)}else 2===o&&null===r?i.notificationIdNull&&(s.id=null):s.id=r;return s}},5498:(e,t,r)=>{var n;!function(){"use strict";var i="input is invalid type",o="object"==typeof window,s=o?window:{};s.JS_SHA3_NO_WINDOW&&(o=!1);var a=!o&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?s=r.g:a&&(s=self);var u=!s.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,h=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),d=[4,1024,262144,67108864],l=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],y=[224,256,384,512],g=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var v=function(e,t,r){return function(n){return new C(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,i){return new C(e,t,i).update(n)[r]()}},_=function(e,t,r){return function(t,n,i,o){return x["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return x["kmac"+e].update(t,n,i,o)[r]()}},A=function(e,t,r,n){for(var i=0;i<b.length;++i){var o=b[i];e[o]=t(r,n,o)}return e},S=function(e,t){var r=v(e,t,"hex");return r.create=function(){return new C(e,t,e)},r.update=function(e){return r.create().update(e)},A(r,v,e,t)},M=[{name:"keccak",padding:[1,256,65536,16777216],bits:y,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:y,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var r=w(e,t,"hex");return r.create=function(r){return new C(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},A(r,w,e,t)}},{name:"cshake",padding:d,bits:g,createMethod:function(e,t){var r=m[e],n=_(e,0,"hex");return n.create=function(n,i,o){return i||o?new C(e,t,n).bytepad([i,o],r):x["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},A(n,_,e,t)}},{name:"kmac",padding:d,bits:g,createMethod:function(e,t){var r=m[e],n=E(e,0,"hex");return n.create=function(n,i,o){return new P(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},A(n,E,e,t)}}],x={},k=[],I=0;I<M.length;++I)for(var R=M[I],B=R.bits,T=0;T<B.length;++T){var U=R.name+"_"+B[T];if(k.push(U),x[U]=R.createMethod(B[T],R.padding),"sha3"!==R.name){var O=R.name+B[T];k.push(O),x[O]=x[U]}}function C(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function P(e,t,r){C.call(this,e,t,r)}C.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,s=this.blocks,a=this.byteCount,u=e.length,c=this.blockCount,f=0,d=this.s;f<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<c+1;++n)s[n]=0;if(t)for(n=this.start;f<u&&n<a;++f)s[n>>2]|=e[f]<<l[3&n++];else for(n=this.start;f<u&&n<a;++f)(o=e.charCodeAt(f))<128?s[n>>2]|=o<<l[3&n++]:o<2048?(s[n>>2]|=(192|o>>6)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]):o<55296||o>=57344?(s[n>>2]|=(224|o>>12)<<l[3&n++],s[n>>2]|=(128|o>>6&63)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++f)),s[n>>2]|=(240|o>>18)<<l[3&n++],s[n>>2]|=(128|o>>12&63)<<l[3&n++],s[n>>2]|=(128|o>>6&63)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[c],n=0;n<c;++n)d[n]^=s[n];z(d),this.reset=!0}else this.start=n}return this},C.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},C.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,o=e.length;if(t)n=o;else for(var s=0;s<e.length;++s){var a=e.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(e),n},C.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];z(n)}},C.prototype.toString=C.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<t&&s<n;++o,++s)e=r[o],a+=f[e>>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];s%t==0&&(z(r),o=0)}return i&&(e=r[o],a+=f[e>>4&15]+f[15&e],i>1&&(a+=f[e>>12&15]+f[e>>8&15]),i>2&&(a+=f[e>>20&15]+f[e>>16&15])),a},C.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s<n;){for(o=0;o<t&&s<n;++o,++s)u[s]=r[o];s%t==0&&z(r)}return i&&(u[o]=r[o],e=e.slice(0,a)),e},C.prototype.buffer=C.prototype.arrayBuffer,C.prototype.digest=C.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)e=a<<2,t=n[s],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&z(n)}return o&&(e=a<<2,t=n[s],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},P.prototype=new C,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var z=function(e){var t,r,n,i,o,s,a,u,c,h,f,d,l,y,g,b,m,v,w,_,E,A,S,M,x,k,I,R,B,T,U,O,C,P,z,L,N,q,j,D,F,$,H,W,K,G,V,J,Y,Z,X,Q,ee,te,re,ne,ie,oe,se,ae,ue,ce,he;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(l=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(h<<1|f>>>31),r=a^(f<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(d<<1|l>>>31),r=c^(l<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,y=e[0],g=e[1],G=e[11]<<4|e[10]>>>28,V=e[10]<<4|e[11]>>>28,R=e[20]<<3|e[21]>>>29,B=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,$=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,P=e[2]<<1|e[3]>>>31,z=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,U=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,he=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,N=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,C=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,q=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,D=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=y^~b&v,e[1]=g^~m&w,e[10]=M^~k&R,e[11]=x^~I&B,e[20]=P^~L&q,e[21]=z^~N&j,e[30]=W^~G&J,e[31]=K^~V&Y,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=b^~v&_,e[3]=m^~w&E,e[12]=k^~R&T,e[13]=I^~B&U,e[22]=L^~q&D,e[23]=N^~j&F,e[32]=G^~J&Z,e[33]=V^~Y&X,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=v^~_&A,e[5]=w^~E&S,e[14]=R^~T&O,e[15]=B^~U&C,e[24]=q^~D&$,e[25]=j^~F&H,e[34]=J^~Z&Q,e[35]=Y^~X&ee,e[44]=oe^~ae&ce,e[45]=se^~ue&he,e[6]=_^~A&y,e[7]=E^~S&g,e[16]=T^~O&M,e[17]=U^~C&x,e[26]=D^~$&P,e[27]=F^~H&z,e[36]=Z^~Q&W,e[37]=X^~ee&K,e[46]=ae^~ce&te,e[47]=ue^~he&re,e[8]=A^~y&b,e[9]=S^~g&m,e[18]=O^~M&k,e[19]=C^~x&I,e[28]=$^~P&L,e[29]=H^~z&N,e[38]=Q^~W&G,e[39]=ee^~K&V,e[48]=ce^~te&ne,e[49]=he^~re&ie,e[0]^=p[n],e[1]^=p[n+1]};if(u)e.exports=x;else{for(I=0;I<k.length;++I)s[k[I]]=x[k[I]];c&&(void 0===(n=function(){return x}.call(t,r,t,e))||(e.exports=n))}}()},4076:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},1784:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},6770:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),s=new I(n||[]);return o._invoke=function(e,t,r){var n=f;return function(i,o){if(n===l)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return B()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=M(s,r);if(a){if(a===y)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var u=h(e,t,r);if("normal"===u.type){if(n=r.done?p:d,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(e,r,s),o}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",d="suspendedYield",l="executing",p="completed",y={};function g(){}function b(){}function m(){}var v={};u(v,o,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(R([])));_&&_!==r&&n.call(_,o)&&(v=_);var E=m.prototype=g.prototype=Object.create(v);function A(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(i,o,s,a){var u=h(e[i],e,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,a)}))}a(u.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function M(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,M(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var i=h(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function R(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}return{next:B}}function B(){return{value:t,done:!0}}return b.prototype=m,u(E,"constructor",m),u(m,"constructor",b),b.displayName=u(m,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,a,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},A(S.prototype),u(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new S(c(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},A(E),u(E,a,"Generator"),u(E,o,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=R,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},4217:(e,t,r)=>{"use strict";var n=r(3148),i=n(r(7599)),o=n(r(6852)),s=n(r(3729)),a=n(r(7972)),u=n(r(2905)),c=n(r(8721));n(r(2666)).default},2666:(e,t,r)=>{"use strict";var n=r(5326).Buffer,i=r(3148);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(r(9963)),s=i(r(9012)),a=i(r(9444)),u=i(r(6852)),c=i(r(7599)),h=i(r(3729)),f=i(r(7972)),d=i(r(2905)),l=r(8236);var p=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},y=function(e){(0,h.default)(m,e);var t,r,i,l,y,g,b=(y=m,g=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,d.default)(y);if(g){var r=(0,d.default)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,f.default)(this,e)});function m(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:8080",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;(0,u.default)(this,m);var o=n.autoconnect,s=void 0===o||o,a=n.reconnect,c=void 0===a||a,h=n.reconnect_interval,f=void 0===h?1e3:h,d=n.max_reconnects,l=void 0===d?5:d,y=p(n,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return(t=b.call(this)).webSocketFactory=e,t.queue={},t.rpc_id=0,t.address=r,t.autoconnect=s,t.ready=!1,t.reconnect=c,t.reconnect_interval=f,t.max_reconnects=l,t.rest_options=y,t.current_reconnects=0,t.generate_request_id=i||function(){return++t.rpc_id},t.autoconnect&&t._connect(t.address,Object.assign({autoconnect:t.autoconnect,reconnect:t.reconnect,reconnect_interval:t.reconnect_interval,max_reconnects:t.max_reconnects},t.rest_options)),t}return(0,c.default)(m,[{key:"connect",value:function(){this.socket||this._connect(this.address,Object.assign({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(e,t,r,n){var i=this;return n||"object"!==(0,a.default)(r)||(n=r,r=null),new Promise((function(o,s){if(!i.ready)return s(new Error("socket not ready"));var a=i.generate_request_id(e,t),u={jsonrpc:"2.0",method:e,params:t||null,id:a};i.socket.send(JSON.stringify(u),n,(function(e){if(e)return s(e);i.queue[a]={promise:[o,s]},r&&(i.queue[a].timeout=setTimeout((function(){delete i.queue[a],s(new Error("reply timeout"))}),r))}))}))}},{key:"login",value:(l=(0,s.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("rpc.login",t);case 2:if(r=e.sent){e.next=5;break}throw new Error("authentication failed");case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"listMethods",value:(i=(0,s.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("__listMethods");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"notify",value:function(e,t){var r=this;return new Promise((function(n,i){if(!r.ready)return i(new Error("socket not ready"));var o={jsonrpc:"2.0",method:e,params:t||null};r.socket.send(JSON.stringify(o),(function(e){if(e)return i(e);n()}))}))}},{key:"subscribe",value:(r=(0,s.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.on",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed subscribing to an event '"+t+"' with: "+r[t]);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"unsubscribe",value:(t=(0,s.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.off",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed unsubscribing from an event with: "+r);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"close",value:function(e,t){this.socket.close(e||1e3,t)}},{key:"_connect",value:function(e,t){var r=this;this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",(function(){r.ready=!0,r.emit("open"),r.current_reconnects=0})),this.socket.addEventListener("message",(function(e){var t=e.data;t instanceof ArrayBuffer&&(t=n.from(t).toString());try{t=JSON.parse(t)}catch(e){return}if(t.notification&&r.listeners(t.notification).length){if(!Object.keys(t.params).length)return r.emit(t.notification);var i=[t.notification];if(t.params.constructor===Object)i.push(t.params);else for(var o=0;o<t.params.length;o++)i.push(t.params[o]);return Promise.resolve().then((function(){r.emit.apply(r,i)}))}if(!r.queue[t.id])return t.method&&t.params?Promise.resolve().then((function(){r.emit(t.method,t.params)})):void 0;"error"in t=="result"in t&&r.queue[t.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),r.queue[t.id].timeout&&clearTimeout(r.queue[t.id].timeout),t.error?r.queue[t.id].promise[1](t.error):r.queue[t.id].promise[0](t.result),delete r.queue[t.id]})),this.socket.addEventListener("error",(function(e){return r.emit("error",e)})),this.socket.addEventListener("close",(function(n){var i=n.code,o=n.reason;r.ready&&setTimeout((function(){return r.emit("close",i,o)}),0),r.ready=!1,r.socket=void 0,1e3!==i&&(r.current_reconnects++,r.reconnect&&(r.max_reconnects>r.current_reconnects||0===r.max_reconnects)&&setTimeout((function(){return r._connect(e,t)}),r.reconnect_interval))}))}}]),m}(l.EventEmitter);t.default=y},8721:(e,t,r)=>{"use strict";var n=r(3148);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return new c(e,t)};var i=n(r(6852)),o=n(r(7599)),s=n(r(3729)),a=n(r(7972)),u=n(r(2905));var c=function(e){(0,s.default)(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,u.default)(t);if(r){var i=(0,u.default)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,a.default)(this,e)});function c(e,t,r){var o;return(0,i.default)(this,c),(o=n.call(this)).socket=new window.WebSocket(e,r),o.socket.onopen=function(){return o.emit("open")},o.socket.onmessage=function(e){return o.emit("message",e.data)},o.socket.onerror=function(e){return o.emit("error",e)},o.socket.onclose=function(e){o.emit("close",e.code,e.reason)},o}return(0,o.default)(c,[{key:"send",value:function(e,t,r){var n=r||t;try{this.socket.send(e),n()}catch(e){n(e)}}},{key:"close",value:function(e,t){this.socket.close(e,t)}},{key:"addEventListener",value:function(e,t,r){this.socket.addEventListener(e,t,r)}}]),c}(r(8236).EventEmitter)},7547:(e,t,r)=>{var n=r(5326),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},5293:(e,t,r)=>{e.exports=r(150)(r(4701))},4701:(e,t,r)=>{const n=new(0,r(2272).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function s(e){const t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){let r=new o(t);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let s=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===e!==s.isOdd()&&(s=s.redNeg()),n.keyPair({pub:{x:r,y:s}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){let s=new o(t),a=new o(r);if(s.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(s=s.toRed(i.red),a=a.toRed(i.red),(6===e||7===e)&&a.isOdd()!==(7===e))return null;const u=s.redSqr().redIMul(s);return a.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:a}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function a(e,t){const r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}e.exports={contextRandomize:()=>0,privateKeyVerify(e){const t=new o(e);return t.cmp(i.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new o(e),r=i.n.sub(t).umod(i.n).toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakAdd(e,t){const r=new o(t);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(e)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},privateKeyTweakMul(e,t){let r=new o(t);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(e)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},publicKeyVerify:e=>null===s(e)?1:0,publicKeyCreate(e,t){const r=new o(t);return r.cmp(i.n)>=0||r.isZero()?1:(a(e,n.keyFromPrivate(t).getPublic()),0)},publicKeyConvert(e,t){const r=s(t);return null===r?1:(a(e,r.getPublic()),0)},publicKeyNegate(e,t){const r=s(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),a(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=s(t[e]),null===r[e])return 1;let n=r[0].getPublic();for(let e=1;e<r.length;++e)n=n.add(r[e].pub);return n.isInfinity()?2:(a(e,n),0)},publicKeyTweakAdd(e,t,r){const n=s(t);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(a(e,u),0)},publicKeyTweakMul(e,t,r){const n=s(t);return null===n?1:(r=new o(r)).cmp(i.n)>=0||r.isZero()?2:(a(e,n.getPublic().mul(r)),0)},signatureNormalize(e){const t=new o(e.subarray(0,32)),r=new o(e.subarray(32,64));return t.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&e.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const r=t.subarray(0,32),n=t.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:s}=e;let a=s.subarray(4,37);a[0]=0,a.set(r,1);let u=33,c=0;for(;u>1&&0===a[c]&&!(128&a[c+1]);--u,++c);if(a=a.subarray(c),128&a[0])return 1;if(u>1&&0===a[0]&&!(128&a[1]))return 1;let h=s.subarray(39,72);h[0]=0,h.set(n,1);let f=33,d=0;for(;f>1&&0===h[d]&&!(128&h[d+1]);--f,++d);return h=h.subarray(d),128&h[0]||f>1&&0===h[0]&&!(128&h[1])?1:(e.outputlen=6+u+f,s[0]=48,s[1]=e.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+u]=2,s[5+u]=h.length,s.set(h,6+u),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const r=t[3];if(0===r)return 1;if(5+r>=t.length)return 1;if(2!==t[4+r])return 1;const n=t[5+r];if(0===n)return 1;if(6+r+n!==t.length)return 1;if(128&t[4])return 1;if(r>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[r+6])return 1;if(n>1&&0===t[r+6]&&!(128&t[r+7]))return 1;let s=t.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=t.subarray(6+r);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let u=new o(s);u.cmp(i.n)>=0&&(u=new o(0));let c=new o(t.subarray(6+r));return c.cmp(i.n)>=0&&(c=new o(0)),e.set(u.toArrayLike(Uint8Array,"be",32),0),e.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,s,a){if(a){const e=a;a=n=>{const i=e(t,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let c;try{c=n.sign(t,r,{canonical:!0,k:a,pers:s})}catch(e){return 1}return e.signature.set(c.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(c.s.toArrayLike(Uint8Array,"be",32),32),e.recid=c.recoveryParam,0},ecdsaVerify(e,t,r){const a={r:e.subarray(0,32),s:e.subarray(32,64)},u=new o(a.r),c=new o(a.s);if(u.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(1===c.cmp(n.nh)||u.isZero()||c.isZero())return 3;const h=s(r);if(null===h)return 2;const f=h.getPublic();return n.verify(t,a,f)?0:3},ecdsaRecover(e,t,r,s){const u={r:t.slice(0,32),s:t.slice(32,64)},c=new o(u.r),h=new o(u.s);if(c.cmp(i.n)>=0||h.cmp(i.n)>=0)return 1;if(c.isZero()||h.isZero())return 2;let f;try{f=n.recoverPubKey(s,u,r)}catch(e){return 2}return a(e,f),0},ecdh(e,t,r,a,u,c,h){const f=s(t);if(null===f)return 1;const d=new o(r);if(d.cmp(i.n)>=0||d.isZero())return 2;const l=f.getPublic().mul(d);if(void 0===u){const t=l.encode(null,!0),r=n.hash().update(t).digest();for(let t=0;t<32;++t)e[t]=r[t]}else{c||(c=new Uint8Array(32));const t=l.getX().toArray("be",32);for(let e=0;e<32;++e)c[e]=t[e];h||(h=new Uint8Array(32));const r=l.getY().toArray("be",32);for(let e=0;e<32;++e)h[e]=r[e];const n=u(c,h,a);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}}},150:e=>{const t="Impossible case. Please create issue.",r="The tweak was out of range or the resulted private key is invalid",n="The tweak was out of range or equal to zero",i="Public Key could not be parsed",o="Public Key serialization error",s="Signature could not be parsed";function a(e,t){if(!e)throw new Error(t)}function u(e,t,r){if(a(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;a(r.includes(t.length),n)}else{const n=`Expected ${e} to be an Uint8Array with length ${r}`;a(t.length===r,n)}}function c(e){a("Boolean"===f(e),"Expected compressed to be a Boolean")}function h(e=(e=>new Uint8Array(e)),t){return"function"==typeof e&&(e=e(t)),u("output",e,t),e}function f(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=e=>({contextRandomize(t){if(a(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&u("seed",t,32),1===e.contextRandomize(t))throw new Error("Unknow error on context randomization")},privateKeyVerify:t=>(u("private key",t,32),0===e.privateKeyVerify(t)),privateKeyNegate(r){switch(u("private key",r,32),e.privateKeyNegate(r)){case 0:return r;case 1:throw new Error(t)}},privateKeyTweakAdd(t,n){switch(u("private key",t,32),u("tweak",n,32),e.privateKeyTweakAdd(t,n)){case 0:return t;case 1:throw new Error(r)}},privateKeyTweakMul(t,r){switch(u("private key",t,32),u("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(n)}},publicKeyVerify:t=>(u("public key",t,[33,65]),0===e.publicKeyVerify(t)),publicKeyCreate(t,r=!0,n){switch(u("private key",t,32),c(r),n=h(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error("Private Key is invalid");case 2:throw new Error(o)}},publicKeyConvert(t,r=!0,n){switch(u("public key",t,[33,65]),c(r),n=h(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error(o)}},publicKeyNegate(r,n=!0,s){switch(u("public key",r,[33,65]),c(n),s=h(s,n?33:65),e.publicKeyNegate(s,r)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(t);case 3:throw new Error(o)}},publicKeyCombine(t,r=!0,n){a(Array.isArray(t),"Expected public keys to be an Array"),a(t.length>0,"Expected public keys array will have more than zero items");for(const e of t)u("public key",e,[33,65]);switch(c(r),n=h(n,r?33:65),e.publicKeyCombine(n,t)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error("The sum of the public keys is not valid");case 3:throw new Error(o)}},publicKeyTweakAdd(t,n,o=!0,s){switch(u("public key",t,[33,65]),u("tweak",n,32),c(o),s=h(s,o?33:65),e.publicKeyTweakAdd(s,t,n)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(r)}},publicKeyTweakMul(t,r,o=!0,s){switch(u("public key",t,[33,65]),u("tweak",r,32),c(o),s=h(s,o?33:65),e.publicKeyTweakMul(s,t,r)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(n)}},signatureNormalize(t){switch(u("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(s)}},signatureExport(r,n){u("signature",r,64);const i={output:n=h(n,72),outputlen:72};switch(e.signatureExport(i,r)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(s);case 2:throw new Error(t)}},signatureImport(r,n){switch(u("signature",r),n=h(n,64),e.signatureImport(n,r)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(t)}},ecdsaSign(r,n,i={},o){u("message",r,32),u("private key",n,32),a("Object"===f(i),"Expected options to be an Object"),void 0!==i.data&&u("options.data",i.data),void 0!==i.noncefn&&a("Function"===f(i.noncefn),"Expected options.noncefn to be a Function");const s={signature:o=h(o,64),recid:null};switch(e.ecdsaSign(s,r,n,i.data,i.noncefn)){case 0:return s;case 1:throw new Error("The nonce generation function failed, or the private key was invalid");case 2:throw new Error(t)}},ecdsaVerify(t,r,n){switch(u("signature",t,64),u("message",r,32),u("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(s);case 2:throw new Error(i)}},ecdsaRecover(r,n,i,o=!0,d){switch(u("signature",r,64),a("Number"===f(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),u("message",i,32),c(o),d=h(d,o?33:65),e.ecdsaRecover(d,r,n,i)){case 0:return d;case 1:throw new Error(s);case 2:throw new Error("Public key could not be recover");case 3:throw new Error(t)}},ecdh(t,r,n={},o){switch(u("public key",t,[33,65]),u("private key",r,32),a("Object"===f(n),"Expected options to be an Object"),void 0!==n.data&&u("options.data",n.data),void 0!==n.hashfn?(a("Function"===f(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&u("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&u("options.ybuf",n.ybuf,32),u("output",o)):o=h(o,32),e.ecdh(o,t,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return o;case 1:throw new Error(i);case 2:throw new Error("Scalar was invalid (zero or overflow)")}}})},9967:(e,t)=>{"use strict";function r(e,t,r){return t<=e&&e<=r}function n(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function i(e){this.tokens=[].slice.call(e)}i.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};var o=-1;function s(e,t){if(e)throw TypeError("Decoder error");return t||65533}var a="utf-8";function u(e,t){if(!(this instanceof u))return new u(e,t);if((e=void 0!==e?String(e).toLowerCase():a)!==a)throw new Error("Encoding not supported. Only utf-8 is supported");t=n(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function c(e,t){if(!(this instanceof c))return new c(e,t);if((e=void 0!==e?String(e).toLowerCase():a)!==a)throw new Error("Encoding not supported. Only utf-8 is supported");t=n(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function h(e){var t=e.fatal,n=0,i=0,a=0,u=128,c=191;this.handler=function(e,h){if(-1===h&&0!==a)return a=0,s(t);if(-1===h)return o;if(0===a){if(r(h,0,127))return h;if(r(h,194,223))a=1,n=h-192;else if(r(h,224,239))224===h&&(u=160),237===h&&(c=159),a=2,n=h-224;else{if(!r(h,240,244))return s(t);240===h&&(u=144),244===h&&(c=143),a=3,n=h-240}return n<<=6*a,null}if(!r(h,u,c))return n=a=i=0,u=128,c=191,e.prepend(h),s(t);if(u=128,c=191,n+=h-128<<6*(a-(i+=1)),i!==a)return null;var f=n;return n=a=i=0,f}}function f(e){e.fatal,this.handler=function(e,t){if(-1===t)return o;if(r(t,0,127))return t;var n,i;r(t,128,2047)?(n=1,i=192):r(t,2048,65535)?(n=2,i=224):r(t,65536,1114111)&&(n=3,i=240);for(var s=[(t>>6*n)+i];n>0;){var a=t>>6*(n-1);s.push(128|63&a),n-=1}return s}}u.prototype={decode:function(e,t){var r;r="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=n(t),this._streaming||(this._decoder=new h({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var s,a=new i(r),u=[];!a.endOfStream()&&(s=this._decoder.handler(a,a.read()))!==o;)null!==s&&(Array.isArray(s)?u.push.apply(u,s):u.push(s));if(!this._streaming){do{if((s=this._decoder.handler(a,a.read()))===o)break;null!==s&&(Array.isArray(s)?u.push.apply(u,s):u.push(s))}while(!a.endOfStream());this._decoder=null}return u.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===u[0]?(this._BOMseen=!0,u.shift()):this._BOMseen=!0)),function(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return t}(u)}},c.prototype={encode:function(e,t){e=e?String(e):"",t=n(t),this._streaming||(this._encoder=new f(this._options)),this._streaming=Boolean(t.stream);for(var r,s=[],a=new i(function(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var o=t.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=e.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=1023&o,u=1023&s;i.push(65536+(a<<10)+u),n+=1}else i.push(65533)}n+=1}return i}(e));!a.endOfStream()&&(r=this._encoder.handler(a,a.read()))!==o;)Array.isArray(r)?s.push.apply(s,r):s.push(r);if(!this._streaming){for(;(r=this._encoder.handler(a,a.read()))!==o;)Array.isArray(r)?s.push.apply(s,r):s.push(r);this._encoder=null}return new Uint8Array(s)}},t.TextEncoder=c,t.TextDecoder=u},5474:(e,t,r)=>{!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),a=t([1]),u=t([56129,1]),c=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),l=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function y(e,t,r,n,i){var o,s=0;for(o=0;o<i;o++)s|=e[t+o]^r[n+o];return(1&s-1>>>8)-1}function g(e,t,r,n){return y(e,t,r,n,16)}function b(e,t,r,n){return y(e,t,r,n,32)}function m(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=o,E=s,A=a,S=u,M=c,x=h,k=f,I=d,R=l,B=p,T=y,U=g,O=b,C=m,P=v,z=w,L=0;L<20;L+=2)_^=(i=(O^=(i=(R^=(i=(M^=(i=_+O|0)<<7|i>>>25)+_|0)<<9|i>>>23)+M|0)<<13|i>>>19)+R|0)<<18|i>>>14,x^=(i=(E^=(i=(C^=(i=(B^=(i=x+E|0)<<7|i>>>25)+x|0)<<9|i>>>23)+B|0)<<13|i>>>19)+C|0)<<18|i>>>14,T^=(i=(k^=(i=(A^=(i=(P^=(i=T+k|0)<<7|i>>>25)+T|0)<<9|i>>>23)+P|0)<<13|i>>>19)+A|0)<<18|i>>>14,z^=(i=(U^=(i=(I^=(i=(S^=(i=z+U|0)<<7|i>>>25)+z|0)<<9|i>>>23)+S|0)<<13|i>>>19)+I|0)<<18|i>>>14,_^=(i=(S^=(i=(A^=(i=(E^=(i=_+S|0)<<7|i>>>25)+_|0)<<9|i>>>23)+E|0)<<13|i>>>19)+A|0)<<18|i>>>14,x^=(i=(M^=(i=(I^=(i=(k^=(i=x+M|0)<<7|i>>>25)+x|0)<<9|i>>>23)+k|0)<<13|i>>>19)+I|0)<<18|i>>>14,T^=(i=(B^=(i=(R^=(i=(U^=(i=T+B|0)<<7|i>>>25)+T|0)<<9|i>>>23)+U|0)<<13|i>>>19)+R|0)<<18|i>>>14,z^=(i=(P^=(i=(C^=(i=(O^=(i=z+P|0)<<7|i>>>25)+z|0)<<9|i>>>23)+O|0)<<13|i>>>19)+C|0)<<18|i>>>14;_=_+o|0,E=E+s|0,A=A+a|0,S=S+u|0,M=M+c|0,x=x+h|0,k=k+f|0,I=I+d|0,R=R+l|0,B=B+p|0,T=T+y|0,U=U+g|0,O=O+b|0,C=C+m|0,P=P+v|0,z=z+w|0,e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=M>>>0&255,e[17]=M>>>8&255,e[18]=M>>>16&255,e[19]=M>>>24&255,e[20]=x>>>0&255,e[21]=x>>>8&255,e[22]=x>>>16&255,e[23]=x>>>24&255,e[24]=k>>>0&255,e[25]=k>>>8&255,e[26]=k>>>16&255,e[27]=k>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=R>>>0&255,e[33]=R>>>8&255,e[34]=R>>>16&255,e[35]=R>>>24&255,e[36]=B>>>0&255,e[37]=B>>>8&255,e[38]=B>>>16&255,e[39]=B>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=U>>>0&255,e[45]=U>>>8&255,e[46]=U>>>16&255,e[47]=U>>>24&255,e[48]=O>>>0&255,e[49]=O>>>8&255,e[50]=O>>>16&255,e[51]=O>>>24&255,e[52]=C>>>0&255,e[53]=C>>>8&255,e[54]=C>>>16&255,e[55]=C>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,n)}function v(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=0;_<20;_+=2)o^=(i=(b^=(i=(l^=(i=(c^=(i=o+b|0)<<7|i>>>25)+o|0)<<9|i>>>23)+c|0)<<13|i>>>19)+l|0)<<18|i>>>14,h^=(i=(s^=(i=(m^=(i=(p^=(i=h+s|0)<<7|i>>>25)+h|0)<<9|i>>>23)+p|0)<<13|i>>>19)+m|0)<<18|i>>>14,y^=(i=(f^=(i=(a^=(i=(v^=(i=y+f|0)<<7|i>>>25)+y|0)<<9|i>>>23)+v|0)<<13|i>>>19)+a|0)<<18|i>>>14,w^=(i=(g^=(i=(d^=(i=(u^=(i=w+g|0)<<7|i>>>25)+w|0)<<9|i>>>23)+u|0)<<13|i>>>19)+d|0)<<18|i>>>14,o^=(i=(u^=(i=(a^=(i=(s^=(i=o+u|0)<<7|i>>>25)+o|0)<<9|i>>>23)+s|0)<<13|i>>>19)+a|0)<<18|i>>>14,h^=(i=(c^=(i=(d^=(i=(f^=(i=h+c|0)<<7|i>>>25)+h|0)<<9|i>>>23)+f|0)<<13|i>>>19)+d|0)<<18|i>>>14,y^=(i=(p^=(i=(l^=(i=(g^=(i=y+p|0)<<7|i>>>25)+y|0)<<9|i>>>23)+g|0)<<13|i>>>19)+l|0)<<18|i>>>14,w^=(i=(v^=(i=(m^=(i=(b^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+b|0)<<13|i>>>19)+m|0)<<18|i>>>14;e[0]=o>>>0&255,e[1]=o>>>8&255,e[2]=o>>>16&255,e[3]=o>>>24&255,e[4]=h>>>0&255,e[5]=h>>>8&255,e[6]=h>>>16&255,e[7]=h>>>24&255,e[8]=y>>>0&255,e[9]=y>>>8&255,e[10]=y>>>16&255,e[11]=y>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=f>>>0&255,e[17]=f>>>8&255,e[18]=f>>>16&255,e[19]=f>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(e,t,r,n,i,o,s){var a,u,c=new Uint8Array(16),h=new Uint8Array(64);for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=o[u];for(;i>=64;){for(m(h,c,s,w),u=0;u<64;u++)e[t+u]=r[n+u]^h[u];for(a=1,u=8;u<16;u++)a=a+(255&c[u])|0,c[u]=255&a,a>>>=8;i-=64,t+=64,n+=64}if(i>0)for(m(h,c,s,w),u=0;u<i;u++)e[t+u]=r[n+u]^h[u];return 0}function E(e,t,r,n,i){var o,s,a=new Uint8Array(16),u=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=n[s];for(;r>=64;){for(m(u,a,i,w),s=0;s<64;s++)e[t+s]=u[s];for(o=1,s=8;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,t+=64}if(r>0)for(m(u,a,i,w),s=0;s<r;s++)e[t+s]=u[s];return 0}function A(e,t,r,n,i){var o=new Uint8Array(32);v(o,n,i,w);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=n[a+16];return E(e,t,r,s,o)}function S(e,t,r,n,i,o,s){var a=new Uint8Array(32);v(a,o,s,w);for(var u=new Uint8Array(8),c=0;c<8;c++)u[c]=o[c+16];return _(e,t,r,n,i,u,a)}var M=function(e){var t,r,n,i,o,s,a,u;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,s=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(o>>>14|s<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(s>>>11|a<<5),u=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function x(e,t,r,n,i,o){var s=new M(o);return s.update(r,n,i),s.finish(e,t),0}function k(e,t,r,n,i,o){var s=new Uint8Array(16);return x(s,0,r,n,i,o),g(e,t,s,0)}function I(e,t,r,n,i){var o;if(r<32)return-1;for(S(e,0,t,0,r,n,i),x(e,16,e,32,r-32,e),o=0;o<16;o++)e[o]=0;return 0}function R(e,t,r,n,i){var o,s=new Uint8Array(32);if(r<32)return-1;if(A(s,0,32,n,i),0!==k(t,16,t,32,r-32,s))return-1;for(S(e,0,t,0,r,n,i),o=0;o<32;o++)e[o]=0;return 0}function B(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function T(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function U(e,t,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function O(e,r){var n,i,o,s=t(),a=t();for(n=0;n<16;n++)a[n]=r[n];for(T(a),T(a),T(a),i=0;i<2;i++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,U(a,s,1-o)}for(n=0;n<16;n++)e[2*n]=255&a[n],e[2*n+1]=a[n]>>8}function C(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return O(r,e),O(n,t),b(r,0,n,0)}function P(e){var t=new Uint8Array(32);return O(t,e),1&t[0]}function z(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function L(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function N(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function q(e,t,r){var n,i,o=0,s=0,a=0,u=0,c=0,h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,v=0,w=0,_=0,E=0,A=0,S=0,M=0,x=0,k=0,I=0,R=0,B=0,T=0,U=0,O=0,C=0,P=0,z=r[0],L=r[1],N=r[2],q=r[3],j=r[4],D=r[5],F=r[6],$=r[7],H=r[8],W=r[9],K=r[10],G=r[11],V=r[12],J=r[13],Y=r[14],Z=r[15];o+=(n=t[0])*z,s+=n*L,a+=n*N,u+=n*q,c+=n*j,h+=n*D,f+=n*F,d+=n*$,l+=n*H,p+=n*W,y+=n*K,g+=n*G,b+=n*V,m+=n*J,v+=n*Y,w+=n*Z,s+=(n=t[1])*z,a+=n*L,u+=n*N,c+=n*q,h+=n*j,f+=n*D,d+=n*F,l+=n*$,p+=n*H,y+=n*W,g+=n*K,b+=n*G,m+=n*V,v+=n*J,w+=n*Y,_+=n*Z,a+=(n=t[2])*z,u+=n*L,c+=n*N,h+=n*q,f+=n*j,d+=n*D,l+=n*F,p+=n*$,y+=n*H,g+=n*W,b+=n*K,m+=n*G,v+=n*V,w+=n*J,_+=n*Y,E+=n*Z,u+=(n=t[3])*z,c+=n*L,h+=n*N,f+=n*q,d+=n*j,l+=n*D,p+=n*F,y+=n*$,g+=n*H,b+=n*W,m+=n*K,v+=n*G,w+=n*V,_+=n*J,E+=n*Y,A+=n*Z,c+=(n=t[4])*z,h+=n*L,f+=n*N,d+=n*q,l+=n*j,p+=n*D,y+=n*F,g+=n*$,b+=n*H,m+=n*W,v+=n*K,w+=n*G,_+=n*V,E+=n*J,A+=n*Y,S+=n*Z,h+=(n=t[5])*z,f+=n*L,d+=n*N,l+=n*q,p+=n*j,y+=n*D,g+=n*F,b+=n*$,m+=n*H,v+=n*W,w+=n*K,_+=n*G,E+=n*V,A+=n*J,S+=n*Y,M+=n*Z,f+=(n=t[6])*z,d+=n*L,l+=n*N,p+=n*q,y+=n*j,g+=n*D,b+=n*F,m+=n*$,v+=n*H,w+=n*W,_+=n*K,E+=n*G,A+=n*V,S+=n*J,M+=n*Y,x+=n*Z,d+=(n=t[7])*z,l+=n*L,p+=n*N,y+=n*q,g+=n*j,b+=n*D,m+=n*F,v+=n*$,w+=n*H,_+=n*W,E+=n*K,A+=n*G,S+=n*V,M+=n*J,x+=n*Y,k+=n*Z,l+=(n=t[8])*z,p+=n*L,y+=n*N,g+=n*q,b+=n*j,m+=n*D,v+=n*F,w+=n*$,_+=n*H,E+=n*W,A+=n*K,S+=n*G,M+=n*V,x+=n*J,k+=n*Y,I+=n*Z,p+=(n=t[9])*z,y+=n*L,g+=n*N,b+=n*q,m+=n*j,v+=n*D,w+=n*F,_+=n*$,E+=n*H,A+=n*W,S+=n*K,M+=n*G,x+=n*V,k+=n*J,I+=n*Y,R+=n*Z,y+=(n=t[10])*z,g+=n*L,b+=n*N,m+=n*q,v+=n*j,w+=n*D,_+=n*F,E+=n*$,A+=n*H,S+=n*W,M+=n*K,x+=n*G,k+=n*V,I+=n*J,R+=n*Y,B+=n*Z,g+=(n=t[11])*z,b+=n*L,m+=n*N,v+=n*q,w+=n*j,_+=n*D,E+=n*F,A+=n*$,S+=n*H,M+=n*W,x+=n*K,k+=n*G,I+=n*V,R+=n*J,B+=n*Y,T+=n*Z,b+=(n=t[12])*z,m+=n*L,v+=n*N,w+=n*q,_+=n*j,E+=n*D,A+=n*F,S+=n*$,M+=n*H,x+=n*W,k+=n*K,I+=n*G,R+=n*V,B+=n*J,T+=n*Y,U+=n*Z,m+=(n=t[13])*z,v+=n*L,w+=n*N,_+=n*q,E+=n*j,A+=n*D,S+=n*F,M+=n*$,x+=n*H,k+=n*W,I+=n*K,R+=n*G,B+=n*V,T+=n*J,U+=n*Y,O+=n*Z,v+=(n=t[14])*z,w+=n*L,_+=n*N,E+=n*q,A+=n*j,S+=n*D,M+=n*F,x+=n*$,k+=n*H,I+=n*W,R+=n*K,B+=n*G,T+=n*V,U+=n*J,O+=n*Y,C+=n*Z,w+=(n=t[15])*z,s+=38*(E+=n*N),a+=38*(A+=n*q),u+=38*(S+=n*j),c+=38*(M+=n*D),h+=38*(x+=n*F),f+=38*(k+=n*$),d+=38*(I+=n*H),l+=38*(R+=n*W),p+=38*(B+=n*K),y+=38*(T+=n*G),g+=38*(U+=n*V),b+=38*(O+=n*J),m+=38*(C+=n*Y),v+=38*(P+=n*Z),o=(n=(o+=38*(_+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=u,e[4]=c,e[5]=h,e[6]=f,e[7]=d,e[8]=l,e[9]=p,e[10]=y,e[11]=g,e[12]=b,e[13]=m,e[14]=v,e[15]=w}function j(e,t){q(e,t,t)}function D(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)j(i,i),2!==n&&4!==n&&q(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function F(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)j(i,i),1!==n&&q(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function $(e,r,n){var i,o,s=new Uint8Array(32),a=new Float64Array(80),c=t(),h=t(),f=t(),d=t(),l=t(),p=t();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,z(a,n),o=0;o<16;o++)h[o]=a[o],d[o]=c[o]=f[o]=0;for(c[0]=d[0]=1,o=254;o>=0;--o)U(c,h,i=s[o>>>3]>>>(7&o)&1),U(f,d,i),L(l,c,f),N(c,c,f),L(f,h,d),N(h,h,d),j(d,l),j(p,c),q(c,f,c),q(f,h,l),L(l,c,f),N(c,c,f),j(h,c),N(f,d,p),q(c,f,u),L(c,c,d),q(f,f,c),q(c,d,p),q(d,h,a),j(h,l),U(c,h,i),U(f,d,i);for(o=0;o<16;o++)a[o+16]=c[o],a[o+32]=f[o],a[o+48]=h[o],a[o+64]=d[o];var y=a.subarray(32),g=a.subarray(16);return D(y,y),q(g,g,y),O(e,g),0}function H(e,t){return $(e,t,o)}function W(e,t){return n(t,32),H(e,t)}function K(e,t,r){var n=new Uint8Array(32);return $(n,r,t),v(e,i,n,w)}M.prototype.blocks=function(e,t,r){for(var n,i,o,s,a,u,c,h,f,d,l,p,y,g,b,m,v,w,_,E=this.fin?0:2048,A=this.h[0],S=this.h[1],M=this.h[2],x=this.h[3],k=this.h[4],I=this.h[5],R=this.h[6],B=this.h[7],T=this.h[8],U=this.h[9],O=this.r[0],C=this.r[1],P=this.r[2],z=this.r[3],L=this.r[4],N=this.r[5],q=this.r[6],j=this.r[7],D=this.r[8],F=this.r[9];r>=16;)d=f=0,d+=(A+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*O,d+=(S+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*F),d+=(M+=8191&(i>>>10|(o=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*D),d+=(x+=8191&(o>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*j),f=(d+=(k+=8191&(s>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*q))>>>13,d&=8191,d+=(I+=a>>>1&8191)*(5*N),d+=(R+=8191&(a>>>14|(u=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*L),d+=(B+=8191&(u>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),d+=(T+=8191&(c>>>8|(h=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*P),l=f+=(d+=(U+=h>>>5|E)*(5*C))>>>13,l+=A*C,l+=S*O,l+=M*(5*F),l+=x*(5*D),f=(l+=k*(5*j))>>>13,l&=8191,l+=I*(5*q),l+=R*(5*N),l+=B*(5*L),l+=T*(5*z),f+=(l+=U*(5*P))>>>13,l&=8191,p=f,p+=A*P,p+=S*C,p+=M*O,p+=x*(5*F),f=(p+=k*(5*D))>>>13,p&=8191,p+=I*(5*j),p+=R*(5*q),p+=B*(5*N),p+=T*(5*L),y=f+=(p+=U*(5*z))>>>13,y+=A*z,y+=S*P,y+=M*C,y+=x*O,f=(y+=k*(5*F))>>>13,y&=8191,y+=I*(5*D),y+=R*(5*j),y+=B*(5*q),y+=T*(5*N),g=f+=(y+=U*(5*L))>>>13,g+=A*L,g+=S*z,g+=M*P,g+=x*C,f=(g+=k*O)>>>13,g&=8191,g+=I*(5*F),g+=R*(5*D),g+=B*(5*j),g+=T*(5*q),b=f+=(g+=U*(5*N))>>>13,b+=A*N,b+=S*L,b+=M*z,b+=x*P,f=(b+=k*C)>>>13,b&=8191,b+=I*O,b+=R*(5*F),b+=B*(5*D),b+=T*(5*j),m=f+=(b+=U*(5*q))>>>13,m+=A*q,m+=S*N,m+=M*L,m+=x*z,f=(m+=k*P)>>>13,m&=8191,m+=I*C,m+=R*O,m+=B*(5*F),m+=T*(5*D),v=f+=(m+=U*(5*j))>>>13,v+=A*j,v+=S*q,v+=M*N,v+=x*L,f=(v+=k*z)>>>13,v&=8191,v+=I*P,v+=R*C,v+=B*O,v+=T*(5*F),w=f+=(v+=U*(5*D))>>>13,w+=A*D,w+=S*j,w+=M*q,w+=x*N,f=(w+=k*L)>>>13,w&=8191,w+=I*z,w+=R*P,w+=B*C,w+=T*O,_=f+=(w+=U*(5*F))>>>13,_+=A*F,_+=S*D,_+=M*j,_+=x*q,f=(_+=k*N)>>>13,_&=8191,_+=I*L,_+=R*z,_+=B*P,_+=T*C,A=d=8191&(f=(f=((f+=(_+=U*O)>>>13)<<2)+f|0)+(d&=8191)|0),S=l+=f>>>=13,M=p&=8191,x=y&=8191,k=g&=8191,I=b&=8191,R=m&=8191,B=v&=8191,T=w&=8191,U=_&=8191,t+=16,r-=16;this.h[0]=A,this.h[1]=S,this.h[2]=M,this.h[3]=x,this.h[4]=k,this.h[5]=I,this.h[6]=R,this.h[7]=B,this.h[8]=T,this.h[9]=U},M.prototype.finish=function(e,t){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},M.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var G=I,V=R,J=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Y(e,t,r,n){for(var i,o,s,a,u,c,h,f,d,l,p,y,g,b,m,v,w,_,E,A,S,M,x,k,I,R,B=new Int32Array(16),T=new Int32Array(16),U=e[0],O=e[1],C=e[2],P=e[3],z=e[4],L=e[5],N=e[6],q=e[7],j=t[0],D=t[1],F=t[2],$=t[3],H=t[4],W=t[5],K=t[6],G=t[7],V=0;n>=128;){for(E=0;E<16;E++)A=8*E+V,B[E]=r[A+0]<<24|r[A+1]<<16|r[A+2]<<8|r[A+3],T[E]=r[A+4]<<24|r[A+5]<<16|r[A+6]<<8|r[A+7];for(E=0;E<80;E++)if(i=U,o=O,s=C,a=P,u=z,c=L,h=N,d=j,l=D,p=F,y=$,g=H,b=W,m=K,x=65535&(M=G),k=M>>>16,I=65535&(S=q),R=S>>>16,x+=65535&(M=(H>>>14|z<<18)^(H>>>18|z<<14)^(z>>>9|H<<23)),k+=M>>>16,I+=65535&(S=(z>>>14|H<<18)^(z>>>18|H<<14)^(H>>>9|z<<23)),R+=S>>>16,x+=65535&(M=H&W^~H&K),k+=M>>>16,I+=65535&(S=z&L^~z&N),R+=S>>>16,x+=65535&(M=J[2*E+1]),k+=M>>>16,I+=65535&(S=J[2*E]),R+=S>>>16,S=B[E%16],k+=(M=T[E%16])>>>16,I+=65535&S,R+=S>>>16,I+=(k+=(x+=65535&M)>>>16)>>>16,x=65535&(M=_=65535&x|k<<16),k=M>>>16,I=65535&(S=w=65535&I|(R+=I>>>16)<<16),R=S>>>16,x+=65535&(M=(j>>>28|U<<4)^(U>>>2|j<<30)^(U>>>7|j<<25)),k+=M>>>16,I+=65535&(S=(U>>>28|j<<4)^(j>>>2|U<<30)^(j>>>7|U<<25)),R+=S>>>16,k+=(M=j&D^j&F^D&F)>>>16,I+=65535&(S=U&O^U&C^O&C),R+=S>>>16,f=65535&(I+=(k+=(x+=65535&M)>>>16)>>>16)|(R+=I>>>16)<<16,v=65535&x|k<<16,x=65535&(M=y),k=M>>>16,I=65535&(S=a),R=S>>>16,k+=(M=_)>>>16,I+=65535&(S=w),R+=S>>>16,O=i,C=o,P=s,z=a=65535&(I+=(k+=(x+=65535&M)>>>16)>>>16)|(R+=I>>>16)<<16,L=u,N=c,q=h,U=f,D=d,F=l,$=p,H=y=65535&x|k<<16,W=g,K=b,G=m,j=v,E%16==15)for(A=0;A<16;A++)S=B[A],x=65535&(M=T[A]),k=M>>>16,I=65535&S,R=S>>>16,S=B[(A+9)%16],x+=65535&(M=T[(A+9)%16]),k+=M>>>16,I+=65535&S,R+=S>>>16,w=B[(A+1)%16],x+=65535&(M=((_=T[(A+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),k+=M>>>16,I+=65535&(S=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),R+=S>>>16,w=B[(A+14)%16],k+=(M=((_=T[(A+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,I+=65535&(S=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,B[A]=65535&I|R<<16,T[A]=65535&x|k<<16;x=65535&(M=j),k=M>>>16,I=65535&(S=U),R=S>>>16,S=e[0],k+=(M=t[0])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[0]=U=65535&I|R<<16,t[0]=j=65535&x|k<<16,x=65535&(M=D),k=M>>>16,I=65535&(S=O),R=S>>>16,S=e[1],k+=(M=t[1])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[1]=O=65535&I|R<<16,t[1]=D=65535&x|k<<16,x=65535&(M=F),k=M>>>16,I=65535&(S=C),R=S>>>16,S=e[2],k+=(M=t[2])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[2]=C=65535&I|R<<16,t[2]=F=65535&x|k<<16,x=65535&(M=$),k=M>>>16,I=65535&(S=P),R=S>>>16,S=e[3],k+=(M=t[3])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[3]=P=65535&I|R<<16,t[3]=$=65535&x|k<<16,x=65535&(M=H),k=M>>>16,I=65535&(S=z),R=S>>>16,S=e[4],k+=(M=t[4])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[4]=z=65535&I|R<<16,t[4]=H=65535&x|k<<16,x=65535&(M=W),k=M>>>16,I=65535&(S=L),R=S>>>16,S=e[5],k+=(M=t[5])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[5]=L=65535&I|R<<16,t[5]=W=65535&x|k<<16,x=65535&(M=K),k=M>>>16,I=65535&(S=N),R=S>>>16,S=e[6],k+=(M=t[6])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[6]=N=65535&I|R<<16,t[6]=K=65535&x|k<<16,x=65535&(M=G),k=M>>>16,I=65535&(S=q),R=S>>>16,S=e[7],k+=(M=t[7])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[7]=q=65535&I|R<<16,t[7]=G=65535&x|k<<16,V+=128,n-=128}return n}function Z(e,t,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,Y(i,o,t,r),r%=128,n=0;n<r;n++)s[n]=t[a-r+n];for(s[r]=128,s[(r=256-128*(r<112?1:0))-9]=0,p(s,r-8,a/536870912|0,a<<3),Y(i,o,s,r),n=0;n<8;n++)p(e,8*n,i[n],o[n]);return 0}function X(e,r){var n=t(),i=t(),o=t(),s=t(),a=t(),u=t(),c=t(),f=t(),d=t();N(n,e[1],e[0]),N(d,r[1],r[0]),q(n,n,d),L(i,e[0],e[1]),L(d,r[0],r[1]),q(i,i,d),q(o,e[3],r[3]),q(o,o,h),q(s,e[2],r[2]),L(s,s,s),N(a,i,n),N(u,s,o),L(c,s,o),L(f,i,n),q(e[0],a,u),q(e[1],f,c),q(e[2],c,u),q(e[3],a,f)}function Q(e,t,r){var n;for(n=0;n<4;n++)U(e[n],t[n],r)}function ee(e,r){var n=t(),i=t(),o=t();D(o,r[2]),q(n,r[0],o),q(i,r[1],o),O(e,i),e[31]^=P(n)<<7}function te(e,t,r){var n,i;for(B(e[0],s),B(e[1],a),B(e[2],a),B(e[3],s),i=255;i>=0;--i)Q(e,t,n=r[i/8|0]>>(7&i)&1),X(t,e),X(e,e),Q(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];B(n[0],f),B(n[1],d),B(n[2],a),q(n[3],f,d),te(e,n,r)}function ne(e,r,i){var o,s=new Uint8Array(64),a=[t(),t(),t(),t()];for(i||n(r,32),Z(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,re(a,s),ee(e,a),o=0;o<32;o++)r[o+32]=e[o];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function oe(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*ie[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*ie[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ie[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function se(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;oe(e,r)}function ae(e,r,n,i){var o,s,a=new Uint8Array(64),u=new Uint8Array(64),c=new Uint8Array(64),h=new Float64Array(64),f=[t(),t(),t(),t()];Z(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var d=n+64;for(o=0;o<n;o++)e[64+o]=r[o];for(o=0;o<32;o++)e[32+o]=a[32+o];for(Z(c,e.subarray(32),n+32),se(c),re(f,c),ee(e,f),o=32;o<64;o++)e[o]=i[o];for(Z(u,e,n+64),se(u),o=0;o<64;o++)h[o]=0;for(o=0;o<32;o++)h[o]=c[o];for(o=0;o<32;o++)for(s=0;s<32;s++)h[o+s]+=u[o]*a[s];return oe(e.subarray(32),h),d}function ue(e,r,n,i){var o,u=new Uint8Array(32),h=new Uint8Array(64),f=[t(),t(),t(),t()],d=[t(),t(),t(),t()];if(n<64)return-1;if(function(e,r){var n=t(),i=t(),o=t(),u=t(),h=t(),f=t(),d=t();return B(e[2],a),z(e[1],r),j(o,e[1]),q(u,o,c),N(o,o,e[2]),L(u,e[2],u),j(h,u),j(f,h),q(d,f,h),q(n,d,o),q(n,n,u),F(n,n),q(n,n,o),q(n,n,u),q(n,n,u),q(e[0],n,u),j(i,e[0]),q(i,i,u),C(i,o)&&q(e[0],e[0],l),j(i,e[0]),q(i,i,u),C(i,o)?-1:(P(e[0])===r[31]>>7&&N(e[0],s,e[0]),q(e[3],e[0],e[1]),0)}(d,i))return-1;for(o=0;o<n;o++)e[o]=r[o];for(o=0;o<32;o++)e[o+32]=i[o];if(Z(h,e,n),se(h),te(f,d,h),re(d,r.subarray(32)),X(f,d),ee(u,f),n-=64,b(r,0,u,0)){for(o=0;o<n;o++)e[o]=0;return-1}for(o=0;o<n;o++)e[o]=r[o+64];return n}var ce=64,he=32,fe=64;function de(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function le(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function pe(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:v,crypto_stream_xor:S,crypto_stream:A,crypto_stream_salsa20_xor:_,crypto_stream_salsa20:E,crypto_onetimeauth:x,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:b,crypto_secretbox:I,crypto_secretbox_open:R,crypto_scalarmult:$,crypto_scalarmult_base:H,crypto_box_beforenm:K,crypto_box_afternm:G,crypto_box:function(e,t,r,n,i,o){var s=new Uint8Array(32);return K(s,i,o),G(e,t,r,n,s)},crypto_box_open:function(e,t,r,n,i,o){var s=new Uint8Array(32);return K(s,i,o),V(e,t,r,n,s)},crypto_box_keypair:W,crypto_hash:Z,crypto_sign:ae,crypto_sign_keypair:ne,crypto_sign_open:ue,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ce,crypto_sign_PUBLICKEYBYTES:he,crypto_sign_SECRETKEYBYTES:fe,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:c,L:ie,pack25519:O,unpack25519:z,M:q,A:L,S:j,Z:N,pow2523:F,add:X,set25519:B,modL:oe,scalarmult:te,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,r){le(e,t,r),de(r,t);for(var n=new Uint8Array(32+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+32]=e[o];return I(i,n,n.length,t,r),i.subarray(16)},e.secretbox.open=function(e,t,r){le(e,t,r),de(r,t);for(var n=new Uint8Array(16+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+16]=e[o];return n.length<32||0!==R(i,n,n.length,t,r)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(le(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return $(r,e,t),r},e.scalarMult.base=function(e){if(le(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox(t,r,o)},e.box.before=function(e,t){le(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return K(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox.open(t,r,o)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return W(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(le(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return H(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(le(e,t),t.length!==fe)throw new Error("bad secret key size");var r=new Uint8Array(ce+e.length);return ae(r,e,e.length,t),r},e.sign.open=function(e,t){if(le(e,t),t.length!==he)throw new Error("bad public key size");var r=new Uint8Array(e.length),n=ue(r,e,e.length,t);if(n<0)return null;for(var i=new Uint8Array(n),o=0;o<i.length;o++)i[o]=r[o];return i},e.sign.detached=function(t,r){for(var n=e.sign(t,r),i=new Uint8Array(ce),o=0;o<i.length;o++)i[o]=n[o];return i},e.sign.detached.verify=function(e,t,r){if(le(e,t,r),t.length!==ce)throw new Error("bad signature size");if(r.length!==he)throw new Error("bad public key size");var n,i=new Uint8Array(ce+e.length),o=new Uint8Array(ce+e.length);for(n=0;n<ce;n++)i[n]=t[n];for(n=0;n<e.length;n++)i[n+ce]=e[n];return ue(o,i,i.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(he),t=new Uint8Array(fe);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(le(e),e.length!==fe)throw new Error("bad secret key size");for(var t=new Uint8Array(he),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(le(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(he),r=new Uint8Array(fe),n=0;n<32;n++)r[n]=e[n];return ne(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=he,e.sign.secretKeyLength=fe,e.sign.seedLength=32,e.sign.signatureLength=ce,e.hash=function(e){le(e);var t=new Uint8Array(64);return Z(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return le(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===y(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=i[n];pe(i)})):(t=r(6835))&&t.randomBytes&&e.setPRNG((function(e,r){var n,i=t.randomBytes(r);for(n=0;n<r;n++)e[n]=i[n];pe(i)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},3141:(e,t,r)=>{"use strict";var n;r.d(t,{v4:()=>h});var i=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const 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(e){return"string"==typeof e&&s.test(e)};for(var u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));const h=function(e,t,r){var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r}(n)}},9046:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;const n=r(8624);class i extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n.default(this.serialize(),o,2)}}function o(e,t){if("[Circular]"!==t)return t}t.EthereumRpcError=i,t.EthereumProviderError=class extends i{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},2468:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},535:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;const n=r(9046),i=r(7473),o=r(2468);function s(e,t){const[r,o]=u(t);return new n.EthereumRpcError(e,r||i.getMessageFromCode(e),o)}function a(e,t){const[r,o]=u(t);return new n.EthereumProviderError(e,r||i.getMessageFromCode(e),o)}function u(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}t.ethErrors={rpc:{parse:e=>s(o.errorCodes.rpc.parse,e),invalidRequest:e=>s(o.errorCodes.rpc.invalidRequest,e),invalidParams:e=>s(o.errorCodes.rpc.invalidParams,e),methodNotFound:e=>s(o.errorCodes.rpc.methodNotFound,e),internal:e=>s(o.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:e=>s(o.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>s(o.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>s(o.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>s(o.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>s(o.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>s(o.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>a(o.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(o.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(o.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(o.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(o.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:i}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,i)}}}},3596:(e,t,r)=>{"use strict";t.Cg=t.Sy=void 0;const n=r(9046);Object.defineProperty(t,"Cg",{enumerable:!0,get:function(){return n.EthereumRpcError}});r(7473);const i=r(535);Object.defineProperty(t,"Sy",{enumerable:!0,get:function(){return i.ethErrors}});r(2468)},7473:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=r(2468),i=r(9046),o=n.errorCodes.rpc.internal,s={code:o,message:a(o)};function a(e,r="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const r=e.toString();if(f(n.errorValues,r))return n.errorValues[r].message;if(c(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function u(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!n.errorValues[t]||!!c(e)}function c(e){return e>=-32099&&e<=-32e3}function h(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=a,t.isValidCode=u,t.serializeError=function(e,{fallbackError:t=s,shouldIncludeStack:r=!1}={}){var n,o;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();const c={};if(e&&"object"==typeof e&&!Array.isArray(e)&&f(e,"code")&&u(e.code)){const t=e;c.code=t.code,t.message&&"string"==typeof t.message?(c.message=t.message,f(t,"data")&&(c.data=t.data)):(c.message=a(c.code),c.data={originalError:h(e)})}else{c.code=t.code;const r=null===(n=e)||void 0===n?void 0:n.message;c.message=r&&"string"==typeof r?r:t.message,c.data={originalError:h(e)}}const d=null===(o=e)||void 0===o?void 0:o.stack;return r&&e&&d&&"string"==typeof d&&(c.stack=d),c}},8624:e=>{e.exports=s,s.default=s,s.stable=h,s.stableStringify=h;var t="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=o()),u(e,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(e,t,r):JSON.stringify(e,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function a(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:e}),n.push([o,r,t,s])):i.push([t,r,e]):(o[r]=e,n.push([o,r,t]))}function u(e,n,i,o,s,c,h){var f;if(c+=1,"object"==typeof e&&null!==e){for(f=0;f<o.length;f++)if(o[f]===e)return void a(r,e,n,s);if(void 0!==h.depthLimit&&c>h.depthLimit)return void a(t,e,n,s);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void a(t,e,n,s);if(o.push(e),Array.isArray(e))for(f=0;f<e.length;f++)u(e[f],f,f,o,e,c,h);else{var d=Object.keys(e);for(f=0;f<d.length;f++){var l=d[f];u(e[l],l,f,o,e,c,h)}}o.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function h(e,t,r,s){void 0===s&&(s=o());var a,u=f(e,"",0,[],void 0,0,s)||e;try{a=0===i.length?JSON.stringify(u,t,r):JSON.stringify(u,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function f(e,i,o,s,u,h,d){var l;if(h+=1,"object"==typeof e&&null!==e){for(l=0;l<s.length;l++)if(s[l]===e)return void a(r,e,i,u);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&h>d.depthLimit)return void a(t,e,i,u);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void a(t,e,i,u);if(s.push(e),Array.isArray(e))for(l=0;l<e.length;l++)f(e[l],l,l,s,e,h,d);else{var p={},y=Object.keys(e).sort(c);for(l=0;l<y.length;l++){var g=y[l];f(e[g],g,l,s,e,h,d),p[g]=e[g]}if(void 0===u)return p;n.push([u,i,e]),u[i]=p}s.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===t&&o[0]===r){r=o[2],i.splice(n,1);break}}return e.call(this,t,r)}}},1160:()=>{},5377:()=>{},3325:()=>{},9312:()=>{},6835:()=>{},7330:e=>{"use strict";e.exports={i8:"6.5.4"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.r(n);var e={};r.r(e),r.d(e,{DEBUG_LOGGER_STORAGE_KEY:()=>b,EXT_PORT_CS_TO_BG:()=>y,EXT_PORT_UI_TO_BG:()=>g,JS_BRIDGE_MESSAGE_DIRECTION:()=>p,JS_BRIDGE_MESSAGE_EXT_CHANNEL:()=>d,JS_BRIDGE_MESSAGE_EXT_PING:()=>l,JS_BRIDGE_MESSAGE_IPC_CHANNEL:()=>f});var t=r(8298);function i(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class o extends t{emit(e,...t){return super.emit(e,...t)}addListener(e,t){return super.addListener(e,t),this}on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}removeListener(e,t){return super.removeListener(e,t),this}off(e,t){return super.off(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}setMaxListeners(e){return super.setMaxListeners(e),this}getMaxListeners(){return super.getMaxListeners()}listeners(e){return super.listeners(e)}rawListeners(e){return super.rawListeners(e)}listenerCount(e){return super.listenerCount(e)}prependListener(e,t){return super.prependListener(e,t),this}prependOnceListener(e,t){return super.prependOnceListener(e,t),this}eventNames(){return super.eventNames()}}class s extends o{emit(e,...t){let r="error"===e;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const o=n[e];if(void 0===o)return!1;if("function"==typeof o)i(o,this,t);else{const e=o.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(o);for(let n=0;n<e;n+=1)i(r[n],this,t)}return!0}}var a=r(8395),u=r(2788),c=r(4554),h=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const f="onekey@JS_BRIDGE_MESSAGE_IPC_CHANNEL",d="onekey@JS_BRIDGE_MESSAGE_EXT_CHANNEL",l="onekey@JS_BRIDGE_MESSAGE_EXT_PING",p={HOST_TO_INPAGE:"onekey@JS_BRIDGE_MESSAGE_DIRECTION-HOST_TO_INPAGE",INPAGE_TO_HOST:"onekey@JS_BRIDGE_MESSAGE_DIRECTION-INPAGE_TO_HOST"},y="onekey@EXT_PORT_CS_TO_BG",g="onekey@EXT_PORT_UI_TO_BG",b="$$ONEKEY_DEBUG_LOGGER";var m=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const v=b,w={formatArgs:function(e){if(e[0]=`${(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")}+${w.humanize(this.diff)}`,!this.useColors)return;const t=`color: ${this.color}`;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r+=1,"%c"===e&&(n=r))})),e.splice(n,0,t)},save:function(e){return m(this,void 0,void 0,(function*(){try{e?yield w.storage.setItem(v,e):yield w.storage.removeItem(v)}catch(e){console.error("debug logger storage error",e)}}))},load:function(){return m(this,void 0,void 0,(function*(){let e;try{e=yield w.storage.getItem(v)}catch(e){console.error("debug logger storage error",e)}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}))},useColors:function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}};w.storage=function(){try{return"undefined"!=typeof global&&global.$$onekeyAppStorage?global.$$onekeyAppStorage:"undefined"!=typeof window&&window.localStorage?window.localStorage:(console.warn("debugLogger init warning, neither `global.$$onekeyAppStorage` nor `window.localStorage` found."),{getItem(){return m(this,void 0,void 0,(function*(){return""}))},setItem(){return m(this,void 0,void 0,(function*(){}))},removeItem(){return m(this,void 0,void 0,(function*(){}))}})}catch(e){console.error("debug logger storage error",e)}}(),w.humanize=c,w.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),w.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],w.log=(...e)=>{console.debug?console.debug(...e):console.log&&console.log(...e)};const _=w;const E=function(){return e=this,t=void 0,n=function*(){return function(e){return h(this,void 0,void 0,(function*(){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>`-${e}`))].join(",");return t.enable(""),e},t.enable=function(e){return h(this,void 0,void 0,(function*(){let r;yield t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp(`^${e.substr(1)}$`)):t.names.push(new RegExp(`^${e}$`)))}))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=c,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={j(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: ${e.message}`}}},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]};const i=yield t.load();return yield t.enable(i),t}))}(_)},new((r=void 0)||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}));var e,t,r,n};function A(...e){"undefined"!=typeof localStorage&&localStorage.getItem(b)&&console.error(...e)}const S={_isFakeLogger:!0,log:(...e)=>{},warn:(...e)=>{},error:(...e)=>{},debug:(...e)=>{},info:(...e)=>{},trace:(...e)=>{}};var M;!function(e){e.jsBridge="jsBridge",e.providerBase="providerBase",e.extInjected="extInjected",e.extContentScripts="extContentScripts",e.webview="webview",e.desktopInjected="desktopInjected",e.ethereum="ethereum"}(M||(M={}));class x extends s{constructor(){super(),this.jsBridge=(...e)=>null,this.providerBase=(...e)=>null,this.extInjected=(...e)=>null,this.extContentScripts=(...e)=>null,this.webview=(...e)=>null,this.desktopInjected=(...e)=>null,this.ethereum=(...e)=>null,this._debug={enable(e){}},this._externalLogger=S,this._createExternalLog=e=>(...t)=>{var r,n;return this.once("debugReady",(()=>{var r;null===(r=this[e])||void 0===r||r.call(this,...t)})),null===(n=null===(r=this._externalLogger)||void 0===r?void 0:r.log)||void 0===n?void 0:n.call(r,`${e} >>> `,...t)},this.initExternalLogInstances()}initExternalLogInstances(){Object.keys(M).forEach((e=>{this[e]=this._createExternalLog(e)}))}isDebugReady(){return this._debug&&"function"==typeof this._debug}_attachExternalLogger(e){e&&(this._externalLogger=e)}_createDebugInstance(e){}}const k=new x,I=new class extends x{constructor(){super(),this._debugInstanceCreatedMap={},E().then((e=>{this._debug=e,this.initDebugInstances(),this.emit("debugReady")}))}initDebugInstances(){this.isDebugReady()&&Object.keys(M).forEach((e=>{this[e]=this._debug(e)}))}_createDebugInstance(e){if(!this._debugInstanceCreatedMap[e]&&(this._debugInstanceCreatedMap[e]=!0,e&&this._debug&&"function"==typeof this._debug)){const t=this._debug(e),r=this[e];this[e]=(...e)=>{t(...e),r&&"function"==typeof r&&r(...e)}}}};var R,B;!function(e){e.RESPONSE="RESPONSE",e.REQUEST="REQUEST"}(R||(R={})),function(e){e.ethereum="ethereum",e.conflux="conflux",e.solana="solana",e.starcoin="starcoin",e.sollet="sollet",e.near="near",e.aptos="aptos",e.martian="martian",e.$private="$private",e.$hardware_sdk="$hardware_sdk"}(B||(B={}));var T=r(9439);class U extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return T(this.serialize(),C,2)}}class O extends U{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function C(e,t){if("[Circular]"!==t)return t}const P=-32600,z=-32603,L=4100,N=4500,q={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Web3 provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4500:{standard:"",message:"The request by this Web3 provider is timeout."}};function j(e,t="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const t=e.toString();if(r=q,n=t,Object.prototype.hasOwnProperty.call(r,n))return q[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return"Unspecified server error."}var r,n;return t}j(z);const D=e=>H(P,e),F=e=>W(L,e),$=e=>W(N,e);function H(e,t){const[r,n]=K(t);return new U(e,r||j(e),n)}function W(e,t){const[r,n]=K(t);return new O(e,r||j(e),n)}function K(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}const G="1.0.2";const V="undefined"!=typeof window?window:global,J="message",Y="error";class Z extends s{constructor(e={}){var t,r;super(),this._requestPayloadCache={},this.isExtUi=!1,this.isInjected=!1,this.sendAsString=!0,this.globalOnMessageEnabled=!0,this.providersHub={},this.globalOnMessage=e=>{return t=this,r=void 0,i=function*(){try{if(this.config.receiveHandler&&this.globalOnMessageEnabled){const t=yield this.config.receiveHandler(e,this);e.id&&this.response({id:e.id,scope:e.scope,remoteId:e.remoteId,data:t})}}catch(t){e.id&&e.type===R.REQUEST&&this.responseError({id:e.id,scope:e.scope,remoteId:e.remoteId,error:t}),this.emit(Y,t)}},new((n=void 0)||(n=Promise))((function(e,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,a)}u((i=i.apply(t,r||[])).next())}));var t,r,n,i},this.version=G,this.remoteInfo={origin:"",remoteId:""},this.callbacksExpireTimeout=6e5,this.debugLogger=I,this.callbacks=[],this.callbackId=1,this.config=e,this.callbacksExpireTimeout=null!==(t=e.timeout)&&void 0!==t?t:this.callbacksExpireTimeout,this.debugLogger=e.debugLogger||I,this.sendAsString=null!==(r=e.sendAsString)&&void 0!==r?r:this.sendAsString,this.config.receiveHandler&&this.on(J,this.globalOnMessage),this.on(Y,(e=>{var t;A("JsBridge ERROR: ",e,{code:null===(t=e)||void 0===t?void 0:t.code})})),this.rejectExpiredCallbacks()}attachProviderInstance(e){var t;const r=e.providerName;r&&(this.providersHub[r]=null!==(t=this.providersHub[r])&&void 0!==t?t:[],this.providersHub[r].push(e))}createCallbackId(){return this.callbackId+=1,this.callbackId}createPayload(e,{resolve:t,reject:r}){const{id:n,type:i}=e;if(t&&r&&n&&i===R.REQUEST){if(this.callbacks[n])throw new Error(`JsBridge ERROR: callback exists, id=${n}`);this.callbacks[n]={id:n,resolve:t,reject:r,created:Date.now()}}if(e.error){const t=e.error;e.error=function(e){return{name:e.name,message:e.message,stack:e.stack,code:e.code,data:e.data,key:e.key,info:e.info,className:e.className}}(t)}return null==e||delete e.resolve,null==e||delete e.reject,e}send({type:e,data:t,error:r,id:n,remoteId:i,sync:o=!1,scope:s}){const a=(a,u)=>{var c,h,f;let d=n;o||e!==R.REQUEST||(d=this.createCallbackId());try{const n=this.createPayload({id:d,data:t,error:r,type:e,origin:(null===(c=null==V?void 0:V.location)||void 0===c?void 0:c.origin)||"",remoteId:i,scope:s},{resolve:a,reject:u});let o=n;this.sendAsString&&(o=JSON.stringify(n)),(null===(h=this.debugLogger.jsBridge)||void 0===h?void 0:h.enabled)&&n&&n.id&&n.type===R.REQUEST&&(this._requestPayloadCache[n.id]=n,n.id%100==0&&(this._requestPayloadCache={})),this.debugLogger.jsBridge("send",n,"\r\n ------\x3e ",n.data,"\r\n ------\x3e ",null===(f=n.data)||void 0===f?void 0:f.result),this.sendPayload(o)}catch(e){d?this.rejectCallback(d,e):this.emit(Y,e)}};if(!o)return new Promise(a);a()}rejectCallback(e,t){this.processCallback({method:"reject",id:e,error:t})}resolveCallback(e,t){this.processCallback({method:"resolve",id:e,data:t})}processCallback({method:e,id:t,data:r,error:n}){const i=this.callbacks[t];i&&("reject"===e&&(i.reject&&i.reject(n),this.emit(Y,n)),"resolve"===e&&i.resolve&&i.resolve(r),this.clearCallbackCache(t))}rejectExpiredCallbacks(){if(!this.callbacksExpireTimeout)return;const e=Date.now();for(const t in this.callbacks){const r=this.callbacks[t];if(r&&r.created&&e-r.created>this.callbacksExpireTimeout){const e=$();this.rejectCallback(t,e)}}setTimeout((()=>{this.rejectExpiredCallbacks()}),this.callbacksExpireTimeout)}clearCallbackCache(e){delete this.callbacks[e]}receive(e="",t){var r,n,i,o,s;let c={data:null};if(a(e)&&(c=e),u(e))try{c=JSON.parse(e)}catch(p){throw this.emit(Y,p),new Error("JsBridge ERROR: JSON.parse payloadReceived failed")}if(c.origin=null==t?void 0:t.origin,c.internal=Boolean(null==t?void 0:t.internal),(null==t?void 0:t.internal)&&this.isExtUi&&function(e){const t=e;return Boolean(t.name)&&["onekey-provider-eth","onekey-provider-cfx","publicConfig"].includes(t.name)}(c))return;if(!c.origin&&!this.isInjected)throw A(null===(r=null==this?void 0:this.constructor)||void 0===r?void 0:r.name,"[payload.origin] is missing.",this),new Error("JsBridge ERROR: receive message [payload.origin] is required.");if(!c.internal&&!c.scope)throw new Error("JsBridge ERROR: receive message [payload.scope] is required for non-internal method call.");const h=null!==(i=this._requestPayloadCache[null!==(n=null==c?void 0:c.id)&&void 0!==n?n:""])&&void 0!==i?i:null;this.debugLogger.jsBridge("receive",c,{sender:t},"\r\n -----\x3e ",null!==(s=null===(o=c.data)||void 0===o?void 0:o.result)&&void 0!==s?s:c.data,"\r\n <----- ",null==h?void 0:h.data);const{type:f,id:d,data:l,error:p,origin:y,remoteId:g}=c;if(this.remoteInfo={origin:y,remoteId:g},f===R.RESPONSE){if(null==d)throw new Error("JsBridge ERROR: parameter [id] is required in JsBridge.receive() when REQUEST type message");if(this.callbacks[d])try{p?this.rejectCallback(d,p):this.resolveCallback(d,l)}catch(e){this.emit(Y,e)}}else{if(f!==R.REQUEST)throw new Error(`JsBridge ERROR: payload type not support yet (type=${f||"undefined"})`);{const e=Object.assign(Object.assign({},c),{created:Date.now()});this.emit(J,e)}}}requestSync({data:e,scope:t,remoteId:r}){this.send({id:void 0,type:R.REQUEST,scope:t,data:e,remoteId:r,sync:!0})}request(e){const{data:t,remoteId:r,scope:n}=e;return void 0===t&&console.warn("JsBridge ERROR: data required. Call like `bridge.request({ data: {...} });`"),this.send({type:R.REQUEST,data:t,remoteId:r,sync:!1,scope:n})}response({id:e,data:t,remoteId:r,scope:n}){this.send({type:R.RESPONSE,data:t,id:e,remoteId:r,scope:n,sync:!0})}responseError({id:e,error:t,scope:r,remoteId:n}){this.send({type:R.RESPONSE,error:t,id:e,remoteId:n,scope:r,sync:!0})}}var X=r(5920),Q=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};function ee(e){return new Promise(((t,r)=>{try{const r=document.createElement("img");r.onload=()=>t(!0),r.onerror=()=>t(!1),r.src=e}catch(e){r(e)}}))}function te(e){const{document:t}=e,r=t.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;const n=t.querySelector('head > meta[name="title"]');return n?n.content:t.title&&t.title.length>0?t.title:window.location.hostname}function re(e){return Q(this,void 0,void 0,(function*(){const{document:t}=e,r=t.querySelectorAll('head > link[rel~="icon"]');for(const e of r)if(e&&(yield ee(e.href)))return e.href;return null}))}const ne={getSiteMetadata:function(){return Q(this,void 0,void 0,(function*(){return{name:te(window),icon:yield re(window)}}))},getSiteIcon:re,getSiteName:te,imgExists:ee};var ie=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class oe extends s{constructor(e){var t,r,n;if(super(),this.version=G,this.isOneKey=!0,this.debugLogger=k,this.logger=S,!e.bridge)throw new Error("ProviderBase init error: bridge required.");this.config=e,this.bridge=e.bridge,this.logger=e.logger||S,this.debugLogger=(null===(t=this.bridge)||void 0===t?void 0:t.debugLogger)||k,null===(n=null===(r=this.bridge)||void 0===r?void 0:r.debugLogger)||void 0===n||n._attachExternalLogger(this.logger),setTimeout((()=>{this.bridge.attachProviderInstance(this)}),0)}configDebugLogger(e){try{if(!e||!this.bridge.debugLogger)return;const t=this.bridge.debugLogger;(e.enabledKeys||[]).forEach((e=>{t._createDebugInstance(e)})),e.config&&t._debug.enable(e.config),window.$onekey=window.$onekey||{},window.$onekey.$debugLogger=t}catch(e){A("configDebugLogger ERROR:",e)}}getConnectWalletInfo({timeout:e=3e3}={}){return ie(this,void 0,void 0,(function*(){return new Promise(((t,r)=>ie(this,void 0,void 0,(function*(){const r=setTimeout((()=>{t(null)}),e);try{const e=yield this.bridgeRequest({method:"wallet_getConnectWalletInfo",params:[{time:Date.now()}]});e&&(e.providerState=e.providerState||{}),e&&e.debugLoggerConfig&&this.configDebugLogger(e.debugLoggerConfig),e&&e.walletInfo&&(window.$onekey=window.$onekey||{},window.$onekey.$walletInfo=e.walletInfo),t(e||null)}catch(e){A("getConnectWalletInfo: ERROR",e),t(null)}finally{clearTimeout(r)}}))))}))}bridgeRequest(e,t){var r,n,i,o;return ie(this,void 0,void 0,(function*(){let s=!1;t&&X(t)&&(s=!0);try{const a={data:null!=e?e:{},scope:this.providerName};this.debugLogger.providerBase("bridgeRequest:",a,"\r\n -----\x3e ",a.data);const u=yield this.bridge.request(a);u&&(u.id=null!==(n=null!==(r=null==e?void 0:e.id)&&void 0!==r?r:u.id)&&void 0!==n?n:void 0,u.jsonrpc=null!==(o=null!==(i=null==e?void 0:e.jsonrpc)&&void 0!==i?i:u.jsonrpc)&&void 0!==o?o:"2.0");const c=u?u.result:void 0;return t&&s&&t(null,u),this.debugLogger.providerBase("bridgeRequest RETURN:",{req:a,res:u},"\r\n -----\x3e ",a.data,"\r\n -----\x3e ",c),c}catch(e){throw t&&s&&t(e),e}}))}sendSiteMetadataDomReady(){if("complete"===document.readyState)this.sendSiteMetadata();else{const e=()=>{this.sendSiteMetadata(),window.removeEventListener("DOMContentLoaded",e)};window.addEventListener("DOMContentLoaded",e)}}sendSiteMetadata(){return ie(this,void 0,void 0,(function*(){const e=yield ne.getSiteMetadata();return yield this.bridgeRequest({method:"wallet_sendSiteMetadata",params:e})}))}}function se(e){var t;return window.global=window.global||window||window.globalThis,window.global=window.global||window||window.globalThis,(null===(t=null===window||void 0===window?void 0:window.$onekey)||void 0===t?void 0:t.jsBridge)||(window.$onekey=window.$onekey||{},window.$onekey.jsBridge=e(),"undefined"!=typeof localStorage&&localStorage.getItem(b)&&console.log("===== jsBridge injected success! >>>>> ",performance.now())),window.$onekey.jsBridge}function ae(e,t){const r=(null==t?void 0:t.providersHub)||window.$onekey,n=e.scope,i=e.data;if(!n)return void A("providerName (scope) is required in injectedProviderReceiveHandler.");const o=[].concat(r[n]).filter(Boolean);o&&o.length?o.forEach((e=>{e&&e.emit&&e.emit("message_low_level",i)})):A(`[${n}] provider is NOT injected to document or bridge.`)}const{JS_BRIDGE_MESSAGE_DIRECTION:ue,JS_BRIDGE_MESSAGE_EXT_CHANNEL:ce}=e;function he(e={}){return se((()=>new de(Object.assign(Object.assign({},e),{receiveHandler:ae}))))}let fe=!1;class de extends Z{constructor(e){super(e),this.sendAsString=!1,this.isInjected=!0,function(e={}){const t=e.debugLogger||k;fe||(fe=!0,window.addEventListener("message",(r=>{var n,i;if(r.source!==window)return;const o=r.data;if(o.channel===ce&&o.direction===ue.HOST_TO_INPAGE){t.extInjected("onWindowPostMessage",o);const r=o.payload,s=null!==(n=e.bridge)&&void 0!==n?n:null===(i=null===window||void 0===window?void 0:window.$onekey)||void 0===i?void 0:i.jsBridge;s&&s.receive(r)}}),!1))}({debugLogger:this.debugLogger,bridge:this})}sendPayload(e){window.postMessage({channel:ce,direction:ue.INPAGE_TO_HOST,payload:e})}}var le=r(8429),pe=r(9378);const ye={errors:{disconnected:()=>"MetaMask: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"MetaMask: Disconnected from MetaMask background. Page reload required.",sendSiteMetadata:()=>"MetaMask: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`MetaMask: Connected to chain with ID "${e}".`},warnings:{enableDeprecation:"MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",sendDeprecation:"MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",events:{close:"MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"},experimentalMethods:"MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning."}},ge=()=>{},be=["eth_subscription"];var me=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class ve extends oe{constructor(e){var t;super(e),this.providerName=B.ethereum,this.isMetaMask=!0,this._log=null!==(t=e.logger)&&void 0!==t?t:window.console,this._state=Object.assign({},ve._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this),this._handleStreamDisconnect.bind(this,"OneKey"),this.on("connect",(()=>{this._state.isConnected=!0})),this._handleStreamDisconnect.bind(this,"OneKey RpcProvider"),this._initializeState(),this.on("message_low_level",(e=>{const{method:t,params:r}=e;"metamask_accountsChanged"===t?this._handleAccountsChanged(r):"metamask_unlockStateChanged"===t?this._handleUnlockStateChanged(r):"metamask_chainChanged"===t?this._handleChainChanged(r):be.includes(t)?this.emit("message",{type:t,data:r}):"METAMASK_STREAM_FAILURE"===t&&new Error(ye.errors.permanentlyDisconnected())}))}isConnected(){return this._state.isConnected}request(e){return me(this,void 0,void 0,(function*(){if(I.ethereum("request",e),!e||"object"!=typeof e||Array.isArray(e))throw le.Sy.rpc.invalidRequest({message:ye.errors.invalidRequestArgs(),data:e});const{method:t,params:r,id:n}=e;if(!t||"string"!=typeof t||0===t.length)throw le.Sy.rpc.invalidRequest({message:ye.errors.invalidRequestMethod(),data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw le.Sy.rpc.invalidRequest({message:ye.errors.invalidRequestParams(),data:e});const i=yield this._rpcRequest({method:t,params:r,id:n});return I.ethereum("request->response","\n",e,"\n ---\x3e ",i),i}))}_initializeState(){return me(this,void 0,void 0,(function*(){try{const e=yield this.request({method:"metamask_getProviderState"}),{accounts:t,chainId:r,isUnlocked:n,networkVersion:i}=e;this.emit("connect",{chainId:r}),this._handleChainChanged({chainId:r,networkVersion:i}),this._handleUnlockStateChanged({accounts:t,isUnlocked:n}),this._handleAccountsChanged(t)}catch(e){this._log.error("MetaMask: Failed to get initial state. Please report this bug.",e)}finally{this._state.initialized=!0,this.emit("_initialized")}}))}_rpcRequest(e,t){return me(this,void 0,void 0,(function*(){if(!Array.isArray(e)){e.jsonrpc||(e.jsonrpc="2.0");const r=yield this.bridgeRequest(e,t);return"eth_accounts"!==e.method&&"eth_requestAccounts"!==e.method||this._handleAccountsChanged(r||[],"eth_accounts"===e.method),r}return this.bridgeRequest(e,t)}))}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),this._log.debug(ye.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let r;this._state.isConnected=!1,e?(r=new le.Cg(1013,t||ye.errors.disconnected()),this._log.debug(r)):(r=new le.Cg(1011,t||ye.errors.permanentlyDisconnected()),this._log.error(r),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r)}}_handleStreamDisconnect(e,t){!function(e,t,r,n){let i=`MetaMask: Lost connection to "${t}".`;(null==r?void 0:r.stack)&&(i+=`\n${r.stack}`),e.warn(i),n&&n.listenerCount("error")>0&&n.emit("error",i)}(this._log,e,t,this),this._handleDisconnect(!1,t?t.message:void 0)}_handleChainChanged({chainId:e,networkVersion:t}={}){e&&"string"==typeof e&&e.startsWith("0x")&&t&&"string"==typeof t?"loading"===t?this._handleDisconnect(!0):(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId))):this._log.error("MetaMask: Received invalid network parameters. Please report this bug.",{chainId:e,networkVersion:t})}_handleAccountsChanged(e,t=!1){let r=e;Array.isArray(e)||(this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.",e),r=[]);for(const t of e)if("string"!=typeof t){this._log.error("MetaMask: Received non-string account. Please report this bug.",e),r=[];break}pe(this._state.accounts,r)||(t&&null!==this._state.accounts&&this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.",r),this._state.accounts=r,this.selectedAddress!==r[0]&&(this.selectedAddress=r[0]||null),this._state.initialized&&this.emit("accountsChanged",r))}_handleUnlockStateChanged({accounts:e,isUnlocked:t}={}){"boolean"==typeof t?t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e||[])):this._log.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.")}}ve._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1};var we=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class _e extends ve{constructor(e){super(e),this._sentWarnings={enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},this.networkVersion=null,this.isMetaMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._metamask=this._getExperimentalApi(),this.bridge.on("notification",(e=>{const{method:t}=e;if(be.includes(t)){this.emit("data",e);const t=e.params;this.emit("notification",t.result)}}))}sendAsync(e,t){this._rpcRequest(e,t)}addListener(e,t){return this._warnOfDeprecation(e),super.addListener(e,t)}on(e,t){return this._warnOfDeprecation(e),super.on(e,t)}once(e,t){return this._warnOfDeprecation(e),super.once(e,t)}prependListener(e,t){return this._warnOfDeprecation(e),super.prependListener(e,t)}prependOnceListener(e,t){return this._warnOfDeprecation(e),super.prependOnceListener(e,t)}_handleDisconnect(e,t){super._handleDisconnect(e,t),this.networkVersion&&!e&&(this.networkVersion=null)}_warnOfDeprecation(e){var t;!1===(null===(t=this._sentWarnings)||void 0===t?void 0:t.events[e])&&(this._log.warn(ye.warnings.events[e]),this._sentWarnings.events[e]=!0)}enable(){return we(this,void 0,void 0,(function*(){return this._sentWarnings.enable||(this._log.warn(ye.warnings.enableDeprecation),this._sentWarnings.enable=!0),yield this._rpcRequest({method:"eth_requestAccounts",params:[]})}))}_rpcResult(e,t){var r,n;return{id:null!==(r=null==t?void 0:t.id)&&void 0!==r?r:void 0,jsonrpc:null!==(n=null==t?void 0:t.jsonrpc)&&void 0!==n?n:"2.0",result:e}}send(e,t){return this._sentWarnings.send||(this._log.warn(ye.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof e||t&&!Array.isArray(t)?e&&"object"==typeof e&&"function"==typeof t?this._rpcRequest(e,t):this._sendSync(e):this._rpcRequest({method:e,params:t}).then((e=>this._rpcResult(e)))}_sendSync(e){let t;switch(e.method){case"eth_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":t=this.selectedAddress||null;break;case"eth_uninstallFilter":this._rpcRequest(e,ge),t=!0;break;case"net_version":t=this.networkVersion||null;break;default:throw new Error(ye.errors.unsupportedSync(e.method))}return this._rpcResult(t,e)}_getExperimentalApi(){return new Proxy({isUnlocked:()=>we(this,void 0,void 0,(function*(){return this._state.initialized||(yield new Promise((e=>{this.on("_initialized",(()=>e()))}))),this._state.isUnlocked})),requestBatch:e=>we(this,void 0,void 0,(function*(){if(!Array.isArray(e))throw le.Sy.rpc.invalidRequest({message:"Batch requests must be made with an array of request objects.",data:e});return this._rpcRequest(e)}))},{get:(e,t,...r)=>(this._sentWarnings.experimentalMethods||(this._log.warn(ye.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(e,t,...r))})}_handleChainChanged({chainId:e,networkVersion:t}={}){super._handleChainChanged({chainId:e,networkVersion:t}),t&&"loading"!==t&&t!==this.networkVersion&&(this.networkVersion=t,this._state.initialized&&this.emit("networkChanged",this.networkVersion))}}class Ee extends _e{}class Ae extends oe{constructor(e){super(e),this.providerName=B.$private;try{this.getConnectWalletInfo()}catch(e){console.error(e)}try{this.sendSiteMetadataDomReady()}catch(e){console.error(e)}}request(e){return this.bridgeRequest(e)}}var Se=r(5474),Me=r.n(Se),xe=r(5326),ke=r(7543),Ie=r.n(ke),Re=r(6565),Be=r.n(Re),Te=r(9989),Ue=r(4920);class Oe extends TypeError{constructor(e,t){let r;const{message:n,...i}=e,{path:o}=e;super(0===o.length?n:"At path: "+o.join(".")+" -- "+n),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function Ce(e){return"object"==typeof e&&null!=e}function Pe(e){return"string"==typeof e?JSON.stringify(e):""+e}function ze(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:s}=r,{refinement:a,message:u="Expected a value of type `"+s+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+Pe(n)+"`"}=e;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...e,message:u}}function*Le(e,t,r,n){var i;Ce(i=e)&&"function"==typeof i[Symbol.iterator]||(e=[e]);for(const i of e){const e=ze(i,t,r,n);e&&(yield e)}}function*Ne(e,t,r={}){const{path:n=[],branch:i=[e],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i};if(o&&(e=t.coercer(e,a),s&&"type"!==t.type&&Ce(t.schema)&&Ce(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u=!0;for(const r of t.validator(e,a))u=!1,yield[r,void 0];for(let[r,c,h]of t.entries(e,a)){const t=Ne(c,h,{path:void 0===r?n:[...n,r],branch:void 0===r?i:[...i,c],coerce:o,mask:s});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):o&&(c=n[1],void 0===r?e=c:e instanceof Map?e.set(r,c):e instanceof Set?e.add(c):Ce(e)&&(e[r]=c))}if(u)for(const r of t.refiner(e,a))u=!1,yield[r,void 0];u&&(yield[void 0,e])}class qe{constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:o=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(e,t)=>Le(n(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>Le(i(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=Fe(e,t);if(r[0])throw r[0]}(e,this)}create(e){return je(e,this)}is(e){return De(e,this)}mask(e){return function(e,t){const r=Fe(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return Fe(e,this,t)}}function je(e,t){const r=Fe(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}function De(e,t){return!Fe(e,t)[0]}function Fe(e,t,r={}){const n=Ne(e,t,r),i=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return i[0]?[new Oe(i[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,i[1]]}function $e(e,t){return new qe({type:e,schema:null,validator:t})}function He(e){return new qe({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+Pe(e)})}function We(){return $e("boolean",(e=>"boolean"==typeof e))}function Ke(e){return $e("instance",(t=>t instanceof e||"Expected a `"+e.name+"` instance, but received: "+Pe(t)))}function Ge(e){const t=Pe(e),r=typeof e;return new qe({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||"Expected the literal `"+t+"`, but received: "+Pe(r)})}function Ve(e){return new qe({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function Je(){return $e("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+Pe(e)))}function Ye(e){return new qe({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function Ze(e,t){return new qe({type:"record",schema:null,*entries(r){if(Ce(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator:e=>Ce(e)||"Expected an object, but received: "+Pe(e)})}function Xe(){return $e("string",(e=>"string"==typeof e||"Expected a string, but received: "+Pe(e)))}function Qe(e){const t=$e("never",(()=>!1));return new qe({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator:e=>Array.isArray(e)||"Expected an array, but received: "+Pe(e)})}function et(e){const t=Object.keys(e);return new qe({type:"type",schema:e,*entries(r){if(Ce(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>Ce(e)||"Expected an object, but received: "+Pe(e)})}function tt(e){const t=e.map((e=>e.type)).join(" | ");return new qe({type:"union",schema:null,validator(r,n){const i=[];for(const t of e){const[...e]=Ne(r,t,n),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return["Expected the value to satisfy a union of `"+t+"`, but received: "+Pe(r),...i]}})}function rt(){return $e("unknown",(()=>!0))}function nt(e,t,r){return new qe({...e,coercer:(n,i)=>De(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}r(4217),r(6350);var it=r(5293),ot=r.n(it),st=r(5498),at=r.n(st);const ut=e=>xe.Buffer.isBuffer(e)?e:e instanceof Uint8Array?xe.Buffer.from(e.buffer,e.byteOffset,e.byteLength):xe.Buffer.from(e);var ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},ht={},ft={},dt=lt;function lt(e,t){if(!e)throw new Error(t||"Assertion failed")}lt.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var pt={exports:{}};"function"==typeof Object.create?pt.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:pt.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var yt=dt,gt=pt.exports;function bt(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function mt(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function vt(e){return 1===e.length?"0"+e:e}function wt(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}ft.inherits=gt,ft.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):bt(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},ft.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=vt(e[r].toString(16));return t},ft.htonl=mt,ft.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=mt(i)),r+=wt(i.toString(16))}return r},ft.zero2=vt,ft.zero8=wt,ft.join32=function(e,t,r,n){var i=r-t;yt(i%4==0);for(var o=new Array(i/4),s=0,a=t;s<o.length;s++,a+=4){var u;u="big"===n?e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]:e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a],o[s]=u>>>0}return o},ft.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},ft.rotr32=function(e,t){return e>>>t|e<<32-t},ft.rotl32=function(e,t){return e<<t|e>>>32-t},ft.sum32=function(e,t){return e+t>>>0},ft.sum32_3=function(e,t,r){return e+t+r>>>0},ft.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},ft.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},ft.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},ft.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},ft.sum64_lo=function(e,t,r,n){return t+n>>>0},ft.sum64_4_hi=function(e,t,r,n,i,o,s,a){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},ft.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},ft.sum64_5_hi=function(e,t,r,n,i,o,s,a,u,c){var h=0,f=t;return h+=(f=f+n>>>0)<t?1:0,h+=(f=f+o>>>0)<o?1:0,h+=(f=f+a>>>0)<a?1:0,e+r+i+s+u+(h+=(f=f+c>>>0)<c?1:0)>>>0},ft.sum64_5_lo=function(e,t,r,n,i,o,s,a,u,c){return t+n+o+a+c>>>0},ft.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},ft.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},ft.shr64_hi=function(e,t,r){return e>>>r},ft.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var _t={},Et=ft,At=dt;function St(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_t.BlockHash=St,St.prototype.update=function(e,t){if(e=Et.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=Et.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},St.prototype.digest=function(e){return this.update(this._pad()),At(null===this.pending),this._digest(e)},St.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var Mt={},xt={},kt=ft.rotr32;function It(e,t,r){return e&t^~e&r}function Rt(e,t,r){return e&t^e&r^t&r}function Bt(e,t,r){return e^t^r}xt.ft_1=function(e,t,r,n){return 0===e?It(t,r,n):1===e||3===e?Bt(t,r,n):2===e?Rt(t,r,n):void 0},xt.ch32=It,xt.maj32=Rt,xt.p32=Bt,xt.s0_256=function(e){return kt(e,2)^kt(e,13)^kt(e,22)},xt.s1_256=function(e){return kt(e,6)^kt(e,11)^kt(e,25)},xt.g0_256=function(e){return kt(e,7)^kt(e,18)^e>>>3},xt.g1_256=function(e){return kt(e,17)^kt(e,19)^e>>>10};var Tt=ft,Ut=_t,Ot=xt,Ct=Tt.rotl32,Pt=Tt.sum32,zt=Tt.sum32_5,Lt=Ot.ft_1,Nt=Ut.BlockHash,qt=[1518500249,1859775393,2400959708,3395469782];function jt(){if(!(this instanceof jt))return new jt;Nt.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Tt.inherits(jt,Nt);var Dt=jt;jt.blockSize=512,jt.outSize=160,jt.hmacStrength=80,jt.padLength=64,jt.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Ct(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4];for(n=0;n<r.length;n++){var c=~~(n/20),h=zt(Ct(i,5),Lt(c,o,s,a),u,r[n],qt[c]);u=a,a=s,s=Ct(o,30),o=i,i=h}this.h[0]=Pt(this.h[0],i),this.h[1]=Pt(this.h[1],o),this.h[2]=Pt(this.h[2],s),this.h[3]=Pt(this.h[3],a),this.h[4]=Pt(this.h[4],u)},jt.prototype._digest=function(e){return"hex"===e?Tt.toHex32(this.h,"big"):Tt.split32(this.h,"big")};var Ft=ft,$t=_t,Ht=xt,Wt=dt,Kt=Ft.sum32,Gt=Ft.sum32_4,Vt=Ft.sum32_5,Jt=Ht.ch32,Yt=Ht.maj32,Zt=Ht.s0_256,Xt=Ht.s1_256,Qt=Ht.g0_256,er=Ht.g1_256,tr=$t.BlockHash,rr=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function nr(){if(!(this instanceof nr))return new nr;tr.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=rr,this.W=new Array(64)}Ft.inherits(nr,tr);var ir=nr;nr.blockSize=512,nr.outSize=256,nr.hmacStrength=192,nr.padLength=64,nr.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Gt(er(r[n-2]),r[n-7],Qt(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],c=this.h[5],h=this.h[6],f=this.h[7];for(Wt(this.k.length===r.length),n=0;n<r.length;n++){var d=Vt(f,Xt(u),Jt(u,c,h),this.k[n],r[n]),l=Kt(Zt(i),Yt(i,o,s));f=h,h=c,c=u,u=Kt(a,d),a=s,s=o,o=i,i=Kt(d,l)}this.h[0]=Kt(this.h[0],i),this.h[1]=Kt(this.h[1],o),this.h[2]=Kt(this.h[2],s),this.h[3]=Kt(this.h[3],a),this.h[4]=Kt(this.h[4],u),this.h[5]=Kt(this.h[5],c),this.h[6]=Kt(this.h[6],h),this.h[7]=Kt(this.h[7],f)},nr.prototype._digest=function(e){return"hex"===e?Ft.toHex32(this.h,"big"):Ft.split32(this.h,"big")};var or=ft,sr=ir;function ar(){if(!(this instanceof ar))return new ar;sr.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}or.inherits(ar,sr);var ur=ar;ar.blockSize=512,ar.outSize=224,ar.hmacStrength=192,ar.padLength=64,ar.prototype._digest=function(e){return"hex"===e?or.toHex32(this.h.slice(0,7),"big"):or.split32(this.h.slice(0,7),"big")};var cr=ft,hr=_t,fr=dt,dr=cr.rotr64_hi,lr=cr.rotr64_lo,pr=cr.shr64_hi,yr=cr.shr64_lo,gr=cr.sum64,br=cr.sum64_hi,mr=cr.sum64_lo,vr=cr.sum64_4_hi,wr=cr.sum64_4_lo,_r=cr.sum64_5_hi,Er=cr.sum64_5_lo,Ar=hr.BlockHash,Sr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Mr(){if(!(this instanceof Mr))return new Mr;Ar.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Sr,this.W=new Array(160)}cr.inherits(Mr,Ar);var xr=Mr;function kr(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function Ir(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function Rr(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function Br(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function Tr(e,t){var r=dr(e,t,28)^dr(t,e,2)^dr(t,e,7);return r<0&&(r+=4294967296),r}function Ur(e,t){var r=lr(e,t,28)^lr(t,e,2)^lr(t,e,7);return r<0&&(r+=4294967296),r}function Or(e,t){var r=dr(e,t,14)^dr(e,t,18)^dr(t,e,9);return r<0&&(r+=4294967296),r}function Cr(e,t){var r=lr(e,t,14)^lr(e,t,18)^lr(t,e,9);return r<0&&(r+=4294967296),r}function Pr(e,t){var r=dr(e,t,1)^dr(e,t,8)^pr(e,t,7);return r<0&&(r+=4294967296),r}function zr(e,t){var r=lr(e,t,1)^lr(e,t,8)^yr(e,t,7);return r<0&&(r+=4294967296),r}function Lr(e,t){var r=dr(e,t,19)^dr(t,e,29)^pr(e,t,6);return r<0&&(r+=4294967296),r}function Nr(e,t){var r=lr(e,t,19)^lr(t,e,29)^yr(e,t,6);return r<0&&(r+=4294967296),r}Mr.blockSize=1024,Mr.outSize=512,Mr.hmacStrength=192,Mr.padLength=128,Mr.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=Lr(r[n-4],r[n-3]),o=Nr(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=Pr(r[n-30],r[n-29]),c=zr(r[n-30],r[n-29]),h=r[n-32],f=r[n-31];r[n]=vr(i,o,s,a,u,c,h,f),r[n+1]=wr(i,o,s,a,u,c,h,f)}},Mr.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],u=this.h[5],c=this.h[6],h=this.h[7],f=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],y=this.h[12],g=this.h[13],b=this.h[14],m=this.h[15];fr(this.k.length===r.length);for(var v=0;v<r.length;v+=2){var w=b,_=m,E=Or(f,d),A=Cr(f,d),S=kr(f,0,l,0,y),M=Ir(0,d,0,p,0,g),x=this.k[v],k=this.k[v+1],I=r[v],R=r[v+1],B=_r(w,_,E,A,S,M,x,k,I,R),T=Er(w,_,E,A,S,M,x,k,I,R);w=Tr(n,i),_=Ur(n,i),E=Rr(n,0,o,0,a),A=Br(0,i,0,s,0,u);var U=br(w,_,E,A),O=mr(w,_,E,A);b=y,m=g,y=l,g=p,l=f,p=d,f=br(c,h,B,T),d=mr(h,h,B,T),c=a,h=u,a=o,u=s,o=n,s=i,n=br(B,T,U,O),i=mr(B,T,U,O)}gr(this.h,0,n,i),gr(this.h,2,o,s),gr(this.h,4,a,u),gr(this.h,6,c,h),gr(this.h,8,f,d),gr(this.h,10,l,p),gr(this.h,12,y,g),gr(this.h,14,b,m)},Mr.prototype._digest=function(e){return"hex"===e?cr.toHex32(this.h,"big"):cr.split32(this.h,"big")};var qr=ft,jr=xr;function Dr(){if(!(this instanceof Dr))return new Dr;jr.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}qr.inherits(Dr,jr);var Fr=Dr;Dr.blockSize=1024,Dr.outSize=384,Dr.hmacStrength=192,Dr.padLength=128,Dr.prototype._digest=function(e){return"hex"===e?qr.toHex32(this.h.slice(0,12),"big"):qr.split32(this.h.slice(0,12),"big")},Mt.sha1=Dt,Mt.sha224=ur,Mt.sha256=ir,Mt.sha384=Fr,Mt.sha512=xr;var $r={},Hr=ft,Wr=_t,Kr=Hr.rotl32,Gr=Hr.sum32,Vr=Hr.sum32_3,Jr=Hr.sum32_4,Yr=Wr.BlockHash;function Zr(){if(!(this instanceof Zr))return new Zr;Yr.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Xr(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function Qr(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function en(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}Hr.inherits(Zr,Yr),$r.ripemd160=Zr,Zr.blockSize=512,Zr.outSize=160,Zr.hmacStrength=192,Zr.padLength=64,Zr.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],s=this.h[4],a=r,u=n,c=i,h=o,f=s,d=0;d<80;d++){var l=Gr(Kr(Jr(r,Xr(d,n,i,o),e[tn[d]+t],Qr(d)),nn[d]),s);r=s,s=o,o=Kr(i,10),i=n,n=l,l=Gr(Kr(Jr(a,Xr(79-d,u,c,h),e[rn[d]+t],en(d)),on[d]),f),a=f,f=h,h=Kr(c,10),c=u,u=l}l=Vr(this.h[1],i,h),this.h[1]=Vr(this.h[2],o,f),this.h[2]=Vr(this.h[3],s,a),this.h[3]=Vr(this.h[4],r,u),this.h[4]=Vr(this.h[0],n,c),this.h[0]=l},Zr.prototype._digest=function(e){return"hex"===e?Hr.toHex32(this.h,"little"):Hr.split32(this.h,"little")};var tn=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rn=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],nn=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],on=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],sn=ft,an=dt;function un(e,t,r){if(!(this instanceof un))return new un(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(sn.toArray(t,r))}var cn=un;un.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),an(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},un.prototype.update=function(e,t){return this.inner.update(e,t),this},un.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=e;t.utils=ft,t.common=_t,t.sha=Mt,t.ripemd=$r,t.hmac=cn,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(ht);var hn=ht;let fn=!1,dn=!1;const ln={debug:1,default:2,info:2,warning:3,error:4,off:5};let pn=ln.default,yn=null;const gn=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var bn,mn;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(bn||(bn={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(mn||(mn={}));const vn="0123456789abcdef";class wn{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==ln[r]&&this.throwArgumentError("invalid log level name","logLevel",e),pn>ln[r]||console.log.apply(console,t)}debug(...e){this._log(wn.levels.DEBUG,e)}info(...e){this._log(wn.levels.INFO,e)}warn(...e){this._log(wn.levels.WARNING,e)}makeError(e,t,r){if(dn)return this.makeError("censored error",t,{});t||(t=wn.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=vn[t[e]>>4],r+=vn[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case mn.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case mn.CALL_EXCEPTION:case mn.INSUFFICIENT_FUNDS:case mn.MISSING_NEW:case mn.NONCE_EXPIRED:case mn.REPLACEMENT_UNDERPRICED:case mn.TRANSACTION_REPLACED:case mn.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const s=new Error(e);return s.reason=i,s.code=t,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,wn.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){gn&&this.throwError("platform missing String.prototype.normalize",wn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:gn})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,wn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,wn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,wn.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,wn.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",wn.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",wn.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",wn.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return yn||(yn=new wn("logger/5.6.0")),yn}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",wn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),fn){if(!e)return;this.globalLogger().throwError("error censorship permanent",wn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}dn=!!e,fn=!!t}static setLogLevel(e){const t=ln[e.toLowerCase()];null!=t?pn=t:wn.globalLogger().warn("invalid log level - "+e)}static from(e){return new wn(e)}}wn.errors=mn,wn.levels=bn;const _n=new wn("bytes/5.6.0");function En(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return En(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function An(e){return"number"==typeof e&&e==e&&e%1==0}function Sn(e){return"0x"+hn.sha256().update(function(e,t){if(t||(t={}),"number"==typeof e){_n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),En(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),function(e){return!!e.toHexString}(e)&&(e=e.toHexString()),function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))}(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0x0"+r.substring(2):"right"===t.hexPad?r+="0":_n.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substring(e,e+2),16));return En(new Uint8Array(n))}return function(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!An(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!An(r)||r<0||r>=256)return!1}return!0}(e)?En(new Uint8Array(e)):_n.throwArgumentError("invalid arrayify value","value",e)}(e)).digest("hex")}new wn("sha2/5.6.0");const Mn=new Map;class xn extends class{constructor(e){Object.assign(this,e)}encode(){return xe.Buffer.from((0,Te.serialize)(Mn,this))}static decode(e){return(0,Te.deserialize)(Mn,this,e)}static decodeUnchecked(e){return(0,Te.deserializeUnchecked)(Mn,this,e)}}{constructor(e){if(super({}),this._bn=void 0,function(e){return void 0!==e._bn}(e))this._bn=e._bn;else{if("string"==typeof e){const t=Be().decode(e);if(32!=t.length)throw new Error("Invalid public key input");this._bn=new(Ie())(t)}else this._bn=new(Ie())(e);if(this._bn.byteLength()>32)throw new Error("Invalid public key input")}}equals(e){return this._bn.eq(e._bn)}toBase58(){return Be().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){return this.toBuffer()}toBuffer(){const e=this._bn.toArrayLike(xe.Buffer);if(32===e.length)return e;const t=xe.Buffer.alloc(32);return e.copy(t,32-e.length),t}toString(){return this.toBase58()}static async createWithSeed(e,t,r){const n=xe.Buffer.concat([e.toBuffer(),xe.Buffer.from(t),r.toBuffer()]),i=Sn(new Uint8Array(n)).slice(2);return new xn(xe.Buffer.from(i,"hex"))}static createProgramAddressSync(e,t){let r=xe.Buffer.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");r=xe.Buffer.concat([r,ut(e)])})),r=xe.Buffer.concat([r,t.toBuffer(),xe.Buffer.from("ProgramDerivedAddress")]);let n=Sn(new Uint8Array(r)).slice(2),i=new(Ie())(n,16).toArray(void 0,32);if(In(i))throw new Error("Invalid seeds, address must fall off the curve");return new xn(i)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r,n=255;for(;0!=n;){try{const i=e.concat(xe.Buffer.from([n]));r=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;n--;continue}return[r,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return 1==In(new xn(e).toBytes())}}xn.default=new xn("11111111111111111111111111111111"),Mn.set(xn,{kind:"struct",fields:[["_bn","u256"]]});let kn=Me().lowlevel;function In(e){var t=[kn.gf(),kn.gf(),kn.gf(),kn.gf()],r=kn.gf(),n=kn.gf(),i=kn.gf(),o=kn.gf(),s=kn.gf(),a=kn.gf(),u=kn.gf();return kn.set25519(t[2],Rn),kn.unpack25519(t[1],e),kn.S(i,t[1]),kn.M(o,i,kn.D),kn.Z(i,i,t[2]),kn.A(o,t[2],o),kn.S(s,o),kn.S(a,s),kn.M(u,a,s),kn.M(r,u,i),kn.M(r,r,o),kn.pow2523(r,r),kn.M(r,r,i),kn.M(r,r,o),kn.M(r,r,o),kn.M(t[0],r,o),kn.S(n,t[0]),kn.M(n,n,o),Tn(n,i)&&kn.M(t[0],t[0],Bn),kn.S(n,t[0]),kn.M(n,n,o),Tn(n,i)?0:1}let Rn=kn.gf([1]),Bn=kn.gf([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Tn(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return kn.pack25519(r,e),kn.pack25519(n,t),kn.crypto_verify_32(r,0,n,0)}new xn("BPFLoader1111111111111111111111111111111111");const Un=(e="publicKey")=>Ue.Ik(32,e),On=(e="string")=>{const t=Ue.n_([Ue.Jq("length"),Ue.Jq("lengthPadding"),Ue.Ik(Ue.cv(Ue.Jq(),-8),"chars")],e),r=t.decode.bind(t),n=t.encode.bind(t),i=t;return i.decode=(e,t)=>r(e,t).chars.toString(),i.encode=(e,t,r)=>{const i={chars:xe.Buffer.from(e,"utf8")};return n(i,t,r)},i.alloc=e=>Ue.Jq().span+Ue.Jq().span+xe.Buffer.from(e,"utf8").length,i};function Cn(e){let t=0,r=0;for(;;){let n=e.shift();if(t|=(127&n)<<7*r,r+=1,0==(128&n))break}return t}function Pn(e,t){let r=t;for(;;){let t=127&r;if(r>>=7,0==r){e.push(t);break}t|=128,e.push(t)}}class zn{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map((e=>new xn(e))),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach((e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex])))}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){return e<this.header.numRequiredSignatures-this.header.numReadonlySignedAccounts||e>=this.header.numRequiredSignatures&&e<this.accountKeys.length-this.header.numReadonlyUnsignedAccounts}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter(((e,t)=>!this.isProgramId(t)))}serialize(){const e=this.accountKeys.length;let t=[];Pn(t,e);const r=this.instructions.map((e=>{const{accounts:t,programIdIndex:r}=e,n=Array.from(Be().decode(e.data));let i=[];Pn(i,t.length);let o=[];return Pn(o,n.length),{programIdIndex:r,keyIndicesCount:xe.Buffer.from(i),keyIndices:t,dataLength:xe.Buffer.from(o),data:n}}));let n=[];Pn(n,r.length);let i=xe.Buffer.alloc(1232);xe.Buffer.from(n).copy(i);let o=n.length;r.forEach((e=>{const t=Ue.n_([Ue.u8("programIdIndex"),Ue.Ik(e.keyIndicesCount.length,"keyIndicesCount"),Ue.A9(Ue.u8("keyIndex"),e.keyIndices.length,"keyIndices"),Ue.Ik(e.dataLength.length,"dataLength"),Ue.A9(Ue.u8("userdatum"),e.data.length,"data")]).encode(e,i,o);o+=t})),i=i.slice(0,o);const s=Ue.n_([Ue.Ik(1,"numRequiredSignatures"),Ue.Ik(1,"numReadonlySignedAccounts"),Ue.Ik(1,"numReadonlyUnsignedAccounts"),Ue.Ik(t.length,"keyCount"),Ue.A9(Un("key"),e,"keys"),Un("recentBlockhash")]),a={numRequiredSignatures:xe.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:xe.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:xe.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:xe.Buffer.from(t),keys:this.accountKeys.map((e=>ut(e.toBytes()))),recentBlockhash:Be().decode(this.recentBlockhash)};let u=xe.Buffer.alloc(2048);const c=s.encode(a,u);return i.copy(u,c),u.slice(0,c+i.length)}static from(e){let t=[...e];const r=t.shift(),n=t.shift(),i=t.shift(),o=Cn(t);let s=[];for(let e=0;e<o;e++){const e=t.slice(0,32);t=t.slice(32),s.push(Be().encode(xe.Buffer.from(e)))}const a=t.slice(0,32);t=t.slice(32);const u=Cn(t);let c=[];for(let e=0;e<u;e++){const e=t.shift(),r=Cn(t),n=t.slice(0,r);t=t.slice(r);const i=Cn(t),o=t.slice(0,i),s=Be().encode(xe.Buffer.from(o));t=t.slice(i),c.push({programIdIndex:e,accounts:n,data:s})}const h={header:{numRequiredSignatures:r,numReadonlySignedAccounts:n,numReadonlyUnsignedAccounts:i},recentBlockhash:Be().encode(xe.Buffer.from(a)),accountKeys:s,instructions:c};return new zn(h)}}function Ln(e,t){if(!e)throw new Error(t||"Assertion failed")}const Nn=xe.Buffer.alloc(64).fill(0);class qn{constructor(e){this.keys=void 0,this.programId=void 0,this.data=xe.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map((({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r}))),programId:this.programId.toJSON(),data:[...this.data]}}}class jn{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.nonceInfo=void 0,this._message=void 0,this._json=void 0,e&&Object.assign(this,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((e=>e.toJSON())),signers:this.signatures.map((({publicKey:e})=>e.toJSON()))}}add(...e){if(0===e.length)throw new Error("No instructions");return e.forEach((e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new qn(e))})),this}compileMessage(){if(this._message){if(JSON.stringify(this.toJSON())!==JSON.stringify(this._json))throw new Error("Transaction message mutated after being populated from Message");return this._message}const{nonceInfo:e}=this;e&&this.instructions[0]!=e.nonceInstruction&&(this.recentBlockhash=e.nonce,this.instructions.unshift(e.nonceInstruction));const{recentBlockhash:t}=this;if(!t)throw new Error("Transaction recentBlockhash required");let r;if(this.instructions.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");r=this.signatures[0].publicKey}for(let e=0;e<this.instructions.length;e++)if(void 0===this.instructions[e].programId)throw new Error(`Transaction instruction index ${e} has undefined program id`);const n=[],i=[];this.instructions.forEach((e=>{e.keys.forEach((e=>{i.push({...e})}));const t=e.programId.toString();n.includes(t)||n.push(t)})),n.forEach((e=>{i.push({pubkey:new xn(e),isSigner:!1,isWritable:!1})})),i.sort((function(e,t){const r=e.pubkey.toBase58().localeCompare(t.pubkey.toBase58()),n=e.isSigner===t.isSigner?0:e.isSigner?-1:1,i=e.isWritable===t.isWritable?r:e.isWritable?-1:1;return n||i}));const o=[];i.forEach((e=>{const t=e.pubkey.toString(),r=o.findIndex((e=>e.pubkey.toString()===t));r>-1?o[r].isWritable=o[r].isWritable||e.isWritable:o.push(e)}));const s=o.findIndex((e=>e.pubkey.equals(r)));if(s>-1){const[e]=o.splice(s,1);e.isSigner=!0,e.isWritable=!0,o.unshift(e)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const e of this.signatures){const t=o.findIndex((t=>t.pubkey.equals(e.publicKey)));if(!(t>-1))throw new Error(`unknown signer: ${e.publicKey.toString()}`);o[t].isSigner||(o[t].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."))}let a=0,u=0,c=0;const h=[],f=[];o.forEach((({pubkey:e,isSigner:t,isWritable:r})=>{t?(h.push(e.toString()),a+=1,r||(u+=1)):(f.push(e.toString()),r||(c+=1))}));const d=h.concat(f),l=this.instructions.map((e=>{const{data:t,programId:r}=e;return{programIdIndex:d.indexOf(r.toString()),accounts:e.keys.map((e=>d.indexOf(e.pubkey.toString()))),data:Be().encode(t)}}));return l.forEach((e=>{Ln(e.programIdIndex>=0),e.accounts.forEach((e=>Ln(e>=0)))})),new zn({header:{numRequiredSignatures:a,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:c},accountKeys:d,recentBlockhash:t,instructions:l})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every(((e,r)=>t[r].equals(e.publicKey)))||(this.signatures=t.map((e=>({signature:null,publicKey:e})))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(0===e.length)throw new Error("No signers");const t=new Set;this.signatures=e.filter((e=>{const r=e.toString();return!t.has(r)&&(t.add(r),!0)})).map((e=>({signature:null,publicKey:e})))}sign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,r=[];for(const n of e){const e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}this.signatures=r.map((e=>({signature:null,publicKey:e.publicKey})));const n=this._compile();this._partialSign(n,...r),this._verifySignatures(n.serialize(),!0)}partialSign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,r=[];for(const n of e){const e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}const n=this._compile();this._partialSign(n,...r)}_partialSign(e,...t){const r=e.serialize();t.forEach((e=>{const t=Me().sign.detached(r,e.secretKey);this._addSignature(e.publicKey,ut(t))}))}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){Ln(64===t.length);const r=this.signatures.findIndex((t=>e.equals(t.publicKey)));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=xe.Buffer.from(t)}verifySignatures(){return this._verifySignatures(this.serializeMessage(),!0)}_verifySignatures(e,t){for(const{signature:r,publicKey:n}of this.signatures)if(null===r){if(t)return!1}else if(!Me().sign.detached.verify(e,r,n.toBuffer()))return!1;return!0}serialize(e){const{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=this.serializeMessage();if(r&&!this._verifySignatures(n,t))throw new Error("Signature verification failed");return this._serialize(n)}_serialize(e){const{signatures:t}=this,r=[];Pn(r,t.length);const n=r.length+64*t.length+e.length,i=xe.Buffer.alloc(n);return Ln(t.length<256),xe.Buffer.from(r).copy(i,0),t.forEach((({signature:e},t)=>{null!==e&&(Ln(64===e.length,"signature has invalid length"),xe.Buffer.from(e).copy(i,r.length+64*t))})),e.copy(i,r.length+64*t.length),Ln(i.length<=1232,`Transaction too large: ${i.length} > 1232`),i}get keys(){return Ln(1===this.instructions.length),this.instructions[0].keys.map((e=>e.pubkey))}get programId(){return Ln(1===this.instructions.length),this.instructions[0].programId}get data(){return Ln(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e];const r=Cn(t);let n=[];for(let e=0;e<r;e++){const e=t.slice(0,64);t=t.slice(64),n.push(Be().encode(xe.Buffer.from(e)))}return jn.populate(zn.from(t),n)}static populate(e,t=[]){const r=new jn;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach(((t,n)=>{const i={signature:t==Be().encode(Nn)?null:Be().decode(t),publicKey:e.accountKeys[n]};r.signatures.push(i)})),e.instructions.forEach((t=>{const n=t.accounts.map((t=>{const n=e.accountKeys[t];return{pubkey:n,isSigner:r.signatures.some((e=>e.publicKey.toString()===n.toString()))||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}}));r.instructions.push(new qn({keys:n,programId:e.accountKeys[t.programIdIndex],data:Be().decode(t.data)}))})),r._message=e,r._json=r.toJSON(),r}}const Dn=new xn("SysvarC1ock11111111111111111111111111111111"),Fn=(new xn("SysvarEpochSchedu1e111111111111111111111111"),new xn("Sysvar1nstructions1111111111111111111111111"),new xn("SysvarRecentB1ockHashes11111111111111111111")),$n=new xn("SysvarRent111111111111111111111111111111111"),Hn=(new xn("SysvarRewards111111111111111111111111111111"),new xn("SysvarS1otHashes111111111111111111111111111"),new xn("SysvarS1otHistory11111111111111111111111111"),new xn("SysvarStakeHistory1111111111111111111111111"));async function Wn(e,t,r,n){const i=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries},o=await e.sendTransaction(t,r,i),s=(await e.confirmTransaction(o,n&&n.commitment)).value;if(s.err)throw new Error(`Transaction ${o} failed (${JSON.stringify(s)})`);return o}function Kn(e){return new Promise((t=>setTimeout(t,e)))}function Gn(e,t){const r=e.layout.span>=0?e.layout.span:function(e,t){let r=0;return e.layout.fields.forEach((e=>{e.span>=0?r+=e.span:"function"==typeof e.alloc&&(r+=e.alloc(t[e.property]))})),r}(e,t),n=xe.Buffer.alloc(r),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,n),n}const Vn=Ue._O("lamportsPerSignature"),Jn=Ue.n_([Ue.Jq("version"),Ue.Jq("state"),Un("authorizedPubkey"),Un("nonce"),Ue.n_([Vn],"feeCalculator")]).span,Yn=Object.freeze({Create:{index:0,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports"),Ue.gM("space"),Un("programId")])},Assign:{index:1,layout:Ue.n_([Ue.Jq("instruction"),Un("programId")])},Transfer:{index:2,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports")])},CreateWithSeed:{index:3,layout:Ue.n_([Ue.Jq("instruction"),Un("base"),On("seed"),Ue.gM("lamports"),Ue.gM("space"),Un("programId")])},AdvanceNonceAccount:{index:4,layout:Ue.n_([Ue.Jq("instruction")])},WithdrawNonceAccount:{index:5,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports")])},InitializeNonceAccount:{index:6,layout:Ue.n_([Ue.Jq("instruction"),Un("authorized")])},AuthorizeNonceAccount:{index:7,layout:Ue.n_([Ue.Jq("instruction"),Un("authorized")])},Allocate:{index:8,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("space")])},AllocateWithSeed:{index:9,layout:Ue.n_([Ue.Jq("instruction"),Un("base"),On("seed"),Ue.gM("space"),Un("programId")])},AssignWithSeed:{index:10,layout:Ue.n_([Ue.Jq("instruction"),Un("base"),On("seed"),Un("programId")])},TransferWithSeed:{index:11,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports"),On("seed"),Un("programId")])}});class Zn{constructor(){}static createAccount(e){const t=Gn(Yn.Create,{lamports:e.lamports,space:e.space,programId:ut(e.programId.toBuffer())});return new qn({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}static transfer(e){let t,r;return"basePubkey"in e?(t=Gn(Yn.TransferWithSeed,{lamports:e.lamports,seed:e.seed,programId:ut(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]):(t=Gn(Yn.Transfer,{lamports:e.lamports}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]),new qn({keys:r,programId:this.programId,data:t})}static assign(e){let t,r;return"basePubkey"in e?(t=Gn(Yn.AssignWithSeed,{base:ut(e.basePubkey.toBuffer()),seed:e.seed,programId:ut(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Gn(Yn.Assign,{programId:ut(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]),new qn({keys:r,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=Gn(Yn.CreateWithSeed,{base:ut(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:ut(e.programId.toBuffer())});let r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey!=e.fromPubkey&&r.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new qn({keys:r,programId:this.programId,data:t})}static createNonceAccount(e){const t=new jn;"basePubkey"in e&&"seed"in e?t.add(Zn.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:Jn,programId:this.programId})):t.add(Zn.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:Jn,programId:this.programId}));const r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(r)),t}static nonceInitialize(e){const t=Gn(Yn.InitializeNonceAccount,{authorized:ut(e.authorizedPubkey.toBuffer())}),r={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Fn,isSigner:!1,isWritable:!1},{pubkey:$n,isSigner:!1,isWritable:!1}],programId:this.programId,data:t};return new qn(r)}static nonceAdvance(e){const t=Gn(Yn.AdvanceNonceAccount),r={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Fn,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t};return new qn(r)}static nonceWithdraw(e){const t=Gn(Yn.WithdrawNonceAccount,{lamports:e.lamports});return new qn({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Fn,isSigner:!1,isWritable:!1},{pubkey:$n,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static nonceAuthorize(e){const t=Gn(Yn.AuthorizeNonceAccount,{authorized:ut(e.newAuthorizedPubkey.toBuffer())});return new qn({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static allocate(e){let t,r;return"basePubkey"in e?(t=Gn(Yn.AllocateWithSeed,{base:ut(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:ut(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Gn(Yn.Allocate,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]),new qn({keys:r,programId:this.programId,data:t})}}Zn.programId=new xn("11111111111111111111111111111111");class Xn{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/Xn.chunkSize)+1+1)}static async load(e,t,r,n,i){{const o=await e.getMinimumBalanceForRentExemption(i.length),s=await e.getAccountInfo(r.publicKey,"confirmed");let a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==i.length&&(a=a||new jn,a.add(Zn.allocate({accountPubkey:r.publicKey,space:i.length}))),s.owner.equals(n)||(a=a||new jn,a.add(Zn.assign({accountPubkey:r.publicKey,programId:n}))),s.lamports<o&&(a=a||new jn,a.add(Zn.transfer({fromPubkey:t.publicKey,toPubkey:r.publicKey,lamports:o-s.lamports})))}else a=(new jn).add(Zn.createAccount({fromPubkey:t.publicKey,newAccountPubkey:r.publicKey,lamports:o>0?o:1,space:i.length,programId:n}));null!==a&&await Wn(e,a,[t,r],{commitment:"confirmed"})}const o=Ue.n_([Ue.Jq("instruction"),Ue.Jq("offset"),Ue.Jq("bytesLength"),Ue.Jq("bytesLengthPadding"),Ue.A9(Ue.u8("byte"),Ue.cv(Ue.Jq(),-8),"bytes")]),s=Xn.chunkSize;let a=0,u=i,c=[];for(;u.length>0;){const i=u.slice(0,s),h=xe.Buffer.alloc(s+16);o.encode({instruction:0,offset:a,bytes:i,bytesLength:0,bytesLengthPadding:0},h);const f=(new jn).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:h});if(c.push(Wn(e,f,[t,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")){const e=4;await Kn(1e3/e)}a+=s,u=u.slice(s)}await Promise.all(c);{const i=Ue.n_([Ue.Jq("instruction")]),o=xe.Buffer.alloc(i.span);i.encode({instruction:1},o);const s=(new jn).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:$n,isSigner:!1,isWritable:!1}],programId:n,data:o});await Wn(e,s,[t,r],{commitment:"confirmed"})}return!0}}Xn.chunkSize=932,new xn("BPFLoader2111111111111111111111111111111111");Object.freeze({RequestUnits:{index:0,layout:Ue.n_([Ue.u8("instruction"),Ue.Jq("units"),Ue.Jq("additionalFee")])},RequestHeapFrame:{index:1,layout:Ue.n_([Ue.u8("instruction"),Ue.Jq("bytes")])}});new xn("ComputeBudget111111111111111111111111111111");var Qn={exports:{}};!function(e,t){var r="undefined"!=typeof self?self:ct,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,r,n=l(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=p(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=h(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=h(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),f(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),f(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(e,t){var r,n,i=(t=t||{}).body;if(e instanceof v){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function _(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},b.call(v.prototype),b.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];_.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function A(e,r){return new Promise((function(n,o){var s=new v(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new _(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",u)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}A.polyfill=!0,e.fetch||(e.fetch=A,e.Headers=d,e.Request=v,e.Response=_),t.Headers=d,t.Request=v,t.Response=_,t.fetch=A,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Qn,Qn.exports),Object.prototype.toString,Object.keys,Error;const ei=nt(Ke(xn),Xe(),(e=>new xn(e))),ti=Qe([Xe(),Ge("base64")]),ri=nt(Ke(xe.Buffer),ti,(e=>xe.Buffer.from(e[0],"base64")));function ni(e){return tt([et({jsonrpc:Ge("2.0"),id:Xe(),result:e}),et({jsonrpc:Ge("2.0"),id:Xe(),error:et({code:rt(),message:Xe(),data:Ye($e("any",(()=>!0)))})})])}const ii=ni(rt());function oi(e){return nt(ni(e),ii,(t=>"error"in t?t:{...t,result:je(t.result,e)}))}function si(e){return oi(et({context:et({slot:Je()}),value:e}))}function ai(e){return et({context:et({slot:Je()}),value:e})}const ui=et({foundation:Je(),foundationTerm:Je(),initial:Je(),taper:Je(),terminal:Je()}),ci=(oi(He(Ve(et({epoch:Je(),effectiveSlot:Je(),amount:Je(),postBalance:Je()})))),et({epoch:Je(),slotIndex:Je(),slotsInEpoch:Je(),absoluteSlot:Je(),blockHeight:Ye(Je()),transactionCount:Ye(Je())})),hi=et({slotsPerEpoch:Je(),leaderScheduleSlotOffset:Je(),warmup:We(),firstNormalEpoch:Je(),firstNormalSlot:Je()}),fi=Ze(Xe(),He(Je())),di=Ve(tt([et({}),Xe()])),li=et({err:di}),pi=Ge("receivedSignature");et({"solana-core":Xe(),"feature-set":Ye(Je())}),si(et({err:Ve(tt([et({}),Xe()])),logs:Ve(He(Xe())),accounts:Ye(Ve(He(Ve(et({executable:We(),owner:Xe(),lamports:Je(),data:He(Xe()),rentEpoch:Ye(Je())}))))),unitsConsumed:Ye(Je())})),si(et({byIdentity:Ze(Xe(),He(Je())),range:et({firstSlot:Je(),lastSlot:Je()})})),oi(ui),oi(ci),oi(hi),oi(fi),oi(Je()),si(et({total:Je(),circulating:Je(),nonCirculating:Je(),nonCirculatingAccounts:He(ei)}));const yi=et({amount:Xe(),uiAmount:Ve(Je()),decimals:Je(),uiAmountString:Ye(Xe())}),gi=(si(He(et({address:ei,amount:Xe(),uiAmount:Ve(Je()),decimals:Je(),uiAmountString:Ye(Xe())}))),si(He(et({pubkey:ei,account:et({executable:We(),owner:ei,lamports:Je(),data:ri,rentEpoch:Je()})}))),et({program:Xe(),parsed:rt(),space:Je()})),bi=(si(He(et({pubkey:ei,account:et({executable:We(),owner:ei,lamports:Je(),data:gi,rentEpoch:Je()})}))),si(He(et({lamports:Je(),address:ei}))),et({executable:We(),owner:ei,lamports:Je(),data:ri,rentEpoch:Je()})),mi=(et({pubkey:ei,account:bi}),nt(tt([Ke(xe.Buffer),gi]),tt([ti,gi]),(e=>Array.isArray(e)?je(e,ri):e))),vi=et({executable:We(),owner:ei,lamports:Je(),data:mi,rentEpoch:Je()}),wi=(et({pubkey:ei,account:vi}),et({state:tt([Ge("active"),Ge("inactive"),Ge("activating"),Ge("deactivating")]),active:Je(),inactive:Je()}),oi(He(et({signature:Xe(),slot:Je(),err:di,memo:Ve(Xe()),blockTime:Ye(Ve(Je()))}))),oi(He(et({signature:Xe(),slot:Je(),err:di,memo:Ve(Xe()),blockTime:Ye(Ve(Je()))}))),et({subscription:Je(),result:ai(bi)}),et({pubkey:ei,account:bi})),_i=(et({subscription:Je(),result:ai(wi)}),et({parent:Je(),slot:Je(),root:Je()})),Ei=(et({subscription:Je(),result:_i}),tt([et({type:tt([Ge("firstShredReceived"),Ge("completed"),Ge("optimisticConfirmation"),Ge("root")]),slot:Je(),timestamp:Je()}),et({type:Ge("createdBank"),parent:Je(),slot:Je(),timestamp:Je()}),et({type:Ge("frozen"),slot:Je(),timestamp:Je(),stats:et({numTransactionEntries:Je(),numSuccessfulTransactions:Je(),numFailedTransactions:Je(),maxTransactionsPerEntry:Je()})}),et({type:Ge("dead"),slot:Je(),timestamp:Je(),err:Xe()})])),Ai=(et({subscription:Je(),result:Ei}),et({subscription:Je(),result:ai(tt([li,pi]))}),et({subscription:Je(),result:Je()}),et({pubkey:Xe(),gossip:Ve(Xe()),tpu:Ve(Xe()),rpc:Ve(Xe()),version:Ve(Xe())}),et({votePubkey:Xe(),nodePubkey:Xe(),activatedStake:Je(),epochVoteAccount:We(),epochCredits:He(Qe([Je(),Je(),Je()])),commission:Je(),lastVote:Je(),rootSlot:Ve(Je())})),Si=(oi(et({current:He(Ai),delinquent:He(Ai)})),tt([Ge("processed"),Ge("confirmed"),Ge("finalized")])),Mi=et({slot:Je(),confirmations:Ve(Je()),err:di,confirmationStatus:Ye(Si)}),xi=(si(He(Ve(Mi))),oi(Je()),et({signatures:He(Xe()),message:et({accountKeys:He(Xe()),header:et({numRequiredSignatures:Je(),numReadonlySignedAccounts:Je(),numReadonlyUnsignedAccounts:Je()}),instructions:He(et({accounts:He(Je()),data:Xe(),programIdIndex:Je()})),recentBlockhash:Xe()})})),ki=et({parsed:rt(),program:Xe(),programId:ei}),Ii=et({accounts:He(ei),data:Xe(),programId:ei}),Ri=nt(tt([Ii,ki]),tt([et({parsed:rt(),program:Xe(),programId:Xe()}),et({accounts:He(Xe()),data:Xe(),programId:Xe()})]),(e=>je(e,"accounts"in e?Ii:ki))),Bi=et({signatures:He(Xe()),message:et({accountKeys:He(et({pubkey:ei,signer:We(),writable:We()})),instructions:He(Ri),recentBlockhash:Xe()})}),Ti=et({accountIndex:Je(),mint:Xe(),owner:Ye(Xe()),uiTokenAmount:yi}),Ui=et({err:di,fee:Je(),innerInstructions:Ye(Ve(He(et({index:Je(),instructions:He(et({accounts:He(Je()),data:Xe(),programIdIndex:Je()}))})))),preBalances:He(Je()),postBalances:He(Je()),logMessages:Ye(Ve(He(Xe()))),preTokenBalances:Ye(Ve(He(Ti))),postTokenBalances:Ye(Ve(He(Ti)))}),Oi=et({err:di,fee:Je(),innerInstructions:Ye(Ve(He(et({index:Je(),instructions:He(Ri)})))),preBalances:He(Je()),postBalances:He(Je()),logMessages:Ye(Ve(He(Xe()))),preTokenBalances:Ye(Ve(He(Ti))),postTokenBalances:Ye(Ve(He(Ti)))}),Ci=(oi(Ve(et({blockhash:Xe(),previousBlockhash:Xe(),parentSlot:Je(),transactions:He(et({transaction:xi,meta:Ve(Ui)})),rewards:Ye(He(et({pubkey:Xe(),lamports:Je(),postBalance:Ve(Je()),rewardType:Ve(Xe())}))),blockTime:Ve(Je()),blockHeight:Ve(Je())}))),oi(Ve(et({blockhash:Xe(),previousBlockhash:Xe(),parentSlot:Je(),transactions:He(et({transaction:xi,meta:Ve(Ui)})),rewards:Ye(He(et({pubkey:Xe(),lamports:Je(),postBalance:Ve(Je()),rewardType:Ve(Xe())}))),blockTime:Ve(Je())}))),oi(Ve(et({blockhash:Xe(),previousBlockhash:Xe(),parentSlot:Je(),signatures:He(Xe()),blockTime:Ve(Je())}))),oi(Ve(et({slot:Je(),meta:Ui,blockTime:Ye(Ve(Je())),transaction:xi}))),oi(Ve(et({slot:Je(),transaction:Bi,meta:Ve(Oi),blockTime:Ye(Ve(Je()))}))),si(et({blockhash:Xe(),feeCalculator:et({lamportsPerSignature:Je()})})),si(et({blockhash:Xe(),lastValidBlockHeight:Je()})),oi(He(et({slot:Je(),numTransactions:Je(),numSlots:Je(),samplePeriodSecs:Je()}))),si(Ve(et({feeCalculator:et({lamportsPerSignature:Je()})}))),oi(Xe()),oi(Xe()),et({err:di,logs:He(Xe()),signature:Xe()}));et({result:ai(Ci),subscription:Je()});class Pi{constructor(e){this._keypair=void 0,this._keypair=e||Me().sign.keyPair()}static generate(){return new Pi(Me().sign.keyPair())}static fromSecretKey(e,t){const r=Me().sign.keyPair.fromSecretKey(e);if(!t||!t.skipValidation){const e=(new TextEncoder).encode("@solana/web3.js-validation-v1"),t=Me().sign.detached(e,r.secretKey);if(!Me().sign.detached.verify(e,t,r.publicKey))throw new Error("provided secretKey is invalid")}return new Pi(r)}static fromSeed(e){return new Pi(Me().sign.keyPair.fromSeed(e))}get publicKey(){return new xn(this._keypair.publicKey)}get secretKey(){return this._keypair.secretKey}}const zi=Ue.n_([Ue.u8("numSignatures"),Ue.u8("padding"),Ue.KB("signatureOffset"),Ue.KB("signatureInstructionIndex"),Ue.KB("publicKeyOffset"),Ue.KB("publicKeyInstructionIndex"),Ue.KB("messageDataOffset"),Ue.KB("messageDataSize"),Ue.KB("messageInstructionIndex")]);class Li{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:n,instructionIndex:i}=e;Ln(32===t.length,`Public Key must be 32 bytes but received ${t.length} bytes`),Ln(64===n.length,`Signature must be 64 bytes but received ${n.length} bytes`);const o=zi.span,s=o+t.length,a=s+n.length,u=xe.Buffer.alloc(a+r.length),c=null==i?65535:i;return zi.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:c,publicKeyOffset:o,publicKeyInstructionIndex:c,messageDataOffset:a,messageDataSize:r.length,messageInstructionIndex:c},u),u.fill(t,o),u.fill(n,s),u.fill(r,a),new qn({keys:[],programId:Li.programId,data:u})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:n}=e;Ln(64===t.length,`Private key must be 64 bytes but received ${t.length} bytes`);try{const e=Pi.fromSecretKey(t),i=e.publicKey.toBytes(),o=Me().sign.detached(r,e.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:o,instructionIndex:n})}catch(e){throw new Error(`Error creating instruction; ${e}`)}}}Li.programId=new xn("Ed25519SigVerify111111111111111111111111111");const Ni=new xn("StakeConfig11111111111111111111111111111111");class qi{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}qi.default=new qi(0,0,xn.default);const ji=Object.freeze({Initialize:{index:0,layout:Ue.n_([Ue.Jq("instruction"),((e="authorized")=>Ue.n_([Un("staker"),Un("withdrawer")],e))(),((e="lockup")=>Ue.n_([Ue.gM("unixTimestamp"),Ue.gM("epoch"),Un("custodian")],e))()])},Authorize:{index:1,layout:Ue.n_([Ue.Jq("instruction"),Un("newAuthorized"),Ue.Jq("stakeAuthorizationType")])},Delegate:{index:2,layout:Ue.n_([Ue.Jq("instruction")])},Split:{index:3,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports")])},Withdraw:{index:4,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports")])},Deactivate:{index:5,layout:Ue.n_([Ue.Jq("instruction")])},Merge:{index:7,layout:Ue.n_([Ue.Jq("instruction")])},AuthorizeWithSeed:{index:8,layout:Ue.n_([Ue.Jq("instruction"),Un("newAuthorized"),Ue.Jq("stakeAuthorizationType"),On("authoritySeed"),Un("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class Di{constructor(){}static initialize(e){const{stakePubkey:t,authorized:r,lockup:n}=e,i=n||qi.default,o=Gn(ji.Initialize,{authorized:{staker:ut(r.staker.toBuffer()),withdrawer:ut(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:ut(i.custodian.toBuffer())}}),s={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:$n,isSigner:!1,isWritable:!1}],programId:this.programId,data:o};return new qn(s)}static createAccountWithSeed(e){const t=new jn;t.add(Zn.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static createAccount(e){const t=new jn;t.add(Zn.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:r,votePubkey:n}=e,i=Gn(ji.Delegate);return(new jn).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:Hn,isSigner:!1,isWritable:!1},{pubkey:Ni,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(e){const{stakePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:i,custodianPubkey:o}=e,s=Gn(ji.Authorize,{newAuthorized:ut(n.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Dn,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new jn).add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:r,authoritySeed:n,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=e,u=Gn(ji.AuthorizeWithSeed,{newAuthorized:ut(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:n,authorityOwner:ut(i.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:Dn,isSigner:!1,isWritable:!1}];return a&&c.push({pubkey:a,isSigner:!1,isWritable:!1}),(new jn).add({keys:c,programId:this.programId,data:u})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,lamports:i}=e,o=Gn(ji.Split,{lamports:i});return new qn({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(e){const t=new jn;return t.add(Zn.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),t.add(this.splitInstruction(e))}static splitWithSeed(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,basePubkey:i,seed:o,lamports:s}=e,a=new jn;return a.add(Zn.allocate({accountPubkey:n,basePubkey:i,seed:o,space:this.space,programId:this.programId})),a.add(this.splitInstruction({stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,lamports:s}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:r,authorizedPubkey:n}=e,i=Gn(ji.Merge);return(new jn).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:Hn,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:r,toPubkey:n,lamports:i,custodianPubkey:o}=e,s=Gn(ji.Withdraw,{lamports:i}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:Hn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new jn).add({keys:a,programId:this.programId,data:s})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:r}=e,n=Gn(ji.Deactivate);return(new jn).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}Di.programId=new xn("Stake11111111111111111111111111111111111111"),Di.space=200;const{publicKeyCreate:Fi,ecdsaSign:$i}=ot(),Hi=Ue.n_([Ue.u8("numSignatures"),Ue.KB("signatureOffset"),Ue.u8("signatureInstructionIndex"),Ue.KB("ethAddressOffset"),Ue.u8("ethAddressInstructionIndex"),Ue.KB("messageDataOffset"),Ue.KB("messageDataSize"),Ue.u8("messageInstructionIndex"),Ue.Ik(20,"ethAddress"),Ue.Ik(64,"signature"),Ue.u8("recoveryId")]);class Wi{constructor(){}static publicKeyToEthAddress(e){Ln(64===e.length,`Public key must be 64 bytes but received ${e.length} bytes`);try{return xe.Buffer.from(at().keccak_256.update(ut(e)).digest()).slice(-20)}catch(e){throw new Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:n,recoveryId:i,instructionIndex:o}=e;return Wi.createInstructionWithEthAddress({ethAddress:Wi.publicKeyToEthAddress(t),message:r,signature:n,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:r,signature:n,recoveryId:i,instructionIndex:o=0}=e;let s;s="string"==typeof t?t.startsWith("0x")?xe.Buffer.from(t.substr(2),"hex"):xe.Buffer.from(t,"hex"):t,Ln(20===s.length,`Address must be 20 bytes but received ${s.length} bytes`);const a=12+s.length,u=a+n.length+1,c=xe.Buffer.alloc(Hi.span+r.length);return Hi.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:o,ethAddressOffset:12,ethAddressInstructionIndex:o,messageDataOffset:u,messageDataSize:r.length,messageInstructionIndex:o,signature:ut(n),ethAddress:ut(s),recoveryId:i},c),c.fill(ut(r),Hi.span),new qn({keys:[],programId:Wi.programId,data:c})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:n}=e;Ln(32===t.length,`Private key must be 32 bytes but received ${t.length} bytes`);try{const e=ut(t),i=Fi(e,!1).slice(1),o=xe.Buffer.from(at().keccak_256.update(ut(r)).digest()),{signature:s,recid:a}=$i(o,e);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:s,recoveryId:a,instructionIndex:n})}catch(e){throw new Error(`Error creating instruction; ${e}`)}}}Wi.programId=new xn("KeccakSecp256k11111111111111111111111111111"),new xn("Va1idator1nfo111111111111111111111111111111"),et({name:Xe(),website:Ye(Xe()),details:Ye(Xe()),keybaseUsername:Ye(Xe())}),new xn("Vote111111111111111111111111111111111111111"),Ue.n_([Un("nodePubkey"),Un("authorizedWithdrawer"),Ue.u8("commission"),Ue._O(),Ue.A9(Ue.n_([Ue._O("slot"),Ue.Jq("confirmationCount")]),Ue.cv(Ue.Jq(),-8),"votes"),Ue.u8("rootSlotValid"),Ue._O("rootSlot"),Ue._O(),Ue.A9(Ue.n_([Ue._O("epoch"),Un("authorizedVoter")]),Ue.cv(Ue.Jq(),-8),"authorizedVoters"),Ue.n_([Ue.A9(Ue.n_([Un("authorizedPubkey"),Ue._O("epochOfLastAuthorizedSwitch"),Ue._O("targetEpoch")]),32,"buf"),Ue._O("idx"),Ue.u8("isEmpty")],"priorVoters"),Ue._O(),Ue.A9(Ue.n_([Ue._O("epoch"),Ue._O("credits"),Ue._O("prevCredits")]),Ue.cv(Ue.Jq(),-8),"epochCredits"),Ue.n_([Ue._O("slot"),Ue._O("timestamp")],"lastTimestamp")]);const Ki=Object.freeze({InitializeAccount:{index:0,layout:Ue.n_([Ue.Jq("instruction"),((e="voteInit")=>Ue.n_([Un("nodePubkey"),Un("authorizedVoter"),Un("authorizedWithdrawer"),Ue.u8("commission")],e))()])},Authorize:{index:1,layout:Ue.n_([Ue.Jq("instruction"),Un("newAuthorized"),Ue.Jq("voteAuthorizationType")])},Withdraw:{index:3,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports")])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class Gi{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:r,voteInit:n}=e,i=Gn(Ki.InitializeAccount,{voteInit:{nodePubkey:ut(n.nodePubkey.toBuffer()),authorizedVoter:ut(n.authorizedVoter.toBuffer()),authorizedWithdrawer:ut(n.authorizedWithdrawer.toBuffer()),commission:n.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:$n,isSigner:!1,isWritable:!1},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new qn(o)}static createAccount(e){const t=new jn;return t.add(Zn.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:i}=e,o=Gn(Ki.Authorize,{newAuthorized:ut(n.toBuffer()),voteAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return(new jn).add({keys:s,programId:this.programId,data:o})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:i}=e,o=Gn(Ki.Withdraw,{lamports:n}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return(new jn).add({keys:s,programId:this.programId,data:o})}}Gi.programId=new xn("Vote111111111111111111111111111111111111111"),Gi.space=3731;var Vi=r(5973);class Ji extends oe{constructor(e){super(e),this.providerName=B.solana}request(e){return this.bridgeRequest(e)}}const Yi=e=>Vi.encode(e.serialize({requireAllSignatures:!1})),Zi=e=>jn.from(Vi.decode(e));var Xi=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class Qi extends Ji{constructor(e){super(Object.assign(Object.assign({},e),{bridge:e.bridge||he({timeout:e.timeout})})),this.isPhantom=!0,this.isSolflare=!0,this.isGlow=!0,this._publicKey=null,this._registerEvents()}get publicKey(){return this._publicKey}get isConnected(){return null!==this._publicKey}_registerEvents(){window.addEventListener("onekey_bridge_disconnect",(()=>{this._handleDisconnected()})),this.on("message_low_level",(e=>{const{method:t,params:r}=e;(function(e,t){return e===`metamask_${t}`||e===`wallet_events_${t}`})(t,"accountChanged")&&this._handleAccountChange(r)}))}_callBridge(e){return this.bridgeRequest(e)}postMessage(e){return this._callBridge(e)}connect(e){return Xi(this,void 0,void 0,(function*(){if(this.publicKey)return{publicKey:this.publicKey};const t=yield this._callBridge({method:"connect",params:e}),r=new xn(t.publicKey);return this._handleConnected(r,{emit:!0}),{publicKey:r}}))}_handleConnected(e,t={emit:!0}){this._publicKey=e,t.emit&&this.emit("connect",e)}disconnect(){return Xi(this,void 0,void 0,(function*(){yield this._callBridge({method:"disconnect",params:void 0}),this._handleDisconnected()}))}_handleDisconnected(e={emit:!0}){this._publicKey=null,e.emit&&this.emit("disconnect")}_handleAccountChange(e){const t=e.accounts[0];if(!t)return this._handleDisconnected(),this.emit("accountChanged",null);const r=new xn(t.publicKey);this._handleConnected(r,{emit:!1}),this.emit("accountChanged",r)}signAndSendTransaction(e,t){return Xi(this,void 0,void 0,(function*(){return this._handleSignAndSendTransaction({message:Yi(e),options:t})}))}_handleSignAndSendTransaction(e){return Xi(this,void 0,void 0,(function*(){return yield this._callBridge({method:"signAndSendTransaction",params:e})}))}signTransaction(e){return Xi(this,void 0,void 0,(function*(){return this._handleSignTransaction({message:Yi(e)})}))}_handleSignTransaction(e){return Xi(this,void 0,void 0,(function*(){const t=yield this._callBridge({method:"signTransaction",params:e});return Zi(t)}))}signAllTransactions(e){return Xi(this,void 0,void 0,(function*(){return this._handleSignAllTransactions({message:e.map(Yi)})}))}_handleSignAllTransactions(e){return Xi(this,void 0,void 0,(function*(){return(yield this._callBridge({method:"signAllTransactions",params:e})).map(Zi)}))}signMessage(e,t){return Xi(this,void 0,void 0,(function*(){return this._handleSignMessage({message:e,display:t})}))}_handleSignMessage(e){return Xi(this,void 0,void 0,(function*(){const{message:t,display:r}=e,n=yield this._callBridge({method:"signMessage",params:{message:"string"==typeof t?t:Vi.encode(t),display:r}});return{signature:Vi.decode(n.signature),publicKey:new xn(n.publicKey)}}))}request(...e){let t,r;if("string"==typeof e[0])t=e[0],r=e[1];else{const n=e[0];t=n.method,r=n.params}switch(t){case"connect":return this.connect(r);case"disconnect":return this.disconnect();case"signTransaction":return this._handleSignTransaction(r);case"signAllTransactions":return this._handleSignAllTransactions(r);case"signMessage":return this._handleSignMessage(r);case"signAndSendTransaction":return this._handleSignAndSendTransaction(r)}return this._callBridge({method:t,params:r})}on(e,t){return super.on(e,t)}emit(e,...t){return super.emit(e,...t)}}var eo=r(3596);const to={errors:{disconnected:()=>"StarMask: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"StarMask: Disconnected from StarMask background. Page reload required.",sendSiteMetadata:()=>"StarMask: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`StarMask: The StarMask Starcoin provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`StarMask: Connected to chain with ID "${e}".`},warnings:{enableDeprecation:"StarMask: 'starcoin.enable()' is deprecated and may be removed in the future. Please use the 'stc_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",sendDeprecation:"StarMask: 'starcoin.send(...)' is deprecated and may be removed in the future. Please use 'starcoin.sendAsync(...)' or 'starcoin.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",events:{close:"StarMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"StarMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"StarMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"StarMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"},experimentalMethods:"StarMask: 'starcoin._starmask' exposes non-standard, experimental methods. They may be removed or changed without warning."}},ro=()=>{},no=["stc_subscription"];var io=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class oo extends oe{constructor(e){var t;super(e),this.providerName=B.starcoin,this.isStarMask=!0,this._log=null!==(t=e.logger)&&void 0!==t?t:window.console,this._state=Object.assign({},oo._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this),this._handleStreamDisconnect.bind(this,"OneKey"),this.on("connect",(()=>{this._state.isConnected=!0})),this._handleStreamDisconnect.bind(this,"OneKey RpcProvider"),this._initializeState(),this.on("message_low_level",(e=>{const{method:t,params:r}=e;"starmask_accountsChanged"===t?this._handleAccountsChanged(r):"starmask_unlockStateChanged"===t?this._handleUnlockStateChanged(r):"starmask_chainChanged"===t?this._handleChainChanged(r):no.includes(t)?this.emit("message",{type:t,data:r}):"STARMASK_STREAM_FAILURE"===t&&new Error(to.errors.permanentlyDisconnected())}))}isConnected(){return this._state.isConnected}request(e){return io(this,void 0,void 0,(function*(){if(I.ethereum("request",e),!e||"object"!=typeof e||Array.isArray(e))throw eo.Sy.rpc.invalidRequest({message:to.errors.invalidRequestArgs(),data:e});const{method:t,params:r,id:n}=e;if(!t||"string"!=typeof t||0===t.length)throw eo.Sy.rpc.invalidRequest({message:to.errors.invalidRequestMethod(),data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw eo.Sy.rpc.invalidRequest({message:to.errors.invalidRequestParams(),data:e});const i=yield this._rpcRequest({method:t,params:r,id:n});return I.ethereum("request->response","\n",e,"\n ---\x3e ",i),i}))}_initializeState(){return io(this,void 0,void 0,(function*(){try{const e=yield this.request({method:"starmask_getProviderState"}),{accounts:t,chainId:r,isUnlocked:n,networkVersion:i}=e;this.emit("connect",{chainId:r}),this._handleChainChanged({chainId:r,networkVersion:i}),this._handleUnlockStateChanged({accounts:t,isUnlocked:n}),this._handleAccountsChanged(t)}catch(e){this._log.error("StarMask: Failed to get initial state. Please report this bug.",e)}finally{this._state.initialized=!0,this.emit("_initialized")}}))}_rpcRequest(e,t){return io(this,void 0,void 0,(function*(){if(!Array.isArray(e)){e.jsonrpc||(e.jsonrpc="2.0");const r=yield this.bridgeRequest(e,t);return"stc_accounts"!==e.method&&"stc_requestAccounts"!==e.method||this._handleAccountsChanged(r||[],"stc_accounts"===e.method),r}return this.bridgeRequest(e,t)}))}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),this._log.debug(to.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let r;this._state.isConnected=!1,e?(r=new eo.Cg(1013,t||to.errors.disconnected()),this._log.debug(r)):(r=new eo.Cg(1011,t||to.errors.permanentlyDisconnected()),this._log.error(r),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r)}}_handleStreamDisconnect(e,t){!function(e,t,r,n){let i=`StarMask: Lost connection to "${t}".`;(null==r?void 0:r.stack)&&(i+=`\n${r.stack}`),e.warn(i),n&&n.listenerCount("error")>0&&n.emit("error",i)}(this._log,e,t,this),this._handleDisconnect(!1,t?t.message:void 0)}_handleChainChanged({chainId:e,networkVersion:t}={}){e&&"string"==typeof e&&e.startsWith("0x")&&t&&"string"==typeof t?"loading"===t?this._handleDisconnect(!0):(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId))):this._log.error("StarMask: Received invalid network parameters. Please report this bug.",{chainId:e,networkVersion:t})}_handleAccountsChanged(e,t=!1){let r=e;Array.isArray(e)||(this._log.error("StarMask: Received invalid accounts parameter. Please report this bug.",e),r=[]);for(const t of e)if("string"!=typeof t){this._log.error("StarMask: Received non-string account. Please report this bug.",e),r=[];break}pe(this._state.accounts,r)||(t&&null!==this._state.accounts&&this._log.error("StarMask: 'stc_accounts' unexpectedly updated accounts. Please report this bug.",r),this._state.accounts=r,this.selectedAddress!==r[0]&&(this.selectedAddress=r[0]||null),this._state.initialized&&this.emit("accountsChanged",r))}_handleUnlockStateChanged({accounts:e,isUnlocked:t}={}){"boolean"==typeof t?t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e||[])):this._log.error("StarMask: Received invalid isUnlocked parameter. Please report this bug.")}}oo._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1};var so=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class ao extends oo{constructor(e){super(e),this._sentWarnings={enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},this.networkVersion=null,this.isStarMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._starmask=this._getExperimentalApi(),this.bridge.on("notification",(e=>{const{method:t}=e;if(no.includes(t)){this.emit("data",e);const t=e.params;this.emit("notification",t.result)}}))}sendAsync(e,t){this._rpcRequest(e,t)}addListener(e,t){return this._warnOfDeprecation(e),super.addListener(e,t)}on(e,t){return this._warnOfDeprecation(e),super.on(e,t)}once(e,t){return this._warnOfDeprecation(e),super.once(e,t)}prependListener(e,t){return this._warnOfDeprecation(e),super.prependListener(e,t)}prependOnceListener(e,t){return this._warnOfDeprecation(e),super.prependOnceListener(e,t)}_handleDisconnect(e,t){super._handleDisconnect(e,t),this.networkVersion&&!e&&(this.networkVersion=null)}_warnOfDeprecation(e){var t;!1===(null===(t=this._sentWarnings)||void 0===t?void 0:t.events[e])&&(this._log.warn(to.warnings.events[e]),this._sentWarnings.events[e]=!0)}enable(){return so(this,void 0,void 0,(function*(){return this._sentWarnings.enable||(this._log.warn(to.warnings.enableDeprecation),this._sentWarnings.enable=!0),yield this._rpcRequest({method:"stc_requestAccounts",params:[]})}))}_rpcResult(e,t){var r,n;return{id:null!==(r=null==t?void 0:t.id)&&void 0!==r?r:void 0,jsonrpc:null!==(n=null==t?void 0:t.jsonrpc)&&void 0!==n?n:"2.0",result:e}}send(e,t){return this._sentWarnings.send||(this._log.warn(to.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof e||t&&!Array.isArray(t)?e&&"object"==typeof e&&"function"==typeof t?this._rpcRequest(e,t):this._sendSync(e):this._rpcRequest({method:e,params:t}).then((e=>this._rpcResult(e)))}_sendSync(e){let t;switch(e.method){case"stc_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"stc_coinbase":t=this.selectedAddress||null;break;case"stc_uninstallFilter":this._rpcRequest(e,ro),t=!0;break;case"net_version":t=this.networkVersion||null;break;default:throw new Error(to.errors.unsupportedSync(e.method))}return this._rpcResult(t,e)}_getExperimentalApi(){return new Proxy({isUnlocked:()=>so(this,void 0,void 0,(function*(){return this._state.initialized||(yield new Promise((e=>{this.on("_initialized",(()=>e()))}))),this._state.isUnlocked})),requestBatch:e=>so(this,void 0,void 0,(function*(){if(!Array.isArray(e))throw D({message:"Batch requests must be made with an array of request objects.",data:e});return this._rpcRequest(e)}))},{get:(e,t,...r)=>(this._sentWarnings.experimentalMethods||(this._log.warn(to.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(e,t,...r))})}_handleChainChanged({chainId:e,networkVersion:t}={}){super._handleChainChanged({chainId:e,networkVersion:t}),t&&"loading"!==t&&t!==this.networkVersion&&(this.networkVersion=t,this._state.initialized&&this.emit("networkChanged",this.networkVersion))}}class uo extends ao{}class co extends oe{constructor(e){super(e),this.providerName=B.aptos}request(e){return this.bridgeRequest(e)}}var ho=r(8764).Buffer,fo=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const lo="accountChanged",po="networkChange";function yo({method:e,name:t}){return e===`wallet_events_${t}`}class go extends co{constructor(e){super(Object.assign(Object.assign({},e),{bridge:e.bridge||he({timeout:e.timeout})})),this._account=null,this._registerEvents()}get publicKey(){var e,t;return null!==(t=null===(e=this._account)||void 0===e?void 0:e.publicKey)&&void 0!==t?t:null}_registerEvents(){window.addEventListener("onekey_bridge_disconnect",(()=>{this._handleDisconnected()})),this.on("message_low_level",(e=>{const{method:t,params:r}=e;yo({method:t,name:lo})&&this._handleAccountChange(r),yo({method:t,name:po})&&this._handleNetworkChange(r)}))}_callBridge(e){return this.bridgeRequest(e)}_handleConnected(e,t={emit:!0}){var r;this._account=e,t.emit&&this.emit("connect",null!==(r=null==e?void 0:e.address)&&void 0!==r?r:null)}_handleDisconnected(e={emit:!0}){this._account=null,e.emit&&this.emit("disconnect")}_handleAccountChange(e){var t;const r=e;if(!r)return this._handleDisconnected(),this.emit("accountChanged",null);this._handleConnected(r,{emit:!1}),this.emit("accountChanged",null!==(t=null==r?void 0:r.address)&&void 0!==t?t:null)}_handleNetworkChange(e){const t=e;this.emit("networkChange",null!=t?t:null)}connect(){return fo(this,void 0,void 0,(function*(){if(this._account)return Promise.resolve(this._account);const e=yield this._callBridge({method:"connect",params:void 0});if(!e)throw F();return this._handleConnected(e,{emit:!0}),e}))}isConnected(){return null!==this._account}account(){return fo(this,void 0,void 0,(function*(){const e=yield this._callBridge({method:"account",params:void 0});if(!e)throw F();return Promise.resolve(e)}))}signAndSubmitTransaction(e){return fo(this,void 0,void 0,(function*(){const t=yield this._callBridge({method:"signAndSubmitTransaction",params:e});if(!t)throw F();return JSON.parse(t)}))}signTransaction(e){return fo(this,void 0,void 0,(function*(){const t=yield this._callBridge({method:"signTransaction",params:e});if(!t)throw F();return new Uint8Array(ho.from(t,"hex"))}))}signMessage(e){return this._callBridge({method:"signMessage",params:e})}network(){return this._callBridge({method:"network",params:void 0})}getNetworkURL(){return this._callBridge({method:"getNetworkURL",params:void 0})}disconnect(){return fo(this,void 0,void 0,(function*(){yield this._callBridge({method:"disconnect",params:void 0}),this._handleDisconnected()}))}onNetworkChange(e){return super.on(po,e)}onAccountChange(e){return super.on(lo,e)}on(e,t){return super.on(e,t)}emit(e,...t){return super.emit(e,...t)}}var bo=r(6254),mo=r(5857),vo=r(7184);"object"==typeof self&&"crypto"in self&&self.crypto;const wo=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const _o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Eo(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=_o[e[r]];return t}function Ao(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function So(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}class Mo{clone(){return this._cloneInto()}}function xo(e){const t=t=>e().update(So(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function ko(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Io(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}const Ro={number:ko,bool:function(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:Io,hash:function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");ko(e.outputLen),ko(e.blockLen)},exists:function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},output:function(e,t){Io(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}},Bo=Ro;class To extends Mo{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Bo.hash(e);const r=So(t);if(this.iHash=e.create(),!(this.iHash instanceof Mo))throw new TypeError("Expected instance of class which extends utils.Hash");const n=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const i=new Uint8Array(n);i.set(r.length>this.iHash.blockLen?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return Bo.exists(this),this.iHash.update(e),this}digestInto(e){Bo.exists(this),Bo.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Uo=(e,t,r)=>new To(e,t).update(r).digest();Uo.create=(e,t)=>new To(e,t);class Oo extends Mo{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=wo(this.buffer)}update(e){Bo.exists(this);const{view:t,buffer:r,blockLen:n}=this,i=(e=So(e)).length;for(let o=0;o<i;){const s=Math.min(n-this.pos,i-o);if(s!==n)r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=wo(e);for(;n<=i-o;o+=n)this.process(t,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Bo.exists(this),Bo.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:i}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),u=n?4:0,c=n?0:4;e.setUint32(t+u,s,n),e.setUint32(t+c,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=wo(e);this.get().forEach(((e,t)=>s.setUint32(4*t,e,i)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}const Co=BigInt(2**32-1),Po=BigInt(32);function zo(e,t=!1){return t?{h:Number(e&Co),l:Number(e>>Po&Co)}:{h:0|Number(e>>Po&Co),l:0|Number(e&Co)}}const Lo={fromBig:zo,split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=zo(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]},toBig:(e,t)=>BigInt(e>>>0)<<Po|BigInt(t>>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:function(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},No=Lo,[qo,jo]=No.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))),Do=new Uint32Array(80),Fo=new Uint32Array(80);class $o extends Oo{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:u,El:c,Fh:h,Fl:f,Gh:d,Gl:l,Hh:p,Hl:y}=this;return[e,t,r,n,i,o,s,a,u,c,h,f,d,l,p,y]}set(e,t,r,n,i,o,s,a,u,c,h,f,d,l,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|u,this.El=0|c,this.Fh=0|h,this.Fl=0|f,this.Gh=0|d,this.Gl=0|l,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)Do[r]=e.getUint32(t),Fo[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|Do[e-15],r=0|Fo[e-15],n=No.rotrSH(t,r,1)^No.rotrSH(t,r,8)^No.shrSH(t,r,7),i=No.rotrSL(t,r,1)^No.rotrSL(t,r,8)^No.shrSL(t,r,7),o=0|Do[e-2],s=0|Fo[e-2],a=No.rotrSH(o,s,19)^No.rotrBH(o,s,61)^No.shrSH(o,s,6),u=No.rotrSL(o,s,19)^No.rotrBL(o,s,61)^No.shrSL(o,s,6),c=No.add4L(i,u,Fo[e-7],Fo[e-16]),h=No.add4H(c,n,a,Do[e-7],Do[e-16]);Do[e]=0|h,Fo[e]=0|c}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:u,Dl:c,Eh:h,El:f,Fh:d,Fl:l,Gh:p,Gl:y,Hh:g,Hl:b}=this;for(let e=0;e<80;e++){const t=No.rotrSH(h,f,14)^No.rotrSH(h,f,18)^No.rotrBH(h,f,41),m=No.rotrSL(h,f,14)^No.rotrSL(h,f,18)^No.rotrBL(h,f,41),v=h&d^~h&p,w=f&l^~f&y,_=No.add5L(b,m,w,jo[e],Fo[e]),E=No.add5H(_,g,t,v,qo[e],Do[e]),A=0|_,S=No.rotrSH(r,n,28)^No.rotrBH(r,n,34)^No.rotrBH(r,n,39),M=No.rotrSL(r,n,28)^No.rotrBL(r,n,34)^No.rotrBL(r,n,39),x=r&i^r&s^i&s,k=n&o^n&a^o&a;g=0|p,b=0|y,p=0|d,y=0|l,d=0|h,l=0|f,({h,l:f}=No.add(0|u,0|c,0|E,0|A)),u=0|s,c=0|a,s=0|i,a=0|o,i=0|r,o=0|n;const I=No.add3L(A,M,k);r=No.add3H(I,E,S,x),n=0|I}({h:r,l:n}=No.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=No.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=No.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:u,l:c}=No.add(0|this.Dh,0|this.Dl,0|u,0|c)),({h,l:f}=No.add(0|this.Eh,0|this.El,0|h,0|f)),({h:d,l}=No.add(0|this.Fh,0|this.Fl,0|d,0|l)),({h:p,l:y}=No.add(0|this.Gh,0|this.Gl,0|p,0|y)),({h:g,l:b}=No.add(0|this.Hh,0|this.Hl,0|g,0|b)),this.set(r,n,i,o,s,a,u,c,h,f,d,l,p,y,g,b)}roundClean(){Do.fill(0),Fo.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Ho extends $o{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class Wo extends $o{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const Ko=xo((()=>new $o));xo((()=>new Ho)),xo((()=>new Wo));var Go=r(7788),Vo=r(9881),Jo=Object.defineProperty,Yo=Object.getOwnPropertyDescriptor,Zo=(e,t)=>{for(var r in t)Jo(e,r,{get:t[r],enumerable:!0})},Xo=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Yo(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Jo(t,r,o),o},Qo=/^m(\/[0-9]+')+$/,es=e=>e.replace("'",""),ts=class{static fromBuffer(e){return ts.fromUint8Array(e)}static fromUint8Array(e){return new ts(Eo(e))}static ensure(e){return"string"==typeof e?new ts(e):e}constructor(e){e.startsWith("0x")?this.hexString=e:this.hexString=`0x${e}`}hex(){return this.hexString}noPrefix(){return this.hexString.slice(2)}toString(){return this.hex()}toShortString(){return`0x${this.hexString.replace(/^0x0*/,"")}`}toUint8Array(){return Uint8Array.from(Ao(this.noPrefix()))}};async function rs(e){return new Promise((t=>{setTimeout(t,e)}))}function ns(e){let t,r,n;return"object"==typeof e?(t=e.hashFunction,r=e.ttlMs,n=e.tags):t=e,(e,i,o)=>{if(null!=o.value)o.value=os(o.value,t,r,n);else{if(null==o.get)throw new Error("Only put a Memoize() decorator on a method or get accessor.");o.get=os(o.get,t,r,n)}}}var is=new Map;function os(e,t,r=0,n){const i=Symbol("__memoized_map__");return function(...o){let s;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});const a=this[i];if(Array.isArray(n))for(const e of n)is.has(e)?is.get(e).push(a):is.set(e,[a]);if(t||o.length>0||r>0){let n;n=!0===t?o.map((e=>e.toString())).join("!"):t?t.apply(this,o):o[0];const i=`${n}__timestamp`;let u=!1;if(r>0)if(a.has(i)){const e=a.get(i);u=Date.now()-e>r}else u=!0;a.has(n)&&!u?s=a.get(n):(s=e.apply(this,o),a.set(n,s),r>0&&a.set(i,Date.now()))}else{const t=this;a.has(t)?s=a.get(t):(s=e.apply(this,o),a.set(t,s))}return s}}var{sha3_256:ss}=mo,as=class{static fromAptosAccountObject(e){return new as(ts.ensure(e.privateKeyHex).toUint8Array(),e.address)}static fromDerivePath(e,t){if(!as.isValidPath(e))throw new Error("Invalid derivation path");const r=t.trim().split(/\s+/).map((e=>e.toLowerCase())).join(" "),{key:n}=((e,t,r=2147483648)=>{if(!(e=>!!Qo.test(e)&&!e.split("/").slice(1).map(es).some(Number.isNaN))(e))throw new Error("Invalid derivation path");const{key:n,chainCode:i}=(e=>{const t=Uo.create(Ko,"ed25519 seed").update(Ao(e)).digest();return{key:t.slice(0,32),chainCode:t.slice(32)}})(t);return e.split("/").slice(1).map(es).map((e=>parseInt(e,10))).reduce(((e,t)=>(({key:e,chainCode:t},r)=>{const n=new ArrayBuffer(4);new DataView(n).setUint32(0,r);const i=new Uint8Array(n),o=new Uint8Array([0]),s=new Uint8Array([...o,...e,...i]),a=Uo.create(Ko,t).update(s).digest();return{key:a.slice(0,32),chainCode:a.slice(32)}})(e,t+r)),{key:n,chainCode:i})})(e,Eo(vo.Z1(r)));return new as(n)}constructor(e,t){this.signingKey=e?bo.sign.keyPair.fromSeed(e.slice(0,32)):bo.sign.keyPair(),this.accountAddress=ts.ensure(t||this.authKey().hex())}address(){return this.accountAddress}authKey(){const e=ss.create();return e.update(this.signingKey.publicKey),e.update("\0"),new ts(e.hex())}pubKey(){return ts.fromUint8Array(this.signingKey.publicKey)}signBuffer(e){const t=bo.sign(e,this.signingKey.secretKey);return ts.fromUint8Array(t.slice(0,64))}signHexString(e){const t=ts.ensure(e).toUint8Array();return this.signBuffer(t)}toPrivateKeyObject(){return{address:this.address().hex(),publicKeyHex:this.pubKey().hex(),privateKeyHex:ts.fromUint8Array(this.signingKey.secretKey.slice(0,32)).hex()}}},us=as;us.isValidPath=e=>!!/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'+$/.test(e),Xo([ns()],us.prototype,"authKey",1),Zo({},{$AccountData:()=>Ts,$AccountSignature:()=>Us,$AccountSignature_Ed25519Signature:()=>Os,$AccountSignature_MultiEd25519Signature:()=>Cs,$Address:()=>Ps,$AptosError:()=>zs,$AptosErrorCode:()=>Ls,$Block:()=>Ns,$BlockMetadataTransaction:()=>qs,$DecodedTableData:()=>js,$DeleteModule:()=>Fs,$DeleteResource:()=>$s,$DeleteTableItem:()=>Hs,$DeletedTableData:()=>Ds,$DirectWriteSet:()=>Ws,$Ed25519Signature:()=>Ks,$EncodeSubmissionRequest:()=>Gs,$EntryFunctionId:()=>Vs,$EntryFunctionPayload:()=>Js,$Event:()=>Ys,$EventGuid:()=>Zs,$EventKey:()=>Xs,$GasEstimation:()=>Qs,$GenesisPayload:()=>ea,$GenesisPayload_WriteSetPayload:()=>ta,$GenesisTransaction:()=>ra,$HashValue:()=>na,$HealthCheckSuccess:()=>ia,$HexEncodedBytes:()=>oa,$IdentifierWrapper:()=>sa,$IndexResponse:()=>aa,$ModuleBundlePayload:()=>ua,$MoveAbility:()=>ca,$MoveFunction:()=>ha,$MoveFunctionGenericTypeParam:()=>fa,$MoveFunctionVisibility:()=>da,$MoveModule:()=>la,$MoveModuleBytecode:()=>pa,$MoveModuleId:()=>ya,$MoveResource:()=>ga,$MoveScriptBytecode:()=>ba,$MoveStruct:()=>ma,$MoveStructField:()=>va,$MoveStructGenericTypeParam:()=>wa,$MoveStructTag:()=>_a,$MoveStructValue:()=>Ea,$MoveType:()=>Aa,$MoveValue:()=>Sa,$MultiAgentSignature:()=>Ma,$MultiEd25519Signature:()=>xa,$PendingTransaction:()=>ka,$RoleType:()=>Ia,$ScriptPayload:()=>Ra,$ScriptWriteSet:()=>Ba,$StateCheckpointTransaction:()=>Ta,$SubmitTransactionRequest:()=>Ua,$TableItemRequest:()=>Oa,$Transaction:()=>Ca,$TransactionPayload:()=>ja,$TransactionPayload_EntryFunctionPayload:()=>Da,$TransactionPayload_ModuleBundlePayload:()=>Fa,$TransactionPayload_ScriptPayload:()=>$a,$TransactionSignature:()=>Ka,$TransactionSignature_Ed25519Signature:()=>Ga,$TransactionSignature_MultiAgentSignature:()=>Va,$TransactionSignature_MultiEd25519Signature:()=>Ja,$Transaction_BlockMetadataTransaction:()=>Pa,$Transaction_GenesisTransaction:()=>za,$Transaction_PendingTransaction:()=>La,$Transaction_StateCheckpointTransaction:()=>Na,$Transaction_UserTransaction:()=>qa,$TransactionsBatchSingleSubmissionFailure:()=>Ha,$TransactionsBatchSubmissionResult:()=>Wa,$U128:()=>Ya,$U64:()=>Za,$UserTransaction:()=>Xa,$VersionedEvent:()=>Qa,$WriteModule:()=>eu,$WriteResource:()=>tu,$WriteSet:()=>ru,$WriteSetChange:()=>ou,$WriteSetChange_DeleteModule:()=>su,$WriteSetChange_DeleteResource:()=>au,$WriteSetChange_DeleteTableItem:()=>uu,$WriteSetChange_WriteModule:()=>cu,$WriteSetChange_WriteResource:()=>hu,$WriteSetChange_WriteTableItem:()=>fu,$WriteSetPayload:()=>du,$WriteSet_DirectWriteSet:()=>nu,$WriteSet_ScriptWriteSet:()=>iu,$WriteTableItem:()=>lu,AccountsService:()=>ws,ApiError:()=>hs,AptosErrorCode:()=>Is,AptosGeneratedClient:()=>xs,BaseHttpRequest:()=>cs,BlocksService:()=>_s,CancelError:()=>fs,CancelablePromise:()=>ds,EventsService:()=>Es,GeneralService:()=>As,MoveFunctionVisibility:()=>Rs,OpenAPI:()=>ks,RoleType:()=>Bs,TablesService:()=>Ss,TransactionsService:()=>Ms});var cs=class{constructor(e){this.config=e}},hs=class extends Error{constructor(e,t,r){super(r),this.name="ApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.body=t.body,this.request=e}},fs=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},ds=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this._cancelHandlers=[],this._promise=new Promise(((t,r)=>{this._resolve=t,this._reject=r;const n=e=>{this._isResolved||this._isRejected||this._isCancelled||this._cancelHandlers.push(e)};return Object.defineProperty(n,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(n,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(n,"isCancelled",{get:()=>this._isCancelled}),e((e=>{var t;this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,null==(t=this._resolve)||t.call(this,e))}),(e=>{var t;this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,null==(t=this._reject)||t.call(this,e))}),n)}))}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(){var e;if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this._cancelHandlers.length)try{for(const e of this._cancelHandlers)e()}catch(e){return void console.warn("Cancellation threw an error",e)}this._cancelHandlers.length=0,null==(e=this._reject)||e.call(this,new fs("Request aborted"))}}get isCancelled(){return this._isCancelled}};Symbol.toStringTag;var ls=e=>null!=e,ps=e=>"string"==typeof e,ys=e=>ps(e)&&""!==e,gs=e=>"object"==typeof e&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.arrayBuffer&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),bs=async(e,t)=>"function"==typeof t?t(e):t,ms=(e,t)=>new ds((async(r,n,i)=>{try{const n=((e,t)=>{const r=e.ENCODE_PATH||encodeURI,n=t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,((e,n)=>{var i;return(null==(i=t.path)?void 0:i.hasOwnProperty(n))?r(String(t.path[n])):e})),i=`${e.BASE}${n}`;return t.query?`${i}${(e=>{const t=[],r=(e,n)=>{ls(n)&&(Array.isArray(n)?n.forEach((t=>{r(e,t)})):"object"==typeof n?Object.entries(n).forEach((([t,n])=>{r(`${e}[${t}]`,n)})):((e,r)=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)})(e,n))};return Object.entries(e).forEach((([e,t])=>{r(e,t)})),t.length>0?`?${t.join("&")}`:""})(t.query)}`:i})(e,t),s=(e=>{if(e.formData){const t=new Vo,r=(e,r)=>{ps(r)||gs(r)?t.append(e,r):t.append(e,JSON.stringify(r))};return Object.entries(e.formData).filter((([e,t])=>ls(t))).forEach((([e,t])=>{Array.isArray(t)?t.forEach((t=>r(e,t))):r(e,t)})),t}})(t),a=(e=>{if(e.body)return e.body})(t),u=await(async(e,t,r)=>{const n=await bs(t,e.TOKEN),i=await bs(t,e.USERNAME),o=await bs(t,e.PASSWORD),s=await bs(t,e.HEADERS),a="function"==typeof(null==r?void 0:r.getHeaders)&&(null==r?void 0:r.getHeaders())||{},u=Object.entries({Accept:"application/json",...s,...t.headers,...a}).filter((([e,t])=>ls(t))).reduce(((e,[t,r])=>({...e,[t]:String(r)})),{});if(ys(n)&&(u.Authorization=`Bearer ${n}`),ys(i)&&ys(o)){const e=btoa(`${i}:${o}`);u.Authorization=`Basic ${e}`}return t.body&&(t.mediaType?u["Content-Type"]=t.mediaType:gs(t.body)?u["Content-Type"]=t.body.type||"application/octet-stream":ps(t.body)?u["Content-Type"]="text/plain":t.body instanceof Vo||(u["Content-Type"]="application/json")),u})(e,t,s);if(!i.isCancelled){const c=await(async(e,t,r,n,i,o,s)=>{const a=Go.CancelToken.source(),u={url:r,headers:o,data:n??i,method:t.method,withCredentials:e.WITH_CREDENTIALS,cancelToken:a.token};s((()=>a.cancel("The user aborted a request.")));try{return await Go.request(u)}catch(e){const t=e;if(t.response)return t.response;throw e}})(e,t,n,a,s,u,i),h=(e=>{if(204!==e.status)return e.data})(c),f=((e,t)=>{if(t){const r=e.headers[t];if(ps(r))return r}})(c,t.responseHeader),d={url:n,ok:(o=c.status,o>=200&&o<300),status:c.status,statusText:c.statusText,body:f??h};((e,t)=>{const r={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...e.errors}[t.status];if(r)throw new hs(e,t,r);if(!t.ok)throw new hs(e,t,"Generic Error")})(t,d),r(d.body)}}catch(e){n(e)}var o})),vs=class extends cs{constructor(e){super(e)}request(e){return ms(this.config,e)}},ws=class{constructor(e){this.httpRequest=e}getAccount(e,t){return this.httpRequest.request({method:"GET",url:"/accounts/{address}",path:{address:e},query:{ledger_version:t}})}getAccountResources(e,t){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/resources",path:{address:e},query:{ledger_version:t}})}getAccountModules(e,t){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/modules",path:{address:e},query:{ledger_version:t}})}getAccountResource(e,t,r){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/resource/{resource_type}",path:{address:e,resource_type:t},query:{ledger_version:r}})}getAccountModule(e,t,r){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/module/{module_name}",path:{address:e,module_name:t},query:{ledger_version:r}})}},_s=class{constructor(e){this.httpRequest=e}getBlockByHeight(e,t){return this.httpRequest.request({method:"GET",url:"/blocks/by_height/{block_height}",path:{block_height:e},query:{with_transactions:t}})}getBlockByVersion(e,t){return this.httpRequest.request({method:"GET",url:"/blocks/by_version/{version}",path:{version:e},query:{with_transactions:t}})}},Es=class{constructor(e){this.httpRequest=e}getEventsByEventKey(e,t,r){return this.httpRequest.request({method:"GET",url:"/events/{event_key}",path:{event_key:e},query:{start:t,limit:r}})}getEventsByCreationNumber(e,t,r,n){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/events/{creation_number}",path:{address:e,creation_number:t},query:{start:r,limit:n}})}getEventsByEventHandle(e,t,r,n,i){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/events/{event_handle}/{field_name}",path:{address:e,event_handle:t,field_name:r},query:{start:n,limit:i}})}},As=class{constructor(e){this.httpRequest=e}spec(){return this.httpRequest.request({method:"GET",url:"/spec"})}healthy(e){return this.httpRequest.request({method:"GET",url:"/-/healthy",query:{duration_secs:e}})}getLedgerInfo(){return this.httpRequest.request({method:"GET",url:"/"})}},Ss=class{constructor(e){this.httpRequest=e}getTableItem(e,t,r){return this.httpRequest.request({method:"POST",url:"/tables/{table_handle}/item",path:{table_handle:e},query:{ledger_version:r},body:t,mediaType:"application/json"})}},Ms=class{constructor(e){this.httpRequest=e}getTransactions(e,t){return this.httpRequest.request({method:"GET",url:"/transactions",query:{start:e,limit:t}})}submitTransaction(e){return this.httpRequest.request({method:"POST",url:"/transactions",body:e,mediaType:"application/json"})}getTransactionByHash(e){return this.httpRequest.request({method:"GET",url:"/transactions/by_hash/{txn_hash}",path:{txn_hash:e}})}getTransactionByVersion(e){return this.httpRequest.request({method:"GET",url:"/transactions/by_version/{txn_version}",path:{txn_version:e}})}getAccountTransactions(e,t,r){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/transactions",path:{address:e},query:{start:t,limit:r}})}submitBatchTransactions(e){return this.httpRequest.request({method:"POST",url:"/transactions/batch",body:e,mediaType:"application/json"})}simulateTransaction(e){return this.httpRequest.request({method:"POST",url:"/transactions/simulate",body:e,mediaType:"application/json"})}encodeSubmission(e){return this.httpRequest.request({method:"POST",url:"/transactions/encode_submission",body:e,mediaType:"application/json"})}estimateGasPrice(){return this.httpRequest.request({method:"GET",url:"/estimate_gas_price"})}},xs=class{constructor(e,t=vs){this.request=new t({BASE:(null==e?void 0:e.BASE)??"/v1",VERSION:(null==e?void 0:e.VERSION)??"1.1.0",WITH_CREDENTIALS:(null==e?void 0:e.WITH_CREDENTIALS)??!1,CREDENTIALS:(null==e?void 0:e.CREDENTIALS)??"include",TOKEN:null==e?void 0:e.TOKEN,USERNAME:null==e?void 0:e.USERNAME,PASSWORD:null==e?void 0:e.PASSWORD,HEADERS:null==e?void 0:e.HEADERS,ENCODE_PATH:null==e?void 0:e.ENCODE_PATH}),this.accounts=new ws(this.request),this.blocks=new _s(this.request),this.events=new Es(this.request),this.general=new As(this.request),this.tables=new Ss(this.request),this.transactions=new Ms(this.request)}},ks={BASE:"/v1",VERSION:"1.1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0},Is=(e=>(e.ACCOUNT_NOT_FOUND="account_not_found",e.RESOURCE_NOT_FOUND="resource_not_found",e.MODULE_NOT_FOUND="module_not_found",e.STRUCT_FIELD_NOT_FOUND="struct_field_not_found",e.VERSION_NOT_FOUND="version_not_found",e.TRANSACTION_NOT_FOUND="transaction_not_found",e.TABLE_ITEM_NOT_FOUND="table_item_not_found",e.BLOCK_NOT_FOUND="block_not_found",e.VERSION_PRUNED="version_pruned",e.BLOCK_PRUNED="block_pruned",e.INVALID_INPUT="invalid_input",e.INVALID_TRANSACTION_UPDATE="invalid_transaction_update",e.SEQUENCE_NUMBER_TOO_OLD="sequence_number_too_old",e.VM_ERROR="vm_error",e.HEALTH_CHECK_FAILED="health_check_failed",e.MEMPOOL_IS_FULL="mempool_is_full",e.INTERNAL_ERROR="internal_error",e.WEB_FRAMEWORK_ERROR="web_framework_error",e.BCS_NOT_SUPPORTED="bcs_not_supported",e.API_DISABLED="api_disabled",e))(Is||{}),Rs=(e=>(e.PRIVATE="private",e.PUBLIC="public",e.FRIEND="friend",e))(Rs||{}),Bs=(e=>(e.VALIDATOR="validator",e.FULL_NODE="full_node",e))(Bs||{}),Ts={description:"Account data\n\n A simplified version of the onchain Account resource",properties:{sequence_number:{type:"U64",isRequired:!0},authentication_key:{type:"HexEncodedBytes",isRequired:!0}}},Us={type:"one-of",description:"Account signature scheme\n\n The account signature scheme allows you to have two types of accounts:\n\n 1. A single Ed25519 key account, one private key\n 2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction.",contains:[{type:"AccountSignature_Ed25519Signature"},{type:"AccountSignature_MultiEd25519Signature"}]},Os={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"Ed25519Signature"}]},Cs={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"MultiEd25519Signature"}]},Ps={type:"string",description:"A hex encoded 32 byte Aptos account address.\n\n This is represented in a string as a 64 character hex string, sometimes\n shortened by stripping leading 0s, and adding a 0x.\n\n For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.\n ",format:"hex"},zs={description:"This is the generic struct we use for all API errors, it contains a string\n message and an Aptos API specific error code.",properties:{message:{type:"string",description:"A message describing the error",isRequired:!0},error_code:{type:"AptosErrorCode",isRequired:!0},vm_error_code:{type:"number",description:"A code providing VM error details when submitting transactions to the VM",format:"uint64"}}},Ls={type:"Enum"},Ns={description:"A Block with or without transactions\n\n This contains the information about a transactions along with\n associated transactions if requested",properties:{block_height:{type:"U64",isRequired:!0},block_hash:{type:"HashValue",isRequired:!0},block_timestamp:{type:"U64",isRequired:!0},first_version:{type:"U64",isRequired:!0},last_version:{type:"U64",isRequired:!0},transactions:{type:"array",contains:{type:"Transaction"}}}},qs={description:"A block metadata transaction\n\n This signifies the beginning of a block, and contains information\n about the specific block",properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},id:{type:"HashValue",isRequired:!0},epoch:{type:"U64",isRequired:!0},round:{type:"U64",isRequired:!0},events:{type:"array",contains:{type:"Event"},isRequired:!0},previous_block_votes_bitvec:{type:"array",contains:{type:"number",format:"uint8"},isRequired:!0},proposer:{type:"Address",isRequired:!0},failed_proposer_indices:{type:"array",contains:{type:"number",format:"uint32"},isRequired:!0},timestamp:{type:"U64",isRequired:!0}}},js={description:"Decoded table data",properties:{key:{description:"Key of table in JSON",properties:{},isRequired:!0},key_type:{type:"string",description:"Type of key",isRequired:!0},value:{description:"Value of table in JSON",properties:{},isRequired:!0},value_type:{type:"string",description:"Type of value",isRequired:!0}}},Ds={description:"Deleted table data",properties:{key:{description:"Deleted key",properties:{},isRequired:!0},key_type:{type:"string",description:"Deleted key type",isRequired:!0}}},Fs={description:"Delete a module",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},module:{type:"MoveModuleId",isRequired:!0}}},$s={description:"Delete a resource",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},resource:{type:"MoveStructTag",isRequired:!0}}},Hs={description:"Delete a table item",properties:{state_key_hash:{type:"string",isRequired:!0},handle:{type:"HexEncodedBytes",isRequired:!0},key:{type:"HexEncodedBytes",isRequired:!0},data:{type:"DeletedTableData"}}},Ws={properties:{changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},events:{type:"array",contains:{type:"Event"},isRequired:!0}}},Ks={description:"A single Ed25519 signature",properties:{public_key:{type:"HexEncodedBytes",isRequired:!0},signature:{type:"HexEncodedBytes",isRequired:!0}}},Gs={description:"Request to encode a submission",properties:{sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},secondary_signers:{type:"array",contains:{type:"Address"}}}},Vs={type:"string",description:"Entry function id is string representation of a entry function defined on-chain.\n\n Format: `{address}::{module name}::{function name}`\n\n Both `module name` and `function name` are case-sensitive.\n "},Js={description:"Payload which runs a single entry function",properties:{function:{type:"EntryFunctionId",isRequired:!0},type_arguments:{type:"array",contains:{type:"MoveType"},isRequired:!0},arguments:{type:"array",contains:{properties:{}},isRequired:!0}}},Ys={description:"An event from a transaction",properties:{key:{type:"EventKey",isRequired:!0},guid:{type:"EventGuid",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},type:{type:"MoveType",isRequired:!0},data:{description:"The JSON representation of the event",properties:{},isRequired:!0}}},Zs={properties:{creation_number:{type:"U64",isRequired:!0},account_address:{type:"Address",isRequired:!0}}},Xs={type:"string",description:"Event key is a global index for an event stream.\n\n It is hex-encoded BCS bytes of `EventHandle` `guid` field value, which is\n a combination of a `uint64` creation number and account address (without\n trimming leading zeros).\n\n For example, event key `0x000000000000000088fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` is combined by the following 2 parts:\n 1. `0000000000000000`: `uint64` representation of `0`.\n 2. `88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1`: 32 bytes of account address.\n ",format:"hex"},Qs={description:"Struct holding the outputs of the estimate gas API",properties:{gas_estimate:{type:"number",description:"The current estimate for the gas unit price",isRequired:!0,format:"uint64"}}},ea={type:"one-of",description:"The writeset payload of the Genesis transaction",contains:[{type:"GenesisPayload_WriteSetPayload"}]},ta={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteSetPayload"}]},ra={description:"The genesis transaction\n\n This only occurs at the genesis transaction (version 0)",properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},payload:{type:"GenesisPayload",isRequired:!0},events:{type:"array",contains:{type:"Event"},isRequired:!0}}},na={type:"string"},ia={description:"Representation of a successful healthcheck",properties:{message:{type:"string",isRequired:!0}}},oa={type:"string",description:"All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with\n two hex digits per byte.\n\n Unlike the `Address` type, HexEncodedBytes will not trim any zeros.\n ",format:"hex"},sa={type:"string"},aa={description:'The struct holding all data returned to the client by the\n index endpoint (i.e., GET "/").',properties:{chain_id:{type:"number",description:"Chain ID of the current chain",isRequired:!0,format:"uint8"},epoch:{type:"U64",isRequired:!0},ledger_version:{type:"U64",isRequired:!0},oldest_ledger_version:{type:"U64",isRequired:!0},ledger_timestamp:{type:"U64",isRequired:!0},node_role:{type:"RoleType",isRequired:!0},oldest_block_height:{type:"U64",isRequired:!0},block_height:{type:"U64",isRequired:!0}}},ua={properties:{modules:{type:"array",contains:{type:"MoveModuleBytecode"},isRequired:!0}}},ca={type:"string"},ha={description:"Move function",properties:{name:{type:"IdentifierWrapper",isRequired:!0},visibility:{type:"MoveFunctionVisibility",isRequired:!0},is_entry:{type:"boolean",description:"Whether the function can be called as an entry function directly in a transaction",isRequired:!0},generic_type_params:{type:"array",contains:{type:"MoveFunctionGenericTypeParam"},isRequired:!0},params:{type:"array",contains:{type:"MoveType"},isRequired:!0},return:{type:"array",contains:{type:"MoveType"},isRequired:!0}}},fa={description:"Move function generic type param",properties:{constraints:{type:"array",contains:{type:"MoveAbility"},isRequired:!0}}},da={type:"Enum"},la={description:"A Move module",properties:{address:{type:"Address",isRequired:!0},name:{type:"IdentifierWrapper",isRequired:!0},friends:{type:"array",contains:{type:"MoveModuleId"},isRequired:!0},exposed_functions:{type:"array",contains:{type:"MoveFunction"},isRequired:!0},structs:{type:"array",contains:{type:"MoveStruct"},isRequired:!0}}},pa={description:"Move module bytecode along with it's ABI",properties:{bytecode:{type:"HexEncodedBytes",isRequired:!0},abi:{type:"MoveModule"}}},ya={type:"string",description:"Move module id is a string representation of Move module.\n\n Format: `{address}::{module name}`\n\n `address` should be hex-encoded 32 byte account address that is prefixed with `0x`.\n\n Module name is case-sensitive.\n "},ga={description:"A parsed Move resource",properties:{type:{type:"MoveStructTag",isRequired:!0},data:{type:"MoveStructValue",isRequired:!0}}},ba={description:"Move script bytecode",properties:{bytecode:{type:"HexEncodedBytes",isRequired:!0},abi:{type:"MoveFunction"}}},ma={description:"A move struct",properties:{name:{type:"IdentifierWrapper",isRequired:!0},is_native:{type:"boolean",description:"Whether the struct is a native struct of Move",isRequired:!0},abilities:{type:"array",contains:{type:"MoveAbility"},isRequired:!0},generic_type_params:{type:"array",contains:{type:"MoveStructGenericTypeParam"},isRequired:!0},fields:{type:"array",contains:{type:"MoveStructField"},isRequired:!0}}},va={description:"Move struct field",properties:{name:{type:"IdentifierWrapper",isRequired:!0},type:{type:"MoveType",isRequired:!0}}},wa={description:"Move generic type param",properties:{constraints:{type:"array",contains:{type:"MoveAbility"},isRequired:!0}}},_a={type:"string",description:"String representation of a MoveStructTag (on-chain Move struct type). This exists so you\n can specify MoveStructTags as path / query parameters, e.g. for get_events_by_event_handle.\n\n It is a combination of:\n 1. `move_module_address`, `module_name` and `struct_name`, all joined by `::`\n 2. `struct generic type parameters` joined by `, `\n\n Examples:\n * `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>`\n * `0x1::account::Account`\n\n Note:\n 1. Empty chars should be ignored when comparing 2 struct tag ids.\n 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).\n\n See [doc](https://aptos.dev/concepts/basics-accounts) for more details.\n ",pattern:"^0x[0-9a-zA-Z:_<>]+$"},Ea={description:'This is a JSON representation of some data within an account resource. More specifically,\n it is a map of strings to arbitrary JSON values / objects, where the keys are top level\n fields within the given resource.\n\n To clarify, you might query for 0x1::account::Account and see the example data.\n\n Move `bool` type value is serialized into `boolean`.\n\n Move `u8` type value is serialized into `integer`.\n\n Move `u64` and `u128` type value is serialized into `string`.\n\n Move `address` type value (32 byte Aptos account address) is serialized into a HexEncodedBytes string.\n For example:\n - `0x1`\n - `0x1668f6be25668c1a17cd8caf6b8d2f25`\n\n Move `vector` type value is serialized into `array`, except `vector<u8>` which is serialized into a\n HexEncodedBytes string with `0x` prefix.\n For example:\n - `vector<u64>{255, 255}` => `["255", "255"]`\n - `vector<u8>{255, 255}` => `0xffff`\n\n Move `struct` type value is serialized into `object` that looks like this (except some Move stdlib types, see the following section):\n ```json\n {\n field1_name: field1_value,\n field2_name: field2_value,\n ......\n }\n ```\n\n For example:\n `{ "created": "0xa550c18", "role_id": "0" }`\n\n **Special serialization for Move stdlib types**:\n - [0x1::string::String](https://github.com/aptos-labs/aptos-core/blob/main/language/move-stdlib/docs/ascii.md)\n is serialized into `string`. For example, struct value `0x1::string::String{bytes: b"Hello World!"}`\n is serialized as `"Hello World!"` in JSON.\n ',properties:{}},Aa={type:"string",description:"String representation of an on-chain Move type tag that is exposed in transaction payload.\n Values:\n - bool\n - u8\n - u64\n - u128\n - address\n - signer\n - vector: `vector<{non-reference MoveTypeId}>`\n - struct: `{address}::{module_name}::{struct_name}::<{generic types}>`\n\n Vector type value examples:\n - `vector<u8>`\n - `vector<vector<u64>>`\n - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>`\n\n Struct type value examples:\n - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>\n - `0x1::account::Account`\n\n Note:\n 1. Empty chars should be ignored when comparing 2 struct tag ids.\n 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).\n ",pattern:"^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$"},Sa={type:"any-of",description:"An enum of the possible Move value types",contains:[{type:"number",format:"uint8"},{type:"U64"},{type:"U128"},{type:"boolean"},{type:"Address"},{type:"array",contains:{type:"MoveValue"}},{type:"HexEncodedBytes"},{type:"MoveStructValue"},{type:"string"}]},Ma={description:"Multi agent signature for multi agent transactions\n\n This allows you to have transactions across multiple accounts",properties:{sender:{type:"AccountSignature",isRequired:!0},secondary_signer_addresses:{type:"array",contains:{type:"Address"},isRequired:!0},secondary_signers:{type:"array",contains:{type:"AccountSignature"},isRequired:!0}}},xa={description:"A Ed25519 multi-sig signature\n\n This allows k-of-n signing for a transaction",properties:{public_keys:{type:"array",contains:{type:"HexEncodedBytes"},isRequired:!0},signatures:{type:"array",contains:{type:"HexEncodedBytes"},isRequired:!0},threshold:{type:"number",description:"The number of signatures required for a successful transaction",isRequired:!0,format:"uint8"},bitmap:{type:"HexEncodedBytes",isRequired:!0}}},ka={description:"A transaction waiting in mempool",properties:{hash:{type:"HashValue",isRequired:!0},sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},signature:{type:"TransactionSignature"}}},Ia={type:"Enum"},Ra={description:"Payload which runs a script that can run multiple functions",properties:{code:{type:"MoveScriptBytecode",isRequired:!0},type_arguments:{type:"array",contains:{type:"MoveType"},isRequired:!0},arguments:{type:"array",contains:{properties:{}},isRequired:!0}}},Ba={properties:{execute_as:{type:"Address",isRequired:!0},script:{type:"ScriptPayload",isRequired:!0}}},Ta={description:"A state checkpoint transaction",properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},timestamp:{type:"U64",isRequired:!0}}},Ua={description:"A request to submit a transaction\n\n This requires a transaction and a signature of it",properties:{sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},signature:{type:"TransactionSignature",isRequired:!0}}},Oa={description:"Table Item request for the GetTableItem API",properties:{key_type:{type:"MoveType",isRequired:!0},value_type:{type:"MoveType",isRequired:!0},key:{description:"The value of the table item's key",properties:{},isRequired:!0}}},Ca={type:"one-of",description:"Enum of the different types of transactions in Aptos",contains:[{type:"Transaction_PendingTransaction"},{type:"Transaction_UserTransaction"},{type:"Transaction_GenesisTransaction"},{type:"Transaction_BlockMetadataTransaction"},{type:"Transaction_StateCheckpointTransaction"}]},Pa={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"BlockMetadataTransaction"}]},za={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"GenesisTransaction"}]},La={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"PendingTransaction"}]},Na={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"StateCheckpointTransaction"}]},qa={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"UserTransaction"}]},ja={type:"one-of",description:"An enum of the possible transaction payloads",contains:[{type:"TransactionPayload_EntryFunctionPayload"},{type:"TransactionPayload_ScriptPayload"},{type:"TransactionPayload_ModuleBundlePayload"}]},Da={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"EntryFunctionPayload"}]},Fa={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"ModuleBundlePayload"}]},$a={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"ScriptPayload"}]},Ha={description:"Information telling which batch submission transactions failed",properties:{error:{type:"AptosError",isRequired:!0},transaction_index:{type:"number",description:"The index of which transaction failed, same as submission order",isRequired:!0,format:"uint64"}}},Wa={description:"Batch transaction submission result\n\n Tells which transactions failed",properties:{transaction_failures:{type:"array",contains:{type:"TransactionsBatchSingleSubmissionFailure"},isRequired:!0}}},Ka={type:"one-of",description:"An enum representing the different transaction signatures available",contains:[{type:"TransactionSignature_Ed25519Signature"},{type:"TransactionSignature_MultiEd25519Signature"},{type:"TransactionSignature_MultiAgentSignature"}]},Ga={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"Ed25519Signature"}]},Va={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"MultiAgentSignature"}]},Ja={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"MultiEd25519Signature"}]},Ya={type:"string",description:"A string containing a 128-bit unsigned integer.\n\n We represent u128 values as a string to ensure compatibility with languages such\n as JavaScript that do not parse u64s in JSON natively.\n ",format:"uint64"},Za={type:"string",description:"A string containing a 64-bit unsigned integer.\n\n We represent u64 values as a string to ensure compatibility with languages such\n as JavaScript that do not parse u64s in JSON natively.\n ",format:"uint64"},Xa={description:"A transaction submitted by a user to change the state of the blockchain",properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},signature:{type:"TransactionSignature"},events:{type:"array",contains:{type:"Event"},isRequired:!0},timestamp:{type:"U64",isRequired:!0}}},Qa={description:"An event from a transaction with a version",properties:{version:{type:"U64",isRequired:!0},key:{type:"EventKey",isRequired:!0},guid:{type:"EventGuid",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},type:{type:"MoveType",isRequired:!0},data:{description:"The JSON representation of the event",properties:{},isRequired:!0}}},eu={description:"Write a new module or update an existing one",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},data:{type:"MoveModuleBytecode",isRequired:!0}}},tu={description:"Write a resource or update an existing one",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},data:{type:"MoveResource",isRequired:!0}}},ru={type:"one-of",description:"The associated writeset with a payload",contains:[{type:"WriteSet_ScriptWriteSet"},{type:"WriteSet_DirectWriteSet"}]},nu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DirectWriteSet"}]},iu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"ScriptWriteSet"}]},ou={type:"one-of",description:"A final state change of a transaction on a resource or module",contains:[{type:"WriteSetChange_DeleteModule"},{type:"WriteSetChange_DeleteResource"},{type:"WriteSetChange_DeleteTableItem"},{type:"WriteSetChange_WriteModule"},{type:"WriteSetChange_WriteResource"},{type:"WriteSetChange_WriteTableItem"}]},su={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DeleteModule"}]},au={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DeleteResource"}]},uu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DeleteTableItem"}]},cu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteModule"}]},hu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteResource"}]},fu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteTableItem"}]},du={description:"A writeset payload, used only for genesis",properties:{write_set:{type:"WriteSet",isRequired:!0}}},lu={description:"Change set to write a table item",properties:{state_key_hash:{type:"string",isRequired:!0},handle:{type:"HexEncodedBytes",isRequired:!0},key:{type:"HexEncodedBytes",isRequired:!0},value:{type:"HexEncodedBytes",isRequired:!0},data:{type:"DecodedTableData"}}},pu={};Zo(pu,{AccountAddress:()=>gu,AccountAuthenticator:()=>Vu,AccountAuthenticatorEd25519:()=>Ju,AccountAuthenticatorMultiEd25519:()=>Yu,AuthenticationKey:()=>Cc,ChainId:()=>Ec,ChangeSet:()=>pc,Ed25519PublicKey:()=>Nu,Ed25519Signature:()=>ju,EntryFunction:()=>fc,Identifier:()=>Zu,Module:()=>dc,ModuleId:()=>lc,MultiAgentRawTransaction:()=>mc,MultiEd25519PublicKey:()=>Du,MultiEd25519Signature:()=>$u,RawTransaction:()=>cc,RawTransactionWithData:()=>bc,RotationProofChallenge:()=>Pc,Script:()=>hc,SignedTransaction:()=>gc,StructTag:()=>ac,Transaction:()=>Bc,TransactionArgument:()=>Ac,TransactionArgumentAddress:()=>kc,TransactionArgumentBool:()=>Rc,TransactionArgumentU128:()=>xc,TransactionArgumentU64:()=>Mc,TransactionArgumentU8:()=>Sc,TransactionArgumentU8Vector:()=>Ic,TransactionAuthenticator:()=>Hu,TransactionAuthenticatorEd25519:()=>Wu,TransactionAuthenticatorMultiAgent:()=>Gu,TransactionAuthenticatorMultiEd25519:()=>Ku,TransactionPayload:()=>vc,TransactionPayloadEntryFunction:()=>_c,TransactionPayloadScript:()=>wc,TypeTag:()=>Xu,TypeTagAddress:()=>nc,TypeTagBool:()=>Qu,TypeTagSigner:()=>ic,TypeTagStruct:()=>sc,TypeTagU128:()=>rc,TypeTagU64:()=>tc,TypeTagU8:()=>ec,TypeTagVector:()=>oc,UserTransaction:()=>Tc,WriteSet:()=>yc});var yu=class{constructor(e){if(e.length!==yu.LENGTH)throw new Error("Expected address of length 32");this.address=e}static fromHex(e){let t=ts.ensure(e);t.noPrefix().length%2!=0&&(t=new ts(`0${t.noPrefix()}`));const r=t.toUint8Array();if(r.length>yu.LENGTH)throw new Error("Hex string is too long. Address's length is 32 bytes.");if(r.length===yu.LENGTH)return new yu(r);const n=new Uint8Array(yu.LENGTH);return n.set(r,yu.LENGTH-r.length),new yu(n)}serialize(e){e.serializeFixedBytes(this.address)}static deserialize(e){return new yu(e.deserializeFixedBytes(yu.LENGTH))}},gu=yu;gu.LENGTH=32,gu.CORE_CODE_ADDRESS=yu.fromHex("0x1");var bu={};Zo(bu,{Deserializer:()=>Au,Serializer:()=>_u,bcsSerializeBool:()=>Ou,bcsSerializeBytes:()=>Pu,bcsSerializeFixedBytes:()=>zu,bcsSerializeStr:()=>Cu,bcsSerializeU128:()=>Uu,bcsSerializeU16:()=>Bu,bcsSerializeU32:()=>Tu,bcsSerializeU8:()=>Ru,bcsSerializeUint64:()=>Iu,bcsToBytes:()=>ku,deserializeVector:()=>xu,serializeVector:()=>Su,serializeVectorWithFunc:()=>Mu});var mu=2**32-1,vu=BigInt(2**64)-BigInt(1),wu=BigInt(2**128)-BigInt(1),_u=class{constructor(){this.buffer=new ArrayBuffer(64),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){const e=new ArrayBuffer(2*this.buffer.byteLength);new Uint8Array(e).set(new Uint8Array(this.buffer)),this.buffer=e}}serialize(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,r){this.ensureBufferWillHandleSize(t);const n=new DataView(this.buffer,this.offset);e.apply(n,[0,r,!0]),this.offset+=t}serializeStr(e){const t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.serialize(e)}serializeFixedBytes(e){this.serialize(e)}serializeBool(e){if("boolean"!=typeof e)throw new Error("Value needs to be a boolean");const t=e?1:0;this.serialize(new Uint8Array([t]))}serializeU8(e){this.serialize(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){const t=BigInt(e.toString())&BigInt(mu),r=BigInt(e.toString())>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(r))}serializeU128(e){const t=BigInt(e.toString())&vu,r=BigInt(e.toString())>>BigInt(64);this.serializeU64(t),this.serializeU64(r)}serializeU32AsUleb128(e){let t=e;const r=[];for(;t>>>7!=0;)r.push(127&t|128),t>>>=7;r.push(t),this.serialize(new Uint8Array(r))}getBytes(){return new Uint8Array(this.buffer).slice(0,this.offset)}};function Eu(e,t,r){return(n,i,o)=>{const s=o.value;return o.value=function(n){const i=BigInt(n.toString());if(i>BigInt(t.toString())||i<BigInt(e.toString()))throw new Error(r||"Value is out of range");s.apply(this,[n])},o}}Xo([Eu(0,255)],_u.prototype,"serializeU8",1),Xo([Eu(0,65535)],_u.prototype,"serializeU16",1),Xo([Eu(0,mu)],_u.prototype,"serializeU32",1),Xo([Eu(BigInt(0),vu)],_u.prototype,"serializeU64",1),Xo([Eu(BigInt(0),wu)],_u.prototype,"serializeU128",1),Xo([Eu(0,mu)],_u.prototype,"serializeU32AsUleb128",1);var Au=class{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}read(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Reached to the end of buffer");const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}deserializeStr(){const e=this.deserializeBytes();return(new TextDecoder).decode(e)}deserializeBytes(){const e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){const e=new Uint8Array(this.read(1))[0];if(1!==e&&0!==e)throw new Error("Invalid boolean value");return 1===e}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){const e=this.deserializeU32(),t=this.deserializeU32();return BigInt(BigInt(t)<<BigInt(32)|BigInt(e))}deserializeU128(){const e=this.deserializeU64(),t=this.deserializeU64();return BigInt(t<<BigInt(64)|e)}deserializeUleb128AsU32(){let e=BigInt(0),t=0;for(;e<mu;){const r=this.deserializeU8();if(e|=BigInt(127&r)<<BigInt(t),0==(128&r))break;t+=7}if(e>mu)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}};function Su(e,t){t.serializeU32AsUleb128(e.length),e.forEach((e=>{e.serialize(t)}))}function Mu(e,t){const r=new _u;r.serializeU32AsUleb128(e.length);const n=r[t];return e.forEach((e=>{n.call(r,e)})),r.getBytes()}function xu(e,t){const r=e.deserializeUleb128AsU32(),n=[];for(let i=0;i<r;i+=1)n.push(t.deserialize(e));return n}function ku(e){const t=new _u;return e.serialize(t),t.getBytes()}function Iu(e){const t=new _u;return t.serializeU64(e),t.getBytes()}function Ru(e){const t=new _u;return t.serializeU8(e),t.getBytes()}function Bu(e){const t=new _u;return t.serializeU16(e),t.getBytes()}function Tu(e){const t=new _u;return t.serializeU32(e),t.getBytes()}function Uu(e){const t=new _u;return t.serializeU128(e),t.getBytes()}function Ou(e){const t=new _u;return t.serializeBool(e),t.getBytes()}function Cu(e){const t=new _u;return t.serializeStr(e),t.getBytes()}function Pu(e){const t=new _u;return t.serializeBytes(e),t.getBytes()}function zu(e){const t=new _u;return t.serializeFixedBytes(e),t.getBytes()}var Lu=class{constructor(e){if(e.length!==Lu.LENGTH)throw new Error(`Ed25519PublicKey length should be ${Lu.LENGTH}`);this.value=e}serialize(e){e.serializeBytes(this.value)}static deserialize(e){const t=e.deserializeBytes();return new Lu(t)}},Nu=Lu;Nu.LENGTH=32;var qu=class{constructor(e){if(this.value=e,e.length!==qu.LENGTH)throw new Error(`Ed25519Signature length should be ${qu.LENGTH}`)}serialize(e){e.serializeBytes(this.value)}static deserialize(e){const t=e.deserializeBytes();return new qu(t)}},ju=qu;ju.LENGTH=64;var Du=class{constructor(e,t){if(this.public_keys=e,this.threshold=t,t>32)throw new Error('"threshold" cannot be larger than 32')}toBytes(){const e=new Uint8Array(this.public_keys.length*Nu.LENGTH+1);return this.public_keys.forEach(((t,r)=>{e.set(t.value,r*Nu.LENGTH)})),e[this.public_keys.length*Nu.LENGTH]=this.threshold,e}serialize(e){e.serializeBytes(this.toBytes())}static deserialize(e){const t=e.deserializeBytes(),r=t[t.length-1],n=[];for(let e=0;e<t.length-1;e+=Nu.LENGTH){const r=e;n.push(new Nu(t.subarray(r,r+Nu.LENGTH)))}return new Du(n,r)}},Fu=class{constructor(e,t){if(this.signatures=e,this.bitmap=t,t.length!==Fu.BITMAP_LEN)throw new Error(`"bitmap" length should be ${Fu.BITMAP_LEN}`)}toBytes(){const e=new Uint8Array(this.signatures.length*ju.LENGTH+Fu.BITMAP_LEN);return this.signatures.forEach(((t,r)=>{e.set(t.value,r*ju.LENGTH)})),e.set(this.bitmap,this.signatures.length*ju.LENGTH),e}static createBitmap(e){const t=new Uint8Array([0,0,0,0]),r=new Set;return e.forEach((e=>{if(e>=32)throw new Error(`Invalid bit value ${e}.`);if(r.has(e))throw new Error("Duplicated bits detected.");r.add(e);const n=Math.floor(e/8);let i=t[n];i|=128>>e%8,t[n]=i})),t}serialize(e){e.serializeBytes(this.toBytes())}static deserialize(e){const t=e.deserializeBytes(),r=t.subarray(t.length-4),n=[];for(let e=0;e<t.length-r.length;e+=ju.LENGTH){const r=e;n.push(new ju(t.subarray(r,r+ju.LENGTH)))}return new Fu(n,r)}},$u=Fu;$u.BITMAP_LEN=4;var Hu=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return Wu.load(e);case 1:return Ku.load(e);case 2:return Gu.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${t}`)}}},Wu=class extends Hu{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const t=Nu.deserialize(e),r=ju.deserialize(e);return new Wu(t,r)}},Ku=class extends Hu{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const t=Du.deserialize(e),r=$u.deserialize(e);return new Ku(t,r)}},Gu=class extends Hu{constructor(e,t,r){super(),this.sender=e,this.secondary_signer_addresses=t,this.secondary_signers=r}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),Su(this.secondary_signer_addresses,e),Su(this.secondary_signers,e)}static load(e){const t=Vu.deserialize(e),r=xu(e,gu),n=xu(e,Vu);return new Gu(t,r,n)}},Vu=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return Ju.load(e);case 1:return Yu.load(e);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${t}`)}}},Ju=class extends Vu{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const t=Nu.deserialize(e),r=ju.deserialize(e);return new Ju(t,r)}},Yu=class extends Vu{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const t=Du.deserialize(e),r=$u.deserialize(e);return new Yu(t,r)}},Zu=class{constructor(e){this.value=e}serialize(e){e.serializeStr(this.value)}static deserialize(e){const t=e.deserializeStr();return new Zu(t)}},Xu=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return Qu.load(e);case 1:return ec.load(e);case 2:return tc.load(e);case 3:return rc.load(e);case 4:return nc.load(e);case 5:return ic.load(e);case 6:return oc.load(e);case 7:return sc.load(e);default:throw new Error(`Unknown variant index for TypeTag: ${t}`)}}},Qu=class extends Xu{serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new Qu}},ec=class extends Xu{serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new ec}},tc=class extends Xu{serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new tc}},rc=class extends Xu{serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new rc}},nc=class extends Xu{serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new nc}},ic=class extends Xu{serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new ic}},oc=class extends Xu{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){const t=Xu.deserialize(e);return new oc(t)}},sc=class extends Xu{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){const t=ac.deserialize(e);return new sc(t)}},ac=class{constructor(e,t,r,n){this.address=e,this.module_name=t,this.name=r,this.type_args=n}static fromString(e){if(e.includes("<"))throw new Error("Not implemented");const t=e.split("::");if(3!==t.length)throw new Error("Invalid struct tag string literal.");return new ac(gu.fromHex(t[0]),new Zu(t[1]),new Zu(t[2]),[])}serialize(e){this.address.serialize(e),this.module_name.serialize(e),this.name.serialize(e),Su(this.type_args,e)}static deserialize(e){const t=gu.deserialize(e),r=Zu.deserialize(e),n=Zu.deserialize(e),i=xu(e,Xu);return new ac(t,r,n,i)}},{sha3_256:uc}=mo,cc=class{constructor(e,t,r,n,i,o,s){this.sender=e,this.sequence_number=t,this.payload=r,this.max_gas_amount=n,this.gas_unit_price=i,this.expiration_timestamp_secs=o,this.chain_id=s}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){const t=gu.deserialize(e),r=e.deserializeU64(),n=vc.deserialize(e),i=e.deserializeU64(),o=e.deserializeU64(),s=e.deserializeU64(),a=Ec.deserialize(e);return new cc(t,r,n,i,o,s,a)}},hc=class{constructor(e,t,r){this.code=e,this.ty_args=t,this.args=r}serialize(e){e.serializeBytes(this.code),Su(this.ty_args,e),Su(this.args,e)}static deserialize(e){const t=e.deserializeBytes(),r=xu(e,Xu),n=xu(e,Ac);return new hc(t,r,n)}},fc=class{constructor(e,t,r,n){this.module_name=e,this.function_name=t,this.ty_args=r,this.args=n}static natural(e,t,r,n){return new fc(lc.fromStr(e),new Zu(t),r,n)}static natual(e,t,r,n){return fc.natural(e,t,r,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),Su(this.ty_args,e),e.serializeU32AsUleb128(this.args.length),this.args.forEach((t=>{e.serializeBytes(t)}))}static deserialize(e){const t=lc.deserialize(e),r=Zu.deserialize(e),n=xu(e,Xu),i=e.deserializeUleb128AsU32(),o=[];for(let t=0;t<i;t+=1)o.push(e.deserializeBytes());return new fc(t,r,n,o)}},dc=class{constructor(e){this.code=e}serialize(e){e.serializeBytes(this.code)}static deserialize(e){const t=e.deserializeBytes();return new dc(t)}},lc=class{constructor(e,t){this.address=e,this.name=t}static fromStr(e){const t=e.split("::");if(2!==t.length)throw new Error("Invalid module id.");return new lc(gu.fromHex(new ts(t[0])),new Zu(t[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){const t=gu.deserialize(e),r=Zu.deserialize(e);return new lc(t,r)}},pc=class{serialize(e){throw new Error("Not implemented.")}static deserialize(e){throw new Error("Not implemented.")}},yc=class{serialize(e){throw new Error("Not implmented.")}static deserialize(e){throw new Error("Not implmented.")}},gc=class{constructor(e,t){this.raw_txn=e,this.authenticator=t}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){const t=cc.deserialize(e),r=Hu.deserialize(e);return new gc(t,r)}},bc=class{static deserialize(e){const t=e.deserializeUleb128AsU32();if(0===t)return mc.load(e);throw new Error(`Unknown variant index for RawTransactionWithData: ${t}`)}},mc=class extends bc{constructor(e,t){super(),this.raw_txn=e,this.secondary_signer_addresses=t}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),Su(this.secondary_signer_addresses,e)}static load(e){const t=cc.deserialize(e),r=xu(e,gu);return new mc(t,r)}},vc=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return wc.load(e);case 2:return _c.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},wc=class extends vc{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(0),this.value.serialize(e)}static load(e){const t=hc.deserialize(e);return new wc(t)}},_c=class extends vc{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(2),this.value.serialize(e)}static load(e){const t=fc.deserialize(e);return new _c(t)}},Ec=class{constructor(e){this.value=e}serialize(e){e.serializeU8(this.value)}static deserialize(e){const t=e.deserializeU8();return new Ec(t)}},Ac=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return Sc.load(e);case 1:return Mc.load(e);case 2:return xc.load(e);case 3:return kc.load(e);case 4:return Ic.load(e);case 5:return Rc.load(e);default:throw new Error(`Unknown variant index for TransactionArgument: ${t}`)}}},Sc=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(0),e.serializeU8(this.value)}static load(e){const t=e.deserializeU8();return new Sc(t)}},Mc=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(1),e.serializeU64(this.value)}static load(e){const t=e.deserializeU64();return new Mc(t)}},xc=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(2),e.serializeU128(this.value)}static load(e){const t=e.deserializeU128();return new xc(t)}},kc=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(3),this.value.serialize(e)}static load(e){const t=gu.deserialize(e);return new kc(t)}},Ic=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(4),e.serializeBytes(this.value)}static load(e){const t=e.deserializeBytes();return new Ic(t)}},Rc=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(5),e.serializeBool(this.value)}static load(e){const t=e.deserializeBool();return new Rc(t)}},Bc=class{getHashSalt(){const e=uc.create();return e.update("APTOS::Transaction"),new Uint8Array(e.arrayBuffer())}static deserialize(e){const t=e.deserializeUleb128AsU32();if(0===t)return Tc.load(e);throw new Error(`Unknown variant index for Transaction: ${t}`)}},Tc=class extends Bc{constructor(e){super(),this.value=e}hash(){const e=uc.create();return e.update(this.getHashSalt()),e.update(ku(this)),new Uint8Array(e.arrayBuffer())}serialize(e){e.serializeU32AsUleb128(0),this.value.serialize(e)}static load(e){return new Tc(gc.deserialize(e))}},{sha3_256:Uc}=mo,Oc=class{constructor(e){if(e.length!==Oc.LENGTH)throw new Error("Expected a byte array of length 32");this.bytes=e}static fromMultiEd25519PublicKey(e){const t=e.toBytes(),r=new Uint8Array(t.length+1);r.set(t),r.set([Oc.MULTI_ED25519_SCHEME],t.length);const n=Uc.create();return n.update(r),new Oc(new Uint8Array(n.arrayBuffer()))}derivedAddress(){return ts.fromUint8Array(this.bytes)}},Cc=Oc;Cc.LENGTH=32,Cc.MULTI_ED25519_SCHEME=1;var Pc=class{constructor(e,t,r,n,i,o,s){this.accountAddress=e,this.moduleName=t,this.structName=r,this.sequenceNumber=n,this.originator=i,this.currentAuthKey=o,this.newPublicKey=s}serialize(e){this.accountAddress.serialize(e),e.serializeStr(this.moduleName),e.serializeStr(this.structName),e.serializeU64(this.sequenceNumber),this.originator.serialize(e),this.currentAuthKey.serialize(e),e.serializeBytes(this.newPublicKey)}},zc=class{constructor(e){this.name=e}serialize(e){e.serializeStr(this.name)}static deserialize(e){const t=e.deserializeStr();return new zc(t)}},Lc=class{constructor(e,t){this.name=e,this.type_tag=t}serialize(e){e.serializeStr(this.name),this.type_tag.serialize(e)}static deserialize(e){const t=e.deserializeStr(),r=Xu.deserialize(e);return new Lc(t,r)}},Nc=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return qc.load(e);case 1:return jc.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},qc=class extends Nc{constructor(e,t,r,n,i){super(),this.name=e,this.doc=t,this.code=r,this.ty_args=n,this.args=i}serialize(e){e.serializeU32AsUleb128(0),e.serializeStr(this.name),e.serializeStr(this.doc),e.serializeBytes(this.code),Su(this.ty_args,e),Su(this.args,e)}static load(e){const t=e.deserializeStr(),r=e.deserializeStr(),n=e.deserializeBytes(),i=xu(e,zc),o=xu(e,Lc);return new qc(t,r,n,i,o)}},jc=class extends Nc{constructor(e,t,r,n,i){super(),this.name=e,this.module_name=t,this.doc=r,this.ty_args=n,this.args=i}serialize(e){e.serializeU32AsUleb128(1),e.serializeStr(this.name),this.module_name.serialize(e),e.serializeStr(this.doc),Su(this.ty_args,e),Su(this.args,e)}static load(e){const t=e.deserializeStr(),r=lc.deserialize(e),n=e.deserializeStr(),i=xu(e,zc),o=xu(e,Lc);return new jc(t,r,n,i,o)}};function Dc(e,t,r){if(!(null==t?void 0:t.includes(typeof e)))throw new Error(r||`Invalid arg: ${e} type should be ${t instanceof Array?t.join(" or "):t}`)}function Fc(e){throw new Error(e)}function $c(e){return!!e.match(/\s/)}function Hc(e){return!!e.match(/[_A-Za-z0-9]/g)}function Wc(e,t){const r=e[t];if(":"===r){if("::"===e.slice(t,t+2))return[["COLON","::"],2];Fc("Unrecognized token.")}else{if("<"===r)return[["LT","<"],1];if(">"===r)return[["GT",">"],1];if(","===r)return[["COMMA",","],1];if($c(r)){let r="";for(let n=t;n<e.length;n+=1){const t=e[n];if(!$c(t))break;r=`${r}${t}`}return[["SPACE",r],r.length]}if(Hc(r)){let r="";for(let n=t;n<e.length;n+=1){const t=e[n];if(!Hc(t))break;r=`${r}${t}`}return[["IDENT",r],r.length]}}throw new Error("Unrecognized token.")}var Kc=class{constructor(e){this.tokens=function(e){let t=0;const r=[];for(;t<e.length;){const[n,i]=Wc(e,t);"SPACE"!==n[0]&&r.push(n),t+=i}return r}(e)}consume(e){const t=this.tokens.shift();t&&t[1]===e||Fc("Invalid type tag.")}parseCommaList(e,t){const r=[];for(this.tokens.length<=0&&Fc("Invalid type tag.");!(this.tokens[0][1]===e||(r.push(this.parseTypeTag()),this.tokens.length>0&&this.tokens[0][1]===e)||(this.consume(","),this.tokens.length>0&&this.tokens[0][1]===e&&t));)this.tokens.length<=0&&Fc("Invalid type tag.");return r}parseTypeTag(){0===this.tokens.length&&Fc("Invalid type tag.");const[e,t]=this.tokens.shift();if("u8"===t)return new ec;if("u64"===t)return new tc;if("u128"===t)return new rc;if("bool"===t)return new Qu;if("address"===t)return new nc;if("vector"===t){this.consume("<");const e=this.parseTypeTag();return this.consume(">"),new oc(e)}if("IDENT"===e&&(t.startsWith("0x")||t.startsWith("0X"))){const e=t;this.consume("::");const[r,n]=this.tokens.shift();"IDENT"!==r&&Fc("Invalid type tag."),this.consume("::");const[i,o]=this.tokens.shift();"IDENT"!==i&&Fc("Invalid type tag.");let s=[];this.tokens.length>0&&"<"===this.tokens[0][1]&&(this.consume("<"),s=this.parseCommaList(">",!0),this.consume(">"));const a=new ac(gu.fromHex(e),new Zu(n),new Zu(o),s);return new sc(a)}throw new Error("Invalid type tag.")}};function Gc(e){if(Dc(e,["boolean","string"]),"boolean"==typeof e)return e;if("true"===e)return!0;if("false"===e)return!1;throw new Error("Invalid boolean string.")}function Vc(e){if(Dc(e,["number","string"]),"number"==typeof e)return e;const t=Number.parseInt(e,10);if(Number.isNaN(t))throw new Error("Invalid number string.");return t}function Jc(e){return Dc(e,["number","bigint","string"]),BigInt(e)}function Yc(e,t,r){if(t instanceof Qu)r.serializeBool(Gc(e));else if(t instanceof ec)r.serializeU8(Vc(e));else if(t instanceof tc)r.serializeU64(Jc(e));else if(t instanceof rc)r.serializeU128(Jc(e));else{if(!(t instanceof nc)){if(t instanceof oc){if(t.value instanceof ec){if(e instanceof Uint8Array)return void r.serializeBytes(e);if("string"==typeof e)return void r.serializeStr(e)}if(!(e instanceof Array))throw new Error("Invalid vector args.");return r.serializeU32AsUleb128(e.length),void e.forEach((e=>Yc(e,t.value,r)))}if(t instanceof sc){const{address:n,module_name:i,name:o}=t.value;if("0x1::string::String"!=`${ts.fromUint8Array(n.address).toShortString()}::${i.value}::${o.value}`)throw new Error("The only supported struct arg is of type 0x1::string::String");return Dc(e,["string"]),void r.serializeStr(e)}throw new Error("Unsupported arg type.")}{let t;if("string"==typeof e||e instanceof ts)t=gu.fromHex(e);else{if(!(e instanceof gu))throw new Error("Invalid account address.");t=e}t.serialize(r)}}}var{sha3_256:Zc}=mo,Xc=class{constructor(e,t){this.rawTxnBuilder=t,this.signingFunction=e}build(e,t,r){if(!this.rawTxnBuilder)throw new Error("this.rawTxnBuilder doesn't exist.");return this.rawTxnBuilder.build(e,t,r)}static getSigningMessage(e){const t=Zc.create();if(e instanceof cc)t.update("APTOS::RawTransaction");else{if(!(e instanceof mc))throw new Error("Unknown transaction type.");t.update("APTOS::RawTransactionWithData")}const r=new Uint8Array(t.arrayBuffer()),n=ku(e),i=new Uint8Array(r.length+n.length);return i.set(r),i.set(n,r.length),i}},Qc=class extends Xc{constructor(e,t,r){super(e,r),this.publicKey=t}rawToSigned(e){const t=Xc.getSigningMessage(e),r=this.signingFunction(t),n=new Wu(new Nu(this.publicKey),r);return new gc(e,n)}sign(e){return ku(this.rawToSigned(e))}},eh=class{constructor(e,t){this.abiMap=new Map,e.forEach((e=>{const t=new Au(e),r=Nc.deserialize(t);let n;if(r instanceof jc){const e=r,{address:t,name:i}=e.module_name;n=`${ts.fromUint8Array(t.address).toShortString()}::${i.value}::${e.name}`}else n=r.name;if(this.abiMap.has(n))throw new Error("Found conflicting ABI interfaces");this.abiMap.set(n,r)})),this.builderConfig={gasUnitPrice:BigInt(1),maxGasAmount:BigInt(2e3),expSecFromNow:20,...t}}static toBCSArgs(e,t){if(e.length!==t.length)throw new Error("Wrong number of args provided.");return t.map(((t,r)=>{const n=new _u;return Yc(t,e[r].type_tag,n),n.getBytes()}))}static toTransactionArguments(e,t){if(e.length!==t.length)throw new Error("Wrong number of args provided.");return t.map(((t,r)=>function(e,t){if(t instanceof Qu)return new Rc(Gc(e));if(t instanceof ec)return new Sc(Vc(e));if(t instanceof tc)return new Mc(Jc(e));if(t instanceof rc)return new xc(Jc(e));if(t instanceof nc){let t;if("string"==typeof e||e instanceof ts)t=gu.fromHex(e);else{if(!(e instanceof gu))throw new Error("Invalid account address.");t=e}return new kc(t)}if(t instanceof oc&&t.value instanceof ec){if(!(e instanceof Uint8Array))throw new Error(`${e} should be an instance of Uint8Array`);return new Ic(e)}throw new Error("Unknown type for TransactionArgument.")}(t,e[r].type_tag)))}setSequenceNumber(e){this.builderConfig.sequenceNumber=BigInt(e)}buildTransactionPayload(e,t,r){const n=t.map((e=>new Kc(e).parseTypeTag()));let i;if(!this.abiMap.has(e))throw new Error(`Cannot find function: ${e}`);const o=this.abiMap.get(e);if(o instanceof jc){const e=o,t=eh.toBCSArgs(e.args,r);i=new _c(new fc(e.module_name,new Zu(e.name),n,t))}if(o instanceof qc){const e=o,t=eh.toTransactionArguments(e.args,r);i=new wc(new hc(e.code,n,t))}return i}build(e,t,r){const{sender:n,sequenceNumber:i,gasUnitPrice:o,maxGasAmount:s,expSecFromNow:a,chainId:u}=this.builderConfig,c=n instanceof gu?n:gu.fromHex(n),h=BigInt(Math.floor(Date.now()/1e3)+Number(a)),f=this.buildTransactionPayload(e,t,r);if(f)return new cc(c,BigInt(i),f,BigInt(s),BigInt(o),h,new Ec(Number(u)));throw new Error("Invalid ABI.")}},th=class{constructor(e,t){this.aptosClient=e,this.builderConfig=t}async fetchABI(e){const t=(await this.aptosClient.getAccountModules(e)).map((e=>e.abi)).flatMap((e=>e.exposed_functions.filter((e=>e.is_entry)).map((t=>({fullName:`${e.address}::${e.name}::${t.name}`,...t}))))),r=new Map;return t.forEach((e=>{r.set(e.fullName,e)})),r}async build(e,t,r){if(e=(e=>e.replace(/^0[xX]0*/g,"0x"))(e),3!==e.split("::").length)throw new Error("'func' needs to be a fully qualified function name in format <address>::<module>::<function>, e.g. 0x1::coins::transfer");const[n,i]=e.split("::"),o=await this.fetchABI(n);if(!o.has(e))throw new Error(`${e} doesn't exist.`);const s=o.get(e),a=s.params.filter((e=>"signer"!==e&&"&signer"!==e)).map(((e,t)=>new Lc(`var${t}`,new Kc(e).parseTypeTag()))),u=new jc(s.name,lc.fromStr(`${n}::${i}`),"",s.generic_type_params.map(((e,t)=>new zc(`${t}`))),a),{sender:c,...h}=this.builderConfig,f=c instanceof gu?ts.fromUint8Array(c.address):c,[{sequence_number:d},l]=await Promise.all([(null==h?void 0:h.sequenceNumber)?Promise.resolve({sequence_number:null==h?void 0:h.sequenceNumber}):this.aptosClient.getAccount(f),(null==h?void 0:h.chainId)?Promise.resolve(null==h?void 0:h.chainId):this.aptosClient.getChainId()]);return new eh([ku(u)],{sender:c,sequenceNumber:d,chainId:l,...h}).build(e,t,r)}};Xo([(6e5,ns({ttlMs:6e5,hashFunction:undefined}))],th.prototype,"fetchABI",1);var rh=class{constructor(e,t,r=!1){if(!e)throw new Error("Node URL cannot be empty.");const n=null==t?{}:{...t};n.BASE=r?e:function(e){let t=`${e}`;return t.endsWith("/")&&(t=t.substring(0,t.length-1)),t.endsWith("/v1")||(t=`${t}/v1`),t}(e),this.client=new xs(n)}async getAccount(e){return this.client.accounts.getAccount(ts.ensure(e).hex())}async getAccountTransactions(e,t){var r;return this.client.transactions.getAccountTransactions(ts.ensure(e).hex(),null==(r=null==t?void 0:t.start)?void 0:r.toString(),null==t?void 0:t.limit)}async getAccountModules(e,t){var r;return this.client.accounts.getAccountModules(ts.ensure(e).hex(),null==(r=null==t?void 0:t.ledgerVersion)?void 0:r.toString())}async getAccountModule(e,t,r){var n;return this.client.accounts.getAccountModule(ts.ensure(e).hex(),t,null==(n=null==r?void 0:r.ledgerVersion)?void 0:n.toString())}async getAccountResources(e,t){var r;return this.client.accounts.getAccountResources(ts.ensure(e).hex(),null==(r=null==t?void 0:t.ledgerVersion)?void 0:r.toString())}async getAccountResource(e,t,r){var n;return this.client.accounts.getAccountResource(ts.ensure(e).hex(),t,null==(n=null==r?void 0:r.ledgerVersion)?void 0:n.toString())}static generateBCSTransaction(e,t){return new Qc((t=>{const r=e.signBuffer(t);return new pu.Ed25519Signature(r.toUint8Array())}),e.pubKey().toUint8Array()).sign(t)}static generateBCSSimulation(e,t){return new Qc((e=>{const t=new Uint8Array(64);return new pu.Ed25519Signature(t)}),e.pubKey().toUint8Array()).sign(t)}async generateTransaction(e,t,r){const n={sender:e};if((null==r?void 0:r.sequence_number)&&(n.sequenceNumber=r.sequence_number),(null==r?void 0:r.gas_unit_price)&&(n.gasUnitPrice=r.gas_unit_price),(null==r?void 0:r.max_gas_amount)&&(n.maxGasAmount=r.max_gas_amount),null==r?void 0:r.expiration_timestamp_secs){const e=Number.parseInt(r.expiration_timestamp_secs,10);n.expSecFromNow=e-Math.floor(Date.now()/1e3)}return new th(this,n).build(t.function,t.type_arguments,t.arguments)}async signTransaction(e,t){return Promise.resolve(rh.generateBCSTransaction(e,t))}async getEventsByEventKey(e){return this.client.events.getEventsByEventKey(e)}async getEventsByCreationNumber(e,t){return this.client.events.getEventsByCreationNumber(ts.ensure(e).hex(),t.toString())}async getEventsByEventHandle(e,t,r,n){var i;return this.client.events.getEventsByEventHandle(ts.ensure(e).hex(),t,r,null==(i=null==n?void 0:n.start)?void 0:i.toString(),null==n?void 0:n.limit)}async submitTransaction(e){return this.submitSignedBCSTransaction(e)}async simulateTransaction(e,t){const r=rh.generateBCSSimulation(e,t);return this.submitBCSSimulation(r)}async submitSignedBCSTransaction(e){return this.client.request.request({url:"/transactions",method:"POST",body:e,mediaType:"application/x.aptos.signed_transaction+bcs"})}async submitBCSSimulation(e){return this.client.request.request({url:"/transactions/simulate",method:"POST",body:e,mediaType:"application/x.aptos.signed_transaction+bcs"})}async getTransactions(e){var t;return this.client.transactions.getTransactions(null==(t=null==e?void 0:e.start)?void 0:t.toString(),null==e?void 0:e.limit)}async getTransactionByHash(e){return this.client.transactions.getTransactionByHash(e)}async getTransactionByVersion(e){return this.client.transactions.getTransactionByVersion(e.toString())}async transactionPending(e){try{return"pending_transaction"===(await this.client.transactions.getTransactionByHash(e)).type}catch(e){if(404===(null==e?void 0:e.status))return!0;throw e}}async waitForTransactionWithResult(e,t){const r=(null==t?void 0:t.timeoutSecs)??20,n=(null==t?void 0:t.checkSuccess)??!1;let i,o=!0,s=0;for(;o&&!(s>=r);){try{if(i=await this.client.transactions.getTransactionByHash(e),o="pending_transaction"===i.type,!o)break}catch(e){const t=e instanceof hs,r=t&&404!==e.status&&e.status>=400&&e.status<500;if(!t||r)throw e}await rs(1e3),s+=1}if(o)throw new oh(`Waiting for transaction ${e} timed out after ${r} seconds`,i);if(!n)return i;if(!(null==i?void 0:i.success))throw new sh(`Transaction ${i.hash} committed to the blockchain but execution failed`,i);return i}async waitForTransaction(e,t){await this.waitForTransactionWithResult(e,t)}async getLedgerInfo(){return this.client.general.getLedgerInfo()}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getTableItem(e,t,r){var n;return await this.client.tables.getTableItem(e,t,null==(n=null==r?void 0:r.ledgerVersion)?void 0:n.toString())}async generateRawTransaction(e,t,r){const{maxGasAmount:n,gasUnitPrice:i,expireTimestamp:o}={maxGasAmount:BigInt(2e3),gasUnitPrice:BigInt(1),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+20),...r},[{sequence_number:s},a]=await Promise.all([this.getAccount(e),this.getChainId()]);return new pu.RawTransaction(pu.AccountAddress.fromHex(e),BigInt(s),t,n,i,o,new pu.ChainId(a))}async generateSignSubmitTransaction(e,t,r){const n=await this.generateRawTransaction(e.address(),t,r),i=rh.generateBCSTransaction(e,n);return(await this.submitSignedBCSTransaction(i)).hash}async publishPackage(e,t,r,n){const i=new _u;Su(r,i);const o=new pu.TransactionPayloadEntryFunction(pu.EntryFunction.natural("0x1::code","publish_package_txn",[],[Pu(t),i.getBytes()]));return this.generateSignSubmitTransaction(e,o,n)}async generateSignSubmitWaitForTransaction(e,t,r){const n=await this.generateSignSubmitTransaction(e,t,r);return this.waitForTransactionWithResult(n,r)}async rotateAuthKeyEd25519(e,t,r){const{sequence_number:n,authentication_key:i}=await this.getAccount(e.address()),o=new us(t),s=new pu.RotationProofChallenge(pu.AccountAddress.CORE_CODE_ADDRESS,"account","RotationProofChallenge",BigInt(n),pu.AccountAddress.fromHex(e.address()),new pu.AccountAddress(new ts(i).toUint8Array()),o.pubKey().toUint8Array()),a=ts.fromUint8Array(ku(s)),u=e.signHexString(a),c=o.signHexString(a),h=new pu.TransactionPayloadEntryFunction(pu.EntryFunction.natural("0x1::account","rotate_authentication_key",[],[Ru(0),Pu(e.pubKey().toUint8Array()),Ru(0),Pu(o.pubKey().toUint8Array()),Pu(u.toUint8Array()),Pu(c.toUint8Array())])),f=await this.generateRawTransaction(e.address(),h,r),d=rh.generateBCSTransaction(e,f);return this.submitSignedBCSTransaction(d)}async lookupOriginalAddress(e){const t=await this.getAccountResource("0x1","0x1::account::OriginatingAddress"),{address_map:{handle:r}}=t.data,n=await this.getTableItem(r,{key_type:"address",value_type:"address",key:ts.ensure(e).hex()});return new ts(n)}},nh=rh;Xo([ah],nh.prototype,"getAccount",1),Xo([ah],nh.prototype,"getAccountTransactions",1),Xo([ah],nh.prototype,"getAccountModules",1),Xo([ah],nh.prototype,"getAccountModule",1),Xo([ah],nh.prototype,"getAccountResources",1),Xo([ah],nh.prototype,"getAccountResource",1),Xo([ah],nh.prototype,"getEventsByEventKey",1),Xo([ah],nh.prototype,"getEventsByCreationNumber",1),Xo([ah],nh.prototype,"getEventsByEventHandle",1),Xo([ah],nh.prototype,"getTransactions",1),Xo([ah],nh.prototype,"getTransactionByHash",1),Xo([ah],nh.prototype,"getTransactionByVersion",1),Xo([ah],nh.prototype,"getLedgerInfo",1),Xo([ns()],nh.prototype,"getChainId",1),Xo([ah],nh.prototype,"getTableItem",1);var ih=class extends Error{constructor(e,t,r,n){super(t),this.status=e,this.message=t,this.errorCode=r,this.vmErrorCode=n}},oh=class extends Error{constructor(e,t){super(e),this.lastSubmittedTransaction=t}},sh=class extends Error{constructor(e,t){super(e),this.transaction=t}};function ah(e,t,r){const n=r.value;return r.value=async function(...e){var t,r;try{return await n.apply(this,[...e])}catch(e){if(e instanceof hs)throw new ih(e.status,JSON.stringify({message:e.message,...e.body}),null==(t=e.body)?void 0:t.error_code,null==(r=e.body)?void 0:r.vm_error_code);throw e}},r}var uh=r(8764).Buffer,ch=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class hh extends go{constructor(e){super(Object.assign(Object.assign({},e),{bridge:e.bridge||he({timeout:e.timeout})})),this.isMartian=!0,window.dispatchEvent(new Event("martian#initialized"))}get publicKey(){var e,t;return null!==(t=null===(e=this._account)||void 0===e?void 0:e.publicKey)&&void 0!==t?t:null}getClient(){return ch(this,void 0,void 0,(function*(){return new nh(yield this.getNetworkURL())}))}_callMartianBridge(e){return this.bridgeRequest(e)}signAndSubmitTransaction(e){return ch(this,void 0,void 0,(function*(){if("string"==typeof e)return yield this._callMartianBridge({method:"martianSignAndSubmitTransaction",params:e});{const t=yield this._callMartianBridge({method:"signAndSubmitTransaction",params:e});if(!t)throw F();return JSON.parse(t)}}))}signTransaction(e){return ch(this,void 0,void 0,(function*(){if("string"==typeof e)return this._callMartianBridge({method:"martianSignTransaction",params:e});{const t=yield this._callMartianBridge({method:"signTransaction",params:e});if(!t)throw F();return new Uint8Array(uh.from(t,"hex"))}}))}signGenericTransaction(e){return ch(this,void 0,void 0,(function*(){return this._callMartianBridge({method:"signGenericTransaction",params:{func:e.func,args:e.args,type_args:e.type_args}})}))}generateSignAndSubmitTransaction(e,t,r){return ch(this,void 0,void 0,(function*(){const n=yield this.generateTransaction(e,t,r);return yield this.signAndSubmitTransaction(n)}))}createCollection(e,t,r){return ch(this,void 0,void 0,(function*(){return this._callMartianBridge({method:"createCollection",params:{name:e,description:t,uri:r}})}))}createToken(e,t,r,n,i,o,s,a,u,c,h,f){return ch(this,void 0,void 0,(function*(){return this._callMartianBridge({method:"createToken",params:{collectionName:e,name:t,description:r,supply:n,uri:i,max:o,royalty_payee_address:s,royalty_points_denominator:a,royalty_points_numerator:u,property_keys:c,property_values:h,property_types:f}})}))}generateTransaction(e,t,r){return ch(this,void 0,void 0,(function*(){const n=yield this.getClient(),i=yield n.generateTransaction(e,t,r),o=new bu.Serializer;return i.serialize(o),o.getBytes().toString()}))}_convertStringToUint8Array(e){return new Uint8Array(e.split(",").map((e=>parseInt(e,10))))}submitTransaction(e){return ch(this,void 0,void 0,(function*(){const t="string"==typeof e?this._convertStringToUint8Array(e):e,r=yield this.getClient();return(yield r.submitTransaction(t)).hash}))}getTransactions(e){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getTransactions(e)}))}getTransaction(e){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getTransactionByHash(e)}))}getAccountTransactions(e,t){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getAccountTransactions(e,t)}))}getAccountResources(e,t){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getAccountResources(e,t)}))}getAccount(e){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getAccount(e)}))}getChainId(){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getChainId()}))}getLedgerInfo(){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getLedgerInfo()}))}}se((()=>new de({receiveHandler:ae}))),function(){var e,t;if(!(null===(e=null===window||void 0===window?void 0:window.$onekey)||void 0===e?void 0:e.jsBridge))throw new Error("OneKey jsBridge not found.");const r=null===(t=null===window||void 0===window?void 0:window.$onekey)||void 0===t?void 0:t.jsBridge,n=new Ee({bridge:r}),i=new Ae({bridge:r}),o=new Qi({bridge:r}),s=new uo({bridge:r}),a=new hh({bridge:r}),u=Object.assign(Object.assign({},window.$onekey),{jsBridge:r,$private:i,ethereum:n,solana:o,starcoin:s,aptos:a,conflux:null,sollet:null});window.$onekey=u,window.ethereum=n,window.solana=o,window.phantom={solana:o},window.starcoin=s,window.aptos=a,window.martian=a,function(e,t=console){let r=!1,n=!1;if(!window.web3){const i="__isMetaMaskShim__",o="__isOneKeyShim__";let s={currentProvider:e};Object.defineProperty(s,i,{value:!0,enumerable:!0,configurable:!1,writable:!1}),Object.defineProperty(s,o,{value:!0,enumerable:!0,configurable:!1,writable:!1}),s=new Proxy(s,{get:(o,s,...a)=>("currentProvider"!==s||r?"currentProvider"===s||s===i||n||(n=!0,t.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),e.request({method:"metamask_logWeb3ShimUsage"}).catch((e=>{t.debug("MetaMask: Failed to log web3 shim usage.",e)}))):(r=!0,t.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")),Reflect.get(o,s,...a)),set:(...e)=>(t.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),Reflect.set(...e))}),Object.defineProperty(window,"web3",{value:s,enumerable:!1,configurable:!0,writable:!0})}}(n),window.dispatchEvent(new Event("ethereum#initialized"))}(),console.log("======== injected.js in extension done! >>>>>>> ",performance.now())})(),n})()}));
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,(function(){return(()=>{var e={9378:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},4563:(e,t,r)=>{var n=r(19).Symbol;e.exports=n},2325:(e,t,r)=>{var n=r(4563),i=r(6544),o=r(9252),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},6008:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},9723:(e,t,r)=>{var n=r(1539)(Object.getPrototypeOf,Object);e.exports=n},6544:(e,t,r)=>{var n=r(4563),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var i=s.call(e);return n&&(t?e[a]=r:delete e[a]),i}},9252:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},1539:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},19:(e,t,r)=>{var n=r(6008),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},9906:e=>{var t=Array.isArray;e.exports=t},5920:(e,t,r)=>{var n=r(2325),i=r(6464);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},6464:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},2612:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8395:(e,t,r)=>{var n=r(2325),i=r(9723),o=r(2612),s=Function.prototype,a=Object.prototype,u=s.toString,c=a.hasOwnProperty,h=u.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==h}},2788:(e,t,r)=>{var n=r(2325),i=r(9906),o=r(2612);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==n(e)}},4554:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,u,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&isFinite(e))return s.long?(a=e,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=n?o(a,u,n,"hour"):u>=r?o(a,u,r,"minute"):u>=t?o(a,u,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9439:e=>{e.exports=s,s.default=s,s.stable=h,s.stableStringify=h;var t="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=o()),u(e,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(e,t,r):JSON.stringify(e,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function a(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:e}),n.push([o,r,t,s])):i.push([t,r,e]):(o[r]=e,n.push([o,r,t]))}function u(e,n,i,o,s,c,h){var f;if(c+=1,"object"==typeof e&&null!==e){for(f=0;f<o.length;f++)if(o[f]===e)return void a(r,e,n,s);if(void 0!==h.depthLimit&&c>h.depthLimit)return void a(t,e,n,s);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void a(t,e,n,s);if(o.push(e),Array.isArray(e))for(f=0;f<e.length;f++)u(e[f],f,f,o,e,c,h);else{var d=Object.keys(e);for(f=0;f<d.length;f++){var l=d[f];u(e[l],l,f,o,e,c,h)}}o.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function h(e,t,r,s){void 0===s&&(s=o());var a,u=f(e,"",0,[],void 0,0,s)||e;try{a=0===i.length?JSON.stringify(u,t,r):JSON.stringify(u,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function f(e,i,o,s,u,h,d){var l;if(h+=1,"object"==typeof e&&null!==e){for(l=0;l<s.length;l++)if(s[l]===e)return void a(r,e,i,u);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&h>d.depthLimit)return void a(t,e,i,u);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void a(t,e,i,u);if(s.push(e),Array.isArray(e))for(l=0;l<e.length;l++)f(e[l],l,l,s,e,h,d);else{var p={},y=Object.keys(e).sort(c);for(l=0;l<y.length;l++){var g=y[l];f(e[g],g,l,s,e,h,d),p[g]=e[g]}if(void 0===u)return p;n.push([u,i,e]),u[i]=p}s.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===t&&o[0]===r){r=o[2],i.splice(n,1);break}}return e.call(this,t,r)}}},8298:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=s.length,c=h,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function l(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,h=p(u,c);for(r=0;r<c;++r)n(h[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},o.prototype.listenerCount=l,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),h=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[h++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return l(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return l(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return h(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return V(K(t,e.length-r),e,r,n)}function E(e,t,r,n){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function A(e,t,r,n){return V(G(t),e,r,n)}function S(e,t,r,n){return V(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(J(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),h=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==h[e]){o=c[e],s=h[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function T(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function z(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const q={};function j(e,t,r){q[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new q.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function $(e,t){if("number"!=typeof e)throw new q.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new q.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,h=-7,f=r?i-1:0,d=r?-1:1,l=e[t+f];for(f+=d,o=l&(1<<-h)-1,l>>=-h,h+=a;h>0;o=256*o+e[t+f],f+=d,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+e[t+f],f+=d,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=c}return(l?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,f=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+l]=255&a,l+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+l]=255&s,l+=p,s/=256,c-=8);e[r+l-p]|=128*y}},9926:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=i,t.hash=o,t.exists=s,t.output=a;const u={number:r,bool:n,bytes:i,hash:o,exists:s,output:a};t.default=u},5827:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(9926),i=r(5658);class o extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){n.default.exists(this);const{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){const a=Math.min(o-this.pos,s-n);if(a!==o)r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){n.default.exists(this),n.default.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:s}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(r,0),a=0);for(let e=a;e<o;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),u=n?4:0,c=n?0:4;e.setUint32(t+u,s,n),e.setUint32(t+c,a,n)}(r,o-8,BigInt(8*this.length),s),this.process(r,0);const u=(0,i.createView)(e);this.get().forEach(((e,t)=>u.setUint32(4*t,e,s)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.SHA2=o},2972:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:s,l:a}=i(e[o],t);[r[o],n[o]]=[s,a]}return[r,n]}function s(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.fromBig=i,t.split=o,t.toBig=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0),t.add=s;const a={fromBig:i,split:o,toBig:t.toBig,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:s,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};t.default=a},2103:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=void 0;const n=r(9926),i=r(5658);class o extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),!(this.iHash instanceof i.Hash))throw new TypeError("Expected instance of class which extends utils.Hash");const o=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const s=new Uint8Array(o);s.set(r.length>this.iHash.blockLen?e.create().update(r).digest():r);for(let e=0;e<s.length;e++)s[e]^=54;this.iHash.update(s),this.oHash=e.create();for(let e=0;e<s.length;e++)s[e]^=106;this.oHash.update(s),s.fill(0)}update(e){return n.default.exists(this),this.iHash.update(e),this}digestInto(e){n.default.exists(this),n.default.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.hmac=(e,t,r)=>new o(e,t).update(r).digest(),t.hmac.create=(e,t)=>new o(e,t)},2733:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;const n=r(9926),i=r(961),o=r(5658);function s(e,t,r,s){n.default.hash(e);const a=(0,o.checkOpts)({dkLen:32,asyncTick:10},s),{c:u,dkLen:c,asyncTick:h}=a;if(n.default.number(u),n.default.number(c),n.default.number(h),u<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const f=(0,o.toBytes)(t),d=(0,o.toBytes)(r),l=new Uint8Array(c),p=i.hmac.create(e,f),y=p._cloneInto().update(d);return{c:u,dkLen:c,asyncTick:h,DK:l,PRF:p,PRFSalt:y}}function a(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}t.pbkdf2=function(e,t,r,n){const{c:i,dkLen:u,DK:c,PRF:h,PRFSalt:f}=s(e,t,r,n);let d;const l=new Uint8Array(4),p=(0,o.createView)(l),y=new Uint8Array(h.outputLen);for(let e=1,t=0;t<u;e++,t+=h.outputLen){const r=c.subarray(t,t+h.outputLen);p.setInt32(0,e,!1),(d=f._cloneInto(d)).update(l).digestInto(y),r.set(y.subarray(0,r.length));for(let e=1;e<i;e++){h._cloneInto(d).update(y).digestInto(y);for(let e=0;e<r.length;e++)r[e]^=y[e]}}return a(h,f,c,d,y)},t.pbkdf2Async=async function(e,t,r,n){const{c:i,dkLen:u,asyncTick:c,DK:h,PRF:f,PRFSalt:d}=s(e,t,r,n);let l;const p=new Uint8Array(4),y=(0,o.createView)(p),g=new Uint8Array(f.outputLen);for(let e=1,t=0;t<u;e++,t+=f.outputLen){const r=h.subarray(t,t+f.outputLen);y.setInt32(0,e,!1),(l=d._cloneInto(l)).update(p).digestInto(g),r.set(g.subarray(0,r.length)),await(0,o.asyncLoop)(i-1,c,(e=>{f._cloneInto(l).update(g).digestInto(g);for(let e=0;e<r.length;e++)r[e]^=g[e]}))}return a(f,d,h,l,g)}},8435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(5827),i=r(5658),o=(e,t,r)=>e&t^e&r^t&r,s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class c extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=o+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:a,D:c,E:h,F:f,G:d,H:l}=this;for(let e=0;e<64;e++){const t=l+((0,i.rotr)(h,6)^(0,i.rotr)(h,11)^(0,i.rotr)(h,25))+((p=h)&f^~p&d)+s[e]+u[e]|0,y=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,a)|0;l=d,d=f,f=h,h=c+t|0,c=a,a=n,n=r,r=t+y|0}var p;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,c=c+this.D|0,h=h+this.E|0,f=f+this.F|0,d=d+this.G|0,l=l+this.H|0,this.set(r,n,a,c,h,f,d,l)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,i.wrapConstructor)((()=>new c))},6398:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512=t.SHA512=void 0;const n=r(5827),i=r(2972),o=r(5658),[s,a]=i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))),u=new Uint32Array(80),c=new Uint32Array(80);class h extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:u,El:c,Fh:h,Fl:f,Gh:d,Gl:l,Hh:p,Hl:y}=this;return[e,t,r,n,i,o,s,a,u,c,h,f,d,l,p,y]}set(e,t,r,n,i,o,s,a,u,c,h,f,d,l,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|u,this.El=0|c,this.Fh=0|h,this.Fl=0|f,this.Gh=0|d,this.Gl=0|l,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t),c[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|u[e-15],r=0|c[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),o=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),s=0|u[e-2],a=0|c[e-2],h=i.default.rotrSH(s,a,19)^i.default.rotrBH(s,a,61)^i.default.shrSH(s,a,6),f=i.default.rotrSL(s,a,19)^i.default.rotrBL(s,a,61)^i.default.shrSL(s,a,6),d=i.default.add4L(o,f,c[e-7],c[e-16]),l=i.default.add4H(d,n,h,u[e-7],u[e-16]);u[e]=0|l,c[e]=0|d}let{Ah:r,Al:n,Bh:o,Bl:h,Ch:f,Cl:d,Dh:l,Dl:p,Eh:y,El:g,Fh:b,Fl:m,Gh:v,Gl:w,Hh:_,Hl:E}=this;for(let e=0;e<80;e++){const t=i.default.rotrSH(y,g,14)^i.default.rotrSH(y,g,18)^i.default.rotrBH(y,g,41),A=i.default.rotrSL(y,g,14)^i.default.rotrSL(y,g,18)^i.default.rotrBL(y,g,41),S=y&b^~y&v,M=g&m^~g&w,x=i.default.add5L(E,A,M,a[e],c[e]),k=i.default.add5H(x,_,t,S,s[e],u[e]),I=0|x,R=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),B=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),T=r&o^r&f^o&f,U=n&h^n&d^h&d;_=0|v,E=0|w,v=0|b,w=0|m,b=0|y,m=0|g,({h:y,l:g}=i.default.add(0|l,0|p,0|k,0|I)),l=0|f,p=0|d,f=0|o,d=0|h,o=0|r,h=0|n;const O=i.default.add3L(I,B,U);r=i.default.add3H(O,k,R,T),n=0|O}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:h}=i.default.add(0|this.Bh,0|this.Bl,0|o,0|h)),({h:f,l:d}=i.default.add(0|this.Ch,0|this.Cl,0|f,0|d)),({h:l,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|l,0|p)),({h:y,l:g}=i.default.add(0|this.Eh,0|this.El,0|y,0|g)),({h:b,l:m}=i.default.add(0|this.Fh,0|this.Fl,0|b,0|m)),({h:v,l:w}=i.default.add(0|this.Gh,0|this.Gl,0|v,0|w)),({h:_,l:E}=i.default.add(0|this.Hh,0|this.Hl,0|_,0|E)),this.set(r,n,o,h,f,d,l,p,y,g,b,m,v,w,_,E)}roundClean(){u.fill(0),c.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=h;class f extends h{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class d extends h{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,o.wrapConstructor)((()=>new h)),t.sha512_256=(0,o.wrapConstructor)((()=>new f)),t.sha384=(0,o.wrapConstructor)((()=>new d))},5658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(2103);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function o(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=o(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t},t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=o,t.toBytes=s,t.concatBytes=function(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},1171:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function n(...e){const t=(e,t)=>r=>e(t(r));return{encode:Array.from(e).reverse().reduce(((e,r)=>e?t(e,r.encode):r.encode),void 0),decode:e.reduce(((e,r)=>e?t(e,r.decode):r.decode),void 0)}}function i(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(r(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const r=e.indexOf(t);if(-1===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}}function o(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function s(e,t="="){if(r(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let n=r.length;if(n*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if(!((n-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function a(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function u(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const o=[],s=Array.from(e);for(s.forEach((e=>{if(r(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,r=!0;for(let o=i;o<s.length;o++){const a=s[o],u=t*e+a;if(!Number.isSafeInteger(u)||t*e/t!==e||u-a!=t*e)throw new Error("convertRadix: carry overflow");if(e=u%n,s[o]=Math.floor(u/n),!Number.isSafeInteger(s[o])||s[o]*n+e!==u)throw new Error("convertRadix: carry overflow");r&&(s[o]?r=!1:i=o)}if(o.push(e),r)break}for(let t=0;t<e.length-1&&0===e[t];t++)o.push(0);return o.reverse()}Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64url=t.base64=t.base32crockford=t.base32hex=t.base32=t.base16=t.utils=t.assertNumber=void 0,t.assertNumber=r;const c=(e,t)=>t?c(t,e%t):e,h=(e,t)=>e+(t-c(e,t));function f(e,t,n,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(h(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${h(t,n)}`);let o=0,s=0;const a=2**n-1,u=[];for(const i of e){if(r(i),i>=2**t)throw new Error(`convertRadix2: invalid data word=${i} from=${t}`);if(o=o<<t|i,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=n;s-=n)u.push((o>>s-n&a)>>>0);o&=2**s-1}if(o=o<<n-s&a,!i&&s>=t)throw new Error("Excess padding");if(!i&&o)throw new Error(`Non-zero padding: ${o}`);return i&&s>0&&u.push(o>>>0),u}function d(e){return r(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return u(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(u(t,e,256))}}}function l(e,t=!1){if(r(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(h(8,e)>32||h(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return f(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(f(r,e,8,t))}}}function p(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch(e){}}}function y(e,t){if(r(e),"function"!=typeof t)throw new Error("checksum fn should be function");return{encode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const n=t(r).slice(0,e),i=new Uint8Array(r.length+e);return i.set(r),i.set(n,r.length),i},decode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const n=r.slice(0,-e),i=t(n).slice(0,e),o=r.slice(-e);for(let t=0;t<e;t++)if(i[t]!==o[t])throw new Error("Invalid checksum");return n}}}t.utils={alphabet:i,chain:n,checksum:y,radix:d,radix2:l,join:o,padding:s},t.base16=n(l(4),i("0123456789ABCDEF"),o("")),t.base32=n(l(5),i("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),s(5),o("")),t.base32hex=n(l(5),i("0123456789ABCDEFGHIJKLMNOPQRSTUV"),s(5),o("")),t.base32crockford=n(l(5),i("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),o(""),a((e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),t.base64=n(l(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s(6),o("")),t.base64url=n(l(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(6),o(""));const g=e=>n(d(58),i(e),o(""));t.base58=g("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=g("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=g("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const b=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(e){let r="";for(let n=0;n<e.length;n+=8){const i=e.subarray(n,n+8);r+=t.base58.encode(i).padStart(b[i.length],"1")}return r},decode(e){let r=[];for(let n=0;n<e.length;n+=11){const i=e.slice(n,n+11),o=b.indexOf(i.length),s=t.base58.decode(i);for(let e=0;e<s.length-o;e++)if(0!==s[e])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(r)}},t.base58check=e=>n(y(4,(t=>e(e(t)))),t.base58);const m=n(i("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),v=[996825010,642813549,513874426,1027748829,705979059];function w(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<v.length;e++)1==(t>>e&1)&&(r^=v[e]);return r}function _(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=w(i)^r>>5}i=w(i);for(let t=0;t<n;t++)i=w(i)^31&e.charCodeAt(t);for(let e of t)i=w(i)^e;for(let e=0;e<6;e++)i=w(i);return i^=r,m.encode(f([i%2**30],30,5,!1))}function E(e){const t="bech32"===e?1:734539939,r=l(5),n=r.decode,i=r.encode,o=p(n);function s(e,r=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==r&&e.length>r)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${r})`);const n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=(e=n).lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const o=e.slice(0,i),s=e.slice(i+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const a=m.decode(s).slice(0,-6),u=_(o,a,t);if(!s.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected "${u}"`);return{prefix:o,words:a}}return{encode:function(e,r,n=90){if("string"!=typeof e)throw new Error("bech32.encode prefix should be string, not "+typeof e);if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof r);const i=e.length+7+r.length;if(!1!==n&&i>n)throw new TypeError(`Length ${i} exceeds limit ${n}`);return`${e=e.toLowerCase()}1${m.encode(r)}${_(e,r,t)}`},decode:s,decodeToBytes:function(e){const{prefix:t,words:r}=s(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:p(s),fromWords:n,fromWordsUnsafe:o,toWords:i}}t.bech32=E("bech32"),t.bech32m=E("bech32m"),t.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},t.hex=n(l(4),i("0123456789abcdef"),o(""),a((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const A={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},S=`Invalid encoding type. Available types: ${Object.keys(A).join(", ")}`;t.bytesToString=(e,t)=>{if("string"!=typeof e||!A.hasOwnProperty(e))throw new TypeError(S);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return A[e].encode(t)},t.str=t.bytesToString,t.stringToBytes=(e,t)=>{if(!A.hasOwnProperty(e))throw new TypeError(S);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return A[e].decode(t)},t.bytes=t.stringToBytes},7184:(e,t,r)=>{"use strict";t.Z1=void 0;r(9926);const n=r(2733),i=(r(8435),r(6398));r(5658),r(1171);function o(e){if("string"!=typeof e)throw new TypeError("Invalid mnemonic type: "+typeof e);return e.normalize("NFKD")}function s(e){const t=o(e),r=t.split(" ");if(![12,15,18,21,24].includes(r.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:r}}t.Z1=function(e,t=""){return(0,n.pbkdf2)(i.sha512,s(e).nfkd,(e=>o(`mnemonic${e}`))(t),{c:2048,dkLen:64})}},7788:(e,t,r)=>{e.exports=r(2350)},4744:(e,t,r)=>{"use strict";var n=r(7217),i=r(6559),o=r(2646),s=r(7654),a=r(2774),u=r(9635),c=r(2654),h=r(8783),f=r(2699),d=r(6924),l=r(9251);e.exports=function(e){return new Promise((function(t,r){var p,y=e.data,g=e.headers,b=e.responseType;function m(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}n.isFormData(y)&&n.isStandardBrowserEnv()&&delete g["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";g.Authorization="Basic "+btoa(w+":"+_)}var E=a(e.baseURL,e.url);function A(){if(v){var n="getAllResponseHeaders"in v?u(v.getAllResponseHeaders()):null,o={data:b&&"text"!==b&&"json"!==b?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function(e){t(e),m()}),(function(e){r(e),m()}),o),v=null}}if(v.open(e.method.toUpperCase(),s(E,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=A:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(A)},v.onabort=function(){v&&(r(new f("Request aborted",f.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new f("Network Error",f.ERR_NETWORK,e,v,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||h;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new f(t,n.clarifyTimeoutError?f.ETIMEDOUT:f.ECONNABORTED,e,v)),v=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||c(E))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;S&&(g[e.xsrfHeaderName]=S)}"setRequestHeader"in v&&n.forEach(g,(function(e,t){void 0===y&&"content-type"===t.toLowerCase()?delete g[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),b&&"json"!==b&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){v&&(r(!e||e&&e.type?new d:e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),y||(y=null);var M=l(E);M&&-1===["http","https","file"].indexOf(M)?r(new f("Unsupported protocol "+M+":",f.ERR_BAD_REQUEST,e)):v.send(y)}))}},2350:(e,t,r)=>{"use strict";var n=r(7217),i=r(4046),o=r(8326),s=r(6044),a=function e(t){var r=new o(t),a=i(o.prototype.request,r);return n.extend(a,o.prototype,r),n.extend(a,r),a.create=function(r){return e(s(t,r))},a}(r(7741));a.Axios=o,a.CanceledError=r(6924),a.CancelToken=r(6829),a.isCancel=r(5700),a.VERSION=r(3542).version,a.toFormData=r(6289),a.AxiosError=r(2699),a.Cancel=a.CanceledError,a.all=function(e){return Promise.all(e)},a.spread=r(6728),a.isAxiosError=r(8667),e.exports=a,e.exports.default=a},6829:(e,t,r)=>{"use strict";var n=r(6924);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6924:(e,t,r)=>{"use strict";var n=r(2699);function i(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}r(7217).inherits(i,n,{__CANCEL__:!0}),e.exports=i},5700:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},8326:(e,t,r)=>{"use strict";var n=r(7217),i=r(7654),o=r(8874),s=r(4674),a=r(6044),u=r(2774),c=r(4671),h=c.validators;function f(e){this.defaults=e,this.interceptors={request:new o,response:new o}}f.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:h.transitional(h.boolean),forcedJSONParsing:h.transitional(h.boolean),clarifyTimeoutError:h.transitional(h.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)})),!i){var f=[s,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(u),o=Promise.resolve(t);f.length;)o=o.then(f.shift(),f.shift());return o}for(var d=t;n.length;){var l=n.shift(),p=n.shift();try{d=l(d)}catch(e){p(e);break}}try{o=s(d)}catch(e){return Promise.reject(e)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},f.prototype.getUri=function(e){e=a(this.defaults,e);var t=u(e.baseURL,e.url);return i(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(a(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}f.prototype[e]=t(),f.prototype[e+"Form"]=t(!0)})),e.exports=f},2699:(e,t,r)=>{"use strict";var n=r(7217);function i(e,t,r,n,i){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}n.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){s[e]={value:e}})),Object.defineProperties(i,s),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(e,t,r,s,a,u){var c=Object.create(o);return n.toFlatObject(e,c,(function(e){return e!==Error.prototype})),i.call(c,e.message,t,r,s,a),c.name=e.name,u&&Object.assign(c,u),c},e.exports=i},8874:(e,t,r)=>{"use strict";var n=r(7217);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},2774:(e,t,r)=>{"use strict";var n=r(5731),i=r(8451);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},4674:(e,t,r)=>{"use strict";var n=r(7217),i=r(2345),o=r(5700),s=r(7741),a=r(6924);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},6044:(e,t,r)=>{"use strict";var n=r(7217);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function s(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function u(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,i=t(e);n.isUndefined(i)&&t!==u||(r[e]=i)})),r}},6559:(e,t,r)=>{"use strict";var n=r(2699);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}},2345:(e,t,r)=>{"use strict";var n=r(7217),i=r(7741);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},7741:(e,t,r)=>{"use strict";var n=r(7217),i=r(7620),o=r(2699),s=r(8783),a=r(6289),u={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var h,f={transitional:s,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(h=r(4744)),h),transformRequest:[function(e,t){if(i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e))return e;if(n.isArrayBufferView(e))return e.buffer;if(n.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,o=n.isObject(e),s=t&&t["Content-Type"];if((r=n.isFileList(e))||o&&"multipart/form-data"===s){var u=this.env&&this.env.FormData;return a(r?{"files[]":e}:e,u&&new u)}return o||"application/json"===s?(c(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||f.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:r(4912)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){f.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){f.headers[e]=n.merge(u)})),e.exports=f},8783:e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},3542:e=>{e.exports={version:"0.27.2"}},4046:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},7654:(e,t,r)=>{"use strict";var n=r(7217);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},8451:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},2646:(e,t,r)=>{"use strict";var n=r(7217);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},5731:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},8667:(e,t,r)=>{"use strict";var n=r(7217);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},2654:(e,t,r)=>{"use strict";var n=r(7217);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},7620:(e,t,r)=>{"use strict";var n=r(7217);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},4912:e=>{e.exports=null},9635:(e,t,r)=>{"use strict";var n=r(7217),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},9251:e=>{"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},6728:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},6289:(e,t,r)=>{"use strict";var n=r(8764).Buffer,i=r(7217);e.exports=function(e,t){t=t||new FormData;var r=[];function o(e){return null===e?"":i.isDate(e)?e.toISOString():i.isArrayBuffer(e)||i.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):n.from(e):e}return function e(n,s){if(i.isPlainObject(n)||i.isArray(n)){if(-1!==r.indexOf(n))throw Error("Circular reference detected in "+s);r.push(n),i.forEach(n,(function(r,n){if(!i.isUndefined(r)){var a,u=s?s+"."+n:n;if(r&&!s&&"object"==typeof r)if(i.endsWith(n,"{}"))r=JSON.stringify(r);else if(i.endsWith(n,"[]")&&(a=i.toArray(r)))return void a.forEach((function(e){!i.isUndefined(e)&&t.append(u,o(e))}));e(r,u)}})),r.pop()}else t.append(s,o(n))}(e),t}},4671:(e,t,r)=>{"use strict";var n=r(3542).version,i=r(2699),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var s={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,a){if(!1===e)throw new i(o(n," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,a)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var s=n[o],a=t[s];if(a){var u=e[s],c=void 0===u||a(u,s,e);if(!0!==c)throw new i("option "+s+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i("Unknown option "+s,i.ERR_BAD_OPTION)}},validators:o}},7217:(e,t,r)=>{"use strict";var n,i=r(4046),o=Object.prototype.toString,s=(n=Object.create(null),function(e){var t=o.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())});function a(e){return e=e.toLowerCase(),function(t){return s(t)===e}}function u(e){return Array.isArray(e)}function c(e){return void 0===e}var h=a("ArrayBuffer");function f(e){return null!==e&&"object"==typeof e}function d(e){if("object"!==s(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var l=a("Date"),p=a("File"),y=a("Blob"),g=a("FileList");function b(e){return"[object Function]"===o.call(e)}var m=a("URLSearchParams");function v(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var w,_=(w="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return w&&e instanceof w});e.exports={isArray:u,isArrayBuffer:h,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||o.call(e)===t||b(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:f,isPlainObject:d,isUndefined:c,isDate:l,isFile:p,isBlob:y,isFunction:b,isStream:function(e){return f(e)&&b(e.pipe)},isURLSearchParams:m,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:v,merge:function e(){var t={};function r(r,n){d(t[n])&&d(r)?t[n]=e(t[n],r):d(r)?t[n]=e({},r):u(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)v(arguments[n],r);return t},extend:function(e,t,r){return v(t,(function(t,n){e[n]=r&&"function"==typeof t?i(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var n,i,o,s={};t=t||{};do{for(i=(n=Object.getOwnPropertyNames(e)).length;i-- >0;)s[o=n[i]]||(t[o]=e[o],s[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(c(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:_,isFileList:g}},9881:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},5857:(e,t,r)=>{var n;!function(){"use strict";var i="input is invalid type",o="object"==typeof window,s=o?window:{};s.JS_SHA3_NO_WINDOW&&(o=!1);var a=!o&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?s=r.g:a&&(s=self);var u=!s.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,h=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),d=[4,1024,262144,67108864],l=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],y=[224,256,384,512],g=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var v=function(e,t,r){return function(n){return new C(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,i){return new C(e,t,i).update(n)[r]()}},_=function(e,t,r){return function(t,n,i,o){return x["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return x["kmac"+e].update(t,n,i,o)[r]()}},A=function(e,t,r,n){for(var i=0;i<b.length;++i){var o=b[i];e[o]=t(r,n,o)}return e},S=function(e,t){var r=v(e,t,"hex");return r.create=function(){return new C(e,t,e)},r.update=function(e){return r.create().update(e)},A(r,v,e,t)},M=[{name:"keccak",padding:[1,256,65536,16777216],bits:y,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:y,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var r=w(e,t,"hex");return r.create=function(r){return new C(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},A(r,w,e,t)}},{name:"cshake",padding:d,bits:g,createMethod:function(e,t){var r=m[e],n=_(e,0,"hex");return n.create=function(n,i,o){return i||o?new C(e,t,n).bytepad([i,o],r):x["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},A(n,_,e,t)}},{name:"kmac",padding:d,bits:g,createMethod:function(e,t){var r=m[e],n=E(e,0,"hex");return n.create=function(n,i,o){return new P(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},A(n,E,e,t)}}],x={},k=[],I=0;I<M.length;++I)for(var R=M[I],B=R.bits,T=0;T<B.length;++T){var U=R.name+"_"+B[T];if(k.push(U),x[U]=R.createMethod(B[T],R.padding),"sha3"!==R.name){var O=R.name+B[T];k.push(O),x[O]=x[U]}}function C(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function P(e,t,r){C.call(this,e,t,r)}C.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,s=this.blocks,a=this.byteCount,u=e.length,c=this.blockCount,f=0,d=this.s;f<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<c+1;++n)s[n]=0;if(t)for(n=this.start;f<u&&n<a;++f)s[n>>2]|=e[f]<<l[3&n++];else for(n=this.start;f<u&&n<a;++f)(o=e.charCodeAt(f))<128?s[n>>2]|=o<<l[3&n++]:o<2048?(s[n>>2]|=(192|o>>6)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]):o<55296||o>=57344?(s[n>>2]|=(224|o>>12)<<l[3&n++],s[n>>2]|=(128|o>>6&63)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++f)),s[n>>2]|=(240|o>>18)<<l[3&n++],s[n>>2]|=(128|o>>12&63)<<l[3&n++],s[n>>2]|=(128|o>>6&63)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[c],n=0;n<c;++n)d[n]^=s[n];z(d),this.reset=!0}else this.start=n}return this},C.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},C.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,o=e.length;if(t)n=o;else for(var s=0;s<e.length;++s){var a=e.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(e),n},C.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];z(n)}},C.prototype.toString=C.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<t&&s<n;++o,++s)e=r[o],a+=f[e>>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];s%t==0&&(z(r),o=0)}return i&&(e=r[o],a+=f[e>>4&15]+f[15&e],i>1&&(a+=f[e>>12&15]+f[e>>8&15]),i>2&&(a+=f[e>>20&15]+f[e>>16&15])),a},C.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s<n;){for(o=0;o<t&&s<n;++o,++s)u[s]=r[o];s%t==0&&z(r)}return i&&(u[o]=r[o],e=e.slice(0,a)),e},C.prototype.buffer=C.prototype.arrayBuffer,C.prototype.digest=C.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)e=a<<2,t=n[s],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&z(n)}return o&&(e=a<<2,t=n[s],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},P.prototype=new C,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var z=function(e){var t,r,n,i,o,s,a,u,c,h,f,d,l,y,g,b,m,v,w,_,E,A,S,M,x,k,I,R,B,T,U,O,C,P,z,L,N,q,j,D,F,$,H,W,K,G,V,J,Y,Z,X,Q,ee,te,re,ne,ie,oe,se,ae,ue,ce,he;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(l=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(h<<1|f>>>31),r=a^(f<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(d<<1|l>>>31),r=c^(l<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,y=e[0],g=e[1],G=e[11]<<4|e[10]>>>28,V=e[10]<<4|e[11]>>>28,R=e[20]<<3|e[21]>>>29,B=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,$=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,P=e[2]<<1|e[3]>>>31,z=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,U=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,he=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,N=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,C=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,q=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,D=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=y^~b&v,e[1]=g^~m&w,e[10]=M^~k&R,e[11]=x^~I&B,e[20]=P^~L&q,e[21]=z^~N&j,e[30]=W^~G&J,e[31]=K^~V&Y,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=b^~v&_,e[3]=m^~w&E,e[12]=k^~R&T,e[13]=I^~B&U,e[22]=L^~q&D,e[23]=N^~j&F,e[32]=G^~J&Z,e[33]=V^~Y&X,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=v^~_&A,e[5]=w^~E&S,e[14]=R^~T&O,e[15]=B^~U&C,e[24]=q^~D&$,e[25]=j^~F&H,e[34]=J^~Z&Q,e[35]=Y^~X&ee,e[44]=oe^~ae&ce,e[45]=se^~ue&he,e[6]=_^~A&y,e[7]=E^~S&g,e[16]=T^~O&M,e[17]=U^~C&x,e[26]=D^~$&P,e[27]=F^~H&z,e[36]=Z^~Q&W,e[37]=X^~ee&K,e[46]=ae^~ce&te,e[47]=ue^~he&re,e[8]=A^~y&b,e[9]=S^~g&m,e[18]=O^~M&k,e[19]=C^~x&I,e[28]=$^~P&L,e[29]=H^~z&N,e[38]=Q^~W&G,e[39]=ee^~K&V,e[48]=ce^~te&ne,e[49]=he^~re&ie,e[0]^=p[n],e[1]^=p[n+1]};if(u)e.exports=x;else{for(I=0;I<k.length;++I)s[k[I]]=x[k[I]];c&&(void 0===(n=function(){return x}.call(t,r,t,e))||(e.exports=n))}}()},6254:(e,t,r)=>{!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),a=t([1]),u=t([56129,1]),c=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),l=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function y(e,t,r,n,i){var o,s=0;for(o=0;o<i;o++)s|=e[t+o]^r[n+o];return(1&s-1>>>8)-1}function g(e,t,r,n){return y(e,t,r,n,16)}function b(e,t,r,n){return y(e,t,r,n,32)}function m(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=o,E=s,A=a,S=u,M=c,x=h,k=f,I=d,R=l,B=p,T=y,U=g,O=b,C=m,P=v,z=w,L=0;L<20;L+=2)_^=(i=(O^=(i=(R^=(i=(M^=(i=_+O|0)<<7|i>>>25)+_|0)<<9|i>>>23)+M|0)<<13|i>>>19)+R|0)<<18|i>>>14,x^=(i=(E^=(i=(C^=(i=(B^=(i=x+E|0)<<7|i>>>25)+x|0)<<9|i>>>23)+B|0)<<13|i>>>19)+C|0)<<18|i>>>14,T^=(i=(k^=(i=(A^=(i=(P^=(i=T+k|0)<<7|i>>>25)+T|0)<<9|i>>>23)+P|0)<<13|i>>>19)+A|0)<<18|i>>>14,z^=(i=(U^=(i=(I^=(i=(S^=(i=z+U|0)<<7|i>>>25)+z|0)<<9|i>>>23)+S|0)<<13|i>>>19)+I|0)<<18|i>>>14,_^=(i=(S^=(i=(A^=(i=(E^=(i=_+S|0)<<7|i>>>25)+_|0)<<9|i>>>23)+E|0)<<13|i>>>19)+A|0)<<18|i>>>14,x^=(i=(M^=(i=(I^=(i=(k^=(i=x+M|0)<<7|i>>>25)+x|0)<<9|i>>>23)+k|0)<<13|i>>>19)+I|0)<<18|i>>>14,T^=(i=(B^=(i=(R^=(i=(U^=(i=T+B|0)<<7|i>>>25)+T|0)<<9|i>>>23)+U|0)<<13|i>>>19)+R|0)<<18|i>>>14,z^=(i=(P^=(i=(C^=(i=(O^=(i=z+P|0)<<7|i>>>25)+z|0)<<9|i>>>23)+O|0)<<13|i>>>19)+C|0)<<18|i>>>14;_=_+o|0,E=E+s|0,A=A+a|0,S=S+u|0,M=M+c|0,x=x+h|0,k=k+f|0,I=I+d|0,R=R+l|0,B=B+p|0,T=T+y|0,U=U+g|0,O=O+b|0,C=C+m|0,P=P+v|0,z=z+w|0,e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=M>>>0&255,e[17]=M>>>8&255,e[18]=M>>>16&255,e[19]=M>>>24&255,e[20]=x>>>0&255,e[21]=x>>>8&255,e[22]=x>>>16&255,e[23]=x>>>24&255,e[24]=k>>>0&255,e[25]=k>>>8&255,e[26]=k>>>16&255,e[27]=k>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=R>>>0&255,e[33]=R>>>8&255,e[34]=R>>>16&255,e[35]=R>>>24&255,e[36]=B>>>0&255,e[37]=B>>>8&255,e[38]=B>>>16&255,e[39]=B>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=U>>>0&255,e[45]=U>>>8&255,e[46]=U>>>16&255,e[47]=U>>>24&255,e[48]=O>>>0&255,e[49]=O>>>8&255,e[50]=O>>>16&255,e[51]=O>>>24&255,e[52]=C>>>0&255,e[53]=C>>>8&255,e[54]=C>>>16&255,e[55]=C>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,n)}function v(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=0;_<20;_+=2)o^=(i=(b^=(i=(l^=(i=(c^=(i=o+b|0)<<7|i>>>25)+o|0)<<9|i>>>23)+c|0)<<13|i>>>19)+l|0)<<18|i>>>14,h^=(i=(s^=(i=(m^=(i=(p^=(i=h+s|0)<<7|i>>>25)+h|0)<<9|i>>>23)+p|0)<<13|i>>>19)+m|0)<<18|i>>>14,y^=(i=(f^=(i=(a^=(i=(v^=(i=y+f|0)<<7|i>>>25)+y|0)<<9|i>>>23)+v|0)<<13|i>>>19)+a|0)<<18|i>>>14,w^=(i=(g^=(i=(d^=(i=(u^=(i=w+g|0)<<7|i>>>25)+w|0)<<9|i>>>23)+u|0)<<13|i>>>19)+d|0)<<18|i>>>14,o^=(i=(u^=(i=(a^=(i=(s^=(i=o+u|0)<<7|i>>>25)+o|0)<<9|i>>>23)+s|0)<<13|i>>>19)+a|0)<<18|i>>>14,h^=(i=(c^=(i=(d^=(i=(f^=(i=h+c|0)<<7|i>>>25)+h|0)<<9|i>>>23)+f|0)<<13|i>>>19)+d|0)<<18|i>>>14,y^=(i=(p^=(i=(l^=(i=(g^=(i=y+p|0)<<7|i>>>25)+y|0)<<9|i>>>23)+g|0)<<13|i>>>19)+l|0)<<18|i>>>14,w^=(i=(v^=(i=(m^=(i=(b^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+b|0)<<13|i>>>19)+m|0)<<18|i>>>14;e[0]=o>>>0&255,e[1]=o>>>8&255,e[2]=o>>>16&255,e[3]=o>>>24&255,e[4]=h>>>0&255,e[5]=h>>>8&255,e[6]=h>>>16&255,e[7]=h>>>24&255,e[8]=y>>>0&255,e[9]=y>>>8&255,e[10]=y>>>16&255,e[11]=y>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=f>>>0&255,e[17]=f>>>8&255,e[18]=f>>>16&255,e[19]=f>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(e,t,r,n,i,o,s){var a,u,c=new Uint8Array(16),h=new Uint8Array(64);for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=o[u];for(;i>=64;){for(m(h,c,s,w),u=0;u<64;u++)e[t+u]=r[n+u]^h[u];for(a=1,u=8;u<16;u++)a=a+(255&c[u])|0,c[u]=255&a,a>>>=8;i-=64,t+=64,n+=64}if(i>0)for(m(h,c,s,w),u=0;u<i;u++)e[t+u]=r[n+u]^h[u];return 0}function E(e,t,r,n,i){var o,s,a=new Uint8Array(16),u=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=n[s];for(;r>=64;){for(m(u,a,i,w),s=0;s<64;s++)e[t+s]=u[s];for(o=1,s=8;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,t+=64}if(r>0)for(m(u,a,i,w),s=0;s<r;s++)e[t+s]=u[s];return 0}function A(e,t,r,n,i){var o=new Uint8Array(32);v(o,n,i,w);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=n[a+16];return E(e,t,r,s,o)}function S(e,t,r,n,i,o,s){var a=new Uint8Array(32);v(a,o,s,w);for(var u=new Uint8Array(8),c=0;c<8;c++)u[c]=o[c+16];return _(e,t,r,n,i,u,a)}var M=function(e){var t,r,n,i,o,s,a,u;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,s=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(o>>>14|s<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(s>>>11|a<<5),u=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function x(e,t,r,n,i,o){var s=new M(o);return s.update(r,n,i),s.finish(e,t),0}function k(e,t,r,n,i,o){var s=new Uint8Array(16);return x(s,0,r,n,i,o),g(e,t,s,0)}function I(e,t,r,n,i){var o;if(r<32)return-1;for(S(e,0,t,0,r,n,i),x(e,16,e,32,r-32,e),o=0;o<16;o++)e[o]=0;return 0}function R(e,t,r,n,i){var o,s=new Uint8Array(32);if(r<32)return-1;if(A(s,0,32,n,i),0!==k(t,16,t,32,r-32,s))return-1;for(S(e,0,t,0,r,n,i),o=0;o<32;o++)e[o]=0;return 0}function B(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function T(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function U(e,t,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function O(e,r){var n,i,o,s=t(),a=t();for(n=0;n<16;n++)a[n]=r[n];for(T(a),T(a),T(a),i=0;i<2;i++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,U(a,s,1-o)}for(n=0;n<16;n++)e[2*n]=255&a[n],e[2*n+1]=a[n]>>8}function C(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return O(r,e),O(n,t),b(r,0,n,0)}function P(e){var t=new Uint8Array(32);return O(t,e),1&t[0]}function z(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function L(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function N(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function q(e,t,r){var n,i,o=0,s=0,a=0,u=0,c=0,h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,v=0,w=0,_=0,E=0,A=0,S=0,M=0,x=0,k=0,I=0,R=0,B=0,T=0,U=0,O=0,C=0,P=0,z=r[0],L=r[1],N=r[2],q=r[3],j=r[4],D=r[5],F=r[6],$=r[7],H=r[8],W=r[9],K=r[10],G=r[11],V=r[12],J=r[13],Y=r[14],Z=r[15];o+=(n=t[0])*z,s+=n*L,a+=n*N,u+=n*q,c+=n*j,h+=n*D,f+=n*F,d+=n*$,l+=n*H,p+=n*W,y+=n*K,g+=n*G,b+=n*V,m+=n*J,v+=n*Y,w+=n*Z,s+=(n=t[1])*z,a+=n*L,u+=n*N,c+=n*q,h+=n*j,f+=n*D,d+=n*F,l+=n*$,p+=n*H,y+=n*W,g+=n*K,b+=n*G,m+=n*V,v+=n*J,w+=n*Y,_+=n*Z,a+=(n=t[2])*z,u+=n*L,c+=n*N,h+=n*q,f+=n*j,d+=n*D,l+=n*F,p+=n*$,y+=n*H,g+=n*W,b+=n*K,m+=n*G,v+=n*V,w+=n*J,_+=n*Y,E+=n*Z,u+=(n=t[3])*z,c+=n*L,h+=n*N,f+=n*q,d+=n*j,l+=n*D,p+=n*F,y+=n*$,g+=n*H,b+=n*W,m+=n*K,v+=n*G,w+=n*V,_+=n*J,E+=n*Y,A+=n*Z,c+=(n=t[4])*z,h+=n*L,f+=n*N,d+=n*q,l+=n*j,p+=n*D,y+=n*F,g+=n*$,b+=n*H,m+=n*W,v+=n*K,w+=n*G,_+=n*V,E+=n*J,A+=n*Y,S+=n*Z,h+=(n=t[5])*z,f+=n*L,d+=n*N,l+=n*q,p+=n*j,y+=n*D,g+=n*F,b+=n*$,m+=n*H,v+=n*W,w+=n*K,_+=n*G,E+=n*V,A+=n*J,S+=n*Y,M+=n*Z,f+=(n=t[6])*z,d+=n*L,l+=n*N,p+=n*q,y+=n*j,g+=n*D,b+=n*F,m+=n*$,v+=n*H,w+=n*W,_+=n*K,E+=n*G,A+=n*V,S+=n*J,M+=n*Y,x+=n*Z,d+=(n=t[7])*z,l+=n*L,p+=n*N,y+=n*q,g+=n*j,b+=n*D,m+=n*F,v+=n*$,w+=n*H,_+=n*W,E+=n*K,A+=n*G,S+=n*V,M+=n*J,x+=n*Y,k+=n*Z,l+=(n=t[8])*z,p+=n*L,y+=n*N,g+=n*q,b+=n*j,m+=n*D,v+=n*F,w+=n*$,_+=n*H,E+=n*W,A+=n*K,S+=n*G,M+=n*V,x+=n*J,k+=n*Y,I+=n*Z,p+=(n=t[9])*z,y+=n*L,g+=n*N,b+=n*q,m+=n*j,v+=n*D,w+=n*F,_+=n*$,E+=n*H,A+=n*W,S+=n*K,M+=n*G,x+=n*V,k+=n*J,I+=n*Y,R+=n*Z,y+=(n=t[10])*z,g+=n*L,b+=n*N,m+=n*q,v+=n*j,w+=n*D,_+=n*F,E+=n*$,A+=n*H,S+=n*W,M+=n*K,x+=n*G,k+=n*V,I+=n*J,R+=n*Y,B+=n*Z,g+=(n=t[11])*z,b+=n*L,m+=n*N,v+=n*q,w+=n*j,_+=n*D,E+=n*F,A+=n*$,S+=n*H,M+=n*W,x+=n*K,k+=n*G,I+=n*V,R+=n*J,B+=n*Y,T+=n*Z,b+=(n=t[12])*z,m+=n*L,v+=n*N,w+=n*q,_+=n*j,E+=n*D,A+=n*F,S+=n*$,M+=n*H,x+=n*W,k+=n*K,I+=n*G,R+=n*V,B+=n*J,T+=n*Y,U+=n*Z,m+=(n=t[13])*z,v+=n*L,w+=n*N,_+=n*q,E+=n*j,A+=n*D,S+=n*F,M+=n*$,x+=n*H,k+=n*W,I+=n*K,R+=n*G,B+=n*V,T+=n*J,U+=n*Y,O+=n*Z,v+=(n=t[14])*z,w+=n*L,_+=n*N,E+=n*q,A+=n*j,S+=n*D,M+=n*F,x+=n*$,k+=n*H,I+=n*W,R+=n*K,B+=n*G,T+=n*V,U+=n*J,O+=n*Y,C+=n*Z,w+=(n=t[15])*z,s+=38*(E+=n*N),a+=38*(A+=n*q),u+=38*(S+=n*j),c+=38*(M+=n*D),h+=38*(x+=n*F),f+=38*(k+=n*$),d+=38*(I+=n*H),l+=38*(R+=n*W),p+=38*(B+=n*K),y+=38*(T+=n*G),g+=38*(U+=n*V),b+=38*(O+=n*J),m+=38*(C+=n*Y),v+=38*(P+=n*Z),o=(n=(o+=38*(_+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=u,e[4]=c,e[5]=h,e[6]=f,e[7]=d,e[8]=l,e[9]=p,e[10]=y,e[11]=g,e[12]=b,e[13]=m,e[14]=v,e[15]=w}function j(e,t){q(e,t,t)}function D(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)j(i,i),2!==n&&4!==n&&q(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function F(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)j(i,i),1!==n&&q(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function $(e,r,n){var i,o,s=new Uint8Array(32),a=new Float64Array(80),c=t(),h=t(),f=t(),d=t(),l=t(),p=t();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,z(a,n),o=0;o<16;o++)h[o]=a[o],d[o]=c[o]=f[o]=0;for(c[0]=d[0]=1,o=254;o>=0;--o)U(c,h,i=s[o>>>3]>>>(7&o)&1),U(f,d,i),L(l,c,f),N(c,c,f),L(f,h,d),N(h,h,d),j(d,l),j(p,c),q(c,f,c),q(f,h,l),L(l,c,f),N(c,c,f),j(h,c),N(f,d,p),q(c,f,u),L(c,c,d),q(f,f,c),q(c,d,p),q(d,h,a),j(h,l),U(c,h,i),U(f,d,i);for(o=0;o<16;o++)a[o+16]=c[o],a[o+32]=f[o],a[o+48]=h[o],a[o+64]=d[o];var y=a.subarray(32),g=a.subarray(16);return D(y,y),q(g,g,y),O(e,g),0}function H(e,t){return $(e,t,o)}function W(e,t){return n(t,32),H(e,t)}function K(e,t,r){var n=new Uint8Array(32);return $(n,r,t),v(e,i,n,w)}M.prototype.blocks=function(e,t,r){for(var n,i,o,s,a,u,c,h,f,d,l,p,y,g,b,m,v,w,_,E=this.fin?0:2048,A=this.h[0],S=this.h[1],M=this.h[2],x=this.h[3],k=this.h[4],I=this.h[5],R=this.h[6],B=this.h[7],T=this.h[8],U=this.h[9],O=this.r[0],C=this.r[1],P=this.r[2],z=this.r[3],L=this.r[4],N=this.r[5],q=this.r[6],j=this.r[7],D=this.r[8],F=this.r[9];r>=16;)d=f=0,d+=(A+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*O,d+=(S+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*F),d+=(M+=8191&(i>>>10|(o=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*D),d+=(x+=8191&(o>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*j),f=(d+=(k+=8191&(s>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*q))>>>13,d&=8191,d+=(I+=a>>>1&8191)*(5*N),d+=(R+=8191&(a>>>14|(u=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*L),d+=(B+=8191&(u>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),d+=(T+=8191&(c>>>8|(h=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*P),l=f+=(d+=(U+=h>>>5|E)*(5*C))>>>13,l+=A*C,l+=S*O,l+=M*(5*F),l+=x*(5*D),f=(l+=k*(5*j))>>>13,l&=8191,l+=I*(5*q),l+=R*(5*N),l+=B*(5*L),l+=T*(5*z),f+=(l+=U*(5*P))>>>13,l&=8191,p=f,p+=A*P,p+=S*C,p+=M*O,p+=x*(5*F),f=(p+=k*(5*D))>>>13,p&=8191,p+=I*(5*j),p+=R*(5*q),p+=B*(5*N),p+=T*(5*L),y=f+=(p+=U*(5*z))>>>13,y+=A*z,y+=S*P,y+=M*C,y+=x*O,f=(y+=k*(5*F))>>>13,y&=8191,y+=I*(5*D),y+=R*(5*j),y+=B*(5*q),y+=T*(5*N),g=f+=(y+=U*(5*L))>>>13,g+=A*L,g+=S*z,g+=M*P,g+=x*C,f=(g+=k*O)>>>13,g&=8191,g+=I*(5*F),g+=R*(5*D),g+=B*(5*j),g+=T*(5*q),b=f+=(g+=U*(5*N))>>>13,b+=A*N,b+=S*L,b+=M*z,b+=x*P,f=(b+=k*C)>>>13,b&=8191,b+=I*O,b+=R*(5*F),b+=B*(5*D),b+=T*(5*j),m=f+=(b+=U*(5*q))>>>13,m+=A*q,m+=S*N,m+=M*L,m+=x*z,f=(m+=k*P)>>>13,m&=8191,m+=I*C,m+=R*O,m+=B*(5*F),m+=T*(5*D),v=f+=(m+=U*(5*j))>>>13,v+=A*j,v+=S*q,v+=M*N,v+=x*L,f=(v+=k*z)>>>13,v&=8191,v+=I*P,v+=R*C,v+=B*O,v+=T*(5*F),w=f+=(v+=U*(5*D))>>>13,w+=A*D,w+=S*j,w+=M*q,w+=x*N,f=(w+=k*L)>>>13,w&=8191,w+=I*z,w+=R*P,w+=B*C,w+=T*O,_=f+=(w+=U*(5*F))>>>13,_+=A*F,_+=S*D,_+=M*j,_+=x*q,f=(_+=k*N)>>>13,_&=8191,_+=I*L,_+=R*z,_+=B*P,_+=T*C,A=d=8191&(f=(f=((f+=(_+=U*O)>>>13)<<2)+f|0)+(d&=8191)|0),S=l+=f>>>=13,M=p&=8191,x=y&=8191,k=g&=8191,I=b&=8191,R=m&=8191,B=v&=8191,T=w&=8191,U=_&=8191,t+=16,r-=16;this.h[0]=A,this.h[1]=S,this.h[2]=M,this.h[3]=x,this.h[4]=k,this.h[5]=I,this.h[6]=R,this.h[7]=B,this.h[8]=T,this.h[9]=U},M.prototype.finish=function(e,t){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},M.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var G=I,V=R,J=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Y(e,t,r,n){for(var i,o,s,a,u,c,h,f,d,l,p,y,g,b,m,v,w,_,E,A,S,M,x,k,I,R,B=new Int32Array(16),T=new Int32Array(16),U=e[0],O=e[1],C=e[2],P=e[3],z=e[4],L=e[5],N=e[6],q=e[7],j=t[0],D=t[1],F=t[2],$=t[3],H=t[4],W=t[5],K=t[6],G=t[7],V=0;n>=128;){for(E=0;E<16;E++)A=8*E+V,B[E]=r[A+0]<<24|r[A+1]<<16|r[A+2]<<8|r[A+3],T[E]=r[A+4]<<24|r[A+5]<<16|r[A+6]<<8|r[A+7];for(E=0;E<80;E++)if(i=U,o=O,s=C,a=P,u=z,c=L,h=N,d=j,l=D,p=F,y=$,g=H,b=W,m=K,x=65535&(M=G),k=M>>>16,I=65535&(S=q),R=S>>>16,x+=65535&(M=(H>>>14|z<<18)^(H>>>18|z<<14)^(z>>>9|H<<23)),k+=M>>>16,I+=65535&(S=(z>>>14|H<<18)^(z>>>18|H<<14)^(H>>>9|z<<23)),R+=S>>>16,x+=65535&(M=H&W^~H&K),k+=M>>>16,I+=65535&(S=z&L^~z&N),R+=S>>>16,x+=65535&(M=J[2*E+1]),k+=M>>>16,I+=65535&(S=J[2*E]),R+=S>>>16,S=B[E%16],k+=(M=T[E%16])>>>16,I+=65535&S,R+=S>>>16,I+=(k+=(x+=65535&M)>>>16)>>>16,x=65535&(M=_=65535&x|k<<16),k=M>>>16,I=65535&(S=w=65535&I|(R+=I>>>16)<<16),R=S>>>16,x+=65535&(M=(j>>>28|U<<4)^(U>>>2|j<<30)^(U>>>7|j<<25)),k+=M>>>16,I+=65535&(S=(U>>>28|j<<4)^(j>>>2|U<<30)^(j>>>7|U<<25)),R+=S>>>16,k+=(M=j&D^j&F^D&F)>>>16,I+=65535&(S=U&O^U&C^O&C),R+=S>>>16,f=65535&(I+=(k+=(x+=65535&M)>>>16)>>>16)|(R+=I>>>16)<<16,v=65535&x|k<<16,x=65535&(M=y),k=M>>>16,I=65535&(S=a),R=S>>>16,k+=(M=_)>>>16,I+=65535&(S=w),R+=S>>>16,O=i,C=o,P=s,z=a=65535&(I+=(k+=(x+=65535&M)>>>16)>>>16)|(R+=I>>>16)<<16,L=u,N=c,q=h,U=f,D=d,F=l,$=p,H=y=65535&x|k<<16,W=g,K=b,G=m,j=v,E%16==15)for(A=0;A<16;A++)S=B[A],x=65535&(M=T[A]),k=M>>>16,I=65535&S,R=S>>>16,S=B[(A+9)%16],x+=65535&(M=T[(A+9)%16]),k+=M>>>16,I+=65535&S,R+=S>>>16,w=B[(A+1)%16],x+=65535&(M=((_=T[(A+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),k+=M>>>16,I+=65535&(S=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),R+=S>>>16,w=B[(A+14)%16],k+=(M=((_=T[(A+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,I+=65535&(S=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,B[A]=65535&I|R<<16,T[A]=65535&x|k<<16;x=65535&(M=j),k=M>>>16,I=65535&(S=U),R=S>>>16,S=e[0],k+=(M=t[0])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[0]=U=65535&I|R<<16,t[0]=j=65535&x|k<<16,x=65535&(M=D),k=M>>>16,I=65535&(S=O),R=S>>>16,S=e[1],k+=(M=t[1])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[1]=O=65535&I|R<<16,t[1]=D=65535&x|k<<16,x=65535&(M=F),k=M>>>16,I=65535&(S=C),R=S>>>16,S=e[2],k+=(M=t[2])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[2]=C=65535&I|R<<16,t[2]=F=65535&x|k<<16,x=65535&(M=$),k=M>>>16,I=65535&(S=P),R=S>>>16,S=e[3],k+=(M=t[3])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[3]=P=65535&I|R<<16,t[3]=$=65535&x|k<<16,x=65535&(M=H),k=M>>>16,I=65535&(S=z),R=S>>>16,S=e[4],k+=(M=t[4])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[4]=z=65535&I|R<<16,t[4]=H=65535&x|k<<16,x=65535&(M=W),k=M>>>16,I=65535&(S=L),R=S>>>16,S=e[5],k+=(M=t[5])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[5]=L=65535&I|R<<16,t[5]=W=65535&x|k<<16,x=65535&(M=K),k=M>>>16,I=65535&(S=N),R=S>>>16,S=e[6],k+=(M=t[6])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[6]=N=65535&I|R<<16,t[6]=K=65535&x|k<<16,x=65535&(M=G),k=M>>>16,I=65535&(S=q),R=S>>>16,S=e[7],k+=(M=t[7])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[7]=q=65535&I|R<<16,t[7]=G=65535&x|k<<16,V+=128,n-=128}return n}function Z(e,t,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,Y(i,o,t,r),r%=128,n=0;n<r;n++)s[n]=t[a-r+n];for(s[r]=128,s[(r=256-128*(r<112?1:0))-9]=0,p(s,r-8,a/536870912|0,a<<3),Y(i,o,s,r),n=0;n<8;n++)p(e,8*n,i[n],o[n]);return 0}function X(e,r){var n=t(),i=t(),o=t(),s=t(),a=t(),u=t(),c=t(),f=t(),d=t();N(n,e[1],e[0]),N(d,r[1],r[0]),q(n,n,d),L(i,e[0],e[1]),L(d,r[0],r[1]),q(i,i,d),q(o,e[3],r[3]),q(o,o,h),q(s,e[2],r[2]),L(s,s,s),N(a,i,n),N(u,s,o),L(c,s,o),L(f,i,n),q(e[0],a,u),q(e[1],f,c),q(e[2],c,u),q(e[3],a,f)}function Q(e,t,r){var n;for(n=0;n<4;n++)U(e[n],t[n],r)}function ee(e,r){var n=t(),i=t(),o=t();D(o,r[2]),q(n,r[0],o),q(i,r[1],o),O(e,i),e[31]^=P(n)<<7}function te(e,t,r){var n,i;for(B(e[0],s),B(e[1],a),B(e[2],a),B(e[3],s),i=255;i>=0;--i)Q(e,t,n=r[i/8|0]>>(7&i)&1),X(t,e),X(e,e),Q(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];B(n[0],f),B(n[1],d),B(n[2],a),q(n[3],f,d),te(e,n,r)}function ne(e,r,i){var o,s=new Uint8Array(64),a=[t(),t(),t(),t()];for(i||n(r,32),Z(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,re(a,s),ee(e,a),o=0;o<32;o++)r[o+32]=e[o];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function oe(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*ie[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*ie[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ie[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function se(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;oe(e,r)}function ae(e,r,n,i){var o,s,a=new Uint8Array(64),u=new Uint8Array(64),c=new Uint8Array(64),h=new Float64Array(64),f=[t(),t(),t(),t()];Z(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var d=n+64;for(o=0;o<n;o++)e[64+o]=r[o];for(o=0;o<32;o++)e[32+o]=a[32+o];for(Z(c,e.subarray(32),n+32),se(c),re(f,c),ee(e,f),o=32;o<64;o++)e[o]=i[o];for(Z(u,e,n+64),se(u),o=0;o<64;o++)h[o]=0;for(o=0;o<32;o++)h[o]=c[o];for(o=0;o<32;o++)for(s=0;s<32;s++)h[o+s]+=u[o]*a[s];return oe(e.subarray(32),h),d}function ue(e,r,n,i){var o,u=new Uint8Array(32),h=new Uint8Array(64),f=[t(),t(),t(),t()],d=[t(),t(),t(),t()];if(n<64)return-1;if(function(e,r){var n=t(),i=t(),o=t(),u=t(),h=t(),f=t(),d=t();return B(e[2],a),z(e[1],r),j(o,e[1]),q(u,o,c),N(o,o,e[2]),L(u,e[2],u),j(h,u),j(f,h),q(d,f,h),q(n,d,o),q(n,n,u),F(n,n),q(n,n,o),q(n,n,u),q(n,n,u),q(e[0],n,u),j(i,e[0]),q(i,i,u),C(i,o)&&q(e[0],e[0],l),j(i,e[0]),q(i,i,u),C(i,o)?-1:(P(e[0])===r[31]>>7&&N(e[0],s,e[0]),q(e[3],e[0],e[1]),0)}(d,i))return-1;for(o=0;o<n;o++)e[o]=r[o];for(o=0;o<32;o++)e[o+32]=i[o];if(Z(h,e,n),se(h),te(f,d,h),re(d,r.subarray(32)),X(f,d),ee(u,f),n-=64,b(r,0,u,0)){for(o=0;o<n;o++)e[o]=0;return-1}for(o=0;o<n;o++)e[o]=r[o+64];return n}var ce=64,he=32,fe=64;function de(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function le(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function pe(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:v,crypto_stream_xor:S,crypto_stream:A,crypto_stream_salsa20_xor:_,crypto_stream_salsa20:E,crypto_onetimeauth:x,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:b,crypto_secretbox:I,crypto_secretbox_open:R,crypto_scalarmult:$,crypto_scalarmult_base:H,crypto_box_beforenm:K,crypto_box_afternm:G,crypto_box:function(e,t,r,n,i,o){var s=new Uint8Array(32);return K(s,i,o),G(e,t,r,n,s)},crypto_box_open:function(e,t,r,n,i,o){var s=new Uint8Array(32);return K(s,i,o),V(e,t,r,n,s)},crypto_box_keypair:W,crypto_hash:Z,crypto_sign:ae,crypto_sign_keypair:ne,crypto_sign_open:ue,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ce,crypto_sign_PUBLICKEYBYTES:he,crypto_sign_SECRETKEYBYTES:fe,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:c,L:ie,pack25519:O,unpack25519:z,M:q,A:L,S:j,Z:N,pow2523:F,add:X,set25519:B,modL:oe,scalarmult:te,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,r){le(e,t,r),de(r,t);for(var n=new Uint8Array(32+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+32]=e[o];return I(i,n,n.length,t,r),i.subarray(16)},e.secretbox.open=function(e,t,r){le(e,t,r),de(r,t);for(var n=new Uint8Array(16+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+16]=e[o];return n.length<32||0!==R(i,n,n.length,t,r)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(le(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return $(r,e,t),r},e.scalarMult.base=function(e){if(le(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox(t,r,o)},e.box.before=function(e,t){le(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return K(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox.open(t,r,o)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return W(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(le(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return H(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(le(e,t),t.length!==fe)throw new Error("bad secret key size");var r=new Uint8Array(ce+e.length);return ae(r,e,e.length,t),r},e.sign.open=function(e,t){if(le(e,t),t.length!==he)throw new Error("bad public key size");var r=new Uint8Array(e.length),n=ue(r,e,e.length,t);if(n<0)return null;for(var i=new Uint8Array(n),o=0;o<i.length;o++)i[o]=r[o];return i},e.sign.detached=function(t,r){for(var n=e.sign(t,r),i=new Uint8Array(ce),o=0;o<i.length;o++)i[o]=n[o];return i},e.sign.detached.verify=function(e,t,r){if(le(e,t,r),t.length!==ce)throw new Error("bad signature size");if(r.length!==he)throw new Error("bad public key size");var n,i=new Uint8Array(ce+e.length),o=new Uint8Array(ce+e.length);for(n=0;n<ce;n++)i[n]=t[n];for(n=0;n<e.length;n++)i[n+ce]=e[n];return ue(o,i,i.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(he),t=new Uint8Array(fe);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(le(e),e.length!==fe)throw new Error("bad secret key size");for(var t=new Uint8Array(he),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(le(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(he),r=new Uint8Array(fe),n=0;n<32;n++)r[n]=e[n];return ne(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=he,e.sign.secretKeyLength=fe,e.sign.seedLength=32,e.sign.signatureLength=ce,e.hash=function(e){le(e);var t=new Uint8Array(64);return Z(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return le(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===y(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=i[n];pe(i)})):(t=r(1160))&&t.randomBytes&&e.setPRNG((function(e,r){var n,i=t.randomBytes(r);for(n=0;n<r;n++)e[n]=i[n];pe(i)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},3744:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;const n=r(990);class i extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n.default(this.serialize(),o,2)}}function o(e,t){if("[Circular]"!==t)return t}t.EthereumRpcError=i,t.EthereumProviderError=class extends i{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},1770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},9620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;const n=r(3744),i=r(8649),o=r(1770);function s(e,t){const[r,o]=u(t);return new n.EthereumRpcError(e,r||i.getMessageFromCode(e),o)}function a(e,t){const[r,o]=u(t);return new n.EthereumProviderError(e,r||i.getMessageFromCode(e),o)}function u(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}t.ethErrors={rpc:{parse:e=>s(o.errorCodes.rpc.parse,e),invalidRequest:e=>s(o.errorCodes.rpc.invalidRequest,e),invalidParams:e=>s(o.errorCodes.rpc.invalidParams,e),methodNotFound:e=>s(o.errorCodes.rpc.methodNotFound,e),internal:e=>s(o.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:e=>s(o.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>s(o.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>s(o.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>s(o.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>s(o.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>s(o.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>a(o.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(o.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(o.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(o.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(o.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:i}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,i)}}}},8429:(e,t,r)=>{"use strict";t.Cg=t.Sy=void 0;const n=r(3744);Object.defineProperty(t,"Cg",{enumerable:!0,get:function(){return n.EthereumRpcError}});r(8649);const i=r(9620);Object.defineProperty(t,"Sy",{enumerable:!0,get:function(){return i.ethErrors}});r(1770)},8649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=r(1770),i=r(3744),o=n.errorCodes.rpc.internal,s={code:o,message:a(o)};function a(e,r="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const r=e.toString();if(f(n.errorValues,r))return n.errorValues[r].message;if(c(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function u(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!n.errorValues[t]||!!c(e)}function c(e){return e>=-32099&&e<=-32e3}function h(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=a,t.isValidCode=u,t.serializeError=function(e,{fallbackError:t=s,shouldIncludeStack:r=!1}={}){var n,o;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();const c={};if(e&&"object"==typeof e&&!Array.isArray(e)&&f(e,"code")&&u(e.code)){const t=e;c.code=t.code,t.message&&"string"==typeof t.message?(c.message=t.message,f(t,"data")&&(c.data=t.data)):(c.message=a(c.code),c.data={originalError:h(e)})}else{c.code=t.code;const r=null===(n=e)||void 0===n?void 0:n.message;c.message=r&&"string"==typeof r?r:t.message,c.data={originalError:h(e)}}const d=null===(o=e)||void 0===o?void 0:o.stack;return r&&e&&d&&"string"==typeof d&&(c.stack=d),c}},990:e=>{e.exports=s,s.default=s,s.stable=h,s.stableStringify=h;var t="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=o()),u(e,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(e,t,r):JSON.stringify(e,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function a(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:e}),n.push([o,r,t,s])):i.push([t,r,e]):(o[r]=e,n.push([o,r,t]))}function u(e,n,i,o,s,c,h){var f;if(c+=1,"object"==typeof e&&null!==e){for(f=0;f<o.length;f++)if(o[f]===e)return void a(r,e,n,s);if(void 0!==h.depthLimit&&c>h.depthLimit)return void a(t,e,n,s);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void a(t,e,n,s);if(o.push(e),Array.isArray(e))for(f=0;f<e.length;f++)u(e[f],f,f,o,e,c,h);else{var d=Object.keys(e);for(f=0;f<d.length;f++){var l=d[f];u(e[l],l,f,o,e,c,h)}}o.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function h(e,t,r,s){void 0===s&&(s=o());var a,u=f(e,"",0,[],void 0,0,s)||e;try{a=0===i.length?JSON.stringify(u,t,r):JSON.stringify(u,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function f(e,i,o,s,u,h,d){var l;if(h+=1,"object"==typeof e&&null!==e){for(l=0;l<s.length;l++)if(s[l]===e)return void a(r,e,i,u);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&h>d.depthLimit)return void a(t,e,i,u);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void a(t,e,i,u);if(s.push(e),Array.isArray(e))for(l=0;l<e.length;l++)f(e[l],l,l,s,e,h,d);else{var p={},y=Object.keys(e).sort(c);for(l=0;l<y.length;l++){var g=y[l];f(e[g],g,l,s,e,h,d),p[g]=e[g]}if(void 0===u)return p;n.push([u,i,e]),u[i]=p}s.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===t&&o[0]===r){r=o[2],i.splice(n,1);break}}return e.call(this,t,r)}}},7550:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},9012:e=>{function t(e,t,r,n,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,i)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(i,o){var s=e.apply(r,n);function a(e){t(s,i,o,a,u,"next",e)}function u(e){t(s,i,o,a,u,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6852:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},7599:e=>{function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},2905:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},3729:(e,t,r)=>{var n=r(7190);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},3148:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},7972:(e,t,r)=>{var n=r(9444).default,i=r(7550);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7190:e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9444:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9963:(e,t,r)=>{e.exports=r(6770)},4920:(e,t,r)=>{"use strict";t._O=t.Jq=t.KB=t.u8=t.cv=void 0,t.Ik=t.A9=t.n_=t.gM=void 0;const n=r(7487);function i(e){if(!(e instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function o(e){return i(e),n.Buffer.from(e.buffer,e.byteOffset,e.length)}class s{constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}function a(e,t){return t.property?e+"["+t.property+"]":e}class u extends s{isCount(){throw new Error("ExternalLayout is abstract")}}class c extends u{constructor(e,t=0,r){if(!(e instanceof s))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof h||this.layout instanceof f}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}}class h extends s{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return o(e).readUIntLE(t,this.span)}encode(e,t,r=0){return o(t).writeUIntLE(e,r,this.span),this.span}}class f extends s{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return o(e).readUIntBE(t,this.span)}encode(e,t,r=0){return o(t).writeUIntBE(e,r,this.span),this.span}}const d=Math.pow(2,32);function l(e){const t=Math.floor(e/d);return{hi32:t,lo32:e-t*d}}function p(e,t){return e*d+t}class y extends s{constructor(e){super(8,e)}decode(e,t=0){const r=o(e),n=r.readUInt32LE(t);return p(r.readUInt32LE(t+4),n)}encode(e,t,r=0){const n=l(e),i=o(t);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}}class g extends s{constructor(e){super(8,e)}decode(e,t=0){const r=o(e),n=r.readUInt32LE(t);return p(r.readInt32LE(t+4),n)}encode(e,t,r=0){const n=l(e),i=o(t);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}}class b extends s{constructor(e,t,r){if(!(e instanceof s))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof u&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;!(t instanceof u)&&0<e.span&&(n=t*e.span),super(n,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof u&&(n=n.decode(e,t)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let i=0;for(;i<n;)r+=this.elementLayout.getSpan(e,t+r),++i}return r}decode(e,t=0){const r=[];let n=0,i=this.count;for(i instanceof u&&(i=i.decode(e,t));n<i;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),n+=1;return r}encode(e,t,r=0){const n=this.elementLayout,i=e.reduce(((e,i)=>e+n.encode(i,t,r+e)),0);return this.count instanceof u&&this.count.encode(e.length,t,r),i}}class m extends s{constructor(e,t,r){if(!Array.isArray(e)||!e.reduce(((e,t)=>e&&t instanceof s),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof t&&void 0===r&&(r=t,t=void 0);for(const t of e)if(0>t.span&&void 0===t.property)throw new Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=e.reduce(((e,t)=>e+t.getSpan()),0)}catch(e){}super(n,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce(((r,n)=>{const i=n.getSpan(e,t);return t+=i,r+i}),0)}catch(e){throw new RangeError("indeterminate span")}return r}decode(e,t=0){i(e);const r=this.makeDestinationObject();for(const n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){const n=r;let i=0,o=0;for(const n of this.fields){let s=n.span;if(o=0<s?s:0,void 0!==n.property){const i=e[n.property];void 0!==i&&(o=n.encode(i,t,r),0>s&&(s=n.getSpan(t,r)))}i=r,r+=s}return i+o-n}fromArray(e){const t=this.makeDestinationObject();for(const r of this.fields)void 0!==r.property&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if("string"!=typeof e)throw new TypeError("property must be string");for(const t of this.fields)if(t.property===e)return t}offsetOf(e){if("string"!=typeof e)throw new TypeError("property must be string");let t=0;for(const r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}}class v extends s{constructor(e,t){if(!(e instanceof u&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof u||(r=e),super(r,t),this.length=e}getSpan(e,t){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),o(e).slice(t,t+r)}encode(e,t,r){let n=this.length;if(this.length instanceof u&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw new TypeError(a("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>t.length)throw new RangeError("encoding overruns Uint8Array");const i=o(e);return o(t).write(i.toString("hex"),r,n,"hex"),this.length instanceof u&&this.length.encode(n,t,r),n}}t.cv=(e,t,r)=>new c(e,t,r),t.u8=e=>new h(1,e),t.KB=e=>new h(2,e),t.Jq=e=>new h(4,e),t._O=e=>new y(e),t.gM=e=>new g(e),t.n_=(e,t,r)=>new m(e,t,r),t.A9=(e,t,r)=>new b(e,t,r),t.Ik=(e,t)=>new v(e,t)},7487:(e,t,r)=>{"use strict";const n=r(3350),i=r(3575),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return l(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return l(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return h(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return V(K(t,e.length-r),e,r,n)}function E(e,t,r,n){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function A(e,t,r,n){return V(G(t),e,r,n)}function S(e,t,r,n){return V(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(J(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),h=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==h[e]){o=c[e],s=h[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function T(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function z(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const q={};function j(e,t,r){q[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new q.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function $(e,t){if("number"!=typeof e)throw new q.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new q.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},6565:(e,t,r)=>{var n=r(6504);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},6504:(e,t,r)=>{"use strict";var n=r(7547).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==t[s])throw new TypeError(o+" is ambiguous");t[s]=i}var a=e.length,u=e.charAt(0),c=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,o=0;e[r]===u;)i++,r++;for(var s=(e.length-r)*c+1>>>0,h=new Uint8Array(s);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var d=0,l=s-1;(0!==f||d<o)&&-1!==l;l--,d++)f+=a*h[l]>>>0,h[l]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=d,r++}for(var p=s-o;p!==s&&0===h[p];)p++;var y=n.allocUnsafe(i+(s-p));y.fill(0,0,i);for(var g=i;p!==s;)y[g++]=h[p++];return y}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var c=(s-o)*h+1>>>0,f=new Uint8Array(c);o!==s;){for(var d=t[o],l=0,p=c-1;(0!==d||l<i)&&-1!==p;p--,l++)d+=256*f[p]>>>0,f[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");i=l,o++}for(var y=c-i;y!==c&&0===f[y];)y++;for(var g=u.repeat(r);y<c;++y)g+=e.charAt(f[y]);return g},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},3350:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),h=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[h++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7543:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(5377).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),u=t;u<a;u++){var c=e.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){h(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],l=[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],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,f=67108863&u,d=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=d;l++){var p=c-l|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[l])+f)/67108864|0,f=67108863&s}r.words[c]=0|f,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?d[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],h=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(h).toString(e);r=(f=f.idivn(h)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],f=8191&h,d=h>>>13,l=0|s[1],p=8191&l,y=l>>>13,g=0|s[2],b=8191&g,m=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],A=8191&E,S=E>>>13,M=0|s[5],x=8191&M,k=M>>>13,I=0|s[6],R=8191&I,B=I>>>13,T=0|s[7],U=8191&T,O=T>>>13,C=0|s[8],P=8191&C,z=C>>>13,L=0|s[9],N=8191&L,q=L>>>13,j=0|a[0],D=8191&j,F=j>>>13,$=0|a[1],H=8191&$,W=$>>>13,K=0|a[2],G=8191&K,V=K>>>13,J=0|a[3],Y=8191&J,Z=J>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],fe=8191&he,de=he>>>13,le=0|a[9],pe=8191&le,ye=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(f,D))|0)+((8191&(i=(i=Math.imul(f,F))+Math.imul(d,D)|0))<<13)|0;c=((o=Math.imul(d,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,F))+Math.imul(y,D)|0,o=Math.imul(y,F);var be=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;c=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,D),i=(i=Math.imul(b,F))+Math.imul(m,D)|0,o=Math.imul(m,F),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,W)|0;var me=(c+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(w,D),i=(i=Math.imul(w,F))+Math.imul(_,D)|0,o=Math.imul(_,F),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,V)|0;var ve=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,F))+Math.imul(S,D)|0,o=Math.imul(S,F),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Z)|0;var we=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,D),i=(i=Math.imul(x,F))+Math.imul(k,D)|0,o=Math.imul(k,F),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,D),i=(i=Math.imul(R,F))+Math.imul(B,D)|0,o=Math.imul(B,F),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,se)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,D),i=(i=Math.imul(U,F))+Math.imul(O,D)|0,o=Math.imul(O,F),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Ae=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,D),i=(i=Math.imul(P,F))+Math.imul(z,D)|0,o=Math.imul(z,F),n=n+Math.imul(U,H)|0,i=(i=i+Math.imul(U,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Se=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,D),i=(i=Math.imul(N,F))+Math.imul(q,D)|0,o=Math.imul(q,F),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(z,H)|0,o=o+Math.imul(z,W)|0,n=n+Math.imul(U,G)|0,i=(i=i+Math.imul(U,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,de)|0;var Me=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((o=o+Math.imul(d,ye)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,W))+Math.imul(q,H)|0,o=Math.imul(q,W),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(z,G)|0,o=o+Math.imul(z,V)|0,n=n+Math.imul(U,Y)|0,i=(i=i+Math.imul(U,Z)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(b,fe)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,G),i=(i=Math.imul(N,V))+Math.imul(q,G)|0,o=Math.imul(q,V),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(z,Y)|0,o=o+Math.imul(z,Z)|0,n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,de)|0;var ke=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,Y),i=(i=Math.imul(N,Z))+Math.imul(q,Y)|0,o=Math.imul(q,Z),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(z,Q)|0,o=o+Math.imul(z,ee)|0,n=n+Math.imul(U,re)|0,i=(i=i+Math.imul(U,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,de)|0;var Ie=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(N,Q),i=(i=Math.imul(N,ee))+Math.imul(q,Q)|0,o=Math.imul(q,ee),n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(z,re)|0,o=o+Math.imul(z,ne)|0,n=n+Math.imul(U,oe)|0,i=(i=i+Math.imul(U,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,de)|0;var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ye)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(N,re),i=(i=Math.imul(N,ne))+Math.imul(q,re)|0,o=Math.imul(q,ne),n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(z,oe)|0,o=o+Math.imul(z,se)|0,n=n+Math.imul(U,ue)|0,i=(i=i+Math.imul(U,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(B,fe)|0,o=o+Math.imul(B,de)|0;var Be=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(N,oe),i=(i=Math.imul(N,se))+Math.imul(q,oe)|0,o=Math.imul(q,se),n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(z,ue)|0,o=o+Math.imul(z,ce)|0,n=n+Math.imul(U,fe)|0,i=(i=i+Math.imul(U,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Te=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(N,ue),i=(i=Math.imul(N,ce))+Math.imul(q,ue)|0,o=Math.imul(q,ce),n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(z,fe)|0,o=o+Math.imul(z,de)|0;var Ue=(c+(n=n+Math.imul(U,pe)|0)|0)+((8191&(i=(i=i+Math.imul(U,ye)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ye)|0)+(i>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,n=Math.imul(N,fe),i=(i=Math.imul(N,de))+Math.imul(q,fe)|0,o=Math.imul(q,de);var Oe=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ye)|0)+Math.imul(z,pe)|0))<<13)|0;c=((o=o+Math.imul(z,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Ce=(c+(n=Math.imul(N,pe))|0)+((8191&(i=(i=Math.imul(N,ye))+Math.imul(q,pe)|0))<<13)|0;return c=((o=Math.imul(q,ye))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=ge,u[1]=be,u[2]=me,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Ae,u[8]=Se,u[9]=Me,u[10]=xe,u[11]=ke,u[12]=Ie,u[13]=Re,u[14]=Be,u[15]=Te,u[16]=Ue,u[17]=Oe,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,f=(0|e.words[h])*(0|t.words[c]),d=67108863&f;a=67108863&(d=d+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(e,t,r){return b(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=y),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?y(this,e,t):r<1024?b(this,e,t):m(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},v.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var f=u,d=c,l=0;l<s;l++){var p=r[h+l],y=n[h+l],g=r[h+l+s],b=n[h+l+s],m=f*g-d*b;b=f*b+d*g,g=m,r[h+l]=p+g,n[h+l]=y+b,r[h+l+s]=p-g,n[h+l+s]=y-b,l!==a&&(m=u*f-c*d,d=u*d+c*f,f=m)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},v.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,f,n,i);for(var l=0;l<n;l++){var p=a[l]*h[l]-u[l]*f[l];u[l]=a[l]*f[l]+u[l]*h[l],a[l]=p}return this.conjugate(a,u,n),this.transform(a,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),m(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var f=0|this.words[c];this.words[c]=h<<26-o|f>>>o,h=f&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),f=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(f)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0==(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new x(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}_.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(E,_),E.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},E.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(A,_),i(S,_),i(M,_),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new A;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return w[e]=t,t},x.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var f=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=s;0!==l.cmp(a);){for(var y=l,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));d=d.redMul(b),f=b.redSqr(),l=l.redMul(f),p=g}return d},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var f=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,x),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},9989:function(e,t,r){"use strict";var n=r(5326).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeUnchecked=t.deserialize=t.serialize=t.BinaryReader=t.BinaryWriter=t.BorshError=t.baseDecode=t.baseEncode=void 0;const c=u(r(7543)),h=u(r(3534)),f=a(r(9967)),d=new("function"!=typeof TextDecoder?f.TextDecoder:TextDecoder)("utf-8",{fatal:!0});t.baseEncode=function(e){return"string"==typeof e&&(e=n.from(e,"utf8")),h.default.encode(n.from(e))},t.baseDecode=function(e){return n.from(h.default.decode(e))};const l=1024;class p extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}t.BorshError=p;class y{constructor(){this.buf=n.alloc(l),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=n.concat([this.buf,n.alloc(l)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(n.from(new c.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(n.from(new c.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(n.from(new c.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(n.from(new c.default(e).toArray("le",64)))}writeBuffer(e){this.buf=n.concat([n.from(this.buf.subarray(0,this.length)),e,n.alloc(l)]),this.length+=e.length}writeString(e){this.maybeResize();const t=n.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(n.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(const r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}}function g(e,t,r){const n=r.value;r.value=function(...e){try{return n.apply(this,e)}catch(e){if(e instanceof RangeError){const t=e.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t)>=0)throw new p("Reached the end of buffer when deserializing")}throw e}}}t.BinaryWriter=y;class b{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new c.default(e,"le")}readU128(){const e=this.readBuffer(16);return new c.default(e,"le")}readU256(){const e=this.readBuffer(32);return new c.default(e,"le")}readU512(){const e=this.readBuffer(64);return new c.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new p(`Expected buffer length ${e} isn't within bounds`);const t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){const e=this.readU32(),t=this.readBuffer(e);try{return d.decode(t)}catch(e){throw new p(`Error decoding UTF-8 string: ${e}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const t=this.readU32(),r=Array();for(let n=0;n<t;++n)r.push(e());return r}}function m(e){return e.charAt(0).toUpperCase()+e.slice(1)}function v(e,t,r,n,i){try{if("string"==typeof n)i[`write${m(n)}`](r);else if(n instanceof Array)if("number"==typeof n[0]){if(r.length!==n[0])throw new p(`Expecting byte array of length ${n[0]}, but got ${r.length} bytes`);i.writeFixedArray(r)}else if(2===n.length&&"number"==typeof n[1]){if(r.length!==n[1])throw new p(`Expecting byte array of length ${n[1]}, but got ${r.length} bytes`);for(let t=0;t<n[1];t++)v(e,null,r[t],n[0],i)}else i.writeArray(r,(r=>{v(e,t,r,n[0],i)}));else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),v(e,t,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach(((r,o)=>{v(e,t,o,n.key,i),v(e,t,r,n.value,i)}));break;default:throw new p(`FieldType ${n} unrecognized`)}else w(e,r,i)}catch(e){throw e instanceof p&&e.addToFieldPath(t),e}}function w(e,t,r){if("function"==typeof t.borshSerialize)return void t.borshSerialize(r);const n=e.get(t.constructor);if(!n)throw new p(`Class ${t.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map((([n,i])=>{v(e,n,t[n],i,r)}));else{if("enum"!==n.kind)throw new p(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`);{const i=t[n.field];for(let o=0;o<n.values.length;++o){const[s,a]=n.values[o];if(s===i){r.writeU8(o),v(e,s,t[s],a,r);break}}}}}function _(e,t,r,n){try{if("string"==typeof r)return n[`read${m(r)}`]();if(r instanceof Array){if("number"==typeof r[0])return n.readFixedArray(r[0]);if("number"==typeof r[1]){const t=[];for(let i=0;i<r[1];i++)t.push(_(e,null,r[0],n));return t}return n.readArray((()=>_(e,t,r[0],n)))}if("option"===r.kind)return n.readU8()?_(e,t,r.type,n):void 0;if("map"===r.kind){let i=new Map;const o=n.readU32();for(let s=0;s<o;s++){const o=_(e,t,r.key,n),s=_(e,t,r.value,n);i.set(o,s)}return i}return E(e,r,n)}catch(e){throw e instanceof p&&e.addToFieldPath(t),e}}function E(e,t,r){if("function"==typeof t.borshDeserialize)return t.borshDeserialize(r);const n=e.get(t);if(!n)throw new p(`Class ${t.name} is missing in schema`);if("struct"===n.kind){const n={};for(const[i,o]of e.get(t).fields)n[i]=_(e,i,o,r);return new t(n)}if("enum"===n.kind){const i=r.readU8();if(i>=n.values.length)throw new p(`Enum index: ${i} is out of range`);const[o,s]=n.values[i];return new t({[o]:_(e,o,s,r)})}throw new p(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}s([g],b.prototype,"readU8",null),s([g],b.prototype,"readU16",null),s([g],b.prototype,"readU32",null),s([g],b.prototype,"readU64",null),s([g],b.prototype,"readU128",null),s([g],b.prototype,"readU256",null),s([g],b.prototype,"readU512",null),s([g],b.prototype,"readString",null),s([g],b.prototype,"readFixedArray",null),s([g],b.prototype,"readArray",null),t.BinaryReader=b,t.serialize=function(e,t,r=y){const n=new r;return w(e,t,n),n.toArray()},t.deserialize=function(e,t,r,n=b){const i=new n(r),o=E(e,t,i);if(i.offset<r.length)throw new p(`Unexpected ${r.length-i.offset} bytes after deserialized data`);return o},t.deserializeUnchecked=function(e,t,r,n=b){return E(e,t,new n(r))}},3534:(e,t,r)=>{var n=r(6504);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},2017:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(3325);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},5973:(e,t,r)=>{const n=r(5705);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},5705:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function h(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var r=0,n=0,i=0;e[r]===a;)n++,r++;for(var o=(e.length-r)*u+1>>>0,c=new Uint8Array(o);e[r];){var h=t[e.charCodeAt(r)];if(255===h)return;for(var f=0,d=o-1;(0!==h||f<i)&&-1!==d;d--,f++)h+=s*c[d]>>>0,c[d]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");i=f,r++}for(var l=o-i;l!==o&&0===c[l];)l++;for(var p=new Uint8Array(n+(o-l)),y=n;l!==o;)p[y++]=c[l++];return p}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var u=(o-i)*c+1>>>0,h=new Uint8Array(u);i!==o;){for(var f=t[i],d=0,l=u-1;(0!==f||d<n)&&-1!==l;l--,d++)f+=256*h[l]>>>0,h[l]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");n=d,i++}for(var p=u-n;p!==u&&0===h[p];)p++;for(var y=a.repeat(r);p<u;++p)y+=e.charAt(h[p]);return y},decodeUnsafe:h,decode:function(e){var t=h(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},5326:(e,t,r)=>{"use strict";const n=r(3350),i=r(3575),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return l(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return l(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return h(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return V(K(t,e.length-r),e,r,n)}function E(e,t,r,n){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function A(e,t,r,n){return V(G(t),e,r,n)}function S(e,t,r,n){return V(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(J(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),h=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==h[e]){o=c[e],s=h[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function T(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function z(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const q={};function j(e,t,r){q[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new q.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function $(e,t){if("number"!=typeof e)throw new q.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new q.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},2272:(e,t,r)=>{"use strict";var n=t;n.version=r(7330).i8,n.utils=r(7445),n.rand=r(2017),n.curve=r(3401),n.curves=r(3673),n.ec=r(2995),n.eddsa=r(303)},7017:(e,t,r)=>{"use strict";var n=r(2616),i=r(7445),o=i.getNAF,s=i.getJSF,a=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,u,c=[];for(s=0;s<n.length;s+=r.step){u=0;for(var h=s+r.step-1;h>=s;h--)u=(u<<1)+n[h];c.push(u)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(s=0;s<c.length;s++)(u=c[s])===l?d=d.mixedAdd(r.points[s]):u===-l&&(d=d.mixedAdd(r.points[s].neg()));f=f.add(d)}return f.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(t,r,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(var h=0;c>=0&&0===s[c];c--)h++;if(c>=0&&h++,u=u.dblp(h),c<0)break;var f=s[c];a(0!==f),u="affine"===e.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var a,u,c,h=this._wnafT1,f=this._wnafT2,d=this._wnafT3,l=0;for(a=0;a<n;a++){var p=(c=t[a])._getNAFPoints(e);h[a]=p.wnd,f[a]=p.points}for(a=n-1;a>=1;a-=2){var y=a-1,g=a;if(1===h[y]&&1===h[g]){var b=[t[y],null,null,t[g]];0===t[y].y.cmp(t[g].y)?(b[1]=t[y].add(t[g]),b[2]=t[y].toJ().mixedAdd(t[g].neg())):0===t[y].y.cmp(t[g].y.redNeg())?(b[1]=t[y].toJ().mixedAdd(t[g]),b[2]=t[y].add(t[g].neg())):(b[1]=t[y].toJ().mixedAdd(t[g]),b[2]=t[y].toJ().mixedAdd(t[g].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[y],r[g]);for(l=Math.max(v[0].length,l),d[y]=new Array(l),d[g]=new Array(l),u=0;u<l;u++){var w=0|v[0][u],_=0|v[1][u];d[y][u]=m[3*(w+1)+(_+1)],d[g][u]=0,f[y]=b}}else d[y]=o(r[y],h[y],this._bitLength),d[g]=o(r[g],h[g],this._bitLength),l=Math.max(d[y].length,l),l=Math.max(d[g].length,l)}var E=this.jpoint(null,null,null),A=this._wnafT4;for(a=l;a>=0;a--){for(var S=0;a>=0;){var M=!0;for(u=0;u<n;u++)A[u]=0|d[u][a],0!==A[u]&&(M=!1);if(!M)break;S++,a--}if(a>=0&&S++,E=E.dblp(S),a<0)break;for(u=0;u<n;u++){var x=A[u];0!==x&&(x>0?c=f[u][x-1>>1]:x<0&&(c=f[u][-x-1>>1].neg()),E="affine"===c.type?E.mixedAdd(c):E.add(c))}}for(a=0;a<n;a++)f[a]=null;return i?E:E.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},2418:(e,t,r)=>{"use strict";var n=r(7445),i=r(2616),o=r(3717),s=r(7017),a=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(t&&!u||!t&&u)&&(a=a.redNeg()),this.point(e,a)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,s.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),u=i.redMul(s),c=o.redMul(a),h=i.redMul(a),f=s.redMul(o);return this.curve.point(u,c,f,h)},c.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(e=s.redSub(a).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=s.redSub(a).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(t),c=o.redMul(s),h=a.redMul(u),f=o.redMul(u),d=s.redMul(a);return this.curve.point(c,h,d,f)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),c=i.redAdd(a),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),f=n.redMul(u).redMul(h);return this.curve.twisted?(t=n.redMul(c).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},3401:(e,t,r)=>{"use strict";var n=t;n.base=r(7017),n.short=r(1164),n.mont=r(7732),n.edwards=r(2418)},7732:(e,t,r)=>{"use strict";var n=r(2616),i=r(3717),o=r(7017),s=r(7445);function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new u(this,e,t)},a.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},1164:(e,t,r)=>{"use strict";var n=r(7445),i=r(2616),o=r(3717),s=r(7017),a=n.assert;function u(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,u,c,h,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,l=this.n.clone(),p=new i(1),y=new i(0),g=new i(0),b=new i(1),m=0;0!==d.cmpn(0);){var v=l.div(d);c=l.sub(v.mul(d)),h=g.sub(v.mul(p));var w=b.sub(v.mul(y));if(!n&&c.cmp(f)<0)t=u.neg(),r=p,n=c.neg(),o=h;else if(n&&2==++m)break;u=c,l=d,d=c,g=p,p=h,b=y,y=w}s=c.neg(),a=h;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),h=0;h<2*o;h++)n[h]=null,i[h]=null;return c},o(c,s.BasePoint),u.prototype.point=function(e,t,r){return new c(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,s.BasePoint),u.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),h=c.redMul(a),f=n.redMul(c),d=u.redSqr().redIAdd(h).redISub(f).redISub(f),l=u.redMul(f.redISub(d)).redISub(o.redMul(h)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,l,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=r.redMul(u),f=a.redSqr().redIAdd(c).redISub(h).redISub(h),d=a.redMul(h.redISub(f)).redISub(i.redMul(c)),l=this.z.redMul(s);return this.curve.jpoint(f,d,l)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),c=s.redAdd(s);for(t=0;t<e;t++){var h=o.redSqr(),f=c.redSqr(),d=f.redSqr(),l=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(u)),p=o.redMul(f),y=l.redSqr().redISub(p.redAdd(p)),g=p.redISub(y),b=l.redMul(g);b=b.redIAdd(b).redISub(d);var m=c.redMul(a);t+1<e&&(u=u.redMul(d)),o=y,a=m,c=b}return this.curve.jpoint(o,c.redMul(i),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),l=this.x.redAdd(f).redSqr().redISub(h).redISub(d);l=l.redIAdd(l);var p=h.redAdd(h).redIAdd(h),y=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),e=y.redISub(l).redISub(l),t=p.redMul(l.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},h.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),l=this.x.redSub(h).redMul(this.x.redAdd(h));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=l.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(h);var g=f.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=l.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(s),h=a.redSqr().redISub(c.redAdd(c)),f=c.redISub(h),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=a.redMul(f).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,l,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),h=t.redMul(c);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.x.redMul(a).redISub(h);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,d,l)},h.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},3673:(e,t,r)=>{"use strict";var n,i=t,o=r(1568),s=r(3401),a=r(7445).assert;function u(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(6517)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},2995:(e,t,r)=>{"use strict";var n=r(2616),i=r(7905),o=r(7445),s=r(3673),a=r(2017),u=o.assert,c=r(5467),h=r(309);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new c(this,e)},f.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),u=e.toArray("be",s),c=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(f)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var y=p.getX(),g=y.umod(this.n);if(0!==g.cmpn(0)){var b=l.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==y.cmp(g)?2:0);return o.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),m^=1),new h({r:g,s:b,recoveryParam:m})}}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new h(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),c=u.mul(e).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new h(t,i);var o=this.n,s=new n(e),a=t.r,c=t.s,f=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var l=t.r.invm(o),p=o.sub(s).mul(l).umod(o),y=c.mul(l).umod(o);return this.g.mulAdd(p,a,y)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new h(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},5467:(e,t,r)=>{"use strict";var n=r(2616),i=r(7445).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},309:(e,t,r)=>{"use strict";var n=r(2616),i=r(7445),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function h(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=u(e,r);if(!1===s)return!1;var c=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var h=u(e,r);if(!1===h)return!1;if(e.length!==h+r.place)return!1;var f=e.slice(r.place,h+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(c),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];h(n,t.length),(n=n.concat(t)).push(2),h(n,r.length);var o=n.concat(r),s=[48];return h(s,o.length),s=s.concat(o),i.encode(s,e)}},303:(e,t,r)=>{"use strict";var n=r(1568),i=r(3673),o=r(7445),s=o.assert,a=o.parseBytes,u=r(5624),c=r(3891);function h(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof h))return new h(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=h,h.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},h.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},h.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},h.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},h.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},h.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},h.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},h.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(e){return o.intFromLE(e)},h.prototype.isPoint=function(e){return e instanceof this.pointClass}},5624:(e,t,r)=>{"use strict";var n=r(7445),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},3891:(e,t,r)=>{"use strict";var n=r(2616),i=r(7445),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},6517:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},7445:(e,t,r)=>{"use strict";var n=t,i=r(2616),o=r(4076),s=r(1784);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),s=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(s),a=0==(1&c)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},2616:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(9312).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,f=67108863&u,d=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=d;l++){var p=c-l|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[l])+f)/67108864|0,f=67108863&s}r.words[c]=0|f,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],l=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],f=8191&h,d=h>>>13,l=0|s[1],p=8191&l,y=l>>>13,g=0|s[2],b=8191&g,m=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],A=8191&E,S=E>>>13,M=0|s[5],x=8191&M,k=M>>>13,I=0|s[6],R=8191&I,B=I>>>13,T=0|s[7],U=8191&T,O=T>>>13,C=0|s[8],P=8191&C,z=C>>>13,L=0|s[9],N=8191&L,q=L>>>13,j=0|a[0],D=8191&j,F=j>>>13,$=0|a[1],H=8191&$,W=$>>>13,K=0|a[2],G=8191&K,V=K>>>13,J=0|a[3],Y=8191&J,Z=J>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],fe=8191&he,de=he>>>13,le=0|a[9],pe=8191&le,ye=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(f,D))|0)+((8191&(i=(i=Math.imul(f,F))+Math.imul(d,D)|0))<<13)|0;c=((o=Math.imul(d,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,F))+Math.imul(y,D)|0,o=Math.imul(y,F);var be=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;c=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,D),i=(i=Math.imul(b,F))+Math.imul(m,D)|0,o=Math.imul(m,F),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,W)|0;var me=(c+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(w,D),i=(i=Math.imul(w,F))+Math.imul(_,D)|0,o=Math.imul(_,F),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,V)|0;var ve=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,F))+Math.imul(S,D)|0,o=Math.imul(S,F),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Z)|0;var we=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,D),i=(i=Math.imul(x,F))+Math.imul(k,D)|0,o=Math.imul(k,F),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,D),i=(i=Math.imul(R,F))+Math.imul(B,D)|0,o=Math.imul(B,F),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,se)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,D),i=(i=Math.imul(U,F))+Math.imul(O,D)|0,o=Math.imul(O,F),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Ae=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,D),i=(i=Math.imul(P,F))+Math.imul(z,D)|0,o=Math.imul(z,F),n=n+Math.imul(U,H)|0,i=(i=i+Math.imul(U,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Se=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,D),i=(i=Math.imul(N,F))+Math.imul(q,D)|0,o=Math.imul(q,F),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(z,H)|0,o=o+Math.imul(z,W)|0,n=n+Math.imul(U,G)|0,i=(i=i+Math.imul(U,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,de)|0;var Me=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((o=o+Math.imul(d,ye)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,W))+Math.imul(q,H)|0,o=Math.imul(q,W),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(z,G)|0,o=o+Math.imul(z,V)|0,n=n+Math.imul(U,Y)|0,i=(i=i+Math.imul(U,Z)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(b,fe)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,G),i=(i=Math.imul(N,V))+Math.imul(q,G)|0,o=Math.imul(q,V),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(z,Y)|0,o=o+Math.imul(z,Z)|0,n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,de)|0;var ke=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,Y),i=(i=Math.imul(N,Z))+Math.imul(q,Y)|0,o=Math.imul(q,Z),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(z,Q)|0,o=o+Math.imul(z,ee)|0,n=n+Math.imul(U,re)|0,i=(i=i+Math.imul(U,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,de)|0;var Ie=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(N,Q),i=(i=Math.imul(N,ee))+Math.imul(q,Q)|0,o=Math.imul(q,ee),n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(z,re)|0,o=o+Math.imul(z,ne)|0,n=n+Math.imul(U,oe)|0,i=(i=i+Math.imul(U,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,de)|0;var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ye)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(N,re),i=(i=Math.imul(N,ne))+Math.imul(q,re)|0,o=Math.imul(q,ne),n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(z,oe)|0,o=o+Math.imul(z,se)|0,n=n+Math.imul(U,ue)|0,i=(i=i+Math.imul(U,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(B,fe)|0,o=o+Math.imul(B,de)|0;var Be=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(N,oe),i=(i=Math.imul(N,se))+Math.imul(q,oe)|0,o=Math.imul(q,se),n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(z,ue)|0,o=o+Math.imul(z,ce)|0,n=n+Math.imul(U,fe)|0,i=(i=i+Math.imul(U,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Te=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(N,ue),i=(i=Math.imul(N,ce))+Math.imul(q,ue)|0,o=Math.imul(q,ce),n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(z,fe)|0,o=o+Math.imul(z,de)|0;var Ue=(c+(n=n+Math.imul(U,pe)|0)|0)+((8191&(i=(i=i+Math.imul(U,ye)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ye)|0)+(i>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,n=Math.imul(N,fe),i=(i=Math.imul(N,de))+Math.imul(q,fe)|0,o=Math.imul(q,de);var Oe=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ye)|0)+Math.imul(z,pe)|0))<<13)|0;c=((o=o+Math.imul(z,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Ce=(c+(n=Math.imul(N,pe))|0)+((8191&(i=(i=Math.imul(N,ye))+Math.imul(q,pe)|0))<<13)|0;return c=((o=Math.imul(q,ye))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=ge,u[1]=be,u[2]=me,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Ae,u[8]=Se,u[9]=Me,u[10]=xe,u[11]=ke,u[12]=Ie,u[13]=Re,u[14]=Be,u[15]=Te,u[16]=Ue,u[17]=Oe,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=l),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,f=(0|e.words[h])*(0|t.words[c]),d=67108863&f;a=67108863&(d=d+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var f=u,d=c,l=0;l<s;l++){var p=r[h+l],y=n[h+l],g=r[h+l+s],b=n[h+l+s],m=f*g-d*b;b=f*b+d*g,g=m,r[h+l]=p+g,n[h+l]=y+b,r[h+l+s]=p-g,n[h+l+s]=y-b,l!==a&&(m=u*f-c*d,d=u*d+c*f,f=m)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,f,n,i);for(var l=0;l<n;l++){var p=a[l]*h[l]-u[l]*f[l];u[l]=a[l]*f[l]+u[l]*h[l],a[l]=p}return this.conjugate(a,u,n),this.transform(a,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var f=0|this.words[c];this.words[c]=h<<26-o|f>>>o,h=f&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),f=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(f)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0==(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}m.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},i(v,m),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,m),i(_,m),i(E,m),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return b[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var f=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=s;0!==l.cmp(a);){for(var y=l,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));d=d.redMul(b),f=b.redSqr(),l=l.redMul(f),p=g}return d},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var f=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,A),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},8236:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||e,s),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],a]:e._events[u].push(a):(e._events[u]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,i,o,s){var a=r?r+e:e;if(!this._events[a])return!1;var u,c,h=this._events[a],f=arguments.length;if(h.fn){switch(h.once&&this.removeListener(e,h.fn,void 0,!0),f){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,t),!0;case 3:return h.fn.call(h.context,t,n),!0;case 4:return h.fn.call(h.context,t,n,i),!0;case 5:return h.fn.call(h.context,t,n,i,o),!0;case 6:return h.fn.call(h.context,t,n,i,o,s),!0}for(c=1,u=new Array(f-1);c<f;c++)u[c-1]=arguments[c];h.fn.apply(h.context,u)}else{var d,l=h.length;for(c=0;c<l;c++)switch(h[c].once&&this.removeListener(e,h[c].fn,void 0,!0),f){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,t);break;case 3:h[c].fn.call(h[c].context,t,n);break;case 4:h[c].fn.call(h[c].context,t,n,i);break;default:if(!u)for(d=1,u=new Array(f-1);d<f;d++)u[d-1]=arguments[d];h[c].fn.apply(h[c].context,u)}}return!0},a.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var u=0,c=[],h=a.length;u<h;u++)(a[u].fn!==t||i&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},1568:(e,t,r)=>{var n=t;n.utils=r(886),n.common=r(6925),n.sha=r(1036),n.ripemd=r(3020),n.hmac=r(9147),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},6925:(e,t,r)=>{"use strict";var n=r(886),i=r(4076);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},9147:(e,t,r)=>{"use strict";var n=r(886),i=r(4076);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},3020:(e,t,r)=>{"use strict";var n=r(886),i=r(6925),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function h(){if(!(this instanceof h))return new h;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(h,c),t.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],h=this.h[4],m=r,v=n,w=i,_=c,E=h,A=0;A<80;A++){var S=s(o(u(r,f(A,n,i,c),e[p[A]+t],d(A)),g[A]),h);r=h,h=c,c=o(i,10),i=n,n=S,S=s(o(u(m,f(79-A,v,w,_),e[y[A]+t],l(A)),b[A]),E),m=E,E=_,_=o(w,10),w=v,v=S}S=a(this.h[1],i,_),this.h[1]=a(this.h[2],c,E),this.h[2]=a(this.h[3],h,m),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=S},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],b=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},1036:(e,t,r)=>{"use strict";t.sha1=r(5654),t.sha224=r(8513),t.sha256=r(8221),t.sha384=r(7212),t.sha512=r(6439)},5654:(e,t,r)=>{"use strict";var n=r(886),i=r(6925),o=r(4389),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=o.ft_1,h=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,h),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],h=this.h[2],d=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=u(s(i,5),c(p,o,h,d),l,r[n],f[p]);l=d,d=h,h=s(o,30),o=i,i=y}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],l)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8513:(e,t,r)=>{"use strict";var n=r(886),i=r(8221);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},8221:(e,t,r)=>{"use strict";var n=r(886),i=r(6925),o=r(4389),s=r(4076),a=n.sum32,u=n.sum32_4,c=n.sum32_5,h=o.ch32,f=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,y=o.g1_256,g=i.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function m(){if(!(this instanceof m))return new m;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}n.inherits(m,g),e.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],b=this.h[3],m=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=c(_,l(m),h(m,v,w),this.k[n],r[n]),A=a(d(i),f(i,o,g));_=w,w=v,v=m,m=a(b,E),b=g,g=o,o=i,i=a(E,A)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],b),this.h[4]=a(this.h[4],m),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},m.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7212:(e,t,r)=>{"use strict";var n=r(886),i=r(6439);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},6439:(e,t,r)=>{"use strict";var n=r(886),i=r(6925),o=r(4076),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,h=n.sum64,f=n.sum64_hi,d=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,g=n.sum64_5_lo,b=i.BlockHash,m=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function _(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function A(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function S(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function k(e,t){var r=s(e,t,1)^s(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,1)^a(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=a(e,t,19)^a(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,b),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=(g=r[n-4],b=r[n-3],m=void 0,(m=s(g,b,19)^s(b,g,29)^u(g,b,6))<0&&(m+=4294967296),m),o=R(r[n-4],r[n-3]),a=r[n-14],c=r[n-13],h=k(r[n-30],r[n-29]),f=I(r[n-30],r[n-29]),d=r[n-32],y=r[n-31];r[n]=l(i,o,a,c,h,f,d,y),r[n+1]=p(i,o,a,c,h,f,d,y)}var g,b,m},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,i,a=this.W,u=this.h[0],c=this.h[1],l=this.h[2],p=this.h[3],b=this.h[4],m=this.h[5],v=this.h[6],k=this.h[7],I=this.h[8],R=this.h[9],B=this.h[10],T=this.h[11],U=this.h[12],O=this.h[13],C=this.h[14],P=this.h[15];o(this.k.length===a.length);for(var z=0;z<a.length;z+=2){var L=C,N=P,q=(i=void 0,(i=s(r=I,n=R,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),j=x(I,R),D=w(I,0,B,0,U),F=_(0,R,0,T,0,O),$=this.k[z],H=this.k[z+1],W=a[z],K=a[z+1],G=y(L,N,q,j,D,F,$,H,W,K),V=g(L,N,q,j,D,F,$,H,W,K);L=S(u,c),N=M(u,c),q=E(u,0,l,0,b),j=A(0,c,0,p,0,m);var J=f(L,N,q,j),Y=d(L,N,q,j);C=U,P=O,U=B,O=T,B=I,T=R,I=f(v,k,G,V),R=d(k,k,G,V),v=b,k=m,b=l,m=p,l=u,p=c,u=f(G,V,J,Y),c=d(G,V,J,Y)}h(this.h,0,u,c),h(this.h,2,l,p),h(this.h,4,b,m),h(this.h,6,v,k),h(this.h,8,I,R),h(this.h,10,B,T),h(this.h,12,U,O),h(this.h,14,C,P)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},4389:(e,t,r)=>{"use strict";var n=r(886).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},886:(e,t,r)=>{"use strict";var n=r(4076),i=r(3717);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=u(i.toString(16))}return r},t.zero2=a,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var s=new Array(o/4),a=0,u=t;a<s.length;a++,u+=4){var c;c="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],s[a]=c>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,u,c){var h=0,f=t;return h+=(f=f+n>>>0)<t?1:0,h+=(f=f+o>>>0)<o?1:0,h+=(f=f+a>>>0)<a?1:0,e+r+i+s+u+(h+=(f=f+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,u,c){return t+n+o+a+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},7905:(e,t,r)=>{"use strict";var n=r(1568),i=r(1784),o=r(4076);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},3575:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,h=-7,f=r?i-1:0,d=r?-1:1,l=e[t+f];for(f+=d,o=l&(1<<-h)-1,l>>=-h,h+=a;h>0;o=256*o+e[t+f],f+=d,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+e[t+f],f+=d,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=c}return(l?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,f=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+l]=255&a,l+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+l]=255&s,l+=p,s/=256,c-=8);e[r+l-p]|=128*y}},3717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6350:(e,t,r)=>{"use strict";const n=r(3141).v4,i=r(6661),o=function(e,t){if(!(this instanceof o))return new o(e,t);t||(t={}),this.options={reviver:void 0!==t.reviver?t.reviver:null,replacer:void 0!==t.replacer?t.replacer:null,generator:void 0!==t.generator?t.generator:function(){return n()},version:void 0!==t.version?t.version:2,notificationIdNull:"boolean"==typeof t.notificationIdNull&&t.notificationIdNull},this.callServer=e};e.exports=o,o.prototype.request=function(e,t,r,n){const o=this;let s=null;const a=Array.isArray(e)&&"function"==typeof t;if(1===this.options.version&&a)throw new TypeError("JSON-RPC 1.0 does not support batching");if(a||!a&&e&&"object"==typeof e&&"function"==typeof t)n=t,s=e;else{"function"==typeof r&&(n=r,r=void 0);const o="function"==typeof n;try{s=i(e,t,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(e){if(o)return n(e);throw e}if(!o)return s}let u;try{u=JSON.stringify(s,this.options.replacer)}catch(e){return n(e)}return this.callServer(u,(function(e,t){o._parseResponse(e,t,n)})),s},o.prototype._parseResponse=function(e,t,r){if(e)return void r(e);if(!t)return r();let n;try{n=JSON.parse(t,this.options.reviver)}catch(e){return r(e)}if(3===r.length){if(Array.isArray(n)){const e=function(e){return void 0!==e.error},t=function(t){return!e(t)};return r(null,n.filter(e),n.filter(t))}return r(null,n.error,n.result)}r(null,n)}},6661:(e,t,r)=>{"use strict";const n=r(3141).v4;e.exports=function(e,t,r,i){if("string"!=typeof e)throw new TypeError(e+" must be a string");const o="number"==typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw new TypeError(o+" must be 1 or 2");const s={method:e};if(2===o&&(s.jsonrpc="2.0"),t){if("object"!=typeof t&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");s.params=t}if(void 0===r){const e="function"==typeof i.generator?i.generator:function(){return n()};s.id=e(s,i)}else 2===o&&null===r?i.notificationIdNull&&(s.id=null):s.id=r;return s}},5498:(e,t,r)=>{var n;!function(){"use strict";var i="input is invalid type",o="object"==typeof window,s=o?window:{};s.JS_SHA3_NO_WINDOW&&(o=!1);var a=!o&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?s=r.g:a&&(s=self);var u=!s.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,h=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),d=[4,1024,262144,67108864],l=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],y=[224,256,384,512],g=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var v=function(e,t,r){return function(n){return new C(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,i){return new C(e,t,i).update(n)[r]()}},_=function(e,t,r){return function(t,n,i,o){return x["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return x["kmac"+e].update(t,n,i,o)[r]()}},A=function(e,t,r,n){for(var i=0;i<b.length;++i){var o=b[i];e[o]=t(r,n,o)}return e},S=function(e,t){var r=v(e,t,"hex");return r.create=function(){return new C(e,t,e)},r.update=function(e){return r.create().update(e)},A(r,v,e,t)},M=[{name:"keccak",padding:[1,256,65536,16777216],bits:y,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:y,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var r=w(e,t,"hex");return r.create=function(r){return new C(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},A(r,w,e,t)}},{name:"cshake",padding:d,bits:g,createMethod:function(e,t){var r=m[e],n=_(e,0,"hex");return n.create=function(n,i,o){return i||o?new C(e,t,n).bytepad([i,o],r):x["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},A(n,_,e,t)}},{name:"kmac",padding:d,bits:g,createMethod:function(e,t){var r=m[e],n=E(e,0,"hex");return n.create=function(n,i,o){return new P(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},A(n,E,e,t)}}],x={},k=[],I=0;I<M.length;++I)for(var R=M[I],B=R.bits,T=0;T<B.length;++T){var U=R.name+"_"+B[T];if(k.push(U),x[U]=R.createMethod(B[T],R.padding),"sha3"!==R.name){var O=R.name+B[T];k.push(O),x[O]=x[U]}}function C(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function P(e,t,r){C.call(this,e,t,r)}C.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,s=this.blocks,a=this.byteCount,u=e.length,c=this.blockCount,f=0,d=this.s;f<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<c+1;++n)s[n]=0;if(t)for(n=this.start;f<u&&n<a;++f)s[n>>2]|=e[f]<<l[3&n++];else for(n=this.start;f<u&&n<a;++f)(o=e.charCodeAt(f))<128?s[n>>2]|=o<<l[3&n++]:o<2048?(s[n>>2]|=(192|o>>6)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]):o<55296||o>=57344?(s[n>>2]|=(224|o>>12)<<l[3&n++],s[n>>2]|=(128|o>>6&63)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++f)),s[n>>2]|=(240|o>>18)<<l[3&n++],s[n>>2]|=(128|o>>12&63)<<l[3&n++],s[n>>2]|=(128|o>>6&63)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[c],n=0;n<c;++n)d[n]^=s[n];z(d),this.reset=!0}else this.start=n}return this},C.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},C.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,o=e.length;if(t)n=o;else for(var s=0;s<e.length;++s){var a=e.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(e),n},C.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];z(n)}},C.prototype.toString=C.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<t&&s<n;++o,++s)e=r[o],a+=f[e>>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];s%t==0&&(z(r),o=0)}return i&&(e=r[o],a+=f[e>>4&15]+f[15&e],i>1&&(a+=f[e>>12&15]+f[e>>8&15]),i>2&&(a+=f[e>>20&15]+f[e>>16&15])),a},C.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s<n;){for(o=0;o<t&&s<n;++o,++s)u[s]=r[o];s%t==0&&z(r)}return i&&(u[o]=r[o],e=e.slice(0,a)),e},C.prototype.buffer=C.prototype.arrayBuffer,C.prototype.digest=C.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)e=a<<2,t=n[s],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&z(n)}return o&&(e=a<<2,t=n[s],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},P.prototype=new C,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var z=function(e){var t,r,n,i,o,s,a,u,c,h,f,d,l,y,g,b,m,v,w,_,E,A,S,M,x,k,I,R,B,T,U,O,C,P,z,L,N,q,j,D,F,$,H,W,K,G,V,J,Y,Z,X,Q,ee,te,re,ne,ie,oe,se,ae,ue,ce,he;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(l=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(h<<1|f>>>31),r=a^(f<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(d<<1|l>>>31),r=c^(l<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,y=e[0],g=e[1],G=e[11]<<4|e[10]>>>28,V=e[10]<<4|e[11]>>>28,R=e[20]<<3|e[21]>>>29,B=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,$=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,P=e[2]<<1|e[3]>>>31,z=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,U=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,he=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,N=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,C=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,q=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,D=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=y^~b&v,e[1]=g^~m&w,e[10]=M^~k&R,e[11]=x^~I&B,e[20]=P^~L&q,e[21]=z^~N&j,e[30]=W^~G&J,e[31]=K^~V&Y,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=b^~v&_,e[3]=m^~w&E,e[12]=k^~R&T,e[13]=I^~B&U,e[22]=L^~q&D,e[23]=N^~j&F,e[32]=G^~J&Z,e[33]=V^~Y&X,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=v^~_&A,e[5]=w^~E&S,e[14]=R^~T&O,e[15]=B^~U&C,e[24]=q^~D&$,e[25]=j^~F&H,e[34]=J^~Z&Q,e[35]=Y^~X&ee,e[44]=oe^~ae&ce,e[45]=se^~ue&he,e[6]=_^~A&y,e[7]=E^~S&g,e[16]=T^~O&M,e[17]=U^~C&x,e[26]=D^~$&P,e[27]=F^~H&z,e[36]=Z^~Q&W,e[37]=X^~ee&K,e[46]=ae^~ce&te,e[47]=ue^~he&re,e[8]=A^~y&b,e[9]=S^~g&m,e[18]=O^~M&k,e[19]=C^~x&I,e[28]=$^~P&L,e[29]=H^~z&N,e[38]=Q^~W&G,e[39]=ee^~K&V,e[48]=ce^~te&ne,e[49]=he^~re&ie,e[0]^=p[n],e[1]^=p[n+1]};if(u)e.exports=x;else{for(I=0;I<k.length;++I)s[k[I]]=x[k[I]];c&&(void 0===(n=function(){return x}.call(t,r,t,e))||(e.exports=n))}}()},4076:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},1784:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},6770:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),s=new I(n||[]);return o._invoke=function(e,t,r){var n=f;return function(i,o){if(n===l)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return B()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=M(s,r);if(a){if(a===y)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var u=h(e,t,r);if("normal"===u.type){if(n=r.done?p:d,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(e,r,s),o}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",d="suspendedYield",l="executing",p="completed",y={};function g(){}function b(){}function m(){}var v={};u(v,o,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(R([])));_&&_!==r&&n.call(_,o)&&(v=_);var E=m.prototype=g.prototype=Object.create(v);function A(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(i,o,s,a){var u=h(e[i],e,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,a)}))}a(u.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function M(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,M(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var i=h(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function R(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}return{next:B}}function B(){return{value:t,done:!0}}return b.prototype=m,u(E,"constructor",m),u(m,"constructor",b),b.displayName=u(m,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,a,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},A(S.prototype),u(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new S(c(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},A(E),u(E,a,"Generator"),u(E,o,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=R,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},4217:(e,t,r)=>{"use strict";var n=r(3148),i=n(r(7599)),o=n(r(6852)),s=n(r(3729)),a=n(r(7972)),u=n(r(2905)),c=n(r(8721));n(r(2666)).default},2666:(e,t,r)=>{"use strict";var n=r(5326).Buffer,i=r(3148);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(r(9963)),s=i(r(9012)),a=i(r(9444)),u=i(r(6852)),c=i(r(7599)),h=i(r(3729)),f=i(r(7972)),d=i(r(2905)),l=r(8236);var p=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},y=function(e){(0,h.default)(m,e);var t,r,i,l,y,g,b=(y=m,g=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,d.default)(y);if(g){var r=(0,d.default)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,f.default)(this,e)});function m(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:8080",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;(0,u.default)(this,m);var o=n.autoconnect,s=void 0===o||o,a=n.reconnect,c=void 0===a||a,h=n.reconnect_interval,f=void 0===h?1e3:h,d=n.max_reconnects,l=void 0===d?5:d,y=p(n,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return(t=b.call(this)).webSocketFactory=e,t.queue={},t.rpc_id=0,t.address=r,t.autoconnect=s,t.ready=!1,t.reconnect=c,t.reconnect_interval=f,t.max_reconnects=l,t.rest_options=y,t.current_reconnects=0,t.generate_request_id=i||function(){return++t.rpc_id},t.autoconnect&&t._connect(t.address,Object.assign({autoconnect:t.autoconnect,reconnect:t.reconnect,reconnect_interval:t.reconnect_interval,max_reconnects:t.max_reconnects},t.rest_options)),t}return(0,c.default)(m,[{key:"connect",value:function(){this.socket||this._connect(this.address,Object.assign({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(e,t,r,n){var i=this;return n||"object"!==(0,a.default)(r)||(n=r,r=null),new Promise((function(o,s){if(!i.ready)return s(new Error("socket not ready"));var a=i.generate_request_id(e,t),u={jsonrpc:"2.0",method:e,params:t||null,id:a};i.socket.send(JSON.stringify(u),n,(function(e){if(e)return s(e);i.queue[a]={promise:[o,s]},r&&(i.queue[a].timeout=setTimeout((function(){delete i.queue[a],s(new Error("reply timeout"))}),r))}))}))}},{key:"login",value:(l=(0,s.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("rpc.login",t);case 2:if(r=e.sent){e.next=5;break}throw new Error("authentication failed");case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"listMethods",value:(i=(0,s.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("__listMethods");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"notify",value:function(e,t){var r=this;return new Promise((function(n,i){if(!r.ready)return i(new Error("socket not ready"));var o={jsonrpc:"2.0",method:e,params:t||null};r.socket.send(JSON.stringify(o),(function(e){if(e)return i(e);n()}))}))}},{key:"subscribe",value:(r=(0,s.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.on",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed subscribing to an event '"+t+"' with: "+r[t]);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"unsubscribe",value:(t=(0,s.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.off",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed unsubscribing from an event with: "+r);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"close",value:function(e,t){this.socket.close(e||1e3,t)}},{key:"_connect",value:function(e,t){var r=this;this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",(function(){r.ready=!0,r.emit("open"),r.current_reconnects=0})),this.socket.addEventListener("message",(function(e){var t=e.data;t instanceof ArrayBuffer&&(t=n.from(t).toString());try{t=JSON.parse(t)}catch(e){return}if(t.notification&&r.listeners(t.notification).length){if(!Object.keys(t.params).length)return r.emit(t.notification);var i=[t.notification];if(t.params.constructor===Object)i.push(t.params);else for(var o=0;o<t.params.length;o++)i.push(t.params[o]);return Promise.resolve().then((function(){r.emit.apply(r,i)}))}if(!r.queue[t.id])return t.method&&t.params?Promise.resolve().then((function(){r.emit(t.method,t.params)})):void 0;"error"in t=="result"in t&&r.queue[t.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),r.queue[t.id].timeout&&clearTimeout(r.queue[t.id].timeout),t.error?r.queue[t.id].promise[1](t.error):r.queue[t.id].promise[0](t.result),delete r.queue[t.id]})),this.socket.addEventListener("error",(function(e){return r.emit("error",e)})),this.socket.addEventListener("close",(function(n){var i=n.code,o=n.reason;r.ready&&setTimeout((function(){return r.emit("close",i,o)}),0),r.ready=!1,r.socket=void 0,1e3!==i&&(r.current_reconnects++,r.reconnect&&(r.max_reconnects>r.current_reconnects||0===r.max_reconnects)&&setTimeout((function(){return r._connect(e,t)}),r.reconnect_interval))}))}}]),m}(l.EventEmitter);t.default=y},8721:(e,t,r)=>{"use strict";var n=r(3148);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return new c(e,t)};var i=n(r(6852)),o=n(r(7599)),s=n(r(3729)),a=n(r(7972)),u=n(r(2905));var c=function(e){(0,s.default)(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,u.default)(t);if(r){var i=(0,u.default)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,a.default)(this,e)});function c(e,t,r){var o;return(0,i.default)(this,c),(o=n.call(this)).socket=new window.WebSocket(e,r),o.socket.onopen=function(){return o.emit("open")},o.socket.onmessage=function(e){return o.emit("message",e.data)},o.socket.onerror=function(e){return o.emit("error",e)},o.socket.onclose=function(e){o.emit("close",e.code,e.reason)},o}return(0,o.default)(c,[{key:"send",value:function(e,t,r){var n=r||t;try{this.socket.send(e),n()}catch(e){n(e)}}},{key:"close",value:function(e,t){this.socket.close(e,t)}},{key:"addEventListener",value:function(e,t,r){this.socket.addEventListener(e,t,r)}}]),c}(r(8236).EventEmitter)},7547:(e,t,r)=>{var n=r(5326),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},5293:(e,t,r)=>{e.exports=r(150)(r(4701))},4701:(e,t,r)=>{const n=new(0,r(2272).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function s(e){const t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){let r=new o(t);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let s=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===e!==s.isOdd()&&(s=s.redNeg()),n.keyPair({pub:{x:r,y:s}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){let s=new o(t),a=new o(r);if(s.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(s=s.toRed(i.red),a=a.toRed(i.red),(6===e||7===e)&&a.isOdd()!==(7===e))return null;const u=s.redSqr().redIMul(s);return a.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:a}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function a(e,t){const r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}e.exports={contextRandomize:()=>0,privateKeyVerify(e){const t=new o(e);return t.cmp(i.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new o(e),r=i.n.sub(t).umod(i.n).toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakAdd(e,t){const r=new o(t);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(e)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},privateKeyTweakMul(e,t){let r=new o(t);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(e)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},publicKeyVerify:e=>null===s(e)?1:0,publicKeyCreate(e,t){const r=new o(t);return r.cmp(i.n)>=0||r.isZero()?1:(a(e,n.keyFromPrivate(t).getPublic()),0)},publicKeyConvert(e,t){const r=s(t);return null===r?1:(a(e,r.getPublic()),0)},publicKeyNegate(e,t){const r=s(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),a(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=s(t[e]),null===r[e])return 1;let n=r[0].getPublic();for(let e=1;e<r.length;++e)n=n.add(r[e].pub);return n.isInfinity()?2:(a(e,n),0)},publicKeyTweakAdd(e,t,r){const n=s(t);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(a(e,u),0)},publicKeyTweakMul(e,t,r){const n=s(t);return null===n?1:(r=new o(r)).cmp(i.n)>=0||r.isZero()?2:(a(e,n.getPublic().mul(r)),0)},signatureNormalize(e){const t=new o(e.subarray(0,32)),r=new o(e.subarray(32,64));return t.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&e.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const r=t.subarray(0,32),n=t.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:s}=e;let a=s.subarray(4,37);a[0]=0,a.set(r,1);let u=33,c=0;for(;u>1&&0===a[c]&&!(128&a[c+1]);--u,++c);if(a=a.subarray(c),128&a[0])return 1;if(u>1&&0===a[0]&&!(128&a[1]))return 1;let h=s.subarray(39,72);h[0]=0,h.set(n,1);let f=33,d=0;for(;f>1&&0===h[d]&&!(128&h[d+1]);--f,++d);return h=h.subarray(d),128&h[0]||f>1&&0===h[0]&&!(128&h[1])?1:(e.outputlen=6+u+f,s[0]=48,s[1]=e.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+u]=2,s[5+u]=h.length,s.set(h,6+u),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const r=t[3];if(0===r)return 1;if(5+r>=t.length)return 1;if(2!==t[4+r])return 1;const n=t[5+r];if(0===n)return 1;if(6+r+n!==t.length)return 1;if(128&t[4])return 1;if(r>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[r+6])return 1;if(n>1&&0===t[r+6]&&!(128&t[r+7]))return 1;let s=t.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=t.subarray(6+r);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let u=new o(s);u.cmp(i.n)>=0&&(u=new o(0));let c=new o(t.subarray(6+r));return c.cmp(i.n)>=0&&(c=new o(0)),e.set(u.toArrayLike(Uint8Array,"be",32),0),e.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,s,a){if(a){const e=a;a=n=>{const i=e(t,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let c;try{c=n.sign(t,r,{canonical:!0,k:a,pers:s})}catch(e){return 1}return e.signature.set(c.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(c.s.toArrayLike(Uint8Array,"be",32),32),e.recid=c.recoveryParam,0},ecdsaVerify(e,t,r){const a={r:e.subarray(0,32),s:e.subarray(32,64)},u=new o(a.r),c=new o(a.s);if(u.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(1===c.cmp(n.nh)||u.isZero()||c.isZero())return 3;const h=s(r);if(null===h)return 2;const f=h.getPublic();return n.verify(t,a,f)?0:3},ecdsaRecover(e,t,r,s){const u={r:t.slice(0,32),s:t.slice(32,64)},c=new o(u.r),h=new o(u.s);if(c.cmp(i.n)>=0||h.cmp(i.n)>=0)return 1;if(c.isZero()||h.isZero())return 2;let f;try{f=n.recoverPubKey(s,u,r)}catch(e){return 2}return a(e,f),0},ecdh(e,t,r,a,u,c,h){const f=s(t);if(null===f)return 1;const d=new o(r);if(d.cmp(i.n)>=0||d.isZero())return 2;const l=f.getPublic().mul(d);if(void 0===u){const t=l.encode(null,!0),r=n.hash().update(t).digest();for(let t=0;t<32;++t)e[t]=r[t]}else{c||(c=new Uint8Array(32));const t=l.getX().toArray("be",32);for(let e=0;e<32;++e)c[e]=t[e];h||(h=new Uint8Array(32));const r=l.getY().toArray("be",32);for(let e=0;e<32;++e)h[e]=r[e];const n=u(c,h,a);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}}},150:e=>{const t="Impossible case. Please create issue.",r="The tweak was out of range or the resulted private key is invalid",n="The tweak was out of range or equal to zero",i="Public Key could not be parsed",o="Public Key serialization error",s="Signature could not be parsed";function a(e,t){if(!e)throw new Error(t)}function u(e,t,r){if(a(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;a(r.includes(t.length),n)}else{const n=`Expected ${e} to be an Uint8Array with length ${r}`;a(t.length===r,n)}}function c(e){a("Boolean"===f(e),"Expected compressed to be a Boolean")}function h(e=(e=>new Uint8Array(e)),t){return"function"==typeof e&&(e=e(t)),u("output",e,t),e}function f(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=e=>({contextRandomize(t){if(a(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&u("seed",t,32),1===e.contextRandomize(t))throw new Error("Unknow error on context randomization")},privateKeyVerify:t=>(u("private key",t,32),0===e.privateKeyVerify(t)),privateKeyNegate(r){switch(u("private key",r,32),e.privateKeyNegate(r)){case 0:return r;case 1:throw new Error(t)}},privateKeyTweakAdd(t,n){switch(u("private key",t,32),u("tweak",n,32),e.privateKeyTweakAdd(t,n)){case 0:return t;case 1:throw new Error(r)}},privateKeyTweakMul(t,r){switch(u("private key",t,32),u("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(n)}},publicKeyVerify:t=>(u("public key",t,[33,65]),0===e.publicKeyVerify(t)),publicKeyCreate(t,r=!0,n){switch(u("private key",t,32),c(r),n=h(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error("Private Key is invalid");case 2:throw new Error(o)}},publicKeyConvert(t,r=!0,n){switch(u("public key",t,[33,65]),c(r),n=h(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error(o)}},publicKeyNegate(r,n=!0,s){switch(u("public key",r,[33,65]),c(n),s=h(s,n?33:65),e.publicKeyNegate(s,r)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(t);case 3:throw new Error(o)}},publicKeyCombine(t,r=!0,n){a(Array.isArray(t),"Expected public keys to be an Array"),a(t.length>0,"Expected public keys array will have more than zero items");for(const e of t)u("public key",e,[33,65]);switch(c(r),n=h(n,r?33:65),e.publicKeyCombine(n,t)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error("The sum of the public keys is not valid");case 3:throw new Error(o)}},publicKeyTweakAdd(t,n,o=!0,s){switch(u("public key",t,[33,65]),u("tweak",n,32),c(o),s=h(s,o?33:65),e.publicKeyTweakAdd(s,t,n)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(r)}},publicKeyTweakMul(t,r,o=!0,s){switch(u("public key",t,[33,65]),u("tweak",r,32),c(o),s=h(s,o?33:65),e.publicKeyTweakMul(s,t,r)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(n)}},signatureNormalize(t){switch(u("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(s)}},signatureExport(r,n){u("signature",r,64);const i={output:n=h(n,72),outputlen:72};switch(e.signatureExport(i,r)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(s);case 2:throw new Error(t)}},signatureImport(r,n){switch(u("signature",r),n=h(n,64),e.signatureImport(n,r)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(t)}},ecdsaSign(r,n,i={},o){u("message",r,32),u("private key",n,32),a("Object"===f(i),"Expected options to be an Object"),void 0!==i.data&&u("options.data",i.data),void 0!==i.noncefn&&a("Function"===f(i.noncefn),"Expected options.noncefn to be a Function");const s={signature:o=h(o,64),recid:null};switch(e.ecdsaSign(s,r,n,i.data,i.noncefn)){case 0:return s;case 1:throw new Error("The nonce generation function failed, or the private key was invalid");case 2:throw new Error(t)}},ecdsaVerify(t,r,n){switch(u("signature",t,64),u("message",r,32),u("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(s);case 2:throw new Error(i)}},ecdsaRecover(r,n,i,o=!0,d){switch(u("signature",r,64),a("Number"===f(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),u("message",i,32),c(o),d=h(d,o?33:65),e.ecdsaRecover(d,r,n,i)){case 0:return d;case 1:throw new Error(s);case 2:throw new Error("Public key could not be recover");case 3:throw new Error(t)}},ecdh(t,r,n={},o){switch(u("public key",t,[33,65]),u("private key",r,32),a("Object"===f(n),"Expected options to be an Object"),void 0!==n.data&&u("options.data",n.data),void 0!==n.hashfn?(a("Function"===f(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&u("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&u("options.ybuf",n.ybuf,32),u("output",o)):o=h(o,32),e.ecdh(o,t,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return o;case 1:throw new Error(i);case 2:throw new Error("Scalar was invalid (zero or overflow)")}}})},9967:(e,t)=>{"use strict";function r(e,t,r){return t<=e&&e<=r}function n(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function i(e){this.tokens=[].slice.call(e)}i.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};var o=-1;function s(e,t){if(e)throw TypeError("Decoder error");return t||65533}var a="utf-8";function u(e,t){if(!(this instanceof u))return new u(e,t);if((e=void 0!==e?String(e).toLowerCase():a)!==a)throw new Error("Encoding not supported. Only utf-8 is supported");t=n(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function c(e,t){if(!(this instanceof c))return new c(e,t);if((e=void 0!==e?String(e).toLowerCase():a)!==a)throw new Error("Encoding not supported. Only utf-8 is supported");t=n(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function h(e){var t=e.fatal,n=0,i=0,a=0,u=128,c=191;this.handler=function(e,h){if(-1===h&&0!==a)return a=0,s(t);if(-1===h)return o;if(0===a){if(r(h,0,127))return h;if(r(h,194,223))a=1,n=h-192;else if(r(h,224,239))224===h&&(u=160),237===h&&(c=159),a=2,n=h-224;else{if(!r(h,240,244))return s(t);240===h&&(u=144),244===h&&(c=143),a=3,n=h-240}return n<<=6*a,null}if(!r(h,u,c))return n=a=i=0,u=128,c=191,e.prepend(h),s(t);if(u=128,c=191,n+=h-128<<6*(a-(i+=1)),i!==a)return null;var f=n;return n=a=i=0,f}}function f(e){e.fatal,this.handler=function(e,t){if(-1===t)return o;if(r(t,0,127))return t;var n,i;r(t,128,2047)?(n=1,i=192):r(t,2048,65535)?(n=2,i=224):r(t,65536,1114111)&&(n=3,i=240);for(var s=[(t>>6*n)+i];n>0;){var a=t>>6*(n-1);s.push(128|63&a),n-=1}return s}}u.prototype={decode:function(e,t){var r;r="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=n(t),this._streaming||(this._decoder=new h({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var s,a=new i(r),u=[];!a.endOfStream()&&(s=this._decoder.handler(a,a.read()))!==o;)null!==s&&(Array.isArray(s)?u.push.apply(u,s):u.push(s));if(!this._streaming){do{if((s=this._decoder.handler(a,a.read()))===o)break;null!==s&&(Array.isArray(s)?u.push.apply(u,s):u.push(s))}while(!a.endOfStream());this._decoder=null}return u.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===u[0]?(this._BOMseen=!0,u.shift()):this._BOMseen=!0)),function(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return t}(u)}},c.prototype={encode:function(e,t){e=e?String(e):"",t=n(t),this._streaming||(this._encoder=new f(this._options)),this._streaming=Boolean(t.stream);for(var r,s=[],a=new i(function(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var o=t.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=e.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=1023&o,u=1023&s;i.push(65536+(a<<10)+u),n+=1}else i.push(65533)}n+=1}return i}(e));!a.endOfStream()&&(r=this._encoder.handler(a,a.read()))!==o;)Array.isArray(r)?s.push.apply(s,r):s.push(r);if(!this._streaming){for(;(r=this._encoder.handler(a,a.read()))!==o;)Array.isArray(r)?s.push.apply(s,r):s.push(r);this._encoder=null}return new Uint8Array(s)}},t.TextEncoder=c,t.TextDecoder=u},5474:(e,t,r)=>{!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),a=t([1]),u=t([56129,1]),c=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),l=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function y(e,t,r,n,i){var o,s=0;for(o=0;o<i;o++)s|=e[t+o]^r[n+o];return(1&s-1>>>8)-1}function g(e,t,r,n){return y(e,t,r,n,16)}function b(e,t,r,n){return y(e,t,r,n,32)}function m(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=o,E=s,A=a,S=u,M=c,x=h,k=f,I=d,R=l,B=p,T=y,U=g,O=b,C=m,P=v,z=w,L=0;L<20;L+=2)_^=(i=(O^=(i=(R^=(i=(M^=(i=_+O|0)<<7|i>>>25)+_|0)<<9|i>>>23)+M|0)<<13|i>>>19)+R|0)<<18|i>>>14,x^=(i=(E^=(i=(C^=(i=(B^=(i=x+E|0)<<7|i>>>25)+x|0)<<9|i>>>23)+B|0)<<13|i>>>19)+C|0)<<18|i>>>14,T^=(i=(k^=(i=(A^=(i=(P^=(i=T+k|0)<<7|i>>>25)+T|0)<<9|i>>>23)+P|0)<<13|i>>>19)+A|0)<<18|i>>>14,z^=(i=(U^=(i=(I^=(i=(S^=(i=z+U|0)<<7|i>>>25)+z|0)<<9|i>>>23)+S|0)<<13|i>>>19)+I|0)<<18|i>>>14,_^=(i=(S^=(i=(A^=(i=(E^=(i=_+S|0)<<7|i>>>25)+_|0)<<9|i>>>23)+E|0)<<13|i>>>19)+A|0)<<18|i>>>14,x^=(i=(M^=(i=(I^=(i=(k^=(i=x+M|0)<<7|i>>>25)+x|0)<<9|i>>>23)+k|0)<<13|i>>>19)+I|0)<<18|i>>>14,T^=(i=(B^=(i=(R^=(i=(U^=(i=T+B|0)<<7|i>>>25)+T|0)<<9|i>>>23)+U|0)<<13|i>>>19)+R|0)<<18|i>>>14,z^=(i=(P^=(i=(C^=(i=(O^=(i=z+P|0)<<7|i>>>25)+z|0)<<9|i>>>23)+O|0)<<13|i>>>19)+C|0)<<18|i>>>14;_=_+o|0,E=E+s|0,A=A+a|0,S=S+u|0,M=M+c|0,x=x+h|0,k=k+f|0,I=I+d|0,R=R+l|0,B=B+p|0,T=T+y|0,U=U+g|0,O=O+b|0,C=C+m|0,P=P+v|0,z=z+w|0,e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=M>>>0&255,e[17]=M>>>8&255,e[18]=M>>>16&255,e[19]=M>>>24&255,e[20]=x>>>0&255,e[21]=x>>>8&255,e[22]=x>>>16&255,e[23]=x>>>24&255,e[24]=k>>>0&255,e[25]=k>>>8&255,e[26]=k>>>16&255,e[27]=k>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=R>>>0&255,e[33]=R>>>8&255,e[34]=R>>>16&255,e[35]=R>>>24&255,e[36]=B>>>0&255,e[37]=B>>>8&255,e[38]=B>>>16&255,e[39]=B>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=U>>>0&255,e[45]=U>>>8&255,e[46]=U>>>16&255,e[47]=U>>>24&255,e[48]=O>>>0&255,e[49]=O>>>8&255,e[50]=O>>>16&255,e[51]=O>>>24&255,e[52]=C>>>0&255,e[53]=C>>>8&255,e[54]=C>>>16&255,e[55]=C>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,n)}function v(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=0;_<20;_+=2)o^=(i=(b^=(i=(l^=(i=(c^=(i=o+b|0)<<7|i>>>25)+o|0)<<9|i>>>23)+c|0)<<13|i>>>19)+l|0)<<18|i>>>14,h^=(i=(s^=(i=(m^=(i=(p^=(i=h+s|0)<<7|i>>>25)+h|0)<<9|i>>>23)+p|0)<<13|i>>>19)+m|0)<<18|i>>>14,y^=(i=(f^=(i=(a^=(i=(v^=(i=y+f|0)<<7|i>>>25)+y|0)<<9|i>>>23)+v|0)<<13|i>>>19)+a|0)<<18|i>>>14,w^=(i=(g^=(i=(d^=(i=(u^=(i=w+g|0)<<7|i>>>25)+w|0)<<9|i>>>23)+u|0)<<13|i>>>19)+d|0)<<18|i>>>14,o^=(i=(u^=(i=(a^=(i=(s^=(i=o+u|0)<<7|i>>>25)+o|0)<<9|i>>>23)+s|0)<<13|i>>>19)+a|0)<<18|i>>>14,h^=(i=(c^=(i=(d^=(i=(f^=(i=h+c|0)<<7|i>>>25)+h|0)<<9|i>>>23)+f|0)<<13|i>>>19)+d|0)<<18|i>>>14,y^=(i=(p^=(i=(l^=(i=(g^=(i=y+p|0)<<7|i>>>25)+y|0)<<9|i>>>23)+g|0)<<13|i>>>19)+l|0)<<18|i>>>14,w^=(i=(v^=(i=(m^=(i=(b^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+b|0)<<13|i>>>19)+m|0)<<18|i>>>14;e[0]=o>>>0&255,e[1]=o>>>8&255,e[2]=o>>>16&255,e[3]=o>>>24&255,e[4]=h>>>0&255,e[5]=h>>>8&255,e[6]=h>>>16&255,e[7]=h>>>24&255,e[8]=y>>>0&255,e[9]=y>>>8&255,e[10]=y>>>16&255,e[11]=y>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=f>>>0&255,e[17]=f>>>8&255,e[18]=f>>>16&255,e[19]=f>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(e,t,r,n,i,o,s){var a,u,c=new Uint8Array(16),h=new Uint8Array(64);for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=o[u];for(;i>=64;){for(m(h,c,s,w),u=0;u<64;u++)e[t+u]=r[n+u]^h[u];for(a=1,u=8;u<16;u++)a=a+(255&c[u])|0,c[u]=255&a,a>>>=8;i-=64,t+=64,n+=64}if(i>0)for(m(h,c,s,w),u=0;u<i;u++)e[t+u]=r[n+u]^h[u];return 0}function E(e,t,r,n,i){var o,s,a=new Uint8Array(16),u=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=n[s];for(;r>=64;){for(m(u,a,i,w),s=0;s<64;s++)e[t+s]=u[s];for(o=1,s=8;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,t+=64}if(r>0)for(m(u,a,i,w),s=0;s<r;s++)e[t+s]=u[s];return 0}function A(e,t,r,n,i){var o=new Uint8Array(32);v(o,n,i,w);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=n[a+16];return E(e,t,r,s,o)}function S(e,t,r,n,i,o,s){var a=new Uint8Array(32);v(a,o,s,w);for(var u=new Uint8Array(8),c=0;c<8;c++)u[c]=o[c+16];return _(e,t,r,n,i,u,a)}var M=function(e){var t,r,n,i,o,s,a,u;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,s=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(o>>>14|s<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(s>>>11|a<<5),u=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function x(e,t,r,n,i,o){var s=new M(o);return s.update(r,n,i),s.finish(e,t),0}function k(e,t,r,n,i,o){var s=new Uint8Array(16);return x(s,0,r,n,i,o),g(e,t,s,0)}function I(e,t,r,n,i){var o;if(r<32)return-1;for(S(e,0,t,0,r,n,i),x(e,16,e,32,r-32,e),o=0;o<16;o++)e[o]=0;return 0}function R(e,t,r,n,i){var o,s=new Uint8Array(32);if(r<32)return-1;if(A(s,0,32,n,i),0!==k(t,16,t,32,r-32,s))return-1;for(S(e,0,t,0,r,n,i),o=0;o<32;o++)e[o]=0;return 0}function B(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function T(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function U(e,t,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function O(e,r){var n,i,o,s=t(),a=t();for(n=0;n<16;n++)a[n]=r[n];for(T(a),T(a),T(a),i=0;i<2;i++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,U(a,s,1-o)}for(n=0;n<16;n++)e[2*n]=255&a[n],e[2*n+1]=a[n]>>8}function C(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return O(r,e),O(n,t),b(r,0,n,0)}function P(e){var t=new Uint8Array(32);return O(t,e),1&t[0]}function z(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function L(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function N(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function q(e,t,r){var n,i,o=0,s=0,a=0,u=0,c=0,h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,v=0,w=0,_=0,E=0,A=0,S=0,M=0,x=0,k=0,I=0,R=0,B=0,T=0,U=0,O=0,C=0,P=0,z=r[0],L=r[1],N=r[2],q=r[3],j=r[4],D=r[5],F=r[6],$=r[7],H=r[8],W=r[9],K=r[10],G=r[11],V=r[12],J=r[13],Y=r[14],Z=r[15];o+=(n=t[0])*z,s+=n*L,a+=n*N,u+=n*q,c+=n*j,h+=n*D,f+=n*F,d+=n*$,l+=n*H,p+=n*W,y+=n*K,g+=n*G,b+=n*V,m+=n*J,v+=n*Y,w+=n*Z,s+=(n=t[1])*z,a+=n*L,u+=n*N,c+=n*q,h+=n*j,f+=n*D,d+=n*F,l+=n*$,p+=n*H,y+=n*W,g+=n*K,b+=n*G,m+=n*V,v+=n*J,w+=n*Y,_+=n*Z,a+=(n=t[2])*z,u+=n*L,c+=n*N,h+=n*q,f+=n*j,d+=n*D,l+=n*F,p+=n*$,y+=n*H,g+=n*W,b+=n*K,m+=n*G,v+=n*V,w+=n*J,_+=n*Y,E+=n*Z,u+=(n=t[3])*z,c+=n*L,h+=n*N,f+=n*q,d+=n*j,l+=n*D,p+=n*F,y+=n*$,g+=n*H,b+=n*W,m+=n*K,v+=n*G,w+=n*V,_+=n*J,E+=n*Y,A+=n*Z,c+=(n=t[4])*z,h+=n*L,f+=n*N,d+=n*q,l+=n*j,p+=n*D,y+=n*F,g+=n*$,b+=n*H,m+=n*W,v+=n*K,w+=n*G,_+=n*V,E+=n*J,A+=n*Y,S+=n*Z,h+=(n=t[5])*z,f+=n*L,d+=n*N,l+=n*q,p+=n*j,y+=n*D,g+=n*F,b+=n*$,m+=n*H,v+=n*W,w+=n*K,_+=n*G,E+=n*V,A+=n*J,S+=n*Y,M+=n*Z,f+=(n=t[6])*z,d+=n*L,l+=n*N,p+=n*q,y+=n*j,g+=n*D,b+=n*F,m+=n*$,v+=n*H,w+=n*W,_+=n*K,E+=n*G,A+=n*V,S+=n*J,M+=n*Y,x+=n*Z,d+=(n=t[7])*z,l+=n*L,p+=n*N,y+=n*q,g+=n*j,b+=n*D,m+=n*F,v+=n*$,w+=n*H,_+=n*W,E+=n*K,A+=n*G,S+=n*V,M+=n*J,x+=n*Y,k+=n*Z,l+=(n=t[8])*z,p+=n*L,y+=n*N,g+=n*q,b+=n*j,m+=n*D,v+=n*F,w+=n*$,_+=n*H,E+=n*W,A+=n*K,S+=n*G,M+=n*V,x+=n*J,k+=n*Y,I+=n*Z,p+=(n=t[9])*z,y+=n*L,g+=n*N,b+=n*q,m+=n*j,v+=n*D,w+=n*F,_+=n*$,E+=n*H,A+=n*W,S+=n*K,M+=n*G,x+=n*V,k+=n*J,I+=n*Y,R+=n*Z,y+=(n=t[10])*z,g+=n*L,b+=n*N,m+=n*q,v+=n*j,w+=n*D,_+=n*F,E+=n*$,A+=n*H,S+=n*W,M+=n*K,x+=n*G,k+=n*V,I+=n*J,R+=n*Y,B+=n*Z,g+=(n=t[11])*z,b+=n*L,m+=n*N,v+=n*q,w+=n*j,_+=n*D,E+=n*F,A+=n*$,S+=n*H,M+=n*W,x+=n*K,k+=n*G,I+=n*V,R+=n*J,B+=n*Y,T+=n*Z,b+=(n=t[12])*z,m+=n*L,v+=n*N,w+=n*q,_+=n*j,E+=n*D,A+=n*F,S+=n*$,M+=n*H,x+=n*W,k+=n*K,I+=n*G,R+=n*V,B+=n*J,T+=n*Y,U+=n*Z,m+=(n=t[13])*z,v+=n*L,w+=n*N,_+=n*q,E+=n*j,A+=n*D,S+=n*F,M+=n*$,x+=n*H,k+=n*W,I+=n*K,R+=n*G,B+=n*V,T+=n*J,U+=n*Y,O+=n*Z,v+=(n=t[14])*z,w+=n*L,_+=n*N,E+=n*q,A+=n*j,S+=n*D,M+=n*F,x+=n*$,k+=n*H,I+=n*W,R+=n*K,B+=n*G,T+=n*V,U+=n*J,O+=n*Y,C+=n*Z,w+=(n=t[15])*z,s+=38*(E+=n*N),a+=38*(A+=n*q),u+=38*(S+=n*j),c+=38*(M+=n*D),h+=38*(x+=n*F),f+=38*(k+=n*$),d+=38*(I+=n*H),l+=38*(R+=n*W),p+=38*(B+=n*K),y+=38*(T+=n*G),g+=38*(U+=n*V),b+=38*(O+=n*J),m+=38*(C+=n*Y),v+=38*(P+=n*Z),o=(n=(o+=38*(_+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=u,e[4]=c,e[5]=h,e[6]=f,e[7]=d,e[8]=l,e[9]=p,e[10]=y,e[11]=g,e[12]=b,e[13]=m,e[14]=v,e[15]=w}function j(e,t){q(e,t,t)}function D(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)j(i,i),2!==n&&4!==n&&q(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function F(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)j(i,i),1!==n&&q(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function $(e,r,n){var i,o,s=new Uint8Array(32),a=new Float64Array(80),c=t(),h=t(),f=t(),d=t(),l=t(),p=t();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,z(a,n),o=0;o<16;o++)h[o]=a[o],d[o]=c[o]=f[o]=0;for(c[0]=d[0]=1,o=254;o>=0;--o)U(c,h,i=s[o>>>3]>>>(7&o)&1),U(f,d,i),L(l,c,f),N(c,c,f),L(f,h,d),N(h,h,d),j(d,l),j(p,c),q(c,f,c),q(f,h,l),L(l,c,f),N(c,c,f),j(h,c),N(f,d,p),q(c,f,u),L(c,c,d),q(f,f,c),q(c,d,p),q(d,h,a),j(h,l),U(c,h,i),U(f,d,i);for(o=0;o<16;o++)a[o+16]=c[o],a[o+32]=f[o],a[o+48]=h[o],a[o+64]=d[o];var y=a.subarray(32),g=a.subarray(16);return D(y,y),q(g,g,y),O(e,g),0}function H(e,t){return $(e,t,o)}function W(e,t){return n(t,32),H(e,t)}function K(e,t,r){var n=new Uint8Array(32);return $(n,r,t),v(e,i,n,w)}M.prototype.blocks=function(e,t,r){for(var n,i,o,s,a,u,c,h,f,d,l,p,y,g,b,m,v,w,_,E=this.fin?0:2048,A=this.h[0],S=this.h[1],M=this.h[2],x=this.h[3],k=this.h[4],I=this.h[5],R=this.h[6],B=this.h[7],T=this.h[8],U=this.h[9],O=this.r[0],C=this.r[1],P=this.r[2],z=this.r[3],L=this.r[4],N=this.r[5],q=this.r[6],j=this.r[7],D=this.r[8],F=this.r[9];r>=16;)d=f=0,d+=(A+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*O,d+=(S+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*F),d+=(M+=8191&(i>>>10|(o=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*D),d+=(x+=8191&(o>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*j),f=(d+=(k+=8191&(s>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*q))>>>13,d&=8191,d+=(I+=a>>>1&8191)*(5*N),d+=(R+=8191&(a>>>14|(u=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*L),d+=(B+=8191&(u>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),d+=(T+=8191&(c>>>8|(h=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*P),l=f+=(d+=(U+=h>>>5|E)*(5*C))>>>13,l+=A*C,l+=S*O,l+=M*(5*F),l+=x*(5*D),f=(l+=k*(5*j))>>>13,l&=8191,l+=I*(5*q),l+=R*(5*N),l+=B*(5*L),l+=T*(5*z),f+=(l+=U*(5*P))>>>13,l&=8191,p=f,p+=A*P,p+=S*C,p+=M*O,p+=x*(5*F),f=(p+=k*(5*D))>>>13,p&=8191,p+=I*(5*j),p+=R*(5*q),p+=B*(5*N),p+=T*(5*L),y=f+=(p+=U*(5*z))>>>13,y+=A*z,y+=S*P,y+=M*C,y+=x*O,f=(y+=k*(5*F))>>>13,y&=8191,y+=I*(5*D),y+=R*(5*j),y+=B*(5*q),y+=T*(5*N),g=f+=(y+=U*(5*L))>>>13,g+=A*L,g+=S*z,g+=M*P,g+=x*C,f=(g+=k*O)>>>13,g&=8191,g+=I*(5*F),g+=R*(5*D),g+=B*(5*j),g+=T*(5*q),b=f+=(g+=U*(5*N))>>>13,b+=A*N,b+=S*L,b+=M*z,b+=x*P,f=(b+=k*C)>>>13,b&=8191,b+=I*O,b+=R*(5*F),b+=B*(5*D),b+=T*(5*j),m=f+=(b+=U*(5*q))>>>13,m+=A*q,m+=S*N,m+=M*L,m+=x*z,f=(m+=k*P)>>>13,m&=8191,m+=I*C,m+=R*O,m+=B*(5*F),m+=T*(5*D),v=f+=(m+=U*(5*j))>>>13,v+=A*j,v+=S*q,v+=M*N,v+=x*L,f=(v+=k*z)>>>13,v&=8191,v+=I*P,v+=R*C,v+=B*O,v+=T*(5*F),w=f+=(v+=U*(5*D))>>>13,w+=A*D,w+=S*j,w+=M*q,w+=x*N,f=(w+=k*L)>>>13,w&=8191,w+=I*z,w+=R*P,w+=B*C,w+=T*O,_=f+=(w+=U*(5*F))>>>13,_+=A*F,_+=S*D,_+=M*j,_+=x*q,f=(_+=k*N)>>>13,_&=8191,_+=I*L,_+=R*z,_+=B*P,_+=T*C,A=d=8191&(f=(f=((f+=(_+=U*O)>>>13)<<2)+f|0)+(d&=8191)|0),S=l+=f>>>=13,M=p&=8191,x=y&=8191,k=g&=8191,I=b&=8191,R=m&=8191,B=v&=8191,T=w&=8191,U=_&=8191,t+=16,r-=16;this.h[0]=A,this.h[1]=S,this.h[2]=M,this.h[3]=x,this.h[4]=k,this.h[5]=I,this.h[6]=R,this.h[7]=B,this.h[8]=T,this.h[9]=U},M.prototype.finish=function(e,t){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},M.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var G=I,V=R,J=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Y(e,t,r,n){for(var i,o,s,a,u,c,h,f,d,l,p,y,g,b,m,v,w,_,E,A,S,M,x,k,I,R,B=new Int32Array(16),T=new Int32Array(16),U=e[0],O=e[1],C=e[2],P=e[3],z=e[4],L=e[5],N=e[6],q=e[7],j=t[0],D=t[1],F=t[2],$=t[3],H=t[4],W=t[5],K=t[6],G=t[7],V=0;n>=128;){for(E=0;E<16;E++)A=8*E+V,B[E]=r[A+0]<<24|r[A+1]<<16|r[A+2]<<8|r[A+3],T[E]=r[A+4]<<24|r[A+5]<<16|r[A+6]<<8|r[A+7];for(E=0;E<80;E++)if(i=U,o=O,s=C,a=P,u=z,c=L,h=N,d=j,l=D,p=F,y=$,g=H,b=W,m=K,x=65535&(M=G),k=M>>>16,I=65535&(S=q),R=S>>>16,x+=65535&(M=(H>>>14|z<<18)^(H>>>18|z<<14)^(z>>>9|H<<23)),k+=M>>>16,I+=65535&(S=(z>>>14|H<<18)^(z>>>18|H<<14)^(H>>>9|z<<23)),R+=S>>>16,x+=65535&(M=H&W^~H&K),k+=M>>>16,I+=65535&(S=z&L^~z&N),R+=S>>>16,x+=65535&(M=J[2*E+1]),k+=M>>>16,I+=65535&(S=J[2*E]),R+=S>>>16,S=B[E%16],k+=(M=T[E%16])>>>16,I+=65535&S,R+=S>>>16,I+=(k+=(x+=65535&M)>>>16)>>>16,x=65535&(M=_=65535&x|k<<16),k=M>>>16,I=65535&(S=w=65535&I|(R+=I>>>16)<<16),R=S>>>16,x+=65535&(M=(j>>>28|U<<4)^(U>>>2|j<<30)^(U>>>7|j<<25)),k+=M>>>16,I+=65535&(S=(U>>>28|j<<4)^(j>>>2|U<<30)^(j>>>7|U<<25)),R+=S>>>16,k+=(M=j&D^j&F^D&F)>>>16,I+=65535&(S=U&O^U&C^O&C),R+=S>>>16,f=65535&(I+=(k+=(x+=65535&M)>>>16)>>>16)|(R+=I>>>16)<<16,v=65535&x|k<<16,x=65535&(M=y),k=M>>>16,I=65535&(S=a),R=S>>>16,k+=(M=_)>>>16,I+=65535&(S=w),R+=S>>>16,O=i,C=o,P=s,z=a=65535&(I+=(k+=(x+=65535&M)>>>16)>>>16)|(R+=I>>>16)<<16,L=u,N=c,q=h,U=f,D=d,F=l,$=p,H=y=65535&x|k<<16,W=g,K=b,G=m,j=v,E%16==15)for(A=0;A<16;A++)S=B[A],x=65535&(M=T[A]),k=M>>>16,I=65535&S,R=S>>>16,S=B[(A+9)%16],x+=65535&(M=T[(A+9)%16]),k+=M>>>16,I+=65535&S,R+=S>>>16,w=B[(A+1)%16],x+=65535&(M=((_=T[(A+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),k+=M>>>16,I+=65535&(S=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),R+=S>>>16,w=B[(A+14)%16],k+=(M=((_=T[(A+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,I+=65535&(S=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,B[A]=65535&I|R<<16,T[A]=65535&x|k<<16;x=65535&(M=j),k=M>>>16,I=65535&(S=U),R=S>>>16,S=e[0],k+=(M=t[0])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[0]=U=65535&I|R<<16,t[0]=j=65535&x|k<<16,x=65535&(M=D),k=M>>>16,I=65535&(S=O),R=S>>>16,S=e[1],k+=(M=t[1])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[1]=O=65535&I|R<<16,t[1]=D=65535&x|k<<16,x=65535&(M=F),k=M>>>16,I=65535&(S=C),R=S>>>16,S=e[2],k+=(M=t[2])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[2]=C=65535&I|R<<16,t[2]=F=65535&x|k<<16,x=65535&(M=$),k=M>>>16,I=65535&(S=P),R=S>>>16,S=e[3],k+=(M=t[3])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[3]=P=65535&I|R<<16,t[3]=$=65535&x|k<<16,x=65535&(M=H),k=M>>>16,I=65535&(S=z),R=S>>>16,S=e[4],k+=(M=t[4])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[4]=z=65535&I|R<<16,t[4]=H=65535&x|k<<16,x=65535&(M=W),k=M>>>16,I=65535&(S=L),R=S>>>16,S=e[5],k+=(M=t[5])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[5]=L=65535&I|R<<16,t[5]=W=65535&x|k<<16,x=65535&(M=K),k=M>>>16,I=65535&(S=N),R=S>>>16,S=e[6],k+=(M=t[6])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[6]=N=65535&I|R<<16,t[6]=K=65535&x|k<<16,x=65535&(M=G),k=M>>>16,I=65535&(S=q),R=S>>>16,S=e[7],k+=(M=t[7])>>>16,I+=65535&S,R+=S>>>16,R+=(I+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,e[7]=q=65535&I|R<<16,t[7]=G=65535&x|k<<16,V+=128,n-=128}return n}function Z(e,t,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,Y(i,o,t,r),r%=128,n=0;n<r;n++)s[n]=t[a-r+n];for(s[r]=128,s[(r=256-128*(r<112?1:0))-9]=0,p(s,r-8,a/536870912|0,a<<3),Y(i,o,s,r),n=0;n<8;n++)p(e,8*n,i[n],o[n]);return 0}function X(e,r){var n=t(),i=t(),o=t(),s=t(),a=t(),u=t(),c=t(),f=t(),d=t();N(n,e[1],e[0]),N(d,r[1],r[0]),q(n,n,d),L(i,e[0],e[1]),L(d,r[0],r[1]),q(i,i,d),q(o,e[3],r[3]),q(o,o,h),q(s,e[2],r[2]),L(s,s,s),N(a,i,n),N(u,s,o),L(c,s,o),L(f,i,n),q(e[0],a,u),q(e[1],f,c),q(e[2],c,u),q(e[3],a,f)}function Q(e,t,r){var n;for(n=0;n<4;n++)U(e[n],t[n],r)}function ee(e,r){var n=t(),i=t(),o=t();D(o,r[2]),q(n,r[0],o),q(i,r[1],o),O(e,i),e[31]^=P(n)<<7}function te(e,t,r){var n,i;for(B(e[0],s),B(e[1],a),B(e[2],a),B(e[3],s),i=255;i>=0;--i)Q(e,t,n=r[i/8|0]>>(7&i)&1),X(t,e),X(e,e),Q(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];B(n[0],f),B(n[1],d),B(n[2],a),q(n[3],f,d),te(e,n,r)}function ne(e,r,i){var o,s=new Uint8Array(64),a=[t(),t(),t(),t()];for(i||n(r,32),Z(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,re(a,s),ee(e,a),o=0;o<32;o++)r[o+32]=e[o];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function oe(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*ie[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*ie[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ie[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function se(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;oe(e,r)}function ae(e,r,n,i){var o,s,a=new Uint8Array(64),u=new Uint8Array(64),c=new Uint8Array(64),h=new Float64Array(64),f=[t(),t(),t(),t()];Z(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var d=n+64;for(o=0;o<n;o++)e[64+o]=r[o];for(o=0;o<32;o++)e[32+o]=a[32+o];for(Z(c,e.subarray(32),n+32),se(c),re(f,c),ee(e,f),o=32;o<64;o++)e[o]=i[o];for(Z(u,e,n+64),se(u),o=0;o<64;o++)h[o]=0;for(o=0;o<32;o++)h[o]=c[o];for(o=0;o<32;o++)for(s=0;s<32;s++)h[o+s]+=u[o]*a[s];return oe(e.subarray(32),h),d}function ue(e,r,n,i){var o,u=new Uint8Array(32),h=new Uint8Array(64),f=[t(),t(),t(),t()],d=[t(),t(),t(),t()];if(n<64)return-1;if(function(e,r){var n=t(),i=t(),o=t(),u=t(),h=t(),f=t(),d=t();return B(e[2],a),z(e[1],r),j(o,e[1]),q(u,o,c),N(o,o,e[2]),L(u,e[2],u),j(h,u),j(f,h),q(d,f,h),q(n,d,o),q(n,n,u),F(n,n),q(n,n,o),q(n,n,u),q(n,n,u),q(e[0],n,u),j(i,e[0]),q(i,i,u),C(i,o)&&q(e[0],e[0],l),j(i,e[0]),q(i,i,u),C(i,o)?-1:(P(e[0])===r[31]>>7&&N(e[0],s,e[0]),q(e[3],e[0],e[1]),0)}(d,i))return-1;for(o=0;o<n;o++)e[o]=r[o];for(o=0;o<32;o++)e[o+32]=i[o];if(Z(h,e,n),se(h),te(f,d,h),re(d,r.subarray(32)),X(f,d),ee(u,f),n-=64,b(r,0,u,0)){for(o=0;o<n;o++)e[o]=0;return-1}for(o=0;o<n;o++)e[o]=r[o+64];return n}var ce=64,he=32,fe=64;function de(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function le(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function pe(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:v,crypto_stream_xor:S,crypto_stream:A,crypto_stream_salsa20_xor:_,crypto_stream_salsa20:E,crypto_onetimeauth:x,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:b,crypto_secretbox:I,crypto_secretbox_open:R,crypto_scalarmult:$,crypto_scalarmult_base:H,crypto_box_beforenm:K,crypto_box_afternm:G,crypto_box:function(e,t,r,n,i,o){var s=new Uint8Array(32);return K(s,i,o),G(e,t,r,n,s)},crypto_box_open:function(e,t,r,n,i,o){var s=new Uint8Array(32);return K(s,i,o),V(e,t,r,n,s)},crypto_box_keypair:W,crypto_hash:Z,crypto_sign:ae,crypto_sign_keypair:ne,crypto_sign_open:ue,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ce,crypto_sign_PUBLICKEYBYTES:he,crypto_sign_SECRETKEYBYTES:fe,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:c,L:ie,pack25519:O,unpack25519:z,M:q,A:L,S:j,Z:N,pow2523:F,add:X,set25519:B,modL:oe,scalarmult:te,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,r){le(e,t,r),de(r,t);for(var n=new Uint8Array(32+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+32]=e[o];return I(i,n,n.length,t,r),i.subarray(16)},e.secretbox.open=function(e,t,r){le(e,t,r),de(r,t);for(var n=new Uint8Array(16+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+16]=e[o];return n.length<32||0!==R(i,n,n.length,t,r)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(le(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return $(r,e,t),r},e.scalarMult.base=function(e){if(le(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox(t,r,o)},e.box.before=function(e,t){le(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return K(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox.open(t,r,o)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return W(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(le(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return H(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(le(e,t),t.length!==fe)throw new Error("bad secret key size");var r=new Uint8Array(ce+e.length);return ae(r,e,e.length,t),r},e.sign.open=function(e,t){if(le(e,t),t.length!==he)throw new Error("bad public key size");var r=new Uint8Array(e.length),n=ue(r,e,e.length,t);if(n<0)return null;for(var i=new Uint8Array(n),o=0;o<i.length;o++)i[o]=r[o];return i},e.sign.detached=function(t,r){for(var n=e.sign(t,r),i=new Uint8Array(ce),o=0;o<i.length;o++)i[o]=n[o];return i},e.sign.detached.verify=function(e,t,r){if(le(e,t,r),t.length!==ce)throw new Error("bad signature size");if(r.length!==he)throw new Error("bad public key size");var n,i=new Uint8Array(ce+e.length),o=new Uint8Array(ce+e.length);for(n=0;n<ce;n++)i[n]=t[n];for(n=0;n<e.length;n++)i[n+ce]=e[n];return ue(o,i,i.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(he),t=new Uint8Array(fe);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(le(e),e.length!==fe)throw new Error("bad secret key size");for(var t=new Uint8Array(he),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(le(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(he),r=new Uint8Array(fe),n=0;n<32;n++)r[n]=e[n];return ne(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=he,e.sign.secretKeyLength=fe,e.sign.seedLength=32,e.sign.signatureLength=ce,e.hash=function(e){le(e);var t=new Uint8Array(64);return Z(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return le(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===y(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=i[n];pe(i)})):(t=r(6835))&&t.randomBytes&&e.setPRNG((function(e,r){var n,i=t.randomBytes(r);for(n=0;n<r;n++)e[n]=i[n];pe(i)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},3141:(e,t,r)=>{"use strict";var n;r.d(t,{v4:()=>h});var i=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const 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(e){return"string"==typeof e&&s.test(e)};for(var u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));const h=function(e,t,r){var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r}(n)}},9046:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;const n=r(8624);class i extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n.default(this.serialize(),o,2)}}function o(e,t){if("[Circular]"!==t)return t}t.EthereumRpcError=i,t.EthereumProviderError=class extends i{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},2468:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},535:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;const n=r(9046),i=r(7473),o=r(2468);function s(e,t){const[r,o]=u(t);return new n.EthereumRpcError(e,r||i.getMessageFromCode(e),o)}function a(e,t){const[r,o]=u(t);return new n.EthereumProviderError(e,r||i.getMessageFromCode(e),o)}function u(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}t.ethErrors={rpc:{parse:e=>s(o.errorCodes.rpc.parse,e),invalidRequest:e=>s(o.errorCodes.rpc.invalidRequest,e),invalidParams:e=>s(o.errorCodes.rpc.invalidParams,e),methodNotFound:e=>s(o.errorCodes.rpc.methodNotFound,e),internal:e=>s(o.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:e=>s(o.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>s(o.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>s(o.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>s(o.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>s(o.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>s(o.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>a(o.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(o.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(o.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(o.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(o.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:i}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,i)}}}},3596:(e,t,r)=>{"use strict";t.Cg=t.Sy=void 0;const n=r(9046);Object.defineProperty(t,"Cg",{enumerable:!0,get:function(){return n.EthereumRpcError}});r(7473);const i=r(535);Object.defineProperty(t,"Sy",{enumerable:!0,get:function(){return i.ethErrors}});r(2468)},7473:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=r(2468),i=r(9046),o=n.errorCodes.rpc.internal,s={code:o,message:a(o)};function a(e,r="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const r=e.toString();if(f(n.errorValues,r))return n.errorValues[r].message;if(c(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function u(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!n.errorValues[t]||!!c(e)}function c(e){return e>=-32099&&e<=-32e3}function h(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=a,t.isValidCode=u,t.serializeError=function(e,{fallbackError:t=s,shouldIncludeStack:r=!1}={}){var n,o;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();const c={};if(e&&"object"==typeof e&&!Array.isArray(e)&&f(e,"code")&&u(e.code)){const t=e;c.code=t.code,t.message&&"string"==typeof t.message?(c.message=t.message,f(t,"data")&&(c.data=t.data)):(c.message=a(c.code),c.data={originalError:h(e)})}else{c.code=t.code;const r=null===(n=e)||void 0===n?void 0:n.message;c.message=r&&"string"==typeof r?r:t.message,c.data={originalError:h(e)}}const d=null===(o=e)||void 0===o?void 0:o.stack;return r&&e&&d&&"string"==typeof d&&(c.stack=d),c}},8624:e=>{e.exports=s,s.default=s,s.stable=h,s.stableStringify=h;var t="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=o()),u(e,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(e,t,r):JSON.stringify(e,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function a(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:e}),n.push([o,r,t,s])):i.push([t,r,e]):(o[r]=e,n.push([o,r,t]))}function u(e,n,i,o,s,c,h){var f;if(c+=1,"object"==typeof e&&null!==e){for(f=0;f<o.length;f++)if(o[f]===e)return void a(r,e,n,s);if(void 0!==h.depthLimit&&c>h.depthLimit)return void a(t,e,n,s);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void a(t,e,n,s);if(o.push(e),Array.isArray(e))for(f=0;f<e.length;f++)u(e[f],f,f,o,e,c,h);else{var d=Object.keys(e);for(f=0;f<d.length;f++){var l=d[f];u(e[l],l,f,o,e,c,h)}}o.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function h(e,t,r,s){void 0===s&&(s=o());var a,u=f(e,"",0,[],void 0,0,s)||e;try{a=0===i.length?JSON.stringify(u,t,r):JSON.stringify(u,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function f(e,i,o,s,u,h,d){var l;if(h+=1,"object"==typeof e&&null!==e){for(l=0;l<s.length;l++)if(s[l]===e)return void a(r,e,i,u);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&h>d.depthLimit)return void a(t,e,i,u);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void a(t,e,i,u);if(s.push(e),Array.isArray(e))for(l=0;l<e.length;l++)f(e[l],l,l,s,e,h,d);else{var p={},y=Object.keys(e).sort(c);for(l=0;l<y.length;l++){var g=y[l];f(e[g],g,l,s,e,h,d),p[g]=e[g]}if(void 0===u)return p;n.push([u,i,e]),u[i]=p}s.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===t&&o[0]===r){r=o[2],i.splice(n,1);break}}return e.call(this,t,r)}}},1160:()=>{},5377:()=>{},3325:()=>{},9312:()=>{},6835:()=>{},7330:e=>{"use strict";e.exports={i8:"6.5.4"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.r(n);var e={};r.r(e),r.d(e,{DEBUG_LOGGER_STORAGE_KEY:()=>b,EXT_PORT_CS_TO_BG:()=>y,EXT_PORT_UI_TO_BG:()=>g,JS_BRIDGE_MESSAGE_DIRECTION:()=>p,JS_BRIDGE_MESSAGE_EXT_CHANNEL:()=>d,JS_BRIDGE_MESSAGE_EXT_PING:()=>l,JS_BRIDGE_MESSAGE_IPC_CHANNEL:()=>f});var t=r(8298);function i(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class o extends t{emit(e,...t){return super.emit(e,...t)}addListener(e,t){return super.addListener(e,t),this}on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}removeListener(e,t){return super.removeListener(e,t),this}off(e,t){return super.off(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}setMaxListeners(e){return super.setMaxListeners(e),this}getMaxListeners(){return super.getMaxListeners()}listeners(e){return super.listeners(e)}rawListeners(e){return super.rawListeners(e)}listenerCount(e){return super.listenerCount(e)}prependListener(e,t){return super.prependListener(e,t),this}prependOnceListener(e,t){return super.prependOnceListener(e,t),this}eventNames(){return super.eventNames()}}class s extends o{emit(e,...t){let r="error"===e;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const o=n[e];if(void 0===o)return!1;if("function"==typeof o)i(o,this,t);else{const e=o.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(o);for(let n=0;n<e;n+=1)i(r[n],this,t)}return!0}}var a=r(8395),u=r(2788),c=r(4554),h=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const f="onekey@JS_BRIDGE_MESSAGE_IPC_CHANNEL",d="onekey@JS_BRIDGE_MESSAGE_EXT_CHANNEL",l="onekey@JS_BRIDGE_MESSAGE_EXT_PING",p={HOST_TO_INPAGE:"onekey@JS_BRIDGE_MESSAGE_DIRECTION-HOST_TO_INPAGE",INPAGE_TO_HOST:"onekey@JS_BRIDGE_MESSAGE_DIRECTION-INPAGE_TO_HOST"},y="onekey@EXT_PORT_CS_TO_BG",g="onekey@EXT_PORT_UI_TO_BG",b="$$ONEKEY_DEBUG_LOGGER";var m=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const v=b,w={formatArgs:function(e){if(e[0]=`${(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")}+${w.humanize(this.diff)}`,!this.useColors)return;const t=`color: ${this.color}`;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r+=1,"%c"===e&&(n=r))})),e.splice(n,0,t)},save:function(e){return m(this,void 0,void 0,(function*(){try{e?yield w.storage.setItem(v,e):yield w.storage.removeItem(v)}catch(e){console.error("debug logger storage error",e)}}))},load:function(){return m(this,void 0,void 0,(function*(){let e;try{e=yield w.storage.getItem(v)}catch(e){console.error("debug logger storage error",e)}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}))},useColors:function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}};w.storage=function(){try{return"undefined"!=typeof global&&global.$$onekeyAppStorage?global.$$onekeyAppStorage:"undefined"!=typeof window&&window.localStorage?window.localStorage:(console.warn("debugLogger init warning, neither `global.$$onekeyAppStorage` nor `window.localStorage` found."),{getItem(){return m(this,void 0,void 0,(function*(){return""}))},setItem(){return m(this,void 0,void 0,(function*(){}))},removeItem(){return m(this,void 0,void 0,(function*(){}))}})}catch(e){console.error("debug logger storage error",e)}}(),w.humanize=c,w.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),w.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],w.log=(...e)=>{console.debug?console.debug(...e):console.log&&console.log(...e)};const _=w;const E=function(){return e=this,t=void 0,n=function*(){return function(e){return h(this,void 0,void 0,(function*(){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>`-${e}`))].join(",");return t.enable(""),e},t.enable=function(e){return h(this,void 0,void 0,(function*(){let r;yield t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp(`^${e.substr(1)}$`)):t.names.push(new RegExp(`^${e}$`)))}))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=c,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={j(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: ${e.message}`}}},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]};const i=yield t.load();return yield t.enable(i),t}))}(_)},new((r=void 0)||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}));var e,t,r,n};function A(...e){"undefined"!=typeof localStorage&&localStorage.getItem(b)&&console.error(...e)}const S={_isFakeLogger:!0,log:(...e)=>{},warn:(...e)=>{},error:(...e)=>{},debug:(...e)=>{},info:(...e)=>{},trace:(...e)=>{}};var M;!function(e){e.jsBridge="jsBridge",e.providerBase="providerBase",e.extInjected="extInjected",e.extContentScripts="extContentScripts",e.webview="webview",e.desktopInjected="desktopInjected",e.ethereum="ethereum"}(M||(M={}));class x extends s{constructor(){super(),this.jsBridge=(...e)=>null,this.providerBase=(...e)=>null,this.extInjected=(...e)=>null,this.extContentScripts=(...e)=>null,this.webview=(...e)=>null,this.desktopInjected=(...e)=>null,this.ethereum=(...e)=>null,this._debug={enable(e){}},this._externalLogger=S,this._createExternalLog=e=>(...t)=>{var r,n;return this.once("debugReady",(()=>{var r;null===(r=this[e])||void 0===r||r.call(this,...t)})),null===(n=null===(r=this._externalLogger)||void 0===r?void 0:r.log)||void 0===n?void 0:n.call(r,`${e} >>> `,...t)},this.initExternalLogInstances()}initExternalLogInstances(){Object.keys(M).forEach((e=>{this[e]=this._createExternalLog(e)}))}isDebugReady(){return this._debug&&"function"==typeof this._debug}_attachExternalLogger(e){e&&(this._externalLogger=e)}_createDebugInstance(e){}}const k=new x,I=new class extends x{constructor(){super(),this._debugInstanceCreatedMap={},E().then((e=>{this._debug=e,this.initDebugInstances(),this.emit("debugReady")}))}initDebugInstances(){this.isDebugReady()&&Object.keys(M).forEach((e=>{this[e]=this._debug(e)}))}_createDebugInstance(e){if(!this._debugInstanceCreatedMap[e]&&(this._debugInstanceCreatedMap[e]=!0,e&&this._debug&&"function"==typeof this._debug)){const t=this._debug(e),r=this[e];this[e]=(...e)=>{t(...e),r&&"function"==typeof r&&r(...e)}}}};var R,B;!function(e){e.RESPONSE="RESPONSE",e.REQUEST="REQUEST"}(R||(R={})),function(e){e.ethereum="ethereum",e.conflux="conflux",e.solana="solana",e.starcoin="starcoin",e.sollet="sollet",e.near="near",e.aptos="aptos",e.martian="martian",e.$private="$private",e.$hardware_sdk="$hardware_sdk"}(B||(B={}));var T=r(9439);class U extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return T(this.serialize(),C,2)}}class O extends U{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function C(e,t){if("[Circular]"!==t)return t}const P=-32600,z=-32603,L=4100,N=4500,q={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Web3 provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4500:{standard:"",message:"The request by this Web3 provider is timeout."}};function j(e,t="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const t=e.toString();if(r=q,n=t,Object.prototype.hasOwnProperty.call(r,n))return q[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return"Unspecified server error."}var r,n;return t}j(z);const D=e=>H(P,e),F=e=>W(L,e),$=e=>W(N,e);function H(e,t){const[r,n]=K(t);return new U(e,r||j(e),n)}function W(e,t){const[r,n]=K(t);return new O(e,r||j(e),n)}function K(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}const G="1.0.4";const V="undefined"!=typeof window?window:global,J="message",Y="error";class Z extends s{constructor(e={}){var t,r;super(),this._requestPayloadCache={},this.isExtUi=!1,this.isInjected=!1,this.sendAsString=!0,this.globalOnMessageEnabled=!0,this.providersHub={},this.globalOnMessage=e=>{return t=this,r=void 0,i=function*(){try{if(this.config.receiveHandler&&this.globalOnMessageEnabled){const t=yield this.config.receiveHandler(e,this);e.id&&this.response({id:e.id,scope:e.scope,remoteId:e.remoteId,data:t})}}catch(t){e.id&&e.type===R.REQUEST&&this.responseError({id:e.id,scope:e.scope,remoteId:e.remoteId,error:t}),this.emit(Y,t)}},new((n=void 0)||(n=Promise))((function(e,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,a)}u((i=i.apply(t,r||[])).next())}));var t,r,n,i},this.version=G,this.remoteInfo={origin:"",remoteId:""},this.callbacksExpireTimeout=6e5,this.debugLogger=I,this.callbacks=[],this.callbackId=1,this.config=e,this.callbacksExpireTimeout=null!==(t=e.timeout)&&void 0!==t?t:this.callbacksExpireTimeout,this.debugLogger=e.debugLogger||I,this.sendAsString=null!==(r=e.sendAsString)&&void 0!==r?r:this.sendAsString,this.config.receiveHandler&&this.on(J,this.globalOnMessage),this.on(Y,(e=>{var t;A("JsBridge ERROR: ",e,{code:null===(t=e)||void 0===t?void 0:t.code})})),this.rejectExpiredCallbacks()}attachProviderInstance(e){var t;const r=e.providerName;r&&(this.providersHub[r]=null!==(t=this.providersHub[r])&&void 0!==t?t:[],this.providersHub[r].push(e))}createCallbackId(){return this.callbackId+=1,this.callbackId}createPayload(e,{resolve:t,reject:r}){const{id:n,type:i}=e;if(t&&r&&n&&i===R.REQUEST){if(this.callbacks[n])throw new Error(`JsBridge ERROR: callback exists, id=${n}`);this.callbacks[n]={id:n,resolve:t,reject:r,created:Date.now()}}if(e.error){const t=e.error;e.error=function(e){return{name:e.name,message:e.message,stack:e.stack,code:e.code,data:e.data,key:e.key,info:e.info,className:e.className}}(t)}return null==e||delete e.resolve,null==e||delete e.reject,e}send({type:e,data:t,error:r,id:n,remoteId:i,sync:o=!1,scope:s}){const a=(a,u)=>{var c,h,f;let d=n;o||e!==R.REQUEST||(d=this.createCallbackId());try{const n=this.createPayload({id:d,data:t,error:r,type:e,origin:(null===(c=null==V?void 0:V.location)||void 0===c?void 0:c.origin)||"",remoteId:i,scope:s},{resolve:a,reject:u});let o=n;this.sendAsString&&(o=JSON.stringify(n)),(null===(h=this.debugLogger.jsBridge)||void 0===h?void 0:h.enabled)&&n&&n.id&&n.type===R.REQUEST&&(this._requestPayloadCache[n.id]=n,n.id%100==0&&(this._requestPayloadCache={})),this.debugLogger.jsBridge("send",n,"\r\n ------\x3e ",n.data,"\r\n ------\x3e ",null===(f=n.data)||void 0===f?void 0:f.result),this.sendPayload(o)}catch(e){d?this.rejectCallback(d,e):this.emit(Y,e)}};if(!o)return new Promise(a);a()}rejectCallback(e,t){this.processCallback({method:"reject",id:e,error:t})}resolveCallback(e,t){this.processCallback({method:"resolve",id:e,data:t})}processCallback({method:e,id:t,data:r,error:n}){const i=this.callbacks[t];i&&("reject"===e&&(i.reject&&i.reject(n),this.emit(Y,n)),"resolve"===e&&i.resolve&&i.resolve(r),this.clearCallbackCache(t))}rejectExpiredCallbacks(){if(!this.callbacksExpireTimeout)return;const e=Date.now();for(const t in this.callbacks){const r=this.callbacks[t];if(r&&r.created&&e-r.created>this.callbacksExpireTimeout){const e=$();this.rejectCallback(t,e)}}setTimeout((()=>{this.rejectExpiredCallbacks()}),this.callbacksExpireTimeout)}clearCallbackCache(e){delete this.callbacks[e]}receive(e="",t){var r,n,i,o,s;let c={data:null};if(a(e)&&(c=e),u(e))try{c=JSON.parse(e)}catch(p){throw this.emit(Y,p),new Error("JsBridge ERROR: JSON.parse payloadReceived failed")}if(c.origin=null==t?void 0:t.origin,c.internal=Boolean(null==t?void 0:t.internal),(null==t?void 0:t.internal)&&this.isExtUi&&function(e){const t=e;return Boolean(t.name)&&["onekey-provider-eth","onekey-provider-cfx","publicConfig"].includes(t.name)}(c))return;if(!c.origin&&!this.isInjected)throw A(null===(r=null==this?void 0:this.constructor)||void 0===r?void 0:r.name,"[payload.origin] is missing.",this),new Error("JsBridge ERROR: receive message [payload.origin] is required.");if(!c.internal&&!c.scope)throw new Error("JsBridge ERROR: receive message [payload.scope] is required for non-internal method call.");const h=null!==(i=this._requestPayloadCache[null!==(n=null==c?void 0:c.id)&&void 0!==n?n:""])&&void 0!==i?i:null;this.debugLogger.jsBridge("receive",c,{sender:t},"\r\n -----\x3e ",null!==(s=null===(o=c.data)||void 0===o?void 0:o.result)&&void 0!==s?s:c.data,"\r\n <----- ",null==h?void 0:h.data);const{type:f,id:d,data:l,error:p,origin:y,remoteId:g}=c;if(this.remoteInfo={origin:y,remoteId:g},f===R.RESPONSE){if(null==d)throw new Error("JsBridge ERROR: parameter [id] is required in JsBridge.receive() when REQUEST type message");if(this.callbacks[d])try{p?this.rejectCallback(d,p):this.resolveCallback(d,l)}catch(e){this.emit(Y,e)}}else{if(f!==R.REQUEST)throw new Error(`JsBridge ERROR: payload type not support yet (type=${f||"undefined"})`);{const e=Object.assign(Object.assign({},c),{created:Date.now()});this.emit(J,e)}}}requestSync({data:e,scope:t,remoteId:r}){this.send({id:void 0,type:R.REQUEST,scope:t,data:e,remoteId:r,sync:!0})}request(e){const{data:t,remoteId:r,scope:n}=e;return void 0===t&&console.warn("JsBridge ERROR: data required. Call like `bridge.request({ data: {...} });`"),this.send({type:R.REQUEST,data:t,remoteId:r,sync:!1,scope:n})}response({id:e,data:t,remoteId:r,scope:n}){this.send({type:R.RESPONSE,data:t,id:e,remoteId:r,scope:n,sync:!0})}responseError({id:e,error:t,scope:r,remoteId:n}){this.send({type:R.RESPONSE,error:t,id:e,remoteId:n,scope:r,sync:!0})}}var X=r(5920),Q=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};function ee(e){return new Promise(((t,r)=>{try{const r=document.createElement("img");r.onload=()=>t(!0),r.onerror=()=>t(!1),r.src=e}catch(e){r(e)}}))}function te(e){const{document:t}=e,r=t.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;const n=t.querySelector('head > meta[name="title"]');return n?n.content:t.title&&t.title.length>0?t.title:window.location.hostname}function re(e){return Q(this,void 0,void 0,(function*(){const{document:t}=e,r=t.querySelectorAll('head > link[rel~="icon"]');for(const e of r)if(e&&(yield ee(e.href)))return e.href;return null}))}const ne={getSiteMetadata:function(){return Q(this,void 0,void 0,(function*(){return{name:te(window),icon:yield re(window)}}))},getSiteIcon:re,getSiteName:te,imgExists:ee};var ie=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class oe extends s{constructor(e){var t,r,n;if(super(),this.version=G,this.isOneKey=!0,this.debugLogger=k,this.logger=S,!e.bridge)throw new Error("ProviderBase init error: bridge required.");this.config=e,this.bridge=e.bridge,this.logger=e.logger||S,this.debugLogger=(null===(t=this.bridge)||void 0===t?void 0:t.debugLogger)||k,null===(n=null===(r=this.bridge)||void 0===r?void 0:r.debugLogger)||void 0===n||n._attachExternalLogger(this.logger),setTimeout((()=>{this.bridge.attachProviderInstance(this)}),0)}configDebugLogger(e){try{if(!e||!this.bridge.debugLogger)return;const t=this.bridge.debugLogger;(e.enabledKeys||[]).forEach((e=>{t._createDebugInstance(e)})),e.config&&t._debug.enable(e.config),window.$onekey=window.$onekey||{},window.$onekey.$debugLogger=t}catch(e){A("configDebugLogger ERROR:",e)}}getConnectWalletInfo({timeout:e=3e3}={}){return ie(this,void 0,void 0,(function*(){return new Promise(((t,r)=>ie(this,void 0,void 0,(function*(){const r=setTimeout((()=>{t(null)}),e);try{const e=yield this.bridgeRequest({method:"wallet_getConnectWalletInfo",params:[{time:Date.now()}]});e&&(e.providerState=e.providerState||{}),e&&e.debugLoggerConfig&&this.configDebugLogger(e.debugLoggerConfig),e&&e.walletInfo&&(window.$onekey=window.$onekey||{},window.$onekey.$walletInfo=e.walletInfo),t(e||null)}catch(e){A("getConnectWalletInfo: ERROR",e),t(null)}finally{clearTimeout(r)}}))))}))}bridgeRequest(e,t){var r,n,i,o;return ie(this,void 0,void 0,(function*(){let s=!1;t&&X(t)&&(s=!0);try{const a={data:null!=e?e:{},scope:this.providerName};this.debugLogger.providerBase("bridgeRequest:",a,"\r\n -----\x3e ",a.data);const u=yield this.bridge.request(a);u&&(u.id=null!==(n=null!==(r=null==e?void 0:e.id)&&void 0!==r?r:u.id)&&void 0!==n?n:void 0,u.jsonrpc=null!==(o=null!==(i=null==e?void 0:e.jsonrpc)&&void 0!==i?i:u.jsonrpc)&&void 0!==o?o:"2.0");const c=u?u.result:void 0;return t&&s&&t(null,u),this.debugLogger.providerBase("bridgeRequest RETURN:",{req:a,res:u},"\r\n -----\x3e ",a.data,"\r\n -----\x3e ",c),c}catch(e){throw t&&s&&t(e),e}}))}sendSiteMetadataDomReady(){if("complete"===document.readyState)this.sendSiteMetadata();else{const e=()=>{this.sendSiteMetadata(),window.removeEventListener("DOMContentLoaded",e)};window.addEventListener("DOMContentLoaded",e)}}sendSiteMetadata(){return ie(this,void 0,void 0,(function*(){const e=yield ne.getSiteMetadata();return yield this.bridgeRequest({method:"wallet_sendSiteMetadata",params:e})}))}}function se(e){var t;return window.global=window.global||window||window.globalThis,window.global=window.global||window||window.globalThis,(null===(t=null===window||void 0===window?void 0:window.$onekey)||void 0===t?void 0:t.jsBridge)||(window.$onekey=window.$onekey||{},window.$onekey.jsBridge=e(),"undefined"!=typeof localStorage&&localStorage.getItem(b)&&console.log("===== jsBridge injected success! >>>>> ",performance.now())),window.$onekey.jsBridge}function ae(e,t){const r=(null==t?void 0:t.providersHub)||window.$onekey,n=e.scope,i=e.data;if(!n)return void A("providerName (scope) is required in injectedProviderReceiveHandler.");const o=[].concat(r[n]).filter(Boolean);o&&o.length?o.forEach((e=>{e&&e.emit&&e.emit("message_low_level",i)})):A(`[${n}] provider is NOT injected to document or bridge.`)}const{JS_BRIDGE_MESSAGE_DIRECTION:ue,JS_BRIDGE_MESSAGE_EXT_CHANNEL:ce}=e;function he(e={}){return se((()=>new de(Object.assign(Object.assign({},e),{receiveHandler:ae}))))}let fe=!1;class de extends Z{constructor(e){super(e),this.sendAsString=!1,this.isInjected=!0,function(e={}){const t=e.debugLogger||k;fe||(fe=!0,window.addEventListener("message",(r=>{var n,i;if(r.source!==window)return;const o=r.data;if(o.channel===ce&&o.direction===ue.HOST_TO_INPAGE){t.extInjected("onWindowPostMessage",o);const r=o.payload,s=null!==(n=e.bridge)&&void 0!==n?n:null===(i=null===window||void 0===window?void 0:window.$onekey)||void 0===i?void 0:i.jsBridge;s&&s.receive(r)}}),!1))}({debugLogger:this.debugLogger,bridge:this})}sendPayload(e){window.postMessage({channel:ce,direction:ue.INPAGE_TO_HOST,payload:e})}}var le=r(8429),pe=r(9378);const ye={errors:{disconnected:()=>"MetaMask: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"MetaMask: Disconnected from MetaMask background. Page reload required.",sendSiteMetadata:()=>"MetaMask: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`MetaMask: Connected to chain with ID "${e}".`},warnings:{enableDeprecation:"MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",sendDeprecation:"MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",events:{close:"MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"},experimentalMethods:"MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning."}},ge=()=>{},be=["eth_subscription"];var me=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class ve extends oe{constructor(e){var t;super(e),this.providerName=B.ethereum,this.isMetaMask=!0,this._log=null!==(t=e.logger)&&void 0!==t?t:window.console,this._state=Object.assign({},ve._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this),this._handleStreamDisconnect.bind(this,"OneKey"),this.on("connect",(()=>{this._state.isConnected=!0})),this._handleStreamDisconnect.bind(this,"OneKey RpcProvider"),this._initializeState(),this.on("message_low_level",(e=>{const{method:t,params:r}=e;"metamask_accountsChanged"===t?this._handleAccountsChanged(r):"metamask_unlockStateChanged"===t?this._handleUnlockStateChanged(r):"metamask_chainChanged"===t?this._handleChainChanged(r):be.includes(t)?this.emit("message",{type:t,data:r}):"METAMASK_STREAM_FAILURE"===t&&new Error(ye.errors.permanentlyDisconnected())}))}isConnected(){return this._state.isConnected}request(e){return me(this,void 0,void 0,(function*(){if(I.ethereum("request",e),!e||"object"!=typeof e||Array.isArray(e))throw le.Sy.rpc.invalidRequest({message:ye.errors.invalidRequestArgs(),data:e});const{method:t,params:r,id:n}=e;if(!t||"string"!=typeof t||0===t.length)throw le.Sy.rpc.invalidRequest({message:ye.errors.invalidRequestMethod(),data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw le.Sy.rpc.invalidRequest({message:ye.errors.invalidRequestParams(),data:e});const i=yield this._rpcRequest({method:t,params:r,id:n});return I.ethereum("request->response","\n",e,"\n ---\x3e ",i),i}))}_initializeState(){return me(this,void 0,void 0,(function*(){try{const e=yield this.request({method:"metamask_getProviderState"}),{accounts:t,chainId:r,isUnlocked:n,networkVersion:i}=e;this.emit("connect",{chainId:r}),this._handleChainChanged({chainId:r,networkVersion:i}),this._handleUnlockStateChanged({accounts:t,isUnlocked:n}),this._handleAccountsChanged(t)}catch(e){this._log.error("MetaMask: Failed to get initial state. Please report this bug.",e)}finally{this._state.initialized=!0,this.emit("_initialized")}}))}_rpcRequest(e,t){return me(this,void 0,void 0,(function*(){if(!Array.isArray(e)){e.jsonrpc||(e.jsonrpc="2.0");const r=yield this.bridgeRequest(e,t);return"eth_accounts"!==e.method&&"eth_requestAccounts"!==e.method||this._handleAccountsChanged(r||[],"eth_accounts"===e.method),r}return this.bridgeRequest(e,t)}))}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),this._log.debug(ye.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let r;this._state.isConnected=!1,e?(r=new le.Cg(1013,t||ye.errors.disconnected()),this._log.debug(r)):(r=new le.Cg(1011,t||ye.errors.permanentlyDisconnected()),this._log.error(r),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r)}}_handleStreamDisconnect(e,t){!function(e,t,r,n){let i=`MetaMask: Lost connection to "${t}".`;(null==r?void 0:r.stack)&&(i+=`\n${r.stack}`),e.warn(i),n&&n.listenerCount("error")>0&&n.emit("error",i)}(this._log,e,t,this),this._handleDisconnect(!1,t?t.message:void 0)}_handleChainChanged({chainId:e,networkVersion:t}={}){e&&"string"==typeof e&&e.startsWith("0x")&&t&&"string"==typeof t?"loading"===t?this._handleDisconnect(!0):(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId))):this._log.error("MetaMask: Received invalid network parameters. Please report this bug.",{chainId:e,networkVersion:t})}_handleAccountsChanged(e,t=!1){let r=e;Array.isArray(e)||(this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.",e),r=[]);for(const t of e)if("string"!=typeof t){this._log.error("MetaMask: Received non-string account. Please report this bug.",e),r=[];break}pe(this._state.accounts,r)||(t&&null!==this._state.accounts&&this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.",r),this._state.accounts=r,this.selectedAddress!==r[0]&&(this.selectedAddress=r[0]||null),this._state.initialized&&this.emit("accountsChanged",r))}_handleUnlockStateChanged({accounts:e,isUnlocked:t}={}){"boolean"==typeof t?t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e||[])):this._log.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.")}}ve._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1};var we=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class _e extends ve{constructor(e){super(e),this._sentWarnings={enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},this.networkVersion=null,this.isMetaMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._metamask=this._getExperimentalApi(),this.bridge.on("notification",(e=>{const{method:t}=e;if(be.includes(t)){this.emit("data",e);const t=e.params;this.emit("notification",t.result)}}))}sendAsync(e,t){this._rpcRequest(e,t)}addListener(e,t){return this._warnOfDeprecation(e),super.addListener(e,t)}on(e,t){return this._warnOfDeprecation(e),super.on(e,t)}once(e,t){return this._warnOfDeprecation(e),super.once(e,t)}prependListener(e,t){return this._warnOfDeprecation(e),super.prependListener(e,t)}prependOnceListener(e,t){return this._warnOfDeprecation(e),super.prependOnceListener(e,t)}_handleDisconnect(e,t){super._handleDisconnect(e,t),this.networkVersion&&!e&&(this.networkVersion=null)}_warnOfDeprecation(e){var t;!1===(null===(t=this._sentWarnings)||void 0===t?void 0:t.events[e])&&(this._log.warn(ye.warnings.events[e]),this._sentWarnings.events[e]=!0)}enable(){return we(this,void 0,void 0,(function*(){return this._sentWarnings.enable||(this._log.warn(ye.warnings.enableDeprecation),this._sentWarnings.enable=!0),yield this._rpcRequest({method:"eth_requestAccounts",params:[]})}))}_rpcResult(e,t){var r,n;return{id:null!==(r=null==t?void 0:t.id)&&void 0!==r?r:void 0,jsonrpc:null!==(n=null==t?void 0:t.jsonrpc)&&void 0!==n?n:"2.0",result:e}}send(e,t){return this._sentWarnings.send||(this._log.warn(ye.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof e||t&&!Array.isArray(t)?e&&"object"==typeof e&&"function"==typeof t?this._rpcRequest(e,t):this._sendSync(e):this._rpcRequest({method:e,params:t}).then((e=>this._rpcResult(e)))}_sendSync(e){let t;switch(e.method){case"eth_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":t=this.selectedAddress||null;break;case"eth_uninstallFilter":this._rpcRequest(e,ge),t=!0;break;case"net_version":t=this.networkVersion||null;break;default:throw new Error(ye.errors.unsupportedSync(e.method))}return this._rpcResult(t,e)}_getExperimentalApi(){return new Proxy({isUnlocked:()=>we(this,void 0,void 0,(function*(){return this._state.initialized||(yield new Promise((e=>{this.on("_initialized",(()=>e()))}))),this._state.isUnlocked})),requestBatch:e=>we(this,void 0,void 0,(function*(){if(!Array.isArray(e))throw le.Sy.rpc.invalidRequest({message:"Batch requests must be made with an array of request objects.",data:e});return this._rpcRequest(e)}))},{get:(e,t,...r)=>(this._sentWarnings.experimentalMethods||(this._log.warn(ye.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(e,t,...r))})}_handleChainChanged({chainId:e,networkVersion:t}={}){super._handleChainChanged({chainId:e,networkVersion:t}),t&&"loading"!==t&&t!==this.networkVersion&&(this.networkVersion=t,this._state.initialized&&this.emit("networkChanged",this.networkVersion))}}class Ee extends _e{}class Ae extends oe{constructor(e){super(e),this.providerName=B.$private;try{this.getConnectWalletInfo()}catch(e){console.error(e)}try{this.sendSiteMetadataDomReady()}catch(e){console.error(e)}}request(e){return this.bridgeRequest(e)}}var Se=r(5474),Me=r.n(Se),xe=r(5326),ke=r(7543),Ie=r.n(ke),Re=r(6565),Be=r.n(Re),Te=r(9989),Ue=r(4920);class Oe extends TypeError{constructor(e,t){let r;const{message:n,...i}=e,{path:o}=e;super(0===o.length?n:"At path: "+o.join(".")+" -- "+n),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function Ce(e){return"object"==typeof e&&null!=e}function Pe(e){return"string"==typeof e?JSON.stringify(e):""+e}function ze(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:s}=r,{refinement:a,message:u="Expected a value of type `"+s+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+Pe(n)+"`"}=e;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...e,message:u}}function*Le(e,t,r,n){var i;Ce(i=e)&&"function"==typeof i[Symbol.iterator]||(e=[e]);for(const i of e){const e=ze(i,t,r,n);e&&(yield e)}}function*Ne(e,t,r={}){const{path:n=[],branch:i=[e],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i};if(o&&(e=t.coercer(e,a),s&&"type"!==t.type&&Ce(t.schema)&&Ce(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u=!0;for(const r of t.validator(e,a))u=!1,yield[r,void 0];for(let[r,c,h]of t.entries(e,a)){const t=Ne(c,h,{path:void 0===r?n:[...n,r],branch:void 0===r?i:[...i,c],coerce:o,mask:s});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):o&&(c=n[1],void 0===r?e=c:e instanceof Map?e.set(r,c):e instanceof Set?e.add(c):Ce(e)&&(e[r]=c))}if(u)for(const r of t.refiner(e,a))u=!1,yield[r,void 0];u&&(yield[void 0,e])}class qe{constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:o=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(e,t)=>Le(n(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>Le(i(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=Fe(e,t);if(r[0])throw r[0]}(e,this)}create(e){return je(e,this)}is(e){return De(e,this)}mask(e){return function(e,t){const r=Fe(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return Fe(e,this,t)}}function je(e,t){const r=Fe(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}function De(e,t){return!Fe(e,t)[0]}function Fe(e,t,r={}){const n=Ne(e,t,r),i=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return i[0]?[new Oe(i[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,i[1]]}function $e(e,t){return new qe({type:e,schema:null,validator:t})}function He(e){return new qe({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+Pe(e)})}function We(){return $e("boolean",(e=>"boolean"==typeof e))}function Ke(e){return $e("instance",(t=>t instanceof e||"Expected a `"+e.name+"` instance, but received: "+Pe(t)))}function Ge(e){const t=Pe(e),r=typeof e;return new qe({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||"Expected the literal `"+t+"`, but received: "+Pe(r)})}function Ve(e){return new qe({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function Je(){return $e("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+Pe(e)))}function Ye(e){return new qe({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function Ze(e,t){return new qe({type:"record",schema:null,*entries(r){if(Ce(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator:e=>Ce(e)||"Expected an object, but received: "+Pe(e)})}function Xe(){return $e("string",(e=>"string"==typeof e||"Expected a string, but received: "+Pe(e)))}function Qe(e){const t=$e("never",(()=>!1));return new qe({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator:e=>Array.isArray(e)||"Expected an array, but received: "+Pe(e)})}function et(e){const t=Object.keys(e);return new qe({type:"type",schema:e,*entries(r){if(Ce(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>Ce(e)||"Expected an object, but received: "+Pe(e)})}function tt(e){const t=e.map((e=>e.type)).join(" | ");return new qe({type:"union",schema:null,validator(r,n){const i=[];for(const t of e){const[...e]=Ne(r,t,n),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return["Expected the value to satisfy a union of `"+t+"`, but received: "+Pe(r),...i]}})}function rt(){return $e("unknown",(()=>!0))}function nt(e,t,r){return new qe({...e,coercer:(n,i)=>De(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}r(4217),r(6350);var it=r(5293),ot=r.n(it),st=r(5498),at=r.n(st);const ut=e=>xe.Buffer.isBuffer(e)?e:e instanceof Uint8Array?xe.Buffer.from(e.buffer,e.byteOffset,e.byteLength):xe.Buffer.from(e);var ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},ht={},ft={},dt=lt;function lt(e,t){if(!e)throw new Error(t||"Assertion failed")}lt.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var pt={exports:{}};"function"==typeof Object.create?pt.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:pt.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var yt=dt,gt=pt.exports;function bt(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function mt(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function vt(e){return 1===e.length?"0"+e:e}function wt(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}ft.inherits=gt,ft.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):bt(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},ft.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=vt(e[r].toString(16));return t},ft.htonl=mt,ft.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=mt(i)),r+=wt(i.toString(16))}return r},ft.zero2=vt,ft.zero8=wt,ft.join32=function(e,t,r,n){var i=r-t;yt(i%4==0);for(var o=new Array(i/4),s=0,a=t;s<o.length;s++,a+=4){var u;u="big"===n?e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]:e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a],o[s]=u>>>0}return o},ft.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},ft.rotr32=function(e,t){return e>>>t|e<<32-t},ft.rotl32=function(e,t){return e<<t|e>>>32-t},ft.sum32=function(e,t){return e+t>>>0},ft.sum32_3=function(e,t,r){return e+t+r>>>0},ft.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},ft.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},ft.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},ft.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},ft.sum64_lo=function(e,t,r,n){return t+n>>>0},ft.sum64_4_hi=function(e,t,r,n,i,o,s,a){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},ft.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},ft.sum64_5_hi=function(e,t,r,n,i,o,s,a,u,c){var h=0,f=t;return h+=(f=f+n>>>0)<t?1:0,h+=(f=f+o>>>0)<o?1:0,h+=(f=f+a>>>0)<a?1:0,e+r+i+s+u+(h+=(f=f+c>>>0)<c?1:0)>>>0},ft.sum64_5_lo=function(e,t,r,n,i,o,s,a,u,c){return t+n+o+a+c>>>0},ft.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},ft.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},ft.shr64_hi=function(e,t,r){return e>>>r},ft.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var _t={},Et=ft,At=dt;function St(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_t.BlockHash=St,St.prototype.update=function(e,t){if(e=Et.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=Et.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},St.prototype.digest=function(e){return this.update(this._pad()),At(null===this.pending),this._digest(e)},St.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var Mt={},xt={},kt=ft.rotr32;function It(e,t,r){return e&t^~e&r}function Rt(e,t,r){return e&t^e&r^t&r}function Bt(e,t,r){return e^t^r}xt.ft_1=function(e,t,r,n){return 0===e?It(t,r,n):1===e||3===e?Bt(t,r,n):2===e?Rt(t,r,n):void 0},xt.ch32=It,xt.maj32=Rt,xt.p32=Bt,xt.s0_256=function(e){return kt(e,2)^kt(e,13)^kt(e,22)},xt.s1_256=function(e){return kt(e,6)^kt(e,11)^kt(e,25)},xt.g0_256=function(e){return kt(e,7)^kt(e,18)^e>>>3},xt.g1_256=function(e){return kt(e,17)^kt(e,19)^e>>>10};var Tt=ft,Ut=_t,Ot=xt,Ct=Tt.rotl32,Pt=Tt.sum32,zt=Tt.sum32_5,Lt=Ot.ft_1,Nt=Ut.BlockHash,qt=[1518500249,1859775393,2400959708,3395469782];function jt(){if(!(this instanceof jt))return new jt;Nt.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Tt.inherits(jt,Nt);var Dt=jt;jt.blockSize=512,jt.outSize=160,jt.hmacStrength=80,jt.padLength=64,jt.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Ct(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4];for(n=0;n<r.length;n++){var c=~~(n/20),h=zt(Ct(i,5),Lt(c,o,s,a),u,r[n],qt[c]);u=a,a=s,s=Ct(o,30),o=i,i=h}this.h[0]=Pt(this.h[0],i),this.h[1]=Pt(this.h[1],o),this.h[2]=Pt(this.h[2],s),this.h[3]=Pt(this.h[3],a),this.h[4]=Pt(this.h[4],u)},jt.prototype._digest=function(e){return"hex"===e?Tt.toHex32(this.h,"big"):Tt.split32(this.h,"big")};var Ft=ft,$t=_t,Ht=xt,Wt=dt,Kt=Ft.sum32,Gt=Ft.sum32_4,Vt=Ft.sum32_5,Jt=Ht.ch32,Yt=Ht.maj32,Zt=Ht.s0_256,Xt=Ht.s1_256,Qt=Ht.g0_256,er=Ht.g1_256,tr=$t.BlockHash,rr=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function nr(){if(!(this instanceof nr))return new nr;tr.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=rr,this.W=new Array(64)}Ft.inherits(nr,tr);var ir=nr;nr.blockSize=512,nr.outSize=256,nr.hmacStrength=192,nr.padLength=64,nr.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Gt(er(r[n-2]),r[n-7],Qt(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],c=this.h[5],h=this.h[6],f=this.h[7];for(Wt(this.k.length===r.length),n=0;n<r.length;n++){var d=Vt(f,Xt(u),Jt(u,c,h),this.k[n],r[n]),l=Kt(Zt(i),Yt(i,o,s));f=h,h=c,c=u,u=Kt(a,d),a=s,s=o,o=i,i=Kt(d,l)}this.h[0]=Kt(this.h[0],i),this.h[1]=Kt(this.h[1],o),this.h[2]=Kt(this.h[2],s),this.h[3]=Kt(this.h[3],a),this.h[4]=Kt(this.h[4],u),this.h[5]=Kt(this.h[5],c),this.h[6]=Kt(this.h[6],h),this.h[7]=Kt(this.h[7],f)},nr.prototype._digest=function(e){return"hex"===e?Ft.toHex32(this.h,"big"):Ft.split32(this.h,"big")};var or=ft,sr=ir;function ar(){if(!(this instanceof ar))return new ar;sr.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}or.inherits(ar,sr);var ur=ar;ar.blockSize=512,ar.outSize=224,ar.hmacStrength=192,ar.padLength=64,ar.prototype._digest=function(e){return"hex"===e?or.toHex32(this.h.slice(0,7),"big"):or.split32(this.h.slice(0,7),"big")};var cr=ft,hr=_t,fr=dt,dr=cr.rotr64_hi,lr=cr.rotr64_lo,pr=cr.shr64_hi,yr=cr.shr64_lo,gr=cr.sum64,br=cr.sum64_hi,mr=cr.sum64_lo,vr=cr.sum64_4_hi,wr=cr.sum64_4_lo,_r=cr.sum64_5_hi,Er=cr.sum64_5_lo,Ar=hr.BlockHash,Sr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Mr(){if(!(this instanceof Mr))return new Mr;Ar.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Sr,this.W=new Array(160)}cr.inherits(Mr,Ar);var xr=Mr;function kr(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function Ir(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function Rr(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function Br(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function Tr(e,t){var r=dr(e,t,28)^dr(t,e,2)^dr(t,e,7);return r<0&&(r+=4294967296),r}function Ur(e,t){var r=lr(e,t,28)^lr(t,e,2)^lr(t,e,7);return r<0&&(r+=4294967296),r}function Or(e,t){var r=dr(e,t,14)^dr(e,t,18)^dr(t,e,9);return r<0&&(r+=4294967296),r}function Cr(e,t){var r=lr(e,t,14)^lr(e,t,18)^lr(t,e,9);return r<0&&(r+=4294967296),r}function Pr(e,t){var r=dr(e,t,1)^dr(e,t,8)^pr(e,t,7);return r<0&&(r+=4294967296),r}function zr(e,t){var r=lr(e,t,1)^lr(e,t,8)^yr(e,t,7);return r<0&&(r+=4294967296),r}function Lr(e,t){var r=dr(e,t,19)^dr(t,e,29)^pr(e,t,6);return r<0&&(r+=4294967296),r}function Nr(e,t){var r=lr(e,t,19)^lr(t,e,29)^yr(e,t,6);return r<0&&(r+=4294967296),r}Mr.blockSize=1024,Mr.outSize=512,Mr.hmacStrength=192,Mr.padLength=128,Mr.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=Lr(r[n-4],r[n-3]),o=Nr(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=Pr(r[n-30],r[n-29]),c=zr(r[n-30],r[n-29]),h=r[n-32],f=r[n-31];r[n]=vr(i,o,s,a,u,c,h,f),r[n+1]=wr(i,o,s,a,u,c,h,f)}},Mr.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],u=this.h[5],c=this.h[6],h=this.h[7],f=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],y=this.h[12],g=this.h[13],b=this.h[14],m=this.h[15];fr(this.k.length===r.length);for(var v=0;v<r.length;v+=2){var w=b,_=m,E=Or(f,d),A=Cr(f,d),S=kr(f,0,l,0,y),M=Ir(0,d,0,p,0,g),x=this.k[v],k=this.k[v+1],I=r[v],R=r[v+1],B=_r(w,_,E,A,S,M,x,k,I,R),T=Er(w,_,E,A,S,M,x,k,I,R);w=Tr(n,i),_=Ur(n,i),E=Rr(n,0,o,0,a),A=Br(0,i,0,s,0,u);var U=br(w,_,E,A),O=mr(w,_,E,A);b=y,m=g,y=l,g=p,l=f,p=d,f=br(c,h,B,T),d=mr(h,h,B,T),c=a,h=u,a=o,u=s,o=n,s=i,n=br(B,T,U,O),i=mr(B,T,U,O)}gr(this.h,0,n,i),gr(this.h,2,o,s),gr(this.h,4,a,u),gr(this.h,6,c,h),gr(this.h,8,f,d),gr(this.h,10,l,p),gr(this.h,12,y,g),gr(this.h,14,b,m)},Mr.prototype._digest=function(e){return"hex"===e?cr.toHex32(this.h,"big"):cr.split32(this.h,"big")};var qr=ft,jr=xr;function Dr(){if(!(this instanceof Dr))return new Dr;jr.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}qr.inherits(Dr,jr);var Fr=Dr;Dr.blockSize=1024,Dr.outSize=384,Dr.hmacStrength=192,Dr.padLength=128,Dr.prototype._digest=function(e){return"hex"===e?qr.toHex32(this.h.slice(0,12),"big"):qr.split32(this.h.slice(0,12),"big")},Mt.sha1=Dt,Mt.sha224=ur,Mt.sha256=ir,Mt.sha384=Fr,Mt.sha512=xr;var $r={},Hr=ft,Wr=_t,Kr=Hr.rotl32,Gr=Hr.sum32,Vr=Hr.sum32_3,Jr=Hr.sum32_4,Yr=Wr.BlockHash;function Zr(){if(!(this instanceof Zr))return new Zr;Yr.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Xr(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function Qr(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function en(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}Hr.inherits(Zr,Yr),$r.ripemd160=Zr,Zr.blockSize=512,Zr.outSize=160,Zr.hmacStrength=192,Zr.padLength=64,Zr.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],s=this.h[4],a=r,u=n,c=i,h=o,f=s,d=0;d<80;d++){var l=Gr(Kr(Jr(r,Xr(d,n,i,o),e[tn[d]+t],Qr(d)),nn[d]),s);r=s,s=o,o=Kr(i,10),i=n,n=l,l=Gr(Kr(Jr(a,Xr(79-d,u,c,h),e[rn[d]+t],en(d)),on[d]),f),a=f,f=h,h=Kr(c,10),c=u,u=l}l=Vr(this.h[1],i,h),this.h[1]=Vr(this.h[2],o,f),this.h[2]=Vr(this.h[3],s,a),this.h[3]=Vr(this.h[4],r,u),this.h[4]=Vr(this.h[0],n,c),this.h[0]=l},Zr.prototype._digest=function(e){return"hex"===e?Hr.toHex32(this.h,"little"):Hr.split32(this.h,"little")};var tn=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rn=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],nn=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],on=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],sn=ft,an=dt;function un(e,t,r){if(!(this instanceof un))return new un(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(sn.toArray(t,r))}var cn=un;un.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),an(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},un.prototype.update=function(e,t){return this.inner.update(e,t),this},un.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=e;t.utils=ft,t.common=_t,t.sha=Mt,t.ripemd=$r,t.hmac=cn,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(ht);var hn=ht;let fn=!1,dn=!1;const ln={debug:1,default:2,info:2,warning:3,error:4,off:5};let pn=ln.default,yn=null;const gn=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var bn,mn;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(bn||(bn={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(mn||(mn={}));const vn="0123456789abcdef";class wn{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==ln[r]&&this.throwArgumentError("invalid log level name","logLevel",e),pn>ln[r]||console.log.apply(console,t)}debug(...e){this._log(wn.levels.DEBUG,e)}info(...e){this._log(wn.levels.INFO,e)}warn(...e){this._log(wn.levels.WARNING,e)}makeError(e,t,r){if(dn)return this.makeError("censored error",t,{});t||(t=wn.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=vn[t[e]>>4],r+=vn[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case mn.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case mn.CALL_EXCEPTION:case mn.INSUFFICIENT_FUNDS:case mn.MISSING_NEW:case mn.NONCE_EXPIRED:case mn.REPLACEMENT_UNDERPRICED:case mn.TRANSACTION_REPLACED:case mn.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const s=new Error(e);return s.reason=i,s.code=t,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,wn.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){gn&&this.throwError("platform missing String.prototype.normalize",wn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:gn})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,wn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,wn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,wn.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,wn.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",wn.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",wn.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",wn.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return yn||(yn=new wn("logger/5.6.0")),yn}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",wn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),fn){if(!e)return;this.globalLogger().throwError("error censorship permanent",wn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}dn=!!e,fn=!!t}static setLogLevel(e){const t=ln[e.toLowerCase()];null!=t?pn=t:wn.globalLogger().warn("invalid log level - "+e)}static from(e){return new wn(e)}}wn.errors=mn,wn.levels=bn;const _n=new wn("bytes/5.6.0");function En(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return En(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function An(e){return"number"==typeof e&&e==e&&e%1==0}function Sn(e){return"0x"+hn.sha256().update(function(e,t){if(t||(t={}),"number"==typeof e){_n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),En(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),function(e){return!!e.toHexString}(e)&&(e=e.toHexString()),function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))}(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0x0"+r.substring(2):"right"===t.hexPad?r+="0":_n.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substring(e,e+2),16));return En(new Uint8Array(n))}return function(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!An(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!An(r)||r<0||r>=256)return!1}return!0}(e)?En(new Uint8Array(e)):_n.throwArgumentError("invalid arrayify value","value",e)}(e)).digest("hex")}new wn("sha2/5.6.0");const Mn=new Map;class xn extends class{constructor(e){Object.assign(this,e)}encode(){return xe.Buffer.from((0,Te.serialize)(Mn,this))}static decode(e){return(0,Te.deserialize)(Mn,this,e)}static decodeUnchecked(e){return(0,Te.deserializeUnchecked)(Mn,this,e)}}{constructor(e){if(super({}),this._bn=void 0,function(e){return void 0!==e._bn}(e))this._bn=e._bn;else{if("string"==typeof e){const t=Be().decode(e);if(32!=t.length)throw new Error("Invalid public key input");this._bn=new(Ie())(t)}else this._bn=new(Ie())(e);if(this._bn.byteLength()>32)throw new Error("Invalid public key input")}}equals(e){return this._bn.eq(e._bn)}toBase58(){return Be().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){return this.toBuffer()}toBuffer(){const e=this._bn.toArrayLike(xe.Buffer);if(32===e.length)return e;const t=xe.Buffer.alloc(32);return e.copy(t,32-e.length),t}toString(){return this.toBase58()}static async createWithSeed(e,t,r){const n=xe.Buffer.concat([e.toBuffer(),xe.Buffer.from(t),r.toBuffer()]),i=Sn(new Uint8Array(n)).slice(2);return new xn(xe.Buffer.from(i,"hex"))}static createProgramAddressSync(e,t){let r=xe.Buffer.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");r=xe.Buffer.concat([r,ut(e)])})),r=xe.Buffer.concat([r,t.toBuffer(),xe.Buffer.from("ProgramDerivedAddress")]);let n=Sn(new Uint8Array(r)).slice(2),i=new(Ie())(n,16).toArray(void 0,32);if(In(i))throw new Error("Invalid seeds, address must fall off the curve");return new xn(i)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r,n=255;for(;0!=n;){try{const i=e.concat(xe.Buffer.from([n]));r=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;n--;continue}return[r,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return 1==In(new xn(e).toBytes())}}xn.default=new xn("11111111111111111111111111111111"),Mn.set(xn,{kind:"struct",fields:[["_bn","u256"]]});let kn=Me().lowlevel;function In(e){var t=[kn.gf(),kn.gf(),kn.gf(),kn.gf()],r=kn.gf(),n=kn.gf(),i=kn.gf(),o=kn.gf(),s=kn.gf(),a=kn.gf(),u=kn.gf();return kn.set25519(t[2],Rn),kn.unpack25519(t[1],e),kn.S(i,t[1]),kn.M(o,i,kn.D),kn.Z(i,i,t[2]),kn.A(o,t[2],o),kn.S(s,o),kn.S(a,s),kn.M(u,a,s),kn.M(r,u,i),kn.M(r,r,o),kn.pow2523(r,r),kn.M(r,r,i),kn.M(r,r,o),kn.M(r,r,o),kn.M(t[0],r,o),kn.S(n,t[0]),kn.M(n,n,o),Tn(n,i)&&kn.M(t[0],t[0],Bn),kn.S(n,t[0]),kn.M(n,n,o),Tn(n,i)?0:1}let Rn=kn.gf([1]),Bn=kn.gf([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Tn(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return kn.pack25519(r,e),kn.pack25519(n,t),kn.crypto_verify_32(r,0,n,0)}new xn("BPFLoader1111111111111111111111111111111111");const Un=(e="publicKey")=>Ue.Ik(32,e),On=(e="string")=>{const t=Ue.n_([Ue.Jq("length"),Ue.Jq("lengthPadding"),Ue.Ik(Ue.cv(Ue.Jq(),-8),"chars")],e),r=t.decode.bind(t),n=t.encode.bind(t),i=t;return i.decode=(e,t)=>r(e,t).chars.toString(),i.encode=(e,t,r)=>{const i={chars:xe.Buffer.from(e,"utf8")};return n(i,t,r)},i.alloc=e=>Ue.Jq().span+Ue.Jq().span+xe.Buffer.from(e,"utf8").length,i};function Cn(e){let t=0,r=0;for(;;){let n=e.shift();if(t|=(127&n)<<7*r,r+=1,0==(128&n))break}return t}function Pn(e,t){let r=t;for(;;){let t=127&r;if(r>>=7,0==r){e.push(t);break}t|=128,e.push(t)}}class zn{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map((e=>new xn(e))),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach((e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex])))}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){return e<this.header.numRequiredSignatures-this.header.numReadonlySignedAccounts||e>=this.header.numRequiredSignatures&&e<this.accountKeys.length-this.header.numReadonlyUnsignedAccounts}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter(((e,t)=>!this.isProgramId(t)))}serialize(){const e=this.accountKeys.length;let t=[];Pn(t,e);const r=this.instructions.map((e=>{const{accounts:t,programIdIndex:r}=e,n=Array.from(Be().decode(e.data));let i=[];Pn(i,t.length);let o=[];return Pn(o,n.length),{programIdIndex:r,keyIndicesCount:xe.Buffer.from(i),keyIndices:t,dataLength:xe.Buffer.from(o),data:n}}));let n=[];Pn(n,r.length);let i=xe.Buffer.alloc(1232);xe.Buffer.from(n).copy(i);let o=n.length;r.forEach((e=>{const t=Ue.n_([Ue.u8("programIdIndex"),Ue.Ik(e.keyIndicesCount.length,"keyIndicesCount"),Ue.A9(Ue.u8("keyIndex"),e.keyIndices.length,"keyIndices"),Ue.Ik(e.dataLength.length,"dataLength"),Ue.A9(Ue.u8("userdatum"),e.data.length,"data")]).encode(e,i,o);o+=t})),i=i.slice(0,o);const s=Ue.n_([Ue.Ik(1,"numRequiredSignatures"),Ue.Ik(1,"numReadonlySignedAccounts"),Ue.Ik(1,"numReadonlyUnsignedAccounts"),Ue.Ik(t.length,"keyCount"),Ue.A9(Un("key"),e,"keys"),Un("recentBlockhash")]),a={numRequiredSignatures:xe.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:xe.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:xe.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:xe.Buffer.from(t),keys:this.accountKeys.map((e=>ut(e.toBytes()))),recentBlockhash:Be().decode(this.recentBlockhash)};let u=xe.Buffer.alloc(2048);const c=s.encode(a,u);return i.copy(u,c),u.slice(0,c+i.length)}static from(e){let t=[...e];const r=t.shift(),n=t.shift(),i=t.shift(),o=Cn(t);let s=[];for(let e=0;e<o;e++){const e=t.slice(0,32);t=t.slice(32),s.push(Be().encode(xe.Buffer.from(e)))}const a=t.slice(0,32);t=t.slice(32);const u=Cn(t);let c=[];for(let e=0;e<u;e++){const e=t.shift(),r=Cn(t),n=t.slice(0,r);t=t.slice(r);const i=Cn(t),o=t.slice(0,i),s=Be().encode(xe.Buffer.from(o));t=t.slice(i),c.push({programIdIndex:e,accounts:n,data:s})}const h={header:{numRequiredSignatures:r,numReadonlySignedAccounts:n,numReadonlyUnsignedAccounts:i},recentBlockhash:Be().encode(xe.Buffer.from(a)),accountKeys:s,instructions:c};return new zn(h)}}function Ln(e,t){if(!e)throw new Error(t||"Assertion failed")}const Nn=xe.Buffer.alloc(64).fill(0);class qn{constructor(e){this.keys=void 0,this.programId=void 0,this.data=xe.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map((({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r}))),programId:this.programId.toJSON(),data:[...this.data]}}}class jn{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.nonceInfo=void 0,this._message=void 0,this._json=void 0,e&&Object.assign(this,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((e=>e.toJSON())),signers:this.signatures.map((({publicKey:e})=>e.toJSON()))}}add(...e){if(0===e.length)throw new Error("No instructions");return e.forEach((e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new qn(e))})),this}compileMessage(){if(this._message){if(JSON.stringify(this.toJSON())!==JSON.stringify(this._json))throw new Error("Transaction message mutated after being populated from Message");return this._message}const{nonceInfo:e}=this;e&&this.instructions[0]!=e.nonceInstruction&&(this.recentBlockhash=e.nonce,this.instructions.unshift(e.nonceInstruction));const{recentBlockhash:t}=this;if(!t)throw new Error("Transaction recentBlockhash required");let r;if(this.instructions.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");r=this.signatures[0].publicKey}for(let e=0;e<this.instructions.length;e++)if(void 0===this.instructions[e].programId)throw new Error(`Transaction instruction index ${e} has undefined program id`);const n=[],i=[];this.instructions.forEach((e=>{e.keys.forEach((e=>{i.push({...e})}));const t=e.programId.toString();n.includes(t)||n.push(t)})),n.forEach((e=>{i.push({pubkey:new xn(e),isSigner:!1,isWritable:!1})})),i.sort((function(e,t){const r=e.pubkey.toBase58().localeCompare(t.pubkey.toBase58()),n=e.isSigner===t.isSigner?0:e.isSigner?-1:1,i=e.isWritable===t.isWritable?r:e.isWritable?-1:1;return n||i}));const o=[];i.forEach((e=>{const t=e.pubkey.toString(),r=o.findIndex((e=>e.pubkey.toString()===t));r>-1?o[r].isWritable=o[r].isWritable||e.isWritable:o.push(e)}));const s=o.findIndex((e=>e.pubkey.equals(r)));if(s>-1){const[e]=o.splice(s,1);e.isSigner=!0,e.isWritable=!0,o.unshift(e)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const e of this.signatures){const t=o.findIndex((t=>t.pubkey.equals(e.publicKey)));if(!(t>-1))throw new Error(`unknown signer: ${e.publicKey.toString()}`);o[t].isSigner||(o[t].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."))}let a=0,u=0,c=0;const h=[],f=[];o.forEach((({pubkey:e,isSigner:t,isWritable:r})=>{t?(h.push(e.toString()),a+=1,r||(u+=1)):(f.push(e.toString()),r||(c+=1))}));const d=h.concat(f),l=this.instructions.map((e=>{const{data:t,programId:r}=e;return{programIdIndex:d.indexOf(r.toString()),accounts:e.keys.map((e=>d.indexOf(e.pubkey.toString()))),data:Be().encode(t)}}));return l.forEach((e=>{Ln(e.programIdIndex>=0),e.accounts.forEach((e=>Ln(e>=0)))})),new zn({header:{numRequiredSignatures:a,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:c},accountKeys:d,recentBlockhash:t,instructions:l})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every(((e,r)=>t[r].equals(e.publicKey)))||(this.signatures=t.map((e=>({signature:null,publicKey:e})))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(0===e.length)throw new Error("No signers");const t=new Set;this.signatures=e.filter((e=>{const r=e.toString();return!t.has(r)&&(t.add(r),!0)})).map((e=>({signature:null,publicKey:e})))}sign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,r=[];for(const n of e){const e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}this.signatures=r.map((e=>({signature:null,publicKey:e.publicKey})));const n=this._compile();this._partialSign(n,...r),this._verifySignatures(n.serialize(),!0)}partialSign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,r=[];for(const n of e){const e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}const n=this._compile();this._partialSign(n,...r)}_partialSign(e,...t){const r=e.serialize();t.forEach((e=>{const t=Me().sign.detached(r,e.secretKey);this._addSignature(e.publicKey,ut(t))}))}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){Ln(64===t.length);const r=this.signatures.findIndex((t=>e.equals(t.publicKey)));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=xe.Buffer.from(t)}verifySignatures(){return this._verifySignatures(this.serializeMessage(),!0)}_verifySignatures(e,t){for(const{signature:r,publicKey:n}of this.signatures)if(null===r){if(t)return!1}else if(!Me().sign.detached.verify(e,r,n.toBuffer()))return!1;return!0}serialize(e){const{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=this.serializeMessage();if(r&&!this._verifySignatures(n,t))throw new Error("Signature verification failed");return this._serialize(n)}_serialize(e){const{signatures:t}=this,r=[];Pn(r,t.length);const n=r.length+64*t.length+e.length,i=xe.Buffer.alloc(n);return Ln(t.length<256),xe.Buffer.from(r).copy(i,0),t.forEach((({signature:e},t)=>{null!==e&&(Ln(64===e.length,"signature has invalid length"),xe.Buffer.from(e).copy(i,r.length+64*t))})),e.copy(i,r.length+64*t.length),Ln(i.length<=1232,`Transaction too large: ${i.length} > 1232`),i}get keys(){return Ln(1===this.instructions.length),this.instructions[0].keys.map((e=>e.pubkey))}get programId(){return Ln(1===this.instructions.length),this.instructions[0].programId}get data(){return Ln(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e];const r=Cn(t);let n=[];for(let e=0;e<r;e++){const e=t.slice(0,64);t=t.slice(64),n.push(Be().encode(xe.Buffer.from(e)))}return jn.populate(zn.from(t),n)}static populate(e,t=[]){const r=new jn;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach(((t,n)=>{const i={signature:t==Be().encode(Nn)?null:Be().decode(t),publicKey:e.accountKeys[n]};r.signatures.push(i)})),e.instructions.forEach((t=>{const n=t.accounts.map((t=>{const n=e.accountKeys[t];return{pubkey:n,isSigner:r.signatures.some((e=>e.publicKey.toString()===n.toString()))||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}}));r.instructions.push(new qn({keys:n,programId:e.accountKeys[t.programIdIndex],data:Be().decode(t.data)}))})),r._message=e,r._json=r.toJSON(),r}}const Dn=new xn("SysvarC1ock11111111111111111111111111111111"),Fn=(new xn("SysvarEpochSchedu1e111111111111111111111111"),new xn("Sysvar1nstructions1111111111111111111111111"),new xn("SysvarRecentB1ockHashes11111111111111111111")),$n=new xn("SysvarRent111111111111111111111111111111111"),Hn=(new xn("SysvarRewards111111111111111111111111111111"),new xn("SysvarS1otHashes111111111111111111111111111"),new xn("SysvarS1otHistory11111111111111111111111111"),new xn("SysvarStakeHistory1111111111111111111111111"));async function Wn(e,t,r,n){const i=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries},o=await e.sendTransaction(t,r,i),s=(await e.confirmTransaction(o,n&&n.commitment)).value;if(s.err)throw new Error(`Transaction ${o} failed (${JSON.stringify(s)})`);return o}function Kn(e){return new Promise((t=>setTimeout(t,e)))}function Gn(e,t){const r=e.layout.span>=0?e.layout.span:function(e,t){let r=0;return e.layout.fields.forEach((e=>{e.span>=0?r+=e.span:"function"==typeof e.alloc&&(r+=e.alloc(t[e.property]))})),r}(e,t),n=xe.Buffer.alloc(r),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,n),n}const Vn=Ue._O("lamportsPerSignature"),Jn=Ue.n_([Ue.Jq("version"),Ue.Jq("state"),Un("authorizedPubkey"),Un("nonce"),Ue.n_([Vn],"feeCalculator")]).span,Yn=Object.freeze({Create:{index:0,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports"),Ue.gM("space"),Un("programId")])},Assign:{index:1,layout:Ue.n_([Ue.Jq("instruction"),Un("programId")])},Transfer:{index:2,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports")])},CreateWithSeed:{index:3,layout:Ue.n_([Ue.Jq("instruction"),Un("base"),On("seed"),Ue.gM("lamports"),Ue.gM("space"),Un("programId")])},AdvanceNonceAccount:{index:4,layout:Ue.n_([Ue.Jq("instruction")])},WithdrawNonceAccount:{index:5,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports")])},InitializeNonceAccount:{index:6,layout:Ue.n_([Ue.Jq("instruction"),Un("authorized")])},AuthorizeNonceAccount:{index:7,layout:Ue.n_([Ue.Jq("instruction"),Un("authorized")])},Allocate:{index:8,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("space")])},AllocateWithSeed:{index:9,layout:Ue.n_([Ue.Jq("instruction"),Un("base"),On("seed"),Ue.gM("space"),Un("programId")])},AssignWithSeed:{index:10,layout:Ue.n_([Ue.Jq("instruction"),Un("base"),On("seed"),Un("programId")])},TransferWithSeed:{index:11,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports"),On("seed"),Un("programId")])}});class Zn{constructor(){}static createAccount(e){const t=Gn(Yn.Create,{lamports:e.lamports,space:e.space,programId:ut(e.programId.toBuffer())});return new qn({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}static transfer(e){let t,r;return"basePubkey"in e?(t=Gn(Yn.TransferWithSeed,{lamports:e.lamports,seed:e.seed,programId:ut(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]):(t=Gn(Yn.Transfer,{lamports:e.lamports}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]),new qn({keys:r,programId:this.programId,data:t})}static assign(e){let t,r;return"basePubkey"in e?(t=Gn(Yn.AssignWithSeed,{base:ut(e.basePubkey.toBuffer()),seed:e.seed,programId:ut(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Gn(Yn.Assign,{programId:ut(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]),new qn({keys:r,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=Gn(Yn.CreateWithSeed,{base:ut(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:ut(e.programId.toBuffer())});let r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey!=e.fromPubkey&&r.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new qn({keys:r,programId:this.programId,data:t})}static createNonceAccount(e){const t=new jn;"basePubkey"in e&&"seed"in e?t.add(Zn.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:Jn,programId:this.programId})):t.add(Zn.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:Jn,programId:this.programId}));const r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(r)),t}static nonceInitialize(e){const t=Gn(Yn.InitializeNonceAccount,{authorized:ut(e.authorizedPubkey.toBuffer())}),r={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Fn,isSigner:!1,isWritable:!1},{pubkey:$n,isSigner:!1,isWritable:!1}],programId:this.programId,data:t};return new qn(r)}static nonceAdvance(e){const t=Gn(Yn.AdvanceNonceAccount),r={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Fn,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t};return new qn(r)}static nonceWithdraw(e){const t=Gn(Yn.WithdrawNonceAccount,{lamports:e.lamports});return new qn({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Fn,isSigner:!1,isWritable:!1},{pubkey:$n,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static nonceAuthorize(e){const t=Gn(Yn.AuthorizeNonceAccount,{authorized:ut(e.newAuthorizedPubkey.toBuffer())});return new qn({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static allocate(e){let t,r;return"basePubkey"in e?(t=Gn(Yn.AllocateWithSeed,{base:ut(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:ut(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Gn(Yn.Allocate,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]),new qn({keys:r,programId:this.programId,data:t})}}Zn.programId=new xn("11111111111111111111111111111111");class Xn{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/Xn.chunkSize)+1+1)}static async load(e,t,r,n,i){{const o=await e.getMinimumBalanceForRentExemption(i.length),s=await e.getAccountInfo(r.publicKey,"confirmed");let a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==i.length&&(a=a||new jn,a.add(Zn.allocate({accountPubkey:r.publicKey,space:i.length}))),s.owner.equals(n)||(a=a||new jn,a.add(Zn.assign({accountPubkey:r.publicKey,programId:n}))),s.lamports<o&&(a=a||new jn,a.add(Zn.transfer({fromPubkey:t.publicKey,toPubkey:r.publicKey,lamports:o-s.lamports})))}else a=(new jn).add(Zn.createAccount({fromPubkey:t.publicKey,newAccountPubkey:r.publicKey,lamports:o>0?o:1,space:i.length,programId:n}));null!==a&&await Wn(e,a,[t,r],{commitment:"confirmed"})}const o=Ue.n_([Ue.Jq("instruction"),Ue.Jq("offset"),Ue.Jq("bytesLength"),Ue.Jq("bytesLengthPadding"),Ue.A9(Ue.u8("byte"),Ue.cv(Ue.Jq(),-8),"bytes")]),s=Xn.chunkSize;let a=0,u=i,c=[];for(;u.length>0;){const i=u.slice(0,s),h=xe.Buffer.alloc(s+16);o.encode({instruction:0,offset:a,bytes:i,bytesLength:0,bytesLengthPadding:0},h);const f=(new jn).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:h});if(c.push(Wn(e,f,[t,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")){const e=4;await Kn(1e3/e)}a+=s,u=u.slice(s)}await Promise.all(c);{const i=Ue.n_([Ue.Jq("instruction")]),o=xe.Buffer.alloc(i.span);i.encode({instruction:1},o);const s=(new jn).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:$n,isSigner:!1,isWritable:!1}],programId:n,data:o});await Wn(e,s,[t,r],{commitment:"confirmed"})}return!0}}Xn.chunkSize=932,new xn("BPFLoader2111111111111111111111111111111111");Object.freeze({RequestUnits:{index:0,layout:Ue.n_([Ue.u8("instruction"),Ue.Jq("units"),Ue.Jq("additionalFee")])},RequestHeapFrame:{index:1,layout:Ue.n_([Ue.u8("instruction"),Ue.Jq("bytes")])}});new xn("ComputeBudget111111111111111111111111111111");var Qn={exports:{}};!function(e,t){var r="undefined"!=typeof self?self:ct,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,r,n=l(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=p(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=h(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=h(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),f(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),f(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(e,t){var r,n,i=(t=t||{}).body;if(e instanceof v){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function _(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},b.call(v.prototype),b.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];_.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function A(e,r){return new Promise((function(n,o){var s=new v(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new _(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",u)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}A.polyfill=!0,e.fetch||(e.fetch=A,e.Headers=d,e.Request=v,e.Response=_),t.Headers=d,t.Request=v,t.Response=_,t.fetch=A,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Qn,Qn.exports),Object.prototype.toString,Object.keys,Error;const ei=nt(Ke(xn),Xe(),(e=>new xn(e))),ti=Qe([Xe(),Ge("base64")]),ri=nt(Ke(xe.Buffer),ti,(e=>xe.Buffer.from(e[0],"base64")));function ni(e){return tt([et({jsonrpc:Ge("2.0"),id:Xe(),result:e}),et({jsonrpc:Ge("2.0"),id:Xe(),error:et({code:rt(),message:Xe(),data:Ye($e("any",(()=>!0)))})})])}const ii=ni(rt());function oi(e){return nt(ni(e),ii,(t=>"error"in t?t:{...t,result:je(t.result,e)}))}function si(e){return oi(et({context:et({slot:Je()}),value:e}))}function ai(e){return et({context:et({slot:Je()}),value:e})}const ui=et({foundation:Je(),foundationTerm:Je(),initial:Je(),taper:Je(),terminal:Je()}),ci=(oi(He(Ve(et({epoch:Je(),effectiveSlot:Je(),amount:Je(),postBalance:Je()})))),et({epoch:Je(),slotIndex:Je(),slotsInEpoch:Je(),absoluteSlot:Je(),blockHeight:Ye(Je()),transactionCount:Ye(Je())})),hi=et({slotsPerEpoch:Je(),leaderScheduleSlotOffset:Je(),warmup:We(),firstNormalEpoch:Je(),firstNormalSlot:Je()}),fi=Ze(Xe(),He(Je())),di=Ve(tt([et({}),Xe()])),li=et({err:di}),pi=Ge("receivedSignature");et({"solana-core":Xe(),"feature-set":Ye(Je())}),si(et({err:Ve(tt([et({}),Xe()])),logs:Ve(He(Xe())),accounts:Ye(Ve(He(Ve(et({executable:We(),owner:Xe(),lamports:Je(),data:He(Xe()),rentEpoch:Ye(Je())}))))),unitsConsumed:Ye(Je())})),si(et({byIdentity:Ze(Xe(),He(Je())),range:et({firstSlot:Je(),lastSlot:Je()})})),oi(ui),oi(ci),oi(hi),oi(fi),oi(Je()),si(et({total:Je(),circulating:Je(),nonCirculating:Je(),nonCirculatingAccounts:He(ei)}));const yi=et({amount:Xe(),uiAmount:Ve(Je()),decimals:Je(),uiAmountString:Ye(Xe())}),gi=(si(He(et({address:ei,amount:Xe(),uiAmount:Ve(Je()),decimals:Je(),uiAmountString:Ye(Xe())}))),si(He(et({pubkey:ei,account:et({executable:We(),owner:ei,lamports:Je(),data:ri,rentEpoch:Je()})}))),et({program:Xe(),parsed:rt(),space:Je()})),bi=(si(He(et({pubkey:ei,account:et({executable:We(),owner:ei,lamports:Je(),data:gi,rentEpoch:Je()})}))),si(He(et({lamports:Je(),address:ei}))),et({executable:We(),owner:ei,lamports:Je(),data:ri,rentEpoch:Je()})),mi=(et({pubkey:ei,account:bi}),nt(tt([Ke(xe.Buffer),gi]),tt([ti,gi]),(e=>Array.isArray(e)?je(e,ri):e))),vi=et({executable:We(),owner:ei,lamports:Je(),data:mi,rentEpoch:Je()}),wi=(et({pubkey:ei,account:vi}),et({state:tt([Ge("active"),Ge("inactive"),Ge("activating"),Ge("deactivating")]),active:Je(),inactive:Je()}),oi(He(et({signature:Xe(),slot:Je(),err:di,memo:Ve(Xe()),blockTime:Ye(Ve(Je()))}))),oi(He(et({signature:Xe(),slot:Je(),err:di,memo:Ve(Xe()),blockTime:Ye(Ve(Je()))}))),et({subscription:Je(),result:ai(bi)}),et({pubkey:ei,account:bi})),_i=(et({subscription:Je(),result:ai(wi)}),et({parent:Je(),slot:Je(),root:Je()})),Ei=(et({subscription:Je(),result:_i}),tt([et({type:tt([Ge("firstShredReceived"),Ge("completed"),Ge("optimisticConfirmation"),Ge("root")]),slot:Je(),timestamp:Je()}),et({type:Ge("createdBank"),parent:Je(),slot:Je(),timestamp:Je()}),et({type:Ge("frozen"),slot:Je(),timestamp:Je(),stats:et({numTransactionEntries:Je(),numSuccessfulTransactions:Je(),numFailedTransactions:Je(),maxTransactionsPerEntry:Je()})}),et({type:Ge("dead"),slot:Je(),timestamp:Je(),err:Xe()})])),Ai=(et({subscription:Je(),result:Ei}),et({subscription:Je(),result:ai(tt([li,pi]))}),et({subscription:Je(),result:Je()}),et({pubkey:Xe(),gossip:Ve(Xe()),tpu:Ve(Xe()),rpc:Ve(Xe()),version:Ve(Xe())}),et({votePubkey:Xe(),nodePubkey:Xe(),activatedStake:Je(),epochVoteAccount:We(),epochCredits:He(Qe([Je(),Je(),Je()])),commission:Je(),lastVote:Je(),rootSlot:Ve(Je())})),Si=(oi(et({current:He(Ai),delinquent:He(Ai)})),tt([Ge("processed"),Ge("confirmed"),Ge("finalized")])),Mi=et({slot:Je(),confirmations:Ve(Je()),err:di,confirmationStatus:Ye(Si)}),xi=(si(He(Ve(Mi))),oi(Je()),et({signatures:He(Xe()),message:et({accountKeys:He(Xe()),header:et({numRequiredSignatures:Je(),numReadonlySignedAccounts:Je(),numReadonlyUnsignedAccounts:Je()}),instructions:He(et({accounts:He(Je()),data:Xe(),programIdIndex:Je()})),recentBlockhash:Xe()})})),ki=et({parsed:rt(),program:Xe(),programId:ei}),Ii=et({accounts:He(ei),data:Xe(),programId:ei}),Ri=nt(tt([Ii,ki]),tt([et({parsed:rt(),program:Xe(),programId:Xe()}),et({accounts:He(Xe()),data:Xe(),programId:Xe()})]),(e=>je(e,"accounts"in e?Ii:ki))),Bi=et({signatures:He(Xe()),message:et({accountKeys:He(et({pubkey:ei,signer:We(),writable:We()})),instructions:He(Ri),recentBlockhash:Xe()})}),Ti=et({accountIndex:Je(),mint:Xe(),owner:Ye(Xe()),uiTokenAmount:yi}),Ui=et({err:di,fee:Je(),innerInstructions:Ye(Ve(He(et({index:Je(),instructions:He(et({accounts:He(Je()),data:Xe(),programIdIndex:Je()}))})))),preBalances:He(Je()),postBalances:He(Je()),logMessages:Ye(Ve(He(Xe()))),preTokenBalances:Ye(Ve(He(Ti))),postTokenBalances:Ye(Ve(He(Ti)))}),Oi=et({err:di,fee:Je(),innerInstructions:Ye(Ve(He(et({index:Je(),instructions:He(Ri)})))),preBalances:He(Je()),postBalances:He(Je()),logMessages:Ye(Ve(He(Xe()))),preTokenBalances:Ye(Ve(He(Ti))),postTokenBalances:Ye(Ve(He(Ti)))}),Ci=(oi(Ve(et({blockhash:Xe(),previousBlockhash:Xe(),parentSlot:Je(),transactions:He(et({transaction:xi,meta:Ve(Ui)})),rewards:Ye(He(et({pubkey:Xe(),lamports:Je(),postBalance:Ve(Je()),rewardType:Ve(Xe())}))),blockTime:Ve(Je()),blockHeight:Ve(Je())}))),oi(Ve(et({blockhash:Xe(),previousBlockhash:Xe(),parentSlot:Je(),transactions:He(et({transaction:xi,meta:Ve(Ui)})),rewards:Ye(He(et({pubkey:Xe(),lamports:Je(),postBalance:Ve(Je()),rewardType:Ve(Xe())}))),blockTime:Ve(Je())}))),oi(Ve(et({blockhash:Xe(),previousBlockhash:Xe(),parentSlot:Je(),signatures:He(Xe()),blockTime:Ve(Je())}))),oi(Ve(et({slot:Je(),meta:Ui,blockTime:Ye(Ve(Je())),transaction:xi}))),oi(Ve(et({slot:Je(),transaction:Bi,meta:Ve(Oi),blockTime:Ye(Ve(Je()))}))),si(et({blockhash:Xe(),feeCalculator:et({lamportsPerSignature:Je()})})),si(et({blockhash:Xe(),lastValidBlockHeight:Je()})),oi(He(et({slot:Je(),numTransactions:Je(),numSlots:Je(),samplePeriodSecs:Je()}))),si(Ve(et({feeCalculator:et({lamportsPerSignature:Je()})}))),oi(Xe()),oi(Xe()),et({err:di,logs:He(Xe()),signature:Xe()}));et({result:ai(Ci),subscription:Je()});class Pi{constructor(e){this._keypair=void 0,this._keypair=e||Me().sign.keyPair()}static generate(){return new Pi(Me().sign.keyPair())}static fromSecretKey(e,t){const r=Me().sign.keyPair.fromSecretKey(e);if(!t||!t.skipValidation){const e=(new TextEncoder).encode("@solana/web3.js-validation-v1"),t=Me().sign.detached(e,r.secretKey);if(!Me().sign.detached.verify(e,t,r.publicKey))throw new Error("provided secretKey is invalid")}return new Pi(r)}static fromSeed(e){return new Pi(Me().sign.keyPair.fromSeed(e))}get publicKey(){return new xn(this._keypair.publicKey)}get secretKey(){return this._keypair.secretKey}}const zi=Ue.n_([Ue.u8("numSignatures"),Ue.u8("padding"),Ue.KB("signatureOffset"),Ue.KB("signatureInstructionIndex"),Ue.KB("publicKeyOffset"),Ue.KB("publicKeyInstructionIndex"),Ue.KB("messageDataOffset"),Ue.KB("messageDataSize"),Ue.KB("messageInstructionIndex")]);class Li{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:n,instructionIndex:i}=e;Ln(32===t.length,`Public Key must be 32 bytes but received ${t.length} bytes`),Ln(64===n.length,`Signature must be 64 bytes but received ${n.length} bytes`);const o=zi.span,s=o+t.length,a=s+n.length,u=xe.Buffer.alloc(a+r.length),c=null==i?65535:i;return zi.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:c,publicKeyOffset:o,publicKeyInstructionIndex:c,messageDataOffset:a,messageDataSize:r.length,messageInstructionIndex:c},u),u.fill(t,o),u.fill(n,s),u.fill(r,a),new qn({keys:[],programId:Li.programId,data:u})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:n}=e;Ln(64===t.length,`Private key must be 64 bytes but received ${t.length} bytes`);try{const e=Pi.fromSecretKey(t),i=e.publicKey.toBytes(),o=Me().sign.detached(r,e.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:o,instructionIndex:n})}catch(e){throw new Error(`Error creating instruction; ${e}`)}}}Li.programId=new xn("Ed25519SigVerify111111111111111111111111111");const Ni=new xn("StakeConfig11111111111111111111111111111111");class qi{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}qi.default=new qi(0,0,xn.default);const ji=Object.freeze({Initialize:{index:0,layout:Ue.n_([Ue.Jq("instruction"),((e="authorized")=>Ue.n_([Un("staker"),Un("withdrawer")],e))(),((e="lockup")=>Ue.n_([Ue.gM("unixTimestamp"),Ue.gM("epoch"),Un("custodian")],e))()])},Authorize:{index:1,layout:Ue.n_([Ue.Jq("instruction"),Un("newAuthorized"),Ue.Jq("stakeAuthorizationType")])},Delegate:{index:2,layout:Ue.n_([Ue.Jq("instruction")])},Split:{index:3,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports")])},Withdraw:{index:4,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports")])},Deactivate:{index:5,layout:Ue.n_([Ue.Jq("instruction")])},Merge:{index:7,layout:Ue.n_([Ue.Jq("instruction")])},AuthorizeWithSeed:{index:8,layout:Ue.n_([Ue.Jq("instruction"),Un("newAuthorized"),Ue.Jq("stakeAuthorizationType"),On("authoritySeed"),Un("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class Di{constructor(){}static initialize(e){const{stakePubkey:t,authorized:r,lockup:n}=e,i=n||qi.default,o=Gn(ji.Initialize,{authorized:{staker:ut(r.staker.toBuffer()),withdrawer:ut(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:ut(i.custodian.toBuffer())}}),s={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:$n,isSigner:!1,isWritable:!1}],programId:this.programId,data:o};return new qn(s)}static createAccountWithSeed(e){const t=new jn;t.add(Zn.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static createAccount(e){const t=new jn;t.add(Zn.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:r,votePubkey:n}=e,i=Gn(ji.Delegate);return(new jn).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:Hn,isSigner:!1,isWritable:!1},{pubkey:Ni,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(e){const{stakePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:i,custodianPubkey:o}=e,s=Gn(ji.Authorize,{newAuthorized:ut(n.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Dn,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new jn).add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:r,authoritySeed:n,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=e,u=Gn(ji.AuthorizeWithSeed,{newAuthorized:ut(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:n,authorityOwner:ut(i.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:Dn,isSigner:!1,isWritable:!1}];return a&&c.push({pubkey:a,isSigner:!1,isWritable:!1}),(new jn).add({keys:c,programId:this.programId,data:u})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,lamports:i}=e,o=Gn(ji.Split,{lamports:i});return new qn({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(e){const t=new jn;return t.add(Zn.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),t.add(this.splitInstruction(e))}static splitWithSeed(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,basePubkey:i,seed:o,lamports:s}=e,a=new jn;return a.add(Zn.allocate({accountPubkey:n,basePubkey:i,seed:o,space:this.space,programId:this.programId})),a.add(this.splitInstruction({stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,lamports:s}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:r,authorizedPubkey:n}=e,i=Gn(ji.Merge);return(new jn).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:Hn,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:r,toPubkey:n,lamports:i,custodianPubkey:o}=e,s=Gn(ji.Withdraw,{lamports:i}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:Hn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new jn).add({keys:a,programId:this.programId,data:s})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:r}=e,n=Gn(ji.Deactivate);return(new jn).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}Di.programId=new xn("Stake11111111111111111111111111111111111111"),Di.space=200;const{publicKeyCreate:Fi,ecdsaSign:$i}=ot(),Hi=Ue.n_([Ue.u8("numSignatures"),Ue.KB("signatureOffset"),Ue.u8("signatureInstructionIndex"),Ue.KB("ethAddressOffset"),Ue.u8("ethAddressInstructionIndex"),Ue.KB("messageDataOffset"),Ue.KB("messageDataSize"),Ue.u8("messageInstructionIndex"),Ue.Ik(20,"ethAddress"),Ue.Ik(64,"signature"),Ue.u8("recoveryId")]);class Wi{constructor(){}static publicKeyToEthAddress(e){Ln(64===e.length,`Public key must be 64 bytes but received ${e.length} bytes`);try{return xe.Buffer.from(at().keccak_256.update(ut(e)).digest()).slice(-20)}catch(e){throw new Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:n,recoveryId:i,instructionIndex:o}=e;return Wi.createInstructionWithEthAddress({ethAddress:Wi.publicKeyToEthAddress(t),message:r,signature:n,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:r,signature:n,recoveryId:i,instructionIndex:o=0}=e;let s;s="string"==typeof t?t.startsWith("0x")?xe.Buffer.from(t.substr(2),"hex"):xe.Buffer.from(t,"hex"):t,Ln(20===s.length,`Address must be 20 bytes but received ${s.length} bytes`);const a=12+s.length,u=a+n.length+1,c=xe.Buffer.alloc(Hi.span+r.length);return Hi.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:o,ethAddressOffset:12,ethAddressInstructionIndex:o,messageDataOffset:u,messageDataSize:r.length,messageInstructionIndex:o,signature:ut(n),ethAddress:ut(s),recoveryId:i},c),c.fill(ut(r),Hi.span),new qn({keys:[],programId:Wi.programId,data:c})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:n}=e;Ln(32===t.length,`Private key must be 32 bytes but received ${t.length} bytes`);try{const e=ut(t),i=Fi(e,!1).slice(1),o=xe.Buffer.from(at().keccak_256.update(ut(r)).digest()),{signature:s,recid:a}=$i(o,e);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:s,recoveryId:a,instructionIndex:n})}catch(e){throw new Error(`Error creating instruction; ${e}`)}}}Wi.programId=new xn("KeccakSecp256k11111111111111111111111111111"),new xn("Va1idator1nfo111111111111111111111111111111"),et({name:Xe(),website:Ye(Xe()),details:Ye(Xe()),keybaseUsername:Ye(Xe())}),new xn("Vote111111111111111111111111111111111111111"),Ue.n_([Un("nodePubkey"),Un("authorizedWithdrawer"),Ue.u8("commission"),Ue._O(),Ue.A9(Ue.n_([Ue._O("slot"),Ue.Jq("confirmationCount")]),Ue.cv(Ue.Jq(),-8),"votes"),Ue.u8("rootSlotValid"),Ue._O("rootSlot"),Ue._O(),Ue.A9(Ue.n_([Ue._O("epoch"),Un("authorizedVoter")]),Ue.cv(Ue.Jq(),-8),"authorizedVoters"),Ue.n_([Ue.A9(Ue.n_([Un("authorizedPubkey"),Ue._O("epochOfLastAuthorizedSwitch"),Ue._O("targetEpoch")]),32,"buf"),Ue._O("idx"),Ue.u8("isEmpty")],"priorVoters"),Ue._O(),Ue.A9(Ue.n_([Ue._O("epoch"),Ue._O("credits"),Ue._O("prevCredits")]),Ue.cv(Ue.Jq(),-8),"epochCredits"),Ue.n_([Ue._O("slot"),Ue._O("timestamp")],"lastTimestamp")]);const Ki=Object.freeze({InitializeAccount:{index:0,layout:Ue.n_([Ue.Jq("instruction"),((e="voteInit")=>Ue.n_([Un("nodePubkey"),Un("authorizedVoter"),Un("authorizedWithdrawer"),Ue.u8("commission")],e))()])},Authorize:{index:1,layout:Ue.n_([Ue.Jq("instruction"),Un("newAuthorized"),Ue.Jq("voteAuthorizationType")])},Withdraw:{index:3,layout:Ue.n_([Ue.Jq("instruction"),Ue.gM("lamports")])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class Gi{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:r,voteInit:n}=e,i=Gn(Ki.InitializeAccount,{voteInit:{nodePubkey:ut(n.nodePubkey.toBuffer()),authorizedVoter:ut(n.authorizedVoter.toBuffer()),authorizedWithdrawer:ut(n.authorizedWithdrawer.toBuffer()),commission:n.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:$n,isSigner:!1,isWritable:!1},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new qn(o)}static createAccount(e){const t=new jn;return t.add(Zn.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:i}=e,o=Gn(Ki.Authorize,{newAuthorized:ut(n.toBuffer()),voteAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return(new jn).add({keys:s,programId:this.programId,data:o})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:i}=e,o=Gn(Ki.Withdraw,{lamports:n}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return(new jn).add({keys:s,programId:this.programId,data:o})}}Gi.programId=new xn("Vote111111111111111111111111111111111111111"),Gi.space=3731;var Vi=r(5973);class Ji extends oe{constructor(e){super(e),this.providerName=B.solana}request(e){return this.bridgeRequest(e)}}const Yi=e=>Vi.encode(e.serialize({requireAllSignatures:!1})),Zi=e=>jn.from(Vi.decode(e));var Xi=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class Qi extends Ji{constructor(e){super(Object.assign(Object.assign({},e),{bridge:e.bridge||he({timeout:e.timeout})})),this.isPhantom=!0,this.isSolflare=!0,this.isGlow=!0,this._publicKey=null,this._registerEvents()}get publicKey(){return this._publicKey}get isConnected(){return null!==this._publicKey}_registerEvents(){window.addEventListener("onekey_bridge_disconnect",(()=>{this._handleDisconnected()})),this.on("message_low_level",(e=>{const{method:t,params:r}=e;(function(e,t){return e===`metamask_${t}`||e===`wallet_events_${t}`})(t,"accountChanged")&&this._handleAccountChange(r)}))}_callBridge(e){return this.bridgeRequest(e)}postMessage(e){return this._callBridge(e)}connect(e){return Xi(this,void 0,void 0,(function*(){if(this.publicKey)return{publicKey:this.publicKey};const t=yield this._callBridge({method:"connect",params:e}),r=new xn(t.publicKey);return this._handleConnected(r,{emit:!0}),{publicKey:r}}))}_handleConnected(e,t={emit:!0}){this._publicKey=e,t.emit&&this.emit("connect",e)}disconnect(){return Xi(this,void 0,void 0,(function*(){yield this._callBridge({method:"disconnect",params:void 0}),this._handleDisconnected()}))}_handleDisconnected(e={emit:!0}){this._publicKey=null,e.emit&&this.emit("disconnect")}_handleAccountChange(e){const t=e.accounts[0];if(!t)return this._handleDisconnected(),this.emit("accountChanged",null);const r=new xn(t.publicKey);this._handleConnected(r,{emit:!1}),this.emit("accountChanged",r)}signAndSendTransaction(e,t){return Xi(this,void 0,void 0,(function*(){return this._handleSignAndSendTransaction({message:Yi(e),options:t})}))}_handleSignAndSendTransaction(e){return Xi(this,void 0,void 0,(function*(){return yield this._callBridge({method:"signAndSendTransaction",params:e})}))}signTransaction(e){return Xi(this,void 0,void 0,(function*(){return this._handleSignTransaction({message:Yi(e)})}))}_handleSignTransaction(e){return Xi(this,void 0,void 0,(function*(){const t=yield this._callBridge({method:"signTransaction",params:e});return Zi(t)}))}signAllTransactions(e){return Xi(this,void 0,void 0,(function*(){return this._handleSignAllTransactions({message:e.map(Yi)})}))}_handleSignAllTransactions(e){return Xi(this,void 0,void 0,(function*(){return(yield this._callBridge({method:"signAllTransactions",params:e})).map(Zi)}))}signMessage(e,t){return Xi(this,void 0,void 0,(function*(){return this._handleSignMessage({message:e,display:t})}))}_handleSignMessage(e){return Xi(this,void 0,void 0,(function*(){const{message:t,display:r}=e,n=yield this._callBridge({method:"signMessage",params:{message:"string"==typeof t?t:Vi.encode(t),display:r}});return{signature:Vi.decode(n.signature),publicKey:new xn(n.publicKey)}}))}request(...e){let t,r;if("string"==typeof e[0])t=e[0],r=e[1];else{const n=e[0];t=n.method,r=n.params}switch(t){case"connect":return this.connect(r);case"disconnect":return this.disconnect();case"signTransaction":return this._handleSignTransaction(r);case"signAllTransactions":return this._handleSignAllTransactions(r);case"signMessage":return this._handleSignMessage(r);case"signAndSendTransaction":return this._handleSignAndSendTransaction(r)}return this._callBridge({method:t,params:r})}on(e,t){return super.on(e,t)}emit(e,...t){return super.emit(e,...t)}}var eo=r(3596);const to={errors:{disconnected:()=>"StarMask: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"StarMask: Disconnected from StarMask background. Page reload required.",sendSiteMetadata:()=>"StarMask: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`StarMask: The StarMask Starcoin provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`StarMask: Connected to chain with ID "${e}".`},warnings:{enableDeprecation:"StarMask: 'starcoin.enable()' is deprecated and may be removed in the future. Please use the 'stc_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",sendDeprecation:"StarMask: 'starcoin.send(...)' is deprecated and may be removed in the future. Please use 'starcoin.sendAsync(...)' or 'starcoin.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",events:{close:"StarMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"StarMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"StarMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"StarMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"},experimentalMethods:"StarMask: 'starcoin._starmask' exposes non-standard, experimental methods. They may be removed or changed without warning."}},ro=()=>{},no=["stc_subscription"];var io=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class oo extends oe{constructor(e){var t;super(e),this.providerName=B.starcoin,this.isStarMask=!0,this._log=null!==(t=e.logger)&&void 0!==t?t:window.console,this._state=Object.assign({},oo._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this),this._handleStreamDisconnect.bind(this,"OneKey"),this.on("connect",(()=>{this._state.isConnected=!0})),this._handleStreamDisconnect.bind(this,"OneKey RpcProvider"),this._initializeState(),this.on("message_low_level",(e=>{const{method:t,params:r}=e;"starmask_accountsChanged"===t?this._handleAccountsChanged(r):"starmask_unlockStateChanged"===t?this._handleUnlockStateChanged(r):"starmask_chainChanged"===t?this._handleChainChanged(r):no.includes(t)?this.emit("message",{type:t,data:r}):"STARMASK_STREAM_FAILURE"===t&&new Error(to.errors.permanentlyDisconnected())}))}isConnected(){return this._state.isConnected}request(e){return io(this,void 0,void 0,(function*(){if(I.ethereum("request",e),!e||"object"!=typeof e||Array.isArray(e))throw eo.Sy.rpc.invalidRequest({message:to.errors.invalidRequestArgs(),data:e});const{method:t,params:r,id:n}=e;if(!t||"string"!=typeof t||0===t.length)throw eo.Sy.rpc.invalidRequest({message:to.errors.invalidRequestMethod(),data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw eo.Sy.rpc.invalidRequest({message:to.errors.invalidRequestParams(),data:e});const i=yield this._rpcRequest({method:t,params:r,id:n});return I.ethereum("request->response","\n",e,"\n ---\x3e ",i),i}))}_initializeState(){return io(this,void 0,void 0,(function*(){try{const e=yield this.request({method:"starmask_getProviderState"}),{accounts:t,chainId:r,isUnlocked:n,networkVersion:i}=e;this.emit("connect",{chainId:r}),this._handleChainChanged({chainId:r,networkVersion:i}),this._handleUnlockStateChanged({accounts:t,isUnlocked:n}),this._handleAccountsChanged(t)}catch(e){this._log.error("StarMask: Failed to get initial state. Please report this bug.",e)}finally{this._state.initialized=!0,this.emit("_initialized")}}))}_rpcRequest(e,t){return io(this,void 0,void 0,(function*(){if(!Array.isArray(e)){e.jsonrpc||(e.jsonrpc="2.0");const r=yield this.bridgeRequest(e,t);return"stc_accounts"!==e.method&&"stc_requestAccounts"!==e.method||this._handleAccountsChanged(r||[],"stc_accounts"===e.method),r}return this.bridgeRequest(e,t)}))}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),this._log.debug(to.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let r;this._state.isConnected=!1,e?(r=new eo.Cg(1013,t||to.errors.disconnected()),this._log.debug(r)):(r=new eo.Cg(1011,t||to.errors.permanentlyDisconnected()),this._log.error(r),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r)}}_handleStreamDisconnect(e,t){!function(e,t,r,n){let i=`StarMask: Lost connection to "${t}".`;(null==r?void 0:r.stack)&&(i+=`\n${r.stack}`),e.warn(i),n&&n.listenerCount("error")>0&&n.emit("error",i)}(this._log,e,t,this),this._handleDisconnect(!1,t?t.message:void 0)}_handleChainChanged({chainId:e,networkVersion:t}={}){e&&"string"==typeof e&&e.startsWith("0x")&&t&&"string"==typeof t?"loading"===t?this._handleDisconnect(!0):(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId))):this._log.error("StarMask: Received invalid network parameters. Please report this bug.",{chainId:e,networkVersion:t})}_handleAccountsChanged(e,t=!1){let r=e;Array.isArray(e)||(this._log.error("StarMask: Received invalid accounts parameter. Please report this bug.",e),r=[]);for(const t of e)if("string"!=typeof t){this._log.error("StarMask: Received non-string account. Please report this bug.",e),r=[];break}pe(this._state.accounts,r)||(t&&null!==this._state.accounts&&this._log.error("StarMask: 'stc_accounts' unexpectedly updated accounts. Please report this bug.",r),this._state.accounts=r,this.selectedAddress!==r[0]&&(this.selectedAddress=r[0]||null),this._state.initialized&&this.emit("accountsChanged",r))}_handleUnlockStateChanged({accounts:e,isUnlocked:t}={}){"boolean"==typeof t?t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e||[])):this._log.error("StarMask: Received invalid isUnlocked parameter. Please report this bug.")}}oo._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1};var so=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class ao extends oo{constructor(e){super(e),this._sentWarnings={enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},this.networkVersion=null,this.isStarMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._starmask=this._getExperimentalApi(),this.bridge.on("notification",(e=>{const{method:t}=e;if(no.includes(t)){this.emit("data",e);const t=e.params;this.emit("notification",t.result)}}))}sendAsync(e,t){this._rpcRequest(e,t)}addListener(e,t){return this._warnOfDeprecation(e),super.addListener(e,t)}on(e,t){return this._warnOfDeprecation(e),super.on(e,t)}once(e,t){return this._warnOfDeprecation(e),super.once(e,t)}prependListener(e,t){return this._warnOfDeprecation(e),super.prependListener(e,t)}prependOnceListener(e,t){return this._warnOfDeprecation(e),super.prependOnceListener(e,t)}_handleDisconnect(e,t){super._handleDisconnect(e,t),this.networkVersion&&!e&&(this.networkVersion=null)}_warnOfDeprecation(e){var t;!1===(null===(t=this._sentWarnings)||void 0===t?void 0:t.events[e])&&(this._log.warn(to.warnings.events[e]),this._sentWarnings.events[e]=!0)}enable(){return so(this,void 0,void 0,(function*(){return this._sentWarnings.enable||(this._log.warn(to.warnings.enableDeprecation),this._sentWarnings.enable=!0),yield this._rpcRequest({method:"stc_requestAccounts",params:[]})}))}_rpcResult(e,t){var r,n;return{id:null!==(r=null==t?void 0:t.id)&&void 0!==r?r:void 0,jsonrpc:null!==(n=null==t?void 0:t.jsonrpc)&&void 0!==n?n:"2.0",result:e}}send(e,t){return this._sentWarnings.send||(this._log.warn(to.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof e||t&&!Array.isArray(t)?e&&"object"==typeof e&&"function"==typeof t?this._rpcRequest(e,t):this._sendSync(e):this._rpcRequest({method:e,params:t}).then((e=>this._rpcResult(e)))}_sendSync(e){let t;switch(e.method){case"stc_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"stc_coinbase":t=this.selectedAddress||null;break;case"stc_uninstallFilter":this._rpcRequest(e,ro),t=!0;break;case"net_version":t=this.networkVersion||null;break;default:throw new Error(to.errors.unsupportedSync(e.method))}return this._rpcResult(t,e)}_getExperimentalApi(){return new Proxy({isUnlocked:()=>so(this,void 0,void 0,(function*(){return this._state.initialized||(yield new Promise((e=>{this.on("_initialized",(()=>e()))}))),this._state.isUnlocked})),requestBatch:e=>so(this,void 0,void 0,(function*(){if(!Array.isArray(e))throw D({message:"Batch requests must be made with an array of request objects.",data:e});return this._rpcRequest(e)}))},{get:(e,t,...r)=>(this._sentWarnings.experimentalMethods||(this._log.warn(to.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(e,t,...r))})}_handleChainChanged({chainId:e,networkVersion:t}={}){super._handleChainChanged({chainId:e,networkVersion:t}),t&&"loading"!==t&&t!==this.networkVersion&&(this.networkVersion=t,this._state.initialized&&this.emit("networkChanged",this.networkVersion))}}class uo extends ao{}class co extends oe{constructor(e){super(e),this.providerName=B.aptos}request(e){return this.bridgeRequest(e)}}var ho=r(8764).Buffer,fo=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const lo="accountChanged",po="networkChange";function yo({method:e,name:t}){return e===`wallet_events_${t}`}class go extends co{constructor(e){super(Object.assign(Object.assign({},e),{bridge:e.bridge||he({timeout:e.timeout})})),this._account=null,this.aptosProviderType="petra",this._registerEvents()}get publicKey(){var e,t;return null!==(t=null===(e=this._account)||void 0===e?void 0:e.publicKey)&&void 0!==t?t:null}_registerEvents(){window.addEventListener("onekey_bridge_disconnect",(()=>{this._handleDisconnected()})),this.on("message_low_level",(e=>{const{method:t,params:r}=e;yo({method:t,name:lo})&&this._handleAccountChange(r),yo({method:t,name:po})&&this._handleNetworkChange(r)}))}_callBridge(e){return e.aptosProviderType=this.aptosProviderType,this.bridgeRequest(e)}_handleConnected(e,t={emit:!0}){var r;this._account=e,t.emit&&this.emit("connect",null!==(r=null==e?void 0:e.address)&&void 0!==r?r:null)}_handleDisconnected(e={emit:!0}){this._account=null,e.emit&&this.emit("disconnect")}_handleAccountChange(e){var t;const r=e;if(!r)return this._handleDisconnected(),this.emit("accountChanged",null);this._handleConnected(r,{emit:!1}),this.emit("accountChanged",null!==(t=null==r?void 0:r.address)&&void 0!==t?t:null)}_handleNetworkChange(e){const t=e;this.emit("networkChange",null!=t?t:null)}connect(){return fo(this,void 0,void 0,(function*(){if(this._account)return Promise.resolve(this._account);const e=yield this._callBridge({method:"connect",params:void 0});if(!e)throw F();return this._handleConnected(e,{emit:!0}),e}))}isConnected(){return null!==this._account}account(){return fo(this,void 0,void 0,(function*(){const e=yield this._callBridge({method:"account",params:void 0});if(!e)throw F();return Promise.resolve(e)}))}signAndSubmitTransaction(e){return fo(this,void 0,void 0,(function*(){const t=yield this._callBridge({method:"signAndSubmitTransaction",params:e});if(!t)throw F();return JSON.parse(t)}))}signTransaction(e){return fo(this,void 0,void 0,(function*(){const t=yield this._callBridge({method:"signTransaction",params:e});if(!t)throw F();return new Uint8Array(ho.from(t,"hex"))}))}signMessage(e){return this._callBridge({method:"signMessage",params:e})}network(){return this._callBridge({method:"network",params:void 0})}getNetworkURL(){return this._callBridge({method:"getNetworkURL",params:void 0})}disconnect(){return fo(this,void 0,void 0,(function*(){yield this._callBridge({method:"disconnect",params:void 0}),this._handleDisconnected()}))}onNetworkChange(e){return super.on(po,e)}onAccountChange(e){return super.on(lo,e)}on(e,t){return super.on(e,t)}emit(e,...t){return super.emit(e,...t)}}var bo=r(6254),mo=r(5857),vo=r(7184);"object"==typeof self&&"crypto"in self&&self.crypto;const wo=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const _o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Eo(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=_o[e[r]];return t}function Ao(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function So(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}class Mo{clone(){return this._cloneInto()}}function xo(e){const t=t=>e().update(So(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function ko(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Io(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}const Ro={number:ko,bool:function(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:Io,hash:function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");ko(e.outputLen),ko(e.blockLen)},exists:function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},output:function(e,t){Io(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}},Bo=Ro;class To extends Mo{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Bo.hash(e);const r=So(t);if(this.iHash=e.create(),!(this.iHash instanceof Mo))throw new TypeError("Expected instance of class which extends utils.Hash");const n=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const i=new Uint8Array(n);i.set(r.length>this.iHash.blockLen?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return Bo.exists(this),this.iHash.update(e),this}digestInto(e){Bo.exists(this),Bo.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Uo=(e,t,r)=>new To(e,t).update(r).digest();Uo.create=(e,t)=>new To(e,t);class Oo extends Mo{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=wo(this.buffer)}update(e){Bo.exists(this);const{view:t,buffer:r,blockLen:n}=this,i=(e=So(e)).length;for(let o=0;o<i;){const s=Math.min(n-this.pos,i-o);if(s!==n)r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=wo(e);for(;n<=i-o;o+=n)this.process(t,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Bo.exists(this),Bo.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:i}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),u=n?4:0,c=n?0:4;e.setUint32(t+u,s,n),e.setUint32(t+c,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=wo(e);this.get().forEach(((e,t)=>s.setUint32(4*t,e,i)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}const Co=BigInt(2**32-1),Po=BigInt(32);function zo(e,t=!1){return t?{h:Number(e&Co),l:Number(e>>Po&Co)}:{h:0|Number(e>>Po&Co),l:0|Number(e&Co)}}const Lo={fromBig:zo,split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=zo(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]},toBig:(e,t)=>BigInt(e>>>0)<<Po|BigInt(t>>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:function(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},No=Lo,[qo,jo]=No.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))),Do=new Uint32Array(80),Fo=new Uint32Array(80);class $o extends Oo{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:u,El:c,Fh:h,Fl:f,Gh:d,Gl:l,Hh:p,Hl:y}=this;return[e,t,r,n,i,o,s,a,u,c,h,f,d,l,p,y]}set(e,t,r,n,i,o,s,a,u,c,h,f,d,l,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|u,this.El=0|c,this.Fh=0|h,this.Fl=0|f,this.Gh=0|d,this.Gl=0|l,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)Do[r]=e.getUint32(t),Fo[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|Do[e-15],r=0|Fo[e-15],n=No.rotrSH(t,r,1)^No.rotrSH(t,r,8)^No.shrSH(t,r,7),i=No.rotrSL(t,r,1)^No.rotrSL(t,r,8)^No.shrSL(t,r,7),o=0|Do[e-2],s=0|Fo[e-2],a=No.rotrSH(o,s,19)^No.rotrBH(o,s,61)^No.shrSH(o,s,6),u=No.rotrSL(o,s,19)^No.rotrBL(o,s,61)^No.shrSL(o,s,6),c=No.add4L(i,u,Fo[e-7],Fo[e-16]),h=No.add4H(c,n,a,Do[e-7],Do[e-16]);Do[e]=0|h,Fo[e]=0|c}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:u,Dl:c,Eh:h,El:f,Fh:d,Fl:l,Gh:p,Gl:y,Hh:g,Hl:b}=this;for(let e=0;e<80;e++){const t=No.rotrSH(h,f,14)^No.rotrSH(h,f,18)^No.rotrBH(h,f,41),m=No.rotrSL(h,f,14)^No.rotrSL(h,f,18)^No.rotrBL(h,f,41),v=h&d^~h&p,w=f&l^~f&y,_=No.add5L(b,m,w,jo[e],Fo[e]),E=No.add5H(_,g,t,v,qo[e],Do[e]),A=0|_,S=No.rotrSH(r,n,28)^No.rotrBH(r,n,34)^No.rotrBH(r,n,39),M=No.rotrSL(r,n,28)^No.rotrBL(r,n,34)^No.rotrBL(r,n,39),x=r&i^r&s^i&s,k=n&o^n&a^o&a;g=0|p,b=0|y,p=0|d,y=0|l,d=0|h,l=0|f,({h,l:f}=No.add(0|u,0|c,0|E,0|A)),u=0|s,c=0|a,s=0|i,a=0|o,i=0|r,o=0|n;const I=No.add3L(A,M,k);r=No.add3H(I,E,S,x),n=0|I}({h:r,l:n}=No.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=No.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=No.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:u,l:c}=No.add(0|this.Dh,0|this.Dl,0|u,0|c)),({h,l:f}=No.add(0|this.Eh,0|this.El,0|h,0|f)),({h:d,l}=No.add(0|this.Fh,0|this.Fl,0|d,0|l)),({h:p,l:y}=No.add(0|this.Gh,0|this.Gl,0|p,0|y)),({h:g,l:b}=No.add(0|this.Hh,0|this.Hl,0|g,0|b)),this.set(r,n,i,o,s,a,u,c,h,f,d,l,p,y,g,b)}roundClean(){Do.fill(0),Fo.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Ho extends $o{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class Wo extends $o{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const Ko=xo((()=>new $o));xo((()=>new Ho)),xo((()=>new Wo));var Go=r(7788),Vo=r(9881),Jo=Object.defineProperty,Yo=Object.getOwnPropertyDescriptor,Zo=(e,t)=>{for(var r in t)Jo(e,r,{get:t[r],enumerable:!0})},Xo=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?Yo(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&Jo(t,r,o),o},Qo=/^m(\/[0-9]+')+$/,es=e=>e.replace("'",""),ts=class{static fromBuffer(e){return ts.fromUint8Array(e)}static fromUint8Array(e){return new ts(Eo(e))}static ensure(e){return"string"==typeof e?new ts(e):e}constructor(e){e.startsWith("0x")?this.hexString=e:this.hexString=`0x${e}`}hex(){return this.hexString}noPrefix(){return this.hexString.slice(2)}toString(){return this.hex()}toShortString(){return`0x${this.hexString.replace(/^0x0*/,"")}`}toUint8Array(){return Uint8Array.from(Ao(this.noPrefix()))}};async function rs(e){return new Promise((t=>{setTimeout(t,e)}))}function ns(e){let t,r,n;return"object"==typeof e?(t=e.hashFunction,r=e.ttlMs,n=e.tags):t=e,(e,i,o)=>{if(null!=o.value)o.value=os(o.value,t,r,n);else{if(null==o.get)throw new Error("Only put a Memoize() decorator on a method or get accessor.");o.get=os(o.get,t,r,n)}}}var is=new Map;function os(e,t,r=0,n){const i=Symbol("__memoized_map__");return function(...o){let s;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});const a=this[i];if(Array.isArray(n))for(const e of n)is.has(e)?is.get(e).push(a):is.set(e,[a]);if(t||o.length>0||r>0){let n;n=!0===t?o.map((e=>e.toString())).join("!"):t?t.apply(this,o):o[0];const i=`${n}__timestamp`;let u=!1;if(r>0)if(a.has(i)){const e=a.get(i);u=Date.now()-e>r}else u=!0;a.has(n)&&!u?s=a.get(n):(s=e.apply(this,o),a.set(n,s),r>0&&a.set(i,Date.now()))}else{const t=this;a.has(t)?s=a.get(t):(s=e.apply(this,o),a.set(t,s))}return s}}var{sha3_256:ss}=mo,as=class{static fromAptosAccountObject(e){return new as(ts.ensure(e.privateKeyHex).toUint8Array(),e.address)}static fromDerivePath(e,t){if(!as.isValidPath(e))throw new Error("Invalid derivation path");const r=t.trim().split(/\s+/).map((e=>e.toLowerCase())).join(" "),{key:n}=((e,t,r=2147483648)=>{if(!(e=>!!Qo.test(e)&&!e.split("/").slice(1).map(es).some(Number.isNaN))(e))throw new Error("Invalid derivation path");const{key:n,chainCode:i}=(e=>{const t=Uo.create(Ko,"ed25519 seed").update(Ao(e)).digest();return{key:t.slice(0,32),chainCode:t.slice(32)}})(t);return e.split("/").slice(1).map(es).map((e=>parseInt(e,10))).reduce(((e,t)=>(({key:e,chainCode:t},r)=>{const n=new ArrayBuffer(4);new DataView(n).setUint32(0,r);const i=new Uint8Array(n),o=new Uint8Array([0]),s=new Uint8Array([...o,...e,...i]),a=Uo.create(Ko,t).update(s).digest();return{key:a.slice(0,32),chainCode:a.slice(32)}})(e,t+r)),{key:n,chainCode:i})})(e,Eo(vo.Z1(r)));return new as(n)}constructor(e,t){this.signingKey=e?bo.sign.keyPair.fromSeed(e.slice(0,32)):bo.sign.keyPair(),this.accountAddress=ts.ensure(t||this.authKey().hex())}address(){return this.accountAddress}authKey(){const e=ss.create();return e.update(this.signingKey.publicKey),e.update("\0"),new ts(e.hex())}pubKey(){return ts.fromUint8Array(this.signingKey.publicKey)}signBuffer(e){const t=bo.sign(e,this.signingKey.secretKey);return ts.fromUint8Array(t.slice(0,64))}signHexString(e){const t=ts.ensure(e).toUint8Array();return this.signBuffer(t)}toPrivateKeyObject(){return{address:this.address().hex(),publicKeyHex:this.pubKey().hex(),privateKeyHex:ts.fromUint8Array(this.signingKey.secretKey.slice(0,32)).hex()}}},us=as;us.isValidPath=e=>!!/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'+$/.test(e),Xo([ns()],us.prototype,"authKey",1),Zo({},{$AccountData:()=>Ts,$AccountSignature:()=>Us,$AccountSignature_Ed25519Signature:()=>Os,$AccountSignature_MultiEd25519Signature:()=>Cs,$Address:()=>Ps,$AptosError:()=>zs,$AptosErrorCode:()=>Ls,$Block:()=>Ns,$BlockMetadataTransaction:()=>qs,$DecodedTableData:()=>js,$DeleteModule:()=>Fs,$DeleteResource:()=>$s,$DeleteTableItem:()=>Hs,$DeletedTableData:()=>Ds,$DirectWriteSet:()=>Ws,$Ed25519Signature:()=>Ks,$EncodeSubmissionRequest:()=>Gs,$EntryFunctionId:()=>Vs,$EntryFunctionPayload:()=>Js,$Event:()=>Ys,$EventGuid:()=>Zs,$EventKey:()=>Xs,$GasEstimation:()=>Qs,$GenesisPayload:()=>ea,$GenesisPayload_WriteSetPayload:()=>ta,$GenesisTransaction:()=>ra,$HashValue:()=>na,$HealthCheckSuccess:()=>ia,$HexEncodedBytes:()=>oa,$IdentifierWrapper:()=>sa,$IndexResponse:()=>aa,$ModuleBundlePayload:()=>ua,$MoveAbility:()=>ca,$MoveFunction:()=>ha,$MoveFunctionGenericTypeParam:()=>fa,$MoveFunctionVisibility:()=>da,$MoveModule:()=>la,$MoveModuleBytecode:()=>pa,$MoveModuleId:()=>ya,$MoveResource:()=>ga,$MoveScriptBytecode:()=>ba,$MoveStruct:()=>ma,$MoveStructField:()=>va,$MoveStructGenericTypeParam:()=>wa,$MoveStructTag:()=>_a,$MoveStructValue:()=>Ea,$MoveType:()=>Aa,$MoveValue:()=>Sa,$MultiAgentSignature:()=>Ma,$MultiEd25519Signature:()=>xa,$PendingTransaction:()=>ka,$RoleType:()=>Ia,$ScriptPayload:()=>Ra,$ScriptWriteSet:()=>Ba,$StateCheckpointTransaction:()=>Ta,$SubmitTransactionRequest:()=>Ua,$TableItemRequest:()=>Oa,$Transaction:()=>Ca,$TransactionPayload:()=>ja,$TransactionPayload_EntryFunctionPayload:()=>Da,$TransactionPayload_ModuleBundlePayload:()=>Fa,$TransactionPayload_ScriptPayload:()=>$a,$TransactionSignature:()=>Ka,$TransactionSignature_Ed25519Signature:()=>Ga,$TransactionSignature_MultiAgentSignature:()=>Va,$TransactionSignature_MultiEd25519Signature:()=>Ja,$Transaction_BlockMetadataTransaction:()=>Pa,$Transaction_GenesisTransaction:()=>za,$Transaction_PendingTransaction:()=>La,$Transaction_StateCheckpointTransaction:()=>Na,$Transaction_UserTransaction:()=>qa,$TransactionsBatchSingleSubmissionFailure:()=>Ha,$TransactionsBatchSubmissionResult:()=>Wa,$U128:()=>Ya,$U64:()=>Za,$UserTransaction:()=>Xa,$VersionedEvent:()=>Qa,$WriteModule:()=>eu,$WriteResource:()=>tu,$WriteSet:()=>ru,$WriteSetChange:()=>ou,$WriteSetChange_DeleteModule:()=>su,$WriteSetChange_DeleteResource:()=>au,$WriteSetChange_DeleteTableItem:()=>uu,$WriteSetChange_WriteModule:()=>cu,$WriteSetChange_WriteResource:()=>hu,$WriteSetChange_WriteTableItem:()=>fu,$WriteSetPayload:()=>du,$WriteSet_DirectWriteSet:()=>nu,$WriteSet_ScriptWriteSet:()=>iu,$WriteTableItem:()=>lu,AccountsService:()=>ws,ApiError:()=>hs,AptosErrorCode:()=>Is,AptosGeneratedClient:()=>xs,BaseHttpRequest:()=>cs,BlocksService:()=>_s,CancelError:()=>fs,CancelablePromise:()=>ds,EventsService:()=>Es,GeneralService:()=>As,MoveFunctionVisibility:()=>Rs,OpenAPI:()=>ks,RoleType:()=>Bs,TablesService:()=>Ss,TransactionsService:()=>Ms});var cs=class{constructor(e){this.config=e}},hs=class extends Error{constructor(e,t,r){super(r),this.name="ApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.body=t.body,this.request=e}},fs=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},ds=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this._cancelHandlers=[],this._promise=new Promise(((t,r)=>{this._resolve=t,this._reject=r;const n=e=>{this._isResolved||this._isRejected||this._isCancelled||this._cancelHandlers.push(e)};return Object.defineProperty(n,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(n,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(n,"isCancelled",{get:()=>this._isCancelled}),e((e=>{var t;this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,null==(t=this._resolve)||t.call(this,e))}),(e=>{var t;this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,null==(t=this._reject)||t.call(this,e))}),n)}))}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(){var e;if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this._cancelHandlers.length)try{for(const e of this._cancelHandlers)e()}catch(e){return void console.warn("Cancellation threw an error",e)}this._cancelHandlers.length=0,null==(e=this._reject)||e.call(this,new fs("Request aborted"))}}get isCancelled(){return this._isCancelled}};Symbol.toStringTag;var ls=e=>null!=e,ps=e=>"string"==typeof e,ys=e=>ps(e)&&""!==e,gs=e=>"object"==typeof e&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.arrayBuffer&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),bs=async(e,t)=>"function"==typeof t?t(e):t,ms=(e,t)=>new ds((async(r,n,i)=>{try{const n=((e,t)=>{const r=e.ENCODE_PATH||encodeURI,n=t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,((e,n)=>{var i;return(null==(i=t.path)?void 0:i.hasOwnProperty(n))?r(String(t.path[n])):e})),i=`${e.BASE}${n}`;return t.query?`${i}${(e=>{const t=[],r=(e,n)=>{ls(n)&&(Array.isArray(n)?n.forEach((t=>{r(e,t)})):"object"==typeof n?Object.entries(n).forEach((([t,n])=>{r(`${e}[${t}]`,n)})):((e,r)=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)})(e,n))};return Object.entries(e).forEach((([e,t])=>{r(e,t)})),t.length>0?`?${t.join("&")}`:""})(t.query)}`:i})(e,t),s=(e=>{if(e.formData){const t=new Vo,r=(e,r)=>{ps(r)||gs(r)?t.append(e,r):t.append(e,JSON.stringify(r))};return Object.entries(e.formData).filter((([e,t])=>ls(t))).forEach((([e,t])=>{Array.isArray(t)?t.forEach((t=>r(e,t))):r(e,t)})),t}})(t),a=(e=>{if(e.body)return e.body})(t),u=await(async(e,t,r)=>{const n=await bs(t,e.TOKEN),i=await bs(t,e.USERNAME),o=await bs(t,e.PASSWORD),s=await bs(t,e.HEADERS),a="function"==typeof(null==r?void 0:r.getHeaders)&&(null==r?void 0:r.getHeaders())||{},u=Object.entries({Accept:"application/json",...s,...t.headers,...a}).filter((([e,t])=>ls(t))).reduce(((e,[t,r])=>({...e,[t]:String(r)})),{});if(ys(n)&&(u.Authorization=`Bearer ${n}`),ys(i)&&ys(o)){const e=btoa(`${i}:${o}`);u.Authorization=`Basic ${e}`}return t.body&&(t.mediaType?u["Content-Type"]=t.mediaType:gs(t.body)?u["Content-Type"]=t.body.type||"application/octet-stream":ps(t.body)?u["Content-Type"]="text/plain":t.body instanceof Vo||(u["Content-Type"]="application/json")),u})(e,t,s);if(!i.isCancelled){const c=await(async(e,t,r,n,i,o,s)=>{const a=Go.CancelToken.source(),u={url:r,headers:o,data:n??i,method:t.method,withCredentials:e.WITH_CREDENTIALS,cancelToken:a.token};s((()=>a.cancel("The user aborted a request.")));try{return await Go.request(u)}catch(e){const t=e;if(t.response)return t.response;throw e}})(e,t,n,a,s,u,i),h=(e=>{if(204!==e.status)return e.data})(c),f=((e,t)=>{if(t){const r=e.headers[t];if(ps(r))return r}})(c,t.responseHeader),d={url:n,ok:(o=c.status,o>=200&&o<300),status:c.status,statusText:c.statusText,body:f??h};((e,t)=>{const r={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...e.errors}[t.status];if(r)throw new hs(e,t,r);if(!t.ok)throw new hs(e,t,"Generic Error")})(t,d),r(d.body)}}catch(e){n(e)}var o})),vs=class extends cs{constructor(e){super(e)}request(e){return ms(this.config,e)}},ws=class{constructor(e){this.httpRequest=e}getAccount(e,t){return this.httpRequest.request({method:"GET",url:"/accounts/{address}",path:{address:e},query:{ledger_version:t}})}getAccountResources(e,t){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/resources",path:{address:e},query:{ledger_version:t}})}getAccountModules(e,t){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/modules",path:{address:e},query:{ledger_version:t}})}getAccountResource(e,t,r){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/resource/{resource_type}",path:{address:e,resource_type:t},query:{ledger_version:r}})}getAccountModule(e,t,r){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/module/{module_name}",path:{address:e,module_name:t},query:{ledger_version:r}})}},_s=class{constructor(e){this.httpRequest=e}getBlockByHeight(e,t){return this.httpRequest.request({method:"GET",url:"/blocks/by_height/{block_height}",path:{block_height:e},query:{with_transactions:t}})}getBlockByVersion(e,t){return this.httpRequest.request({method:"GET",url:"/blocks/by_version/{version}",path:{version:e},query:{with_transactions:t}})}},Es=class{constructor(e){this.httpRequest=e}getEventsByEventKey(e,t,r){return this.httpRequest.request({method:"GET",url:"/events/{event_key}",path:{event_key:e},query:{start:t,limit:r}})}getEventsByCreationNumber(e,t,r,n){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/events/{creation_number}",path:{address:e,creation_number:t},query:{start:r,limit:n}})}getEventsByEventHandle(e,t,r,n,i){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/events/{event_handle}/{field_name}",path:{address:e,event_handle:t,field_name:r},query:{start:n,limit:i}})}},As=class{constructor(e){this.httpRequest=e}spec(){return this.httpRequest.request({method:"GET",url:"/spec"})}healthy(e){return this.httpRequest.request({method:"GET",url:"/-/healthy",query:{duration_secs:e}})}getLedgerInfo(){return this.httpRequest.request({method:"GET",url:"/"})}},Ss=class{constructor(e){this.httpRequest=e}getTableItem(e,t,r){return this.httpRequest.request({method:"POST",url:"/tables/{table_handle}/item",path:{table_handle:e},query:{ledger_version:r},body:t,mediaType:"application/json"})}},Ms=class{constructor(e){this.httpRequest=e}getTransactions(e,t){return this.httpRequest.request({method:"GET",url:"/transactions",query:{start:e,limit:t}})}submitTransaction(e){return this.httpRequest.request({method:"POST",url:"/transactions",body:e,mediaType:"application/json"})}getTransactionByHash(e){return this.httpRequest.request({method:"GET",url:"/transactions/by_hash/{txn_hash}",path:{txn_hash:e}})}getTransactionByVersion(e){return this.httpRequest.request({method:"GET",url:"/transactions/by_version/{txn_version}",path:{txn_version:e}})}getAccountTransactions(e,t,r){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/transactions",path:{address:e},query:{start:t,limit:r}})}submitBatchTransactions(e){return this.httpRequest.request({method:"POST",url:"/transactions/batch",body:e,mediaType:"application/json"})}simulateTransaction(e){return this.httpRequest.request({method:"POST",url:"/transactions/simulate",body:e,mediaType:"application/json"})}encodeSubmission(e){return this.httpRequest.request({method:"POST",url:"/transactions/encode_submission",body:e,mediaType:"application/json"})}estimateGasPrice(){return this.httpRequest.request({method:"GET",url:"/estimate_gas_price"})}},xs=class{constructor(e,t=vs){this.request=new t({BASE:(null==e?void 0:e.BASE)??"/v1",VERSION:(null==e?void 0:e.VERSION)??"1.1.0",WITH_CREDENTIALS:(null==e?void 0:e.WITH_CREDENTIALS)??!1,CREDENTIALS:(null==e?void 0:e.CREDENTIALS)??"include",TOKEN:null==e?void 0:e.TOKEN,USERNAME:null==e?void 0:e.USERNAME,PASSWORD:null==e?void 0:e.PASSWORD,HEADERS:null==e?void 0:e.HEADERS,ENCODE_PATH:null==e?void 0:e.ENCODE_PATH}),this.accounts=new ws(this.request),this.blocks=new _s(this.request),this.events=new Es(this.request),this.general=new As(this.request),this.tables=new Ss(this.request),this.transactions=new Ms(this.request)}},ks={BASE:"/v1",VERSION:"1.1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0},Is=(e=>(e.ACCOUNT_NOT_FOUND="account_not_found",e.RESOURCE_NOT_FOUND="resource_not_found",e.MODULE_NOT_FOUND="module_not_found",e.STRUCT_FIELD_NOT_FOUND="struct_field_not_found",e.VERSION_NOT_FOUND="version_not_found",e.TRANSACTION_NOT_FOUND="transaction_not_found",e.TABLE_ITEM_NOT_FOUND="table_item_not_found",e.BLOCK_NOT_FOUND="block_not_found",e.VERSION_PRUNED="version_pruned",e.BLOCK_PRUNED="block_pruned",e.INVALID_INPUT="invalid_input",e.INVALID_TRANSACTION_UPDATE="invalid_transaction_update",e.SEQUENCE_NUMBER_TOO_OLD="sequence_number_too_old",e.VM_ERROR="vm_error",e.HEALTH_CHECK_FAILED="health_check_failed",e.MEMPOOL_IS_FULL="mempool_is_full",e.INTERNAL_ERROR="internal_error",e.WEB_FRAMEWORK_ERROR="web_framework_error",e.BCS_NOT_SUPPORTED="bcs_not_supported",e.API_DISABLED="api_disabled",e))(Is||{}),Rs=(e=>(e.PRIVATE="private",e.PUBLIC="public",e.FRIEND="friend",e))(Rs||{}),Bs=(e=>(e.VALIDATOR="validator",e.FULL_NODE="full_node",e))(Bs||{}),Ts={description:"Account data\n\n A simplified version of the onchain Account resource",properties:{sequence_number:{type:"U64",isRequired:!0},authentication_key:{type:"HexEncodedBytes",isRequired:!0}}},Us={type:"one-of",description:"Account signature scheme\n\n The account signature scheme allows you to have two types of accounts:\n\n 1. A single Ed25519 key account, one private key\n 2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction.",contains:[{type:"AccountSignature_Ed25519Signature"},{type:"AccountSignature_MultiEd25519Signature"}]},Os={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"Ed25519Signature"}]},Cs={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"MultiEd25519Signature"}]},Ps={type:"string",description:"A hex encoded 32 byte Aptos account address.\n\n This is represented in a string as a 64 character hex string, sometimes\n shortened by stripping leading 0s, and adding a 0x.\n\n For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.\n ",format:"hex"},zs={description:"This is the generic struct we use for all API errors, it contains a string\n message and an Aptos API specific error code.",properties:{message:{type:"string",description:"A message describing the error",isRequired:!0},error_code:{type:"AptosErrorCode",isRequired:!0},vm_error_code:{type:"number",description:"A code providing VM error details when submitting transactions to the VM",format:"uint64"}}},Ls={type:"Enum"},Ns={description:"A Block with or without transactions\n\n This contains the information about a transactions along with\n associated transactions if requested",properties:{block_height:{type:"U64",isRequired:!0},block_hash:{type:"HashValue",isRequired:!0},block_timestamp:{type:"U64",isRequired:!0},first_version:{type:"U64",isRequired:!0},last_version:{type:"U64",isRequired:!0},transactions:{type:"array",contains:{type:"Transaction"}}}},qs={description:"A block metadata transaction\n\n This signifies the beginning of a block, and contains information\n about the specific block",properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},id:{type:"HashValue",isRequired:!0},epoch:{type:"U64",isRequired:!0},round:{type:"U64",isRequired:!0},events:{type:"array",contains:{type:"Event"},isRequired:!0},previous_block_votes_bitvec:{type:"array",contains:{type:"number",format:"uint8"},isRequired:!0},proposer:{type:"Address",isRequired:!0},failed_proposer_indices:{type:"array",contains:{type:"number",format:"uint32"},isRequired:!0},timestamp:{type:"U64",isRequired:!0}}},js={description:"Decoded table data",properties:{key:{description:"Key of table in JSON",properties:{},isRequired:!0},key_type:{type:"string",description:"Type of key",isRequired:!0},value:{description:"Value of table in JSON",properties:{},isRequired:!0},value_type:{type:"string",description:"Type of value",isRequired:!0}}},Ds={description:"Deleted table data",properties:{key:{description:"Deleted key",properties:{},isRequired:!0},key_type:{type:"string",description:"Deleted key type",isRequired:!0}}},Fs={description:"Delete a module",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},module:{type:"MoveModuleId",isRequired:!0}}},$s={description:"Delete a resource",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},resource:{type:"MoveStructTag",isRequired:!0}}},Hs={description:"Delete a table item",properties:{state_key_hash:{type:"string",isRequired:!0},handle:{type:"HexEncodedBytes",isRequired:!0},key:{type:"HexEncodedBytes",isRequired:!0},data:{type:"DeletedTableData"}}},Ws={properties:{changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},events:{type:"array",contains:{type:"Event"},isRequired:!0}}},Ks={description:"A single Ed25519 signature",properties:{public_key:{type:"HexEncodedBytes",isRequired:!0},signature:{type:"HexEncodedBytes",isRequired:!0}}},Gs={description:"Request to encode a submission",properties:{sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},secondary_signers:{type:"array",contains:{type:"Address"}}}},Vs={type:"string",description:"Entry function id is string representation of a entry function defined on-chain.\n\n Format: `{address}::{module name}::{function name}`\n\n Both `module name` and `function name` are case-sensitive.\n "},Js={description:"Payload which runs a single entry function",properties:{function:{type:"EntryFunctionId",isRequired:!0},type_arguments:{type:"array",contains:{type:"MoveType"},isRequired:!0},arguments:{type:"array",contains:{properties:{}},isRequired:!0}}},Ys={description:"An event from a transaction",properties:{key:{type:"EventKey",isRequired:!0},guid:{type:"EventGuid",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},type:{type:"MoveType",isRequired:!0},data:{description:"The JSON representation of the event",properties:{},isRequired:!0}}},Zs={properties:{creation_number:{type:"U64",isRequired:!0},account_address:{type:"Address",isRequired:!0}}},Xs={type:"string",description:"Event key is a global index for an event stream.\n\n It is hex-encoded BCS bytes of `EventHandle` `guid` field value, which is\n a combination of a `uint64` creation number and account address (without\n trimming leading zeros).\n\n For example, event key `0x000000000000000088fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` is combined by the following 2 parts:\n 1. `0000000000000000`: `uint64` representation of `0`.\n 2. `88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1`: 32 bytes of account address.\n ",format:"hex"},Qs={description:"Struct holding the outputs of the estimate gas API",properties:{gas_estimate:{type:"number",description:"The current estimate for the gas unit price",isRequired:!0,format:"uint64"}}},ea={type:"one-of",description:"The writeset payload of the Genesis transaction",contains:[{type:"GenesisPayload_WriteSetPayload"}]},ta={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteSetPayload"}]},ra={description:"The genesis transaction\n\n This only occurs at the genesis transaction (version 0)",properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},payload:{type:"GenesisPayload",isRequired:!0},events:{type:"array",contains:{type:"Event"},isRequired:!0}}},na={type:"string"},ia={description:"Representation of a successful healthcheck",properties:{message:{type:"string",isRequired:!0}}},oa={type:"string",description:"All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with\n two hex digits per byte.\n\n Unlike the `Address` type, HexEncodedBytes will not trim any zeros.\n ",format:"hex"},sa={type:"string"},aa={description:'The struct holding all data returned to the client by the\n index endpoint (i.e., GET "/").',properties:{chain_id:{type:"number",description:"Chain ID of the current chain",isRequired:!0,format:"uint8"},epoch:{type:"U64",isRequired:!0},ledger_version:{type:"U64",isRequired:!0},oldest_ledger_version:{type:"U64",isRequired:!0},ledger_timestamp:{type:"U64",isRequired:!0},node_role:{type:"RoleType",isRequired:!0},oldest_block_height:{type:"U64",isRequired:!0},block_height:{type:"U64",isRequired:!0}}},ua={properties:{modules:{type:"array",contains:{type:"MoveModuleBytecode"},isRequired:!0}}},ca={type:"string"},ha={description:"Move function",properties:{name:{type:"IdentifierWrapper",isRequired:!0},visibility:{type:"MoveFunctionVisibility",isRequired:!0},is_entry:{type:"boolean",description:"Whether the function can be called as an entry function directly in a transaction",isRequired:!0},generic_type_params:{type:"array",contains:{type:"MoveFunctionGenericTypeParam"},isRequired:!0},params:{type:"array",contains:{type:"MoveType"},isRequired:!0},return:{type:"array",contains:{type:"MoveType"},isRequired:!0}}},fa={description:"Move function generic type param",properties:{constraints:{type:"array",contains:{type:"MoveAbility"},isRequired:!0}}},da={type:"Enum"},la={description:"A Move module",properties:{address:{type:"Address",isRequired:!0},name:{type:"IdentifierWrapper",isRequired:!0},friends:{type:"array",contains:{type:"MoveModuleId"},isRequired:!0},exposed_functions:{type:"array",contains:{type:"MoveFunction"},isRequired:!0},structs:{type:"array",contains:{type:"MoveStruct"},isRequired:!0}}},pa={description:"Move module bytecode along with it's ABI",properties:{bytecode:{type:"HexEncodedBytes",isRequired:!0},abi:{type:"MoveModule"}}},ya={type:"string",description:"Move module id is a string representation of Move module.\n\n Format: `{address}::{module name}`\n\n `address` should be hex-encoded 32 byte account address that is prefixed with `0x`.\n\n Module name is case-sensitive.\n "},ga={description:"A parsed Move resource",properties:{type:{type:"MoveStructTag",isRequired:!0},data:{type:"MoveStructValue",isRequired:!0}}},ba={description:"Move script bytecode",properties:{bytecode:{type:"HexEncodedBytes",isRequired:!0},abi:{type:"MoveFunction"}}},ma={description:"A move struct",properties:{name:{type:"IdentifierWrapper",isRequired:!0},is_native:{type:"boolean",description:"Whether the struct is a native struct of Move",isRequired:!0},abilities:{type:"array",contains:{type:"MoveAbility"},isRequired:!0},generic_type_params:{type:"array",contains:{type:"MoveStructGenericTypeParam"},isRequired:!0},fields:{type:"array",contains:{type:"MoveStructField"},isRequired:!0}}},va={description:"Move struct field",properties:{name:{type:"IdentifierWrapper",isRequired:!0},type:{type:"MoveType",isRequired:!0}}},wa={description:"Move generic type param",properties:{constraints:{type:"array",contains:{type:"MoveAbility"},isRequired:!0}}},_a={type:"string",description:"String representation of a MoveStructTag (on-chain Move struct type). This exists so you\n can specify MoveStructTags as path / query parameters, e.g. for get_events_by_event_handle.\n\n It is a combination of:\n 1. `move_module_address`, `module_name` and `struct_name`, all joined by `::`\n 2. `struct generic type parameters` joined by `, `\n\n Examples:\n * `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>`\n * `0x1::account::Account`\n\n Note:\n 1. Empty chars should be ignored when comparing 2 struct tag ids.\n 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).\n\n See [doc](https://aptos.dev/concepts/basics-accounts) for more details.\n ",pattern:"^0x[0-9a-zA-Z:_<>]+$"},Ea={description:'This is a JSON representation of some data within an account resource. More specifically,\n it is a map of strings to arbitrary JSON values / objects, where the keys are top level\n fields within the given resource.\n\n To clarify, you might query for 0x1::account::Account and see the example data.\n\n Move `bool` type value is serialized into `boolean`.\n\n Move `u8` type value is serialized into `integer`.\n\n Move `u64` and `u128` type value is serialized into `string`.\n\n Move `address` type value (32 byte Aptos account address) is serialized into a HexEncodedBytes string.\n For example:\n - `0x1`\n - `0x1668f6be25668c1a17cd8caf6b8d2f25`\n\n Move `vector` type value is serialized into `array`, except `vector<u8>` which is serialized into a\n HexEncodedBytes string with `0x` prefix.\n For example:\n - `vector<u64>{255, 255}` => `["255", "255"]`\n - `vector<u8>{255, 255}` => `0xffff`\n\n Move `struct` type value is serialized into `object` that looks like this (except some Move stdlib types, see the following section):\n ```json\n {\n field1_name: field1_value,\n field2_name: field2_value,\n ......\n }\n ```\n\n For example:\n `{ "created": "0xa550c18", "role_id": "0" }`\n\n **Special serialization for Move stdlib types**:\n - [0x1::string::String](https://github.com/aptos-labs/aptos-core/blob/main/language/move-stdlib/docs/ascii.md)\n is serialized into `string`. For example, struct value `0x1::string::String{bytes: b"Hello World!"}`\n is serialized as `"Hello World!"` in JSON.\n ',properties:{}},Aa={type:"string",description:"String representation of an on-chain Move type tag that is exposed in transaction payload.\n Values:\n - bool\n - u8\n - u64\n - u128\n - address\n - signer\n - vector: `vector<{non-reference MoveTypeId}>`\n - struct: `{address}::{module_name}::{struct_name}::<{generic types}>`\n\n Vector type value examples:\n - `vector<u8>`\n - `vector<vector<u64>>`\n - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>`\n\n Struct type value examples:\n - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>\n - `0x1::account::Account`\n\n Note:\n 1. Empty chars should be ignored when comparing 2 struct tag ids.\n 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).\n ",pattern:"^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$"},Sa={type:"any-of",description:"An enum of the possible Move value types",contains:[{type:"number",format:"uint8"},{type:"U64"},{type:"U128"},{type:"boolean"},{type:"Address"},{type:"array",contains:{type:"MoveValue"}},{type:"HexEncodedBytes"},{type:"MoveStructValue"},{type:"string"}]},Ma={description:"Multi agent signature for multi agent transactions\n\n This allows you to have transactions across multiple accounts",properties:{sender:{type:"AccountSignature",isRequired:!0},secondary_signer_addresses:{type:"array",contains:{type:"Address"},isRequired:!0},secondary_signers:{type:"array",contains:{type:"AccountSignature"},isRequired:!0}}},xa={description:"A Ed25519 multi-sig signature\n\n This allows k-of-n signing for a transaction",properties:{public_keys:{type:"array",contains:{type:"HexEncodedBytes"},isRequired:!0},signatures:{type:"array",contains:{type:"HexEncodedBytes"},isRequired:!0},threshold:{type:"number",description:"The number of signatures required for a successful transaction",isRequired:!0,format:"uint8"},bitmap:{type:"HexEncodedBytes",isRequired:!0}}},ka={description:"A transaction waiting in mempool",properties:{hash:{type:"HashValue",isRequired:!0},sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},signature:{type:"TransactionSignature"}}},Ia={type:"Enum"},Ra={description:"Payload which runs a script that can run multiple functions",properties:{code:{type:"MoveScriptBytecode",isRequired:!0},type_arguments:{type:"array",contains:{type:"MoveType"},isRequired:!0},arguments:{type:"array",contains:{properties:{}},isRequired:!0}}},Ba={properties:{execute_as:{type:"Address",isRequired:!0},script:{type:"ScriptPayload",isRequired:!0}}},Ta={description:"A state checkpoint transaction",properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},timestamp:{type:"U64",isRequired:!0}}},Ua={description:"A request to submit a transaction\n\n This requires a transaction and a signature of it",properties:{sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},signature:{type:"TransactionSignature",isRequired:!0}}},Oa={description:"Table Item request for the GetTableItem API",properties:{key_type:{type:"MoveType",isRequired:!0},value_type:{type:"MoveType",isRequired:!0},key:{description:"The value of the table item's key",properties:{},isRequired:!0}}},Ca={type:"one-of",description:"Enum of the different types of transactions in Aptos",contains:[{type:"Transaction_PendingTransaction"},{type:"Transaction_UserTransaction"},{type:"Transaction_GenesisTransaction"},{type:"Transaction_BlockMetadataTransaction"},{type:"Transaction_StateCheckpointTransaction"}]},Pa={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"BlockMetadataTransaction"}]},za={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"GenesisTransaction"}]},La={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"PendingTransaction"}]},Na={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"StateCheckpointTransaction"}]},qa={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"UserTransaction"}]},ja={type:"one-of",description:"An enum of the possible transaction payloads",contains:[{type:"TransactionPayload_EntryFunctionPayload"},{type:"TransactionPayload_ScriptPayload"},{type:"TransactionPayload_ModuleBundlePayload"}]},Da={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"EntryFunctionPayload"}]},Fa={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"ModuleBundlePayload"}]},$a={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"ScriptPayload"}]},Ha={description:"Information telling which batch submission transactions failed",properties:{error:{type:"AptosError",isRequired:!0},transaction_index:{type:"number",description:"The index of which transaction failed, same as submission order",isRequired:!0,format:"uint64"}}},Wa={description:"Batch transaction submission result\n\n Tells which transactions failed",properties:{transaction_failures:{type:"array",contains:{type:"TransactionsBatchSingleSubmissionFailure"},isRequired:!0}}},Ka={type:"one-of",description:"An enum representing the different transaction signatures available",contains:[{type:"TransactionSignature_Ed25519Signature"},{type:"TransactionSignature_MultiEd25519Signature"},{type:"TransactionSignature_MultiAgentSignature"}]},Ga={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"Ed25519Signature"}]},Va={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"MultiAgentSignature"}]},Ja={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"MultiEd25519Signature"}]},Ya={type:"string",description:"A string containing a 128-bit unsigned integer.\n\n We represent u128 values as a string to ensure compatibility with languages such\n as JavaScript that do not parse u64s in JSON natively.\n ",format:"uint64"},Za={type:"string",description:"A string containing a 64-bit unsigned integer.\n\n We represent u64 values as a string to ensure compatibility with languages such\n as JavaScript that do not parse u64s in JSON natively.\n ",format:"uint64"},Xa={description:"A transaction submitted by a user to change the state of the blockchain",properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},signature:{type:"TransactionSignature"},events:{type:"array",contains:{type:"Event"},isRequired:!0},timestamp:{type:"U64",isRequired:!0}}},Qa={description:"An event from a transaction with a version",properties:{version:{type:"U64",isRequired:!0},key:{type:"EventKey",isRequired:!0},guid:{type:"EventGuid",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},type:{type:"MoveType",isRequired:!0},data:{description:"The JSON representation of the event",properties:{},isRequired:!0}}},eu={description:"Write a new module or update an existing one",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},data:{type:"MoveModuleBytecode",isRequired:!0}}},tu={description:"Write a resource or update an existing one",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},data:{type:"MoveResource",isRequired:!0}}},ru={type:"one-of",description:"The associated writeset with a payload",contains:[{type:"WriteSet_ScriptWriteSet"},{type:"WriteSet_DirectWriteSet"}]},nu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DirectWriteSet"}]},iu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"ScriptWriteSet"}]},ou={type:"one-of",description:"A final state change of a transaction on a resource or module",contains:[{type:"WriteSetChange_DeleteModule"},{type:"WriteSetChange_DeleteResource"},{type:"WriteSetChange_DeleteTableItem"},{type:"WriteSetChange_WriteModule"},{type:"WriteSetChange_WriteResource"},{type:"WriteSetChange_WriteTableItem"}]},su={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DeleteModule"}]},au={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DeleteResource"}]},uu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DeleteTableItem"}]},cu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteModule"}]},hu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteResource"}]},fu={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteTableItem"}]},du={description:"A writeset payload, used only for genesis",properties:{write_set:{type:"WriteSet",isRequired:!0}}},lu={description:"Change set to write a table item",properties:{state_key_hash:{type:"string",isRequired:!0},handle:{type:"HexEncodedBytes",isRequired:!0},key:{type:"HexEncodedBytes",isRequired:!0},value:{type:"HexEncodedBytes",isRequired:!0},data:{type:"DecodedTableData"}}},pu={};Zo(pu,{AccountAddress:()=>gu,AccountAuthenticator:()=>Vu,AccountAuthenticatorEd25519:()=>Ju,AccountAuthenticatorMultiEd25519:()=>Yu,AuthenticationKey:()=>Cc,ChainId:()=>Ec,ChangeSet:()=>pc,Ed25519PublicKey:()=>Nu,Ed25519Signature:()=>ju,EntryFunction:()=>fc,Identifier:()=>Zu,Module:()=>dc,ModuleId:()=>lc,MultiAgentRawTransaction:()=>mc,MultiEd25519PublicKey:()=>Du,MultiEd25519Signature:()=>$u,RawTransaction:()=>cc,RawTransactionWithData:()=>bc,RotationProofChallenge:()=>Pc,Script:()=>hc,SignedTransaction:()=>gc,StructTag:()=>ac,Transaction:()=>Bc,TransactionArgument:()=>Ac,TransactionArgumentAddress:()=>kc,TransactionArgumentBool:()=>Rc,TransactionArgumentU128:()=>xc,TransactionArgumentU64:()=>Mc,TransactionArgumentU8:()=>Sc,TransactionArgumentU8Vector:()=>Ic,TransactionAuthenticator:()=>Hu,TransactionAuthenticatorEd25519:()=>Wu,TransactionAuthenticatorMultiAgent:()=>Gu,TransactionAuthenticatorMultiEd25519:()=>Ku,TransactionPayload:()=>vc,TransactionPayloadEntryFunction:()=>_c,TransactionPayloadScript:()=>wc,TypeTag:()=>Xu,TypeTagAddress:()=>nc,TypeTagBool:()=>Qu,TypeTagSigner:()=>ic,TypeTagStruct:()=>sc,TypeTagU128:()=>rc,TypeTagU64:()=>tc,TypeTagU8:()=>ec,TypeTagVector:()=>oc,UserTransaction:()=>Tc,WriteSet:()=>yc});var yu=class{constructor(e){if(e.length!==yu.LENGTH)throw new Error("Expected address of length 32");this.address=e}static fromHex(e){let t=ts.ensure(e);t.noPrefix().length%2!=0&&(t=new ts(`0${t.noPrefix()}`));const r=t.toUint8Array();if(r.length>yu.LENGTH)throw new Error("Hex string is too long. Address's length is 32 bytes.");if(r.length===yu.LENGTH)return new yu(r);const n=new Uint8Array(yu.LENGTH);return n.set(r,yu.LENGTH-r.length),new yu(n)}serialize(e){e.serializeFixedBytes(this.address)}static deserialize(e){return new yu(e.deserializeFixedBytes(yu.LENGTH))}},gu=yu;gu.LENGTH=32,gu.CORE_CODE_ADDRESS=yu.fromHex("0x1");var bu={};Zo(bu,{Deserializer:()=>Au,Serializer:()=>_u,bcsSerializeBool:()=>Ou,bcsSerializeBytes:()=>Pu,bcsSerializeFixedBytes:()=>zu,bcsSerializeStr:()=>Cu,bcsSerializeU128:()=>Uu,bcsSerializeU16:()=>Bu,bcsSerializeU32:()=>Tu,bcsSerializeU8:()=>Ru,bcsSerializeUint64:()=>Iu,bcsToBytes:()=>ku,deserializeVector:()=>xu,serializeVector:()=>Su,serializeVectorWithFunc:()=>Mu});var mu=2**32-1,vu=BigInt(2**64)-BigInt(1),wu=BigInt(2**128)-BigInt(1),_u=class{constructor(){this.buffer=new ArrayBuffer(64),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){const e=new ArrayBuffer(2*this.buffer.byteLength);new Uint8Array(e).set(new Uint8Array(this.buffer)),this.buffer=e}}serialize(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,r){this.ensureBufferWillHandleSize(t);const n=new DataView(this.buffer,this.offset);e.apply(n,[0,r,!0]),this.offset+=t}serializeStr(e){const t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.serialize(e)}serializeFixedBytes(e){this.serialize(e)}serializeBool(e){if("boolean"!=typeof e)throw new Error("Value needs to be a boolean");const t=e?1:0;this.serialize(new Uint8Array([t]))}serializeU8(e){this.serialize(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){const t=BigInt(e.toString())&BigInt(mu),r=BigInt(e.toString())>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(r))}serializeU128(e){const t=BigInt(e.toString())&vu,r=BigInt(e.toString())>>BigInt(64);this.serializeU64(t),this.serializeU64(r)}serializeU32AsUleb128(e){let t=e;const r=[];for(;t>>>7!=0;)r.push(127&t|128),t>>>=7;r.push(t),this.serialize(new Uint8Array(r))}getBytes(){return new Uint8Array(this.buffer).slice(0,this.offset)}};function Eu(e,t,r){return(n,i,o)=>{const s=o.value;return o.value=function(n){const i=BigInt(n.toString());if(i>BigInt(t.toString())||i<BigInt(e.toString()))throw new Error(r||"Value is out of range");s.apply(this,[n])},o}}Xo([Eu(0,255)],_u.prototype,"serializeU8",1),Xo([Eu(0,65535)],_u.prototype,"serializeU16",1),Xo([Eu(0,mu)],_u.prototype,"serializeU32",1),Xo([Eu(BigInt(0),vu)],_u.prototype,"serializeU64",1),Xo([Eu(BigInt(0),wu)],_u.prototype,"serializeU128",1),Xo([Eu(0,mu)],_u.prototype,"serializeU32AsUleb128",1);var Au=class{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}read(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Reached to the end of buffer");const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}deserializeStr(){const e=this.deserializeBytes();return(new TextDecoder).decode(e)}deserializeBytes(){const e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){const e=new Uint8Array(this.read(1))[0];if(1!==e&&0!==e)throw new Error("Invalid boolean value");return 1===e}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){const e=this.deserializeU32(),t=this.deserializeU32();return BigInt(BigInt(t)<<BigInt(32)|BigInt(e))}deserializeU128(){const e=this.deserializeU64(),t=this.deserializeU64();return BigInt(t<<BigInt(64)|e)}deserializeUleb128AsU32(){let e=BigInt(0),t=0;for(;e<mu;){const r=this.deserializeU8();if(e|=BigInt(127&r)<<BigInt(t),0==(128&r))break;t+=7}if(e>mu)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}};function Su(e,t){t.serializeU32AsUleb128(e.length),e.forEach((e=>{e.serialize(t)}))}function Mu(e,t){const r=new _u;r.serializeU32AsUleb128(e.length);const n=r[t];return e.forEach((e=>{n.call(r,e)})),r.getBytes()}function xu(e,t){const r=e.deserializeUleb128AsU32(),n=[];for(let i=0;i<r;i+=1)n.push(t.deserialize(e));return n}function ku(e){const t=new _u;return e.serialize(t),t.getBytes()}function Iu(e){const t=new _u;return t.serializeU64(e),t.getBytes()}function Ru(e){const t=new _u;return t.serializeU8(e),t.getBytes()}function Bu(e){const t=new _u;return t.serializeU16(e),t.getBytes()}function Tu(e){const t=new _u;return t.serializeU32(e),t.getBytes()}function Uu(e){const t=new _u;return t.serializeU128(e),t.getBytes()}function Ou(e){const t=new _u;return t.serializeBool(e),t.getBytes()}function Cu(e){const t=new _u;return t.serializeStr(e),t.getBytes()}function Pu(e){const t=new _u;return t.serializeBytes(e),t.getBytes()}function zu(e){const t=new _u;return t.serializeFixedBytes(e),t.getBytes()}var Lu=class{constructor(e){if(e.length!==Lu.LENGTH)throw new Error(`Ed25519PublicKey length should be ${Lu.LENGTH}`);this.value=e}serialize(e){e.serializeBytes(this.value)}static deserialize(e){const t=e.deserializeBytes();return new Lu(t)}},Nu=Lu;Nu.LENGTH=32;var qu=class{constructor(e){if(this.value=e,e.length!==qu.LENGTH)throw new Error(`Ed25519Signature length should be ${qu.LENGTH}`)}serialize(e){e.serializeBytes(this.value)}static deserialize(e){const t=e.deserializeBytes();return new qu(t)}},ju=qu;ju.LENGTH=64;var Du=class{constructor(e,t){if(this.public_keys=e,this.threshold=t,t>32)throw new Error('"threshold" cannot be larger than 32')}toBytes(){const e=new Uint8Array(this.public_keys.length*Nu.LENGTH+1);return this.public_keys.forEach(((t,r)=>{e.set(t.value,r*Nu.LENGTH)})),e[this.public_keys.length*Nu.LENGTH]=this.threshold,e}serialize(e){e.serializeBytes(this.toBytes())}static deserialize(e){const t=e.deserializeBytes(),r=t[t.length-1],n=[];for(let e=0;e<t.length-1;e+=Nu.LENGTH){const r=e;n.push(new Nu(t.subarray(r,r+Nu.LENGTH)))}return new Du(n,r)}},Fu=class{constructor(e,t){if(this.signatures=e,this.bitmap=t,t.length!==Fu.BITMAP_LEN)throw new Error(`"bitmap" length should be ${Fu.BITMAP_LEN}`)}toBytes(){const e=new Uint8Array(this.signatures.length*ju.LENGTH+Fu.BITMAP_LEN);return this.signatures.forEach(((t,r)=>{e.set(t.value,r*ju.LENGTH)})),e.set(this.bitmap,this.signatures.length*ju.LENGTH),e}static createBitmap(e){const t=new Uint8Array([0,0,0,0]),r=new Set;return e.forEach((e=>{if(e>=32)throw new Error(`Invalid bit value ${e}.`);if(r.has(e))throw new Error("Duplicated bits detected.");r.add(e);const n=Math.floor(e/8);let i=t[n];i|=128>>e%8,t[n]=i})),t}serialize(e){e.serializeBytes(this.toBytes())}static deserialize(e){const t=e.deserializeBytes(),r=t.subarray(t.length-4),n=[];for(let e=0;e<t.length-r.length;e+=ju.LENGTH){const r=e;n.push(new ju(t.subarray(r,r+ju.LENGTH)))}return new Fu(n,r)}},$u=Fu;$u.BITMAP_LEN=4;var Hu=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return Wu.load(e);case 1:return Ku.load(e);case 2:return Gu.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${t}`)}}},Wu=class extends Hu{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const t=Nu.deserialize(e),r=ju.deserialize(e);return new Wu(t,r)}},Ku=class extends Hu{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const t=Du.deserialize(e),r=$u.deserialize(e);return new Ku(t,r)}},Gu=class extends Hu{constructor(e,t,r){super(),this.sender=e,this.secondary_signer_addresses=t,this.secondary_signers=r}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),Su(this.secondary_signer_addresses,e),Su(this.secondary_signers,e)}static load(e){const t=Vu.deserialize(e),r=xu(e,gu),n=xu(e,Vu);return new Gu(t,r,n)}},Vu=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return Ju.load(e);case 1:return Yu.load(e);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${t}`)}}},Ju=class extends Vu{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const t=Nu.deserialize(e),r=ju.deserialize(e);return new Ju(t,r)}},Yu=class extends Vu{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const t=Du.deserialize(e),r=$u.deserialize(e);return new Yu(t,r)}},Zu=class{constructor(e){this.value=e}serialize(e){e.serializeStr(this.value)}static deserialize(e){const t=e.deserializeStr();return new Zu(t)}},Xu=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return Qu.load(e);case 1:return ec.load(e);case 2:return tc.load(e);case 3:return rc.load(e);case 4:return nc.load(e);case 5:return ic.load(e);case 6:return oc.load(e);case 7:return sc.load(e);default:throw new Error(`Unknown variant index for TypeTag: ${t}`)}}},Qu=class extends Xu{serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new Qu}},ec=class extends Xu{serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new ec}},tc=class extends Xu{serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new tc}},rc=class extends Xu{serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new rc}},nc=class extends Xu{serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new nc}},ic=class extends Xu{serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new ic}},oc=class extends Xu{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){const t=Xu.deserialize(e);return new oc(t)}},sc=class extends Xu{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){const t=ac.deserialize(e);return new sc(t)}},ac=class{constructor(e,t,r,n){this.address=e,this.module_name=t,this.name=r,this.type_args=n}static fromString(e){if(e.includes("<"))throw new Error("Not implemented");const t=e.split("::");if(3!==t.length)throw new Error("Invalid struct tag string literal.");return new ac(gu.fromHex(t[0]),new Zu(t[1]),new Zu(t[2]),[])}serialize(e){this.address.serialize(e),this.module_name.serialize(e),this.name.serialize(e),Su(this.type_args,e)}static deserialize(e){const t=gu.deserialize(e),r=Zu.deserialize(e),n=Zu.deserialize(e),i=xu(e,Xu);return new ac(t,r,n,i)}},{sha3_256:uc}=mo,cc=class{constructor(e,t,r,n,i,o,s){this.sender=e,this.sequence_number=t,this.payload=r,this.max_gas_amount=n,this.gas_unit_price=i,this.expiration_timestamp_secs=o,this.chain_id=s}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){const t=gu.deserialize(e),r=e.deserializeU64(),n=vc.deserialize(e),i=e.deserializeU64(),o=e.deserializeU64(),s=e.deserializeU64(),a=Ec.deserialize(e);return new cc(t,r,n,i,o,s,a)}},hc=class{constructor(e,t,r){this.code=e,this.ty_args=t,this.args=r}serialize(e){e.serializeBytes(this.code),Su(this.ty_args,e),Su(this.args,e)}static deserialize(e){const t=e.deserializeBytes(),r=xu(e,Xu),n=xu(e,Ac);return new hc(t,r,n)}},fc=class{constructor(e,t,r,n){this.module_name=e,this.function_name=t,this.ty_args=r,this.args=n}static natural(e,t,r,n){return new fc(lc.fromStr(e),new Zu(t),r,n)}static natual(e,t,r,n){return fc.natural(e,t,r,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),Su(this.ty_args,e),e.serializeU32AsUleb128(this.args.length),this.args.forEach((t=>{e.serializeBytes(t)}))}static deserialize(e){const t=lc.deserialize(e),r=Zu.deserialize(e),n=xu(e,Xu),i=e.deserializeUleb128AsU32(),o=[];for(let t=0;t<i;t+=1)o.push(e.deserializeBytes());return new fc(t,r,n,o)}},dc=class{constructor(e){this.code=e}serialize(e){e.serializeBytes(this.code)}static deserialize(e){const t=e.deserializeBytes();return new dc(t)}},lc=class{constructor(e,t){this.address=e,this.name=t}static fromStr(e){const t=e.split("::");if(2!==t.length)throw new Error("Invalid module id.");return new lc(gu.fromHex(new ts(t[0])),new Zu(t[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){const t=gu.deserialize(e),r=Zu.deserialize(e);return new lc(t,r)}},pc=class{serialize(e){throw new Error("Not implemented.")}static deserialize(e){throw new Error("Not implemented.")}},yc=class{serialize(e){throw new Error("Not implmented.")}static deserialize(e){throw new Error("Not implmented.")}},gc=class{constructor(e,t){this.raw_txn=e,this.authenticator=t}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){const t=cc.deserialize(e),r=Hu.deserialize(e);return new gc(t,r)}},bc=class{static deserialize(e){const t=e.deserializeUleb128AsU32();if(0===t)return mc.load(e);throw new Error(`Unknown variant index for RawTransactionWithData: ${t}`)}},mc=class extends bc{constructor(e,t){super(),this.raw_txn=e,this.secondary_signer_addresses=t}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),Su(this.secondary_signer_addresses,e)}static load(e){const t=cc.deserialize(e),r=xu(e,gu);return new mc(t,r)}},vc=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return wc.load(e);case 2:return _c.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},wc=class extends vc{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(0),this.value.serialize(e)}static load(e){const t=hc.deserialize(e);return new wc(t)}},_c=class extends vc{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(2),this.value.serialize(e)}static load(e){const t=fc.deserialize(e);return new _c(t)}},Ec=class{constructor(e){this.value=e}serialize(e){e.serializeU8(this.value)}static deserialize(e){const t=e.deserializeU8();return new Ec(t)}},Ac=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return Sc.load(e);case 1:return Mc.load(e);case 2:return xc.load(e);case 3:return kc.load(e);case 4:return Ic.load(e);case 5:return Rc.load(e);default:throw new Error(`Unknown variant index for TransactionArgument: ${t}`)}}},Sc=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(0),e.serializeU8(this.value)}static load(e){const t=e.deserializeU8();return new Sc(t)}},Mc=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(1),e.serializeU64(this.value)}static load(e){const t=e.deserializeU64();return new Mc(t)}},xc=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(2),e.serializeU128(this.value)}static load(e){const t=e.deserializeU128();return new xc(t)}},kc=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(3),this.value.serialize(e)}static load(e){const t=gu.deserialize(e);return new kc(t)}},Ic=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(4),e.serializeBytes(this.value)}static load(e){const t=e.deserializeBytes();return new Ic(t)}},Rc=class extends Ac{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(5),e.serializeBool(this.value)}static load(e){const t=e.deserializeBool();return new Rc(t)}},Bc=class{getHashSalt(){const e=uc.create();return e.update("APTOS::Transaction"),new Uint8Array(e.arrayBuffer())}static deserialize(e){const t=e.deserializeUleb128AsU32();if(0===t)return Tc.load(e);throw new Error(`Unknown variant index for Transaction: ${t}`)}},Tc=class extends Bc{constructor(e){super(),this.value=e}hash(){const e=uc.create();return e.update(this.getHashSalt()),e.update(ku(this)),new Uint8Array(e.arrayBuffer())}serialize(e){e.serializeU32AsUleb128(0),this.value.serialize(e)}static load(e){return new Tc(gc.deserialize(e))}},{sha3_256:Uc}=mo,Oc=class{constructor(e){if(e.length!==Oc.LENGTH)throw new Error("Expected a byte array of length 32");this.bytes=e}static fromMultiEd25519PublicKey(e){const t=e.toBytes(),r=new Uint8Array(t.length+1);r.set(t),r.set([Oc.MULTI_ED25519_SCHEME],t.length);const n=Uc.create();return n.update(r),new Oc(new Uint8Array(n.arrayBuffer()))}derivedAddress(){return ts.fromUint8Array(this.bytes)}},Cc=Oc;Cc.LENGTH=32,Cc.MULTI_ED25519_SCHEME=1;var Pc=class{constructor(e,t,r,n,i,o,s){this.accountAddress=e,this.moduleName=t,this.structName=r,this.sequenceNumber=n,this.originator=i,this.currentAuthKey=o,this.newPublicKey=s}serialize(e){this.accountAddress.serialize(e),e.serializeStr(this.moduleName),e.serializeStr(this.structName),e.serializeU64(this.sequenceNumber),this.originator.serialize(e),this.currentAuthKey.serialize(e),e.serializeBytes(this.newPublicKey)}},zc=class{constructor(e){this.name=e}serialize(e){e.serializeStr(this.name)}static deserialize(e){const t=e.deserializeStr();return new zc(t)}},Lc=class{constructor(e,t){this.name=e,this.type_tag=t}serialize(e){e.serializeStr(this.name),this.type_tag.serialize(e)}static deserialize(e){const t=e.deserializeStr(),r=Xu.deserialize(e);return new Lc(t,r)}},Nc=class{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case 0:return qc.load(e);case 1:return jc.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},qc=class extends Nc{constructor(e,t,r,n,i){super(),this.name=e,this.doc=t,this.code=r,this.ty_args=n,this.args=i}serialize(e){e.serializeU32AsUleb128(0),e.serializeStr(this.name),e.serializeStr(this.doc),e.serializeBytes(this.code),Su(this.ty_args,e),Su(this.args,e)}static load(e){const t=e.deserializeStr(),r=e.deserializeStr(),n=e.deserializeBytes(),i=xu(e,zc),o=xu(e,Lc);return new qc(t,r,n,i,o)}},jc=class extends Nc{constructor(e,t,r,n,i){super(),this.name=e,this.module_name=t,this.doc=r,this.ty_args=n,this.args=i}serialize(e){e.serializeU32AsUleb128(1),e.serializeStr(this.name),this.module_name.serialize(e),e.serializeStr(this.doc),Su(this.ty_args,e),Su(this.args,e)}static load(e){const t=e.deserializeStr(),r=lc.deserialize(e),n=e.deserializeStr(),i=xu(e,zc),o=xu(e,Lc);return new jc(t,r,n,i,o)}};function Dc(e,t,r){if(!(null==t?void 0:t.includes(typeof e)))throw new Error(r||`Invalid arg: ${e} type should be ${t instanceof Array?t.join(" or "):t}`)}function Fc(e){throw new Error(e)}function $c(e){return!!e.match(/\s/)}function Hc(e){return!!e.match(/[_A-Za-z0-9]/g)}function Wc(e,t){const r=e[t];if(":"===r){if("::"===e.slice(t,t+2))return[["COLON","::"],2];Fc("Unrecognized token.")}else{if("<"===r)return[["LT","<"],1];if(">"===r)return[["GT",">"],1];if(","===r)return[["COMMA",","],1];if($c(r)){let r="";for(let n=t;n<e.length;n+=1){const t=e[n];if(!$c(t))break;r=`${r}${t}`}return[["SPACE",r],r.length]}if(Hc(r)){let r="";for(let n=t;n<e.length;n+=1){const t=e[n];if(!Hc(t))break;r=`${r}${t}`}return[["IDENT",r],r.length]}}throw new Error("Unrecognized token.")}var Kc=class{constructor(e){this.tokens=function(e){let t=0;const r=[];for(;t<e.length;){const[n,i]=Wc(e,t);"SPACE"!==n[0]&&r.push(n),t+=i}return r}(e)}consume(e){const t=this.tokens.shift();t&&t[1]===e||Fc("Invalid type tag.")}parseCommaList(e,t){const r=[];for(this.tokens.length<=0&&Fc("Invalid type tag.");!(this.tokens[0][1]===e||(r.push(this.parseTypeTag()),this.tokens.length>0&&this.tokens[0][1]===e)||(this.consume(","),this.tokens.length>0&&this.tokens[0][1]===e&&t));)this.tokens.length<=0&&Fc("Invalid type tag.");return r}parseTypeTag(){0===this.tokens.length&&Fc("Invalid type tag.");const[e,t]=this.tokens.shift();if("u8"===t)return new ec;if("u64"===t)return new tc;if("u128"===t)return new rc;if("bool"===t)return new Qu;if("address"===t)return new nc;if("vector"===t){this.consume("<");const e=this.parseTypeTag();return this.consume(">"),new oc(e)}if("IDENT"===e&&(t.startsWith("0x")||t.startsWith("0X"))){const e=t;this.consume("::");const[r,n]=this.tokens.shift();"IDENT"!==r&&Fc("Invalid type tag."),this.consume("::");const[i,o]=this.tokens.shift();"IDENT"!==i&&Fc("Invalid type tag.");let s=[];this.tokens.length>0&&"<"===this.tokens[0][1]&&(this.consume("<"),s=this.parseCommaList(">",!0),this.consume(">"));const a=new ac(gu.fromHex(e),new Zu(n),new Zu(o),s);return new sc(a)}throw new Error("Invalid type tag.")}};function Gc(e){if(Dc(e,["boolean","string"]),"boolean"==typeof e)return e;if("true"===e)return!0;if("false"===e)return!1;throw new Error("Invalid boolean string.")}function Vc(e){if(Dc(e,["number","string"]),"number"==typeof e)return e;const t=Number.parseInt(e,10);if(Number.isNaN(t))throw new Error("Invalid number string.");return t}function Jc(e){return Dc(e,["number","bigint","string"]),BigInt(e)}function Yc(e,t,r){if(t instanceof Qu)r.serializeBool(Gc(e));else if(t instanceof ec)r.serializeU8(Vc(e));else if(t instanceof tc)r.serializeU64(Jc(e));else if(t instanceof rc)r.serializeU128(Jc(e));else{if(!(t instanceof nc)){if(t instanceof oc){if(t.value instanceof ec){if(e instanceof Uint8Array)return void r.serializeBytes(e);if("string"==typeof e)return void r.serializeStr(e)}if(!(e instanceof Array))throw new Error("Invalid vector args.");return r.serializeU32AsUleb128(e.length),void e.forEach((e=>Yc(e,t.value,r)))}if(t instanceof sc){const{address:n,module_name:i,name:o}=t.value;if("0x1::string::String"!=`${ts.fromUint8Array(n.address).toShortString()}::${i.value}::${o.value}`)throw new Error("The only supported struct arg is of type 0x1::string::String");return Dc(e,["string"]),void r.serializeStr(e)}throw new Error("Unsupported arg type.")}{let t;if("string"==typeof e||e instanceof ts)t=gu.fromHex(e);else{if(!(e instanceof gu))throw new Error("Invalid account address.");t=e}t.serialize(r)}}}var{sha3_256:Zc}=mo,Xc=class{constructor(e,t){this.rawTxnBuilder=t,this.signingFunction=e}build(e,t,r){if(!this.rawTxnBuilder)throw new Error("this.rawTxnBuilder doesn't exist.");return this.rawTxnBuilder.build(e,t,r)}static getSigningMessage(e){const t=Zc.create();if(e instanceof cc)t.update("APTOS::RawTransaction");else{if(!(e instanceof mc))throw new Error("Unknown transaction type.");t.update("APTOS::RawTransactionWithData")}const r=new Uint8Array(t.arrayBuffer()),n=ku(e),i=new Uint8Array(r.length+n.length);return i.set(r),i.set(n,r.length),i}},Qc=class extends Xc{constructor(e,t,r){super(e,r),this.publicKey=t}rawToSigned(e){const t=Xc.getSigningMessage(e),r=this.signingFunction(t),n=new Wu(new Nu(this.publicKey),r);return new gc(e,n)}sign(e){return ku(this.rawToSigned(e))}},eh=class{constructor(e,t){this.abiMap=new Map,e.forEach((e=>{const t=new Au(e),r=Nc.deserialize(t);let n;if(r instanceof jc){const e=r,{address:t,name:i}=e.module_name;n=`${ts.fromUint8Array(t.address).toShortString()}::${i.value}::${e.name}`}else n=r.name;if(this.abiMap.has(n))throw new Error("Found conflicting ABI interfaces");this.abiMap.set(n,r)})),this.builderConfig={gasUnitPrice:BigInt(1),maxGasAmount:BigInt(2e3),expSecFromNow:20,...t}}static toBCSArgs(e,t){if(e.length!==t.length)throw new Error("Wrong number of args provided.");return t.map(((t,r)=>{const n=new _u;return Yc(t,e[r].type_tag,n),n.getBytes()}))}static toTransactionArguments(e,t){if(e.length!==t.length)throw new Error("Wrong number of args provided.");return t.map(((t,r)=>function(e,t){if(t instanceof Qu)return new Rc(Gc(e));if(t instanceof ec)return new Sc(Vc(e));if(t instanceof tc)return new Mc(Jc(e));if(t instanceof rc)return new xc(Jc(e));if(t instanceof nc){let t;if("string"==typeof e||e instanceof ts)t=gu.fromHex(e);else{if(!(e instanceof gu))throw new Error("Invalid account address.");t=e}return new kc(t)}if(t instanceof oc&&t.value instanceof ec){if(!(e instanceof Uint8Array))throw new Error(`${e} should be an instance of Uint8Array`);return new Ic(e)}throw new Error("Unknown type for TransactionArgument.")}(t,e[r].type_tag)))}setSequenceNumber(e){this.builderConfig.sequenceNumber=BigInt(e)}buildTransactionPayload(e,t,r){const n=t.map((e=>new Kc(e).parseTypeTag()));let i;if(!this.abiMap.has(e))throw new Error(`Cannot find function: ${e}`);const o=this.abiMap.get(e);if(o instanceof jc){const e=o,t=eh.toBCSArgs(e.args,r);i=new _c(new fc(e.module_name,new Zu(e.name),n,t))}if(o instanceof qc){const e=o,t=eh.toTransactionArguments(e.args,r);i=new wc(new hc(e.code,n,t))}return i}build(e,t,r){const{sender:n,sequenceNumber:i,gasUnitPrice:o,maxGasAmount:s,expSecFromNow:a,chainId:u}=this.builderConfig,c=n instanceof gu?n:gu.fromHex(n),h=BigInt(Math.floor(Date.now()/1e3)+Number(a)),f=this.buildTransactionPayload(e,t,r);if(f)return new cc(c,BigInt(i),f,BigInt(s),BigInt(o),h,new Ec(Number(u)));throw new Error("Invalid ABI.")}},th=class{constructor(e,t){this.aptosClient=e,this.builderConfig=t}async fetchABI(e){const t=(await this.aptosClient.getAccountModules(e)).map((e=>e.abi)).flatMap((e=>e.exposed_functions.filter((e=>e.is_entry)).map((t=>({fullName:`${e.address}::${e.name}::${t.name}`,...t}))))),r=new Map;return t.forEach((e=>{r.set(e.fullName,e)})),r}async build(e,t,r){if(e=(e=>e.replace(/^0[xX]0*/g,"0x"))(e),3!==e.split("::").length)throw new Error("'func' needs to be a fully qualified function name in format <address>::<module>::<function>, e.g. 0x1::coins::transfer");const[n,i]=e.split("::"),o=await this.fetchABI(n);if(!o.has(e))throw new Error(`${e} doesn't exist.`);const s=o.get(e),a=s.params.filter((e=>"signer"!==e&&"&signer"!==e)).map(((e,t)=>new Lc(`var${t}`,new Kc(e).parseTypeTag()))),u=new jc(s.name,lc.fromStr(`${n}::${i}`),"",s.generic_type_params.map(((e,t)=>new zc(`${t}`))),a),{sender:c,...h}=this.builderConfig,f=c instanceof gu?ts.fromUint8Array(c.address):c,[{sequence_number:d},l]=await Promise.all([(null==h?void 0:h.sequenceNumber)?Promise.resolve({sequence_number:null==h?void 0:h.sequenceNumber}):this.aptosClient.getAccount(f),(null==h?void 0:h.chainId)?Promise.resolve(null==h?void 0:h.chainId):this.aptosClient.getChainId()]);return new eh([ku(u)],{sender:c,sequenceNumber:d,chainId:l,...h}).build(e,t,r)}};Xo([(6e5,ns({ttlMs:6e5,hashFunction:undefined}))],th.prototype,"fetchABI",1);var rh=class{constructor(e,t,r=!1){if(!e)throw new Error("Node URL cannot be empty.");const n=null==t?{}:{...t};n.BASE=r?e:function(e){let t=`${e}`;return t.endsWith("/")&&(t=t.substring(0,t.length-1)),t.endsWith("/v1")||(t=`${t}/v1`),t}(e),this.client=new xs(n)}async getAccount(e){return this.client.accounts.getAccount(ts.ensure(e).hex())}async getAccountTransactions(e,t){var r;return this.client.transactions.getAccountTransactions(ts.ensure(e).hex(),null==(r=null==t?void 0:t.start)?void 0:r.toString(),null==t?void 0:t.limit)}async getAccountModules(e,t){var r;return this.client.accounts.getAccountModules(ts.ensure(e).hex(),null==(r=null==t?void 0:t.ledgerVersion)?void 0:r.toString())}async getAccountModule(e,t,r){var n;return this.client.accounts.getAccountModule(ts.ensure(e).hex(),t,null==(n=null==r?void 0:r.ledgerVersion)?void 0:n.toString())}async getAccountResources(e,t){var r;return this.client.accounts.getAccountResources(ts.ensure(e).hex(),null==(r=null==t?void 0:t.ledgerVersion)?void 0:r.toString())}async getAccountResource(e,t,r){var n;return this.client.accounts.getAccountResource(ts.ensure(e).hex(),t,null==(n=null==r?void 0:r.ledgerVersion)?void 0:n.toString())}static generateBCSTransaction(e,t){return new Qc((t=>{const r=e.signBuffer(t);return new pu.Ed25519Signature(r.toUint8Array())}),e.pubKey().toUint8Array()).sign(t)}static generateBCSSimulation(e,t){return new Qc((e=>{const t=new Uint8Array(64);return new pu.Ed25519Signature(t)}),e.pubKey().toUint8Array()).sign(t)}async generateTransaction(e,t,r){const n={sender:e};if((null==r?void 0:r.sequence_number)&&(n.sequenceNumber=r.sequence_number),(null==r?void 0:r.gas_unit_price)&&(n.gasUnitPrice=r.gas_unit_price),(null==r?void 0:r.max_gas_amount)&&(n.maxGasAmount=r.max_gas_amount),null==r?void 0:r.expiration_timestamp_secs){const e=Number.parseInt(r.expiration_timestamp_secs,10);n.expSecFromNow=e-Math.floor(Date.now()/1e3)}return new th(this,n).build(t.function,t.type_arguments,t.arguments)}async signTransaction(e,t){return Promise.resolve(rh.generateBCSTransaction(e,t))}async getEventsByEventKey(e){return this.client.events.getEventsByEventKey(e)}async getEventsByCreationNumber(e,t){return this.client.events.getEventsByCreationNumber(ts.ensure(e).hex(),t.toString())}async getEventsByEventHandle(e,t,r,n){var i;return this.client.events.getEventsByEventHandle(ts.ensure(e).hex(),t,r,null==(i=null==n?void 0:n.start)?void 0:i.toString(),null==n?void 0:n.limit)}async submitTransaction(e){return this.submitSignedBCSTransaction(e)}async simulateTransaction(e,t){const r=rh.generateBCSSimulation(e,t);return this.submitBCSSimulation(r)}async submitSignedBCSTransaction(e){return this.client.request.request({url:"/transactions",method:"POST",body:e,mediaType:"application/x.aptos.signed_transaction+bcs"})}async submitBCSSimulation(e){return this.client.request.request({url:"/transactions/simulate",method:"POST",body:e,mediaType:"application/x.aptos.signed_transaction+bcs"})}async getTransactions(e){var t;return this.client.transactions.getTransactions(null==(t=null==e?void 0:e.start)?void 0:t.toString(),null==e?void 0:e.limit)}async getTransactionByHash(e){return this.client.transactions.getTransactionByHash(e)}async getTransactionByVersion(e){return this.client.transactions.getTransactionByVersion(e.toString())}async transactionPending(e){try{return"pending_transaction"===(await this.client.transactions.getTransactionByHash(e)).type}catch(e){if(404===(null==e?void 0:e.status))return!0;throw e}}async waitForTransactionWithResult(e,t){const r=(null==t?void 0:t.timeoutSecs)??20,n=(null==t?void 0:t.checkSuccess)??!1;let i,o=!0,s=0;for(;o&&!(s>=r);){try{if(i=await this.client.transactions.getTransactionByHash(e),o="pending_transaction"===i.type,!o)break}catch(e){const t=e instanceof hs,r=t&&404!==e.status&&e.status>=400&&e.status<500;if(!t||r)throw e}await rs(1e3),s+=1}if(o)throw new oh(`Waiting for transaction ${e} timed out after ${r} seconds`,i);if(!n)return i;if(!(null==i?void 0:i.success))throw new sh(`Transaction ${i.hash} committed to the blockchain but execution failed`,i);return i}async waitForTransaction(e,t){await this.waitForTransactionWithResult(e,t)}async getLedgerInfo(){return this.client.general.getLedgerInfo()}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getTableItem(e,t,r){var n;return await this.client.tables.getTableItem(e,t,null==(n=null==r?void 0:r.ledgerVersion)?void 0:n.toString())}async generateRawTransaction(e,t,r){const{maxGasAmount:n,gasUnitPrice:i,expireTimestamp:o}={maxGasAmount:BigInt(2e3),gasUnitPrice:BigInt(1),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+20),...r},[{sequence_number:s},a]=await Promise.all([this.getAccount(e),this.getChainId()]);return new pu.RawTransaction(pu.AccountAddress.fromHex(e),BigInt(s),t,n,i,o,new pu.ChainId(a))}async generateSignSubmitTransaction(e,t,r){const n=await this.generateRawTransaction(e.address(),t,r),i=rh.generateBCSTransaction(e,n);return(await this.submitSignedBCSTransaction(i)).hash}async publishPackage(e,t,r,n){const i=new _u;Su(r,i);const o=new pu.TransactionPayloadEntryFunction(pu.EntryFunction.natural("0x1::code","publish_package_txn",[],[Pu(t),i.getBytes()]));return this.generateSignSubmitTransaction(e,o,n)}async generateSignSubmitWaitForTransaction(e,t,r){const n=await this.generateSignSubmitTransaction(e,t,r);return this.waitForTransactionWithResult(n,r)}async rotateAuthKeyEd25519(e,t,r){const{sequence_number:n,authentication_key:i}=await this.getAccount(e.address()),o=new us(t),s=new pu.RotationProofChallenge(pu.AccountAddress.CORE_CODE_ADDRESS,"account","RotationProofChallenge",BigInt(n),pu.AccountAddress.fromHex(e.address()),new pu.AccountAddress(new ts(i).toUint8Array()),o.pubKey().toUint8Array()),a=ts.fromUint8Array(ku(s)),u=e.signHexString(a),c=o.signHexString(a),h=new pu.TransactionPayloadEntryFunction(pu.EntryFunction.natural("0x1::account","rotate_authentication_key",[],[Ru(0),Pu(e.pubKey().toUint8Array()),Ru(0),Pu(o.pubKey().toUint8Array()),Pu(u.toUint8Array()),Pu(c.toUint8Array())])),f=await this.generateRawTransaction(e.address(),h,r),d=rh.generateBCSTransaction(e,f);return this.submitSignedBCSTransaction(d)}async lookupOriginalAddress(e){const t=await this.getAccountResource("0x1","0x1::account::OriginatingAddress"),{address_map:{handle:r}}=t.data,n=await this.getTableItem(r,{key_type:"address",value_type:"address",key:ts.ensure(e).hex()});return new ts(n)}},nh=rh;Xo([ah],nh.prototype,"getAccount",1),Xo([ah],nh.prototype,"getAccountTransactions",1),Xo([ah],nh.prototype,"getAccountModules",1),Xo([ah],nh.prototype,"getAccountModule",1),Xo([ah],nh.prototype,"getAccountResources",1),Xo([ah],nh.prototype,"getAccountResource",1),Xo([ah],nh.prototype,"getEventsByEventKey",1),Xo([ah],nh.prototype,"getEventsByCreationNumber",1),Xo([ah],nh.prototype,"getEventsByEventHandle",1),Xo([ah],nh.prototype,"getTransactions",1),Xo([ah],nh.prototype,"getTransactionByHash",1),Xo([ah],nh.prototype,"getTransactionByVersion",1),Xo([ah],nh.prototype,"getLedgerInfo",1),Xo([ns()],nh.prototype,"getChainId",1),Xo([ah],nh.prototype,"getTableItem",1);var ih=class extends Error{constructor(e,t,r,n){super(t),this.status=e,this.message=t,this.errorCode=r,this.vmErrorCode=n}},oh=class extends Error{constructor(e,t){super(e),this.lastSubmittedTransaction=t}},sh=class extends Error{constructor(e,t){super(e),this.transaction=t}};function ah(e,t,r){const n=r.value;return r.value=async function(...e){var t,r;try{return await n.apply(this,[...e])}catch(e){if(e instanceof hs)throw new ih(e.status,JSON.stringify({message:e.message,...e.body}),null==(t=e.body)?void 0:t.error_code,null==(r=e.body)?void 0:r.vm_error_code);throw e}},r}var uh=r(8764).Buffer,ch=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class hh extends go{constructor(e){super(Object.assign(Object.assign({},e),{bridge:e.bridge||he({timeout:e.timeout})})),this.isMartian=!0,window.dispatchEvent(new Event("martian#initialized"))}get publicKey(){var e,t;return null!==(t=null===(e=this._account)||void 0===e?void 0:e.publicKey)&&void 0!==t?t:null}getClient(){return ch(this,void 0,void 0,(function*(){return new nh(yield this.getNetworkURL())}))}_callMartianBridge(e){return e.aptosProviderType=this.aptosProviderType,this.bridgeRequest(e)}signAndSubmitTransaction(e){return ch(this,void 0,void 0,(function*(){if("string"==typeof e)return yield this._callMartianBridge({method:"martianSignAndSubmitTransaction",params:e});{const t=yield this._callMartianBridge({method:"signAndSubmitTransaction",params:e});if(!t)throw F();return JSON.parse(t)}}))}signTransaction(e){return ch(this,void 0,void 0,(function*(){if("string"==typeof e)return this._callMartianBridge({method:"martianSignTransaction",params:e});{const t=yield this._callMartianBridge({method:"signTransaction",params:e});if(!t)throw F();return new Uint8Array(uh.from(t,"hex"))}}))}signGenericTransaction(e){return ch(this,void 0,void 0,(function*(){return this._callMartianBridge({method:"signGenericTransaction",params:{func:e.func,args:e.args,type_args:e.type_args}})}))}generateSignAndSubmitTransaction(e,t,r){return ch(this,void 0,void 0,(function*(){const n=yield this.generateTransaction(e,t,r);return yield this.signAndSubmitTransaction(n)}))}createCollection(e,t,r){return ch(this,void 0,void 0,(function*(){return this._callMartianBridge({method:"createCollection",params:{name:e,description:t,uri:r}})}))}createToken(e,t,r,n,i,o,s,a,u,c,h,f){return ch(this,void 0,void 0,(function*(){return this._callMartianBridge({method:"createToken",params:{collectionName:e,name:t,description:r,supply:n,uri:i,max:o,royalty_payee_address:s,royalty_points_denominator:a,royalty_points_numerator:u,property_keys:c,property_values:h,property_types:f}})}))}generateTransaction(e,t,r){return ch(this,void 0,void 0,(function*(){const n=yield this.getClient(),i=yield n.generateTransaction(e,t,r),o=new bu.Serializer;return i.serialize(o),o.getBytes().toString()}))}_convertStringToUint8Array(e){return new Uint8Array(e.split(",").map((e=>parseInt(e,10))))}submitTransaction(e){return ch(this,void 0,void 0,(function*(){const t="string"==typeof e?this._convertStringToUint8Array(e):e,r=yield this.getClient();return(yield r.submitTransaction(t)).hash}))}getTransactions(e){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getTransactions(e)}))}getTransaction(e){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getTransactionByHash(e)}))}getAccountTransactions(e,t){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getAccountTransactions(e,t)}))}getAccountResources(e,t){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getAccountResources(e,t)}))}getAccount(e){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getAccount(e)}))}getChainId(){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getChainId()}))}getLedgerInfo(){return ch(this,void 0,void 0,(function*(){return(yield this.getClient()).getLedgerInfo()}))}}se((()=>new de({receiveHandler:ae}))),function(){var e,t;if(!(null===(e=null===window||void 0===window?void 0:window.$onekey)||void 0===e?void 0:e.jsBridge))throw new Error("OneKey jsBridge not found.");const r=null===(t=null===window||void 0===window?void 0:window.$onekey)||void 0===t?void 0:t.jsBridge,n=new Ee({bridge:r}),i=new Ae({bridge:r}),o=new Qi({bridge:r}),s=new uo({bridge:r}),a=new hh({bridge:r}),u=Object.assign(Object.assign({},window.$onekey),{jsBridge:r,$private:i,ethereum:n,solana:o,starcoin:s,aptos:a,conflux:null,sollet:null});window.$onekey=u,window.ethereum=n,window.solana=o,window.phantom={solana:o},window.starcoin=s,window.aptos=a,window.martian=new Proxy(a,{get:(e,t,...r)=>"aptosProviderType"===t?"martian":Reflect.get(e,t,...r)}),function(e,t=console){let r=!1,n=!1;if(!window.web3){const i="__isMetaMaskShim__",o="__isOneKeyShim__";let s={currentProvider:e};Object.defineProperty(s,i,{value:!0,enumerable:!0,configurable:!1,writable:!1}),Object.defineProperty(s,o,{value:!0,enumerable:!0,configurable:!1,writable:!1}),s=new Proxy(s,{get:(o,s,...a)=>("currentProvider"!==s||r?"currentProvider"===s||s===i||n||(n=!0,t.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),e.request({method:"metamask_logWeb3ShimUsage"}).catch((e=>{t.debug("MetaMask: Failed to log web3 shim usage.",e)}))):(r=!0,t.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")),Reflect.get(o,s,...a)),set:(...e)=>(t.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),Reflect.set(...e))}),Object.defineProperty(window,"web3",{value:s,enumerable:!1,configurable:!0,writable:!0})}}(n),window.dispatchEvent(new Event("ethereum#initialized"))}(),console.log("======== injected.js in extension done! >>>>>>> ",performance.now())})(),n})()}));
|