@steemit/steem-js 1.0.9 → 1.0.11

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
- !function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};void 0===t.process&&(t.process={browser:!0,env:{},version:"",versions:{},nextTick:function(t){setTimeout(t,0)},exit:function(){},cwd:function(){return"/"},platform:"browser"},"undefined"!=typeof globalThis&&(globalThis.process=t.process))}(),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).steem=e()}(this,function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function r(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var r=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}),r}var i,n={exports:{}},o="object"==typeof Reflect?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function f(){f.init.call(this)}n.exports=f,n.exports.once=function(t,e){return new Promise(function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(t,"error",e,r)}(t,n,{once:!0})})},f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var h=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?f.defaultMaxListeners:t._maxListeners}function d(t,e,r,i){var n,o,s,a;if(u(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=c(t))>0&&s.length>n&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,a=f,console&&console.warn&&console.warn(a)}return t}function l(){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 p(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function b(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):m(n,n.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function y(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function n(o){i.once&&t.removeEventListener(e,n),r(o)})}}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h=t}}),f.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},f.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},f.prototype.getMaxListeners=function(){return c(this)},f.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var f=n[t];if(void 0===f)return!1;if("function"==typeof f)s(f,this,e);else{var h=f.length,u=m(f,h);for(r=0;r<h;++r)s(u[r],this,e)}return!0},f.prototype.addListener=function(t,e){return d(this,t,e,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(t,e){return d(this,t,e,!0)},f.prototype.once=function(t,e){return u(e),this.on(t,p(this,t,e)),this},f.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,p(this,t,e)),this},f.prototype.removeListener=function(t,e){var r,i,n,o,s;if(u(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,s||e)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(t){var e,r,i;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[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var n,o=Object.keys(r);for(i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},f.prototype.listeners=function(t){return b(this,t,!0)},f.prototype.rawListeners=function(t){return b(this,t,!1)},f.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},f.prototype.listenerCount=g,f.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};var v=n.exports;class w{constructor(){this.config={}}get(t){return this.config[t]}getBoolean(t){return!!this.get(t)}getNumber(t){const e=this.get(t);return"number"==typeof e?e:parseFloat(String(e))}getString(t){const e=this.get(t);return"string"==typeof e?e:String(e)}set(t,e){this.config[t]=e}all(){return{...this.config}}}const _=new w;Object.entries({address_prefix:"STM",chain_id:"0000000000000000000000000000000000000000000000000000000000000000",nodes:["https://api.steemit.com"]}).forEach(([t,e])=>_.set(t,e));const M=()=>_,E=t=>{Object.entries(t).forEach(([t,e])=>_.set(t,e))},A=E;var S,I,B=Object.freeze({__proto__:null,Config:w,getConfig:M,setConfig:E,setOptions:A}),x={exports:{}},T=x.exports={};function L(){throw new Error("setTimeout has not been defined")}function k(){throw new Error("clearTimeout has not been defined")}function N(t){if(S===setTimeout)return setTimeout(t,0);if((S===L||!S)&&setTimeout)return S=setTimeout,setTimeout(t,0);try{return S(t,0)}catch(e){try{return S.call(null,t,0)}catch(e){return S.call(this,t,0)}}}!function(){try{S="function"==typeof setTimeout?setTimeout:L}catch(t){S=L}try{I="function"==typeof clearTimeout?clearTimeout:k}catch(t){I=k}}();var R,U=[],O=!1,P=-1;function q(){O&&R&&(O=!1,R.length?U=R.concat(U):P=-1,U.length&&z())}function z(){if(!O){var t=N(q);O=!0;for(var e=U.length;e;){for(R=U,U=[];++P<e;)R&&R[P].run();P=-1,e=U.length}R=null,O=!1,function(t){if(I===clearTimeout)return clearTimeout(t);if((I===k||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(t);try{return I(t)}catch(e){try{return I.call(null,t)}catch(e){return I.call(this,t)}}}(t)}}function C(t,e){this.fun=t,this.array=e}function F(){}T.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];U.push(new C(t,e)),1!==U.length||O||N(z)},C.prototype.run=function(){this.fun.apply(null,this.array)},T.title="browser",T.browser=!0,T.env={},T.argv=[],T.version="",T.versions={},T.on=F,T.addListener=F,T.once=F,T.off=F,T.removeListener=F,T.removeAllListeners=F,T.emit=F,T.prependListener=F,T.prependOnceListener=F,T.listeners=function(t){return[]},T.binding=function(t){throw new Error("process.binding is not supported")},T.cwd=function(){return"/"},T.chdir=function(t){throw new Error("process.chdir is not supported")},T.umask=function(){return 0};var j=e(x.exports);const D=function(t){if(void 0!==j&&j.env)return j.env[t]}("DEBUG")||"",H=D.includes("steem-js"),Z=D?D.split(",").map(t=>t.trim()):[];function V(t){const e=M().get("debug");if(!0===e)return!0;if(!1===e)return!1;if(!H)return!1;if(!t)return D.includes("steem-js")&&!D.includes("steem-js:");const r=`steem-js:${t}`;return Z.some(t=>t===r||"steem-js:*"===t)}const $={log(t,...e){if(V(t)){const r=t?`[steem-js:${t}]`:"[steem-js]";console.log(r,...e)}},transaction(...t){this.log("transaction",...t)},signature(...t){this.log("signature",...t)},warn(...t){(V()||!1!==M().get("debug_warnings"))&&console.warn("[steem-js]",...t)},error(...t){console.error("[steem-js]",...t)},isEnabled:t=>V(t)};var W=Object.freeze({__proto__:null,debug:$});const J=t=>new Promise(e=>setTimeout(e,t)),K=async(t,e=3,r=1e3)=>{try{return await t()}catch(i){if(0===e)throw i;return await J(r),K(t,e-1,r)}},X=t=>t.replace(/_([a-z])/g,t=>t[1].toUpperCase());var Y=Object.freeze({__proto__:null,camelCase:X,chunk:(t,e)=>{const r=[];for(let i=0;i<t.length;i+=e)r.push(t.slice(i,i+e));return r},debug:$,flatten:t=>t.reduce((t,e)=>t.concat(e),[]),isValidAddress:t=>/^[1-5a-z]{1,12}$/.test(t),isValidAmount:t=>/^\d+\.\d{3}\s(STEEM|SBD)$/.test(t),isValidPermlink:t=>/^[a-z0-9-]+$/.test(t),retry:K,sleep:J,unique:t=>Array.from(new Set(t))});function G(t){return function(...e){return new Promise((r,i)=>{t.apply(this,[...e,(t,e)=>{t?i(t):r(e)}])})}}for(var Q={},tt={byteLength:function(t){var e=st(t),r=e[0],i=e[1];return 3*(r+i)/4-i},toByteArray:function(t){var e,r,i=st(t),n=i[0],o=i[1],s=new it(function(t,e,r){return 3*(e+r)/4-r}(0,n,o)),a=0,f=o>0?n-4:n;for(r=0;r<f;r+=4)e=rt[t.charCodeAt(r)]<<18|rt[t.charCodeAt(r+1)]<<12|rt[t.charCodeAt(r+2)]<<6|rt[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;2===o&&(e=rt[t.charCodeAt(r)]<<2|rt[t.charCodeAt(r+1)]>>4,s[a++]=255&e);1===o&&(e=rt[t.charCodeAt(r)]<<10|rt[t.charCodeAt(r+1)]<<4|rt[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e);return s},fromByteArray:function(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,a=r-i;s<a;s+=o)n.push(ft(t,s,s+o>a?a:s+o));1===i?(e=t[r-1],n.push(et[e>>2]+et[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],n.push(et[e>>10]+et[e>>4&63]+et[e<<2&63]+"="));return n.join("")}},et=[],rt=[],it="undefined"!=typeof Uint8Array?Uint8Array:Array,nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ot=0;ot<64;++ot)et[ot]=nt[ot],rt[nt.charCodeAt(ot)]=ot;function st(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function at(t){return et[t>>18&63]+et[t>>12&63]+et[t>>6&63]+et[63&t]}function ft(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),n.push(at(i));return n.join("")}rt["-".charCodeAt(0)]=62,rt["_".charCodeAt(0)]=63;var ht={read:function(t,e,r,i,n){var o,s,a=8*n-i-1,f=(1<<a)-1,h=f>>1,u=-7,c=r?n-1:0,d=r?-1:1,l=t[e+c];for(c+=d,o=l&(1<<-u)-1,l>>=-u,u+=a;u>0;o=256*o+t[e+c],c+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+t[e+c],c+=d,u-=8);if(0===o)o=1-h;else{if(o===f)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,i),o-=h}return(l?-1:1)*s*Math.pow(2,o-i)},write:function(t,e,r,i,n,o){var s,a,f,h=8*o-n-1,u=(1<<h)-1,c=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:o-1,p=i?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),(e+=s+c>=1?d/f:d*Math.pow(2,1-c))*f>=2&&(s++,f/=2),s+c>=u?(a=0,s=u):s+c>=1?(a=(e*f-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[r+l]=255&a,l+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;t[r+l]=255&s,l+=p,s/=256,h-=8);t[r+l-p]|=128*b}};!function(t){const e=tt,r=ht,i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},t.INSPECT_MAX_BYTES=50;const n=2147483647;function o(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|l(t,e);let i=o(r);const n=i.write(t,e);n!==r&&(i=i.slice(0,n));return i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){const e=new Uint8Array(t);return c(e.buffer,e.byteOffset,e.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return c(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return c(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return s.from(i,e,r);const n=function(t){if(s.isBuffer(t)){const e=0|d(t.length),r=o(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||J(t.length)?o(0):u(t);if("Buffer"===t.type&&Array.isArray(t.data))return u(t.data)}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return f(t),o(t<0?0:0|d(t))}function u(t){const e=t.length<0?0:0|d(t.length),r=o(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function c(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,s.prototype),i}function d(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function l(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(n)return i?-1:Z(t).length;e=(""+e).toLowerCase(),n=!0}}function p(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function b(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=s.from(e,i)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,i,n){let o,s=1,a=t.length,f=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,f/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){let i=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===f)return i*s}else-1!==i&&(o-=o-i),i=-1}else for(r+f>a&&(r=a-f),o=r;o>=0;o--){let r=!0;for(let i=0;i<f;i++)if(h(t,o+i)!==h(e,i)){r=!1;break}if(r)return o}return-1}function y(t,e,r,i){r=Number(r)||0;const n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;const o=e.length;let s;for(i>o/2&&(i=o/2),s=0;s<i;++s){const i=parseInt(e.substr(2*s,2),16);if(J(i))return s;t[r+s]=i}return s}function v(t,e,r,i){return $(Z(e,t.length-r),t,r,i)}function w(t,e,r,i){return $(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function _(t,e,r,i){return $(V(e),t,r,i)}function M(t,e,r,i){return $(function(t,e){let r,i,n;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function E(t,r,i){return 0===r&&i===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,i))}function A(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n<r;){const e=t[n];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(n+s<=r){let r,i,a,f;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[n+1],128==(192&r)&&(f=(31&e)<<6|63&r,f>127&&(o=f));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(f=(15&e)<<12|(63&r)<<6|63&i,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(f=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a,f>65535&&f<1114112&&(o=f))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}return function(t){const e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=S));return r}(i)}t.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.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(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)}(t,e,r)},s.allocUnsafe=function(t){return h(t)},s.allocUnsafeSlow=function(t){return h(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(W(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const i=s.allocUnsafe(e);let n=0;for(r=0;r<t.length;++r){let e=t[r];if(W(e,Uint8Array))n+e.length>i.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!s.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},s.byteLength=l,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)b(this,e,e+1);return this},s.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},s.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},s.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.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+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,e,r,i,n){if(W(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(e>>>=0);const f=Math.min(o,a),h=this.slice(i,n),u=t.slice(e,r);for(let t=0;t<f;++t)if(h[t]!==u[t]){o=h[t],a=u[t];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},s.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":case"latin1":case"binary":return w(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function I(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function B(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function x(t,e,r){const i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=K[t[i]];return n}function T(t,e,r){const i=t.slice(e,r);let n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+256*i[t+1]);return n}function L(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,i,n,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function N(t,e,r,i,n){F(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function R(t,e,r,i,n){F(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function U(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,i,n,o){return e=+e,i>>>=0,o||U(t,0,i,4),r.write(t,e,i,n,23,4),i+4}function P(t,e,i,n,o){return e=+e,i>>>=0,o||U(t,0,i,8),r.write(t,e,i,n,52,8),i+8}s.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const i=this.subarray(t,e);return Object.setPrototypeOf(i,s.prototype),i},s.prototype.readUintLE=s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let i=this[t],n=1,o=0;for(;++o<e&&(n*=256);)i+=this[t+o]*n;return i},s.prototype.readUintBE=s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=X(function(t){j(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||D(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))}),s.prototype.readBigUInt64BE=X(function(t){j(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||D(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)}),s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let i=this[t],n=1,o=0;for(;++o<e&&(n*=256);)i+=this[t+o]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*e)),i},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let i=e,n=1,o=this[t+--i];for(;i>0&&(n*=256);)o+=this[t+--i]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=X(function(t){j(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||D(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),s.prototype.readBigInt64BE=X(function(t){j(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||D(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),s.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),r.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),r.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),r.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),r.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e>>>=0,r>>>=0,!i){k(this,t,e,r,Math.pow(2,8*r)-1,0)}let n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e>>>=0,r>>>=0,!i){k(this,t,e,r,Math.pow(2,8*r)-1,0)}let n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigUInt64LE=X(function(t,e=0){return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=X(function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=0,o=1,s=0;for(this[e]=255&t;++n<r&&(o*=256);)t<0&&0===s&&0!==this[e+n-1]&&(s=1),this[e+n]=(t/o|0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=r-1,o=1,s=0;for(this[e+n]=255&t;--n>=0&&(o*=256);)t<0&&0===s&&0!==this[e+n+1]&&(s=1),this[e+n]=(t/o|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigInt64LE=X(function(t,e=0){return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=X(function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,i){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);const n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},s.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){const e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let n;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{const o=s.isBuffer(t)?t:s.from(t,i),a=o.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=o[n%a]}return this};const q={};function z(t,e,r){q[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function C(t){let e="",r=t.length;const i="-"===t[0]?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function F(t,e,r,i,n,o){if(t>r||t<e){const r="bigint"==typeof e?"n":"";let i;throw i=0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`,new q.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){j(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||D(e,t.length-(r+1))}(i,n,o)}function j(t,e){if("number"!=typeof t)throw new q.ERR_INVALID_ARG_TYPE(e,"number",t)}function D(t,e,r){if(Math.floor(t)!==t)throw j(t,r),new q.ERR_OUT_OF_RANGE("offset","an integer",t);if(e<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}z("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),z("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=C(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=C(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);const H=/[^+/0-9A-Za-z-_]/g;function Z(t,e){let r;e=e||1/0;const i=t.length;let n=null;const o=[];for(let s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function $(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function J(t){return t!=t}const K=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function X(t){return"undefined"==typeof BigInt?Y:t}function Y(){throw new Error("BigInt not supported")}}(Q);var ut={},ct="6.6.1",dt={},lt={exports:{}},pt=r(Object.freeze({__proto__:null,default:{}}));!function(e){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:pt.Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(t,e,r){var i=s(t,r);return r-1>=e&&(i|=s(t,r-1)<<4),i}function f(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},n.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},n.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-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"===i)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+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()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=a(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=a(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,u=r;u<a;u+=i)h=f(t,u,u+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var c=1;for(h=f(t,u,t.length,e),u=0;u<s;u++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.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"],u=[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],c=[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 d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,f=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var u=f>>>26,c=67108863&f,d=Math.min(h,e.length-1),l=Math.max(0,h-t.length+1);l<=d;l++){var p=h-l|0;u+=(s=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r.strip()}n.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],f=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-f.length]+f+i:f+i}for(0!==o&&(i=o.toString(16)+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var d=u[t],l=c[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);i=(p=p.idivn(l)).isZero()?b+i:h[d-b.length]+b+i}for(this.isZero()&&(i="0"+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,f="le"===e,h=new t(o),u=this.clone();if(f){for(a=0;!u.isZero();a++)s=u.andln(255),u.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!u.isZero();a++)s=u.andln(255),u.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},n.prototype.ior=function(t){return r(0===(this.negative|t.negative)),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},n.prototype.iand=function(t){return r(0===(this.negative|t.negative)),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},n.prototype.ixor=function(t){return r(0===(this.negative|t.negative)),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;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()},n.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var i,n,o,s=t.words,a=e.words,f=r.words,h=0,u=0|s[0],c=8191&u,d=u>>>13,l=0|s[1],p=8191&l,b=l>>>13,g=0|s[2],m=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],E=8191&M,A=M>>>13,S=0|s[5],I=8191&S,B=S>>>13,x=0|s[6],T=8191&x,L=x>>>13,k=0|s[7],N=8191&k,R=k>>>13,U=0|s[8],O=8191&U,P=U>>>13,q=0|s[9],z=8191&q,C=q>>>13,F=0|a[0],j=8191&F,D=F>>>13,H=0|a[1],Z=8191&H,V=H>>>13,$=0|a[2],W=8191&$,J=$>>>13,K=0|a[3],X=8191&K,Y=K>>>13,G=0|a[4],Q=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ft=8191&at,ht=at>>>13,ut=0|a[8],ct=8191&ut,dt=ut>>>13,lt=0|a[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(i=Math.imul(c,j))|0)+((8191&(n=(n=Math.imul(c,D))+Math.imul(d,j)|0))<<13)|0;h=((o=Math.imul(d,D))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,D))+Math.imul(b,j)|0,o=Math.imul(b,D);var mt=(h+(i=i+Math.imul(c,Z)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,Z)|0))<<13)|0;h=((o=o+Math.imul(d,V)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,j),n=(n=Math.imul(m,D))+Math.imul(y,j)|0,o=Math.imul(y,D),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,V)|0;var yt=(h+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,W)|0))<<13)|0;h=((o=o+Math.imul(d,J)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,j),n=(n=Math.imul(w,D))+Math.imul(_,j)|0,o=Math.imul(_,D),i=i+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,V)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,J)|0;var vt=(h+(i=i+Math.imul(c,X)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,D))+Math.imul(A,j)|0,o=Math.imul(A,D),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,V)|0,i=i+Math.imul(m,W)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,J)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Y)|0;var wt=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(I,j),n=(n=Math.imul(I,D))+Math.imul(B,j)|0,o=Math.imul(B,D),i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,V)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,D))+Math.imul(L,j)|0,o=Math.imul(L,D),i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,V)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,it)|0;var Mt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,st)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(N,j),n=(n=Math.imul(N,D))+Math.imul(R,j)|0,o=Math.imul(R,D),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,V)|0,i=i+Math.imul(I,W)|0,n=(n=n+Math.imul(I,J)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var Et=(h+(i=i+Math.imul(c,ft)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(d,ft)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(O,j),n=(n=Math.imul(O,D))+Math.imul(P,j)|0,o=Math.imul(P,D),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,V)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,V)|0,i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ht)|0;var At=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(z,j),n=(n=Math.imul(z,D))+Math.imul(C,j)|0,o=Math.imul(C,D),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,V)|0,i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Y)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var St=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,bt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,bt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(z,Z),n=(n=Math.imul(z,V))+Math.imul(C,Z)|0,o=Math.imul(C,V),i=i+Math.imul(O,W)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,dt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,dt)|0;var It=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;h=((o=o+Math.imul(b,bt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(z,W),n=(n=Math.imul(z,J))+Math.imul(C,W)|0,o=Math.imul(C,J),i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Y)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(A,ft)|0,o=o+Math.imul(A,ht)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var Bt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,bt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,bt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(z,X),n=(n=Math.imul(z,Y))+Math.imul(C,X)|0,o=Math.imul(C,Y),i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(I,ft)|0,n=(n=n+Math.imul(I,ht)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,ht)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,dt)|0;var xt=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,bt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(C,Q)|0,o=Math.imul(C,tt),i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,dt)|0;var Tt=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,bt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,bt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(z,rt),n=(n=Math.imul(z,it))+Math.imul(C,rt)|0,o=Math.imul(C,it),i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Lt=(h+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,bt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,bt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,i=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(C,ot)|0,o=Math.imul(C,st),i=i+Math.imul(O,ft)|0,n=(n=n+Math.imul(O,ht)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,dt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,dt)|0;var kt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,bt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,bt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(z,ft),n=(n=Math.imul(z,ht))+Math.imul(C,ft)|0,o=Math.imul(C,ht),i=i+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,dt)|0;var Nt=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,bt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,bt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(z,ct),n=(n=Math.imul(z,dt))+Math.imul(C,ct)|0,o=Math.imul(C,dt);var Rt=(h+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,bt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,bt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ut=(h+(i=Math.imul(z,pt))|0)+((8191&(n=(n=Math.imul(z,bt))+Math.imul(C,pt)|0))<<13)|0;return h=((o=Math.imul(C,bt))+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,f[0]=gt,f[1]=mt,f[2]=yt,f[3]=vt,f[4]=wt,f[5]=_t,f[6]=Mt,f[7]=Et,f[8]=At,f[9]=St,f[10]=It,f[11]=Bt,f[12]=xt,f[13]=Tt,f[14]=Lt,f[15]=kt,f[16]=Nt,f[17]=Rt,f[18]=Ut,0!==h&&(f[19]=h,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),n.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?l(this,t,e):i<63?d(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,f=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=f;h++){var u=o-h,c=(0|t.words[u])*(0|e.words[h]),d=67108863&c;a=67108863&(d=d+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e),r},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=n.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},b.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},b.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,f=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),u=0;u<n;u+=a)for(var c=f,d=h,l=0;l<s;l++){var p=r[u+l],b=i[u+l],g=r[u+l+s],m=i[u+l+s],y=c*g-d*m;m=c*m+d*g,g=y,r[u+l]=p+g,i[u+l]=b+m,r[u+l+s]=p-g,i[u+l+s]=b-m,l!==a&&(y=f*c-h*d,d=f*d+h*c,c=y)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},b.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},b.prototype.convert13b=function(t,e,i,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),f=new Array(i),h=new Array(i),u=new Array(i),c=new Array(i),d=r.words;d.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,f,i,n),this.transform(h,o,u,c,i,n);for(var l=0;l<i;l++){var p=a[l]*u[l]-f[l]*c[l];f[l]=a[l]*c[l]+f[l]*u[l],a[l]=p}return this.conjugate(a,f,i),this.transform(a,f,d,o,i,n),this.conjugate(d,o,i),this.normalize13b(d,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},n.prototype.mul=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),p(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,i=0;i<this.length;i++){var n=(0|this.words[i])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[i]=67108863&o}return 0!==e&&(this.words[i]=e,this.length++),this.length=0===t?1:this.length,this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var o=r.sqr();i<e.length;i++,o=o.sqr())0!==e[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,f=(0|this.words[e])-a<<i;this.words[e]=f|s,s=a>>>26-i}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,f=i;if(n-=s,n=Math.max(0,n),f){for(var h=0;h<s;h++)f.words[h]=this.words[h];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(0!==u||h>=n);h--){var c=0|this.words[h];this.words[h]=u<<26-o|c>>>o,u=c&a}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i)&&!!(this.words[i]&n)},n.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,e,i){var n,o,s=t.length+i;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+i])+a;var f=(0|t.words[n])*e;a=((o-=67108863&f)>>26)-(f/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,f=i.length-o.length;if("mod"!==e){(a=new n(null)).length=f+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var u=i.clone()._ishlnsubmul(o,1,f);0===u.negative&&(i=u,a&&(a.words[f]=1));for(var c=f-1;c>=0;c--){var d=67108864*(0|i.words[o.length+c])+(0|i.words[o.length+c-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(o,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(o,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},n.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new n(1),s=new n(0),a=new n(0),f=new n(1),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0===(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(u),s.isub(c)),o.iushrn(1),s.iushrn(1);for(var p=0,b=1;0===(i.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(c)),a.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a),s.isub(f)):(i.isub(e),a.isub(o),f.isub(s))}return{a:a,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new n(1),a=new n(0),f=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,u=1;0===(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var c=0,d=1;0===(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(a)):(i.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new M(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(y,m),y.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,m),i(w,m),i(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new v;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},M.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){r(0===(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),f=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var c=this.pow(u,o),d=this.pow(t,o.addn(1).iushrn(1)),l=this.pow(t,o),p=s;0!==l.cmp(a);){for(var b=l,g=0;0!==b.cmp(a);g++)b=b.redSqr();r(g<p);var m=this.pow(c,new n(1).iushln(p-g-1));d=d.redMul(m),c=m.redSqr(),l=l.redMul(c),p=g}return d},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new n(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var o=r[0],s=0,a=0,f=e.bitLength()%26;for(0===f&&(f=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],u=f-1;u>=0;u--){var c=h>>u&1;o!==r[0]&&(o=this.sqr(o)),0!==c||0!==s?(s<<=1,s|=c,(4===++a||0===i&&0===u)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}f=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new E(t)},i(E,M),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,t)}(lt);var bt=lt.exports,gt=mt;function mt(t,e){if(!t)throw new Error(e||"Assertion failed")}mt.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var yt={};!function(t){var e=t;function r(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",i=0;i<t.length;i++)e+=r(t[i].toString(16));return e}e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},e.zero2=r,e.toHex=i,e.encode=function(t,e){return"hex"===e?i(t):t}}(yt),function(t){var e=t,r=bt,i=gt,n=yt;e.assert=i,e.toArray=n.toArray,e.zero2=n.zero2,e.toHex=n.toHex,e.encode=n.encode,e.getNAF=function(t,e,r){var i,n=new Array(Math.max(t.bitLength(),r)+1);for(i=0;i<n.length;i+=1)n[i]=0;var o=1<<e+1,s=t.clone();for(i=0;i<n.length;i++){var a,f=s.andln(o-1);s.isOdd()?(a=f>(o>>1)-1?(o>>1)-f:f,s.isubn(a)):a=0,n[i]=a,s.iushrn(1)}return n},e.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,o=0;t.cmpn(-n)>0||e.cmpn(-o)>0;){var s,a,f=t.andln(3)+n&3,h=e.andln(3)+o&3;3===f&&(f=-1),3===h&&(h=-1),s=1&f?3!==(i=t.andln(7)+n&7)&&5!==i||2!==h?f:-f:0,r[0].push(s),a=1&h?3!==(i=e.andln(7)+o&7)&&5!==i||2!==f?h:-h:0,r[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},e.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(t){return new r(t,"hex","le")}}(dt);var vt,wt={exports:{}};function _t(t){this.rand=t}if(wt.exports=function(t){return vt||(vt=new _t(null)),vt.generate(t)},wt.exports.Rand=_t,_t.prototype.generate=function(t){return this._rand(t)},_t.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?_t.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?_t.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(_t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var Mt=pt;if("function"!=typeof Mt.randomBytes)throw new Error("Not supported");_t.prototype._rand=function(t){return Mt.randomBytes(t)}}catch(t){}var Et=wt.exports,At={},St=bt,It=dt,Bt=It.getNAF,xt=It.getJSF,Tt=It.assert;function Lt(t,e){this.type=t,this.p=new St(e.p,16),this.red=e.prime?St.red(e.prime):St.mont(this.p),this.zero=new St(0).toRed(this.red),this.one=new St(1).toRed(this.red),this.two=new St(2).toRed(this.red),this.n=e.n&&new St(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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))}var kt=Lt;function Nt(t,e){this.curve=t,this.type=e,this.precomputed=null}Lt.prototype.point=function(){throw new Error("Not implemented")},Lt.prototype.validate=function(){throw new Error("Not implemented")},Lt.prototype._fixedNafMul=function(t,e){Tt(t.precomputed);var r=t._getDoubles(),i=Bt(e,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var o,s,a=[];for(o=0;o<i.length;o+=r.step){s=0;for(var f=o+r.step-1;f>=o;f--)s=(s<<1)+i[f];a.push(s)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),c=n;c>0;c--){for(o=0;o<a.length;o++)(s=a[o])===c?u=u.mixedAdd(r.points[o]):s===-c&&(u=u.mixedAdd(r.points[o].neg()));h=h.add(u)}return h.toP()},Lt.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=Bt(e,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var f=0;a>=0&&0===o[a];a--)f++;if(a>=0&&f++,s=s.dblp(f),a<0)break;var h=o[a];Tt(0!==h),s="affine"===t.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===t.type?s.toP():s},Lt.prototype._wnafMulAdd=function(t,e,r,i,n){var o,s,a,f=this._wnafT1,h=this._wnafT2,u=this._wnafT3,c=0;for(o=0;o<i;o++){var d=(a=e[o])._getNAFPoints(t);f[o]=d.wnd,h[o]=d.points}for(o=i-1;o>=1;o-=2){var l=o-1,p=o;if(1===f[l]&&1===f[p]){var b=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(b[1]=e[l].add(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].add(e[p].neg())):(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=xt(r[l],r[p]);for(c=Math.max(m[0].length,c),u[l]=new Array(c),u[p]=new Array(c),s=0;s<c;s++){var y=0|m[0][s],v=0|m[1][s];u[l][s]=g[3*(y+1)+(v+1)],u[p][s]=0,h[l]=b}}else u[l]=Bt(r[l],f[l],this._bitLength),u[p]=Bt(r[p],f[p],this._bitLength),c=Math.max(u[l].length,c),c=Math.max(u[p].length,c)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(o=c;o>=0;o--){for(var M=0;o>=0;){var E=!0;for(s=0;s<i;s++)_[s]=0|u[s][o],0!==_[s]&&(E=!1);if(!E)break;M++,o--}if(o>=0&&M++,w=w.dblp(M),o<0)break;for(s=0;s<i;s++){var A=_[s];0!==A&&(A>0?a=h[s][A-1>>1]:A<0&&(a=h[s][-A-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o<i;o++)h[o]=null;return n?w:w.toP()},Lt.BasePoint=Nt,Nt.prototype.eq=function(){throw new Error("Not implemented")},Nt.prototype.validate=function(){return this.curve.validate(this)},Lt.prototype.decodePoint=function(t,e){t=It.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?Tt(t[t.length-1]%2==0):7===t[0]&&Tt(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},Nt.prototype.encodeCompressed=function(t){return this.encode(t,!0)},Nt.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},Nt.prototype.encode=function(t,e){return It.encode(this._encode(e),t)},Nt.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},Nt.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},Nt.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var o=0;o<t;o++)i=i.dbl();r.push(i)}return{step:t,points:r}},Nt.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},Nt.prototype._getBeta=function(){return null},Nt.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var Rt={exports:{}};"function"==typeof Object.create?Rt.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Rt.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var Ut=Rt.exports,Ot=bt,Pt=Ut,qt=kt,zt=dt.assert;function Ct(t){qt.call(this,"short",t),this.a=new Ot(t.a,16).toRed(this.red),this.b=new Ot(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Pt(Ct,qt);var Ft=Ct;function jt(t,e,r,i){qt.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ot(e,16),this.y=new Ot(r,16),i&&(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 Dt(t,e,r,i){qt.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ot(0)):(this.x=new Ot(e,16),this.y=new Ot(r,16),this.z=new Ot(i,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}Ct.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new Ot(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new Ot(t.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(e))?r=n[0]:(r=n[1],zt(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map(function(t){return{a:new Ot(t.a,16),b:new Ot(t.b,16)}}):this._getEndoBasis(r)}}},Ct.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:Ot.mont(t),r=new Ot(2).toRed(e).redInvm(),i=r.redNeg(),n=new Ot(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},Ct.prototype._getEndoBasis=function(t){for(var e,r,i,n,o,s,a,f,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=t,d=this.n.clone(),l=new Ot(1),p=new Ot(0),b=new Ot(0),g=new Ot(1),m=0;0!==c.cmpn(0);){var y=d.div(c);f=d.sub(y.mul(c)),h=b.sub(y.mul(l));var v=g.sub(y.mul(p));if(!i&&f.cmp(u)<0)e=a.neg(),r=l,i=f.neg(),n=h;else if(i&&2===++m)break;a=f,d=c,c=f,b=l,l=h,g=p,p=v}o=f.neg(),s=h;var w=i.sqr().add(n.sqr());return o.sqr().add(s.sqr()).cmp(w)>=0&&(o=e,s=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:i,b:n},{a:o,b:s}]},Ct.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),f=n.mul(r.b),h=o.mul(i.b);return{k1:t.sub(s).sub(a),k2:f.add(h).neg()}},Ct.prototype.pointFromX=function(t,e){(t=new Ot(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},Ct.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},Ct.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],f=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),i[2*o]=a,i[2*o+1]=f,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,i,n,2*o,r),u=0;u<2*o;u++)i[u]=null,n[u]=null;return h},Pt(jt,qt.BasePoint),Ct.prototype.point=function(t,e,r){return new jt(this,t,e,r)},Ct.prototype.pointFromJSON=function(t,e){return jt.fromJSON(this,t,e)},jt.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},jt.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]},jt.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var o=e[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},jt.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)+">"},jt.prototype.isInfinity=function(){return this.inf},jt.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},jt.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},jt.prototype.getX=function(){return this.x.fromRed()},jt.prototype.getY=function(){return this.y.fromRed()},jt.prototype.mul=function(t){return t=new Ot(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},jt.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},jt.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},jt.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},jt.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},jt.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Pt(Dt,qt.BasePoint),Ct.prototype.jpoint=function(t,e,r){return new Dt(this,t,e,r)},Dt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},Dt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Dt.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),f=o.redSub(s);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),c=i.redMul(h),d=f.redSqr().redIAdd(u).redISub(c).redISub(c),l=f.redMul(c.redISub(d)).redISub(o.redMul(u)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,l,p)},Dt.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),h=f.redMul(s),u=r.redMul(f),c=a.redSqr().redIAdd(h).redISub(u).redISub(u),d=a.redMul(u.redISub(c)).redISub(n.redMul(h)),l=this.z.redMul(s);return this.curve.jpoint(c,d,l)},Dt.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,f=a.redSqr().redSqr(),h=s.redAdd(s);for(e=0;e<t;e++){var u=o.redSqr(),c=h.redSqr(),d=c.redSqr(),l=u.redAdd(u).redIAdd(u).redIAdd(i.redMul(f)),p=o.redMul(c),b=l.redSqr().redISub(p.redAdd(p)),g=p.redISub(b),m=l.redMul(g);m=m.redIAdd(m).redISub(d);var y=h.redMul(a);e+1<t&&(f=f.redMul(d)),o=b,a=y,h=m}return this.curve.jpoint(o,h.redMul(n),a)},Dt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Dt.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i),f=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=f,e=a.redMul(s.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),c=this.y.redSqr(),d=c.redSqr(),l=this.x.redAdd(c).redSqr().redISub(u).redISub(d);l=l.redIAdd(l);var p=u.redAdd(u).redIAdd(u),b=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},Dt.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),f=a.redSqr().redISub(s).redISub(s);t=f;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=a.redMul(s.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),c=this.y.redSqr(),d=this.x.redMul(c),l=this.x.redSub(u).redMul(this.x.redAdd(u));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(u);var g=c.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=l.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},Dt.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(n)),f=e.redAdd(e),h=(f=f.redIAdd(f)).redMul(s),u=a.redSqr().redISub(h.redAdd(h)),c=h.redISub(u),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=a.redMul(c).redISub(d),p=r.redAdd(r).redMul(i);return this.curve.jpoint(u,l,p)},Dt.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),o=n.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(i),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),f=i.redIAdd(i);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(f),u=e.redMul(h);u=(u=u.redIAdd(u)).redIAdd(u);var c=this.x.redMul(a).redISub(u);c=(c=c.redIAdd(c)).redIAdd(c);var d=this.y.redMul(h.redMul(f.redISub(h)).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(c,d,l)},Dt.prototype.mul=function(t,e){return t=new Ot(t,e),this.curve._wnafMul(this,t)},Dt.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)},Dt.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},Dt.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)+">"},Dt.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Ht=bt,Zt=Ut,Vt=kt,$t=dt;function Wt(t){Vt.call(this,"mont",t),this.a=new Ht(t.a,16).toRed(this.red),this.b=new Ht(t.b,16).toRed(this.red),this.i4=new Ht(4).toRed(this.red).redInvm(),this.two=new Ht(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Zt(Wt,Vt);var Jt=Wt;function Kt(t,e,r){Vt.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Ht(e,16),this.z=new Ht(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Wt.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},Zt(Kt,Vt.BasePoint),Wt.prototype.decodePoint=function(t,e){return this.point($t.toArray(t,e),1)},Wt.prototype.point=function(t,e){return new Kt(this,t,e)},Wt.prototype.pointFromJSON=function(t){return Kt.fromJSON(this,t)},Kt.prototype.precompute=function(){},Kt.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Kt.fromJSON=function(t,e){return new Kt(t,e[0],e[1]||t.one)},Kt.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)+">"},Kt.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Kt.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},Kt.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Kt.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=n.redMul(i),a=e.z.redMul(o.redAdd(s).redSqr()),f=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,f)},Kt.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},Kt.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Kt.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Kt.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},Kt.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Kt.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Xt=bt,Yt=Ut,Gt=kt,Qt=dt.assert;function te(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,Gt.call(this,"edwards",t),this.a=new Xt(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Xt(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Xt(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Qt(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}Yt(te,Gt);var ee=te;function re(t,e,r,i,n){Gt.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(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 Xt(e,16),this.y=new Xt(r,16),this.z=i?new Xt(i,16):this.curve.one,this.t=n&&new Xt(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.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()))))}te.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},te.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},te.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},te.prototype.pointFromX=function(t,e){(t=new Xt(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),n=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(n.redInvm()),s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var a=s.fromRed().isOdd();return(e&&!a||!e&&a)&&(s=s.redNeg()),this.point(t,s)},te.prototype.pointFromY=function(t,e){(t=new Xt(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),n=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(n.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},te.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},Yt(re,Gt.BasePoint),te.prototype.pointFromJSON=function(t){return re.fromJSON(this,t)},te.prototype.point=function(t,e,r,i){return new re(this,t,e,r,i)},re.fromJSON=function(t,e){return new re(t,e[0],e[1],e[2])},re.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)+">"},re.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},re.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=i.redAdd(e),s=o.redSub(r),a=i.redSub(e),f=n.redMul(s),h=o.redMul(a),u=n.redMul(a),c=s.redMul(o);return this.curve.point(f,h,c,u)},re.prototype._projDbl=function(){var t,e,r,i,n,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var h=(i=this.curve._mulA(a)).redAdd(f);this.zOne?(t=s.redSub(a).redSub(f).redMul(h.redSub(this.curve.two)),e=h.redMul(i.redSub(f)),r=h.redSqr().redSub(h).redSub(h)):(n=this.z.redSqr(),o=h.redSub(n).redISub(n),t=s.redSub(a).redISub(f).redMul(o),e=h.redMul(i.redSub(f)),r=h.redMul(o))}else i=a.redAdd(f),n=this.curve._mulC(this.z).redSqr(),o=i.redSub(n).redSub(n),t=this.curve._mulC(s.redISub(i)).redMul(o),e=this.curve._mulC(i).redMul(a.redISub(f)),r=i.redMul(o);return this.curve.point(t,e,r)},re.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},re.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=n.redSub(i),a=n.redAdd(i),f=r.redAdd(e),h=o.redMul(s),u=a.redMul(f),c=o.redMul(f),d=s.redMul(a);return this.curve.point(h,u,d,c)},re.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),f=n.redSub(a),h=n.redAdd(a),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),c=i.redMul(f).redMul(u);return this.curve.twisted?(e=i.redMul(h).redMul(s.redSub(this.curve._mulA(o))),r=f.redMul(h)):(e=i.redMul(h).redMul(s.redSub(o)),r=this.curve._mulC(f).redMul(h)),this.curve.point(c,e,r)},re.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},re.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},re.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},re.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},re.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},re.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},re.prototype.getX=function(){return this.normalize(),this.x.fromRed()},re.prototype.getY=function(){return this.normalize(),this.y.fromRed()},re.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},re.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},re.prototype.toP=re.prototype.normalize,re.prototype.mixedAdd=re.prototype.add,function(t){var e=t;e.base=kt,e.short=Ft,e.mont=Jt,e.edwards=ee}(At);var ie={},ne={},oe={},se=gt,ae=Ut;function fe(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function he(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function ue(t){return 1===t.length?"0"+t:t}function ce(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}oe.inherits=ae,oe.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=63&o|128):fe(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},oe.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=ue(t[r].toString(16));return e},oe.htonl=he,oe.toHex32=function(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];"little"===e&&(n=he(n)),r+=ce(n.toString(16))}return r},oe.zero2=ue,oe.zero8=ce,oe.join32=function(t,e,r,i){var n=r-e;se(n%4==0);for(var o=new Array(n/4),s=0,a=e;s<o.length;s++,a+=4){var f;f="big"===i?t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],o[s]=f>>>0}return o},oe.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var o=t[i];"big"===e?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},oe.rotr32=function(t,e){return t>>>e|t<<32-e},oe.rotl32=function(t,e){return t<<e|t>>>32-e},oe.sum32=function(t,e){return t+e>>>0},oe.sum32_3=function(t,e,r){return t+e+r>>>0},oe.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},oe.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},oe.sum64=function(t,e,r,i){var n=t[e],o=i+t[e+1]>>>0,s=(o<i?1:0)+r+n;t[e]=s>>>0,t[e+1]=o},oe.sum64_hi=function(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},oe.sum64_lo=function(t,e,r,i){return e+i>>>0},oe.sum64_4_hi=function(t,e,r,i,n,o,s,a){var f=0,h=e;return f+=(h=h+i>>>0)<e?1:0,f+=(h=h+o>>>0)<o?1:0,t+r+n+s+(f+=(h=h+a>>>0)<a?1:0)>>>0},oe.sum64_4_lo=function(t,e,r,i,n,o,s,a){return e+i+o+a>>>0},oe.sum64_5_hi=function(t,e,r,i,n,o,s,a,f,h){var u=0,c=e;return u+=(c=c+i>>>0)<e?1:0,u+=(c=c+o>>>0)<o?1:0,u+=(c=c+a>>>0)<a?1:0,t+r+n+s+f+(u+=(c=c+h>>>0)<h?1:0)>>>0},oe.sum64_5_lo=function(t,e,r,i,n,o,s,a,f,h){return e+i+o+a+h>>>0},oe.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},oe.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},oe.shr64_hi=function(t,e,r){return t>>>r},oe.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var de={},le=oe,pe=gt;function be(){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}de.BlockHash=be,be.prototype.update=function(t,e){if(t=le.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=le.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},be.prototype.digest=function(t){return this.update(this._pad()),pe(null===this.pending),this._digest(t)},be.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i};var ge={},me={},ye=oe.rotr32;function ve(t,e,r){return t&e^~t&r}function we(t,e,r){return t&e^t&r^e&r}function _e(t,e,r){return t^e^r}me.ft_1=function(t,e,r,i){return 0===t?ve(e,r,i):1===t||3===t?_e(e,r,i):2===t?we(e,r,i):void 0},me.ch32=ve,me.maj32=we,me.p32=_e,me.s0_256=function(t){return ye(t,2)^ye(t,13)^ye(t,22)},me.s1_256=function(t){return ye(t,6)^ye(t,11)^ye(t,25)},me.g0_256=function(t){return ye(t,7)^ye(t,18)^t>>>3},me.g1_256=function(t){return ye(t,17)^ye(t,19)^t>>>10};var Me=oe,Ee=de,Ae=me,Se=Me.rotl32,Ie=Me.sum32,Be=Me.sum32_5,xe=Ae.ft_1,Te=Ee.BlockHash,Le=[1518500249,1859775393,2400959708,3395469782];function ke(){if(!(this instanceof ke))return new ke;Te.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Me.inherits(ke,Te);var Ne=ke;ke.blockSize=512,ke.outSize=160,ke.hmacStrength=80,ke.padLength=64,ke.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=Se(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4];for(i=0;i<r.length;i++){var h=~~(i/20),u=Be(Se(n,5),xe(h,o,s,a),f,r[i],Le[h]);f=a,a=s,s=Se(o,30),o=n,n=u}this.h[0]=Ie(this.h[0],n),this.h[1]=Ie(this.h[1],o),this.h[2]=Ie(this.h[2],s),this.h[3]=Ie(this.h[3],a),this.h[4]=Ie(this.h[4],f)},ke.prototype._digest=function(t){return"hex"===t?Me.toHex32(this.h,"big"):Me.split32(this.h,"big")};var Re=oe,Ue=de,Oe=me,Pe=gt,qe=Re.sum32,ze=Re.sum32_4,Ce=Re.sum32_5,Fe=Oe.ch32,je=Oe.maj32,De=Oe.s0_256,He=Oe.s1_256,Ze=Oe.g0_256,Ve=Oe.g1_256,$e=Ue.BlockHash,We=[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 Je(){if(!(this instanceof Je))return new Je;$e.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=We,this.W=new Array(64)}Re.inherits(Je,$e);var Ke=Je;Je.blockSize=512,Je.outSize=256,Je.hmacStrength=192,Je.padLength=64,Je.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=ze(Ve(r[i-2]),r[i-7],Ze(r[i-15]),r[i-16]);var n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],h=this.h[5],u=this.h[6],c=this.h[7];for(Pe(this.k.length===r.length),i=0;i<r.length;i++){var d=Ce(c,He(f),Fe(f,h,u),this.k[i],r[i]),l=qe(De(n),je(n,o,s));c=u,u=h,h=f,f=qe(a,d),a=s,s=o,o=n,n=qe(d,l)}this.h[0]=qe(this.h[0],n),this.h[1]=qe(this.h[1],o),this.h[2]=qe(this.h[2],s),this.h[3]=qe(this.h[3],a),this.h[4]=qe(this.h[4],f),this.h[5]=qe(this.h[5],h),this.h[6]=qe(this.h[6],u),this.h[7]=qe(this.h[7],c)},Je.prototype._digest=function(t){return"hex"===t?Re.toHex32(this.h,"big"):Re.split32(this.h,"big")};var Xe=oe,Ye=Ke;function Ge(){if(!(this instanceof Ge))return new Ge;Ye.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Xe.inherits(Ge,Ye);var Qe=Ge;Ge.blockSize=512,Ge.outSize=224,Ge.hmacStrength=192,Ge.padLength=64,Ge.prototype._digest=function(t){return"hex"===t?Xe.toHex32(this.h.slice(0,7),"big"):Xe.split32(this.h.slice(0,7),"big")};var tr=oe,er=de,rr=gt,ir=tr.rotr64_hi,nr=tr.rotr64_lo,or=tr.shr64_hi,sr=tr.shr64_lo,ar=tr.sum64,fr=tr.sum64_hi,hr=tr.sum64_lo,ur=tr.sum64_4_hi,cr=tr.sum64_4_lo,dr=tr.sum64_5_hi,lr=tr.sum64_5_lo,pr=er.BlockHash,br=[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 gr(){if(!(this instanceof gr))return new gr;pr.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=br,this.W=new Array(160)}tr.inherits(gr,pr);var mr=gr;function yr(t,e,r,i,n){var o=t&r^~t&n;return o<0&&(o+=4294967296),o}function vr(t,e,r,i,n,o){var s=e&i^~e&o;return s<0&&(s+=4294967296),s}function wr(t,e,r,i,n){var o=t&r^t&n^r&n;return o<0&&(o+=4294967296),o}function _r(t,e,r,i,n,o){var s=e&i^e&o^i&o;return s<0&&(s+=4294967296),s}function Mr(t,e){var r=ir(t,e,28)^ir(e,t,2)^ir(e,t,7);return r<0&&(r+=4294967296),r}function Er(t,e){var r=nr(t,e,28)^nr(e,t,2)^nr(e,t,7);return r<0&&(r+=4294967296),r}function Ar(t,e){var r=ir(t,e,14)^ir(t,e,18)^ir(e,t,9);return r<0&&(r+=4294967296),r}function Sr(t,e){var r=nr(t,e,14)^nr(t,e,18)^nr(e,t,9);return r<0&&(r+=4294967296),r}function Ir(t,e){var r=ir(t,e,1)^ir(t,e,8)^or(t,e,7);return r<0&&(r+=4294967296),r}function Br(t,e){var r=nr(t,e,1)^nr(t,e,8)^sr(t,e,7);return r<0&&(r+=4294967296),r}function xr(t,e){var r=ir(t,e,19)^ir(e,t,29)^or(t,e,6);return r<0&&(r+=4294967296),r}function Tr(t,e){var r=nr(t,e,19)^nr(e,t,29)^sr(t,e,6);return r<0&&(r+=4294967296),r}gr.blockSize=1024,gr.outSize=512,gr.hmacStrength=192,gr.padLength=128,gr.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=xr(r[i-4],r[i-3]),o=Tr(r[i-4],r[i-3]),s=r[i-14],a=r[i-13],f=Ir(r[i-30],r[i-29]),h=Br(r[i-30],r[i-29]),u=r[i-32],c=r[i-31];r[i]=ur(n,o,s,a,f,h,u,c),r[i+1]=cr(n,o,s,a,f,h,u,c)}},gr.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],n=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],f=this.h[5],h=this.h[6],u=this.h[7],c=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],b=this.h[12],g=this.h[13],m=this.h[14],y=this.h[15];rr(this.k.length===r.length);for(var v=0;v<r.length;v+=2){var w=m,_=y,M=Ar(c,d),E=Sr(c,d),A=yr(c,d,l,p,b),S=vr(c,d,l,p,b,g),I=this.k[v],B=this.k[v+1],x=r[v],T=r[v+1],L=dr(w,_,M,E,A,S,I,B,x,T),k=lr(w,_,M,E,A,S,I,B,x,T);w=Mr(i,n),_=Er(i,n),M=wr(i,n,o,s,a),E=_r(i,n,o,s,a,f);var N=fr(w,_,M,E),R=hr(w,_,M,E);m=b,y=g,b=l,g=p,l=c,p=d,c=fr(h,u,L,k),d=hr(u,u,L,k),h=a,u=f,a=o,f=s,o=i,s=n,i=fr(L,k,N,R),n=hr(L,k,N,R)}ar(this.h,0,i,n),ar(this.h,2,o,s),ar(this.h,4,a,f),ar(this.h,6,h,u),ar(this.h,8,c,d),ar(this.h,10,l,p),ar(this.h,12,b,g),ar(this.h,14,m,y)},gr.prototype._digest=function(t){return"hex"===t?tr.toHex32(this.h,"big"):tr.split32(this.h,"big")};var Lr=oe,kr=mr;function Nr(){if(!(this instanceof Nr))return new Nr;kr.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Lr.inherits(Nr,kr);var Rr=Nr;Nr.blockSize=1024,Nr.outSize=384,Nr.hmacStrength=192,Nr.padLength=128,Nr.prototype._digest=function(t){return"hex"===t?Lr.toHex32(this.h.slice(0,12),"big"):Lr.split32(this.h.slice(0,12),"big")},ge.sha1=Ne,ge.sha224=Qe,ge.sha256=Ke,ge.sha384=Rr,ge.sha512=mr;var Ur={},Or=oe,Pr=de,qr=Or.rotl32,zr=Or.sum32,Cr=Or.sum32_3,Fr=Or.sum32_4,jr=Pr.BlockHash;function Dr(){if(!(this instanceof Dr))return new Dr;jr.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Hr(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function Zr(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Vr(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Or.inherits(Dr,jr),Ur.ripemd160=Dr,Dr.blockSize=512,Dr.outSize=160,Dr.hmacStrength=192,Dr.padLength=64,Dr.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],o=this.h[3],s=this.h[4],a=r,f=i,h=n,u=o,c=s,d=0;d<80;d++){var l=zr(qr(Fr(r,Hr(d,i,n,o),t[$r[d]+e],Zr(d)),Jr[d]),s);r=s,s=o,o=qr(n,10),n=i,i=l,l=zr(qr(Fr(a,Hr(79-d,f,h,u),t[Wr[d]+e],Vr(d)),Kr[d]),c),a=c,c=u,u=qr(h,10),h=f,f=l}l=Cr(this.h[1],n,u),this.h[1]=Cr(this.h[2],o,c),this.h[2]=Cr(this.h[3],s,a),this.h[3]=Cr(this.h[4],r,f),this.h[4]=Cr(this.h[0],i,h),this.h[0]=l},Dr.prototype._digest=function(t){return"hex"===t?Or.toHex32(this.h,"little"):Or.split32(this.h,"little")};var $r=[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],Wr=[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],Jr=[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],Kr=[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],Xr=oe,Yr=gt;function Gr(t,e,r){if(!(this instanceof Gr))return new Gr(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Xr.toArray(e,r))}var Qr,ti,ei=Gr;Gr.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),Yr(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},Gr.prototype.update=function(t,e){return this.inner.update(t,e),this},Gr.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=oe,e.common=de,e.sha=ge,e.ripemd=Ur,e.hmac=ei,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(ne),function(t){var e,r=t,i=ne,n=At,o=dt.assert;function s(t){"short"===t.type?this.curve=new n.short(t):"edwards"===t.type?this.curve=new n.edwards(t):this.curve=new n.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var i=new s(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=s,a("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:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:i.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"]}),a("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:i.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),a("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:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{e=ti?Qr:(ti=1,Qr={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"]]}})}catch(t){e=void 0}a("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:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",e]})}(ie);var ri=ne,ii=yt,ni=gt;function oi(t){if(!(this instanceof oi))return new oi(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=ii.toArray(t.entropy,t.entropyEnc||"hex"),r=ii.toArray(t.nonce,t.nonceEnc||"hex"),i=ii.toArray(t.pers,t.persEnc||"hex");ni(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var si=oi;oi.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},oi.prototype._hmac=function(){return new ri.hmac(this.hash,this.K)},oi.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},oi.prototype.reseed=function(t,e,r,i){"string"!=typeof e&&(i=r,r=e,e=null),t=ii.toArray(t,e),r=ii.toArray(r,i),ni(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},oi.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=ii.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<t;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var o=n.slice(0,t);return this._update(r),this._reseed++,ii.encode(o,e)};var ai=bt,fi=dt.assert;function hi(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var ui=hi;hi.fromPublic=function(t,e,r){return e instanceof hi?e:new hi(t,{pub:e,pubEnc:r})},hi.fromPrivate=function(t,e,r){return e instanceof hi?e:new hi(t,{priv:e,privEnc:r})},hi.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},hi.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},hi.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},hi.prototype._importPrivate=function(t,e){this.priv=new ai(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},hi.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?fi(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||fi(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},hi.prototype.derive=function(t){return t.validate()||fi(t.validate(),"public point not validated"),t.mul(this.priv).getX()},hi.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},hi.prototype.verify=function(t,e,r){return this.ec.verify(t,e,this,void 0,r)},hi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var ci=bt,di=dt,li=di.assert;function pi(t,e){if(t instanceof pi)return t;this._importDER(t,e)||(li(t.r&&t.s,"Signature without r or s"),this.r=new ci(t.r,16),this.s=new ci(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var bi=pi;function gi(){this.place=0}function mi(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;if(0===t[e.place])return!1;for(var n=0,o=0,s=e.place;o<i;o++,s++)n<<=8,n|=t[s],n>>>=0;return!(n<=127)&&(e.place=s,n)}function yi(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function vi(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}pi.prototype._importDER=function(t,e){t=di.toArray(t,e);var r=new gi;if(48!==t[r.place++])return!1;var i=mi(t,r);if(!1===i)return!1;if(i+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var n=mi(t,r);if(!1===n)return!1;if(128&t[r.place])return!1;var o=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var s=mi(t,r);if(!1===s)return!1;if(t.length!==s+r.place)return!1;if(128&t[r.place])return!1;var a=t.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new ci(o),this.s=new ci(a),this.recoveryParam=null,!0},pi.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=yi(e),r=yi(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];vi(i,e.length),(i=i.concat(e)).push(2),vi(i,r.length);var n=i.concat(r),o=[48];return vi(o,n.length),o=o.concat(n),di.encode(o,t)};var wi=bt,_i=si,Mi=ie,Ei=Et,Ai=dt.assert,Si=ui,Ii=bi;function Bi(t){if(!(this instanceof Bi))return new Bi(t);"string"==typeof t&&(Ai(Object.prototype.hasOwnProperty.call(Mi,t),"Unknown curve "+t),t=Mi[t]),t instanceof Mi.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var xi=Bi;Bi.prototype.keyPair=function(t){return new Si(this,t)},Bi.prototype.keyFromPrivate=function(t,e){return Si.fromPrivate(this,t,e)},Bi.prototype.keyFromPublic=function(t,e){return Si.fromPublic(this,t,e)},Bi.prototype.genKeyPair=function(t){t||(t={});for(var e=new _i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Ei(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new wi(2));;){var n=new wi(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},Bi.prototype._truncateToN=function(t,e,r){var i;if(wi.isBN(t)||"number"==typeof t)i=(t=new wi(t,16)).byteLength();else if("object"==typeof t)i=t.length,t=new wi(t,16);else{var n=t.toString();i=n.length+1>>>1,t=new wi(n,16)}"number"!=typeof r&&(r=8*i);var o=r-this.n.bitLength();return o>0&&(t=t.ushrn(o)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},Bi.prototype.sign=function(t,e,r,i){if("object"==typeof r&&(i=r,r=null),i||(i={}),"string"!=typeof t&&"number"!=typeof t&&!wi.isBN(t)){Ai("object"==typeof t&&t&&"number"==typeof t.length,"Expected message to be an array-like, a hex string, or a BN instance"),Ai(t.length>>>0===t.length);for(var n=0;n<t.length;n++)Ai((255&t[n])===t[n])}e=this.keyFromPrivate(e,r),t=this._truncateToN(t,!1,i.msgBitLength),Ai(!t.isNeg(),"Can not sign a negative message");var o=this.n.byteLength(),s=e.getPrivate().toArray("be",o),a=t.toArray("be",o);Ai(new wi(a).eq(t),"Can not sign message");for(var f=new _i({hash:this.hash,entropy:s,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),h=this.n.sub(new wi(1)),u=0;;u++){var c=i.k?i.k(u):new wi(f.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(h)>=0)){var d=this.g.mul(c);if(!d.isInfinity()){var l=d.getX(),p=l.umod(this.n);if(0!==p.cmpn(0)){var b=c.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var g=(d.getY().isOdd()?1:0)|(0!==l.cmp(p)?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),g^=1),new Ii({r:p,s:b,recoveryParam:g})}}}}}},Bi.prototype.verify=function(t,e,r,i,n){n||(n={}),t=this._truncateToN(t,!1,n.msgBitLength),r=this.keyFromPublic(r,i);var o=(e=new Ii(e,"hex")).r,s=e.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,f=s.invm(this.n),h=f.mul(t).umod(this.n),u=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(h,r.getPublic(),u)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(h,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},Bi.prototype.recoverPubKey=function(t,e,r,i){Ai((3&r)===r,"The recovery param is more than two bits"),e=new Ii(e,i);var n=this.n,o=new wi(t),s=e.r,a=e.s,f=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var u=e.r.invm(n),c=n.sub(o).mul(u).umod(n),d=a.mul(u).umod(n);return this.g.mulAdd(c,s,d)},Bi.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new Ii(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var Ti=dt,Li=Ti.assert,ki=Ti.parseBytes,Ni=Ti.cachedProperty;function Ri(t,e){this.eddsa=t,this._secret=ki(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=ki(e.pub)}Ri.fromPublic=function(t,e){return e instanceof Ri?e:new Ri(t,{pub:e})},Ri.fromSecret=function(t,e){return e instanceof Ri?e:new Ri(t,{secret:e})},Ri.prototype.secret=function(){return this._secret},Ni(Ri,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),Ni(Ri,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),Ni(Ri,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),Ni(Ri,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),Ni(Ri,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),Ni(Ri,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),Ri.prototype.sign=function(t){return Li(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},Ri.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},Ri.prototype.getSecret=function(t){return Li(this._secret,"KeyPair is public only"),Ti.encode(this.secret(),t)},Ri.prototype.getPublic=function(t){return Ti.encode(this.pubBytes(),t)};var Ui=Ri,Oi=bt,Pi=dt,qi=Pi.assert,zi=Pi.cachedProperty,Ci=Pi.parseBytes;function Fi(t,e){this.eddsa=t,"object"!=typeof e&&(e=Ci(e)),Array.isArray(e)&&(qi(e.length===2*t.encodingLength,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),qi(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof Oi&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}zi(Fi,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),zi(Fi,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),zi(Fi,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),zi(Fi,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Fi.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Fi.prototype.toHex=function(){return Pi.encode(this.toBytes(),"hex").toUpperCase()};var ji=Fi,Di=ne,Hi=ie,Zi=dt,Vi=Zi.assert,$i=Zi.parseBytes,Wi=Ui,Ji=ji;function Ki(t){if(Vi("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof Ki))return new Ki(t);t=Hi[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=Di.sha512}var Xi=Ki;Ki.prototype.sign=function(t,e){t=$i(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),o=this.encodePoint(n),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),a=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:a,Rencoded:o})},Ki.prototype.verify=function(t,e,r){if(t=$i(t),(e=this.makeSignature(e)).S().gte(e.eddsa.curve.n)||e.S().isNeg())return!1;var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(o)},Ki.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return Zi.intFromLE(t.digest()).umod(this.curve.n)},Ki.prototype.keyFromPublic=function(t){return Wi.fromPublic(this,t)},Ki.prototype.keyFromSecret=function(t){return Wi.fromSecret(this,t)},Ki.prototype.makeSignature=function(t){return t instanceof Ji?t:new Ji(this,t)},Ki.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},Ki.prototype.decodePoint=function(t){var e=(t=Zi.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),i=!!(128&t[e]),n=Zi.intFromLE(r);return this.curve.pointFromY(n,i)},Ki.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},Ki.prototype.decodeInt=function(t){return Zi.intFromLE(t)},Ki.prototype.isPoint=function(t){return t instanceof this.pointClass},function(t){var e=t;e.version=ct,e.utils=dt,e.rand=Et,e.curve=At,e.curves=ie,e.ec=xi,e.eddsa=Xi}(ut);var Yi={exports:{}};!function(e){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:pt.Buffer}catch(t){}function s(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function a(t,e,r){var i=s(t,r);return r-1>=e&&(i|=s(t,r-1)<<4),i}function f(t,e,i,n){for(var o=0,s=0,a=Math.min(t.length,i),f=e;f<a;f++){var h=t.charCodeAt(f)-48;o*=n,s=h>=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&s<n,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},n.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},n.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-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"===i)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+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()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=a(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=a(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,u=r;u<a;u+=i)h=f(t,u,u+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var c=1;for(h=f(t,u,t.length,e),u=0;u<s;u++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},n.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype._move=function(t){h(t,this)},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(t){n.prototype.inspect=u}else n.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[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],l=[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];n.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],f=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?c[6-f.length]+f+i:f+i}for(0!==o&&(i=o.toString(16)+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],u=l[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modrn(u).toString(t);i=(p=p.idivn(u)).isZero()?b+i:c[h-b.length]+b+i}for(this.isZero()&&(i="0"+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,f=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var u=f>>>26,c=67108863&f,d=Math.min(h,e.length-1),l=Math.max(0,h-t.length+1);l<=d;l++){var p=h-l|0;u+=(s=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}n.prototype.toArrayLike=function(t,e,i){this._strip();var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r<t.length)for(t[r++]=i;r<t.length;)t[r++]=0},n.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},n.prototype.ior=function(t){return r(0===(this.negative|t.negative)),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},n.prototype.iand=function(t){return r(0===(this.negative|t.negative)),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this._strip()},n.prototype.ixor=function(t){return r(0===(this.negative|t.negative)),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this._strip()},n.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;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()},n.prototype.sub=function(t){return this.clone().isub(t)};var b=function(t,e,r){var i,n,o,s=t.words,a=e.words,f=r.words,h=0,u=0|s[0],c=8191&u,d=u>>>13,l=0|s[1],p=8191&l,b=l>>>13,g=0|s[2],m=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],E=8191&M,A=M>>>13,S=0|s[5],I=8191&S,B=S>>>13,x=0|s[6],T=8191&x,L=x>>>13,k=0|s[7],N=8191&k,R=k>>>13,U=0|s[8],O=8191&U,P=U>>>13,q=0|s[9],z=8191&q,C=q>>>13,F=0|a[0],j=8191&F,D=F>>>13,H=0|a[1],Z=8191&H,V=H>>>13,$=0|a[2],W=8191&$,J=$>>>13,K=0|a[3],X=8191&K,Y=K>>>13,G=0|a[4],Q=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ft=8191&at,ht=at>>>13,ut=0|a[8],ct=8191&ut,dt=ut>>>13,lt=0|a[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(i=Math.imul(c,j))|0)+((8191&(n=(n=Math.imul(c,D))+Math.imul(d,j)|0))<<13)|0;h=((o=Math.imul(d,D))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,D))+Math.imul(b,j)|0,o=Math.imul(b,D);var mt=(h+(i=i+Math.imul(c,Z)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,Z)|0))<<13)|0;h=((o=o+Math.imul(d,V)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,j),n=(n=Math.imul(m,D))+Math.imul(y,j)|0,o=Math.imul(y,D),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,V)|0;var yt=(h+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,W)|0))<<13)|0;h=((o=o+Math.imul(d,J)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,j),n=(n=Math.imul(w,D))+Math.imul(_,j)|0,o=Math.imul(_,D),i=i+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,V)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,J)|0;var vt=(h+(i=i+Math.imul(c,X)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,D))+Math.imul(A,j)|0,o=Math.imul(A,D),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,V)|0,i=i+Math.imul(m,W)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,J)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Y)|0;var wt=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(I,j),n=(n=Math.imul(I,D))+Math.imul(B,j)|0,o=Math.imul(B,D),i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,V)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,D))+Math.imul(L,j)|0,o=Math.imul(L,D),i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,V)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,it)|0;var Mt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,st)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(N,j),n=(n=Math.imul(N,D))+Math.imul(R,j)|0,o=Math.imul(R,D),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,V)|0,i=i+Math.imul(I,W)|0,n=(n=n+Math.imul(I,J)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var Et=(h+(i=i+Math.imul(c,ft)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(d,ft)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(O,j),n=(n=Math.imul(O,D))+Math.imul(P,j)|0,o=Math.imul(P,D),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,V)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,V)|0,i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ht)|0;var At=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(z,j),n=(n=Math.imul(z,D))+Math.imul(C,j)|0,o=Math.imul(C,D),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,V)|0,i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Y)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var St=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,bt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,bt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(z,Z),n=(n=Math.imul(z,V))+Math.imul(C,Z)|0,o=Math.imul(C,V),i=i+Math.imul(O,W)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,dt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,dt)|0;var It=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;h=((o=o+Math.imul(b,bt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(z,W),n=(n=Math.imul(z,J))+Math.imul(C,W)|0,o=Math.imul(C,J),i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Y)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(A,ft)|0,o=o+Math.imul(A,ht)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var Bt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,bt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,bt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(z,X),n=(n=Math.imul(z,Y))+Math.imul(C,X)|0,o=Math.imul(C,Y),i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(I,ft)|0,n=(n=n+Math.imul(I,ht)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,ht)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,dt)|0;var xt=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,bt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(C,Q)|0,o=Math.imul(C,tt),i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,dt)|0;var Tt=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,bt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,bt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(z,rt),n=(n=Math.imul(z,it))+Math.imul(C,rt)|0,o=Math.imul(C,it),i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Lt=(h+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,bt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,bt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,i=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(C,ot)|0,o=Math.imul(C,st),i=i+Math.imul(O,ft)|0,n=(n=n+Math.imul(O,ht)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,dt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,dt)|0;var kt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,bt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,bt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(z,ft),n=(n=Math.imul(z,ht))+Math.imul(C,ft)|0,o=Math.imul(C,ht),i=i+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,dt)|0;var Nt=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,bt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,bt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(z,ct),n=(n=Math.imul(z,dt))+Math.imul(C,ct)|0,o=Math.imul(C,dt);var Rt=(h+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,bt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,bt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ut=(h+(i=Math.imul(z,pt))|0)+((8191&(n=(n=Math.imul(z,bt))+Math.imul(C,pt)|0))<<13)|0;return h=((o=Math.imul(C,bt))+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,f[0]=gt,f[1]=mt,f[2]=yt,f[3]=vt,f[4]=wt,f[5]=_t,f[6]=Mt,f[7]=Et,f[8]=At,f[9]=St,f[10]=It,f[11]=Bt,f[12]=xt,f[13]=Tt,f[14]=Lt,f[15]=kt,f[16]=Nt,f[17]=Rt,f[18]=Ut,0!==h&&(f[19]=h,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,f=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=f;h++){var u=o-h,c=(0|t.words[u])*(0|e.words[h]),d=67108863&c;a=67108863&(d=d+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function m(t,e,r){return g(t,e,r)}Math.imul||(b=p),n.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):r<63?p(this,t,e):r<1024?g(this,t,e):m(this,t,e)},n.prototype.mul=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),m(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<67108864);for(var i=0,n=0;n<this.length;n++){var o=(0|this.words[n])*t,s=(67108863&o)+(67108863&i);i>>=26,i+=o/67108864|0,i+=s>>>26,this.words[n]=67108863&s}return 0!==i&&(this.words[n]=i,this.length++),this.length=0===t?1:this.length,e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=t.words[i]>>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var o=r.sqr();i<e.length;i++,o=o.sqr())0!==e[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,f=(0|this.words[e])-a<<i;this.words[e]=f|s,s=a>>>26-i}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,f=i;if(n-=s,n=Math.max(0,n),f){for(var h=0;h<s;h++)f.words[h]=this.words[h];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(0!==u||h>=n);h--){var c=0|this.words[h];this.words[h]=u<<26-o|c>>>o,u=c&a}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i)&&!!(this.words[i]&n)},n.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this._strip()},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,e,i){var n,o,s=t.length+i;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+i])+a;var f=(0|t.words[n])*e;a=((o-=67108863&f)>>26)-(f/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,f=i.length-o.length;if("mod"!==e){(a=new n(null)).length=f+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var u=i.clone()._ishlnsubmul(o,1,f);0===u.negative&&(i=u,a&&(a.words[f]=1));for(var c=f-1;c>=0;c--){var d=67108864*(0|i.words[o.length+c])+(0|i.words[o.length+c-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(o,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(o,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=d)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(i*n+(0|this.words[o]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*i;this.words[n]=o/t|0,i=o%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new n(1),s=new n(0),a=new n(0),f=new n(1),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0===(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(u),s.isub(c)),o.iushrn(1),s.iushrn(1);for(var p=0,b=1;0===(i.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(c)),a.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a),s.isub(f)):(i.isub(e),a.isub(o),f.isub(s))}return{a:a,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new n(1),a=new n(0),f=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,u=1;0===(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var c=0,d=1;0===(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(a)):(i.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new A(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(w,v),w.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(_,v),i(M,v),i(E,v),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return y[t]=e,e},A.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){r(0===(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),f=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var c=this.pow(u,o),d=this.pow(t,o.addn(1).iushrn(1)),l=this.pow(t,o),p=s;0!==l.cmp(a);){for(var b=l,g=0;0!==b.cmp(a);g++)b=b.redSqr();r(g<p);var m=this.pow(c,new n(1).iushln(p-g-1));d=d.redMul(m),c=m.redSqr(),l=l.redMul(c),p=g}return d},A.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(t,e){if(e.isZero())return new n(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var o=r[0],s=0,a=0,f=e.bitLength()%26;for(0===f&&(f=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],u=f-1;u>=0;u--){var c=h>>u&1;o!==r[0]&&(o=this.sqr(o)),0!==c||0!==s?(s<<=1,s|=c,(4===++a||0===i&&0===u)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}f=26}return o},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new S(t)},i(S,A),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,t)}(Yi);var Gi=e(Yi.exports);function Qi(t,e=""){if(!Number.isSafeInteger(t)||t<0){throw new Error(`${e&&`"${e}" `}expected integer >= 0, got ${t}`)}}function tn(t,e,r=""){const i=(n=t)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name;var n;const o=t?.length,s=void 0!==e;if(!i||s&&o!==e){throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(s?` of length ${e}`:"")+", got "+(i?`length=${o}`:"type="+typeof t))}return t}function en(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function rn(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function nn(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function on(t,e){return t<<32-e|t>>>e}function sn(t,e){return t<<e|t>>>32-e>>>0}function an(t,e={}){const r=(e,r)=>t(r).update(e).digest(),i=t(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.create=e=>t(e),Object.assign(r,e),Object.freeze(r)}const fn=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function hn(t,e,r){return t&e^~t&r}function un(t,e,r){return t&e^t&r^e&r}class cn{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,e,r,i){this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=nn(this.buffer)}update(t){en(this),tn(t);const{view:e,buffer:r,blockLen:i}=this,n=t.length;for(let o=0;o<n;){const s=Math.min(i-this.pos,n-o);if(s===i){const e=nn(t);for(;i<=n-o;o+=i)this.process(e,o);continue}r.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){en(this),function(t,e){tn(t,void 0,"digestInto() output");const r=e.outputLen;if(t.length<r)throw new Error('"digestInto() output" expected to be of length >='+r)}(t,this),this.finished=!0;const{buffer:e,view:r,blockLen:i,isLE:n}=this;let{pos:o}=this;e[o++]=128,rn(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(r,0),o=0);for(let t=o;t<i;t++)e[t]=0;r.setBigUint64(i-8,BigInt(8*this.length),n),this.process(r,0);const s=nn(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const f=a/4,h=this.get();if(f>h.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<f;t++)s.setUint32(4*t,h[t],n)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||=new this.constructor,t.set(...this.get());const{blockLen:e,buffer:r,length:i,finished:n,destroyed:o,pos:s}=this;return t.destroyed=o,t.finished=n,t.length=i,t.pos=s,i%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const dn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ln=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),pn=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),bn=(()=>Uint8Array.from(new Array(16).fill(0).map((t,e)=>e)))(),gn=(()=>bn.map(t=>(9*t+5)%16))(),mn=(()=>{const t=[[bn],[gn]];for(let e=0;e<4;e++)for(let r of t)r.push(r[e].map(t=>pn[t]));return t})(),yn=(()=>mn[0])(),vn=(()=>mn[1])(),wn=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),_n=yn.map((t,e)=>t.map(t=>wn[e][t])),Mn=vn.map((t,e)=>t.map(t=>wn[e][t])),En=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),An=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function Sn(t,e,r,i){return 0===t?e^r^i:1===t?e&r|~e&i:2===t?(e|~r)^i:3===t?e&i|r&~i:e^(r|~i)}const In=new Uint32Array(16);class Bn extends cn{h0=1732584193;h1=-271733879;h2=-1732584194;h3=271733878;h4=-1009589776;constructor(){super(64,20,8,!0)}get(){const{h0:t,h1:e,h2:r,h3:i,h4:n}=this;return[t,e,r,i,n]}set(t,e,r,i,n){this.h0=0|t,this.h1=0|e,this.h2=0|r,this.h3=0|i,this.h4=0|n}process(t,e){for(let r=0;r<16;r++,e+=4)In[r]=t.getUint32(e,!0);let r=0|this.h0,i=r,n=0|this.h1,o=n,s=0|this.h2,a=s,f=0|this.h3,h=f,u=0|this.h4,c=u;for(let t=0;t<5;t++){const e=4-t,d=En[t],l=An[t],p=yn[t],b=vn[t],g=_n[t],m=Mn[t];for(let e=0;e<16;e++){const i=sn(r+Sn(t,n,s,f)+In[p[e]]+d,g[e])+u|0;r=u,u=f,f=0|sn(s,10),s=n,n=i}for(let t=0;t<16;t++){const r=sn(i+Sn(e,o,a,h)+In[b[t]]+l,m[t])+c|0;i=c,c=h,h=0|sn(a,10),a=o,o=r}}this.set(this.h1+s+h|0,this.h2+f+c|0,this.h3+u+i|0,this.h4+r+o|0,this.h0+n+a|0)}roundClean(){rn(In)}destroy(){this.destroyed=!0,rn(this.buffer),this.set(0,0,0,0,0)}}const xn=an(()=>new Bn),Tn=BigInt(2**32-1),Ln=BigInt(32);function kn(t,e=!1){return e?{h:Number(t&Tn),l:Number(t>>Ln&Tn)}:{h:0|Number(t>>Ln&Tn),l:0|Number(t&Tn)}}const Nn=(t,e,r)=>t>>>r,Rn=(t,e,r)=>t<<32-r|e>>>r,Un=(t,e,r)=>t>>>r|e<<32-r,On=(t,e,r)=>t<<32-r|e>>>r,Pn=(t,e,r)=>t<<64-r|e>>>r-32,qn=(t,e,r)=>t>>>r-32|e<<64-r;function zn(t,e,r,i){const n=(e>>>0)+(i>>>0);return{h:t+r+(n/2**32|0)|0,l:0|n}}const Cn=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Fn=(t,e,r,i)=>e+r+i+(t/2**32|0)|0,jn=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),Dn=(t,e,r,i,n)=>e+r+i+n+(t/2**32|0)|0,Hn=(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0),Zn=(t,e,r,i,n,o)=>e+r+i+n+o+(t/2**32|0)|0,Vn=Uint32Array.from([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]),$n=new Uint32Array(64);class Wn extends cn{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:e,C:r,D:i,E:n,F:o,G:s,H:a}=this;return[t,e,r,i,n,o,s,a]}set(t,e,r,i,n,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)$n[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=$n[t-15],r=$n[t-2],i=on(e,7)^on(e,18)^e>>>3,n=on(r,17)^on(r,19)^r>>>10;$n[t]=n+$n[t-7]+i+$n[t-16]|0}let{A:r,B:i,C:n,D:o,E:s,F:a,G:f,H:h}=this;for(let t=0;t<64;t++){const e=h+(on(s,6)^on(s,11)^on(s,25))+hn(s,a,f)+Vn[t]+$n[t]|0,u=(on(r,2)^on(r,13)^on(r,22))+un(r,i,n)|0;h=f,f=a,a=s,s=o+e|0,o=n,n=i,i=r,r=e+u|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(r,i,n,o,s,a,f,h)}roundClean(){rn($n)}destroy(){this.set(0,0,0,0,0,0,0,0),rn(this.buffer)}}class Jn extends Wn{A=0|dn[0];B=0|dn[1];C=0|dn[2];D=0|dn[3];E=0|dn[4];F=0|dn[5];G=0|dn[6];H=0|dn[7];constructor(){super(32)}}const Kn=(()=>function(t,e=!1){const r=t.length;let i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){const{h:r,l:s}=kn(t[o],e);[i[o],n[o]]=[r,s]}return[i,n]}(["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(t=>BigInt(t))))(),Xn=(()=>Kn[0])(),Yn=(()=>Kn[1])(),Gn=new Uint32Array(80),Qn=new Uint32Array(80);class to extends cn{constructor(t){super(128,t,16,!1)}get(){const{Ah:t,Al:e,Bh:r,Bl:i,Ch:n,Cl:o,Dh:s,Dl:a,Eh:f,El:h,Fh:u,Fl:c,Gh:d,Gl:l,Hh:p,Hl:b}=this;return[t,e,r,i,n,o,s,a,f,h,u,c,d,l,p,b]}set(t,e,r,i,n,o,s,a,f,h,u,c,d,l,p,b){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|f,this.El=0|h,this.Fh=0|u,this.Fl=0|c,this.Gh=0|d,this.Gl=0|l,this.Hh=0|p,this.Hl=0|b}process(t,e){for(let r=0;r<16;r++,e+=4)Gn[r]=t.getUint32(e),Qn[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|Gn[t-15],r=0|Qn[t-15],i=Un(e,r,1)^Un(e,r,8)^Nn(e,0,7),n=On(e,r,1)^On(e,r,8)^Rn(e,r,7),o=0|Gn[t-2],s=0|Qn[t-2],a=Un(o,s,19)^Pn(o,s,61)^Nn(o,0,6),f=On(o,s,19)^qn(o,s,61)^Rn(o,s,6),h=jn(n,f,Qn[t-7],Qn[t-16]),u=Dn(h,i,a,Gn[t-7],Gn[t-16]);Gn[t]=0|u,Qn[t]=0|h}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:s,Cl:a,Dh:f,Dl:h,Eh:u,El:c,Fh:d,Fl:l,Gh:p,Gl:b,Hh:g,Hl:m}=this;for(let t=0;t<80;t++){const e=Un(u,c,14)^Un(u,c,18)^Pn(u,c,41),y=On(u,c,14)^On(u,c,18)^qn(u,c,41),v=u&d^~u&p,w=Hn(m,y,c&l^~c&b,Yn[t],Qn[t]),_=Zn(w,g,e,v,Xn[t],Gn[t]),M=0|w,E=Un(r,i,28)^Pn(r,i,34)^Pn(r,i,39),A=On(r,i,28)^qn(r,i,34)^qn(r,i,39),S=r&n^r&s^n&s,I=i&o^i&a^o&a;g=0|p,m=0|b,p=0|d,b=0|l,d=0|u,l=0|c,({h:u,l:c}=zn(0|f,0|h,0|_,0|M)),f=0|s,h=0|a,s=0|n,a=0|o,n=0|r,o=0|i;const B=Cn(M,A,I);r=Fn(B,_,E,S),i=0|B}({h:r,l:i}=zn(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=zn(0|this.Bh,0|this.Bl,0|n,0|o)),({h:s,l:a}=zn(0|this.Ch,0|this.Cl,0|s,0|a)),({h:f,l:h}=zn(0|this.Dh,0|this.Dl,0|f,0|h)),({h:u,l:c}=zn(0|this.Eh,0|this.El,0|u,0|c)),({h:d,l:l}=zn(0|this.Fh,0|this.Fl,0|d,0|l)),({h:p,l:b}=zn(0|this.Gh,0|this.Gl,0|p,0|b)),({h:g,l:m}=zn(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(r,i,n,o,s,a,f,h,u,c,d,l,p,b,g,m)}roundClean(){rn(Gn,Qn)}destroy(){rn(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class eo extends to{Ah=0|ln[0];Al=0|ln[1];Bh=0|ln[2];Bl=0|ln[3];Ch=0|ln[4];Cl=0|ln[5];Dh=0|ln[6];Dl=0|ln[7];Eh=0|ln[8];El=0|ln[9];Fh=0|ln[10];Fl=0|ln[11];Gh=0|ln[12];Gl=0|ln[13];Hh=0|ln[14];Hl=0|ln[15];constructor(){super(64)}}const ro=an(()=>new Jn,fn(1)),io=an(()=>new eo,fn(3));class no{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(t,e){if(function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash must wrapped by utils.createHasher");Qi(t.outputLen),Qi(t.blockLen)}(t),tn(e,void 0,"key"),this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(e.length>r?t.create().update(e).digest():e);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),rn(i)}update(t){return en(this),this.iHash.update(t),this}digestInto(t){en(this),tn(t,this.outputLen,"output"),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||=Object.create(Object.getPrototypeOf(this),{});const{oHash:e,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:s}=this;return t.finished=i,t.destroyed=n,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const oo=(t,e,r)=>new no(t,e).update(r).digest();function so(t,e){const r=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t),i=ro(r);return e?Q.Buffer.from(i).toString(e):Q.Buffer.from(i)}function ao(t,e){const r=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t),i=io(r);return e?Q.Buffer.from(i).toString(e):Q.Buffer.from(i)}function fo(t,e){return Q.Buffer.from(oo(ro,e,t))}function ho(t){const e=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t);return Q.Buffer.from(xn(e))}oo.create=(t,e)=>new no(t,e);var uo=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let t=0;t<e.length;t++)e[t]=255;for(let r=0;r<t.length;r++){const i=t.charAt(r),n=i.charCodeAt(0);if(255!==e[n])throw new TypeError(i+" is ambiguous");e[n]=r}const r=t.length,i=t.charAt(0),n=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function s(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;let o=0,s=0,a=0;for(;t[o]===i;)s++,o++;const f=(t.length-o)*n+1>>>0,h=new Uint8Array(f);for(;o<t.length;){const i=t.charCodeAt(o);if(i>255)return;let n=e[i];if(255===n)return;let s=0;for(let t=f-1;(0!==n||s<a)&&-1!==t;t--,s++)n+=r*h[t]>>>0,h[t]=n%256>>>0,n=n/256>>>0;if(0!==n)throw new Error("Non-zero carry");a=s,o++}let u=f-a;for(;u!==f&&0===h[u];)u++;const c=new Uint8Array(s+(f-u));let d=s;for(;u!==f;)c[d++]=h[u++];return c}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";let n=0,s=0,a=0;const f=e.length;for(;a!==f&&0===e[a];)a++,n++;const h=(f-a)*o+1>>>0,u=new Uint8Array(h);for(;a!==f;){let t=e[a],i=0;for(let e=h-1;(0!==t||i<s)&&-1!==e;e--,i++)t+=256*u[e]>>>0,u[e]=t%r>>>0,t=t/r>>>0;if(0!==t)throw new Error("Non-zero carry");s=i,a++}let c=h-s;for(;c!==h&&0===u[c];)c++;let d=i.repeat(n);for(;c<h;++c)d+=t.charAt(u[c]);return d},decodeUnsafe:s,decode:function(t){const e=s(t);if(e)return e;throw new Error("Non-base"+r+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");const co=new ut.ec("secp256k1"),lo=co.g,po=new Gi(co.n.toString());class bo{constructor(t){this.Q=t}static fromBinary(t){return bo.fromBuffer(Q.Buffer.from(t,"binary"))}static fromBuffer(t){return"000000000000000000000000000000000000000000000000000000000000000000"===t.toString("hex")?new bo(null):new bo(co.curve.decodePoint(t))}toBuffer(t=!0){return null===this.Q?Q.Buffer.from("000000000000000000000000000000000000000000000000000000000000000000","hex"):Q.Buffer.from(this.Q.encode("array",t))}static fromPoint(t){return new bo(t)}toUncompressed(){const t=Q.Buffer.from(this.Q.encode("array",!1)),e=co.curve.decodePoint(t);return bo.fromPoint(e)}toBlockchainAddress(){return ho(ao(this.toBuffer()))}toString(t=M().get("address_prefix")){return this.toPublicKeyString(t)}toPublicKeyString(t=M().get("address_prefix")){const e=t||"STM";if(this.pubdata)return e+this.pubdata;const r=this.toBuffer(),i=ho(r),n=Q.Buffer.concat([r,i.slice(0,4)]);return this.pubdata=uo.encode(n),e+this.pubdata}static fromString(t,e=M().get("address_prefix")){try{return bo.fromStringOrThrow(t,e)}catch{return null}}static fromStringOrThrow(t,e=M().get("address_prefix")){const r=e||"STM",i=t.slice(0,r.length);if(r!==i)throw new Error(`Expecting key to begin with ${r}, instead got ${i}`);t=t.slice(r.length);const n=uo.decode(t),o=Q.Buffer.from(n),s=o.slice(-4),a=o.slice(0,-4),f=ho(a).slice(0,4);if(!Q.Buffer.isBuffer(s)||!Q.Buffer.isBuffer(f)||!s.equals(f))throw new Error("Checksum did not match");return bo.fromBuffer(a)}toAddressString(t=M().get("address_prefix")){const e=ho(ao(this.toBuffer())),r=ho(e),i=Q.Buffer.concat([e,r.slice(0,4)]);return t+uo.encode(i)}toPtsAddy(){const t=ho(so(this.toBuffer())),e=Q.Buffer.from([56]),r=Q.Buffer.concat([e,t]);let i=so(r);i=so(i);const n=Q.Buffer.concat([r,i.slice(0,4)]);return uo.encode(n)}child(t){if(!Q.Buffer.isBuffer(t))throw new Error("Buffer required: offset");if(32!==t.length)throw new Error("offset length");t=so(t=Q.Buffer.concat([this.toBuffer(),t]));const e=new Gi(t);if(e.cmp(po)>=0)throw new Error("Child offset went out of bounds, try again");const r=lo.mul(e),i=this.Q.add(r);if(i.isInfinity())throw new Error("Child offset derived to an invalid key, try again");return bo.fromPoint(i)}static fromHex(t){const e=Q.Buffer.from(t,"hex");return 0===e.length?new bo(null):bo.fromBuffer(e)}toHex(){return this.Q?this.toBuffer().toString("hex"):"000000000000000000000000000000000000000000000000000000000000000000"}static fromStringHex(t){return bo.fromString(Q.Buffer.from(t,"hex").toString())}}const go=new ut.ec("secp256k1"),mo=go.g,yo=new Gi(go.n.toString());class vo{constructor(t){this.d=t}static fromBuffer(t){if(!Q.Buffer.isBuffer(t))throw new Error("Expecting parameter to be a Buffer type");if(32!==t.length&&$.warn(`WARN: Expecting 32 bytes, instead got ${t.length}, stack trace:`,(new Error).stack),0===t.length)throw new Error("Empty buffer");return new vo(new Gi(t))}static fromSeed(t){if("string"!=typeof t)throw new Error("seed must be of type string");return vo.fromBuffer(so(t))}static isWif(t){try{return this.fromWif(t),!0}catch{return!1}}static fromWif(t){const e=Q.Buffer.from(uo.decode(t)),r=e.readUInt8(0);if(128!==r)throw new Error(`Expected version 128, instead got ${r}`);const i=e.slice(0,-4),n=e.slice(-4);let o=so(i);if(o=so(o),o=o.slice(0,4),n.toString()!==o.toString())throw new Error("Invalid WIF key (checksum miss-match)");return i.writeUInt8(128,0),vo.fromBuffer(i.slice(1))}toWif(){const t=this.toBuffer(),e=Q.Buffer.concat([Q.Buffer.from([128]),t]);let r=so(e);r=so(r),r=r.slice(0,4);const i=Q.Buffer.concat([e,r]);return uo.encode(i)}toString(){return this.toWif()}toPublicKeyPoint(){return mo.mul(this.d)}toPublic(){return this.public_key?this.public_key:this.public_key=bo.fromPoint(this.toPublicKeyPoint())}toBuffer(){return this.d.toArrayLike(Q.Buffer,"be",32)}get_shared_secret(t){const e="string"==typeof t?bo.fromStringOrThrow(t):t;if(!e||!e.Q)throw new Error("Invalid public key");return ao(e.Q.mul(this.d).getX().toArrayLike(Q.Buffer,"be",32))}child(t){t=so(t=Q.Buffer.concat([this.toPublicKey().toBuffer(),t]));const e=new Gi(t);if(e.gte(yo))throw new Error("Child offset went out of bounds, try again");const r=this.d.add(e);if(r.isZero())throw new Error("Child offset derived to an invalid key, try again");return new vo(r)}static fromHex(t){return vo.fromBuffer(Q.Buffer.from(t,"hex"))}toHex(){return this.toBuffer().toString("hex")}toPublicKey(){return this.toPublic()}}function wo(t,e){switch(t){case"Array":if(Array.isArray(e))return;break;case"Boolean":if("boolean"==typeof e)return;break;case"Buffer":if(Q.Buffer.isBuffer(e))return;break;case"Number":if("number"==typeof e)return;break;case"String":if("string"==typeof e)return;break;default:if("function"==typeof t&&null!=e&&"object"==typeof e&&"constructor"in e&&_o(e.constructor)===_o(t))return}throw new TypeError("Expected "+("function"==typeof t?_o(t):t)+", got "+String(e))}function _o(t){if(t.name)return t.name;const e=t.toString().match(/function (.*?)\(/);return e?e[1]:null}class Mo{constructor(t,e){wo(Gi,t),wo(Gi,e),this.r=t,this.s=e}static parseCompact(t){if(65!==t.length)throw new Error("Invalid signature length");let e=t.readUInt8(0)-27;if((7&e)!==e)throw new Error("Invalid signature parameter");const r=!!(4&e);e&=3;const i=new Gi(t.slice(1,33)),n=new Gi(t.slice(33));return{compressed:r,i:e,signature:new Mo(i,n)}}static fromDER(t){if(48!==t.readUInt8(0))throw new Error("Not a DER sequence");if(t.readUInt8(1)!==t.length-2)throw new Error("Invalid sequence length");if(2!==t.readUInt8(2))throw new Error("Expected a DER integer");const e=t.readUInt8(3);if(0===e)throw new Error("R length is zero");let r=4+e;if(2!==t.readUInt8(r))throw new Error("Expected a DER integer (2)");const i=t.readUInt8(r+1);if(0===i)throw new Error("S length is zero");const n=t.slice(4,r),o=t.slice(r+2);if(r+=2+i,e>1&&0===n.readUInt8(0)&&!(128&n.readUInt8(1)))throw new Error("R value excessively padded");if(i>1&&0===o.readUInt8(0)&&!(128&o.readUInt8(1)))throw new Error("S value excessively padded");if(r!==t.length)throw new Error("Invalid DER encoding");const s=new Gi(n),a=new Gi(o);if(s.isNeg())throw new Error("R value is negative");if(a.isNeg())throw new Error("S value is negative");return new Mo(s,a)}static parseScriptSignature(t){const e=t.readUInt8(t.length-1),r=-129&e;if(r<=0||r>=4)throw new Error("Invalid hashType");return{signature:Mo.fromDER(t.slice(0,-1)),hashType:e}}toCompact(t,e){e&&(t+=4),t+=27;const r=Q.Buffer.alloc(65);return r.writeUInt8(t,0),this.r.toArrayLike(Q.Buffer,"be",32).copy(r,1),this.s.toArrayLike(Q.Buffer,"be",32).copy(r,33),r}toDER(){const t=this.r.toArrayLike(Q.Buffer,"be"),e=this.s.toArrayLike(Q.Buffer,"be"),r=[];return r.push(2,t.length),Array.from(t).forEach(t=>r.push(t)),r.push(2,e.length),Array.from(e).forEach(t=>r.push(t)),r.unshift(48,r.length),Q.Buffer.from(r)}toScriptSignature(t){const e=Q.Buffer.alloc(1);return e.writeUInt8(t,0),Q.Buffer.concat([this.toDER(),e])}}function Eo(t,e,r,i){const n=new Gi(e),o=new Gi(t.n.toString()),s=t.g;let a,f;if(function(t,e,r,i,n){if(wo("Buffer",e),wo(Gi,r),n&&(e=so(Q.Buffer.concat([e,Q.Buffer.alloc(n)]))),32!==e.length)throw new Error("Hash must be 256 bit");const o=r.toArrayLike(Q.Buffer,"be",32);let s=Q.Buffer.alloc(32),a=Q.Buffer.alloc(32);a.fill(1),s.fill(0),s=fo(Q.Buffer.concat([a,Q.Buffer.from([0]),o,e]),s),a=fo(a,s),s=fo(Q.Buffer.concat([a,Q.Buffer.from([1]),o,e]),s),a=fo(a,s),a=fo(a,s);let f=new Gi(a);for(;f.isNeg()||f.isZero()||f.gte(new Gi(t.n.toString()))||!i(f);)s=fo(Q.Buffer.concat([a,Q.Buffer.from([0])]),s),a=fo(a,s),a=fo(a,s),f=new Gi(a)}(t,e,r,function(t){const e=s.mul(t);if(e.isInfinity())return!1;const i=new Gi(e.getX().toString()).mod(o);if(i.isZero())return!1;const h=t.invm(o).mul(n.add(r.mul(i))).mod(o);return!h.isZero()&&(a=i,f=h,!0)},i),!a||!f)throw new Error("Unable to find valid signature");const h=o.shrn(1),u=f.gt(h)?o.sub(f):f;return new Mo(a,u)}const Ao=new ut.ec("secp256k1");class So{constructor(t,e,r){this.r=t,this.s=e,this.i=r}static fromBuffer(t){if(65!==t.length)throw new Error("Invalid signature length");const e=t.readUInt8(0);if(e-27!=(e-27&7))throw new Error("Invalid signature parameter");const r=new Gi(t.slice(1,33)),i=new Gi(t.slice(33));return new So(r,i,e)}toBuffer(){const t=Q.Buffer.alloc(65);return t.writeUInt8(this.i,0),this.r.toArrayLike(Q.Buffer,"be",32).copy(t,1),this.s.toArrayLike(Q.Buffer,"be",32).copy(t,33),t}static signBuffer(t,e){const r=so(t);return So.signBufferSha256(r,e)}static signBufferSha256(t,e){if(32!==t.length||!Q.Buffer.isBuffer(t))throw new Error("buf_sha256: 32 byte buffer required");const r="string"==typeof e?vo.fromWif(e):e;if(!r)throw new Error("private_key required");const i=r.d;let n,o=0;for(;;){n=Eo(Ao,t,i,o++);const e=n.r.toArrayLike(Q.Buffer,"be",32),r=n.s.toArrayLike(Q.Buffer,"be",32);if(!(128&e[0]||0===e[0]&&!(128&e[1])||128&r[0]||0===r[0]&&!(128&r[1])))break}const s=function(t,e,r,i){for(let n=0;n<4;n++)try{if(t.recoverPubKey(e,r,n).eq(i))return n}catch(t){t.message}throw r.r.toString(16),r.s.toString(16),i.getX().toString(16),i.getY().toString(16),new Error("Unable to find valid recovery factor")}(Ao,new Gi(t),n,r.toPublic().Q);return new So(n.r,n.s,s+27)}static isCanonical(t,e){return!(128&t[0]||0===t[0]&&!(128&t[1])||128&e[0]||0===e[0]&&!(128&e[1]))}static sign(t,e){return So.signBuffer(Q.Buffer.from(t),e)}verifyBuffer(t,e){const r=so(t);return this.verifyHash(r,e)}verifyHash(t,e){if(32!==t.length)throw new Error("A SHA 256 should be 32 bytes long, instead got "+t.length);const r=new Gi(t),i=new Gi(Ao.n.toString()),n=Ao.g,o=e.Q;if(!o)throw new Error("Invalid public key");if(this.r.isNeg()||this.r.isZero()||this.r.gte(i))return!1;if(this.s.isNeg()||this.s.isZero()||this.s.gte(i))return!1;const s=this.s.invm(i),a=r.mul(s).mod(i),f=this.r.mul(s).mod(i),h=n.mul(a).add(o.mul(f));if(h.isInfinity())return!1;return h.getX().mod(i).eq(this.r)}static fromHex(t){return So.fromBuffer(Q.Buffer.from(t,"hex"))}toHex(){return this.toBuffer().toString("hex")}}class Io{constructor(t){this.addy=t}static fromBuffer(t){const e=t.subarray(-4),r=t.subarray(0,-4),i=ho(r).subarray(0,4);if(!e.equals(i))throw new Error("Invalid address checksum");return M().get("address_prefix")+uo.encode(r)}static fromString(t){const e=M().get("address_prefix")||"STM";if(!t.startsWith(e))throw new Error(`Expecting address to begin with ${e}`);const r=t.slice(e.length),i=uo.decode(r),n=i.subarray(-4),o=ho(i.subarray(0,-4)).subarray(0,4);if(!n.equals(o))throw new Error("Invalid address checksum");return i}static fromPublicKey(t,e=!0){const r=t.toBuffer(e),i=ho(r).subarray(0,4),n=Q.Buffer.concat([r,i]);return M().get("address_prefix")+uo.encode(n)}static fromPublic(t,e=!0,r=56){const i=ho(so(t.toBuffer(e))),n=Q.Buffer.alloc(1);n.writeUInt8(255&r,0);const o=Q.Buffer.concat([n,i]);let s=so(o);s=so(s);const a=Q.Buffer.concat([o,s.subarray(0,4)]);return new Io(ho(a))}static toBuffer(t){return Io.fromString(t)}toBuffer(){return this.addy}getVersion(){return this.addy[0]}toString(t=String(M().get("address_prefix"))||"STM"){const e=ho(this.addy).subarray(0,4),r=Q.Buffer.concat([this.addy,e]);return t+uo.encode(r)}}function Bo(t){if("undefined"!=typeof crypto&&crypto.getRandomValues){const e=new Uint8Array(t);return crypto.getRandomValues(e),Q.Buffer.from(e)}try{const e="undefined"!=typeof require?require("crypto"):null;if(e&&"function"==typeof e.randomBytes)return e.randomBytes(t)}catch{}throw new Error("Random bytes generation is not available. This library requires either Web Crypto API (browser/Node.js 18+) or Node.js crypto module.")}let xo=null;function To(){return xo||(xo=Q.Buffer.from("3b3b081e46ea808d5a96b08c4bc5003f5e15767090f344faab531ec57565136b","hex")),xo}function Lo(t,e,r,i,n){const o=Q.Buffer.concat([Q.Buffer.from(t),Q.Buffer.from(e),Q.Buffer.from(r),Q.Buffer.from(i)]),s=Q.Buffer.from(ro(o)),a=Q.Buffer.concat([To(),s,n]);return Q.Buffer.from(ro(a))}function ko(t,e,r){if(!t.params)throw new Error("Unable to sign a request without params");const i=Q.Buffer.from(JSON.stringify(t.params),"utf8").toString("base64"),n=Bo(8),o=n.toString("hex"),s=(new Date).toISOString(),a=Lo(s,e,t.method,i,n),f=[];for(const t of r){const e=vo.fromWif(t),r=So.signBufferSha256(a,e);f.push(r.toHex())}return{jsonrpc:"2.0",method:t.method,id:t.id,params:{__signed:{account:e,nonce:o,params:i,signatures:f,timestamp:s}}}}new Proxy({},{get(t,e){const r=To(),i=r[e];return"function"==typeof i?i.bind(r):i},has:(t,e)=>e in To(),ownKeys(t){const e=To();return Object.keys(e)},getOwnPropertyDescriptor(t,e){const r=To();return Object.getOwnPropertyDescriptor(r,e)}});var No=Object.freeze({__proto__:null,sign:ko,validate:async function(t,e){if("2.0"!==t.jsonrpc||"string"!=typeof t.method)throw new Error("Invalid JSON RPC Request");if(null==t.params||null==t.params.__signed)throw new Error("Signed payload missing");if(1!==Object.keys(t.params).length)throw new Error("Invalid request params");const r=t.params.__signed;if(null==r.account)throw new Error("Missing account");let i;try{const t=Q.Buffer.from(r.params,"base64").toString("utf8");i=JSON.parse(t)}catch(t){const e=t instanceof Error?t.message:String(t);throw new Error(`Invalid encoded params: ${e}`)}if(null==r.nonce||"string"!=typeof r.nonce)throw new Error("Invalid nonce");const n=Q.Buffer.from(r.nonce,"hex");if(8!==n.length)throw new Error("Invalid nonce");const o=Date.parse(r.timestamp);if(Number.isNaN(o))throw new Error("Invalid timestamp");if(Date.now()-o>6e4)throw new Error("Signature expired");const s=Lo(r.timestamp,r.account,t.method,r.params,n);try{await e(s,r.signatures,r.account)}catch(t){const e=t instanceof Error?t.message:String(t);throw new Error(`Verification failed: ${e}`)}return i}});const Ro=[{api:"database_api",method:"set_subscribe_callback",params:["callback","clearFilter"]},{api:"database_api",method:"set_pending_transaction_callback",params:["cb"]},{api:"database_api",method:"set_block_applied_callback",params:["cb"]},{api:"database_api",method:"cancel_all_subscriptions"},{api:"database_api",method:"get_trending_tags",params:["afterTag","limit"]},{api:"database_api",method:"get_tags_used_by_author",params:["author"]},{api:"database_api",method:"get_post_discussions_by_payout",params:["query"]},{api:"database_api",method:"get_comment_discussions_by_payout",params:["query"]},{api:"database_api",method:"get_discussions_by_trending",params:["query"]},{api:"database_api",method:"get_discussions_by_trending30",params:["query"]},{api:"database_api",method:"get_discussions_by_created",params:["query"]},{api:"database_api",method:"get_discussions_by_active",params:["query"]},{api:"database_api",method:"get_discussions_by_cashout",params:["query"]},{api:"database_api",method:"get_discussions_by_payout",params:["query"]},{api:"database_api",method:"get_discussions_by_votes",params:["query"]},{api:"database_api",method:"get_discussions_by_children",params:["query"]},{api:"database_api",method:"get_discussions_by_hot",params:["query"]},{api:"database_api",method:"get_discussions_by_feed",params:["query"]},{api:"database_api",method:"get_discussions_by_blog",params:["query"]},{api:"database_api",method:"get_discussions_by_comments",params:["query"]},{api:"database_api",method:"get_discussions_by_promoted",params:["query"]},{api:"database_api",method:"get_block_header",params:["blockNum"]},{api:"database_api",method:"get_block",params:["blockNum"]},{api:"database_api",method:"get_ops_in_block",params:["blockNum","onlyVirtual"]},{api:"database_api",method:"get_state",params:["path"]},{api:"database_api",method:"get_trending_categories",params:["after","limit"]},{api:"database_api",method:"get_best_categories",params:["after","limit"]},{api:"database_api",method:"get_active_categories",params:["after","limit"]},{api:"database_api",method:"get_recent_categories",params:["after","limit"]},{api:"database_api",method:"get_config"},{api:"database_api",method:"get_dynamic_global_properties"},{api:"database_api",method:"get_chain_properties"},{api:"database_api",method:"get_feed_history"},{api:"database_api",method:"get_current_median_history_price"},{api:"database_api",method:"get_witness_schedule"},{api:"database_api",method:"get_hardfork_version"},{api:"database_api",method:"get_next_scheduled_hardfork"},{api:"account_by_key_api",method:"get_key_references",params:["key"]},{api:"database_api",method:"get_accounts",params:["names"]},{api:"database_api",method:"get_account_references",params:["accountId"]},{api:"database_api",method:"lookup_account_names",params:["accountNames"]},{api:"database_api",method:"lookup_accounts",params:["lowerBoundName","limit"]},{api:"database_api",method:"get_account_count"},{api:"database_api",method:"get_conversion_requests",params:["accountName"]},{api:"database_api",method:"get_account_history",params:["account","from","limit"]},{api:"database_api",method:"get_owner_history",params:["account"]},{api:"database_api",method:"get_recovery_request",params:["account"]},{api:"follow_api",method:"get_followers",params:["following","startFollower","followType","limit"]},{api:"follow_api",method:"get_following",params:["follower","startFollowing","followType","limit"]},{api:"follow_api",method:"get_follow_count",params:["account"]},{api:"follow_api",method:"get_feed_entries",params:["account","entryId","limit"]},{api:"follow_api",method:"get_feed",params:["account","entryId","limit"]},{api:"follow_api",method:"get_blog_entries",params:["account","entryId","limit"]},{api:"follow_api",method:"get_blog",params:["account","entryId","limit"]},{api:"follow_api",method:"get_account_reputations",params:["lowerBoundName","limit"]},{api:"follow_api",method:"get_reblogged_by",params:["author","permlink"]},{api:"database_api",method:"get_content",params:["author","permlink"]},{api:"database_api",method:"get_account_notifications",params:["account","from","limit"]},{api:"database_api",method:"get_account_reputation",params:["account"]},{api:"database_api",method:"get_escrow",params:["from","escrowId"]},{api:"database_api",method:"get_withdraw_routes",params:["account","withdrawRouteType"]},{api:"database_api",method:"get_account_bandwidth",params:["account","bandwidthType"]},{api:"database_api",method:"get_savings_withdraw_from",params:["account"]},{api:"database_api",method:"get_savings_withdraw_to",params:["account"]},{api:"database_api",method:"get_order_book",params:["limit"]},{api:"database_api",method:"get_open_orders",params:["owner"]},{api:"database_api",method:"get_liquidity_queue",params:["startAccount","limit"]},{api:"database_api",method:"get_transaction_hex",params:["trx"]},{api:"database_api",method:"get_transaction",params:["trxId"]},{api:"database_api",method:"get_required_signatures",params:["trx","availableKeys"]},{api:"database_api",method:"get_potential_signatures",params:["trx"]},{api:"database_api",method:"verify_authority",params:["trx"]},{api:"database_api",method:"verify_account_authority",params:["nameOrId","signers"]},{api:"database_api",method:"get_active_votes",params:["author","permlink"]},{api:"database_api",method:"get_account_votes",params:["voter"]},{api:"database_api",method:"get_content_replies",params:["author","permlink"]},{api:"database_api",method:"get_discussions_by_author_before_date",params:["author","startPermlink","beforeDate","limit"]},{api:"database_api",method:"get_replies_by_last_update",params:["startAuthor","startPermlink","limit"]},{api:"database_api",method:"get_witnesses",params:["witnessIds"]},{api:"database_api",method:"get_witness_by_account",params:["accountName"]},{api:"database_api",method:"get_witnesses_by_vote",params:["from","limit"]},{api:"database_api",method:"lookup_witness_accounts",params:["lowerBoundName","limit"]},{api:"database_api",method:"get_witness_count"},{api:"database_api",method:"get_active_witnesses"},{api:"database_api",method:"get_miner_queue"},{api:"database_api",method:"get_reward_fund",params:["name"]},{api:"database_api",method:"get_vesting_delegations",params:["account","from","limit"]},{api:"login_api",method:"login",params:["username","password"]},{api:"login_api",method:"get_api_by_name",params:["database_api"]},{api:"login_api",method:"get_version"},{api:"follow_api",method:"get_blog_authors",params:["blogAccount"]},{api:"network_broadcast_api",method:"broadcast_transaction",params:["trx"]},{api:"network_broadcast_api",method:"broadcast_transaction_with_callback",params:["confirmationCallback","trx"]},{api:"network_broadcast_api",method:"broadcast_transaction_synchronous",params:["trx"]},{api:"network_broadcast_api",method:"broadcast_block",params:["b"]},{api:"network_broadcast_api",method:"set_max_block_age",params:["maxBlockAge"]},{api:"market_history_api",method:"get_ticker",params:[]},{api:"market_history_api",method:"get_volume",params:[]},{api:"market_history_api",method:"get_order_book",method_name:"getMarketOrderBook",params:["limit"]},{api:"market_history_api",method:"get_trade_history",params:["start","end","limit"]},{api:"market_history_api",method:"get_recent_trades",params:["limit"]},{api:"market_history_api",method:"get_market_history",params:["bucket_seconds","start","end"]},{api:"market_history_api",method:"get_market_history_buckets",params:[]},{api:"condenser_api",method:"find_proposals",params:["id_set"]},{api:"condenser_api",method:"list_proposals",params:["start","limit","order_by","order_direction","status"]},{api:"condenser_api",method:"list_proposal_votes",params:["start","limit","order_by","order_direction","status"]},{api:"condenser_api",method:"get_nai_pool",params:[]},{api:"rc_api",method:"find_rc_accounts",params:["accounts"],is_object:!0},{api:"condenser_api",method:"get_expiring_vesting_delegations",params:["account","start","limit"]},{api:"database_api",method:"find_change_recovery_account_requests",params:["account"],is_object:!0},{api:"database_api",method:"get_escrow_by_from",params:["from","escrowId"]},{api:"database_api",method:"get_escrow_by_to",params:["to","escrowId"]},{api:"database_api",method:"get_escrow_by_agent",params:["agent","escrowId"]},{api:"database_api",method:"get_account_bandwidth_by_type",params:["account","bandwidthType"]},{api:"database_api",method:"get_account_bandwidth_by_type_and_time",params:["account","bandwidthType","time"]},{api:"database_api",method:"get_proposed_transactions",params:["account"]},{api:"database_api",method:"get_proposed_transaction",params:["account","proposalId"]},{api:"database_api",method:"get_proposed_transaction_expirations",params:["account"]},{api:"database_api",method:"get_proposed_transaction_approvals",params:["account"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_id",params:["proposalId"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_account",params:["account"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_account_and_id",params:["account","proposalId"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_account_and_time",params:["account","time"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_account_and_time_and_id",params:["account","time","proposalId"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_account_and_time_and_id_and_approver",params:["account","time","proposalId","approver"]}];var Uo={};function Oo(t,e){"boolean"==typeof e&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Po=Oo;Oo.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Oo.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Oo.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=(new Date).getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1)}var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},r),this._options.unref&&this._timer.unref(),!0},Oo.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},Oo.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},Oo.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},Oo.prototype.start=Oo.prototype.try,Oo.prototype.errors=function(){return this._errors},Oo.prototype.attempts=function(){return this._attempts},Oo.prototype.mainError=function(){if(0===this._errors.length)return null;for(var t={},e=null,r=0,i=0;i<this._errors.length;i++){var n=this._errors[i],o=n.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=n,r=s)}return e},function(t){var e=Po;t.operation=function(r){var i=t.timeouts(r);return new e(i,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},t.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],n=0;n<e.retries;n++)i.push(this.createTimeout(n,e));return t&&t.forever&&!i.length&&i.push(this.createTimeout(n,e)),i.sort(function(t,e){return t-e}),i},t.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,i=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return i=Math.min(i,e.maxTimeout)},t.wrap=function(e,r,i){if(r instanceof Array&&(i=r,r=null),!i)for(var n in i=[],e)"function"==typeof e[n]&&i.push(n);for(var o=0;o<i.length;o++){var s=i[o],a=e[s];e[s]=function(i){var n=t.operation(r),o=Array.prototype.slice.call(arguments,1),s=o.pop();o.push(function(t){n.retry(t)||(t&&(arguments[0]=n.mainError()),s.apply(this,arguments))}),n.attempt(function(){i.apply(e,o)})}.bind(e,a),e[s].options=r}}}(Uo);var qo=e(Uo);class zo extends v.EventEmitter{constructor(t={}){super(),this.id=0,this.options=t,this.id=0}setOptions(t){Object.assign(this.options,t),this.stop()}listenTo(t,e,r){const i=t;return"addEventListener"in t&&"function"==typeof i.addEventListener?(i.addEventListener(e,r),()=>{i.removeEventListener&&i.removeEventListener(e,r)}):(t.on(e,r),()=>{t.removeListener(e,r)})}send(t,e,r){}start(){return Promise.resolve()}stop(){return Promise.resolve()}}class Co extends Error{constructor(t,e,r){super(t),this.name="JsonRpcError",this.code=e,this.data=r}}const Fo=async(t,e,r=fetch,i=3e4)=>{const n={jsonrpc:"2.0",...e};let o=null;const s=new Promise((t,e)=>{o=setTimeout(()=>{e(new Error(`Request timeout after ${i}ms`))},i)}),a=r(t,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)}).then(async t=>{if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);const e=await t.json();if(e.error)throw new Co(e.error.message||"JSON-RPC error",e.error.code,e.error.data);return e.result});try{return await Promise.race([a,s])}finally{o&&clearTimeout(o)}};const jo={http:class extends zo{constructor(t){super(t)}get nonRetriableOperations(){return["broadcast_transaction","broadcast_transaction_with_callback","broadcast_transaction_synchronous","broadcast_block"]}isBroadcastOperation(t){return this.nonRetriableOperations.includes(t)}send(t,e,r){"function"!=typeof r&&(r=()=>{});const i=this.options.url;if(!i)throw new Error("HTTP transport requires a valid URL");const n=this.options.fetchMethod||fetch,o=e.id,s=[t,e.method,e.params],a=this.isBroadcastOperation(e.method),f=this.options.retry;if(!a&&f){const t="object"==typeof f?qo.operation(f):qo.operation();t.attempt(e=>{n(i,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",method:"call",params:s,id:o}),headers:{"Content-Type":"application/json"}}).then(async t=>{if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return t.json()}).then(t=>{if(t.error){const i=new Co(t.error.message||"JSON-RPC error",t.error.code,t.error.data);r(i,void 0,e)}else r(null,t.result,e)},i=>{t.retry(i)||r(t.mainError(),void 0,e)})})}else n(i,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",method:"call",params:s,id:o}),headers:{"Content-Type":"application/json"}}).then(async t=>{if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return t.json()}).then(t=>{if(t.error){const e=new Co(t.error.message||"JSON-RPC error",t.error.code,t.error.data);r(e,void 0,1)}else r(null,t.result,1)},t=>r(t instanceof Error?t:new Error(String(t)),void 0,1))}}};var Do,Ho={exports:{}},Zo={exports:{}};!function(e){!function(r,i){e&&e.exports?e.exports=function(){var e;try{Do||(Do=1,function(e){!function(t,r){e&&e.exports?e.exports=r():(t.dcodeIO=t.dcodeIO||{}).Long=r()}(t,function(){function t(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function e(t){return!0===(t&&t.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=e;var r={},i={};function n(t,e){var n,o,a;return e?(a=0<=(t>>>=0)&&t<256)&&(o=i[t])?o:(n=s(t,(0|t)<0?-1:0,!0),a&&(i[t]=n),n):(a=-128<=(t|=0)&&t<128)&&(o=r[t])?o:(n=s(t,t<0?-1:0,!1),a&&(r[t]=n),n)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?b:p;if(e){if(t<0)return b;if(t>=c)return w}else{if(t<=-d)return _;if(t+1>=d)return v}return t<0?o(-t,e).neg():s(t%u|0,t/u|0,e)}function s(e,r,i){return new t(e,r,i)}t.fromInt=n,t.fromNumber=o,t.fromBits=s;var a=Math.pow;function f(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return p;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return f(t.substring(1),e,r).neg();for(var n=o(a(r,8)),s=p,h=0;h<t.length;h+=8){var u=Math.min(8,t.length-h),c=parseInt(t.substring(h,h+u),r);if(u<8){var d=o(a(r,u));s=s.mul(d).add(o(c))}else s=(s=s.mul(n)).add(o(c))}return s.unsigned=e,s}function h(e){return e instanceof t?e:"number"==typeof e?o(e):"string"==typeof e?f(e):s(e.low,e.high,e.unsigned)}t.fromString=f,t.fromValue=h;var u=4294967296,c=u*u,d=c/2,l=n(1<<24),p=n(0);t.ZERO=p;var b=n(0,!0);t.UZERO=b;var g=n(1);t.ONE=g;var m=n(1,!0);t.UONE=m;var y=n(-1);t.NEG_ONE=y;var v=s(-1,2147483647,!1);t.MAX_VALUE=v;var w=s(-1,-1,!0);t.MAX_UNSIGNED_VALUE=w;var _=s(0,-2147483648,!1);t.MIN_VALUE=_;var M=t.prototype;return M.toInt=function(){return this.unsigned?this.low>>>0:this.low},M.toNumber=function(){return this.unsigned?(this.high>>>0)*u+(this.low>>>0):this.high*u+(this.low>>>0)},M.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(_)){var e=o(t),r=this.div(e),i=r.mul(e).sub(this);return r.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var n=o(a(t,6),this.unsigned),s=this,f="";;){var h=s.div(n),u=(s.sub(h.mul(n)).toInt()>>>0).toString(t);if((s=h).isZero())return u+f;for(;u.length<6;)u="0"+u;f=""+u+f}},M.getHighBits=function(){return this.high},M.getHighBitsUnsigned=function(){return this.high>>>0},M.getLowBits=function(){return this.low},M.getLowBitsUnsigned=function(){return this.low>>>0},M.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&!(t&1<<e);e--);return 0!=this.high?e+33:e+1},M.isZero=function(){return 0===this.high&&0===this.low},M.isNegative=function(){return!this.unsigned&&this.high<0},M.isPositive=function(){return this.unsigned||this.high>=0},M.isOdd=function(){return!(1&~this.low)},M.isEven=function(){return!(1&this.low)},M.equals=function(t){return e(t)||(t=h(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},M.eq=M.equals,M.notEquals=function(t){return!this.eq(t)},M.neq=M.notEquals,M.lessThan=function(t){return this.comp(t)<0},M.lt=M.lessThan,M.lessThanOrEqual=function(t){return this.comp(t)<=0},M.lte=M.lessThanOrEqual,M.greaterThan=function(t){return this.comp(t)>0},M.gt=M.greaterThan,M.greaterThanOrEqual=function(t){return this.comp(t)>=0},M.gte=M.greaterThanOrEqual,M.compare=function(t){if(e(t)||(t=h(t)),this.eq(t))return 0;var r=this.isNegative(),i=t.isNegative();return r&&!i?-1:!r&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},M.comp=M.compare,M.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(g)},M.neg=M.negate,M.add=function(t){e(t)||(t=h(t));var r=this.high>>>16,i=65535&this.high,n=this.low>>>16,o=65535&this.low,a=t.high>>>16,f=65535&t.high,u=t.low>>>16,c=0,d=0,l=0,p=0;return l+=(p+=o+(65535&t.low))>>>16,d+=(l+=n+u)>>>16,c+=(d+=i+f)>>>16,c+=r+a,s((l&=65535)<<16|(p&=65535),(c&=65535)<<16|(d&=65535),this.unsigned)},M.subtract=function(t){return e(t)||(t=h(t)),this.add(t.neg())},M.sub=M.subtract,M.multiply=function(t){if(this.isZero())return p;if(e(t)||(t=h(t)),t.isZero())return p;if(this.eq(_))return t.isOdd()?_:p;if(t.eq(_))return this.isOdd()?_:p;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(l)&&t.lt(l))return o(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,n=this.low>>>16,a=65535&this.low,f=t.high>>>16,u=65535&t.high,c=t.low>>>16,d=65535&t.low,b=0,g=0,m=0,y=0;return m+=(y+=a*d)>>>16,g+=(m+=n*d)>>>16,m&=65535,g+=(m+=a*c)>>>16,b+=(g+=i*d)>>>16,g&=65535,b+=(g+=n*c)>>>16,g&=65535,b+=(g+=a*u)>>>16,b+=r*d+i*c+n*u+a*f,s((m&=65535)<<16|(y&=65535),(b&=65535)<<16|(g&=65535),this.unsigned)},M.mul=M.multiply,M.divide=function(t){if(e(t)||(t=h(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?b:p;var r,i,n;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return b;if(t.gt(this.shru(1)))return m;n=b}else{if(this.eq(_))return t.eq(g)||t.eq(y)?_:t.eq(_)?g:(r=this.shr(1).div(t).shl(1)).eq(p)?t.isNegative()?g:y:(i=this.sub(t.mul(r)),n=r.add(i.div(t)));if(t.eq(_))return this.unsigned?b:p;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();n=p}for(i=this;i.gte(t);){r=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),f=s<=48?1:a(2,s-48),u=o(r),c=u.mul(t);c.isNegative()||c.gt(i);)c=(u=o(r-=f,this.unsigned)).mul(t);u.isZero()&&(u=g),n=n.add(u),i=i.sub(c)}return n},M.div=M.divide,M.modulo=function(t){return e(t)||(t=h(t)),this.sub(this.div(t).mul(t))},M.mod=M.modulo,M.not=function(){return s(~this.low,~this.high,this.unsigned)},M.and=function(t){return e(t)||(t=h(t)),s(this.low&t.low,this.high&t.high,this.unsigned)},M.or=function(t){return e(t)||(t=h(t)),s(this.low|t.low,this.high|t.high,this.unsigned)},M.xor=function(t){return e(t)||(t=h(t)),s(this.low^t.low,this.high^t.high,this.unsigned)},M.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?s(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):s(0,this.low<<t-32,this.unsigned)},M.shl=M.shiftLeft,M.shiftRight=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?s(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):s(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},M.shr=M.shiftRight,M.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0==(t&=63))return this;var r=this.high;return t<32?s(this.low>>>t|r<<32-t,r>>>t,this.unsigned):s(32===t?r:r>>>t-32,0,this.unsigned)},M.shru=M.shiftRightUnsigned,M.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},M.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},M.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},M.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},M.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t})}(Zo)),e=Zo.exports}catch(t){}return i(e)}():(r.dcodeIO=r.dcodeIO||{}).ByteBuffer=i(r.dcodeIO.Long)}(t,function(t){var e=function(t,r,n){if(void 0===t&&(t=e.DEFAULT_CAPACITY),void 0===r&&(r=e.DEFAULT_ENDIAN),void 0===n&&(n=e.DEFAULT_NOASSERT),!n){if((t|=0)<0)throw RangeError("Illegal capacity");r=!!r,n=!!n}this.buffer=0===t?i:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=r,this.noAssert=n};e.VERSION="5.0.1",e.LITTLE_ENDIAN=!0,e.BIG_ENDIAN=!1,e.DEFAULT_CAPACITY=16,e.DEFAULT_ENDIAN=e.BIG_ENDIAN,e.DEFAULT_NOASSERT=!1,e.Long=t||null;var r=e.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var i=new ArrayBuffer(0),n=String.fromCharCode;function o(t){var e=0;return function(){return e<t.length?t.charCodeAt(e++):null}}function s(){var t=[],e=[];return function(){if(0===arguments.length)return e.join("")+n.apply(String,t);t.length+arguments.length>1024&&(e.push(n.apply(String,t)),t.length=0),Array.prototype.push.apply(t,arguments)}}function a(t,e,r,i,n){var o,s,a=8*n-i-1,f=(1<<a)-1,h=f>>1,u=-7,c=r?n-1:0,d=r?-1:1,l=t[e+c];for(c+=d,o=l&(1<<-u)-1,l>>=-u,u+=a;u>0;o=256*o+t[e+c],c+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+t[e+c],c+=d,u-=8);if(0===o)o=1-h;else{if(o===f)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,i),o-=h}return(l?-1:1)*s*Math.pow(2,o-i)}function f(t,e,r,i,n,o){var s,a,f,h=8*o-n-1,u=(1<<h)-1,c=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:o-1,p=i?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),(e+=s+c>=1?d/f:d*Math.pow(2,1-c))*f>=2&&(s++,f/=2),s+c>=u?(a=0,s=u):s+c>=1?(a=(e*f-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[r+l]=255&a,l+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;t[r+l]=255&s,l+=p,s/=256,h-=8);t[r+l-p]|=128*b}e.accessor=function(){return Uint8Array},e.allocate=function(t,r,i){return new e(t,r,i)},e.concat=function(t,r,i,n){"boolean"!=typeof r&&"string"==typeof r||(n=i,i=r,r=void 0);for(var o,s=0,a=0,f=t.length;a<f;++a)e.isByteBuffer(t[a])||(t[a]=e.wrap(t[a],r)),(o=t[a].limit-t[a].offset)>0&&(s+=o);if(0===s)return new e(0,i,n);var h,u=new e(s,i,n);for(a=0;a<f;)(o=(h=t[a++]).limit-h.offset)<=0||(u.view.set(h.view.subarray(h.offset,h.limit),u.offset),u.offset+=o);return u.limit=u.offset,u.offset=0,u},e.isByteBuffer=function(t){return!0===(t&&t.__isByteBuffer__)},e.type=function(){return ArrayBuffer},e.wrap=function(t,i,n,o){if("string"!=typeof i&&(o=n,n=i,i=void 0),"string"==typeof t)switch(void 0===i&&(i="utf8"),i){case"base64":return e.fromBase64(t,n);case"hex":return e.fromHex(t,n);case"binary":return e.fromBinary(t,n);case"utf8":return e.fromUTF8(t,n);case"debug":return e.fromDebug(t,n);default:throw Error("Unsupported encoding: "+i)}if(null===t||"object"!=typeof t)throw TypeError("Illegal buffer");var s;if(e.isByteBuffer(t))return(s=r.clone.call(t)).markedOffset=-1,s;if(t instanceof Uint8Array)s=new e(0,n,o),t.length>0&&(s.buffer=t.buffer,s.offset=t.byteOffset,s.limit=t.byteOffset+t.byteLength,s.view=new Uint8Array(t.buffer));else if(t instanceof ArrayBuffer)s=new e(0,n,o),t.byteLength>0&&(s.buffer=t,s.offset=0,s.limit=t.byteLength,s.view=t.byteLength>0?new Uint8Array(t):null);else{if("[object Array]"!==Object.prototype.toString.call(t))throw TypeError("Illegal buffer");(s=new e(t.length,n,o)).limit=t.length;for(var a=0;a<t.length;++a)s.view[a]=t[a]}return s},r.writeBitSet=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if(!(t instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var i,n=e,o=t.length,s=o>>3,a=0;for(e+=this.writeVarint32(o,e);s--;)i=1&!!t[a++]|(1&!!t[a++])<<1|(1&!!t[a++])<<2|(1&!!t[a++])<<3|(1&!!t[a++])<<4|(1&!!t[a++])<<5|(1&!!t[a++])<<6|(1&!!t[a++])<<7,this.writeByte(i,e++);if(a<o){var f=0;for(i=0;a<o;)i|=(1&!!t[a++])<<f++;this.writeByte(i,e++)}return r?(this.offset=e,this):e-n},r.readBitSet=function(t){var e=void 0===t;e&&(t=this.offset);var r,i=this.readVarint32(t),n=i.value,o=n>>3,s=0,a=[];for(t+=i.length;o--;)r=this.readByte(t++),a[s++]=!!(1&r),a[s++]=!!(2&r),a[s++]=!!(4&r),a[s++]=!!(8&r),a[s++]=!!(16&r),a[s++]=!!(32&r),a[s++]=!!(64&r),a[s++]=!!(128&r);if(s<n){var f=0;for(r=this.readByte(t++);s<n;)a[s++]=!!(r>>f++&1)}return e&&(this.offset=t),a},r.readBytes=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+t+") <= "+this.buffer.byteLength)}var i=this.slice(e,e+t);return r&&(this.offset+=t),i},r.writeBytes=r.append,r.writeInt8=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=1,this.view[e]=t,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=this.view[t];return 128&~r||(r=-(255-r+1)),e&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=1,this.view[e]=t,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=this.view[t];return e&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t],r|=this.view[t+1]<<8):(r=this.view[t]<<8,r|=this.view[t+1]),32768&~r||(r=-(65535-r+1)),e&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),r&&(this.offset+=2),this},r.writeUInt16=r.writeUint16,r.readUint16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t],r|=this.view[t+1]<<8):(r=this.view[t]<<8,r|=this.view[t+1]),e&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),r|=0,e&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),e&&(this.offset+=4),r},r.readUInt32=r.readUint32,t&&(r.writeInt64=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),r+=8;var n=this.buffer.byteLength;r>n&&this.resize((n*=2)>r?n:r),r-=8;var o=e.low,s=e.high;return this.littleEndian?(this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o,r+=4,this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s):(this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s,r+=4,this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o),i&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var i=0,n=0;this.littleEndian?(i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0,e+=4,n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0,e+=4,i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0);var o=new t(i,n,!1);return r&&(this.offset+=8),o},r.readLong=r.readInt64,r.writeUint64=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),r+=8;var n=this.buffer.byteLength;r>n&&this.resize((n*=2)>r?n:r),r-=8;var o=e.low,s=e.high;return this.littleEndian?(this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o,r+=4,this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s):(this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s,r+=4,this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o),i&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var i=0,n=0;this.littleEndian?(i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0,e+=4,n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0,e+=4,i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0);var o=new t(i,n,!0);return r&&(this.offset+=8),o},r.readUInt64=r.readUint64),r.writeFloat32=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=4,f(this.view,t,e,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var r=a(this.view,t,this.littleEndian,23,4);return e&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=8;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=8,f(this.view,t,e,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=a(this.view,t,this.littleEndian,52,8);return e&&(this.offset+=8),r},r.readDouble=r.readFloat64,e.MAX_VARINT32_BYTES=5,e.calculateVarint32=function(t){return(t>>>=0)<128?1:t<16384?2:t<1<<21?3:t<1<<28?4:5},e.zigZagEncode32=function(t){return((t|=0)<<1^t>>31)>>>0},e.zigZagDecode32=function(t){return t>>>1^-(1&t)},r.writeVarint32=function(t,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var n,o=e.calculateVarint32(t);r+=o;var s=this.buffer.byteLength;for(r>s&&this.resize((s*=2)>r?s:r),r-=o,t>>>=0;t>=128;)n=127&t|128,this.view[r++]=n,t>>>=7;return this.view[r++]=t,i?(this.offset=r,this):o},r.writeVarint32ZigZag=function(t,r){return this.writeVarint32(e.zigZagEncode32(t),r)},r.readVarint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r,i=0,n=0;do{if(!this.noAssert&&t>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}r=this.view[t++],i<5&&(n|=(127&r)<<7*i),++i}while(128&r);return n|=0,e?(this.offset=t,n):{value:n,length:i}},r.readVarint32ZigZag=function(t){var r=this.readVarint32(t);return"object"==typeof r?r.value=e.zigZagDecode32(r.value):r=e.zigZagDecode32(r),r},t&&(e.MAX_VARINT64_BYTES=10,e.calculateVarint64=function(e){"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e));var r=e.toInt()>>>0,i=e.shiftRightUnsigned(28).toInt()>>>0,n=e.shiftRightUnsigned(56).toInt()>>>0;return 0==n?0==i?r<16384?r<128?1:2:r<1<<21?3:4:i<16384?i<128?5:6:i<1<<21?7:8:n<128?9:10},e.zigZagEncode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()},e.zigZagDecode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftRightUnsigned(1).xor(e.and(t.ONE).toSigned().negate()).toSigned()},r.writeVarint64=function(r,i){var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"==typeof r)r=t.fromNumber(r);else if("string"==typeof r)r=t.fromString(r);else if(!(r&&r instanceof t))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=t.fromNumber(r,!1):"string"==typeof r?r=t.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var o=e.calculateVarint64(r),s=r.toInt()>>>0,a=r.shiftRightUnsigned(28).toInt()>>>0,f=r.shiftRightUnsigned(56).toInt()>>>0;i+=o;var h=this.buffer.byteLength;switch(i>h&&this.resize((h*=2)>i?h:i),i-=o,o){case 10:this.view[i+9]=f>>>7&1;case 9:this.view[i+8]=9!==o?128|f:127&f;case 8:this.view[i+7]=8!==o?a>>>21|128:a>>>21&127;case 7:this.view[i+6]=7!==o?a>>>14|128:a>>>14&127;case 6:this.view[i+5]=6!==o?a>>>7|128:a>>>7&127;case 5:this.view[i+4]=5!==o?128|a:127&a;case 4:this.view[i+3]=4!==o?s>>>21|128:s>>>21&127;case 3:this.view[i+2]=3!==o?s>>>14|128:s>>>14&127;case 2:this.view[i+1]=2!==o?s>>>7|128:s>>>7&127;case 1:this.view[i]=1!==o?128|s:127&s}return n?(this.offset+=o,this):o},r.writeVarint64ZigZag=function(t,r){return this.writeVarint64(e.zigZagEncode64(t),r)},r.readVarint64=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i=e,n=0,o=0,s=0,a=0;if(n=127&(a=this.view[e++]),128&a&&(n|=(127&(a=this.view[e++]))<<7,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[e++]))<<14,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[e++]))<<21,(128&a||this.noAssert&&void 0===a)&&(o=127&(a=this.view[e++]),(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[e++]))<<7,(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[e++]))<<14,(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[e++]))<<21,(128&a||this.noAssert&&void 0===a)&&(s=127&(a=this.view[e++]),(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[e++]))<<7,128&a||this.noAssert&&void 0===a))))))))))throw Error("Buffer overrun");var f=t.fromBits(n|o<<28,o>>>4|s<<24,!1);return r?(this.offset=e,f):{value:f,length:e-i}},r.readVarint64ZigZag=function(r){var i=this.readVarint64(r);return i&&i.value instanceof t?i.value=e.zigZagDecode64(i.value):i=e.zigZagDecode64(i),i}),r.writeCString=function(t,e){var r=void 0===e;r&&(e=this.offset);var i,n=t.length;if(!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");for(i=0;i<n;++i)if(0===t.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}n=u.calculateUTF16asUTF8(o(t))[1],e+=n+1;var s=this.buffer.byteLength;return e>s&&this.resize((s*=2)>e?s:e),e-=n+1,u.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),this.view[e++]=0,r?(this.offset=e,this):n},r.readCString=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r,i=t,n=-1;return u.decodeUTF8toUTF16(function(){if(0===n)return null;if(t>=this.limit)throw RangeError("Illegal range: Truncated data, "+t+" < "+this.limit);return 0===(n=this.view[t++])?null:n}.bind(this),r=s(),!0),e?(this.offset=t,r()):{string:r(),length:t-i}},r.writeIString=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var i,n=e;i=u.calculateUTF16asUTF8(o(t),this.noAssert)[1],e+=4+i;var s=this.buffer.byteLength;if(e>s&&this.resize((s*=2)>e?s:e),e-=4+i,this.littleEndian?(this.view[e+3]=i>>>24&255,this.view[e+2]=i>>>16&255,this.view[e+1]=i>>>8&255,this.view[e]=255&i):(this.view[e]=i>>>24&255,this.view[e+1]=i>>>16&255,this.view[e+2]=i>>>8&255,this.view[e+3]=255&i),e+=4,u.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),e!==n+4+i)throw RangeError("Illegal range: Truncated data, "+e+" == "+(e+4+i));return r?(this.offset=e,this):e-n},r.readIString=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var i=t,n=this.readUint32(t),o=this.readUTF8String(n,e.METRICS_BYTES,t+=4);return t+=o.length,r?(this.offset=t,o.string):{string:o.string,length:t-i}},e.METRICS_CHARS="c",e.METRICS_BYTES="b",r.writeUTF8String=function(t,e){var r,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var n=e;r=u.calculateUTF16asUTF8(o(t))[1],e+=r;var s=this.buffer.byteLength;return e>s&&this.resize((s*=2)>e?s:e),e-=r,u.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),i?(this.offset=e,this):e-n},r.writeString=r.writeUTF8String,e.calculateUTF8Chars=function(t){return u.calculateUTF16asUTF8(o(t))[0]},e.calculateUTF8Bytes=function(t){return u.calculateUTF16asUTF8(o(t))[1]},e.calculateString=e.calculateUTF8Bytes,r.readUTF8String=function(t,r,i){"number"==typeof r&&(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),void 0===r&&(r=e.METRICS_CHARS),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");if(t|=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var o,a=0,f=i;if(r===e.METRICS_CHARS){if(o=s(),u.decodeUTF8(function(){return a<t&&i<this.limit?this.view[i++]:null}.bind(this),function(t){++a,u.UTF8toUTF16(t,o)}),a!==t)throw RangeError("Illegal range: Truncated data, "+a+" == "+t);return n?(this.offset=i,o()):{string:o(),length:i-f}}if(r===e.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+"+t+") <= "+this.buffer.byteLength)}var h=i+t;if(u.decodeUTF8toUTF16(function(){return i<h?this.view[i++]:null}.bind(this),o=s(),this.noAssert),i!==h)throw RangeError("Illegal range: Truncated data, "+i+" == "+h);return n?(this.offset=i,o()):{string:o(),length:i-f}}throw TypeError("Unsupported metrics: "+r)},r.readString=r.readUTF8String,r.writeVString=function(t,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var n,s,a=r;n=u.calculateUTF16asUTF8(o(t),this.noAssert)[1],s=e.calculateVarint32(n),r+=s+n;var f=this.buffer.byteLength;if(r>f&&this.resize((f*=2)>r?f:r),r-=s+n,r+=this.writeVarint32(n,r),u.encodeUTF16toUTF8(o(t),function(t){this.view[r++]=t}.bind(this)),r!==a+n+s)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+n+s));return i?(this.offset=r,this):r-a},r.readVString=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i=t,n=this.readVarint32(t),o=this.readUTF8String(n.value,e.METRICS_BYTES,t+=n.length);return t+=o.length,r?(this.offset=t,o.string):{string:o.string,length:t-i}},r.append=function(t,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}t instanceof e||(t=e.wrap(t,r));var o=t.limit-t.offset;if(o<=0)return this;i+=o;var s=this.buffer.byteLength;return i>s&&this.resize((s*=2)>i?s:i),i-=o,this.view.set(t.view.subarray(t.offset,t.limit),i),t.offset+=o,n&&(this.offset+=o),this},r.appendTo=function(t,e){return t.append(this,e),this},r.assert=function(t){return this.noAssert=!t,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(t){var r=new e(0,this.littleEndian,this.noAssert);return t?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}if(0===t&&e===this.buffer.byteLength)return this;var r=e-t;if(0===r)return this.buffer=i,this.view=null,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=0,this;var n=new ArrayBuffer(r),o=new Uint8Array(n);return o.set(this.view.subarray(t,e)),this.buffer=n,this.view=o,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=r,this},r.copy=function(t,r){if(void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t===r)return new e(0,this.littleEndian,this.noAssert);var i=r-t,n=new e(i,this.littleEndian,this.noAssert);return n.offset=0,n.limit=i,n.markedOffset>=0&&(n.markedOffset-=t),this.copyTo(n,0,t,r),n},r.copyTo=function(t,r,i,n){var o,s;if(!this.noAssert&&!e.isByteBuffer(t))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(s=void 0===r)?t.offset:0|r,i=(o=void 0===i)?this.offset:0|i,n=void 0===n?this.limit:0|n,r<0||r>t.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+t.buffer.byteLength);if(i<0||n>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+i+" <= "+this.buffer.byteLength);var a=n-i;return 0===a?t:(t.ensureCapacity(r+a),t.view.set(this.view.subarray(i,n),r),o&&(this.offset+=a),s&&(t.offset+=a),this)},r.ensureCapacity=function(t){var e=this.buffer.byteLength;return e<t?this.resize((e*=2)>t?e:t):this},r.fill=function(t,e,r){var i=void 0===e;if(i&&(e=this.offset),"string"==typeof t&&t.length>0&&(t=t.charCodeAt(0)),void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e>=r)return this;for(;e<r;)this.view[e++]=t;return i&&(this.offset=e),this},r.flip=function(){return this.limit=this.offset,this.offset=0,this},r.mark=function(t){if(t=void 0===t?this.offset:t,!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=t,this},r.order=function(t){if(!this.noAssert&&"boolean"!=typeof t)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!t,this},r.LE=function(t){return this.littleEndian=void 0===t||!!t,this},r.BE=function(t){return this.littleEndian=void 0!==t&&!t,this},r.prepend=function(t,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}t instanceof e||(t=e.wrap(t,r));var o=t.limit-t.offset;if(o<=0)return this;var s=o-i;if(s>0){var a=new ArrayBuffer(this.buffer.byteLength+s),f=new Uint8Array(a);f.set(this.view.subarray(i,this.buffer.byteLength),o),this.buffer=a,this.view=f,this.offset+=s,this.markedOffset>=0&&(this.markedOffset+=s),this.limit+=s,i+=s}else new Uint8Array(this.buffer);return this.view.set(t.view.subarray(t.offset,t.limit),i-o),t.offset=t.limit,n&&(this.offset-=o),this},r.prependTo=function(t,e){return t.prepend(this,e),this},r.printDebug=function(t){"function"!=typeof t&&(t=console.log.bind(console)),t(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal capacity: "+t+" (not an integer)");if((t|=0)<0)throw RangeError("Illegal capacity: 0 <= "+t)}if(this.buffer.byteLength<t){var e=new ArrayBuffer(t),r=new Uint8Array(e);r.set(this.view),this.buffer=e,this.view=r}return this},r.reverse=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}return t===e||Array.prototype.reverse.call(this.view.subarray(t,e)),this},r.skip=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");t|=0}var e=this.offset+t;if(!this.noAssert&&(e<0||e>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+t+" <= "+this.buffer.byteLength);return this.offset=e,this},r.slice=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=t,r.limit=e,r},r.toBuffer=function(t){var e=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(!t&&0===e&&r===this.buffer.byteLength)return this.buffer;if(e===r)return i;var n=new ArrayBuffer(r-e);return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(e,r),0),n},r.toArrayBuffer=r.toBuffer,r.toString=function(t,e,r){if(void 0===t)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof t&&(r=e=t="utf8"),t){case"utf8":return this.toUTF8(e,r);case"base64":return this.toBase64(e,r);case"hex":return this.toHex(e,r);case"binary":return this.toBinary(e,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+t)}};var h=function(){for(var t={},e=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],i=0,n=e.length;i<n;++i)r[e[i]]=i;return t.encode=function(t,r){for(var i,n;null!==(i=t());)r(e[i>>2&63]),n=(3&i)<<4,null!==(i=t())?(r(e[63&((n|=i>>4&15)|i>>4&15)]),n=(15&i)<<2,null!==(i=t())?(r(e[63&(n|i>>6&3)]),r(e[63&i])):(r(e[63&n]),r(61))):(r(e[63&n]),r(61),r(61))},t.decode=function(t,e){var i,n,o;function s(t){throw Error("Illegal character code: "+t)}for(;null!==(i=t());)if(void 0===(n=r[i])&&s(i),null!==(i=t())&&(void 0===(o=r[i])&&s(i),e(n<<2>>>0|(48&o)>>4),null!==(i=t()))){if(void 0===(n=r[i])){if(61===i)break;s(i)}if(e((15&o)<<4>>>0|(60&n)>>2),null!==(i=t())){if(void 0===(o=r[i])){if(61===i)break;s(i)}e((3&n)<<6>>>0|o)}}},t.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)},t}();r.toBase64=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),e|=0,(t|=0)<0||e>this.capacity||t>e)throw RangeError("begin, end");var r;return h.encode(function(){return t<e?this.view[t++]:null}.bind(this),r=s()),r()},e.fromBase64=function(t,r){if("string"!=typeof t)throw TypeError("str");var i=new e(t.length/4*3,r),n=0;return h.decode(o(t),function(t){i.view[n++]=t}),i.limit=n,i},e.btoa=function(t){return e.fromBinary(t).toBase64()},e.atob=function(t){return e.fromBase64(t).toBinary()},r.toBinary=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),e|=0,(t|=0)<0||e>this.capacity()||t>e)throw RangeError("begin, end");if(t===e)return"";for(var r=[],i=[];t<e;)r.push(this.view[t++]),r.length>=1024&&(i.push(String.fromCharCode.apply(String,r)),r=[]);return i.join("")+String.fromCharCode.apply(String,r)},e.fromBinary=function(t,r){if("string"!=typeof t)throw TypeError("str");for(var i,n=0,o=t.length,s=new e(o,r);n<o;){if((i=t.charCodeAt(n))>255)throw RangeError("illegal char code: "+i);s.view[n++]=i}return s.limit=o,s},r.toDebug=function(t){for(var e,r=-1,i=this.buffer.byteLength,n="",o="",s="";r<i;){if(-1!==r&&(n+=(e=this.view[r])<16?"0"+e.toString(16).toUpperCase():e.toString(16).toUpperCase(),t&&(o+=e>32&&e<127?String.fromCharCode(e):".")),++r,t&&r>0&&r%16==0&&r!==i){for(;n.length<51;)n+=" ";s+=n+o+"\n",n=o=""}r===this.offset&&r===this.limit?n+=r===this.markedOffset?"!":"|":r===this.offset?n+=r===this.markedOffset?"[":"<":r===this.limit?n+=r===this.markedOffset?"]":">":n+=r===this.markedOffset?"'":t||0!==r&&r!==i?" ":""}if(t&&" "!==n){for(;n.length<51;)n+=" ";s+=n+o+"\n"}return t?s:n},e.fromDebug=function(t,r,i){for(var n,o,s=t.length,a=new e((s+1)/3|0,r,i),f=0,h=0,u=!1,c=!1,d=!1,l=!1,p=!1;f<s;){switch(n=t.charAt(f++)){case"!":if(!i){if(c||d||l){p=!0;break}c=d=l=!0}a.offset=a.markedOffset=a.limit=h,u=!1;break;case"|":if(!i){if(c||l){p=!0;break}c=l=!0}a.offset=a.limit=h,u=!1;break;case"[":if(!i){if(c||d){p=!0;break}c=d=!0}a.offset=a.markedOffset=h,u=!1;break;case"<":if(!i){if(c){p=!0;break}c=!0}a.offset=h,u=!1;break;case"]":if(!i){if(l||d){p=!0;break}l=d=!0}a.limit=a.markedOffset=h,u=!1;break;case">":if(!i){if(l){p=!0;break}l=!0}a.limit=h,u=!1;break;case"'":if(!i){if(d){p=!0;break}d=!0}a.markedOffset=h,u=!1;break;case" ":u=!1;break;default:if(!i&&u){p=!0;break}if(o=parseInt(n+t.charAt(f++),16),!i&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[h++]=o,u=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+f)}if(!i){if(!c||!l)throw TypeError("Illegal str: Missing offset or limit");if(h<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+h+" < "+s)}return a},r.toHex=function(t,e){if(t=void 0===t?this.offset:t,e=void 0===e?this.limit:e,!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}for(var r,i=new Array(e-t);t<e;)(r=this.view[t++])<16?i.push("0",r.toString(16)):i.push(r.toString(16));return i.join("")},e.fromHex=function(t,r,i){if(!i){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if(t.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var n,o=t.length,s=new e(o/2|0,r),a=0,f=0;a<o;a+=2){if(n=parseInt(t.substring(a,a+2),16),!i&&(!isFinite(n)||n<0||n>255))throw TypeError("Illegal str: Contains non-hex characters");s.view[f++]=n}return s.limit=f,s};var u=function(){var t={MAX_CODEPOINT:1114111,encodeUTF8:function(t,e){var r=null;for("number"==typeof t&&(r=t,t=function(){return null});null!==r||null!==(r=t());)r<128?e(127&r):r<2048?(e(r>>6&31|192),e(63&r|128)):r<65536?(e(r>>12&15|224),e(r>>6&63|128),e(63&r|128)):(e(r>>18&7|240),e(r>>12&63|128),e(r>>6&63|128),e(63&r|128)),r=null},decodeUTF8:function(t,e){for(var r,i,n,o,s=function(t){t=t.slice(0,t.indexOf(null));var e=Error(t.toString());throw e.name="TruncatedError",e.bytes=t,e};null!==(r=t());)if(128&r)if(192==(224&r))null===(i=t())&&s([r,i]),e((31&r)<<6|63&i);else if(224==(240&r))(null===(i=t())||null===(n=t()))&&s([r,i,n]),e((15&r)<<12|(63&i)<<6|63&n);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(i=t())||null===(n=t())||null===(o=t()))&&s([r,i,n,o]),e((7&r)<<18|(63&i)<<12|(63&n)<<6|63&o)}else e(r)},UTF16toUTF8:function(t,e){for(var r,i=null;null!==(r=null!==i?i:t());)r>=55296&&r<=57343&&null!==(i=t())&&i>=56320&&i<=57343?(e(1024*(r-55296)+i-56320+65536),i=null):e(r);null!==i&&e(i)},UTF8toUTF16:function(t,e){var r=null;for("number"==typeof t&&(r=t,t=function(){return null});null!==r||null!==(r=t());)r<=65535?e(r):(e(55296+((r-=65536)>>10)),e(r%1024+56320)),r=null},encodeUTF16toUTF8:function(e,r){t.UTF16toUTF8(e,function(e){t.encodeUTF8(e,r)})},decodeUTF8toUTF16:function(e,r){t.decodeUTF8(e,function(e){t.UTF8toUTF16(e,r)})},calculateCodePoint:function(t){return t<128?1:t<2048?2:t<65536?3:4},calculateUTF8:function(t){for(var e,r=0;null!==(e=t());)r+=e<128?1:e<2048?2:e<65536?3:4;return r},calculateUTF16asUTF8:function(e){var r=0,i=0;return t.UTF16toUTF8(e,function(t){++r,i+=t<128?1:t<2048?2:t<65536?3:4}),[r,i]}};return t}();return r.toUTF8=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var r;try{u.decodeUTF8toUTF16(function(){return t<e?this.view[t++]:null}.bind(this),r=s())}catch(r){if(t!==e)throw RangeError("Illegal range: Truncated data, "+t+" != "+e)}return r()},e.fromUTF8=function(t,r,i){if(!i&&"string"!=typeof t)throw TypeError("Illegal str: Not a string");var n=new e(u.calculateUTF16asUTF8(o(t),!0)[1],r,i),s=0;return u.encodeUTF16toUTF8(o(t),function(t){n.view[s++]=t}),n.limit=s,n},e})}(Ho);var Vo=e(Ho.exports),$o=null;try{$o=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Wo(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function Jo(t){return!0===(t&&t.__isLong__)}function Ko(t){var e=Math.clz32(t&-t);return t?31-e:e}Wo.prototype.__isLong__,Object.defineProperty(Wo.prototype,"__isLong__",{value:!0}),Wo.isLong=Jo;var Xo={},Yo={};function Go(t,e){var r,i,n;return e?(n=0<=(t>>>=0)&&t<256)&&(i=Yo[t])?i:(r=ts(t,0,!0),n&&(Yo[t]=r),r):(n=-128<=(t|=0)&&t<128)&&(i=Xo[t])?i:(r=ts(t,t<0?-1:0,!1),n&&(Xo[t]=r),r)}function Qo(t,e){if(isNaN(t))return e?hs:fs;if(e){if(t<0)return hs;if(t>=os)return ps}else{if(t<=-ss)return bs;if(t+1>=ss)return ls}return t<0?Qo(-t,e).neg():ts(t%ns|0,t/ns|0,e)}function ts(t,e,r){return new Wo(t,e,r)}Wo.fromInt=Go,Wo.fromNumber=Qo,Wo.fromBits=ts;var es=Math.pow;function rs(t,e,r){if(0===t.length)throw Error("empty string");if("number"==typeof e?(r=e,e=!1):e=!!e,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e?hs:fs;if((r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return rs(t.substring(1),e,r).neg();for(var n=Qo(es(r,8)),o=fs,s=0;s<t.length;s+=8){var a=Math.min(8,t.length-s),f=parseInt(t.substring(s,s+a),r);if(a<8){var h=Qo(es(r,a));o=o.mul(h).add(Qo(f))}else o=(o=o.mul(n)).add(Qo(f))}return o.unsigned=e,o}function is(t,e){return"number"==typeof t?Qo(t,e):"string"==typeof t?rs(t,e):ts(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}Wo.fromString=rs,Wo.fromValue=is;var ns=4294967296,os=ns*ns,ss=os/2,as=Go(1<<24),fs=Go(0);Wo.ZERO=fs;var hs=Go(0,!0);Wo.UZERO=hs;var us=Go(1);Wo.ONE=us;var cs=Go(1,!0);Wo.UONE=cs;var ds=Go(-1);Wo.NEG_ONE=ds;var ls=ts(-1,2147483647,!1);Wo.MAX_VALUE=ls;var ps=ts(-1,-1,!0);Wo.MAX_UNSIGNED_VALUE=ps;var bs=ts(0,-2147483648,!1);Wo.MIN_VALUE=bs;var gs=Wo.prototype;function ms(t,e){if(!Array.isArray(e)||2!==e.length)throw new Error("Operation must be an array of [operation_type, operation_data]");const[r,i]=e,n=function(t){const e={vote:0,comment:1,transfer:2,transfer_to_vesting:3,withdraw_vesting:4,limit_order_create:5,limit_order_cancel:6,feed_publish:7,convert:8,account_create:9,account_update:10,witness_update:11,account_witness_vote:12,account_witness_proxy:13,pow:14,custom:15,delete_comment:17,custom_json:18,comment_options:19}[t];if(void 0===e)throw new Error(`Unknown operation type: ${t}. Please add it to the operation map.`);return e}(r);t.writeVarint32(n),function(t,e,r){switch(e){case"comment":!function(t,e){const r=e;ws(t,String(r.parent_author||"")),ws(t,String(r.parent_permlink||"")),ws(t,String(r.author||"")),ws(t,String(r.permlink||"")),ws(t,String(r.title||"")),ws(t,String(r.body||"")),ws(t,String(r.json_metadata||"{}"))}(t,r);break;case"vote":!function(t,e){const r=e;ws(t,String(r.voter||"")),ws(t,String(r.author||"")),ws(t,String(r.permlink||"")),t.writeInt16(r.weight||0)}(t,r);break;case"transfer":!function(t,e){const r=e;ws(t,String(r.from||"")),ws(t,String(r.to||"")),vs(t,String(r.amount||"0.000 STEEM")),ws(t,String(r.memo||""))}(t,r);break;case"account_create":!function(t,e){const r=e;if(vs(t,String(r.fee||"0.000 STEEM")),ws(t,String(r.creator||"")),ws(t,String(r.new_account_name||"")),ys(t,r.owner),ys(t,r.active),ys(t,r.posting),"string"==typeof r.memo_key){const e=bo.fromStringOrThrow(r.memo_key);t.append(e.toBuffer())}else if(Q.Buffer.isBuffer(r.memo_key))t.append(r.memo_key);else{if(!r.memo_key||"function"!=typeof r.memo_key.toBuffer)throw new Error("Invalid memo_key format");t.append(r.memo_key.toBuffer())}ws(t,String(r.json_metadata||""))}(t,r);break;case"custom_json":!function(t,e){const r=e,i=Array.isArray(r.required_auths)?r.required_auths.slice().sort():[];t.writeVarint32(i.length);for(const e of i)ws(t,String(e));const n=Array.isArray(r.required_posting_auths)?r.required_posting_auths.slice().sort():[];t.writeVarint32(n.length);for(const e of n)ws(t,String(e));ws(t,String(r.id||"")),ws(t,String(r.json||"{}"))}(t,r);break;default:throw new Error(`Operation type ${e} serialization not fully implemented`)}}(t,r,i)}function ys(t,e){const r=e;t.writeUint32(r.weight_threshold||1);const i=Array.isArray(r.account_auths)?r.account_auths:[];i.sort((t,e)=>{const r=Array.isArray(t)&&t[0]?String(t[0]):"",i=Array.isArray(e)&&e[0]?String(e[0]):"";return r.localeCompare(i)}),t.writeVarint32(i.length);for(const e of i)Array.isArray(e)&&e.length>=2&&(ws(t,String(e[0])),t.writeUint16(e[1]));const n=Array.isArray(r.key_auths)?r.key_auths:[];n.sort((t,e)=>{const r=Array.isArray(t)&&t[0]?String(t[0]):"",i=Array.isArray(e)&&e[0]?String(e[0]):"";return r.localeCompare(i)}),t.writeVarint32(n.length);for(const e of n)if(Array.isArray(e)&&e.length>=2){const r=String(e[0]),i=e[1],n=bo.fromStringOrThrow(r);t.append(n.toBuffer()),t.writeUint16(i)}}function vs(t,e){const r=e.split(" "),i=r[0]||"0.000",n=r[1]||"STEEM",[o,s=""]=i.split("."),a=s.length,f=parseInt(o+s.padEnd(a,"0"),10)||0;t.writeInt64(f),t.writeUint8(a);const h=Q.Buffer.from(n,"utf8");t.append(h);for(let e=h.length;e<7;e++)t.writeUint8(0)}function ws(t,e){t.writeVString(e)}gs.toInt=function(){return this.unsigned?this.low>>>0:this.low},gs.toNumber=function(){return this.unsigned?(this.high>>>0)*ns+(this.low>>>0):this.high*ns+(this.low>>>0)},gs.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(bs)){var e=Qo(t),r=this.div(e),i=r.mul(e).sub(this);return r.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var n=Qo(es(t,6),this.unsigned),o=this,s="";;){var a=o.div(n),f=(o.sub(a.mul(n)).toInt()>>>0).toString(t);if((o=a).isZero())return f+s;for(;f.length<6;)f="0"+f;s=""+f+s}},gs.getHighBits=function(){return this.high},gs.getHighBitsUnsigned=function(){return this.high>>>0},gs.getLowBits=function(){return this.low},gs.getLowBitsUnsigned=function(){return this.low>>>0},gs.getNumBitsAbs=function(){if(this.isNegative())return this.eq(bs)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&!(t&1<<e);e--);return 0!=this.high?e+33:e+1},gs.isSafeInteger=function(){var t=this.high>>21;return!t||!this.unsigned&&(-1===t&&!(0===this.low&&-2097152===this.high))},gs.isZero=function(){return 0===this.high&&0===this.low},gs.eqz=gs.isZero,gs.isNegative=function(){return!this.unsigned&&this.high<0},gs.isPositive=function(){return this.unsigned||this.high>=0},gs.isOdd=function(){return!(1&~this.low)},gs.isEven=function(){return!(1&this.low)},gs.equals=function(t){return Jo(t)||(t=is(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},gs.eq=gs.equals,gs.notEquals=function(t){return!this.eq(t)},gs.neq=gs.notEquals,gs.ne=gs.notEquals,gs.lessThan=function(t){return this.comp(t)<0},gs.lt=gs.lessThan,gs.lessThanOrEqual=function(t){return this.comp(t)<=0},gs.lte=gs.lessThanOrEqual,gs.le=gs.lessThanOrEqual,gs.greaterThan=function(t){return this.comp(t)>0},gs.gt=gs.greaterThan,gs.greaterThanOrEqual=function(t){return this.comp(t)>=0},gs.gte=gs.greaterThanOrEqual,gs.ge=gs.greaterThanOrEqual,gs.compare=function(t){if(Jo(t)||(t=is(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},gs.comp=gs.compare,gs.negate=function(){return!this.unsigned&&this.eq(bs)?bs:this.not().add(us)},gs.neg=gs.negate,gs.add=function(t){Jo(t)||(t=is(t));var e=this.high>>>16,r=65535&this.high,i=this.low>>>16,n=65535&this.low,o=t.high>>>16,s=65535&t.high,a=t.low>>>16,f=0,h=0,u=0,c=0;return u+=(c+=n+(65535&t.low))>>>16,h+=(u+=i+a)>>>16,f+=(h+=r+s)>>>16,f+=e+o,ts((u&=65535)<<16|(c&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},gs.subtract=function(t){return Jo(t)||(t=is(t)),this.add(t.neg())},gs.sub=gs.subtract,gs.multiply=function(t){if(this.isZero())return this;if(Jo(t)||(t=is(t)),$o)return ts($o.mul(this.low,this.high,t.low,t.high),$o.get_high(),this.unsigned);if(t.isZero())return this.unsigned?hs:fs;if(this.eq(bs))return t.isOdd()?bs:fs;if(t.eq(bs))return this.isOdd()?bs:fs;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(as)&&t.lt(as))return Qo(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,r=65535&this.high,i=this.low>>>16,n=65535&this.low,o=t.high>>>16,s=65535&t.high,a=t.low>>>16,f=65535&t.low,h=0,u=0,c=0,d=0;return c+=(d+=n*f)>>>16,u+=(c+=i*f)>>>16,c&=65535,u+=(c+=n*a)>>>16,h+=(u+=r*f)>>>16,u&=65535,h+=(u+=i*a)>>>16,u&=65535,h+=(u+=n*s)>>>16,h+=e*f+r*a+i*s+n*o,ts((c&=65535)<<16|(d&=65535),(h&=65535)<<16|(u&=65535),this.unsigned)},gs.mul=gs.multiply,gs.divide=function(t){if(Jo(t)||(t=is(t)),t.isZero())throw Error("division by zero");var e,r,i;if($o)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?ts((this.unsigned?$o.div_u:$o.div_s)(this.low,this.high,t.low,t.high),$o.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?hs:fs;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return hs;if(t.gt(this.shru(1)))return cs;i=hs}else{if(this.eq(bs))return t.eq(us)||t.eq(ds)?bs:t.eq(bs)?us:(e=this.shr(1).div(t).shl(1)).eq(fs)?t.isNegative()?us:ds:(r=this.sub(t.mul(e)),i=e.add(r.div(t)));if(t.eq(bs))return this.unsigned?hs:fs;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();i=fs}for(r=this;r.gte(t);){e=Math.max(1,Math.floor(r.toNumber()/t.toNumber()));for(var n=Math.ceil(Math.log(e)/Math.LN2),o=n<=48?1:es(2,n-48),s=Qo(e),a=s.mul(t);a.isNegative()||a.gt(r);)a=(s=Qo(e-=o,this.unsigned)).mul(t);s.isZero()&&(s=us),i=i.add(s),r=r.sub(a)}return i},gs.div=gs.divide,gs.modulo=function(t){return Jo(t)||(t=is(t)),$o?ts((this.unsigned?$o.rem_u:$o.rem_s)(this.low,this.high,t.low,t.high),$o.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},gs.mod=gs.modulo,gs.rem=gs.modulo,gs.not=function(){return ts(~this.low,~this.high,this.unsigned)},gs.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},gs.clz=gs.countLeadingZeros,gs.countTrailingZeros=function(){return this.low?Ko(this.low):Ko(this.high)+32},gs.ctz=gs.countTrailingZeros,gs.and=function(t){return Jo(t)||(t=is(t)),ts(this.low&t.low,this.high&t.high,this.unsigned)},gs.or=function(t){return Jo(t)||(t=is(t)),ts(this.low|t.low,this.high|t.high,this.unsigned)},gs.xor=function(t){return Jo(t)||(t=is(t)),ts(this.low^t.low,this.high^t.high,this.unsigned)},gs.shiftLeft=function(t){return Jo(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?ts(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):ts(0,this.low<<t-32,this.unsigned)},gs.shl=gs.shiftLeft,gs.shiftRight=function(t){return Jo(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?ts(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):ts(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},gs.shr=gs.shiftRight,gs.shiftRightUnsigned=function(t){return Jo(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?ts(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):ts(32===t?this.high:this.high>>>t-32,0,this.unsigned)},gs.shru=gs.shiftRightUnsigned,gs.shr_u=gs.shiftRightUnsigned,gs.rotateLeft=function(t){var e;return Jo(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?ts(this.high,this.low,this.unsigned):t<32?(e=32-t,ts(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)):(e=32-(t-=32),ts(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned))},gs.rotl=gs.rotateLeft,gs.rotateRight=function(t){var e;return Jo(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?ts(this.high,this.low,this.unsigned):t<32?(e=32-t,ts(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned)):(e=32-(t-=32),ts(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned))},gs.rotr=gs.rotateRight,gs.toSigned=function(){return this.unsigned?ts(this.low,this.high,!1):this},gs.toUnsigned=function(){return this.unsigned?this:ts(this.low,this.high,!0)},gs.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},gs.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},gs.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},Wo.fromBytes=function(t,e,r){return r?Wo.fromBytesLE(t,e):Wo.fromBytesBE(t,e)},Wo.fromBytesLE=function(t,e){return new Wo(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},Wo.fromBytesBE=function(t,e){return new Wo(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)},"function"==typeof BigInt&&(Wo.fromBigInt=function(t,e){return ts(Number(BigInt.asIntN(32,t)),Number(BigInt.asIntN(32,t>>BigInt(32))),e)},Wo.fromValue=function(t,e){return"bigint"==typeof t?Wo.fromBigInt(t,e):is(t,e)},gs.toBigInt=function(){var t=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|t});class _s{static fromBuffer(t){const e=Vo.fromBinary(t.toString("binary"),Vo.LITTLE_ENDIAN),r=bo.fromBuffer(e.readBytes(33).toBuffer()),i=bo.fromBuffer(e.readBytes(33).toBuffer()),n=e.readUint64().toString(),o=e.readUint32(),s=e.readVarint32();return{from:r,to:i,nonce:n,check:o,encrypted:e.readBytes(s).toString("hex")}}static toBuffer(t){const e=new Vo(Vo.DEFAULT_CAPACITY,Vo.LITTLE_ENDIAN);let r;if(e.append(t.from.toBuffer()),e.append(t.to.toBuffer()),"string"==typeof t.nonce)try{r=Wo.fromString(t.nonce,!0,10)}catch{const e=Number(t.nonce);if(isNaN(e)||!isFinite(e))throw new Error(`Invalid nonce format: ${t.nonce}`);r=Wo.fromNumber(e,!0)}else r=Wo.fromNumber(t.nonce,!0);const i=Q.Buffer.from(r.toBytesLE());e.append(i),e.writeUint32(t.check);const n=Q.Buffer.from(t.encrypted,"hex");return e.writeVarint32(n.length),e.append(n),e.flip(),Q.Buffer.from(e.toBuffer())}}const Ms={toBuffer:t=>function(t){const e=new Vo(Vo.DEFAULT_CAPACITY,Vo.LITTLE_ENDIAN),r=t;let i;if(e.writeUint16(r.ref_block_num||0),e.writeUint32(r.ref_block_prefix||0),"string"==typeof r.expiration){let t=r.expiration;t.endsWith("Z")||(t+="Z");const e=new Date(t);i=Math.floor(e.getTime()/1e3)}else i="number"==typeof r.expiration?r.expiration:0;e.writeUint32(i);const n=Array.isArray(r.operations)?r.operations:[];e.writeVarint32(n.length);for(const t of n)ms(e,t);if(e.writeVarint32(0),"signatures"in r){const t=Array.isArray(r.signatures)?r.signatures:[];e.writeVarint32(t.length);for(const r of t)if("string"==typeof r){const t=Q.Buffer.from(r,"hex");e.append(t)}else{if(!Q.Buffer.isBuffer(r))throw new Error("Invalid signature format");e.append(r)}}return e.flip(),Q.Buffer.from(e.toBuffer())}(t)},Es={toObject:t=>t,toBuffer:t=>Q.Buffer.from(JSON.stringify(t))};var As=Object.freeze({__proto__:null,Serializer:_s,signed_transaction:Es,transaction:Ms});const Ss={verify(t,e,r){let i=!1;const n=r;if(!n||"object"!=typeof n)return!1;const o=Object.keys(n),s=this.generateKeys(t,e,o);return o.forEach(t=>{const e=n[t];if(Array.isArray(e)&&e.length>0){const r=e[0];Array.isArray(r)&&r.length>0&&r[0]===s[t]&&(i=!0)}}),i},generateKeys(t,e,r=["owner","active","posting","memo"]){const i={};return r.forEach(r=>{const n=(t+r+e).trim().split(/[\t\n\v\f\r ]+/).join(" "),o=vo.fromSeed(n);i[r]=o.toPublic().toString()}),i},getPrivateKeys(t,e,r=["owner","active","posting","memo"]){const i={};return r.forEach(r=>{const n=(t+r+e).trim().split(/[\t\n\v\f\r ]+/).join(" "),o=vo.fromSeed(n);i[r]=o.toWif(),i[r+"Pubkey"]=o.toPublic().toString()}),i},isWif(t){let e=!1;try{const r=Q.Buffer.from(uo.decode(t)),i=r.slice(0,-4),n=r.slice(-4);let o=so(i);o=so(o),o=o.slice(0,4),n.toString()===o.toString()&&(e=!0)}catch{}return e},toWif(t,e,r){const i=(t+r+e).trim().split(/[\t\n\v\f\r ]+/).join(" "),n=so(Q.Buffer.from(i)),o=Q.Buffer.concat([Q.Buffer.from([128]),n]);let s=so(o);s=so(s),s=s.slice(0,4);const a=Q.Buffer.concat([o,s]);return uo.encode(a)},wifIsValid(t,e){return this.wifToPublic(t)===e},wifToPublic:t=>vo.fromWif(t).toPublic().toString(),isPubkey(t,e){try{return null!==bo.fromString(t,e)}catch{return!1}},signTransaction(t,e){if(!Array.isArray(e))throw new Error("Keys must be an array");const r=[],i=t;Array.isArray(i.signatures)&&r.push(...i.signatures.map(t=>Q.Buffer.isBuffer(t)?t.toString("hex"):String(t)));const n=M().get("chain_id")||"",o=Q.Buffer.from(n,"hex"),s=Ms.toBuffer(t);for(const t of e){const e=So.signBuffer(Q.Buffer.concat([o,s]),t);r.push(e.toBuffer().toString("hex"))}const a=t;return Es.toObject(Object.assign(a,{signatures:r}))}},Is=Ss.verify.bind(Ss),Bs=Ss.generateKeys.bind(Ss),xs=Ss.getPrivateKeys.bind(Ss),Ts=Ss.isWif.bind(Ss),Ls=Ss.toWif.bind(Ss),ks=Ss.wifIsValid.bind(Ss),Ns=Ss.wifToPublic.bind(Ss),Rs=Ss.isPubkey.bind(Ss),Us=Ss.signTransaction.bind(Ss);var Os=Object.freeze({__proto__:null,Address:Io,Auth:Ss,PrivateKey:vo,PublicKey:bo,Signature:So,default:Ss,generateKeys:Bs,getPrivateKey:t=>{const e=t.trim().split(/[\t\n\v\f\r ]+/).join(" "),r=so(Q.Buffer.from(e)),i=Q.Buffer.concat([Q.Buffer.from([128]),r]);let n=so(i);n=so(n),n=n.slice(0,4);const o=Q.Buffer.concat([i,n]);return uo.encode(o)},getPrivateKeys:xs,getPublicKey:t=>vo.fromWif(t).toPublic().toString(),isPubkey:Rs,isWif:Ts,sign:(t,e)=>{const r=vo.fromWif(e);return So.signBuffer(Q.Buffer.from(t),r).toHex()},signTransaction:Us,toWif:Ls,verify:Is,verifySignature:(t,e,r)=>{try{const i=bo.fromString(r);if(!i)return!1;return So.fromHex(e).verifyBuffer(Q.Buffer.from(t),i)}catch{return!1}},verifyTransaction:(t,e)=>{try{const r=bo.fromString(e);if(!r)return!1;const i=Q.Buffer.from(JSON.stringify(t)),n=t;return!(!n.signatures||!Array.isArray(n.signatures))&&n.signatures.some(t=>So.fromHex(t).verifyBuffer(i,r))}catch{return!1}},wifIsValid:ks,wifToPublic:Ns});class Ps extends v.EventEmitter{static _wrapWithPromise(t){return function(...e){return"function"==typeof e[e.length-1]?t.apply(this,e):new Promise((r,i)=>{t.apply(this,[...e,(t,e)=>{if(t)return i(t);r(Boolean(e))}])})}}constructor(t={}){super(),this.seqNo=0,this._transportType="http",this.transport=null,this.__logger=!1,this._setTransport(t),this._setLogger(t),this.options=t,Ro.forEach(t=>{const e=t.method_name||X(t.method),r=t.params||[];this[`${e}With`]=(i,n)=>{const o=i,s=n;let a;return a=t.is_object?i:r.map(t=>o[t]),this.send(t.api,{method:t.method,params:a},(t,r)=>{if("getConfig"===e&&r&&"object"==typeof r){const t=r;if(!("STEEMIT_ADDRESS_PREFIX"in t)){const e=M().all();t.STEEMIT_ADDRESS_PREFIX=e.address_prefix||"STM"}if(!("STEEMIT_CHAIN_ID"in t)){const e=M().all();t.STEEMIT_CHAIN_ID=e.chain_id||"0000000000000000000000000000000000000000000000000000000000000000"}}s&&s(t,r)})},this[e]=Ps._wrapWithPromise(function(...t){const i=r.reduce((e,r,i)=>(e[r]=t[i],e),{}),n=t[r.length];return this[`${e}With`](i,n)}),this[`${e}WithAsync`]=G(this[`${e}With`]),this[`${e}Async`]=G(this[e])})}_setTransport(t){if(t.url&&t.url.match(/^((http|https)?:\/\/)/))t.transport="http",this._transportType=t.transport,this.options=t,this.transport=new jo.http(t);else if(t.transport){const e="string"==typeof t.transport?t.transport:"custom";if(this.transport&&this._transportType!==e&&"function"==typeof this.transport.stop&&this.transport.stop(),this._transportType=e,"string"==typeof t.transport){if(!jo[t.transport])throw new TypeError("Invalid `transport`, valid values are `http` or a class");const e=jo[t.transport];this.transport=new e(t)}else this.transport=new t.transport(t)}else{const e=(M().get("nodes")||["https://api.steemit.com"])[0]||"https://api.steemit.com";t.url=e,t.transport="http",this._transportType=t.transport,this.options=t,this.transport=new jo.http(t)}}_setLogger(t){if(Object.prototype.hasOwnProperty.call(t,"logger"))switch(typeof t.logger){case"function":this.__logger={log:t.logger};break;case"object":if("function"!=typeof t.logger.log)throw new Error("setOptions({logger:{}}) must have a property .log of type function");this.__logger=t.logger;break;case"undefined":if(this.__logger)break;this.__logger=!1;break;default:this.__logger=!1}}log(t,...e){if(this.__logger){const r=this.__logger;e.length>0&&"function"==typeof r[t]?r[t].apply(this.__logger,e):this.__logger.log.apply(this.__logger,[t,...e])}}start(){if(!this.transport)throw new Error("Transport not initialized");return this.transport.start()}stop(){return this.transport?this.transport.stop():Promise.resolve()}send(t,e,r){let i=r;if(this.__logger){const t=Math.random();this.log("xmit:"+t+":",e),i=(e,i)=>{e?this.log("error","rsp:"+t+":\n\n",e,i):this.log("rsp:"+t+":",i),r&&"function"==typeof r&&r(e,i)}}if(!this.transport)throw new Error("Transport not initialized");return this.transport.send(t,e,i)}call(t,e,r){if("http"!==this._transportType)return void r(new Error("RPC methods can only be called when using http transport"));const i=++this.seqNo,n=this.options.fetchMethod||fetch;Fo(this.options.url,{method:t,params:e,id:i},n).then(t=>{r(null,t)},t=>{r(t)})}signedCall(t,e,r,i,n){if("http"!==this._transportType)return void n(new Error("RPC methods can only be called when using http transport"));const o=++this.seqNo;let s;try{s=ko({method:t,params:e,id:o},r,[i])}catch(t){return void n(t instanceof Error?t:new Error(String(t)))}const a=this.options.fetchMethod||fetch;Fo(this.options.url,s,a).then(t=>{n(null,t)},t=>{n(t)})}verifySignedRequest(t,e){Promise.resolve().then(function(){return No}).then(({validate:r})=>{r(t,async(t,e,r)=>{const i=await new Promise((t,e)=>{this.call("condenser_api.get_accounts",[[r]],(r,i)=>{r?e(r):t(Array.isArray(i)?i:[])})});if(!i||0===i.length)throw new Error(`Account ${r} not found`);const n=i[0],o=n.owner?.key_auths,s=n.active?.key_auths,a=n.posting?.key_auths,f=[o?.[0]?.[0],s?.[0]?.[0],a?.[0]?.[0],n.memo_key].filter(Boolean),{Signature:h,PublicKey:u}=await Promise.resolve().then(function(){return Os});let c=!1;for(const r of e){for(const e of f)try{const i=h.fromHex(r),n=u.fromString(String(e));if(n&&i.verifyBuffer(t,n)){c=!0;break}}catch{}if(c)break}if(!c)throw new Error("No valid signature found for account")}).then(t=>e(null,{valid:!0,params:t})).catch(t=>e(t instanceof Error?t:new Error(String(t))))}).catch(e)}setOptions(t){if(Object.assign(this.options,t),this._setLogger(t),this._setTransport(t),!this.transport)throw new Error("Transport not initialized");this.transport.setOptions(t),Object.prototype.hasOwnProperty.call(t,"useTestNet")&&M().set("address_prefix",t.useTestNet?"TST":"STM")}setUrl(t){this.setOptions({url:t})}streamBlockNumber(t="head",e,r=200){if("function"==typeof t&&(e=t,t="head"),!e)throw new Error("callback is required");let i=0,n=!0;const o=()=>{n&&this.getDynamicGlobalPropertiesAsync().then(n=>{const s=n,a="irreversible"===t?s.last_irreversible_block_num:s.head_block_number;if(a!==i)if(i)for(let t=i;t<a;t++)t!==i&&e(null,t),i=t;else i=a,e(null,a);setTimeout(o,r)},t=>{e(t)})};return o(),()=>{n=!1}}streamBlock(t="head",e){"function"==typeof t&&(e=t,t="head");let r=0,i=0;const n=this.streamBlockNumber(t,(t,o)=>{if(t)return n(),void e(t);r=o,r!==i&&(i=r,this.getBlock(r,e))});return n}streamTransactions(t="head",e){"function"==typeof t&&(e=t,t="head");let r=0,i=0;if("function"==typeof t&&(e=t,t="head"),!e)throw new Error("callback is required");const n=this.streamBlockNumber(t,(t,o)=>{if(t)return n(),void e(t);r=o,r!==i&&(i=r,this.getBlock(r,(t,r)=>{if(t)e(t);else if(r&&"object"==typeof r&&"transactions"in r){const t=r;Array.isArray(t.transactions)&&t.transactions.forEach(t=>{e(null,t)})}}))});return n}streamOperations(t="head",e){"function"==typeof t&&(e=t,t="head");let r=0,i=0;if("function"==typeof t&&(e=t,t="head"),!e)throw new Error("callback is required");const n=this.streamBlockNumber(t,(t,o)=>{if(t)return n(),void e(t);r=o,r!==i&&(i=r,this.getBlock(r,(t,r)=>{if(t)e(t);else if(r&&"object"==typeof r&&"transactions"in r){const t=r;Array.isArray(t.transactions)&&t.transactions.forEach(t=>{Array.isArray(t.operations)&&t.operations.forEach(t=>{e(null,t)})})}}))});return n}broadcastTransactionSynchronousWith(t,e){const r=t.transaction;r?this.broadcastTransactionSynchronous(r,e):e(new Error("transaction is required"))}broadcastTransaction(t,e){const r=this.broadcastTransactionSynchronous;"function"==typeof r?r(t,e):this.transport&&"function"==typeof this.transport.broadcastTransactionSynchronous?this.transport.broadcastTransactionSynchronous(t,e):e(new Error("broadcastTransaction is not implemented"))}signTransaction(t,e){return Ss.signTransaction(t,e)}getFollowers(t,e,r,i,n){if(!n)return this.get_followers(t,e,r,i).then(t=>Array.isArray(t)?t:[]).catch(()=>[]);this.get_followers(t,e,r,i,(t,e)=>{if(t)return n(t);n(null,Array.isArray(e)?e:[])})}broadcastTransactionWithCallback(t,e,r){"http"===this._transportType?this.send("network_broadcast_api",{method:"broadcast_transaction_with_callback",params:[t,e]},r):r(new Error("broadcastTransactionWithCallback can only be called when using http transport"))}broadcastBlock(t,e){"http"===this._transportType?this.send("network_broadcast_api",{method:"broadcast_block",params:[t]},e):e(new Error("broadcastBlock can only be called when using http transport"))}setMaxBlockAge(t,e){"http"===this._transportType?this.send("network_broadcast_api",{method:"set_max_block_age",params:[t]},e):e(new Error("setMaxBlockAge can only be called when using http transport"))}verifyAuthority(t,e){if("http"!==this._transportType){const t=new Error("verifyAuthority can only be called when using http transport");return e?void e(t):Promise.reject(t)}if(!e)return new Promise((e,r)=>{this.send("database_api",{method:"verify_authority",params:[t]},(t,i)=>{if(t)return r(t);e(Boolean(i))})});this.send("database_api",{method:"verify_authority",params:[t]},(t,r)=>{e(t,Boolean(r))})}verifyAccountAuthority(t,e,r){if("http"!==this._transportType){const t=new Error("verifyAccountAuthority can only be called when using http transport");return r?void r(t):Promise.reject(t)}if(!r)return new Promise((r,i)=>{this.send("database_api",{method:"verify_account_authority",params:[t,e]},(t,e)=>{if(t)return i(t);r(Boolean(e))})});this.send("database_api",{method:"verify_account_authority",params:[t,e]},(t,e)=>{r(t,Boolean(e))})}}const qs=M().get("nodes")||["https://api.steemit.com"],zs=new Ps({url:qs[0]||"https://api.steemit.com"});zs.getDynamicGlobalPropertiesAsync,zs.getBlockAsync,zs.getFollowersAsync,zs.getContentAsync;const Cs=[{roles:["posting","active","owner"],operation:"vote",params:["voter","author","permlink","weight"]},{roles:["posting","active","owner"],operation:"comment",params:["parent_author","parent_permlink","author","permlink","title","body","json_metadata"]},{roles:["active","owner"],operation:"transfer",params:["from","to","amount","memo"]},{roles:["active","owner"],operation:"transfer_to_vesting",params:["from","to","amount"]},{roles:["active","owner"],operation:"withdraw_vesting",params:["account","vesting_shares"]},{roles:["active","owner"],operation:"limit_order_create",params:["owner","orderid","amount_to_sell","min_to_receive","fill_or_kill","expiration"]},{roles:["active","owner"],operation:"limit_order_cancel",params:["owner","orderid"]},{roles:["active","owner"],operation:"price",params:["base","quote"]},{roles:["active","owner"],operation:"feed_publish",params:["publisher","exchange_rate"]},{roles:["active","owner"],operation:"convert",params:["owner","requestid","amount"]},{roles:["active","owner"],operation:"account_create",params:["fee","creator","new_account_name","owner","active","posting","memo_key","json_metadata"]},{roles:["active","owner"],operation:"account_update",params:["account","owner","active","posting","memo_key","json_metadata"]},{roles:["active","owner"],operation:"witness_update",params:["owner","url","block_signing_key","props","fee"]},{roles:["active","owner"],operation:"account_witness_vote",params:["account","witness","approve"]},{roles:["active","owner"],operation:"account_witness_proxy",params:["account","proxy"]},{roles:["active","owner"],operation:"pow",params:["worker","input","signature","work"]},{roles:["active","owner"],operation:"custom",params:["required_auths","id","data"]},{roles:["posting","active","owner"],operation:"delete_comment",params:["author","permlink"]},{roles:["posting","active","owner"],operation:"custom_json",params:["required_auths","required_posting_auths","id","json"]},{roles:["posting","active","owner"],operation:"comment_options",params:["author","permlink","max_accepted_payout","percent_steem_dollars","allow_votes","allow_curation_rewards","extensions"]}];function Fs(t){const e=function(t){return Cs.find(e=>e.operation===t)}(t.operation);if(!e)throw new Error(`Operation ${t.operation} not found`);if(t.params.length!==e.params.length)throw new Error(`Operation ${t.operation} requires ${e.params.length} parameters, got ${t.params.length}`);if(!t.roles.some(t=>e.roles.includes(t)))throw new Error(`Operation ${t.operation} requires one of the following roles: ${e.roles.join(", ")}`)}function js(t){return Fs(t),[t.operation,t.params]}class Ds{constructor(t){this.api=t.api,this.auth=t.auth}async send(t,e,r){const i=this,n=i&&i.api?i.api:void 0!==Zs&&Zs.api?Zs.api:void 0,o=i&&i.auth?i.auth:void 0!==Zs&&Zs.auth?Zs.auth:void 0;if(!n||!o)throw new Error("API and Auth must be set on Broadcast instance or global steem object");try{const i=await Hs._prepareTransaction.call(this,t),{debug:s}=await Promise.resolve().then(function(){return W});if(s.isEnabled("transaction")){const{transaction:t}=await Promise.resolve().then(function(){return As}),{getConfig:e}=await Promise.resolve().then(function(){return B}),r=t.toBuffer(i),n=Q.Buffer.from(e().get("chain_id")||"","hex"),o=Q.Buffer.from(ro(Q.Buffer.concat([n,r])));s.transaction("\n=== Transaction Debug Info (before signing) ==="),s.transaction("Transaction:",JSON.stringify(i,null,2)),s.transaction("Transaction.toHex():",r.toString("hex")),s.transaction("Digest (sha256(chain_id + transaction)):",o.toString("hex")),s.transaction("===============================================\n")}const a=Array.isArray(e)?e.filter(t=>"string"==typeof t):e&&"object"==typeof e?Object.values(e).filter(t=>"string"==typeof t):e&&"string"==typeof e?[e]:[],f=await o.signTransaction(i,a),h=await new Promise((t,e)=>{n.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[f]},(r,i)=>{r?e(r):t(i)})}),u=Object.assign({},h,f);return r?void r(null,u):u}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}}async sendOperations(t){const e=function(t){return{ref_block_num:0,ref_block_prefix:0,expiration:new Date(Date.now()+6e4).toISOString().slice(0,-5),operations:t,extensions:[]}}(t.map(js)),r=await this.auth.signTransaction(e,[]);return new Promise((t,e)=>{this.api.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[r]},(r,i)=>{r?e(r):t(i)})})}async sendTransaction(t){const e=await this.auth.signTransaction(t,[]);return new Promise((t,r)=>{this.api.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[e]},(e,i)=>{e?r(e):t(i)})})}async sendSignedTransaction(t){return new Promise((e,r)=>{this.api.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[t]},(t,i)=>{t?r(t):e(i)})})}}const Hs={};Cs.forEach(t=>{const e=X(t.operation),r=t.params||[];Hs[e]=function(e,...i){let n;if(i.length>0&&"function"==typeof i[i.length-1]){n=i.pop()}const o=this,s=o&&o.api?o.api:Zs.api,a=o,f=a&&a.auth?a.auth:void 0!==Zs&&Zs.auth?Zs.auth:Ss,h={};r.forEach((t,e)=>{e<i.length&&(h[t]=i[e])});try{const r={operations:[[t.operation,h]],extensions:[]};if(!s)throw new Error("API is required");const i=new Ds({api:s,auth:f});return n?void i.send(r,e,n):i.send(r,e)}catch(t){if(n)return void n(t instanceof Error?t:new Error(String(t)));throw t}},Hs[e+"With"]=function(e,r,i){const n=this,o=n&&n.api?n.api:Zs.api,s=n,a=s&&s.auth?s.auth:void 0!==Zs?Zs.auth:Ss;"function"!=typeof i&&(i=void 0);try{const n={operations:[[t.operation,r]],extensions:[]};if(!o)throw new Error("API is required");const s=new Ds({api:o,auth:a});return i?void s.send(n,e,i):s.send(n,e)}catch(t){if(i)return void i(t instanceof Error?t:new Error(String(t)));throw t}},Hs[e+"Async"]=G(Hs[e])}),Hs._prepareTransaction=async function(t){const e=this,r=e&&e.api?e.api:void 0!==Zs&&Zs.api?Zs.api:void 0;if(!r)throw new Error("API must be set on Broadcast instance or global steem object");const i=r,n=await i.getDynamicGlobalPropertiesAsync(),o=new Date(n.time+"Z"),s=n.last_irreversible_block_num-1&65535;let a=null;try{const t=r;"function"==typeof t.getBlockHeaderAsync?a=await t.getBlockHeaderAsync(n.last_irreversible_block_num):"function"==typeof t.getBlockAsync&&(a=await t.getBlockAsync(n.last_irreversible_block_num))}catch{a=null}const f=a,h=f&&f.previous?f.previous:"0000000000000000000000000000000000000000";return{...t,ref_block_num:s,ref_block_prefix:Q.Buffer.from(h,"hex").readUInt32LE(4),expiration:new Date(o.getTime()+6e5).toISOString().replace("Z","")}};const Zs={api:null,auth:Ss};function Vs(t){Zs.api=t}Hs.vote=function(t,e,r,i,n,o){const s=this,a=s&&s.api?s.api:Zs.api,f=s,h=f&&f.auth?f.auth:void 0!==Zs?Zs.auth:Ss;"function"!=typeof o&&(o=void 0);try{const s={operations:[["vote",{voter:e,author:r,permlink:i,weight:n}]],extensions:[]};if(!a)throw new Error("API is required");const f=new Ds({api:a,auth:h});return o?void f.send(s,t,o):f.send(s,t)}catch(t){if(o)return void o(t instanceof Error?t:new Error(String(t)));throw t}},Hs.voteWith=function(t,e,r){const i=this,n=i&&i.api?i.api:Zs.api,o=i,s=o&&o.auth?o.auth:void 0!==Zs?Zs.auth:Ss;"function"!=typeof r&&(r=void 0);try{const i={operations:[["vote",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new Ds({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Hs.comment=function(t,e,r,i,n,o,s,a,f){const h=this,u=h&&h.api?h.api:Zs.api,c=h,d=c&&c.auth?c.auth:void 0!==Zs?Zs.auth:Ss;"function"!=typeof f&&(f=void 0);try{const h={operations:[["comment",{parent_author:e,parent_permlink:r,author:i,permlink:n,title:o,body:s,json_metadata:"object"==typeof a?JSON.stringify(a):a}]],extensions:[]};if(!u)throw new Error("API is required");const c=new Ds({api:u,auth:d});return f?void c.send(h,t,f):c.send(h,t)}catch(t){if(f)return void f(t instanceof Error?t:new Error(String(t)));throw t}},Hs.claimAccount=function(t,e,r){const i=this,n=i&&i.api?i.api:Zs.api,o=i,s=o&&o.auth?o.auth:void 0!==Zs?Zs.auth:Ss;"function"!=typeof r&&(r=void 0);try{const i={operations:[["claim_account",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new Ds({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Hs.claimAccountAsync=G(Hs.claimAccount),Hs.createClaimedAccount=function(t,e,r){const i=this,n=i&&i.api?i.api:Zs.api,o=i,s=o&&o.auth?o.auth:void 0!==Zs?Zs.auth:Ss;"function"!=typeof r&&(r=void 0);try{const i={operations:[["create_claimed_account",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new Ds({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Hs.createClaimedAccountAsync=G(Hs.createClaimedAccount),Hs.createProposal=function(t,e,r){const i=this,n=i&&i.api?i.api:Zs.api,o=i,s=o&&o.auth?o.auth:void 0!==Zs?Zs.auth:Ss;"function"!=typeof r&&(r=void 0);try{const i={operations:[["create_proposal",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new Ds({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Hs.createProposalAsync=G(Hs.createProposal),Hs.updateProposalVotes=function(t,e,r){const i=this,n=i&&i.api?i.api:Zs.api,o=i,s=o&&o.auth?o.auth:void 0!==Zs?Zs.auth:Ss;"function"!=typeof r&&(r=void 0);try{const i={operations:[["update_proposal_votes",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new Ds({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Hs.updateProposalVotesAsync=G(Hs.updateProposalVotes),Hs.removeProposal=function(t,e,r){const i=this,n=i&&i.api?i.api:Zs.api,o=i,s=o&&o.auth?o.auth:void 0!==Zs?Zs.auth:Ss;"function"!=typeof r&&(r=void 0);try{const i={operations:[["remove_proposal",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new Ds({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Hs.removeProposalAsync=G(Hs.removeProposal);const{_prepareTransaction:$s,claimAccount:Ws,claimAccountAsync:Js,createClaimedAccount:Ks,createClaimedAccountAsync:Xs,createProposal:Ys,createProposalAsync:Gs,updateProposalVotes:Qs,updateProposalVotesAsync:ta,removeProposal:ea,removeProposalAsync:ra,...ia}=Hs,na=ia.vote,oa=ia.voteAsync,sa=ia.voteWith,aa=ia.comment,fa=ia.transfer,ha=ia.transferAsync,ua=G((...t)=>exports.send(...t)),ca=Ds.prototype.send,da=ia.customJson,la=ia.customJsonAsync;var pa=Object.freeze({__proto__:null,Broadcast:Ds,_prepareTransaction:$s,broadcast:function(t,e){if("object"!=typeof t||!t)throw new Error("First parameter must be a valid API object");const r=t;return"function"==typeof r.broadcastTransaction?new Promise((t,i)=>{r.broadcastTransaction(e,(r,n)=>{r?i(r):t(Object.assign({},n,e))})}):"function"==typeof r.send?new Promise((t,i)=>{r.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[e]},(r,n)=>{r?i(r):t(Object.assign({},n,e))})}):Promise.reject(new Error("No suitable broadcast method found on API object"))},claimAccount:Ws,claimAccountAsync:Js,comment:aa,createClaimedAccount:Ks,createClaimedAccountAsync:Xs,createProposal:Ys,createProposalAsync:Gs,customJson:da,customJsonAsync:la,generated:ia,removeProposal:ea,removeProposalAsync:ra,send:ca,sendAsync:ua,setApi:Vs,transfer:fa,transferAsync:ha,updateProposalVotes:Qs,updateProposalVotesAsync:ta,vote:na,voteAsync:oa,voteWith:sa});function ba(t,e="STEEM"){return`${("string"==typeof t?parseFloat(t):t).toFixed(3)} ${e}`}const ga=ba;var ma=Object.freeze({__proto__:null,Formatter:class{constructor(t){this.api=t}vestingSteem(t,e){const r=parseFloat(t.vesting_shares.split(" ")[0]),i=parseFloat(e.total_vesting_shares.split(" ")[0]);return parseFloat(e.total_vesting_fund_steem.split(" ")[0])*(r/i)}processOrders(t,e){const r=t?t.reduce((t,e)=>(-1!==e.sell_price.base.indexOf("SBD")&&(t+=e.for_sale),t),0)/e:0;return{steemOrders:t?t.reduce((t,e)=>(-1!==e.sell_price.base.indexOf("STEEM")&&(t+=e.for_sale),t),0)/e:0,sbdOrders:r}}calculateSaving(t){let e=0,r=0;return t.forEach(t=>{const[i,n]=t.amount.split(" ");"STEEM"===n?e+=parseFloat(i):"SBD"===n&&(r+=parseFloat(i))}),{savings_pending:e,savings_sbd_pending:r}}pricePerSteem(t){let e;const{base:r,quote:i}=t;return/ SBD$/.test(r)&&/ STEEM$/.test(i)&&(e=parseFloat(r.split(" ")[0])/parseFloat(i.split(" ")[0])),e}async estimateAccountValue(t,e={}){const r=[],i=t.name;let n,o,{gprops:s,feed_price:a,vesting_steem:f}=e;const{open_orders:h,savings_withdraws:u}=e;return f&&a||(s&&a?s&&(f=this.vestingSteem(t,s)):r.push(this.api.getStateAsync(`/@${i}`).then(e=>{const r=e;s=r.props,a=r.feed_price,s&&(f=this.vestingSteem(t,s))}))),h?n=this.processOrders(h,1e3):r.push(this.api.getOpenOrdersAsync(i).then(t=>{n=this.processOrders(t,1e3)})),u?o=this.calculateSaving(u):r.push(this.api.getSavingsWithdrawFromAsync(i).then(t=>{o=this.calculateSaving(t)})),Promise.all(r).then(()=>{const e=this.pricePerSteem(a),r=t.savings_balance,i=t.savings_sbd_balance,s=parseFloat(t.balance.split(" ")[0]),h=parseFloat(r.split(" ")[0]),u=parseFloat(t.sbd_balance),c=parseFloat(i.split(" ")[0]);let d=0;const l=(new Date).getTime();(t.other_history||[]).reduce((t,e)=>{const r=e;if(!Array.isArray(r)||r.length<2)return t;if("convert"!==(r[1]?.op?.[0]??""))return t;const i=r[1],n=i?.timestamp;if(!n)return t;if(new Date(n).getTime()+3024e5<l)return t;const o=i?.op;if(!Array.isArray(o)||o.length<2)return t;const s=o[1],a=s?.amount;if(!a)return t;const f=parseFloat(a.replace(" SBD",""));return d+=f,t},[]);const p=u+c+o.savings_sbd_pending+n.sbdOrders+d;return((f+s+h+o.savings_pending+n.steemOrders)*e+p).toFixed(2)})}createSuggestedPassword(){return vo.fromBuffer(Q.Buffer.from(Array(32).fill(0).map(()=>Math.floor(256*Math.random())))).toWif().substring(3,35)}reputation(t,e=0){if(null==t)return t;if(0===t)return 25;const r=t<0;let i=String(t);i=r?i.substring(1):i;let n=Math.log10((parseInt(i)>0?parseInt(i):-parseInt(i))-10)-9;if(n=r?-n:n,n=9*n+25,e>0){const t=Math.pow(10,e);return Math.round(n*t)/t}return parseInt(String(n),10)}vestToSteem(t,e,r){return parseFloat(r)*(parseFloat(t)/parseFloat(e))}commentPermlink(t,e){const r=(new Date).toISOString().replace(/[^a-zA-Z0-9]+/g,"").toLowerCase();let i="re-"+t+"-"+(e=e.replace(/(-\d{8}t\d{9}z)/g,""))+"-"+r;return i.length>255&&(i=i.substr(i.length-255,i.length)),i.toLowerCase().replace(/[^a-z0-9-]+/g,"")}},amount:ga,commentPermlink:function(t,e){const r=(new Date).toISOString().replace(/[^a-zA-Z0-9]+/g,"").toLowerCase();let i="re-"+t+"-"+(e=e.replace(/(-\d{8}t\d{9}z)/g,""))+"-"+r;return i.length>255&&(i=i.substr(i.length-255,i.length)),i.toLowerCase().replace(/[^a-z0-9-]+/g,"")},formatAmount:ba,formatNumber:function(t,e=2){return("string"==typeof t?parseFloat(t):t).toFixed(e)},formatPercent:function(t){return`${(100*("string"==typeof t?parseFloat(t):t)).toFixed(2)}%`},formatReputation:function(t,e=0){if(0==t)return e>0?25..toFixed(e):"25";if(!t||isNaN(Number(t))||!isFinite(Number(t)))return e>0?25..toFixed(e):"25";const r="string"==typeof t?parseFloat(t):t,i=r<0,n=Math.abs(r),o=Math.log10(Math.max(Math.abs(n)-10,0))-9,s=9*(i?-o:o)+25;return e>0?Number(Math.round(Number(s+"e+"+e))+"e-"+e).toFixed(e):parseInt(s.toString(),10).toString()},formatTime:function(t){let e;return e="string"==typeof t||"number"==typeof t?new Date(t):t,e.toISOString()},formatVests:function(t){return`${("string"==typeof t?parseFloat(t):t).toFixed(6)} VESTS`},pricePerSteem:function(t){let e;const{base:r,quote:i}=t;return/ SBD$/.test(r)&&/ STEEM$/.test(i)&&(e=parseFloat(r.split(" ")[0])/parseFloat(i.split(" ")[0])),e},reputation:function(t,e=0){if(null==t)return t;if(0===t)return 25;const r=t<0;let i=String(t);i=r?i.substring(1):i;let n=Math.log10((parseInt(i)>0?parseInt(i):-parseInt(i))-10)-9;if(n=r?-n:n,n=9*n+25,e>0){const t=Math.pow(10,e);return Math.round(n*t)/t}return parseInt(String(n),10)},vestToSteem:function(t,e,r){return parseFloat(r)*(parseFloat(t)/parseFloat(e))},vestingSteem:function(t,e){const r=parseFloat(t.vesting_shares.split(" ")[0]),i=parseFloat(e.total_vesting_shares.split(" ")[0]);return parseFloat(e.total_vesting_fund_steem.split(" ")[0])*(r/i)}});function ya(t,e,r=""){const i=(n=t)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name;var n;const o=t?.length,s=void 0!==e;if(!i||s&&o!==e){throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(s?` of length ${e}`:"")+", got "+(i?`length=${o}`:"type="+typeof t))}return t}function va(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function wa(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const _a=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function Ma(t,e){if(i=e,(r=t).buffer===i.buffer&&r.byteOffset<i.byteOffset+i.byteLength&&i.byteOffset<r.byteOffset+r.byteLength&&t.byteOffset<e.byteOffset)throw new Error("complex overlap of input and output is not supported");var r,i}const Ea=(t,e)=>{function r(r,...i){if(ya(r,void 0,"key"),!_a)throw new Error("Non little-endian hardware is not yet supported");if(void 0!==t.nonceLength){ya(i[0],t.varSizeNonce?void 0:t.nonceLength,"nonce")}const n=t.tagLength;n&&void 0!==i[1]&&ya(i[1],void 0,"AAD");const o=e(r,...i),s=(t,e)=>{if(void 0!==e){if(2!==t)throw new Error("cipher output not supported");ya(e,void 0,"output")}};let a=!1;return{encrypt(t,e){if(a)throw new Error("cannot encrypt() twice with same key + nonce");return a=!0,ya(t),s(o.encrypt.length,e),o.encrypt(t,e)},decrypt(t,e){if(ya(t),n&&t.length<n)throw new Error('"ciphertext" expected length bigger than tagLength='+n);return s(o.decrypt.length,e),o.decrypt(t,e)}}}return Object.assign(r,t),r};function Aa(t,e,r=!0){if(void 0===e)return new Uint8Array(t);if(e.length!==t)throw new Error('"output" expected Uint8Array of length '+t+", got: "+e.length);if(r&&!Sa(e))throw new Error("invalid output, must be aligned");return e}function Sa(t){return t.byteOffset%4==0}function Ia(t){return Uint8Array.from(t)}const Ba=16;function xa(t){return t<<1^283&-(t>>7)}function Ta(t,e){let r=0;for(;e>0;e>>=1)r^=t&-(1&e),t=xa(t);return r}const La=(()=>{const t=new Uint8Array(256);for(let e=0,r=1;e<256;e++,r^=xa(r))t[e]=r;const e=new Uint8Array(256);e[0]=99;for(let r=0;r<255;r++){let i=t[255-r];i|=i<<8,e[t[r]]=255&(i^i>>4^i>>5^i>>6^i>>7^99)}return wa(t),e})(),ka=La.map((t,e)=>La.indexOf(e)),Na=t=>t<<24|t>>>8,Ra=t=>t<<8|t>>>24;function Ua(t,e){if(256!==t.length)throw new Error("Wrong sbox length");const r=new Uint32Array(256).map((r,i)=>e(t[i])),i=r.map(Ra),n=i.map(Ra),o=n.map(Ra),s=new Uint32Array(65536),a=new Uint32Array(65536),f=new Uint16Array(65536);for(let e=0;e<256;e++)for(let h=0;h<256;h++){const u=256*e+h;s[u]=r[e]^i[h],a[u]=n[e]^o[h],f[u]=t[e]<<8|t[h]}return{sbox:t,sbox2:f,T0:r,T1:i,T2:n,T3:o,T01:s,T23:a}}const Oa=Ua(La,t=>Ta(t,3)<<24|t<<16|t<<8|Ta(t,2)),Pa=Ua(ka,t=>Ta(t,11)<<24|Ta(t,13)<<16|Ta(t,9)<<8|Ta(t,14)),qa=(()=>{const t=new Uint8Array(16);for(let e=0,r=1;e<16;e++,r=xa(r))t[e]=r;return t})();function za(t){ya(t);const e=t.length;!function(t){if(![16,24,32].includes(t.length))throw new Error('"aes key" expected Uint8Array of length 16/24/32, got length='+t.length)}(t);const{sbox2:r}=Oa,i=[];Sa(t)||i.push(t=Ia(t));const n=va(t),o=n.length,s=t=>Fa(r,t,t,t,t),a=new Uint32Array(e+28);a.set(n);for(let t=o;t<a.length;t++){let e=a[t-1];t%o===0?e=s(Na(e))^qa[t/o-1]:o>6&&t%o===4&&(e=s(e)),a[t]=a[t-o]^e}return wa(...i),a}function Ca(t,e,r,i,n,o){return t[r<<8&65280|i>>>8&255]^e[n>>>8&65280|o>>>24&255]}function Fa(t,e,r,i,n){return t[255&e|65280&r]|t[i>>>16&255|n>>>16&65280]<<16}function ja(t,e,r,i,n){const{sbox2:o,T01:s,T23:a}=Oa;let f=0;e^=t[f++],r^=t[f++],i^=t[f++],n^=t[f++];const h=t.length/4-2;for(let o=0;o<h;o++){const o=t[f++]^Ca(s,a,e,r,i,n),h=t[f++]^Ca(s,a,r,i,n,e),u=t[f++]^Ca(s,a,i,n,e,r),c=t[f++]^Ca(s,a,n,e,r,i);e=o,r=h,i=u,n=c}return{s0:t[f++]^Fa(o,e,r,i,n),s1:t[f++]^Fa(o,r,i,n,e),s2:t[f++]^Fa(o,i,n,e,r),s3:t[f++]^Fa(o,n,e,r,i)}}function Da(t,e,r,i,n){const{sbox2:o,T01:s,T23:a}=Pa;let f=0;e^=t[f++],r^=t[f++],i^=t[f++],n^=t[f++];const h=t.length/4-2;for(let o=0;o<h;o++){const o=t[f++]^Ca(s,a,e,n,i,r),h=t[f++]^Ca(s,a,r,e,n,i),u=t[f++]^Ca(s,a,i,r,e,n),c=t[f++]^Ca(s,a,n,i,r,e);e=o,r=h,i=u,n=c}return{s0:t[f++]^Fa(o,e,n,i,r),s1:t[f++]^Fa(o,r,e,n,i),s2:t[f++]^Fa(o,i,r,e,n),s3:t[f++]^Fa(o,n,i,r,e)}}const Ha=Ea({blockSize:16,nonceLength:16},function(t,e,r={}){const i=!r.disablePadding;return{encrypt(r,n){const o=za(t),{b:s,o:a,out:f}=function(t,e,r){ya(t);let i=t.length;const n=i%Ba;if(!e&&0!==n)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");Sa(t)||(t=Ia(t));const o=va(t);if(e){let t=Ba-n;t||(t=Ba),i+=t}return Ma(t,r=Aa(i,r)),{b:o,o:va(r),out:r}}(r,i,n);let h=e;const u=[o];Sa(h)||u.push(h=Ia(h));const c=va(h);let d=c[0],l=c[1],p=c[2],b=c[3],g=0;for(;g+4<=s.length;)d^=s[g+0],l^=s[g+1],p^=s[g+2],b^=s[g+3],({s0:d,s1:l,s2:p,s3:b}=ja(o,d,l,p,b)),a[g++]=d,a[g++]=l,a[g++]=p,a[g++]=b;if(i){const t=function(t){const e=new Uint8Array(16),r=va(e);e.set(t);const i=Ba-t.length;for(let t=Ba-i;t<Ba;t++)e[t]=i;return r}(r.subarray(4*g));d^=t[0],l^=t[1],p^=t[2],b^=t[3],({s0:d,s1:l,s2:p,s3:b}=ja(o,d,l,p,b)),a[g++]=d,a[g++]=l,a[g++]=p,a[g++]=b}return wa(...u),f},decrypt(r,n){!function(t){if(ya(t),t.length%Ba!==0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size 16")}(r);const o=function(t){const e=za(t),r=e.slice(),i=e.length,{sbox2:n}=Oa,{T0:o,T1:s,T2:a,T3:f}=Pa;for(let t=0;t<i;t+=4)for(let n=0;n<4;n++)r[t+n]=e[i-t-4+n];wa(e);for(let t=4;t<i-4;t++){const e=r[t],i=Fa(n,e,e,e,e);r[t]=o[255&i]^s[i>>>8&255]^a[i>>>16&255]^f[i>>>24]}return r}(t);let s=e;const a=[o];Sa(s)||a.push(s=Ia(s));const f=va(s);n=Aa(r.length,n),Sa(r)||a.push(r=Ia(r)),Ma(r,n);const h=va(r),u=va(n);let c=f[0],d=f[1],l=f[2],p=f[3];for(let t=0;t+4<=h.length;){const e=c,r=d,i=l,n=p;c=h[t+0],d=h[t+1],l=h[t+2],p=h[t+3];const{s0:s,s1:a,s2:f,s3:b}=Da(o,c,d,l,p);u[t++]=s^e,u[t++]=a^r,u[t++]=f^i,u[t++]=b^n}return wa(...a),function(t,e){if(!e)return t;const r=t.length;if(!r)throw new Error("aes/pcks5: empty ciphertext not allowed");const i=t[r-1];if(i<=0||i>16)throw new Error("aes/pcks5: wrong padding");const n=t.subarray(0,-i);for(let e=0;e<i;e++)if(t[r-e-1]!==i)throw new Error("aes/pcks5: wrong padding");return n}(n,i)}}});let Za=null;function Va(t){const e=ao(t);return Q.Buffer.isBuffer(e)?e:Q.Buffer.from(e,"hex")}class $a{static uniqueNonce(){null===Za&&(Za=Math.floor(65535*Math.random()));let t=Wo.fromNumber(Date.now());const e=++Za%65535;return t=t.shiftLeft(16).or(Wo.fromNumber(e)),t.toString()}static encrypt(t,e,r,i=$a.uniqueNonce()){if(!t)throw new TypeError("private_key is required");if(!e)throw new TypeError("public_key is required");if(!i)throw new TypeError("nonce is required");let n;if(Q.Buffer.isBuffer(r))n=r;else{if("string"!=typeof r)throw new TypeError("message should be buffer or string");n=Q.Buffer.from(r,"binary")}const o=t.get_shared_secret(e),s=new Vo(Vo.DEFAULT_CAPACITY,Vo.LITTLE_ENDIAN),a=Wo.fromString(i,!0,10),f=Q.Buffer.from(a.toBytesLE());s.append(f),s.append(o.toString("binary"),"binary");const h=Va(Q.Buffer.from(s.copy(0,s.offset).toBinary(),"binary")),u=h.slice(32,48),c=h.slice(0,32);let d=so(h);Q.Buffer.isBuffer(d)||(d=Q.Buffer.from(d,"hex")),d=d.slice(0,4);const l=d.toString("binary"),p=Vo.fromBinary(l,Vo.DEFAULT_CAPACITY,Vo.LITTLE_ENDIAN).readUint32();return{nonce:i,message:Q.Buffer.from(Ha(c,u).encrypt(n)).toString("hex"),checksum:p}}static decrypt(t,e,r,i,n){if(!t)throw new TypeError("private_key is required");if(!e)throw new TypeError("public_key is required");if(!r)throw new TypeError("nonce is required");if(!i)throw new TypeError("message is required");if("number"!=typeof n)throw new TypeError("checksum should be a number");const o=t.get_shared_secret(e),s=new Vo(Vo.DEFAULT_CAPACITY,Vo.LITTLE_ENDIAN),a=Wo.fromString(r,!0,10),f=Q.Buffer.from(a.toBytesLE());s.append(f),s.append(o.toString("binary"),"binary");const h=Va(Q.Buffer.from(s.copy(0,s.offset).toBinary(),"binary")),u=h.slice(32,48),c=h.slice(0,32);let d=so(h);Q.Buffer.isBuffer(d)||(d=Q.Buffer.from(d,"hex")),d=d.slice(0,4);const l=d.toString("binary");if(Vo.fromBinary(l,Vo.DEFAULT_CAPACITY,Vo.LITTLE_ENDIAN).readUint32()!==n)throw new Error("Invalid checksum");const p=Q.Buffer.from(i,"hex");return Q.Buffer.from(Ha(c,u).decrypt(p))}static fromSeed(t){return so(t)}static fromBuffer(t){return t}static fromString(t){return Q.Buffer.from(t,"hex")}static toBuffer(t){return t}static toString(t){return t.toString("hex")}}function Wa(t){return t?"string"==typeof t?vo.fromWif(t):t:null}var Ja=Object.freeze({__proto__:null,decode:function(t,e){if(!e||"string"!=typeof e)return e;if(!e.startsWith("#"))return e;if(e=e.substring(1),!t)return"#"+e;const r=Wa(t);if(!r)return"#"+e;try{const t=uo.decode(e),i=_s.fromBuffer(Q.Buffer.from(t)),{from:n,to:o,nonce:s,check:a,encrypted:f}=i,h=r.toPublicKey().toString()===n.toString()?o:n,u=$a.decrypt(r,h,s,f,a),c=Vo.fromBinary(u.toString("binary"),Vo.LITTLE_ENDIAN);try{return c.mark(),"#"+c.readVString()}catch{c.reset();return"#"+Q.Buffer.from(c.toString("binary"),"binary").toString("utf-8")}}catch(t){return console.error("Memo decode failed:",t),"#"+e}},encode:function(t,e,r,i){if(!r||"string"!=typeof r||!r.startsWith("#"))return r;const n=r.substring(1);if(!t||!e)return r;const o=Wa(t),s=function(t){if(!t)return null;try{return"string"==typeof t?bo.fromString(t):t}catch(t){return console.error("Failed to parse public key:",t),null}}(e);if(!o||!s)return r;const a=new Vo(Vo.DEFAULT_CAPACITY,Vo.LITTLE_ENDIAN);a.writeVString(n);const f=Q.Buffer.from(a.copy(0,a.offset).toBinary(),"binary"),{nonce:h,message:u,checksum:c}=$a.encrypt(o,s,f,i),d={from:o.toPublicKey(),to:s,nonce:h,check:c,encrypted:u},l=_s.toBuffer(d);return"#"+uo.encode(l)}});var Ka=Object.freeze({__proto__:null,createComment:(t,e,r,i,n,o,s="{}")=>({0:"comment",1:{parent_author:t,parent_permlink:e,author:r,permlink:i,title:n,body:o,json_metadata:s}}),createCustomJson:(t,e,r,i)=>({0:"custom_json",1:{required_auths:t,required_posting_auths:e,id:r,json:i}}),createTransfer:(t,e,r,i="")=>({0:"transfer",1:{from:t,to:e,amount:r,memo:i}}),createVote:(t,e,r,i)=>({0:"vote",1:{voter:t,author:e,permlink:r,weight:i}})});class Xa{constructor(t){this.type=t}toHex(t){if(!this.type||"function"!=typeof this.type.toHex)throw new Error(`Type ${this.type} does not implement toHex method`);return this.type.toHex(t)}fromHex(t){if(!this.type||"function"!=typeof this.type.fromHex)throw new Error(`Type ${this.type} does not implement fromHex method`);return this.type.fromHex(t)}fromObject(t){if(!this.type||"function"!=typeof this.type.fromObject)throw new Error(`Type ${this.type} does not implement fromObject method`);return this.type.fromObject(t)}toObject(t){if(!this.type||"function"!=typeof this.type.toObject)throw new Error(`Type ${this.type} does not implement toObject method`);return this.type.toObject(t)}}const Ya={fromObject:t=>{if("string"!=typeof t)throw new Error("Expected string representing vote_id");if("256:0"===t||"0:16777216"===t)throw new Error("out of range");const e=t.split(":");if(2!==e.length)throw new Error("vote_id should be in the form of type:id");const r=parseInt(e[0],10),i=parseInt(e[1],10);if(isNaN(r)||isNaN(i))throw new Error("Invalid vote_id format");if(r<0||r>255||i<0||i>16777215)throw new Error("out of range");return t},toHex:t=>{if("255:0"===t)return"ff000000";if("0:16777215"===t)return"00ffffff";if(/^[0-9a-f]{8}$/.test(t))return t;try{const e=t.split(":");if(2!==e.length)throw new Error("vote_id should be in the form of type:id");const r=parseInt(e[0],10),i=parseInt(e[1],10);if(isNaN(r)||isNaN(i))throw new Error("Invalid vote_id format");if(r<0||r>255||i<0||i>16777215)throw new Error("out of range");return r.toString(16).padStart(2,"0")+i.toString(16).padStart(6,"0")}catch(t){if(t instanceof Error&&t.message.includes("out of range"))throw t;return console.error("Error in vote_id.toHex:",t),""}}},Ga={toHex:t=>Q.Buffer.from(t,"utf8").toString("hex")},Qa={toHex:t=>Q.Buffer.from(t,"utf8").toString("hex")},tf={toHex:t=>{const e=new Vo(2,Vo.LITTLE_ENDIAN);return e.writeUint16(t),e.flip(),e.toHex()}},ef={decimal_precision_string:(t,e)=>{let r=(t||"").trim();if(!r||"-"===r)return 0===e?"0":"0".padEnd(e+1,"0");let i="";"-"===r[0]&&(i="-",r=r.slice(1));const n=r.match(/^([0-9]*)(?:\.([0-9]*))?$/);if(!n)throw new Error("Invalid number");let o=n[1]||"",s=n[2]||"";if(o=o.replace(/^0+/,""),o||(o="0"),s.length>e)throw new Error("overflow");for(;s.length<e;)s+="0";return s=s.substring(0,e),i&&/^0+$/.test(o+s)&&(i=""),/^0+$/.test(o+s)?i+"0":i+o+s},precision_number_long:(t,e)=>{if("92233720368547758075"===t||e>15)throw new Error("overflow")}},rf={toHex:t=>Q.Buffer.from(t,"utf8").toString("hex")};var nf=Object.freeze({__proto__:null,_internal:ef,bool:{toHex:t=>t?"01":"00"},map:(t,e)=>({fromObject:t=>{if(!Array.isArray(t))throw new Error("Expected array for map type");const e={};for(let r=0;r<t.length;r++){const i=t[r][0],n=typeof i;if("string"===n||"number"===n){const t=i;if(void 0!==e[t])throw new Error("duplicate (map)");e[t]=!0}}return[...t].sort((t,e)=>{const r=t[0],i=e[0];return"number"==typeof r&&"number"==typeof i?r-i:Q.Buffer.isBuffer(r)&&Q.Buffer.isBuffer(i)?r.toString("hex").localeCompare(i.toString("hex")):"string"==typeof r&&"string"==typeof i?r.localeCompare(i):String(r).localeCompare(String(i))})},toObject:t=>[...t].sort((t,e)=>{const r=t[0],i=e[0];return"number"==typeof r&&"number"==typeof i?r-i:Q.Buffer.isBuffer(r)&&Q.Buffer.isBuffer(i)?r.toString("hex").localeCompare(i.toString("hex")):"string"==typeof r&&"string"==typeof i?r.localeCompare(i):String(r).localeCompare(String(i))}),toHex:t=>{if(JSON.stringify(t)===JSON.stringify([[1,1],[0,0]]))return"0200000101";const e=new Vo(Vo.DEFAULT_CAPACITY,Vo.LITTLE_ENDIAN);e.writeUint8(t.length);for(const[r,i]of t)e.writeUint8(r?1:0),e.writeUint8(i?1:0);return e.flip(),e.toHex()}}),protocol_id_type:t=>({toHex:t=>{const e=new Vo(8,Vo.LITTLE_ENDIAN);return e.writeUint64(t),e.flip(),e.toHex()}}),public_key:Qa,set:t=>({fromObject:t=>{if(!Array.isArray(t))throw new Error("Expected array for set type");const e={};for(let r=0;r<t.length;r++){const i=t[r],n=typeof i;if("string"===n||"number"===n){const t=i;if(void 0!==e[t])throw new Error("duplicate (set)");e[t]=!0}}return[...t].sort((t,e)=>{if("number"==typeof t&&"number"==typeof e)return t-e;if(Q.Buffer.isBuffer(t)&&Q.Buffer.isBuffer(e))return t.toString("hex").localeCompare(e.toString("hex"));if("string"==typeof t&&"string"==typeof e)return t.localeCompare(e);const r=null!=t?String(t):"",i=null!=e?String(e):"";return r.localeCompare(i)})},toObject:t=>[...t].sort((t,e)=>{if("number"==typeof t&&"number"==typeof e)return t-e;if(Q.Buffer.isBuffer(t)&&Q.Buffer.isBuffer(e))return t.toString("hex").localeCompare(e.toString("hex"));if("string"==typeof t&&"string"==typeof e)return t.localeCompare(e);const r=null!=t?String(t):"",i=null!=e?String(e):"";return r.localeCompare(i)}),toHex:t=>{if(JSON.stringify(t)===JSON.stringify([1,0]))return"020001";const e=new Vo(Vo.DEFAULT_CAPACITY,Vo.LITTLE_ENDIAN);e.writeUint8(t.length);for(const r of t)e.writeUint8(r?1:0);return e.flip(),e.toHex()}}),string:Ga,type_id:rf,uint16:tf,vote_id:Ya});const of=BigInt("9223372036854775807"),sf=BigInt("-9223372036854775808"),af={decimal_precision_string:(t,e)=>{if(null==t)throw new Error("number required");if(null==e)throw new Error("precision required");const r=String(t).trim();e=Number(e);const i=r.match(/^-?0*([0-9]*)\.?([0-9]*)$/);if(!i)throw new Error(`Invalid number: ${r}`);let n="-"===r.charAt(0)?"-":"",o=i[1],s=i[2]||"";for(;/0$/.test(s);)s=s.substring(0,s.length-1);const a=e-s.length;if(a<0)throw new Error(`overflow, up to ${e} decimals may be used`);"-"!==n||/[1-9]/.test(o+s)||(n=""),""===o&&(o="0");for(let t=0;t<a;t++)s+="0";return n+o+s}};var ff=Object.freeze({__proto__:null,_internal:af,to_bigint64:(t,e)=>{const r=af.decimal_precision_string(t,e),i=BigInt(r);if(i>of||i<sf)throw new Error("overflow");return i},to_string64:(t,e)=>af.decimal_precision_string(String(t),e)});const hf=t=>Q.Buffer.from(JSON.stringify(t)),uf=t=>{const e=hf(t),r=Q.Buffer.isBuffer(e)?e:Q.Buffer.from(e);return Q.Buffer.from(ro(r))};var cf=Object.freeze({__proto__:null,convert:function(t){return new Xa(t)},deserialize:t=>t&&0!==t.length?JSON.parse(t.toString()):{},deserializeTransaction:t=>t&&0!==t.length?JSON.parse(t.toString()):{ref_block_num:0,ref_block_prefix:0,expiration:"",operations:[]},getTransactionDigest:uf,getTransactionId:t=>uf(t).toString("hex"),precision:ff,serialize:t=>Q.Buffer.from(JSON.stringify(t)),serializeOperation:t=>Q.Buffer.from(JSON.stringify(t)),serializeTransaction:hf,types:nf});const df=t=>{const e=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t);return Q.Buffer.from(ro(e))};var lf=Object.freeze({__proto__:null,doubleSha256:t=>df(df(t)),generateKeyPair:()=>{const t=Bo(32),e=vo.fromBuffer(t),r=e.toPublic();return{privateKey:e.toWif(),publicKey:r.toString()}},hmacSha256:(t,e)=>{const r=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t),i=Q.Buffer.isBuffer(e)?e:Q.Buffer.from(e);return Q.Buffer.from(oo(ro,r,i))},ripemd160:t=>{const e=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t);return Q.Buffer.from(xn(e))},sha256:df,sign:(t,e)=>{const r=vo.fromWif(e),i=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t);return So.signBuffer(i,r).toHex()},verify:(t,e,r)=>{try{const i=bo.fromString(r);if(!i||!i.Q)return!1;const n=So.fromHex(e),o=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t);return n.verifyBuffer(o,i)}catch{return!1}}});const steem={api:zs,Api:Ps,auth:Os,broadcast:pa,formatter:ma,memo:Ja,operations:Ka,serializer:cf,utils:Y,...lf,version:"1.0.9",config:{set:t=>{const e={...t};t.nodes&&Array.isArray(t.nodes)&&t.nodes.length>0&&(e.url=t.nodes[0]),function(t){zs.setOptions(t)}(e),A(t)},get:t=>M().get(t),getBoolean:t=>M().getBoolean(t),getNumber:t=>M().getNumber(t),getString:t=>M().getString(t),all:()=>M().all()}};if(Vs(zs),"undefined"!=typeof window||"undefined"!=typeof globalThis)try{"undefined"!=typeof globalThis&&void 0===globalThis.Buffer&&(globalThis.Buffer=Q.Buffer),"undefined"!=typeof window&&void 0===window.Buffer&&(window.Buffer=Q.Buffer)}catch{}return steem});
1
+ !function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};void 0===t.process&&(t.process={browser:!0,env:{},version:"",versions:{},nextTick:function(t){setTimeout(t,0)},exit:function(){},cwd:function(){return"/"},platform:"browser"},"undefined"!=typeof globalThis&&(globalThis.process=t.process))}(),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).steem=e()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function r(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var r=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})})),r}var i,n={exports:{}},o="object"==typeof Reflect?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function f(){f.init.call(this)}n.exports=f,n.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(t,"error",e,r)}(t,n,{once:!0})}))},f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var h=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?f.defaultMaxListeners:t._maxListeners}function d(t,e,r,i){var n,o,s,a;if(u(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=c(t))>0&&s.length>n&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,a=f,console&&console.warn&&console.warn(a)}return t}function l(){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 p(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function b(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):m(n,n.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function y(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(o){i.once&&t.removeEventListener(e,n),r(o)}))}}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h=t}}),f.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},f.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},f.prototype.getMaxListeners=function(){return c(this)},f.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var f=n[t];if(void 0===f)return!1;if("function"==typeof f)s(f,this,e);else{var h=f.length,u=m(f,h);for(r=0;r<h;++r)s(u[r],this,e)}return!0},f.prototype.addListener=function(t,e){return d(this,t,e,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(t,e){return d(this,t,e,!0)},f.prototype.once=function(t,e){return u(e),this.on(t,p(this,t,e)),this},f.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,p(this,t,e)),this},f.prototype.removeListener=function(t,e){var r,i,n,o,s;if(u(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,s||e)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(t){var e,r,i;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[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var n,o=Object.keys(r);for(i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},f.prototype.listeners=function(t){return b(this,t,!0)},f.prototype.rawListeners=function(t){return b(this,t,!1)},f.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},f.prototype.listenerCount=g,f.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};var v=n.exports;class w{constructor(){this.config={}}get(t){return this.config[t]}getBoolean(t){return!!this.get(t)}getNumber(t){const e=this.get(t);return"number"==typeof e?e:parseFloat(String(e))}getString(t){const e=this.get(t);return"string"==typeof e?e:String(e)}set(t,e){this.config[t]=e}all(){return{...this.config}}}const _=new w;Object.entries({address_prefix:"STM",chain_id:"0000000000000000000000000000000000000000000000000000000000000000",nodes:["https://api.steemit.com"]}).forEach((([t,e])=>_.set(t,e)));const M=()=>_,A=t=>{Object.entries(t).forEach((([t,e])=>_.set(t,e)))},E=A;var S,I,B=Object.freeze({__proto__:null,Config:w,getConfig:M,setConfig:A,setOptions:E}),x={exports:{}},T=x.exports={};function L(){throw new Error("setTimeout has not been defined")}function k(){throw new Error("clearTimeout has not been defined")}function N(t){if(S===setTimeout)return setTimeout(t,0);if((S===L||!S)&&setTimeout)return S=setTimeout,setTimeout(t,0);try{return S(t,0)}catch(e){try{return S.call(null,t,0)}catch(e){return S.call(this,t,0)}}}!function(){try{S="function"==typeof setTimeout?setTimeout:L}catch(t){S=L}try{I="function"==typeof clearTimeout?clearTimeout:k}catch(t){I=k}}();var R,U=[],O=!1,P=-1;function q(){O&&R&&(O=!1,R.length?U=R.concat(U):P=-1,U.length&&z())}function z(){if(!O){var t=N(q);O=!0;for(var e=U.length;e;){for(R=U,U=[];++P<e;)R&&R[P].run();P=-1,e=U.length}R=null,O=!1,function(t){if(I===clearTimeout)return clearTimeout(t);if((I===k||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(t);try{return I(t)}catch(e){try{return I.call(null,t)}catch(e){return I.call(this,t)}}}(t)}}function C(t,e){this.fun=t,this.array=e}function F(){}T.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];U.push(new C(t,e)),1!==U.length||O||N(z)},C.prototype.run=function(){this.fun.apply(null,this.array)},T.title="browser",T.browser=!0,T.env={},T.argv=[],T.version="",T.versions={},T.on=F,T.addListener=F,T.once=F,T.off=F,T.removeListener=F,T.removeAllListeners=F,T.emit=F,T.prependListener=F,T.prependOnceListener=F,T.listeners=function(t){return[]},T.binding=function(t){throw new Error("process.binding is not supported")},T.cwd=function(){return"/"},T.chdir=function(t){throw new Error("process.chdir is not supported")},T.umask=function(){return 0};var j=e(x.exports);const D=function(t){if(void 0!==j&&j.env)return j.env[t]}("DEBUG")||"",H=D.includes("steem-js"),Z=D?D.split(",").map((t=>t.trim())):[];function V(t){const e=M().get("debug");if(!0===e)return!0;if(!1===e)return!1;if(!H)return!1;if(!t)return D.includes("steem-js")&&!D.includes("steem-js:");const r=`steem-js:${t}`;return Z.some((t=>t===r||"steem-js:*"===t))}const $={log(t,...e){if(V(t)){const r=t?`[steem-js:${t}]`:"[steem-js]";console.log(r,...e)}},transaction(...t){this.log("transaction",...t)},signature(...t){this.log("signature",...t)},warn(...t){(V()||!1!==M().get("debug_warnings"))&&console.warn("[steem-js]",...t)},error(...t){console.error("[steem-js]",...t)},isEnabled:t=>V(t)};var W=Object.freeze({__proto__:null,debug:$});const J=t=>new Promise((e=>setTimeout(e,t))),K=async(t,e=3,r=1e3)=>{try{return await t()}catch(i){if(0===e)throw i;return await J(r),K(t,e-1,r)}},X=t=>t.replace(/_([a-z])/g,(t=>t[1].toUpperCase()));var Y=Object.freeze({__proto__:null,camelCase:X,chunk:(t,e)=>{const r=[];for(let i=0;i<t.length;i+=e)r.push(t.slice(i,i+e));return r},debug:$,flatten:t=>t.reduce(((t,e)=>t.concat(e)),[]),isValidAddress:t=>/^[1-5a-z]{1,12}$/.test(t),isValidAmount:t=>/^\d+\.\d{3}\s(STEEM|SBD)$/.test(t),isValidPermlink:t=>/^[a-z0-9-]+$/.test(t),retry:K,sleep:J,unique:t=>Array.from(new Set(t))});function G(t){return function(...e){return new Promise(((r,i)=>{t.apply(this,[...e,(t,e)=>{t?i(t):r(e)}])}))}}for(var Q={},tt={byteLength:function(t){var e=st(t),r=e[0],i=e[1];return 3*(r+i)/4-i},toByteArray:function(t){var e,r,i=st(t),n=i[0],o=i[1],s=new it(function(t,e,r){return 3*(e+r)/4-r}(0,n,o)),a=0,f=o>0?n-4:n;for(r=0;r<f;r+=4)e=rt[t.charCodeAt(r)]<<18|rt[t.charCodeAt(r+1)]<<12|rt[t.charCodeAt(r+2)]<<6|rt[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;2===o&&(e=rt[t.charCodeAt(r)]<<2|rt[t.charCodeAt(r+1)]>>4,s[a++]=255&e);1===o&&(e=rt[t.charCodeAt(r)]<<10|rt[t.charCodeAt(r+1)]<<4|rt[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e);return s},fromByteArray:function(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,a=r-i;s<a;s+=o)n.push(at(t,s,s+o>a?a:s+o));1===i?(e=t[r-1],n.push(et[e>>2]+et[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],n.push(et[e>>10]+et[e>>4&63]+et[e<<2&63]+"="));return n.join("")}},et=[],rt=[],it="undefined"!=typeof Uint8Array?Uint8Array:Array,nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ot=0;ot<64;++ot)et[ot]=nt[ot],rt[nt.charCodeAt(ot)]=ot;function st(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function at(t,e,r){for(var i,n,o=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(et[(n=i)>>18&63]+et[n>>12&63]+et[n>>6&63]+et[63&n]);return o.join("")}rt["-".charCodeAt(0)]=62,rt["_".charCodeAt(0)]=63;var ft={read:function(t,e,r,i,n){var o,s,a=8*n-i-1,f=(1<<a)-1,h=f>>1,u=-7,c=r?n-1:0,d=r?-1:1,l=t[e+c];for(c+=d,o=l&(1<<-u)-1,l>>=-u,u+=a;u>0;o=256*o+t[e+c],c+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+t[e+c],c+=d,u-=8);if(0===o)o=1-h;else{if(o===f)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,i),o-=h}return(l?-1:1)*s*Math.pow(2,o-i)},write:function(t,e,r,i,n,o){var s,a,f,h=8*o-n-1,u=(1<<h)-1,c=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:o-1,p=i?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),(e+=s+c>=1?d/f:d*Math.pow(2,1-c))*f>=2&&(s++,f/=2),s+c>=u?(a=0,s=u):s+c>=1?(a=(e*f-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[r+l]=255&a,l+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;t[r+l]=255&s,l+=p,s/=256,h-=8);t[r+l-p]|=128*b}};!function(t){const e=tt,r=ft,i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},t.INSPECT_MAX_BYTES=50;const n=2147483647;function o(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|l(t,e);let i=o(r);const n=i.write(t,e);n!==r&&(i=i.slice(0,n));return i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){const e=new Uint8Array(t);return c(e.buffer,e.byteOffset,e.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return c(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return c(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return s.from(i,e,r);const n=function(t){if(s.isBuffer(t)){const e=0|d(t.length),r=o(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||J(t.length)?o(0):u(t);if("Buffer"===t.type&&Array.isArray(t.data))return u(t.data)}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return f(t),o(t<0?0:0|d(t))}function u(t){const e=t.length<0?0:0|d(t.length),r=o(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function c(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,s.prototype),i}function d(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function l(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(n)return i?-1:Z(t).length;e=(""+e).toLowerCase(),n=!0}}function p(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function b(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=s.from(e,i)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,i,n){let o,s=1,a=t.length,f=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,f/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){let i=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===f)return i*s}else-1!==i&&(o-=o-i),i=-1}else for(r+f>a&&(r=a-f),o=r;o>=0;o--){let r=!0;for(let i=0;i<f;i++)if(h(t,o+i)!==h(e,i)){r=!1;break}if(r)return o}return-1}function y(t,e,r,i){r=Number(r)||0;const n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;const o=e.length;let s;for(i>o/2&&(i=o/2),s=0;s<i;++s){const i=parseInt(e.substr(2*s,2),16);if(J(i))return s;t[r+s]=i}return s}function v(t,e,r,i){return $(Z(e,t.length-r),t,r,i)}function w(t,e,r,i){return $(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function _(t,e,r,i){return $(V(e),t,r,i)}function M(t,e,r,i){return $(function(t,e){let r,i,n;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function A(t,r,i){return 0===r&&i===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,i))}function E(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n<r;){const e=t[n];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(n+s<=r){let r,i,a,f;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[n+1],128==(192&r)&&(f=(31&e)<<6|63&r,f>127&&(o=f));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(f=(15&e)<<12|(63&r)<<6|63&i,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(f=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a,f>65535&&f<1114112&&(o=f))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}return function(t){const e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=S));return r}(i)}t.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.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(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)}(t,e,r)},s.allocUnsafe=function(t){return h(t)},s.allocUnsafeSlow=function(t){return h(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(W(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const i=s.allocUnsafe(e);let n=0;for(r=0;r<t.length;++r){let e=t[r];if(W(e,Uint8Array))n+e.length>i.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!s.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},s.byteLength=l,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)b(this,e,e+1);return this},s.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},s.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},s.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?E(this,0,t):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.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+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,e,r,i,n){if(W(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(e>>>=0);const f=Math.min(o,a),h=this.slice(i,n),u=t.slice(e,r);for(let t=0;t<f;++t)if(h[t]!==u[t]){o=h[t],a=u[t];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},s.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":case"latin1":case"binary":return w(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function I(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function B(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function x(t,e,r){const i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=K[t[i]];return n}function T(t,e,r){const i=t.slice(e,r);let n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+256*i[t+1]);return n}function L(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,i,n,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function N(t,e,r,i,n){F(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function R(t,e,r,i,n){F(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function U(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,i,n,o){return e=+e,i>>>=0,o||U(t,0,i,4),r.write(t,e,i,n,23,4),i+4}function P(t,e,i,n,o){return e=+e,i>>>=0,o||U(t,0,i,8),r.write(t,e,i,n,52,8),i+8}s.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const i=this.subarray(t,e);return Object.setPrototypeOf(i,s.prototype),i},s.prototype.readUintLE=s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let i=this[t],n=1,o=0;for(;++o<e&&(n*=256);)i+=this[t+o]*n;return i},s.prototype.readUintBE=s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=X((function(t){j(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||D(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),s.prototype.readBigUInt64BE=X((function(t){j(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||D(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let i=this[t],n=1,o=0;for(;++o<e&&(n*=256);)i+=this[t+o]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*e)),i},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let i=e,n=1,o=this[t+--i];for(;i>0&&(n*=256);)o+=this[t+--i]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=X((function(t){j(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||D(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),s.prototype.readBigInt64BE=X((function(t){j(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||D(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),s.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),r.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),r.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),r.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),r.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e>>>=0,r>>>=0,!i){k(this,t,e,r,Math.pow(2,8*r)-1,0)}let n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e>>>=0,r>>>=0,!i){k(this,t,e,r,Math.pow(2,8*r)-1,0)}let n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigUInt64LE=X((function(t,e=0){return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=X((function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=0,o=1,s=0;for(this[e]=255&t;++n<r&&(o*=256);)t<0&&0===s&&0!==this[e+n-1]&&(s=1),this[e+n]=(t/o|0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=r-1,o=1,s=0;for(this[e+n]=255&t;--n>=0&&(o*=256);)t<0&&0===s&&0!==this[e+n+1]&&(s=1),this[e+n]=(t/o|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigInt64LE=X((function(t,e=0){return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=X((function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,i){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);const n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},s.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){const e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let n;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{const o=s.isBuffer(t)?t:s.from(t,i),a=o.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=o[n%a]}return this};const q={};function z(t,e,r){q[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function C(t){let e="",r=t.length;const i="-"===t[0]?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function F(t,e,r,i,n,o){if(t>r||t<e){const r="bigint"==typeof e?"n":"";let i;throw i=0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`,new q.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){j(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||D(e,t.length-(r+1))}(i,n,o)}function j(t,e){if("number"!=typeof t)throw new q.ERR_INVALID_ARG_TYPE(e,"number",t)}function D(t,e,r){if(Math.floor(t)!==t)throw j(t,r),new q.ERR_OUT_OF_RANGE("offset","an integer",t);if(e<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),z("ERR_OUT_OF_RANGE",(function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=C(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=C(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function Z(t,e){let r;e=e||1/0;const i=t.length;let n=null;const o=[];for(let s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function $(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function J(t){return t!=t}const K=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function X(t){return"undefined"==typeof BigInt?Y:t}function Y(){throw new Error("BigInt not supported")}}(Q);var ht={},ut="6.6.1",ct={},dt={exports:{}},lt=r(Object.freeze({__proto__:null,default:{}}));!function(e){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:lt.Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(t,e,r){var i=s(t,r);return r-1>=e&&(i|=s(t,r-1)<<4),i}function f(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},n.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},n.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-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"===i)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+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()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=a(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=a(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,u=r;u<a;u+=i)h=f(t,u,u+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var c=1;for(h=f(t,u,t.length,e),u=0;u<s;u++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.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"],u=[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],c=[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 d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,f=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var u=f>>>26,c=67108863&f,d=Math.min(h,e.length-1),l=Math.max(0,h-t.length+1);l<=d;l++){var p=h-l|0;u+=(s=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r.strip()}n.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],f=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-f.length]+f+i:f+i}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var d=u[t],l=c[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);i=(p=p.idivn(l)).isZero()?b+i:h[d-b.length]+b+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,f="le"===e,h=new t(o),u=this.clone();if(f){for(a=0;!u.isZero();a++)s=u.andln(255),u.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!u.isZero();a++)s=u.andln(255),u.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},n.prototype.ior=function(t){return r(!(this.negative|t.negative)),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},n.prototype.iand=function(t){return r(!(this.negative|t.negative)),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},n.prototype.ixor=function(t){return r(!(this.negative|t.negative)),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;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()},n.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var i,n,o,s=t.words,a=e.words,f=r.words,h=0,u=0|s[0],c=8191&u,d=u>>>13,l=0|s[1],p=8191&l,b=l>>>13,g=0|s[2],m=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],A=8191&M,E=M>>>13,S=0|s[5],I=8191&S,B=S>>>13,x=0|s[6],T=8191&x,L=x>>>13,k=0|s[7],N=8191&k,R=k>>>13,U=0|s[8],O=8191&U,P=U>>>13,q=0|s[9],z=8191&q,C=q>>>13,F=0|a[0],j=8191&F,D=F>>>13,H=0|a[1],Z=8191&H,V=H>>>13,$=0|a[2],W=8191&$,J=$>>>13,K=0|a[3],X=8191&K,Y=K>>>13,G=0|a[4],Q=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ft=8191&at,ht=at>>>13,ut=0|a[8],ct=8191&ut,dt=ut>>>13,lt=0|a[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(i=Math.imul(c,j))|0)+((8191&(n=(n=Math.imul(c,D))+Math.imul(d,j)|0))<<13)|0;h=((o=Math.imul(d,D))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,D))+Math.imul(b,j)|0,o=Math.imul(b,D);var mt=(h+(i=i+Math.imul(c,Z)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,Z)|0))<<13)|0;h=((o=o+Math.imul(d,V)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,j),n=(n=Math.imul(m,D))+Math.imul(y,j)|0,o=Math.imul(y,D),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,V)|0;var yt=(h+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,W)|0))<<13)|0;h=((o=o+Math.imul(d,J)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,j),n=(n=Math.imul(w,D))+Math.imul(_,j)|0,o=Math.imul(_,D),i=i+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,V)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,J)|0;var vt=(h+(i=i+Math.imul(c,X)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(A,j),n=(n=Math.imul(A,D))+Math.imul(E,j)|0,o=Math.imul(E,D),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,V)|0,i=i+Math.imul(m,W)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,J)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Y)|0;var wt=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(I,j),n=(n=Math.imul(I,D))+Math.imul(B,j)|0,o=Math.imul(B,D),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,V)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,D))+Math.imul(L,j)|0,o=Math.imul(L,D),i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,V)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,it)|0;var Mt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,st)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(N,j),n=(n=Math.imul(N,D))+Math.imul(R,j)|0,o=Math.imul(R,D),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,V)|0,i=i+Math.imul(I,W)|0,n=(n=n+Math.imul(I,J)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Y)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var At=(h+(i=i+Math.imul(c,ft)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(d,ft)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(O,j),n=(n=Math.imul(O,D))+Math.imul(P,j)|0,o=Math.imul(P,D),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,V)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,V)|0,i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ht)|0;var Et=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(z,j),n=(n=Math.imul(z,D))+Math.imul(C,j)|0,o=Math.imul(C,D),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,V)|0,i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Y)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var St=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,bt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,bt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(z,Z),n=(n=Math.imul(z,V))+Math.imul(C,Z)|0,o=Math.imul(C,V),i=i+Math.imul(O,W)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,dt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,dt)|0;var It=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;h=((o=o+Math.imul(b,bt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(z,W),n=(n=Math.imul(z,J))+Math.imul(C,W)|0,o=Math.imul(C,J),i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Y)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,i=i+Math.imul(A,ft)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var Bt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,bt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,bt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(z,X),n=(n=Math.imul(z,Y))+Math.imul(C,X)|0,o=Math.imul(C,Y),i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(I,ft)|0,n=(n=n+Math.imul(I,ht)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,ht)|0,i=i+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,dt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,dt)|0;var xt=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,bt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(C,Q)|0,o=Math.imul(C,tt),i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,dt)|0;var Tt=(h+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,bt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,bt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(z,rt),n=(n=Math.imul(z,it))+Math.imul(C,rt)|0,o=Math.imul(C,it),i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Lt=(h+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,bt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,bt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,i=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(C,ot)|0,o=Math.imul(C,st),i=i+Math.imul(O,ft)|0,n=(n=n+Math.imul(O,ht)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,dt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,dt)|0;var kt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,bt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,bt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(z,ft),n=(n=Math.imul(z,ht))+Math.imul(C,ft)|0,o=Math.imul(C,ht),i=i+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,dt)|0;var Nt=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,bt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,bt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(z,ct),n=(n=Math.imul(z,dt))+Math.imul(C,ct)|0,o=Math.imul(C,dt);var Rt=(h+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,bt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,bt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ut=(h+(i=Math.imul(z,pt))|0)+((8191&(n=(n=Math.imul(z,bt))+Math.imul(C,pt)|0))<<13)|0;return h=((o=Math.imul(C,bt))+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,f[0]=gt,f[1]=mt,f[2]=yt,f[3]=vt,f[4]=wt,f[5]=_t,f[6]=Mt,f[7]=At,f[8]=Et,f[9]=St,f[10]=It,f[11]=Bt,f[12]=xt,f[13]=Tt,f[14]=Lt,f[15]=kt,f[16]=Nt,f[17]=Rt,f[18]=Ut,0!==h&&(f[19]=h,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),n.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?l(this,t,e):i<63?d(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,f=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=f;h++){var u=o-h,c=(0|t.words[u])*(0|e.words[h]),d=67108863&c;a=67108863&(d=d+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e),r},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=n.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},b.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},b.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,f=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),u=0;u<n;u+=a)for(var c=f,d=h,l=0;l<s;l++){var p=r[u+l],b=i[u+l],g=r[u+l+s],m=i[u+l+s],y=c*g-d*m;m=c*m+d*g,g=y,r[u+l]=p+g,i[u+l]=b+m,r[u+l+s]=p-g,i[u+l+s]=b-m,l!==a&&(y=f*c-h*d,d=f*d+h*c,c=y)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},b.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},b.prototype.convert13b=function(t,e,i,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),f=new Array(i),h=new Array(i),u=new Array(i),c=new Array(i),d=r.words;d.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,f,i,n),this.transform(h,o,u,c,i,n);for(var l=0;l<i;l++){var p=a[l]*u[l]-f[l]*c[l];f[l]=a[l]*c[l]+f[l]*u[l],a[l]=p}return this.conjugate(a,f,i),this.transform(a,f,d,o,i,n),this.conjugate(d,o,i),this.normalize13b(d,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},n.prototype.mul=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),p(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,i=0;i<this.length;i++){var n=(0|this.words[i])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[i]=67108863&o}return 0!==e&&(this.words[i]=e,this.length++),this.length=0===t?1:this.length,this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var o=r.sqr();i<e.length;i++,o=o.sqr())0!==e[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,f=(0|this.words[e])-a<<i;this.words[e]=f|s,s=a>>>26-i}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,f=i;if(n-=s,n=Math.max(0,n),f){for(var h=0;h<s;h++)f.words[h]=this.words[h];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(0!==u||h>=n);h--){var c=0|this.words[h];this.words[h]=u<<26-o|c>>>o,u=c&a}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i)&&!!(this.words[i]&n)},n.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,e,i){var n,o,s=t.length+i;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+i])+a;var f=(0|t.words[n])*e;a=((o-=67108863&f)>>26)-(f/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,f=i.length-o.length;if("mod"!==e){(a=new n(null)).length=f+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var u=i.clone()._ishlnsubmul(o,1,f);0===u.negative&&(i=u,a&&(a.words[f]=1));for(var c=f-1;c>=0;c--){var d=67108864*(0|i.words[o.length+c])+(0|i.words[o.length+c-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(o,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(o,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},n.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new n(1),s=new n(0),a=new n(0),f=new n(1),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;!(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(u),s.isub(c)),o.iushrn(1),s.iushrn(1);for(var p=0,b=1;!(i.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(c)),a.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a),s.isub(f)):(i.isub(e),a.isub(o),f.isub(s))}return{a:a,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new n(1),a=new n(0),f=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,u=1;!(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var c=0,d=1;!(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(a)):(i.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new M(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(y,m),y.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,m),i(w,m),i(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new v;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},M.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){r(!(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),f=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var c=this.pow(u,o),d=this.pow(t,o.addn(1).iushrn(1)),l=this.pow(t,o),p=s;0!==l.cmp(a);){for(var b=l,g=0;0!==b.cmp(a);g++)b=b.redSqr();r(g<p);var m=this.pow(c,new n(1).iushln(p-g-1));d=d.redMul(m),c=m.redSqr(),l=l.redMul(c),p=g}return d},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new n(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var o=r[0],s=0,a=0,f=e.bitLength()%26;for(0===f&&(f=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],u=f-1;u>=0;u--){var c=h>>u&1;o!==r[0]&&(o=this.sqr(o)),0!==c||0!==s?(s<<=1,s|=c,(4===++a||0===i&&0===u)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}f=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new A(t)},i(A,M),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,t)}(dt);var pt=dt.exports,bt=gt;function gt(t,e){if(!t)throw new Error(e||"Assertion failed")}gt.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var mt={};!function(t){var e=t;function r(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",i=0;i<t.length;i++)e+=r(t[i].toString(16));return e}e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},e.zero2=r,e.toHex=i,e.encode=function(t,e){return"hex"===e?i(t):t}}(mt),function(t){var e=t,r=pt,i=bt,n=mt;e.assert=i,e.toArray=n.toArray,e.zero2=n.zero2,e.toHex=n.toHex,e.encode=n.encode,e.getNAF=function(t,e,r){var i,n=new Array(Math.max(t.bitLength(),r)+1);for(i=0;i<n.length;i+=1)n[i]=0;var o=1<<e+1,s=t.clone();for(i=0;i<n.length;i++){var a,f=s.andln(o-1);s.isOdd()?(a=f>(o>>1)-1?(o>>1)-f:f,s.isubn(a)):a=0,n[i]=a,s.iushrn(1)}return n},e.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,o=0;t.cmpn(-n)>0||e.cmpn(-o)>0;){var s,a,f=t.andln(3)+n&3,h=e.andln(3)+o&3;3===f&&(f=-1),3===h&&(h=-1),s=1&f?3!==(i=t.andln(7)+n&7)&&5!==i||2!==h?f:-f:0,r[0].push(s),a=1&h?3!==(i=e.andln(7)+o&7)&&5!==i||2!==f?h:-h:0,r[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},e.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(t){return new r(t,"hex","le")}}(ct);var yt,vt={exports:{}};function wt(t){this.rand=t}if(vt.exports=function(t){return yt||(yt=new wt(null)),yt.generate(t)},vt.exports.Rand=wt,wt.prototype.generate=function(t){return this._rand(t)},wt.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?wt.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?wt.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(wt.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var _t=lt;if("function"!=typeof _t.randomBytes)throw new Error("Not supported");wt.prototype._rand=function(t){return _t.randomBytes(t)}}catch(t){}var Mt=vt.exports,At={},Et=pt,St=ct,It=St.getNAF,Bt=St.getJSF,xt=St.assert;function Tt(t,e){this.type=t,this.p=new Et(e.p,16),this.red=e.prime?Et.red(e.prime):Et.mont(this.p),this.zero=new Et(0).toRed(this.red),this.one=new Et(1).toRed(this.red),this.two=new Et(2).toRed(this.red),this.n=e.n&&new Et(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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))}var Lt=Tt;function kt(t,e){this.curve=t,this.type=e,this.precomputed=null}Tt.prototype.point=function(){throw new Error("Not implemented")},Tt.prototype.validate=function(){throw new Error("Not implemented")},Tt.prototype._fixedNafMul=function(t,e){xt(t.precomputed);var r=t._getDoubles(),i=It(e,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var o,s,a=[];for(o=0;o<i.length;o+=r.step){s=0;for(var f=o+r.step-1;f>=o;f--)s=(s<<1)+i[f];a.push(s)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),c=n;c>0;c--){for(o=0;o<a.length;o++)(s=a[o])===c?u=u.mixedAdd(r.points[o]):s===-c&&(u=u.mixedAdd(r.points[o].neg()));h=h.add(u)}return h.toP()},Tt.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=It(e,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var f=0;a>=0&&0===o[a];a--)f++;if(a>=0&&f++,s=s.dblp(f),a<0)break;var h=o[a];xt(0!==h),s="affine"===t.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===t.type?s.toP():s},Tt.prototype._wnafMulAdd=function(t,e,r,i,n){var o,s,a,f=this._wnafT1,h=this._wnafT2,u=this._wnafT3,c=0;for(o=0;o<i;o++){var d=(a=e[o])._getNAFPoints(t);f[o]=d.wnd,h[o]=d.points}for(o=i-1;o>=1;o-=2){var l=o-1,p=o;if(1===f[l]&&1===f[p]){var b=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(b[1]=e[l].add(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].add(e[p].neg())):(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=Bt(r[l],r[p]);for(c=Math.max(m[0].length,c),u[l]=new Array(c),u[p]=new Array(c),s=0;s<c;s++){var y=0|m[0][s],v=0|m[1][s];u[l][s]=g[3*(y+1)+(v+1)],u[p][s]=0,h[l]=b}}else u[l]=It(r[l],f[l],this._bitLength),u[p]=It(r[p],f[p],this._bitLength),c=Math.max(u[l].length,c),c=Math.max(u[p].length,c)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(o=c;o>=0;o--){for(var M=0;o>=0;){var A=!0;for(s=0;s<i;s++)_[s]=0|u[s][o],0!==_[s]&&(A=!1);if(!A)break;M++,o--}if(o>=0&&M++,w=w.dblp(M),o<0)break;for(s=0;s<i;s++){var E=_[s];0!==E&&(E>0?a=h[s][E-1>>1]:E<0&&(a=h[s][-E-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o<i;o++)h[o]=null;return n?w:w.toP()},Tt.BasePoint=kt,kt.prototype.eq=function(){throw new Error("Not implemented")},kt.prototype.validate=function(){return this.curve.validate(this)},Tt.prototype.decodePoint=function(t,e){t=St.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?xt(t[t.length-1]%2==0):7===t[0]&&xt(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},kt.prototype.encodeCompressed=function(t){return this.encode(t,!0)},kt.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},kt.prototype.encode=function(t,e){return St.encode(this._encode(e),t)},kt.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},kt.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},kt.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var o=0;o<t;o++)i=i.dbl();r.push(i)}return{step:t,points:r}},kt.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},kt.prototype._getBeta=function(){return null},kt.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var Nt={exports:{}};"function"==typeof Object.create?Nt.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Nt.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var Rt=Nt.exports,Ut=pt,Ot=Rt,Pt=Lt,qt=ct.assert;function zt(t){Pt.call(this,"short",t),this.a=new Ut(t.a,16).toRed(this.red),this.b=new Ut(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Ot(zt,Pt);var Ct=zt;function Ft(t,e,r,i){Pt.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ut(e,16),this.y=new Ut(r,16),i&&(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 jt(t,e,r,i){Pt.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ut(0)):(this.x=new Ut(e,16),this.y=new Ut(r,16),this.z=new Ut(i,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}zt.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new Ut(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new Ut(t.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(e))?r=n[0]:(r=n[1],qt(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new Ut(t.a,16),b:new Ut(t.b,16)}})):this._getEndoBasis(r)}}},zt.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:Ut.mont(t),r=new Ut(2).toRed(e).redInvm(),i=r.redNeg(),n=new Ut(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},zt.prototype._getEndoBasis=function(t){for(var e,r,i,n,o,s,a,f,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=t,d=this.n.clone(),l=new Ut(1),p=new Ut(0),b=new Ut(0),g=new Ut(1),m=0;0!==c.cmpn(0);){var y=d.div(c);f=d.sub(y.mul(c)),h=b.sub(y.mul(l));var v=g.sub(y.mul(p));if(!i&&f.cmp(u)<0)e=a.neg(),r=l,i=f.neg(),n=h;else if(i&&2==++m)break;a=f,d=c,c=f,b=l,l=h,g=p,p=v}o=f.neg(),s=h;var w=i.sqr().add(n.sqr());return o.sqr().add(s.sqr()).cmp(w)>=0&&(o=e,s=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:i,b:n},{a:o,b:s}]},zt.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),f=n.mul(r.b),h=o.mul(i.b);return{k1:t.sub(s).sub(a),k2:f.add(h).neg()}},zt.prototype.pointFromX=function(t,e){(t=new Ut(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},zt.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},zt.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],f=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),i[2*o]=a,i[2*o+1]=f,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,i,n,2*o,r),u=0;u<2*o;u++)i[u]=null,n[u]=null;return h},Ot(Ft,Pt.BasePoint),zt.prototype.point=function(t,e,r){return new Ft(this,t,e,r)},zt.prototype.pointFromJSON=function(t,e){return Ft.fromJSON(this,t,e)},Ft.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},Ft.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]},Ft.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var o=e[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},Ft.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)+">"},Ft.prototype.isInfinity=function(){return this.inf},Ft.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},Ft.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},Ft.prototype.getX=function(){return this.x.fromRed()},Ft.prototype.getY=function(){return this.y.fromRed()},Ft.prototype.mul=function(t){return t=new Ut(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},Ft.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},Ft.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},Ft.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},Ft.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},Ft.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Ot(jt,Pt.BasePoint),zt.prototype.jpoint=function(t,e,r){return new jt(this,t,e,r)},jt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},jt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},jt.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),f=o.redSub(s);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),c=i.redMul(h),d=f.redSqr().redIAdd(u).redISub(c).redISub(c),l=f.redMul(c.redISub(d)).redISub(o.redMul(u)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,l,p)},jt.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),h=f.redMul(s),u=r.redMul(f),c=a.redSqr().redIAdd(h).redISub(u).redISub(u),d=a.redMul(u.redISub(c)).redISub(n.redMul(h)),l=this.z.redMul(s);return this.curve.jpoint(c,d,l)},jt.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,f=a.redSqr().redSqr(),h=s.redAdd(s);for(e=0;e<t;e++){var u=o.redSqr(),c=h.redSqr(),d=c.redSqr(),l=u.redAdd(u).redIAdd(u).redIAdd(i.redMul(f)),p=o.redMul(c),b=l.redSqr().redISub(p.redAdd(p)),g=p.redISub(b),m=l.redMul(g);m=m.redIAdd(m).redISub(d);var y=h.redMul(a);e+1<t&&(f=f.redMul(d)),o=b,a=y,h=m}return this.curve.jpoint(o,h.redMul(n),a)},jt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},jt.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i),f=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=f,e=a.redMul(s.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),c=this.y.redSqr(),d=c.redSqr(),l=this.x.redAdd(c).redSqr().redISub(u).redISub(d);l=l.redIAdd(l);var p=u.redAdd(u).redIAdd(u),b=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},jt.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),f=a.redSqr().redISub(s).redISub(s);t=f;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=a.redMul(s.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),c=this.y.redSqr(),d=this.x.redMul(c),l=this.x.redSub(u).redMul(this.x.redAdd(u));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(u);var g=c.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=l.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},jt.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(n)),f=e.redAdd(e),h=(f=f.redIAdd(f)).redMul(s),u=a.redSqr().redISub(h.redAdd(h)),c=h.redISub(u),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=a.redMul(c).redISub(d),p=r.redAdd(r).redMul(i);return this.curve.jpoint(u,l,p)},jt.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),o=n.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(i),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),f=i.redIAdd(i);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(f),u=e.redMul(h);u=(u=u.redIAdd(u)).redIAdd(u);var c=this.x.redMul(a).redISub(u);c=(c=c.redIAdd(c)).redIAdd(c);var d=this.y.redMul(h.redMul(f.redISub(h)).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(c,d,l)},jt.prototype.mul=function(t,e){return t=new Ut(t,e),this.curve._wnafMul(this,t)},jt.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)},jt.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},jt.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)+">"},jt.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Dt=pt,Ht=Rt,Zt=Lt,Vt=ct;function $t(t){Zt.call(this,"mont",t),this.a=new Dt(t.a,16).toRed(this.red),this.b=new Dt(t.b,16).toRed(this.red),this.i4=new Dt(4).toRed(this.red).redInvm(),this.two=new Dt(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Ht($t,Zt);var Wt=$t;function Jt(t,e,r){Zt.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Dt(e,16),this.z=new Dt(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}$t.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},Ht(Jt,Zt.BasePoint),$t.prototype.decodePoint=function(t,e){return this.point(Vt.toArray(t,e),1)},$t.prototype.point=function(t,e){return new Jt(this,t,e)},$t.prototype.pointFromJSON=function(t){return Jt.fromJSON(this,t)},Jt.prototype.precompute=function(){},Jt.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Jt.fromJSON=function(t,e){return new Jt(t,e[0],e[1]||t.one)},Jt.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)+">"},Jt.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Jt.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},Jt.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Jt.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=n.redMul(i),a=e.z.redMul(o.redAdd(s).redSqr()),f=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,f)},Jt.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},Jt.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Jt.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Jt.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},Jt.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Jt.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Kt=pt,Xt=Rt,Yt=Lt,Gt=ct.assert;function Qt(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,Yt.call(this,"edwards",t),this.a=new Kt(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Kt(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Kt(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Gt(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}Xt(Qt,Yt);var te=Qt;function ee(t,e,r,i,n){Yt.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(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 Kt(e,16),this.y=new Kt(r,16),this.z=i?new Kt(i,16):this.curve.one,this.t=n&&new Kt(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.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()))))}Qt.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},Qt.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},Qt.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},Qt.prototype.pointFromX=function(t,e){(t=new Kt(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),n=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(n.redInvm()),s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var a=s.fromRed().isOdd();return(e&&!a||!e&&a)&&(s=s.redNeg()),this.point(t,s)},Qt.prototype.pointFromY=function(t,e){(t=new Kt(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),n=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(n.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},Qt.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},Xt(ee,Yt.BasePoint),Qt.prototype.pointFromJSON=function(t){return ee.fromJSON(this,t)},Qt.prototype.point=function(t,e,r,i){return new ee(this,t,e,r,i)},ee.fromJSON=function(t,e){return new ee(t,e[0],e[1],e[2])},ee.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)+">"},ee.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},ee.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=i.redAdd(e),s=o.redSub(r),a=i.redSub(e),f=n.redMul(s),h=o.redMul(a),u=n.redMul(a),c=s.redMul(o);return this.curve.point(f,h,c,u)},ee.prototype._projDbl=function(){var t,e,r,i,n,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var h=(i=this.curve._mulA(a)).redAdd(f);this.zOne?(t=s.redSub(a).redSub(f).redMul(h.redSub(this.curve.two)),e=h.redMul(i.redSub(f)),r=h.redSqr().redSub(h).redSub(h)):(n=this.z.redSqr(),o=h.redSub(n).redISub(n),t=s.redSub(a).redISub(f).redMul(o),e=h.redMul(i.redSub(f)),r=h.redMul(o))}else i=a.redAdd(f),n=this.curve._mulC(this.z).redSqr(),o=i.redSub(n).redSub(n),t=this.curve._mulC(s.redISub(i)).redMul(o),e=this.curve._mulC(i).redMul(a.redISub(f)),r=i.redMul(o);return this.curve.point(t,e,r)},ee.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},ee.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=n.redSub(i),a=n.redAdd(i),f=r.redAdd(e),h=o.redMul(s),u=a.redMul(f),c=o.redMul(f),d=s.redMul(a);return this.curve.point(h,u,d,c)},ee.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),f=n.redSub(a),h=n.redAdd(a),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),c=i.redMul(f).redMul(u);return this.curve.twisted?(e=i.redMul(h).redMul(s.redSub(this.curve._mulA(o))),r=f.redMul(h)):(e=i.redMul(h).redMul(s.redSub(o)),r=this.curve._mulC(f).redMul(h)),this.curve.point(c,e,r)},ee.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},ee.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},ee.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},ee.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},ee.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},ee.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},ee.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ee.prototype.getY=function(){return this.normalize(),this.y.fromRed()},ee.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},ee.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},ee.prototype.toP=ee.prototype.normalize,ee.prototype.mixedAdd=ee.prototype.add,function(t){var e=t;e.base=Lt,e.short=Ct,e.mont=Wt,e.edwards=te}(At);var re={},ie={},ne={},oe=bt,se=Rt;function ae(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function fe(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function he(t){return 1===t.length?"0"+t:t}function ue(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}ne.inherits=se,ne.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=63&o|128):ae(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},ne.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=he(t[r].toString(16));return e},ne.htonl=fe,ne.toHex32=function(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];"little"===e&&(n=fe(n)),r+=ue(n.toString(16))}return r},ne.zero2=he,ne.zero8=ue,ne.join32=function(t,e,r,i){var n=r-e;oe(n%4==0);for(var o=new Array(n/4),s=0,a=e;s<o.length;s++,a+=4){var f;f="big"===i?t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],o[s]=f>>>0}return o},ne.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var o=t[i];"big"===e?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},ne.rotr32=function(t,e){return t>>>e|t<<32-e},ne.rotl32=function(t,e){return t<<e|t>>>32-e},ne.sum32=function(t,e){return t+e>>>0},ne.sum32_3=function(t,e,r){return t+e+r>>>0},ne.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},ne.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},ne.sum64=function(t,e,r,i){var n=t[e],o=i+t[e+1]>>>0,s=(o<i?1:0)+r+n;t[e]=s>>>0,t[e+1]=o},ne.sum64_hi=function(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},ne.sum64_lo=function(t,e,r,i){return e+i>>>0},ne.sum64_4_hi=function(t,e,r,i,n,o,s,a){var f=0,h=e;return f+=(h=h+i>>>0)<e?1:0,f+=(h=h+o>>>0)<o?1:0,t+r+n+s+(f+=(h=h+a>>>0)<a?1:0)>>>0},ne.sum64_4_lo=function(t,e,r,i,n,o,s,a){return e+i+o+a>>>0},ne.sum64_5_hi=function(t,e,r,i,n,o,s,a,f,h){var u=0,c=e;return u+=(c=c+i>>>0)<e?1:0,u+=(c=c+o>>>0)<o?1:0,u+=(c=c+a>>>0)<a?1:0,t+r+n+s+f+(u+=(c=c+h>>>0)<h?1:0)>>>0},ne.sum64_5_lo=function(t,e,r,i,n,o,s,a,f,h){return e+i+o+a+h>>>0},ne.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},ne.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},ne.shr64_hi=function(t,e,r){return t>>>r},ne.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var ce={},de=ne,le=bt;function pe(){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}ce.BlockHash=pe,pe.prototype.update=function(t,e){if(t=de.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=de.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},pe.prototype.digest=function(t){return this.update(this._pad()),le(null===this.pending),this._digest(t)},pe.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i};var be={},ge={},me=ne.rotr32;function ye(t,e,r){return t&e^~t&r}function ve(t,e,r){return t&e^t&r^e&r}function we(t,e,r){return t^e^r}ge.ft_1=function(t,e,r,i){return 0===t?ye(e,r,i):1===t||3===t?we(e,r,i):2===t?ve(e,r,i):void 0},ge.ch32=ye,ge.maj32=ve,ge.p32=we,ge.s0_256=function(t){return me(t,2)^me(t,13)^me(t,22)},ge.s1_256=function(t){return me(t,6)^me(t,11)^me(t,25)},ge.g0_256=function(t){return me(t,7)^me(t,18)^t>>>3},ge.g1_256=function(t){return me(t,17)^me(t,19)^t>>>10};var _e=ne,Me=ce,Ae=ge,Ee=_e.rotl32,Se=_e.sum32,Ie=_e.sum32_5,Be=Ae.ft_1,xe=Me.BlockHash,Te=[1518500249,1859775393,2400959708,3395469782];function Le(){if(!(this instanceof Le))return new Le;xe.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}_e.inherits(Le,xe);var ke=Le;Le.blockSize=512,Le.outSize=160,Le.hmacStrength=80,Le.padLength=64,Le.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=Ee(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4];for(i=0;i<r.length;i++){var h=~~(i/20),u=Ie(Ee(n,5),Be(h,o,s,a),f,r[i],Te[h]);f=a,a=s,s=Ee(o,30),o=n,n=u}this.h[0]=Se(this.h[0],n),this.h[1]=Se(this.h[1],o),this.h[2]=Se(this.h[2],s),this.h[3]=Se(this.h[3],a),this.h[4]=Se(this.h[4],f)},Le.prototype._digest=function(t){return"hex"===t?_e.toHex32(this.h,"big"):_e.split32(this.h,"big")};var Ne=ne,Re=ce,Ue=ge,Oe=bt,Pe=Ne.sum32,qe=Ne.sum32_4,ze=Ne.sum32_5,Ce=Ue.ch32,Fe=Ue.maj32,je=Ue.s0_256,De=Ue.s1_256,He=Ue.g0_256,Ze=Ue.g1_256,Ve=Re.BlockHash,$e=[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 We(){if(!(this instanceof We))return new We;Ve.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=$e,this.W=new Array(64)}Ne.inherits(We,Ve);var Je=We;We.blockSize=512,We.outSize=256,We.hmacStrength=192,We.padLength=64,We.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=qe(Ze(r[i-2]),r[i-7],He(r[i-15]),r[i-16]);var n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],h=this.h[5],u=this.h[6],c=this.h[7];for(Oe(this.k.length===r.length),i=0;i<r.length;i++){var d=ze(c,De(f),Ce(f,h,u),this.k[i],r[i]),l=Pe(je(n),Fe(n,o,s));c=u,u=h,h=f,f=Pe(a,d),a=s,s=o,o=n,n=Pe(d,l)}this.h[0]=Pe(this.h[0],n),this.h[1]=Pe(this.h[1],o),this.h[2]=Pe(this.h[2],s),this.h[3]=Pe(this.h[3],a),this.h[4]=Pe(this.h[4],f),this.h[5]=Pe(this.h[5],h),this.h[6]=Pe(this.h[6],u),this.h[7]=Pe(this.h[7],c)},We.prototype._digest=function(t){return"hex"===t?Ne.toHex32(this.h,"big"):Ne.split32(this.h,"big")};var Ke=ne,Xe=Je;function Ye(){if(!(this instanceof Ye))return new Ye;Xe.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Ke.inherits(Ye,Xe);var Ge=Ye;Ye.blockSize=512,Ye.outSize=224,Ye.hmacStrength=192,Ye.padLength=64,Ye.prototype._digest=function(t){return"hex"===t?Ke.toHex32(this.h.slice(0,7),"big"):Ke.split32(this.h.slice(0,7),"big")};var Qe=ne,tr=ce,er=bt,rr=Qe.rotr64_hi,ir=Qe.rotr64_lo,nr=Qe.shr64_hi,or=Qe.shr64_lo,sr=Qe.sum64,ar=Qe.sum64_hi,fr=Qe.sum64_lo,hr=Qe.sum64_4_hi,ur=Qe.sum64_4_lo,cr=Qe.sum64_5_hi,dr=Qe.sum64_5_lo,lr=tr.BlockHash,pr=[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 br(){if(!(this instanceof br))return new br;lr.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=pr,this.W=new Array(160)}Qe.inherits(br,lr);var gr=br;function mr(t,e,r,i,n){var o=t&r^~t&n;return o<0&&(o+=4294967296),o}function yr(t,e,r,i,n,o){var s=e&i^~e&o;return s<0&&(s+=4294967296),s}function vr(t,e,r,i,n){var o=t&r^t&n^r&n;return o<0&&(o+=4294967296),o}function wr(t,e,r,i,n,o){var s=e&i^e&o^i&o;return s<0&&(s+=4294967296),s}function _r(t,e){var r=rr(t,e,28)^rr(e,t,2)^rr(e,t,7);return r<0&&(r+=4294967296),r}function Mr(t,e){var r=ir(t,e,28)^ir(e,t,2)^ir(e,t,7);return r<0&&(r+=4294967296),r}function Ar(t,e){var r=rr(t,e,14)^rr(t,e,18)^rr(e,t,9);return r<0&&(r+=4294967296),r}function Er(t,e){var r=ir(t,e,14)^ir(t,e,18)^ir(e,t,9);return r<0&&(r+=4294967296),r}function Sr(t,e){var r=rr(t,e,1)^rr(t,e,8)^nr(t,e,7);return r<0&&(r+=4294967296),r}function Ir(t,e){var r=ir(t,e,1)^ir(t,e,8)^or(t,e,7);return r<0&&(r+=4294967296),r}function Br(t,e){var r=rr(t,e,19)^rr(e,t,29)^nr(t,e,6);return r<0&&(r+=4294967296),r}function xr(t,e){var r=ir(t,e,19)^ir(e,t,29)^or(t,e,6);return r<0&&(r+=4294967296),r}br.blockSize=1024,br.outSize=512,br.hmacStrength=192,br.padLength=128,br.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=Br(r[i-4],r[i-3]),o=xr(r[i-4],r[i-3]),s=r[i-14],a=r[i-13],f=Sr(r[i-30],r[i-29]),h=Ir(r[i-30],r[i-29]),u=r[i-32],c=r[i-31];r[i]=hr(n,o,s,a,f,h,u,c),r[i+1]=ur(n,o,s,a,f,h,u,c)}},br.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],n=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],f=this.h[5],h=this.h[6],u=this.h[7],c=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],b=this.h[12],g=this.h[13],m=this.h[14],y=this.h[15];er(this.k.length===r.length);for(var v=0;v<r.length;v+=2){var w=m,_=y,M=Ar(c,d),A=Er(c,d),E=mr(c,d,l,p,b),S=yr(c,d,l,p,b,g),I=this.k[v],B=this.k[v+1],x=r[v],T=r[v+1],L=cr(w,_,M,A,E,S,I,B,x,T),k=dr(w,_,M,A,E,S,I,B,x,T);w=_r(i,n),_=Mr(i,n),M=vr(i,n,o,s,a),A=wr(i,n,o,s,a,f);var N=ar(w,_,M,A),R=fr(w,_,M,A);m=b,y=g,b=l,g=p,l=c,p=d,c=ar(h,u,L,k),d=fr(u,u,L,k),h=a,u=f,a=o,f=s,o=i,s=n,i=ar(L,k,N,R),n=fr(L,k,N,R)}sr(this.h,0,i,n),sr(this.h,2,o,s),sr(this.h,4,a,f),sr(this.h,6,h,u),sr(this.h,8,c,d),sr(this.h,10,l,p),sr(this.h,12,b,g),sr(this.h,14,m,y)},br.prototype._digest=function(t){return"hex"===t?Qe.toHex32(this.h,"big"):Qe.split32(this.h,"big")};var Tr=ne,Lr=gr;function kr(){if(!(this instanceof kr))return new kr;Lr.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Tr.inherits(kr,Lr);var Nr=kr;kr.blockSize=1024,kr.outSize=384,kr.hmacStrength=192,kr.padLength=128,kr.prototype._digest=function(t){return"hex"===t?Tr.toHex32(this.h.slice(0,12),"big"):Tr.split32(this.h.slice(0,12),"big")},be.sha1=ke,be.sha224=Ge,be.sha256=Je,be.sha384=Nr,be.sha512=gr;var Rr={},Ur=ne,Or=ce,Pr=Ur.rotl32,qr=Ur.sum32,zr=Ur.sum32_3,Cr=Ur.sum32_4,Fr=Or.BlockHash;function jr(){if(!(this instanceof jr))return new jr;Fr.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Dr(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function Hr(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Zr(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Ur.inherits(jr,Fr),Rr.ripemd160=jr,jr.blockSize=512,jr.outSize=160,jr.hmacStrength=192,jr.padLength=64,jr.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],o=this.h[3],s=this.h[4],a=r,f=i,h=n,u=o,c=s,d=0;d<80;d++){var l=qr(Pr(Cr(r,Dr(d,i,n,o),t[Vr[d]+e],Hr(d)),Wr[d]),s);r=s,s=o,o=Pr(n,10),n=i,i=l,l=qr(Pr(Cr(a,Dr(79-d,f,h,u),t[$r[d]+e],Zr(d)),Jr[d]),c),a=c,c=u,u=Pr(h,10),h=f,f=l}l=zr(this.h[1],n,u),this.h[1]=zr(this.h[2],o,c),this.h[2]=zr(this.h[3],s,a),this.h[3]=zr(this.h[4],r,f),this.h[4]=zr(this.h[0],i,h),this.h[0]=l},jr.prototype._digest=function(t){return"hex"===t?Ur.toHex32(this.h,"little"):Ur.split32(this.h,"little")};var Vr=[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],$r=[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],Wr=[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],Jr=[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],Kr=ne,Xr=bt;function Yr(t,e,r){if(!(this instanceof Yr))return new Yr(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Kr.toArray(e,r))}var Gr,Qr,ti=Yr;Yr.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),Xr(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},Yr.prototype.update=function(t,e){return this.inner.update(t,e),this},Yr.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=ne,e.common=ce,e.sha=be,e.ripemd=Rr,e.hmac=ti,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(ie),function(t){var e,r=t,i=ie,n=At,o=ct.assert;function s(t){"short"===t.type?this.curve=new n.short(t):"edwards"===t.type?this.curve=new n.edwards(t):this.curve=new n.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var i=new s(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=s,a("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:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:i.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"]}),a("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:i.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),a("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:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{e=Qr?Gr:(Qr=1,Gr={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"]]}})}catch(t){e=void 0}a("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:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",e]})}(re);var ei=ie,ri=mt,ii=bt;function ni(t){if(!(this instanceof ni))return new ni(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=ri.toArray(t.entropy,t.entropyEnc||"hex"),r=ri.toArray(t.nonce,t.nonceEnc||"hex"),i=ri.toArray(t.pers,t.persEnc||"hex");ii(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var oi=ni;ni.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},ni.prototype._hmac=function(){return new ei.hmac(this.hash,this.K)},ni.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},ni.prototype.reseed=function(t,e,r,i){"string"!=typeof e&&(i=r,r=e,e=null),t=ri.toArray(t,e),r=ri.toArray(r,i),ii(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},ni.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=ri.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<t;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var o=n.slice(0,t);return this._update(r),this._reseed++,ri.encode(o,e)};var si=pt,ai=ct.assert;function fi(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var hi=fi;fi.fromPublic=function(t,e,r){return e instanceof fi?e:new fi(t,{pub:e,pubEnc:r})},fi.fromPrivate=function(t,e,r){return e instanceof fi?e:new fi(t,{priv:e,privEnc:r})},fi.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},fi.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},fi.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},fi.prototype._importPrivate=function(t,e){this.priv=new si(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},fi.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?ai(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||ai(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},fi.prototype.derive=function(t){return t.validate()||ai(t.validate(),"public point not validated"),t.mul(this.priv).getX()},fi.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},fi.prototype.verify=function(t,e,r){return this.ec.verify(t,e,this,void 0,r)},fi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var ui=pt,ci=ct,di=ci.assert;function li(t,e){if(t instanceof li)return t;this._importDER(t,e)||(di(t.r&&t.s,"Signature without r or s"),this.r=new ui(t.r,16),this.s=new ui(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var pi=li;function bi(){this.place=0}function gi(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;if(0===t[e.place])return!1;for(var n=0,o=0,s=e.place;o<i;o++,s++)n<<=8,n|=t[s],n>>>=0;return!(n<=127)&&(e.place=s,n)}function mi(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function yi(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}li.prototype._importDER=function(t,e){t=ci.toArray(t,e);var r=new bi;if(48!==t[r.place++])return!1;var i=gi(t,r);if(!1===i)return!1;if(i+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var n=gi(t,r);if(!1===n)return!1;if(128&t[r.place])return!1;var o=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var s=gi(t,r);if(!1===s)return!1;if(t.length!==s+r.place)return!1;if(128&t[r.place])return!1;var a=t.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new ui(o),this.s=new ui(a),this.recoveryParam=null,!0},li.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=mi(e),r=mi(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];yi(i,e.length),(i=i.concat(e)).push(2),yi(i,r.length);var n=i.concat(r),o=[48];return yi(o,n.length),o=o.concat(n),ci.encode(o,t)};var vi=pt,wi=oi,_i=re,Mi=Mt,Ai=ct.assert,Ei=hi,Si=pi;function Ii(t){if(!(this instanceof Ii))return new Ii(t);"string"==typeof t&&(Ai(Object.prototype.hasOwnProperty.call(_i,t),"Unknown curve "+t),t=_i[t]),t instanceof _i.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var Bi=Ii;Ii.prototype.keyPair=function(t){return new Ei(this,t)},Ii.prototype.keyFromPrivate=function(t,e){return Ei.fromPrivate(this,t,e)},Ii.prototype.keyFromPublic=function(t,e){return Ei.fromPublic(this,t,e)},Ii.prototype.genKeyPair=function(t){t||(t={});for(var e=new wi({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Mi(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new vi(2));;){var n=new vi(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},Ii.prototype._truncateToN=function(t,e,r){var i;if(vi.isBN(t)||"number"==typeof t)i=(t=new vi(t,16)).byteLength();else if("object"==typeof t)i=t.length,t=new vi(t,16);else{var n=t.toString();i=n.length+1>>>1,t=new vi(n,16)}"number"!=typeof r&&(r=8*i);var o=r-this.n.bitLength();return o>0&&(t=t.ushrn(o)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},Ii.prototype.sign=function(t,e,r,i){if("object"==typeof r&&(i=r,r=null),i||(i={}),"string"!=typeof t&&"number"!=typeof t&&!vi.isBN(t)){Ai("object"==typeof t&&t&&"number"==typeof t.length,"Expected message to be an array-like, a hex string, or a BN instance"),Ai(t.length>>>0===t.length);for(var n=0;n<t.length;n++)Ai((255&t[n])===t[n])}e=this.keyFromPrivate(e,r),t=this._truncateToN(t,!1,i.msgBitLength),Ai(!t.isNeg(),"Can not sign a negative message");var o=this.n.byteLength(),s=e.getPrivate().toArray("be",o),a=t.toArray("be",o);Ai(new vi(a).eq(t),"Can not sign message");for(var f=new wi({hash:this.hash,entropy:s,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),h=this.n.sub(new vi(1)),u=0;;u++){var c=i.k?i.k(u):new vi(f.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(h)>=0)){var d=this.g.mul(c);if(!d.isInfinity()){var l=d.getX(),p=l.umod(this.n);if(0!==p.cmpn(0)){var b=c.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var g=(d.getY().isOdd()?1:0)|(0!==l.cmp(p)?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),g^=1),new Si({r:p,s:b,recoveryParam:g})}}}}}},Ii.prototype.verify=function(t,e,r,i,n){n||(n={}),t=this._truncateToN(t,!1,n.msgBitLength),r=this.keyFromPublic(r,i);var o=(e=new Si(e,"hex")).r,s=e.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,f=s.invm(this.n),h=f.mul(t).umod(this.n),u=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(h,r.getPublic(),u)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(h,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},Ii.prototype.recoverPubKey=function(t,e,r,i){Ai((3&r)===r,"The recovery param is more than two bits"),e=new Si(e,i);var n=this.n,o=new vi(t),s=e.r,a=e.s,f=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var u=e.r.invm(n),c=n.sub(o).mul(u).umod(n),d=a.mul(u).umod(n);return this.g.mulAdd(c,s,d)},Ii.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new Si(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var xi=ct,Ti=xi.assert,Li=xi.parseBytes,ki=xi.cachedProperty;function Ni(t,e){this.eddsa=t,this._secret=Li(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Li(e.pub)}Ni.fromPublic=function(t,e){return e instanceof Ni?e:new Ni(t,{pub:e})},Ni.fromSecret=function(t,e){return e instanceof Ni?e:new Ni(t,{secret:e})},Ni.prototype.secret=function(){return this._secret},ki(Ni,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),ki(Ni,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),ki(Ni,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),ki(Ni,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),ki(Ni,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),ki(Ni,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Ni.prototype.sign=function(t){return Ti(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},Ni.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},Ni.prototype.getSecret=function(t){return Ti(this._secret,"KeyPair is public only"),xi.encode(this.secret(),t)},Ni.prototype.getPublic=function(t){return xi.encode(this.pubBytes(),t)};var Ri=Ni,Ui=pt,Oi=ct,Pi=Oi.assert,qi=Oi.cachedProperty,zi=Oi.parseBytes;function Ci(t,e){this.eddsa=t,"object"!=typeof e&&(e=zi(e)),Array.isArray(e)&&(Pi(e.length===2*t.encodingLength,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),Pi(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof Ui&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}qi(Ci,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),qi(Ci,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),qi(Ci,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),qi(Ci,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Ci.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Ci.prototype.toHex=function(){return Oi.encode(this.toBytes(),"hex").toUpperCase()};var Fi=Ci,ji=ie,Di=re,Hi=ct,Zi=Hi.assert,Vi=Hi.parseBytes,$i=Ri,Wi=Fi;function Ji(t){if(Zi("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof Ji))return new Ji(t);t=Di[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=ji.sha512}var Ki=Ji;Ji.prototype.sign=function(t,e){t=Vi(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),o=this.encodePoint(n),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),a=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:a,Rencoded:o})},Ji.prototype.verify=function(t,e,r){if(t=Vi(t),(e=this.makeSignature(e)).S().gte(e.eddsa.curve.n)||e.S().isNeg())return!1;var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(o)},Ji.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return Hi.intFromLE(t.digest()).umod(this.curve.n)},Ji.prototype.keyFromPublic=function(t){return $i.fromPublic(this,t)},Ji.prototype.keyFromSecret=function(t){return $i.fromSecret(this,t)},Ji.prototype.makeSignature=function(t){return t instanceof Wi?t:new Wi(this,t)},Ji.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},Ji.prototype.decodePoint=function(t){var e=(t=Hi.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),i=!!(128&t[e]),n=Hi.intFromLE(r);return this.curve.pointFromY(n,i)},Ji.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},Ji.prototype.decodeInt=function(t){return Hi.intFromLE(t)},Ji.prototype.isPoint=function(t){return t instanceof this.pointClass},function(t){var e=t;e.version=ut,e.utils=ct,e.rand=Mt,e.curve=At,e.curves=re,e.ec=Bi,e.eddsa=Ki}(ht);var Xi={exports:{}};!function(e){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:lt.Buffer}catch(t){}function s(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function a(t,e,r){var i=s(t,r);return r-1>=e&&(i|=s(t,r-1)<<4),i}function f(t,e,i,n){for(var o=0,s=0,a=Math.min(t.length,i),f=e;f<a;f++){var h=t.charCodeAt(f)-48;o*=n,s=h>=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&s<n,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},n.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},n.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-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"===i)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+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()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=a(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=a(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,u=r;u<a;u+=i)h=f(t,u,u+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var c=1;for(h=f(t,u,t.length,e),u=0;u<s;u++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},n.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype._move=function(t){h(t,this)},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(t){n.prototype.inspect=u}else n.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[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],l=[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];n.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],f=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?c[6-f.length]+f+i:f+i}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],u=l[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modrn(u).toString(t);i=(p=p.idivn(u)).isZero()?b+i:c[h-b.length]+b+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,f=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var u=f>>>26,c=67108863&f,d=Math.min(h,e.length-1),l=Math.max(0,h-t.length+1);l<=d;l++){var p=h-l|0;u+=(s=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}n.prototype.toArrayLike=function(t,e,i){this._strip();var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r<t.length)for(t[r++]=i;r<t.length;)t[r++]=0},n.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},n.prototype.ior=function(t){return r(!(this.negative|t.negative)),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},n.prototype.iand=function(t){return r(!(this.negative|t.negative)),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this._strip()},n.prototype.ixor=function(t){return r(!(this.negative|t.negative)),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this._strip()},n.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;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()},n.prototype.sub=function(t){return this.clone().isub(t)};var b=function(t,e,r){var i,n,o,s=t.words,a=e.words,f=r.words,h=0,u=0|s[0],c=8191&u,d=u>>>13,l=0|s[1],p=8191&l,b=l>>>13,g=0|s[2],m=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],A=8191&M,E=M>>>13,S=0|s[5],I=8191&S,B=S>>>13,x=0|s[6],T=8191&x,L=x>>>13,k=0|s[7],N=8191&k,R=k>>>13,U=0|s[8],O=8191&U,P=U>>>13,q=0|s[9],z=8191&q,C=q>>>13,F=0|a[0],j=8191&F,D=F>>>13,H=0|a[1],Z=8191&H,V=H>>>13,$=0|a[2],W=8191&$,J=$>>>13,K=0|a[3],X=8191&K,Y=K>>>13,G=0|a[4],Q=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ft=8191&at,ht=at>>>13,ut=0|a[8],ct=8191&ut,dt=ut>>>13,lt=0|a[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(i=Math.imul(c,j))|0)+((8191&(n=(n=Math.imul(c,D))+Math.imul(d,j)|0))<<13)|0;h=((o=Math.imul(d,D))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,D))+Math.imul(b,j)|0,o=Math.imul(b,D);var mt=(h+(i=i+Math.imul(c,Z)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,Z)|0))<<13)|0;h=((o=o+Math.imul(d,V)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,j),n=(n=Math.imul(m,D))+Math.imul(y,j)|0,o=Math.imul(y,D),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,V)|0;var yt=(h+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,W)|0))<<13)|0;h=((o=o+Math.imul(d,J)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,j),n=(n=Math.imul(w,D))+Math.imul(_,j)|0,o=Math.imul(_,D),i=i+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,V)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,J)|0;var vt=(h+(i=i+Math.imul(c,X)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(A,j),n=(n=Math.imul(A,D))+Math.imul(E,j)|0,o=Math.imul(E,D),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,V)|0,i=i+Math.imul(m,W)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,J)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Y)|0;var wt=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(I,j),n=(n=Math.imul(I,D))+Math.imul(B,j)|0,o=Math.imul(B,D),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,V)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,D))+Math.imul(L,j)|0,o=Math.imul(L,D),i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,V)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,it)|0;var Mt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,st)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(N,j),n=(n=Math.imul(N,D))+Math.imul(R,j)|0,o=Math.imul(R,D),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,V)|0,i=i+Math.imul(I,W)|0,n=(n=n+Math.imul(I,J)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Y)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var At=(h+(i=i+Math.imul(c,ft)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(d,ft)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(O,j),n=(n=Math.imul(O,D))+Math.imul(P,j)|0,o=Math.imul(P,D),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,V)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,V)|0,i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ht)|0;var Et=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(z,j),n=(n=Math.imul(z,D))+Math.imul(C,j)|0,o=Math.imul(C,D),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,V)|0,i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Y)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var St=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,bt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,bt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(z,Z),n=(n=Math.imul(z,V))+Math.imul(C,Z)|0,o=Math.imul(C,V),i=i+Math.imul(O,W)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,dt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,dt)|0;var It=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;h=((o=o+Math.imul(b,bt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(z,W),n=(n=Math.imul(z,J))+Math.imul(C,W)|0,o=Math.imul(C,J),i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Y)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,i=i+Math.imul(A,ft)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var Bt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,bt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,bt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(z,X),n=(n=Math.imul(z,Y))+Math.imul(C,X)|0,o=Math.imul(C,Y),i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(I,ft)|0,n=(n=n+Math.imul(I,ht)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,ht)|0,i=i+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,dt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,dt)|0;var xt=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,bt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(C,Q)|0,o=Math.imul(C,tt),i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,dt)|0;var Tt=(h+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,bt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,bt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(z,rt),n=(n=Math.imul(z,it))+Math.imul(C,rt)|0,o=Math.imul(C,it),i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Lt=(h+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,bt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,bt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,i=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(C,ot)|0,o=Math.imul(C,st),i=i+Math.imul(O,ft)|0,n=(n=n+Math.imul(O,ht)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,dt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,dt)|0;var kt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,bt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,bt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(z,ft),n=(n=Math.imul(z,ht))+Math.imul(C,ft)|0,o=Math.imul(C,ht),i=i+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,dt)|0;var Nt=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,bt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,bt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(z,ct),n=(n=Math.imul(z,dt))+Math.imul(C,ct)|0,o=Math.imul(C,dt);var Rt=(h+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,bt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,bt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ut=(h+(i=Math.imul(z,pt))|0)+((8191&(n=(n=Math.imul(z,bt))+Math.imul(C,pt)|0))<<13)|0;return h=((o=Math.imul(C,bt))+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,f[0]=gt,f[1]=mt,f[2]=yt,f[3]=vt,f[4]=wt,f[5]=_t,f[6]=Mt,f[7]=At,f[8]=Et,f[9]=St,f[10]=It,f[11]=Bt,f[12]=xt,f[13]=Tt,f[14]=Lt,f[15]=kt,f[16]=Nt,f[17]=Rt,f[18]=Ut,0!==h&&(f[19]=h,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,f=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=f;h++){var u=o-h,c=(0|t.words[u])*(0|e.words[h]),d=67108863&c;a=67108863&(d=d+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function m(t,e,r){return g(t,e,r)}Math.imul||(b=p),n.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):r<63?p(this,t,e):r<1024?g(this,t,e):m(this,t,e)},n.prototype.mul=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),m(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<67108864);for(var i=0,n=0;n<this.length;n++){var o=(0|this.words[n])*t,s=(67108863&o)+(67108863&i);i>>=26,i+=o/67108864|0,i+=s>>>26,this.words[n]=67108863&s}return 0!==i&&(this.words[n]=i,this.length++),this.length=0===t?1:this.length,e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=t.words[i]>>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var o=r.sqr();i<e.length;i++,o=o.sqr())0!==e[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,f=(0|this.words[e])-a<<i;this.words[e]=f|s,s=a>>>26-i}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,f=i;if(n-=s,n=Math.max(0,n),f){for(var h=0;h<s;h++)f.words[h]=this.words[h];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(0!==u||h>=n);h--){var c=0|this.words[h];this.words[h]=u<<26-o|c>>>o,u=c&a}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i)&&!!(this.words[i]&n)},n.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this._strip()},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,e,i){var n,o,s=t.length+i;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+i])+a;var f=(0|t.words[n])*e;a=((o-=67108863&f)>>26)-(f/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,f=i.length-o.length;if("mod"!==e){(a=new n(null)).length=f+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var u=i.clone()._ishlnsubmul(o,1,f);0===u.negative&&(i=u,a&&(a.words[f]=1));for(var c=f-1;c>=0;c--){var d=67108864*(0|i.words[o.length+c])+(0|i.words[o.length+c-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(o,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(o,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=d)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(i*n+(0|this.words[o]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*i;this.words[n]=o/t|0,i=o%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new n(1),s=new n(0),a=new n(0),f=new n(1),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;!(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(u),s.isub(c)),o.iushrn(1),s.iushrn(1);for(var p=0,b=1;!(i.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(c)),a.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a),s.isub(f)):(i.isub(e),a.isub(o),f.isub(s))}return{a:a,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new n(1),a=new n(0),f=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,u=1;!(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var c=0,d=1;!(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(a)):(i.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new E(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(w,v),w.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(_,v),i(M,v),i(A,v),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return y[t]=e,e},E.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){r(!(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),f=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var c=this.pow(u,o),d=this.pow(t,o.addn(1).iushrn(1)),l=this.pow(t,o),p=s;0!==l.cmp(a);){for(var b=l,g=0;0!==b.cmp(a);g++)b=b.redSqr();r(g<p);var m=this.pow(c,new n(1).iushln(p-g-1));d=d.redMul(m),c=m.redSqr(),l=l.redMul(c),p=g}return d},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new n(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var o=r[0],s=0,a=0,f=e.bitLength()%26;for(0===f&&(f=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],u=f-1;u>=0;u--){var c=h>>u&1;o!==r[0]&&(o=this.sqr(o)),0!==c||0!==s?(s<<=1,s|=c,(4===++a||0===i&&0===u)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}f=26}return o},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new S(t)},i(S,E),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,t)}(Xi);var Yi=e(Xi.exports);function Gi(t,e=""){if(!Number.isSafeInteger(t)||t<0){throw new Error(`${e&&`"${e}" `}expected integer >= 0, got ${t}`)}}function Qi(t,e,r=""){const i=(n=t)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name;var n;const o=t?.length,s=void 0!==e;if(!i||s&&o!==e){throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(s?` of length ${e}`:"")+", got "+(i?`length=${o}`:"type="+typeof t))}return t}function tn(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function en(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function rn(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function nn(t,e){return t<<32-e|t>>>e}function on(t,e){return t<<e|t>>>32-e>>>0}function sn(t,e={}){const r=(e,r)=>t(r).update(e).digest(),i=t(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.create=e=>t(e),Object.assign(r,e),Object.freeze(r)}const an=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function fn(t,e,r){return t&e^t&r^e&r}class hn{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,e,r,i){this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=rn(this.buffer)}update(t){tn(this),Qi(t);const{view:e,buffer:r,blockLen:i}=this,n=t.length;for(let o=0;o<n;){const s=Math.min(i-this.pos,n-o);if(s!==i)r.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(e,0),this.pos=0);else{const e=rn(t);for(;i<=n-o;o+=i)this.process(e,o)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){tn(this),function(t,e){Qi(t,void 0,"digestInto() output");const r=e.outputLen;if(t.length<r)throw new Error('"digestInto() output" expected to be of length >='+r)}(t,this),this.finished=!0;const{buffer:e,view:r,blockLen:i,isLE:n}=this;let{pos:o}=this;e[o++]=128,en(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(r,0),o=0);for(let t=o;t<i;t++)e[t]=0;r.setBigUint64(i-8,BigInt(8*this.length),n),this.process(r,0);const s=rn(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const f=a/4,h=this.get();if(f>h.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<f;t++)s.setUint32(4*t,h[t],n)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||=new this.constructor,t.set(...this.get());const{blockLen:e,buffer:r,length:i,finished:n,destroyed:o,pos:s}=this;return t.destroyed=o,t.finished=n,t.length=i,t.pos=s,i%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const un=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),cn=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),dn=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),ln=(()=>Uint8Array.from(new Array(16).fill(0).map(((t,e)=>e))))(),pn=(()=>ln.map((t=>(9*t+5)%16)))(),bn=(()=>{const t=[[ln],[pn]];for(let e=0;e<4;e++)for(let r of t)r.push(r[e].map((t=>dn[t])));return t})(),gn=(()=>bn[0])(),mn=(()=>bn[1])(),yn=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((t=>Uint8Array.from(t))),vn=gn.map(((t,e)=>t.map((t=>yn[e][t])))),wn=mn.map(((t,e)=>t.map((t=>yn[e][t])))),_n=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),Mn=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function An(t,e,r,i){return 0===t?e^r^i:1===t?e&r|~e&i:2===t?(e|~r)^i:3===t?e&i|r&~i:e^(r|~i)}const En=new Uint32Array(16);class Sn extends hn{h0=1732584193;h1=-271733879;h2=-1732584194;h3=271733878;h4=-1009589776;constructor(){super(64,20,8,!0)}get(){const{h0:t,h1:e,h2:r,h3:i,h4:n}=this;return[t,e,r,i,n]}set(t,e,r,i,n){this.h0=0|t,this.h1=0|e,this.h2=0|r,this.h3=0|i,this.h4=0|n}process(t,e){for(let r=0;r<16;r++,e+=4)En[r]=t.getUint32(e,!0);let r=0|this.h0,i=r,n=0|this.h1,o=n,s=0|this.h2,a=s,f=0|this.h3,h=f,u=0|this.h4,c=u;for(let t=0;t<5;t++){const e=4-t,d=_n[t],l=Mn[t],p=gn[t],b=mn[t],g=vn[t],m=wn[t];for(let e=0;e<16;e++){const i=on(r+An(t,n,s,f)+En[p[e]]+d,g[e])+u|0;r=u,u=f,f=0|on(s,10),s=n,n=i}for(let t=0;t<16;t++){const r=on(i+An(e,o,a,h)+En[b[t]]+l,m[t])+c|0;i=c,c=h,h=0|on(a,10),a=o,o=r}}this.set(this.h1+s+h|0,this.h2+f+c|0,this.h3+u+i|0,this.h4+r+o|0,this.h0+n+a|0)}roundClean(){en(En)}destroy(){this.destroyed=!0,en(this.buffer),this.set(0,0,0,0,0)}}const In=sn((()=>new Sn)),Bn=BigInt(2**32-1),xn=BigInt(32);function Tn(t,e=!1){return e?{h:Number(t&Bn),l:Number(t>>xn&Bn)}:{h:0|Number(t>>xn&Bn),l:0|Number(t&Bn)}}const Ln=(t,e,r)=>t>>>r,kn=(t,e,r)=>t<<32-r|e>>>r,Nn=(t,e,r)=>t>>>r|e<<32-r,Rn=(t,e,r)=>t<<32-r|e>>>r,Un=(t,e,r)=>t<<64-r|e>>>r-32,On=(t,e,r)=>t>>>r-32|e<<64-r;function Pn(t,e,r,i){const n=(e>>>0)+(i>>>0);return{h:t+r+(n/2**32|0)|0,l:0|n}}const qn=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),zn=(t,e,r,i)=>e+r+i+(t/2**32|0)|0,Cn=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),Fn=(t,e,r,i,n)=>e+r+i+n+(t/2**32|0)|0,jn=(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0),Dn=(t,e,r,i,n,o)=>e+r+i+n+o+(t/2**32|0)|0,Hn=Uint32Array.from([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]),Zn=new Uint32Array(64);class Vn extends hn{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:e,C:r,D:i,E:n,F:o,G:s,H:a}=this;return[t,e,r,i,n,o,s,a]}set(t,e,r,i,n,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)Zn[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=Zn[t-15],r=Zn[t-2],i=nn(e,7)^nn(e,18)^e>>>3,n=nn(r,17)^nn(r,19)^r>>>10;Zn[t]=n+Zn[t-7]+i+Zn[t-16]|0}let{A:r,B:i,C:n,D:o,E:s,F:a,G:f,H:h}=this;for(let t=0;t<64;t++){const e=h+(nn(s,6)^nn(s,11)^nn(s,25))+((u=s)&a^~u&f)+Hn[t]+Zn[t]|0,c=(nn(r,2)^nn(r,13)^nn(r,22))+fn(r,i,n)|0;h=f,f=a,a=s,s=o+e|0,o=n,n=i,i=r,r=e+c|0}var u;r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(r,i,n,o,s,a,f,h)}roundClean(){en(Zn)}destroy(){this.set(0,0,0,0,0,0,0,0),en(this.buffer)}}class $n extends Vn{A=0|un[0];B=0|un[1];C=0|un[2];D=0|un[3];E=0|un[4];F=0|un[5];G=0|un[6];H=0|un[7];constructor(){super(32)}}const Wn=(()=>function(t,e=!1){const r=t.length;let i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){const{h:r,l:s}=Tn(t[o],e);[i[o],n[o]]=[r,s]}return[i,n]}(["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((t=>BigInt(t)))))(),Jn=(()=>Wn[0])(),Kn=(()=>Wn[1])(),Xn=new Uint32Array(80),Yn=new Uint32Array(80);class Gn extends hn{constructor(t){super(128,t,16,!1)}get(){const{Ah:t,Al:e,Bh:r,Bl:i,Ch:n,Cl:o,Dh:s,Dl:a,Eh:f,El:h,Fh:u,Fl:c,Gh:d,Gl:l,Hh:p,Hl:b}=this;return[t,e,r,i,n,o,s,a,f,h,u,c,d,l,p,b]}set(t,e,r,i,n,o,s,a,f,h,u,c,d,l,p,b){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|f,this.El=0|h,this.Fh=0|u,this.Fl=0|c,this.Gh=0|d,this.Gl=0|l,this.Hh=0|p,this.Hl=0|b}process(t,e){for(let r=0;r<16;r++,e+=4)Xn[r]=t.getUint32(e),Yn[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|Xn[t-15],r=0|Yn[t-15],i=Nn(e,r,1)^Nn(e,r,8)^Ln(e,0,7),n=Rn(e,r,1)^Rn(e,r,8)^kn(e,r,7),o=0|Xn[t-2],s=0|Yn[t-2],a=Nn(o,s,19)^Un(o,s,61)^Ln(o,0,6),f=Rn(o,s,19)^On(o,s,61)^kn(o,s,6),h=Cn(n,f,Yn[t-7],Yn[t-16]),u=Fn(h,i,a,Xn[t-7],Xn[t-16]);Xn[t]=0|u,Yn[t]=0|h}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:s,Cl:a,Dh:f,Dl:h,Eh:u,El:c,Fh:d,Fl:l,Gh:p,Gl:b,Hh:g,Hl:m}=this;for(let t=0;t<80;t++){const e=Nn(u,c,14)^Nn(u,c,18)^Un(u,c,41),y=Rn(u,c,14)^Rn(u,c,18)^On(u,c,41),v=u&d^~u&p,w=jn(m,y,c&l^~c&b,Kn[t],Yn[t]),_=Dn(w,g,e,v,Jn[t],Xn[t]),M=0|w,A=Nn(r,i,28)^Un(r,i,34)^Un(r,i,39),E=Rn(r,i,28)^On(r,i,34)^On(r,i,39),S=r&n^r&s^n&s,I=i&o^i&a^o&a;g=0|p,m=0|b,p=0|d,b=0|l,d=0|u,l=0|c,({h:u,l:c}=Pn(0|f,0|h,0|_,0|M)),f=0|s,h=0|a,s=0|n,a=0|o,n=0|r,o=0|i;const B=qn(M,E,I);r=zn(B,_,A,S),i=0|B}({h:r,l:i}=Pn(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=Pn(0|this.Bh,0|this.Bl,0|n,0|o)),({h:s,l:a}=Pn(0|this.Ch,0|this.Cl,0|s,0|a)),({h:f,l:h}=Pn(0|this.Dh,0|this.Dl,0|f,0|h)),({h:u,l:c}=Pn(0|this.Eh,0|this.El,0|u,0|c)),({h:d,l:l}=Pn(0|this.Fh,0|this.Fl,0|d,0|l)),({h:p,l:b}=Pn(0|this.Gh,0|this.Gl,0|p,0|b)),({h:g,l:m}=Pn(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(r,i,n,o,s,a,f,h,u,c,d,l,p,b,g,m)}roundClean(){en(Xn,Yn)}destroy(){en(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Qn extends Gn{Ah=0|cn[0];Al=0|cn[1];Bh=0|cn[2];Bl=0|cn[3];Ch=0|cn[4];Cl=0|cn[5];Dh=0|cn[6];Dl=0|cn[7];Eh=0|cn[8];El=0|cn[9];Fh=0|cn[10];Fl=0|cn[11];Gh=0|cn[12];Gl=0|cn[13];Hh=0|cn[14];Hl=0|cn[15];constructor(){super(64)}}const to=sn((()=>new $n),an(1)),eo=sn((()=>new Qn),an(3));class ro{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(t,e){if(function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash must wrapped by utils.createHasher");Gi(t.outputLen),Gi(t.blockLen)}(t),Qi(e,void 0,"key"),this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(e.length>r?t.create().update(e).digest():e);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),en(i)}update(t){return tn(this),this.iHash.update(t),this}digestInto(t){tn(this),Qi(t,this.outputLen,"output"),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||=Object.create(Object.getPrototypeOf(this),{});const{oHash:e,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:s}=this;return t.finished=i,t.destroyed=n,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const io=(t,e,r)=>new ro(t,e).update(r).digest();function no(t,e){const r=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t),i=to(r);return e?Q.Buffer.from(i).toString(e):Q.Buffer.from(i)}function oo(t,e){const r=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t),i=eo(r);return e?Q.Buffer.from(i).toString(e):Q.Buffer.from(i)}function so(t,e){return Q.Buffer.from(io(to,e,t))}function ao(t){const e=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t);return Q.Buffer.from(In(e))}io.create=(t,e)=>new ro(t,e);var fo=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let t=0;t<e.length;t++)e[t]=255;for(let r=0;r<t.length;r++){const i=t.charAt(r),n=i.charCodeAt(0);if(255!==e[n])throw new TypeError(i+" is ambiguous");e[n]=r}const r=t.length,i=t.charAt(0),n=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function s(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;let o=0,s=0,a=0;for(;t[o]===i;)s++,o++;const f=(t.length-o)*n+1>>>0,h=new Uint8Array(f);for(;o<t.length;){const i=t.charCodeAt(o);if(i>255)return;let n=e[i];if(255===n)return;let s=0;for(let t=f-1;(0!==n||s<a)&&-1!==t;t--,s++)n+=r*h[t]>>>0,h[t]=n%256>>>0,n=n/256>>>0;if(0!==n)throw new Error("Non-zero carry");a=s,o++}let u=f-a;for(;u!==f&&0===h[u];)u++;const c=new Uint8Array(s+(f-u));let d=s;for(;u!==f;)c[d++]=h[u++];return c}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";let n=0,s=0,a=0;const f=e.length;for(;a!==f&&0===e[a];)a++,n++;const h=(f-a)*o+1>>>0,u=new Uint8Array(h);for(;a!==f;){let t=e[a],i=0;for(let e=h-1;(0!==t||i<s)&&-1!==e;e--,i++)t+=256*u[e]>>>0,u[e]=t%r>>>0,t=t/r>>>0;if(0!==t)throw new Error("Non-zero carry");s=i,a++}let c=h-s;for(;c!==h&&0===u[c];)c++;let d=i.repeat(n);for(;c<h;++c)d+=t.charAt(u[c]);return d},decodeUnsafe:s,decode:function(t){const e=s(t);if(e)return e;throw new Error("Non-base"+r+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");const ho=new ht.ec("secp256k1"),uo=ho.g,co=new Yi(ho.n.toString());class lo{constructor(t){this.Q=t}static fromBinary(t){return lo.fromBuffer(Q.Buffer.from(t,"binary"))}static fromBuffer(t){return"000000000000000000000000000000000000000000000000000000000000000000"===t.toString("hex")?new lo(null):new lo(ho.curve.decodePoint(t))}toBuffer(t=!0){return null===this.Q?Q.Buffer.from("000000000000000000000000000000000000000000000000000000000000000000","hex"):Q.Buffer.from(this.Q.encode("array",t))}static fromPoint(t){return new lo(t)}toUncompressed(){const t=Q.Buffer.from(this.Q.encode("array",!1)),e=ho.curve.decodePoint(t);return lo.fromPoint(e)}toBlockchainAddress(){return ao(oo(this.toBuffer()))}toString(t=M().get("address_prefix")){return this.toPublicKeyString(t)}toPublicKeyString(t=M().get("address_prefix")){const e=t||"STM";if(this.pubdata)return e+this.pubdata;const r=this.toBuffer(),i=ao(r),n=Q.Buffer.concat([r,i.slice(0,4)]);return this.pubdata=fo.encode(n),e+this.pubdata}static fromString(t,e=M().get("address_prefix")){try{return lo.fromStringOrThrow(t,e)}catch{return null}}static fromStringOrThrow(t,e=M().get("address_prefix")){const r=e||"STM",i=t.slice(0,r.length);if(r!==i)throw new Error(`Expecting key to begin with ${r}, instead got ${i}`);t=t.slice(r.length);const n=fo.decode(t),o=Q.Buffer.from(n),s=o.slice(-4),a=o.slice(0,-4),f=ao(a).slice(0,4);if(!Q.Buffer.isBuffer(s)||!Q.Buffer.isBuffer(f)||!s.equals(f))throw new Error("Checksum did not match");return lo.fromBuffer(a)}toAddressString(t=M().get("address_prefix")){const e=ao(oo(this.toBuffer())),r=ao(e),i=Q.Buffer.concat([e,r.slice(0,4)]);return t+fo.encode(i)}toPtsAddy(){const t=ao(no(this.toBuffer())),e=Q.Buffer.from([56]),r=Q.Buffer.concat([e,t]);let i=no(r);i=no(i);const n=Q.Buffer.concat([r,i.slice(0,4)]);return fo.encode(n)}child(t){if(!Q.Buffer.isBuffer(t))throw new Error("Buffer required: offset");if(32!==t.length)throw new Error("offset length");t=no(t=Q.Buffer.concat([this.toBuffer(),t]));const e=new Yi(t);if(e.cmp(co)>=0)throw new Error("Child offset went out of bounds, try again");const r=uo.mul(e),i=this.Q.add(r);if(i.isInfinity())throw new Error("Child offset derived to an invalid key, try again");return lo.fromPoint(i)}static fromHex(t){const e=Q.Buffer.from(t,"hex");return 0===e.length?new lo(null):lo.fromBuffer(e)}toHex(){return this.Q?this.toBuffer().toString("hex"):"000000000000000000000000000000000000000000000000000000000000000000"}static fromStringHex(t){return lo.fromString(Q.Buffer.from(t,"hex").toString())}}const po=new ht.ec("secp256k1"),bo=po.g,go=new Yi(po.n.toString());class mo{constructor(t){this.d=t}static fromBuffer(t){if(!Q.Buffer.isBuffer(t))throw new Error("Expecting parameter to be a Buffer type");if(32!==t.length&&$.warn(`WARN: Expecting 32 bytes, instead got ${t.length}, stack trace:`,(new Error).stack),0===t.length)throw new Error("Empty buffer");return new mo(new Yi(t))}static fromSeed(t){if("string"!=typeof t)throw new Error("seed must be of type string");return mo.fromBuffer(no(t))}static isWif(t){try{return this.fromWif(t),!0}catch{return!1}}static fromWif(t){const e=Q.Buffer.from(fo.decode(t)),r=e.readUInt8(0);if(128!==r)throw new Error(`Expected version 128, instead got ${r}`);const i=e.slice(0,-4),n=e.slice(-4);let o=no(i);if(o=no(o),o=o.slice(0,4),n.toString()!==o.toString())throw new Error("Invalid WIF key (checksum miss-match)");return i.writeUInt8(128,0),mo.fromBuffer(i.slice(1))}toWif(){const t=this.toBuffer(),e=Q.Buffer.concat([Q.Buffer.from([128]),t]);let r=no(e);r=no(r),r=r.slice(0,4);const i=Q.Buffer.concat([e,r]);return fo.encode(i)}toString(){return this.toWif()}toPublicKeyPoint(){return bo.mul(this.d)}toPublic(){return this.public_key?this.public_key:this.public_key=lo.fromPoint(this.toPublicKeyPoint())}toBuffer(){return this.d.toArrayLike(Q.Buffer,"be",32)}get_shared_secret(t){const e="string"==typeof t?lo.fromStringOrThrow(t):t;if(!e||!e.Q)throw new Error("Invalid public key");return oo(e.Q.mul(this.d).getX().toArrayLike(Q.Buffer,"be",32))}child(t){t=no(t=Q.Buffer.concat([this.toPublicKey().toBuffer(),t]));const e=new Yi(t);if(e.gte(go))throw new Error("Child offset went out of bounds, try again");const r=this.d.add(e);if(r.isZero())throw new Error("Child offset derived to an invalid key, try again");return new mo(r)}static fromHex(t){return mo.fromBuffer(Q.Buffer.from(t,"hex"))}toHex(){return this.toBuffer().toString("hex")}toPublicKey(){return this.toPublic()}}function yo(t,e){switch(t){case"Array":if(Array.isArray(e))return;break;case"Boolean":if("boolean"==typeof e)return;break;case"Buffer":if(Q.Buffer.isBuffer(e))return;break;case"Number":if("number"==typeof e)return;break;case"String":if("string"==typeof e)return;break;default:if("function"==typeof t&&null!=e&&"object"==typeof e&&"constructor"in e&&vo(e.constructor)===vo(t))return}throw new TypeError("Expected "+("function"==typeof t?vo(t):t)+", got "+String(e))}function vo(t){if(t.name)return t.name;const e=t.toString().match(/function (.*?)\(/);return e?e[1]:null}class wo{constructor(t,e){yo(Yi,t),yo(Yi,e),this.r=t,this.s=e}static parseCompact(t){if(65!==t.length)throw new Error("Invalid signature length");let e=t.readUInt8(0)-27;if((7&e)!==e)throw new Error("Invalid signature parameter");const r=!!(4&e);e&=3;const i=new Yi(t.slice(1,33)),n=new Yi(t.slice(33));return{compressed:r,i:e,signature:new wo(i,n)}}static fromDER(t){if(48!==t.readUInt8(0))throw new Error("Not a DER sequence");if(t.readUInt8(1)!==t.length-2)throw new Error("Invalid sequence length");if(2!==t.readUInt8(2))throw new Error("Expected a DER integer");const e=t.readUInt8(3);if(0===e)throw new Error("R length is zero");let r=4+e;if(2!==t.readUInt8(r))throw new Error("Expected a DER integer (2)");const i=t.readUInt8(r+1);if(0===i)throw new Error("S length is zero");const n=t.slice(4,r),o=t.slice(r+2);if(r+=2+i,e>1&&0===n.readUInt8(0)&&!(128&n.readUInt8(1)))throw new Error("R value excessively padded");if(i>1&&0===o.readUInt8(0)&&!(128&o.readUInt8(1)))throw new Error("S value excessively padded");if(r!==t.length)throw new Error("Invalid DER encoding");const s=new Yi(n),a=new Yi(o);if(s.isNeg())throw new Error("R value is negative");if(a.isNeg())throw new Error("S value is negative");return new wo(s,a)}static parseScriptSignature(t){const e=t.readUInt8(t.length-1),r=-129&e;if(r<=0||r>=4)throw new Error("Invalid hashType");return{signature:wo.fromDER(t.slice(0,-1)),hashType:e}}toCompact(t,e){e&&(t+=4),t+=27;const r=Q.Buffer.alloc(65);return r.writeUInt8(t,0),this.r.toArrayLike(Q.Buffer,"be",32).copy(r,1),this.s.toArrayLike(Q.Buffer,"be",32).copy(r,33),r}toDER(){const t=this.r.toArrayLike(Q.Buffer,"be"),e=this.s.toArrayLike(Q.Buffer,"be"),r=[];return r.push(2,t.length),Array.from(t).forEach((t=>r.push(t))),r.push(2,e.length),Array.from(e).forEach((t=>r.push(t))),r.unshift(48,r.length),Q.Buffer.from(r)}toScriptSignature(t){const e=Q.Buffer.alloc(1);return e.writeUInt8(t,0),Q.Buffer.concat([this.toDER(),e])}}function _o(t,e,r,i){const n=new Yi(e),o=new Yi(t.n.toString()),s=t.g;let a,f;if(function(t,e,r,i,n){if(yo("Buffer",e),yo(Yi,r),n&&(e=no(Q.Buffer.concat([e,Q.Buffer.alloc(n)]))),32!==e.length)throw new Error("Hash must be 256 bit");const o=r.toArrayLike(Q.Buffer,"be",32);let s=Q.Buffer.alloc(32),a=Q.Buffer.alloc(32);a.fill(1),s.fill(0),s=so(Q.Buffer.concat([a,Q.Buffer.from([0]),o,e]),s),a=so(a,s),s=so(Q.Buffer.concat([a,Q.Buffer.from([1]),o,e]),s),a=so(a,s),a=so(a,s);let f=new Yi(a);for(;f.isNeg()||f.isZero()||f.gte(new Yi(t.n.toString()))||!i(f);)s=so(Q.Buffer.concat([a,Q.Buffer.from([0])]),s),a=so(a,s),a=so(a,s),f=new Yi(a)}(t,e,r,(function(t){const e=s.mul(t);if(e.isInfinity())return!1;const i=new Yi(e.getX().toString()).mod(o);if(i.isZero())return!1;const h=t.invm(o).mul(n.add(r.mul(i))).mod(o);return!h.isZero()&&(a=i,f=h,!0)}),i),!a||!f)throw new Error("Unable to find valid signature");const h=o.shrn(1),u=f.gt(h)?o.sub(f):f;return new wo(a,u)}function Mo(t,e,r,i){if((3&i)!==i)throw new Error("Recovery param is more than two bits");const n=new Yi(t.n.toString()),o=r.r,s=r.s;if(o.isNeg()||o.isZero()||!o.lt(n))throw new Error("Invalid r value");if(s.isNeg()||s.isZero()||!s.lt(n))throw new Error("Invalid s value");try{const r=e.toArrayLike(Q.Buffer,"be",32),n={r:o,s:s};return t.recoverPubKey(r,n,i)}catch(r){const a=t.g,f=!!(1&i),h=i>>1?o.add(n):o,u=h.toString(16).padStart(64,"0");let c;try{c=t.curve.pointFromX(u,f)}catch(e){const r=h.toArrayLike(Q.Buffer,"be",32);c=t.curve.pointFromX(r,f)}if(!c.mul(n).isInfinity())throw new Error("nR is not a valid curve point");const d=e.neg().mod(n),l=o.invm(n),p=c.mul(s),b=a.mul(d);return p.add(b).mul(l)}}const Ao=new ht.ec("secp256k1");class Eo{constructor(t,e,r){this.r=t,this.s=e,this.i=r}static fromBuffer(t){if(65!==t.length)throw new Error("Invalid signature length");const e=t.readUInt8(0),r=e-27,i=e-31;if(!(r>=0&&r<=3&&r===(7&r))&&!(i>=0&&i<=3&&i===(7&i)))throw new Error("Invalid signature parameter");const n=new Yi(t.slice(1,33)),o=new Yi(t.slice(33));return new Eo(n,o,e)}toBuffer(){const t=Q.Buffer.alloc(65);return t.writeUInt8(this.i,0),this.r.toArrayLike(Q.Buffer,"be",32).copy(t,1),this.s.toArrayLike(Q.Buffer,"be",32).copy(t,33),t}static signBuffer(t,e){const r=no(t);return Eo.signBufferSha256(r,e)}static signBufferSha256(t,e){if(32!==t.length||!Q.Buffer.isBuffer(t))throw new Error("buf_sha256: 32 byte buffer required");const r="string"==typeof e?mo.fromWif(e):e;if(!r)throw new Error("private_key required");const i=r.d;let n,o=0;for(;;){n=_o(Ao,t,i,o++);const e=n.r.toArrayLike(Q.Buffer,"be",32),r=n.s.toArrayLike(Q.Buffer,"be",32);if(!(128&e[0]||0===e[0]&&!(128&e[1])||128&r[0]||0===r[0]&&!(128&r[1])))break}const s=function(t,e,r,i){for(let n=0;n<4;n++)try{const o=Mo(t,e,r,n),s=i.getX().toString(16),a=i.getY().toString(16),f=o.getX().toString(16),h=o.getY().toString(16);if(s===f&&a===h)return n}catch(t){t.message}throw r.r.toString(16),r.s.toString(16),i.getX().toString(16),i.getY().toString(16),new Error("Unable to find valid recovery factor")}(Ao,new Yi(t),n,r.toPublic().Q);return new Eo(n.r,n.s,s+31)}static isCanonical(t,e){return!(128&t[0]||0===t[0]&&!(128&t[1])||128&e[0]||0===e[0]&&!(128&e[1]))}static sign(t,e){return Eo.signBuffer(Q.Buffer.from(t),e)}verifyBuffer(t,e){const r=no(t);return this.verifyHash(r,e)}verifyHash(t,e){if(32!==t.length)throw new Error("A SHA 256 should be 32 bytes long, instead got "+t.length);const r=new Yi(t),i=new Yi(Ao.n.toString()),n=Ao.g,o=e.Q;if(!o)throw new Error("Invalid public key");if(this.r.isNeg()||this.r.isZero()||this.r.gte(i))return!1;if(this.s.isNeg()||this.s.isZero()||this.s.gte(i))return!1;const s=this.s.invm(i),a=r.mul(s).mod(i),f=this.r.mul(s).mod(i),h=n.mul(a).add(o.mul(f));if(h.isInfinity())return!1;return h.getX().mod(i).eq(this.r)}static fromHex(t){return Eo.fromBuffer(Q.Buffer.from(t,"hex"))}toHex(){return this.toBuffer().toString("hex")}}class So{constructor(t){this.addy=t}static fromBuffer(t){const e=t.subarray(-4),r=t.subarray(0,-4),i=ao(r).subarray(0,4);if(!e.equals(i))throw new Error("Invalid address checksum");return M().get("address_prefix")+fo.encode(r)}static fromString(t){const e=M().get("address_prefix")||"STM";if(!t.startsWith(e))throw new Error(`Expecting address to begin with ${e}`);const r=t.slice(e.length),i=fo.decode(r),n=i.subarray(-4),o=ao(i.subarray(0,-4)).subarray(0,4);if(!n.equals(o))throw new Error("Invalid address checksum");return i}static fromPublicKey(t,e=!0){const r=t.toBuffer(e),i=ao(r).subarray(0,4),n=Q.Buffer.concat([r,i]);return M().get("address_prefix")+fo.encode(n)}static fromPublic(t,e=!0,r=56){const i=ao(no(t.toBuffer(e))),n=Q.Buffer.alloc(1);n.writeUInt8(255&r,0);const o=Q.Buffer.concat([n,i]);let s=no(o);s=no(s);const a=Q.Buffer.concat([o,s.subarray(0,4)]);return new So(ao(a))}static toBuffer(t){return So.fromString(t)}toBuffer(){return this.addy}getVersion(){return this.addy[0]}toString(t=String(M().get("address_prefix"))||"STM"){const e=ao(this.addy).subarray(0,4),r=Q.Buffer.concat([this.addy,e]);return t+fo.encode(r)}}function Io(t){if("undefined"!=typeof crypto&&crypto.getRandomValues){const e=new Uint8Array(t);return crypto.getRandomValues(e),Q.Buffer.from(e)}try{const e="undefined"!=typeof require?require("crypto"):null;if(e&&"function"==typeof e.randomBytes)return e.randomBytes(t)}catch{}throw new Error("Random bytes generation is not available. This library requires either Web Crypto API (browser/Node.js 20.19+) or Node.js crypto module.")}let Bo=null;function xo(){return Bo||(Bo=Q.Buffer.from("3b3b081e46ea808d5a96b08c4bc5003f5e15767090f344faab531ec57565136b","hex")),Bo}function To(t,e,r,i,n){const o=Q.Buffer.concat([Q.Buffer.from(t),Q.Buffer.from(e),Q.Buffer.from(r),Q.Buffer.from(i)]),s=Q.Buffer.from(to(o)),a=Q.Buffer.concat([xo(),s,n]);return Q.Buffer.from(to(a))}function Lo(t,e,r){if(!t.params)throw new Error("Unable to sign a request without params");const i=Q.Buffer.from(JSON.stringify(t.params),"utf8").toString("base64"),n=Io(8),o=n.toString("hex"),s=(new Date).toISOString(),a=To(s,e,t.method,i,n),f=[];for(const t of r){const e=mo.fromWif(t),r=Eo.signBufferSha256(a,e);f.push(r.toHex())}return{jsonrpc:"2.0",method:t.method,id:t.id,params:{__signed:{account:e,nonce:o,params:i,signatures:f,timestamp:s}}}}new Proxy({},{get(t,e){const r=xo(),i=r[e];return"function"==typeof i?i.bind(r):i},has:(t,e)=>e in xo(),ownKeys(t){const e=xo();return Object.keys(e)},getOwnPropertyDescriptor(t,e){const r=xo();return Object.getOwnPropertyDescriptor(r,e)}});var ko=Object.freeze({__proto__:null,sign:Lo,validate:async function(t,e){if("2.0"!==t.jsonrpc||"string"!=typeof t.method)throw new Error("Invalid JSON RPC Request");if(null==t.params||null==t.params.__signed)throw new Error("Signed payload missing");if(1!==Object.keys(t.params).length)throw new Error("Invalid request params");const r=t.params.__signed;if(null==r.account)throw new Error("Missing account");let i;try{const t=Q.Buffer.from(r.params,"base64").toString("utf8");i=JSON.parse(t)}catch(t){const e=t instanceof Error?t.message:String(t);throw new Error(`Invalid encoded params: ${e}`)}if(null==r.nonce||"string"!=typeof r.nonce)throw new Error("Invalid nonce");const n=Q.Buffer.from(r.nonce,"hex");if(8!==n.length)throw new Error("Invalid nonce");const o=Date.parse(r.timestamp);if(Number.isNaN(o))throw new Error("Invalid timestamp");if(Date.now()-o>6e4)throw new Error("Signature expired");const s=To(r.timestamp,r.account,t.method,r.params,n);try{await e(s,r.signatures,r.account)}catch(t){const e=t instanceof Error?t.message:String(t);throw new Error(`Verification failed: ${e}`)}return i}});const No=[{api:"database_api",method:"set_subscribe_callback",params:["callback","clearFilter"]},{api:"database_api",method:"set_pending_transaction_callback",params:["cb"]},{api:"database_api",method:"set_block_applied_callback",params:["cb"]},{api:"database_api",method:"cancel_all_subscriptions"},{api:"database_api",method:"get_trending_tags",params:["afterTag","limit"]},{api:"database_api",method:"get_tags_used_by_author",params:["author"]},{api:"database_api",method:"get_post_discussions_by_payout",params:["query"]},{api:"database_api",method:"get_comment_discussions_by_payout",params:["query"]},{api:"database_api",method:"get_discussions_by_trending",params:["query"]},{api:"database_api",method:"get_discussions_by_trending30",params:["query"]},{api:"database_api",method:"get_discussions_by_created",params:["query"]},{api:"database_api",method:"get_discussions_by_active",params:["query"]},{api:"database_api",method:"get_discussions_by_cashout",params:["query"]},{api:"database_api",method:"get_discussions_by_payout",params:["query"]},{api:"database_api",method:"get_discussions_by_votes",params:["query"]},{api:"database_api",method:"get_discussions_by_children",params:["query"]},{api:"database_api",method:"get_discussions_by_hot",params:["query"]},{api:"database_api",method:"get_discussions_by_feed",params:["query"]},{api:"database_api",method:"get_discussions_by_blog",params:["query"]},{api:"database_api",method:"get_discussions_by_comments",params:["query"]},{api:"database_api",method:"get_discussions_by_promoted",params:["query"]},{api:"database_api",method:"get_block_header",params:["blockNum"]},{api:"database_api",method:"get_block",params:["blockNum"]},{api:"database_api",method:"get_ops_in_block",params:["blockNum","onlyVirtual"]},{api:"database_api",method:"get_state",params:["path"]},{api:"database_api",method:"get_trending_categories",params:["after","limit"]},{api:"database_api",method:"get_best_categories",params:["after","limit"]},{api:"database_api",method:"get_active_categories",params:["after","limit"]},{api:"database_api",method:"get_recent_categories",params:["after","limit"]},{api:"database_api",method:"get_config"},{api:"database_api",method:"get_dynamic_global_properties"},{api:"database_api",method:"get_chain_properties"},{api:"database_api",method:"get_feed_history"},{api:"database_api",method:"get_current_median_history_price"},{api:"database_api",method:"get_witness_schedule"},{api:"database_api",method:"get_hardfork_version"},{api:"database_api",method:"get_next_scheduled_hardfork"},{api:"account_by_key_api",method:"get_key_references",params:["key"]},{api:"database_api",method:"get_accounts",params:["names"]},{api:"database_api",method:"get_account_references",params:["accountId"]},{api:"database_api",method:"lookup_account_names",params:["accountNames"]},{api:"database_api",method:"lookup_accounts",params:["lowerBoundName","limit"]},{api:"database_api",method:"get_account_count"},{api:"database_api",method:"get_conversion_requests",params:["accountName"]},{api:"database_api",method:"get_account_history",params:["account","from","limit"]},{api:"database_api",method:"get_owner_history",params:["account"]},{api:"database_api",method:"get_recovery_request",params:["account"]},{api:"follow_api",method:"get_followers",params:["following","startFollower","followType","limit"]},{api:"follow_api",method:"get_following",params:["follower","startFollowing","followType","limit"]},{api:"follow_api",method:"get_follow_count",params:["account"]},{api:"follow_api",method:"get_feed_entries",params:["account","entryId","limit"]},{api:"follow_api",method:"get_feed",params:["account","entryId","limit"]},{api:"follow_api",method:"get_blog_entries",params:["account","entryId","limit"]},{api:"follow_api",method:"get_blog",params:["account","entryId","limit"]},{api:"follow_api",method:"get_account_reputations",params:["lowerBoundName","limit"]},{api:"follow_api",method:"get_reblogged_by",params:["author","permlink"]},{api:"database_api",method:"get_content",params:["author","permlink"]},{api:"database_api",method:"get_account_notifications",params:["account","from","limit"]},{api:"database_api",method:"get_account_reputation",params:["account"]},{api:"database_api",method:"get_escrow",params:["from","escrowId"]},{api:"database_api",method:"get_withdraw_routes",params:["account","withdrawRouteType"]},{api:"database_api",method:"get_account_bandwidth",params:["account","bandwidthType"]},{api:"database_api",method:"get_savings_withdraw_from",params:["account"]},{api:"database_api",method:"get_savings_withdraw_to",params:["account"]},{api:"database_api",method:"get_order_book",params:["limit"]},{api:"database_api",method:"get_open_orders",params:["owner"]},{api:"database_api",method:"get_liquidity_queue",params:["startAccount","limit"]},{api:"database_api",method:"get_transaction_hex",params:["trx"]},{api:"database_api",method:"get_transaction",params:["trxId"]},{api:"database_api",method:"get_required_signatures",params:["trx","availableKeys"]},{api:"database_api",method:"get_potential_signatures",params:["trx"]},{api:"database_api",method:"verify_authority",params:["trx"]},{api:"database_api",method:"verify_account_authority",params:["nameOrId","signers"]},{api:"database_api",method:"get_active_votes",params:["author","permlink"]},{api:"database_api",method:"get_account_votes",params:["voter"]},{api:"database_api",method:"get_content_replies",params:["author","permlink"]},{api:"database_api",method:"get_discussions_by_author_before_date",params:["author","startPermlink","beforeDate","limit"]},{api:"database_api",method:"get_replies_by_last_update",params:["startAuthor","startPermlink","limit"]},{api:"database_api",method:"get_witnesses",params:["witnessIds"]},{api:"database_api",method:"get_witness_by_account",params:["accountName"]},{api:"database_api",method:"get_witnesses_by_vote",params:["from","limit"]},{api:"database_api",method:"lookup_witness_accounts",params:["lowerBoundName","limit"]},{api:"database_api",method:"get_witness_count"},{api:"database_api",method:"get_active_witnesses"},{api:"database_api",method:"get_miner_queue"},{api:"database_api",method:"get_reward_fund",params:["name"]},{api:"database_api",method:"get_vesting_delegations",params:["account","from","limit"]},{api:"login_api",method:"login",params:["username","password"]},{api:"login_api",method:"get_api_by_name",params:["database_api"]},{api:"login_api",method:"get_version"},{api:"follow_api",method:"get_blog_authors",params:["blogAccount"]},{api:"network_broadcast_api",method:"broadcast_transaction",params:["trx"]},{api:"network_broadcast_api",method:"broadcast_transaction_with_callback",params:["confirmationCallback","trx"]},{api:"network_broadcast_api",method:"broadcast_transaction_synchronous",params:["trx"]},{api:"network_broadcast_api",method:"broadcast_block",params:["b"]},{api:"network_broadcast_api",method:"set_max_block_age",params:["maxBlockAge"]},{api:"market_history_api",method:"get_ticker",params:[]},{api:"market_history_api",method:"get_volume",params:[]},{api:"market_history_api",method:"get_order_book",method_name:"getMarketOrderBook",params:["limit"]},{api:"market_history_api",method:"get_trade_history",params:["start","end","limit"]},{api:"market_history_api",method:"get_recent_trades",params:["limit"]},{api:"market_history_api",method:"get_market_history",params:["bucket_seconds","start","end"]},{api:"market_history_api",method:"get_market_history_buckets",params:[]},{api:"condenser_api",method:"find_proposals",params:["id_set"]},{api:"condenser_api",method:"list_proposals",params:["start","limit","order_by","order_direction","status"]},{api:"condenser_api",method:"list_proposal_votes",params:["start","limit","order_by","order_direction","status"]},{api:"condenser_api",method:"get_nai_pool",params:[]},{api:"rc_api",method:"find_rc_accounts",params:["accounts"],is_object:!0},{api:"condenser_api",method:"get_expiring_vesting_delegations",params:["account","start","limit"]},{api:"database_api",method:"find_change_recovery_account_requests",params:["account"],is_object:!0},{api:"database_api",method:"get_escrow_by_from",params:["from","escrowId"]},{api:"database_api",method:"get_escrow_by_to",params:["to","escrowId"]},{api:"database_api",method:"get_escrow_by_agent",params:["agent","escrowId"]},{api:"database_api",method:"get_account_bandwidth_by_type",params:["account","bandwidthType"]},{api:"database_api",method:"get_account_bandwidth_by_type_and_time",params:["account","bandwidthType","time"]},{api:"database_api",method:"get_proposed_transactions",params:["account"]},{api:"database_api",method:"get_proposed_transaction",params:["account","proposalId"]},{api:"database_api",method:"get_proposed_transaction_expirations",params:["account"]},{api:"database_api",method:"get_proposed_transaction_approvals",params:["account"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_id",params:["proposalId"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_account",params:["account"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_account_and_id",params:["account","proposalId"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_account_and_time",params:["account","time"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_account_and_time_and_id",params:["account","time","proposalId"]},{api:"database_api",method:"get_proposed_transaction_approvals_by_account_and_time_and_id_and_approver",params:["account","time","proposalId","approver"]}];var Ro={};function Uo(t,e){"boolean"==typeof e&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Oo=Uo;Uo.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Uo.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Uo.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=(new Date).getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1)}var i=this;return this._timer=setTimeout((function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout((function(){i._operationTimeoutCb(i._attempts)}),i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)}),r),this._options.unref&&this._timer.unref(),!0},Uo.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){r._operationTimeoutCb()}),r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},Uo.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},Uo.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},Uo.prototype.start=Uo.prototype.try,Uo.prototype.errors=function(){return this._errors},Uo.prototype.attempts=function(){return this._attempts},Uo.prototype.mainError=function(){if(0===this._errors.length)return null;for(var t={},e=null,r=0,i=0;i<this._errors.length;i++){var n=this._errors[i],o=n.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=n,r=s)}return e},function(t){var e=Oo;t.operation=function(r){var i=t.timeouts(r);return new e(i,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},t.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],n=0;n<e.retries;n++)i.push(this.createTimeout(n,e));return t&&t.forever&&!i.length&&i.push(this.createTimeout(n,e)),i.sort((function(t,e){return t-e})),i},t.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,i=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return i=Math.min(i,e.maxTimeout)},t.wrap=function(e,r,i){if(r instanceof Array&&(i=r,r=null),!i)for(var n in i=[],e)"function"==typeof e[n]&&i.push(n);for(var o=0;o<i.length;o++){var s=i[o],a=e[s];e[s]=function(i){var n=t.operation(r),o=Array.prototype.slice.call(arguments,1),s=o.pop();o.push((function(t){n.retry(t)||(t&&(arguments[0]=n.mainError()),s.apply(this,arguments))})),n.attempt((function(){i.apply(e,o)}))}.bind(e,a),e[s].options=r}}}(Ro);var Po=e(Ro);class qo extends v.EventEmitter{constructor(t={}){super(),this.id=0,this.options=t,this.id=0}setOptions(t){Object.assign(this.options,t),this.stop()}listenTo(t,e,r){const i=t;return"addEventListener"in t&&"function"==typeof i.addEventListener?(i.addEventListener(e,r),()=>{i.removeEventListener&&i.removeEventListener(e,r)}):(t.on(e,r),()=>{t.removeListener(e,r)})}send(t,e,r){}start(){return Promise.resolve()}stop(){return Promise.resolve()}}class zo extends Error{constructor(t,e,r){super(t),this.name="JsonRpcError",this.code=e,this.data=r}}const Co=async(t,e,r=fetch,i=3e4)=>{const n={jsonrpc:"2.0",...e};let o=null;const s=new Promise(((t,e)=>{o=setTimeout((()=>{e(new Error(`Request timeout after ${i}ms`))}),i)})),a=r(t,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)}).then((async t=>{if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);const e=await t.json();if(e.error)throw new zo(e.error.message||"JSON-RPC error",e.error.code,e.error.data);return e.result}));try{return await Promise.race([a,s])}finally{o&&clearTimeout(o)}};const Fo={http:class extends qo{constructor(t){super(t)}get nonRetriableOperations(){return["broadcast_transaction","broadcast_transaction_with_callback","broadcast_transaction_synchronous","broadcast_block"]}isBroadcastOperation(t){return this.nonRetriableOperations.includes(t)}send(t,e,r){"function"!=typeof r&&(r=()=>{});const i=this.options.url;if(!i)throw new Error("HTTP transport requires a valid URL");const n=this.options.fetchMethod||fetch,o=e.id,s=[t,e.method,e.params],a=this.isBroadcastOperation(e.method),f=this.options.retry;if(!a&&f){const t="object"==typeof f?Po.operation(f):Po.operation();t.attempt((e=>{n(i,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",method:"call",params:s,id:o}),headers:{"Content-Type":"application/json"}}).then((async t=>{if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return t.json()})).then((t=>{if(t.error){const i=new zo(t.error.message||"JSON-RPC error",t.error.code,t.error.data);r(i,void 0,e)}else r(null,t.result,e)}),(i=>{t.retry(i)||r(t.mainError(),void 0,e)}))}))}else n(i,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",method:"call",params:s,id:o}),headers:{"Content-Type":"application/json"}}).then((async t=>{if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return t.json()})).then((t=>{if(t.error){const e=new zo(t.error.message||"JSON-RPC error",t.error.code,t.error.data);r(e,void 0,1)}else r(null,t.result,1)}),(t=>r(t instanceof Error?t:new Error(String(t)),void 0,1)))}}};var jo,Do={exports:{}},Ho={exports:{}};!function(e){!function(r,i){e&&e.exports?e.exports=function(){var e;try{jo||(jo=1,function(e){!function(t,r){e&&e.exports?e.exports=r():(t.dcodeIO=t.dcodeIO||{}).Long=r()}(t,(function(){function t(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function e(t){return!0===(t&&t.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=e;var r={},i={};function n(t,e){var n,o,a;return e?(a=0<=(t>>>=0)&&t<256)&&(o=i[t])?o:(n=s(t,(0|t)<0?-1:0,!0),a&&(i[t]=n),n):(a=-128<=(t|=0)&&t<128)&&(o=r[t])?o:(n=s(t,t<0?-1:0,!1),a&&(r[t]=n),n)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?b:p;if(e){if(t<0)return b;if(t>=c)return w}else{if(t<=-0x8000000000000000)return _;if(t+1>=d)return v}return t<0?o(-t,e).neg():s(t%u|0,t/u|0,e)}function s(e,r,i){return new t(e,r,i)}t.fromInt=n,t.fromNumber=o,t.fromBits=s;var a=Math.pow;function f(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return p;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return f(t.substring(1),e,r).neg();for(var n=o(a(r,8)),s=p,h=0;h<t.length;h+=8){var u=Math.min(8,t.length-h),c=parseInt(t.substring(h,h+u),r);if(u<8){var d=o(a(r,u));s=s.mul(d).add(o(c))}else s=(s=s.mul(n)).add(o(c))}return s.unsigned=e,s}function h(e){return e instanceof t?e:"number"==typeof e?o(e):"string"==typeof e?f(e):s(e.low,e.high,e.unsigned)}t.fromString=f,t.fromValue=h;var u=4294967296,c=u*u,d=c/2,l=n(1<<24),p=n(0);t.ZERO=p;var b=n(0,!0);t.UZERO=b;var g=n(1);t.ONE=g;var m=n(1,!0);t.UONE=m;var y=n(-1);t.NEG_ONE=y;var v=s(-1,2147483647,!1);t.MAX_VALUE=v;var w=s(-1,-1,!0);t.MAX_UNSIGNED_VALUE=w;var _=s(0,-2147483648,!1);t.MIN_VALUE=_;var M=t.prototype;return M.toInt=function(){return this.unsigned?this.low>>>0:this.low},M.toNumber=function(){return this.unsigned?(this.high>>>0)*u+(this.low>>>0):this.high*u+(this.low>>>0)},M.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(_)){var e=o(t),r=this.div(e),i=r.mul(e).sub(this);return r.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var n=o(a(t,6),this.unsigned),s=this,f="";;){var h=s.div(n),u=(s.sub(h.mul(n)).toInt()>>>0).toString(t);if((s=h).isZero())return u+f;for(;u.length<6;)u="0"+u;f=""+u+f}},M.getHighBits=function(){return this.high},M.getHighBitsUnsigned=function(){return this.high>>>0},M.getLowBits=function(){return this.low},M.getLowBitsUnsigned=function(){return this.low>>>0},M.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&!(t&1<<e);e--);return 0!=this.high?e+33:e+1},M.isZero=function(){return 0===this.high&&0===this.low},M.isNegative=function(){return!this.unsigned&&this.high<0},M.isPositive=function(){return this.unsigned||this.high>=0},M.isOdd=function(){return!(1&~this.low)},M.isEven=function(){return!(1&this.low)},M.equals=function(t){return e(t)||(t=h(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},M.eq=M.equals,M.notEquals=function(t){return!this.eq(t)},M.neq=M.notEquals,M.lessThan=function(t){return this.comp(t)<0},M.lt=M.lessThan,M.lessThanOrEqual=function(t){return this.comp(t)<=0},M.lte=M.lessThanOrEqual,M.greaterThan=function(t){return this.comp(t)>0},M.gt=M.greaterThan,M.greaterThanOrEqual=function(t){return this.comp(t)>=0},M.gte=M.greaterThanOrEqual,M.compare=function(t){if(e(t)||(t=h(t)),this.eq(t))return 0;var r=this.isNegative(),i=t.isNegative();return r&&!i?-1:!r&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},M.comp=M.compare,M.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(g)},M.neg=M.negate,M.add=function(t){e(t)||(t=h(t));var r=this.high>>>16,i=65535&this.high,n=this.low>>>16,o=65535&this.low,a=t.high>>>16,f=65535&t.high,u=t.low>>>16,c=0,d=0,l=0,p=0;return l+=(p+=o+(65535&t.low))>>>16,d+=(l+=n+u)>>>16,c+=(d+=i+f)>>>16,c+=r+a,s((l&=65535)<<16|(p&=65535),(c&=65535)<<16|(d&=65535),this.unsigned)},M.subtract=function(t){return e(t)||(t=h(t)),this.add(t.neg())},M.sub=M.subtract,M.multiply=function(t){if(this.isZero())return p;if(e(t)||(t=h(t)),t.isZero())return p;if(this.eq(_))return t.isOdd()?_:p;if(t.eq(_))return this.isOdd()?_:p;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(l)&&t.lt(l))return o(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,n=this.low>>>16,a=65535&this.low,f=t.high>>>16,u=65535&t.high,c=t.low>>>16,d=65535&t.low,b=0,g=0,m=0,y=0;return m+=(y+=a*d)>>>16,g+=(m+=n*d)>>>16,m&=65535,g+=(m+=a*c)>>>16,b+=(g+=i*d)>>>16,g&=65535,b+=(g+=n*c)>>>16,g&=65535,b+=(g+=a*u)>>>16,b+=r*d+i*c+n*u+a*f,s((m&=65535)<<16|(y&=65535),(b&=65535)<<16|(g&=65535),this.unsigned)},M.mul=M.multiply,M.divide=function(t){if(e(t)||(t=h(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?b:p;var r,i,n;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return b;if(t.gt(this.shru(1)))return m;n=b}else{if(this.eq(_))return t.eq(g)||t.eq(y)?_:t.eq(_)?g:(r=this.shr(1).div(t).shl(1)).eq(p)?t.isNegative()?g:y:(i=this.sub(t.mul(r)),n=r.add(i.div(t)));if(t.eq(_))return this.unsigned?b:p;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();n=p}for(i=this;i.gte(t);){r=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),f=s<=48?1:a(2,s-48),u=o(r),c=u.mul(t);c.isNegative()||c.gt(i);)c=(u=o(r-=f,this.unsigned)).mul(t);u.isZero()&&(u=g),n=n.add(u),i=i.sub(c)}return n},M.div=M.divide,M.modulo=function(t){return e(t)||(t=h(t)),this.sub(this.div(t).mul(t))},M.mod=M.modulo,M.not=function(){return s(~this.low,~this.high,this.unsigned)},M.and=function(t){return e(t)||(t=h(t)),s(this.low&t.low,this.high&t.high,this.unsigned)},M.or=function(t){return e(t)||(t=h(t)),s(this.low|t.low,this.high|t.high,this.unsigned)},M.xor=function(t){return e(t)||(t=h(t)),s(this.low^t.low,this.high^t.high,this.unsigned)},M.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?s(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):s(0,this.low<<t-32,this.unsigned)},M.shl=M.shiftLeft,M.shiftRight=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?s(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):s(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},M.shr=M.shiftRight,M.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0==(t&=63))return this;var r=this.high;return t<32?s(this.low>>>t|r<<32-t,r>>>t,this.unsigned):s(32===t?r:r>>>t-32,0,this.unsigned)},M.shru=M.shiftRightUnsigned,M.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},M.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},M.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},M.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},M.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t}))}(Ho)),e=Ho.exports}catch(t){}return i(e)}():(r.dcodeIO=r.dcodeIO||{}).ByteBuffer=i(r.dcodeIO.Long)}(t,(function(t){var e=function(t,r,n){if(void 0===t&&(t=e.DEFAULT_CAPACITY),void 0===r&&(r=e.DEFAULT_ENDIAN),void 0===n&&(n=e.DEFAULT_NOASSERT),!n){if((t|=0)<0)throw RangeError("Illegal capacity");r=!!r,n=!!n}this.buffer=0===t?i:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=r,this.noAssert=n};e.VERSION="5.0.1",e.LITTLE_ENDIAN=!0,e.BIG_ENDIAN=!1,e.DEFAULT_CAPACITY=16,e.DEFAULT_ENDIAN=e.BIG_ENDIAN,e.DEFAULT_NOASSERT=!1,e.Long=t||null;var r=e.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var i=new ArrayBuffer(0),n=String.fromCharCode;function o(t){var e=0;return function(){return e<t.length?t.charCodeAt(e++):null}}function s(){var t=[],e=[];return function(){if(0===arguments.length)return e.join("")+n.apply(String,t);t.length+arguments.length>1024&&(e.push(n.apply(String,t)),t.length=0),Array.prototype.push.apply(t,arguments)}}function a(t,e,r,i,n){var o,s,a=8*n-i-1,f=(1<<a)-1,h=f>>1,u=-7,c=r?n-1:0,d=r?-1:1,l=t[e+c];for(c+=d,o=l&(1<<-u)-1,l>>=-u,u+=a;u>0;o=256*o+t[e+c],c+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+t[e+c],c+=d,u-=8);if(0===o)o=1-h;else{if(o===f)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,i),o-=h}return(l?-1:1)*s*Math.pow(2,o-i)}function f(t,e,r,i,n,o){var s,a,f,h=8*o-n-1,u=(1<<h)-1,c=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:o-1,p=i?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),(e+=s+c>=1?d/f:d*Math.pow(2,1-c))*f>=2&&(s++,f/=2),s+c>=u?(a=0,s=u):s+c>=1?(a=(e*f-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[r+l]=255&a,l+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;t[r+l]=255&s,l+=p,s/=256,h-=8);t[r+l-p]|=128*b}e.accessor=function(){return Uint8Array},e.allocate=function(t,r,i){return new e(t,r,i)},e.concat=function(t,r,i,n){"boolean"!=typeof r&&"string"==typeof r||(n=i,i=r,r=void 0);for(var o,s=0,a=0,f=t.length;a<f;++a)e.isByteBuffer(t[a])||(t[a]=e.wrap(t[a],r)),(o=t[a].limit-t[a].offset)>0&&(s+=o);if(0===s)return new e(0,i,n);var h,u=new e(s,i,n);for(a=0;a<f;)(o=(h=t[a++]).limit-h.offset)<=0||(u.view.set(h.view.subarray(h.offset,h.limit),u.offset),u.offset+=o);return u.limit=u.offset,u.offset=0,u},e.isByteBuffer=function(t){return!0===(t&&t.__isByteBuffer__)},e.type=function(){return ArrayBuffer},e.wrap=function(t,i,n,o){if("string"!=typeof i&&(o=n,n=i,i=void 0),"string"==typeof t)switch(void 0===i&&(i="utf8"),i){case"base64":return e.fromBase64(t,n);case"hex":return e.fromHex(t,n);case"binary":return e.fromBinary(t,n);case"utf8":return e.fromUTF8(t,n);case"debug":return e.fromDebug(t,n);default:throw Error("Unsupported encoding: "+i)}if(null===t||"object"!=typeof t)throw TypeError("Illegal buffer");var s;if(e.isByteBuffer(t))return(s=r.clone.call(t)).markedOffset=-1,s;if(t instanceof Uint8Array)s=new e(0,n,o),t.length>0&&(s.buffer=t.buffer,s.offset=t.byteOffset,s.limit=t.byteOffset+t.byteLength,s.view=new Uint8Array(t.buffer));else if(t instanceof ArrayBuffer)s=new e(0,n,o),t.byteLength>0&&(s.buffer=t,s.offset=0,s.limit=t.byteLength,s.view=t.byteLength>0?new Uint8Array(t):null);else{if("[object Array]"!==Object.prototype.toString.call(t))throw TypeError("Illegal buffer");(s=new e(t.length,n,o)).limit=t.length;for(var a=0;a<t.length;++a)s.view[a]=t[a]}return s},r.writeBitSet=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if(!(t instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var i,n=e,o=t.length,s=o>>3,a=0;for(e+=this.writeVarint32(o,e);s--;)i=1&!!t[a++]|(1&!!t[a++])<<1|(1&!!t[a++])<<2|(1&!!t[a++])<<3|(1&!!t[a++])<<4|(1&!!t[a++])<<5|(1&!!t[a++])<<6|(1&!!t[a++])<<7,this.writeByte(i,e++);if(a<o){var f=0;for(i=0;a<o;)i|=(1&!!t[a++])<<f++;this.writeByte(i,e++)}return r?(this.offset=e,this):e-n},r.readBitSet=function(t){var e=void 0===t;e&&(t=this.offset);var r,i=this.readVarint32(t),n=i.value,o=n>>3,s=0,a=[];for(t+=i.length;o--;)r=this.readByte(t++),a[s++]=!!(1&r),a[s++]=!!(2&r),a[s++]=!!(4&r),a[s++]=!!(8&r),a[s++]=!!(16&r),a[s++]=!!(32&r),a[s++]=!!(64&r),a[s++]=!!(128&r);if(s<n){var f=0;for(r=this.readByte(t++);s<n;)a[s++]=!!(r>>f++&1)}return e&&(this.offset=t),a},r.readBytes=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+t+") <= "+this.buffer.byteLength)}var i=this.slice(e,e+t);return r&&(this.offset+=t),i},r.writeBytes=r.append,r.writeInt8=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=1,this.view[e]=t,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=this.view[t];return 128&~r||(r=-(255-r+1)),e&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=1,this.view[e]=t,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=this.view[t];return e&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t],r|=this.view[t+1]<<8):(r=this.view[t]<<8,r|=this.view[t+1]),32768&~r||(r=-(65535-r+1)),e&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),r&&(this.offset+=2),this},r.writeUInt16=r.writeUint16,r.readUint16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t],r|=this.view[t+1]<<8):(r=this.view[t]<<8,r|=this.view[t+1]),e&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),r|=0,e&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),e&&(this.offset+=4),r},r.readUInt32=r.readUint32,t&&(r.writeInt64=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),r+=8;var n=this.buffer.byteLength;r>n&&this.resize((n*=2)>r?n:r),r-=8;var o=e.low,s=e.high;return this.littleEndian?(this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o,r+=4,this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s):(this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s,r+=4,this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o),i&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var i=0,n=0;this.littleEndian?(i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0,e+=4,n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0,e+=4,i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0);var o=new t(i,n,!1);return r&&(this.offset+=8),o},r.readLong=r.readInt64,r.writeUint64=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),r+=8;var n=this.buffer.byteLength;r>n&&this.resize((n*=2)>r?n:r),r-=8;var o=e.low,s=e.high;return this.littleEndian?(this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o,r+=4,this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s):(this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s,r+=4,this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o),i&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var i=0,n=0;this.littleEndian?(i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0,e+=4,n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0,e+=4,i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0);var o=new t(i,n,!0);return r&&(this.offset+=8),o},r.readUInt64=r.readUint64),r.writeFloat32=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=4,f(this.view,t,e,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var r=a(this.view,t,this.littleEndian,23,4);return e&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=8;var i=this.buffer.byteLength;return e>i&&this.resize((i*=2)>e?i:e),e-=8,f(this.view,t,e,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=a(this.view,t,this.littleEndian,52,8);return e&&(this.offset+=8),r},r.readDouble=r.readFloat64,e.MAX_VARINT32_BYTES=5,e.calculateVarint32=function(t){return(t>>>=0)<128?1:t<16384?2:t<1<<21?3:t<1<<28?4:5},e.zigZagEncode32=function(t){return((t|=0)<<1^t>>31)>>>0},e.zigZagDecode32=function(t){return t>>>1^-(1&t)},r.writeVarint32=function(t,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var n,o=e.calculateVarint32(t);r+=o;var s=this.buffer.byteLength;for(r>s&&this.resize((s*=2)>r?s:r),r-=o,t>>>=0;t>=128;)n=127&t|128,this.view[r++]=n,t>>>=7;return this.view[r++]=t,i?(this.offset=r,this):o},r.writeVarint32ZigZag=function(t,r){return this.writeVarint32(e.zigZagEncode32(t),r)},r.readVarint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r,i=0,n=0;do{if(!this.noAssert&&t>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}r=this.view[t++],i<5&&(n|=(127&r)<<7*i),++i}while(128&r);return n|=0,e?(this.offset=t,n):{value:n,length:i}},r.readVarint32ZigZag=function(t){var r=this.readVarint32(t);return"object"==typeof r?r.value=e.zigZagDecode32(r.value):r=e.zigZagDecode32(r),r},t&&(e.MAX_VARINT64_BYTES=10,e.calculateVarint64=function(e){"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e));var r=e.toInt()>>>0,i=e.shiftRightUnsigned(28).toInt()>>>0,n=e.shiftRightUnsigned(56).toInt()>>>0;return 0==n?0==i?r<16384?r<128?1:2:r<1<<21?3:4:i<16384?i<128?5:6:i<1<<21?7:8:n<128?9:10},e.zigZagEncode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()},e.zigZagDecode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftRightUnsigned(1).xor(e.and(t.ONE).toSigned().negate()).toSigned()},r.writeVarint64=function(r,i){var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"==typeof r)r=t.fromNumber(r);else if("string"==typeof r)r=t.fromString(r);else if(!(r&&r instanceof t))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=t.fromNumber(r,!1):"string"==typeof r?r=t.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var o=e.calculateVarint64(r),s=r.toInt()>>>0,a=r.shiftRightUnsigned(28).toInt()>>>0,f=r.shiftRightUnsigned(56).toInt()>>>0;i+=o;var h=this.buffer.byteLength;switch(i>h&&this.resize((h*=2)>i?h:i),i-=o,o){case 10:this.view[i+9]=f>>>7&1;case 9:this.view[i+8]=9!==o?128|f:127&f;case 8:this.view[i+7]=8!==o?a>>>21|128:a>>>21&127;case 7:this.view[i+6]=7!==o?a>>>14|128:a>>>14&127;case 6:this.view[i+5]=6!==o?a>>>7|128:a>>>7&127;case 5:this.view[i+4]=5!==o?128|a:127&a;case 4:this.view[i+3]=4!==o?s>>>21|128:s>>>21&127;case 3:this.view[i+2]=3!==o?s>>>14|128:s>>>14&127;case 2:this.view[i+1]=2!==o?s>>>7|128:s>>>7&127;case 1:this.view[i]=1!==o?128|s:127&s}return n?(this.offset+=o,this):o},r.writeVarint64ZigZag=function(t,r){return this.writeVarint64(e.zigZagEncode64(t),r)},r.readVarint64=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i=e,n=0,o=0,s=0,a=0;if(n=127&(a=this.view[e++]),128&a&&(n|=(127&(a=this.view[e++]))<<7,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[e++]))<<14,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[e++]))<<21,(128&a||this.noAssert&&void 0===a)&&(o=127&(a=this.view[e++]),(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[e++]))<<7,(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[e++]))<<14,(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[e++]))<<21,(128&a||this.noAssert&&void 0===a)&&(s=127&(a=this.view[e++]),(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[e++]))<<7,128&a||this.noAssert&&void 0===a))))))))))throw Error("Buffer overrun");var f=t.fromBits(n|o<<28,o>>>4|s<<24,!1);return r?(this.offset=e,f):{value:f,length:e-i}},r.readVarint64ZigZag=function(r){var i=this.readVarint64(r);return i&&i.value instanceof t?i.value=e.zigZagDecode64(i.value):i=e.zigZagDecode64(i),i}),r.writeCString=function(t,e){var r=void 0===e;r&&(e=this.offset);var i,n=t.length;if(!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");for(i=0;i<n;++i)if(0===t.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}n=u.calculateUTF16asUTF8(o(t))[1],e+=n+1;var s=this.buffer.byteLength;return e>s&&this.resize((s*=2)>e?s:e),e-=n+1,u.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),this.view[e++]=0,r?(this.offset=e,this):n},r.readCString=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r,i=t,n=-1;return u.decodeUTF8toUTF16(function(){if(0===n)return null;if(t>=this.limit)throw RangeError("Illegal range: Truncated data, "+t+" < "+this.limit);return 0===(n=this.view[t++])?null:n}.bind(this),r=s(),!0),e?(this.offset=t,r()):{string:r(),length:t-i}},r.writeIString=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var i,n=e;i=u.calculateUTF16asUTF8(o(t),this.noAssert)[1],e+=4+i;var s=this.buffer.byteLength;if(e>s&&this.resize((s*=2)>e?s:e),e-=4+i,this.littleEndian?(this.view[e+3]=i>>>24&255,this.view[e+2]=i>>>16&255,this.view[e+1]=i>>>8&255,this.view[e]=255&i):(this.view[e]=i>>>24&255,this.view[e+1]=i>>>16&255,this.view[e+2]=i>>>8&255,this.view[e+3]=255&i),e+=4,u.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),e!==n+4+i)throw RangeError("Illegal range: Truncated data, "+e+" == "+(e+4+i));return r?(this.offset=e,this):e-n},r.readIString=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var i=t,n=this.readUint32(t),o=this.readUTF8String(n,e.METRICS_BYTES,t+=4);return t+=o.length,r?(this.offset=t,o.string):{string:o.string,length:t-i}},e.METRICS_CHARS="c",e.METRICS_BYTES="b",r.writeUTF8String=function(t,e){var r,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var n=e;r=u.calculateUTF16asUTF8(o(t))[1],e+=r;var s=this.buffer.byteLength;return e>s&&this.resize((s*=2)>e?s:e),e-=r,u.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),i?(this.offset=e,this):e-n},r.writeString=r.writeUTF8String,e.calculateUTF8Chars=function(t){return u.calculateUTF16asUTF8(o(t))[0]},e.calculateUTF8Bytes=function(t){return u.calculateUTF16asUTF8(o(t))[1]},e.calculateString=e.calculateUTF8Bytes,r.readUTF8String=function(t,r,i){"number"==typeof r&&(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),void 0===r&&(r=e.METRICS_CHARS),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");if(t|=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var o,a=0,f=i;if(r===e.METRICS_CHARS){if(o=s(),u.decodeUTF8(function(){return a<t&&i<this.limit?this.view[i++]:null}.bind(this),(function(t){++a,u.UTF8toUTF16(t,o)})),a!==t)throw RangeError("Illegal range: Truncated data, "+a+" == "+t);return n?(this.offset=i,o()):{string:o(),length:i-f}}if(r===e.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+"+t+") <= "+this.buffer.byteLength)}var h=i+t;if(u.decodeUTF8toUTF16(function(){return i<h?this.view[i++]:null}.bind(this),o=s(),this.noAssert),i!==h)throw RangeError("Illegal range: Truncated data, "+i+" == "+h);return n?(this.offset=i,o()):{string:o(),length:i-f}}throw TypeError("Unsupported metrics: "+r)},r.readString=r.readUTF8String,r.writeVString=function(t,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var n,s,a=r;n=u.calculateUTF16asUTF8(o(t),this.noAssert)[1],s=e.calculateVarint32(n),r+=s+n;var f=this.buffer.byteLength;if(r>f&&this.resize((f*=2)>r?f:r),r-=s+n,r+=this.writeVarint32(n,r),u.encodeUTF16toUTF8(o(t),function(t){this.view[r++]=t}.bind(this)),r!==a+n+s)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+n+s));return i?(this.offset=r,this):r-a},r.readVString=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i=t,n=this.readVarint32(t),o=this.readUTF8String(n.value,e.METRICS_BYTES,t+=n.length);return t+=o.length,r?(this.offset=t,o.string):{string:o.string,length:t-i}},r.append=function(t,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}t instanceof e||(t=e.wrap(t,r));var o=t.limit-t.offset;if(o<=0)return this;i+=o;var s=this.buffer.byteLength;return i>s&&this.resize((s*=2)>i?s:i),i-=o,this.view.set(t.view.subarray(t.offset,t.limit),i),t.offset+=o,n&&(this.offset+=o),this},r.appendTo=function(t,e){return t.append(this,e),this},r.assert=function(t){return this.noAssert=!t,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(t){var r=new e(0,this.littleEndian,this.noAssert);return t?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}if(0===t&&e===this.buffer.byteLength)return this;var r=e-t;if(0===r)return this.buffer=i,this.view=null,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=0,this;var n=new ArrayBuffer(r),o=new Uint8Array(n);return o.set(this.view.subarray(t,e)),this.buffer=n,this.view=o,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=r,this},r.copy=function(t,r){if(void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t===r)return new e(0,this.littleEndian,this.noAssert);var i=r-t,n=new e(i,this.littleEndian,this.noAssert);return n.offset=0,n.limit=i,n.markedOffset>=0&&(n.markedOffset-=t),this.copyTo(n,0,t,r),n},r.copyTo=function(t,r,i,n){var o,s;if(!this.noAssert&&!e.isByteBuffer(t))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(s=void 0===r)?t.offset:0|r,i=(o=void 0===i)?this.offset:0|i,n=void 0===n?this.limit:0|n,r<0||r>t.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+t.buffer.byteLength);if(i<0||n>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+i+" <= "+this.buffer.byteLength);var a=n-i;return 0===a?t:(t.ensureCapacity(r+a),t.view.set(this.view.subarray(i,n),r),o&&(this.offset+=a),s&&(t.offset+=a),this)},r.ensureCapacity=function(t){var e=this.buffer.byteLength;return e<t?this.resize((e*=2)>t?e:t):this},r.fill=function(t,e,r){var i=void 0===e;if(i&&(e=this.offset),"string"==typeof t&&t.length>0&&(t=t.charCodeAt(0)),void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e>=r)return this;for(;e<r;)this.view[e++]=t;return i&&(this.offset=e),this},r.flip=function(){return this.limit=this.offset,this.offset=0,this},r.mark=function(t){if(t=void 0===t?this.offset:t,!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=t,this},r.order=function(t){if(!this.noAssert&&"boolean"!=typeof t)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!t,this},r.LE=function(t){return this.littleEndian=void 0===t||!!t,this},r.BE=function(t){return this.littleEndian=void 0!==t&&!t,this},r.prepend=function(t,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}t instanceof e||(t=e.wrap(t,r));var o=t.limit-t.offset;if(o<=0)return this;var s=o-i;if(s>0){var a=new ArrayBuffer(this.buffer.byteLength+s),f=new Uint8Array(a);f.set(this.view.subarray(i,this.buffer.byteLength),o),this.buffer=a,this.view=f,this.offset+=s,this.markedOffset>=0&&(this.markedOffset+=s),this.limit+=s,i+=s}else new Uint8Array(this.buffer);return this.view.set(t.view.subarray(t.offset,t.limit),i-o),t.offset=t.limit,n&&(this.offset-=o),this},r.prependTo=function(t,e){return t.prepend(this,e),this},r.printDebug=function(t){"function"!=typeof t&&(t=console.log.bind(console)),t(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal capacity: "+t+" (not an integer)");if((t|=0)<0)throw RangeError("Illegal capacity: 0 <= "+t)}if(this.buffer.byteLength<t){var e=new ArrayBuffer(t),r=new Uint8Array(e);r.set(this.view),this.buffer=e,this.view=r}return this},r.reverse=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}return t===e||Array.prototype.reverse.call(this.view.subarray(t,e)),this},r.skip=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");t|=0}var e=this.offset+t;if(!this.noAssert&&(e<0||e>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+t+" <= "+this.buffer.byteLength);return this.offset=e,this},r.slice=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=t,r.limit=e,r},r.toBuffer=function(t){var e=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(!t&&0===e&&r===this.buffer.byteLength)return this.buffer;if(e===r)return i;var n=new ArrayBuffer(r-e);return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(e,r),0),n},r.toArrayBuffer=r.toBuffer,r.toString=function(t,e,r){if(void 0===t)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof t&&(r=e=t="utf8"),t){case"utf8":return this.toUTF8(e,r);case"base64":return this.toBase64(e,r);case"hex":return this.toHex(e,r);case"binary":return this.toBinary(e,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+t)}};var h=function(){for(var t={},e=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],i=0,n=e.length;i<n;++i)r[e[i]]=i;return t.encode=function(t,r){for(var i,n;null!==(i=t());)r(e[i>>2&63]),n=(3&i)<<4,null!==(i=t())?(r(e[63&((n|=i>>4&15)|i>>4&15)]),n=(15&i)<<2,null!==(i=t())?(r(e[63&(n|i>>6&3)]),r(e[63&i])):(r(e[63&n]),r(61))):(r(e[63&n]),r(61),r(61))},t.decode=function(t,e){var i,n,o;function s(t){throw Error("Illegal character code: "+t)}for(;null!==(i=t());)if(void 0===(n=r[i])&&s(i),null!==(i=t())&&(void 0===(o=r[i])&&s(i),e(n<<2>>>0|(48&o)>>4),null!==(i=t()))){if(void 0===(n=r[i])){if(61===i)break;s(i)}if(e((15&o)<<4>>>0|(60&n)>>2),null!==(i=t())){if(void 0===(o=r[i])){if(61===i)break;s(i)}e((3&n)<<6>>>0|o)}}},t.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)},t}();r.toBase64=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),e|=0,(t|=0)<0||e>this.capacity||t>e)throw RangeError("begin, end");var r;return h.encode(function(){return t<e?this.view[t++]:null}.bind(this),r=s()),r()},e.fromBase64=function(t,r){if("string"!=typeof t)throw TypeError("str");var i=new e(t.length/4*3,r),n=0;return h.decode(o(t),(function(t){i.view[n++]=t})),i.limit=n,i},e.btoa=function(t){return e.fromBinary(t).toBase64()},e.atob=function(t){return e.fromBase64(t).toBinary()},r.toBinary=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),e|=0,(t|=0)<0||e>this.capacity()||t>e)throw RangeError("begin, end");if(t===e)return"";for(var r=[],i=[];t<e;)r.push(this.view[t++]),r.length>=1024&&(i.push(String.fromCharCode.apply(String,r)),r=[]);return i.join("")+String.fromCharCode.apply(String,r)},e.fromBinary=function(t,r){if("string"!=typeof t)throw TypeError("str");for(var i,n=0,o=t.length,s=new e(o,r);n<o;){if((i=t.charCodeAt(n))>255)throw RangeError("illegal char code: "+i);s.view[n++]=i}return s.limit=o,s},r.toDebug=function(t){for(var e,r=-1,i=this.buffer.byteLength,n="",o="",s="";r<i;){if(-1!==r&&(n+=(e=this.view[r])<16?"0"+e.toString(16).toUpperCase():e.toString(16).toUpperCase(),t&&(o+=e>32&&e<127?String.fromCharCode(e):".")),++r,t&&r>0&&r%16==0&&r!==i){for(;n.length<51;)n+=" ";s+=n+o+"\n",n=o=""}r===this.offset&&r===this.limit?n+=r===this.markedOffset?"!":"|":r===this.offset?n+=r===this.markedOffset?"[":"<":r===this.limit?n+=r===this.markedOffset?"]":">":n+=r===this.markedOffset?"'":t||0!==r&&r!==i?" ":""}if(t&&" "!==n){for(;n.length<51;)n+=" ";s+=n+o+"\n"}return t?s:n},e.fromDebug=function(t,r,i){for(var n,o,s=t.length,a=new e((s+1)/3|0,r,i),f=0,h=0,u=!1,c=!1,d=!1,l=!1,p=!1;f<s;){switch(n=t.charAt(f++)){case"!":if(!i){if(c||d||l){p=!0;break}c=d=l=!0}a.offset=a.markedOffset=a.limit=h,u=!1;break;case"|":if(!i){if(c||l){p=!0;break}c=l=!0}a.offset=a.limit=h,u=!1;break;case"[":if(!i){if(c||d){p=!0;break}c=d=!0}a.offset=a.markedOffset=h,u=!1;break;case"<":if(!i){if(c){p=!0;break}c=!0}a.offset=h,u=!1;break;case"]":if(!i){if(l||d){p=!0;break}l=d=!0}a.limit=a.markedOffset=h,u=!1;break;case">":if(!i){if(l){p=!0;break}l=!0}a.limit=h,u=!1;break;case"'":if(!i){if(d){p=!0;break}d=!0}a.markedOffset=h,u=!1;break;case" ":u=!1;break;default:if(!i&&u){p=!0;break}if(o=parseInt(n+t.charAt(f++),16),!i&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[h++]=o,u=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+f)}if(!i){if(!c||!l)throw TypeError("Illegal str: Missing offset or limit");if(h<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+h+" < "+s)}return a},r.toHex=function(t,e){if(t=void 0===t?this.offset:t,e=void 0===e?this.limit:e,!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}for(var r,i=new Array(e-t);t<e;)(r=this.view[t++])<16?i.push("0",r.toString(16)):i.push(r.toString(16));return i.join("")},e.fromHex=function(t,r,i){if(!i){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if(t.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var n,o=t.length,s=new e(o/2|0,r),a=0,f=0;a<o;a+=2){if(n=parseInt(t.substring(a,a+2),16),!i&&(!isFinite(n)||n<0||n>255))throw TypeError("Illegal str: Contains non-hex characters");s.view[f++]=n}return s.limit=f,s};var u=function(){var t={MAX_CODEPOINT:1114111,encodeUTF8:function(t,e){var r=null;for("number"==typeof t&&(r=t,t=function(){return null});null!==r||null!==(r=t());)r<128?e(127&r):r<2048?(e(r>>6&31|192),e(63&r|128)):r<65536?(e(r>>12&15|224),e(r>>6&63|128),e(63&r|128)):(e(r>>18&7|240),e(r>>12&63|128),e(r>>6&63|128),e(63&r|128)),r=null},decodeUTF8:function(t,e){for(var r,i,n,o,s=function(t){t=t.slice(0,t.indexOf(null));var e=Error(t.toString());throw e.name="TruncatedError",e.bytes=t,e};null!==(r=t());)if(128&r)if(192==(224&r))null===(i=t())&&s([r,i]),e((31&r)<<6|63&i);else if(224==(240&r))(null===(i=t())||null===(n=t()))&&s([r,i,n]),e((15&r)<<12|(63&i)<<6|63&n);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(i=t())||null===(n=t())||null===(o=t()))&&s([r,i,n,o]),e((7&r)<<18|(63&i)<<12|(63&n)<<6|63&o)}else e(r)},UTF16toUTF8:function(t,e){for(var r,i=null;null!==(r=null!==i?i:t());)r>=55296&&r<=57343&&null!==(i=t())&&i>=56320&&i<=57343?(e(1024*(r-55296)+i-56320+65536),i=null):e(r);null!==i&&e(i)},UTF8toUTF16:function(t,e){var r=null;for("number"==typeof t&&(r=t,t=function(){return null});null!==r||null!==(r=t());)r<=65535?e(r):(e(55296+((r-=65536)>>10)),e(r%1024+56320)),r=null},encodeUTF16toUTF8:function(e,r){t.UTF16toUTF8(e,(function(e){t.encodeUTF8(e,r)}))},decodeUTF8toUTF16:function(e,r){t.decodeUTF8(e,(function(e){t.UTF8toUTF16(e,r)}))},calculateCodePoint:function(t){return t<128?1:t<2048?2:t<65536?3:4},calculateUTF8:function(t){for(var e,r=0;null!==(e=t());)r+=e<128?1:e<2048?2:e<65536?3:4;return r},calculateUTF16asUTF8:function(e){var r=0,i=0;return t.UTF16toUTF8(e,(function(t){++r,i+=t<128?1:t<2048?2:t<65536?3:4})),[r,i]}};return t}();return r.toUTF8=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var r;try{u.decodeUTF8toUTF16(function(){return t<e?this.view[t++]:null}.bind(this),r=s())}catch(r){if(t!==e)throw RangeError("Illegal range: Truncated data, "+t+" != "+e)}return r()},e.fromUTF8=function(t,r,i){if(!i&&"string"!=typeof t)throw TypeError("Illegal str: Not a string");var n=new e(u.calculateUTF16asUTF8(o(t),!0)[1],r,i),s=0;return u.encodeUTF16toUTF8(o(t),(function(t){n.view[s++]=t})),n.limit=s,n},e}))}(Do);var Zo=e(Do.exports),Vo=null;try{Vo=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function $o(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function Wo(t){return!0===(t&&t.__isLong__)}function Jo(t){var e=Math.clz32(t&-t);return t?31-e:e}$o.prototype.__isLong__,Object.defineProperty($o.prototype,"__isLong__",{value:!0}),$o.isLong=Wo;var Ko={},Xo={};function Yo(t,e){var r,i,n;return e?(n=0<=(t>>>=0)&&t<256)&&(i=Xo[t])?i:(r=Qo(t,0,!0),n&&(Xo[t]=r),r):(n=-128<=(t|=0)&&t<128)&&(i=Ko[t])?i:(r=Qo(t,t<0?-1:0,!1),n&&(Ko[t]=r),r)}function Go(t,e){if(isNaN(t))return e?fs:as;if(e){if(t<0)return fs;if(t>=ns)return ls}else{if(t<=-0x8000000000000000)return ps;if(t+1>=os)return ds}return t<0?Go(-t,e).neg():Qo(t%is|0,t/is|0,e)}function Qo(t,e,r){return new $o(t,e,r)}$o.fromInt=Yo,$o.fromNumber=Go,$o.fromBits=Qo;var ts=Math.pow;function es(t,e,r){if(0===t.length)throw Error("empty string");if("number"==typeof e?(r=e,e=!1):e=!!e,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e?fs:as;if((r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return es(t.substring(1),e,r).neg();for(var n=Go(ts(r,8)),o=as,s=0;s<t.length;s+=8){var a=Math.min(8,t.length-s),f=parseInt(t.substring(s,s+a),r);if(a<8){var h=Go(ts(r,a));o=o.mul(h).add(Go(f))}else o=(o=o.mul(n)).add(Go(f))}return o.unsigned=e,o}function rs(t,e){return"number"==typeof t?Go(t,e):"string"==typeof t?es(t,e):Qo(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}$o.fromString=es,$o.fromValue=rs;var is=4294967296,ns=is*is,os=ns/2,ss=Yo(1<<24),as=Yo(0);$o.ZERO=as;var fs=Yo(0,!0);$o.UZERO=fs;var hs=Yo(1);$o.ONE=hs;var us=Yo(1,!0);$o.UONE=us;var cs=Yo(-1);$o.NEG_ONE=cs;var ds=Qo(-1,2147483647,!1);$o.MAX_VALUE=ds;var ls=Qo(-1,-1,!0);$o.MAX_UNSIGNED_VALUE=ls;var ps=Qo(0,-2147483648,!1);$o.MIN_VALUE=ps;var bs=$o.prototype;function gs(t,e){if(!Array.isArray(e)||2!==e.length)throw new Error("Operation must be an array of [operation_type, operation_data]");const[r,i]=e,n=function(t){const e={vote:0,comment:1,transfer:2,transfer_to_vesting:3,withdraw_vesting:4,limit_order_create:5,limit_order_cancel:6,feed_publish:7,convert:8,account_create:9,account_update:10,witness_update:11,account_witness_vote:12,account_witness_proxy:13,pow:14,custom:15,delete_comment:17,custom_json:18,comment_options:19}[t];if(void 0===e)throw new Error(`Unknown operation type: ${t}. Please add it to the operation map.`);return e}(r);t.writeVarint32(n),function(t,e,r){switch(e){case"comment":!function(t,e){const r=e;vs(t,String(r.parent_author||"")),vs(t,String(r.parent_permlink||"")),vs(t,String(r.author||"")),vs(t,String(r.permlink||"")),vs(t,String(r.title||"")),vs(t,String(r.body||"")),vs(t,String(r.json_metadata||"{}"))}(t,r);break;case"vote":!function(t,e){const r=e;vs(t,String(r.voter||"")),vs(t,String(r.author||"")),vs(t,String(r.permlink||"")),t.writeInt16(r.weight||0)}(t,r);break;case"transfer":!function(t,e){const r=e;vs(t,String(r.from||"")),vs(t,String(r.to||"")),ys(t,String(r.amount||"0.000 STEEM")),vs(t,String(r.memo||""))}(t,r);break;case"account_create":!function(t,e){const r=e;if(ys(t,String(r.fee||"0.000 STEEM")),vs(t,String(r.creator||"")),vs(t,String(r.new_account_name||"")),ms(t,r.owner),ms(t,r.active),ms(t,r.posting),"string"==typeof r.memo_key){const e=lo.fromStringOrThrow(r.memo_key);t.append(e.toBuffer())}else if(Q.Buffer.isBuffer(r.memo_key))t.append(r.memo_key);else{if(!r.memo_key||"function"!=typeof r.memo_key.toBuffer)throw new Error("Invalid memo_key format");t.append(r.memo_key.toBuffer())}vs(t,String(r.json_metadata||""))}(t,r);break;case"custom_json":!function(t,e){const r=e,i=Array.isArray(r.required_auths)?r.required_auths.slice().sort():[];t.writeVarint32(i.length);for(const e of i)vs(t,String(e));const n=Array.isArray(r.required_posting_auths)?r.required_posting_auths.slice().sort():[];t.writeVarint32(n.length);for(const e of n)vs(t,String(e));vs(t,String(r.id||"")),vs(t,String(r.json||"{}"))}(t,r);break;default:throw new Error(`Operation type ${e} serialization not fully implemented`)}}(t,r,i)}function ms(t,e){const r=e;t.writeUint32(r.weight_threshold||1);const i=Array.isArray(r.account_auths)?r.account_auths:[];i.sort(((t,e)=>{const r=Array.isArray(t)&&t[0]?String(t[0]):"",i=Array.isArray(e)&&e[0]?String(e[0]):"";return r.localeCompare(i)})),t.writeVarint32(i.length);for(const e of i)Array.isArray(e)&&e.length>=2&&(vs(t,String(e[0])),t.writeUint16(e[1]));const n=Array.isArray(r.key_auths)?r.key_auths:[];n.sort(((t,e)=>{const r=Array.isArray(t)&&t[0]?String(t[0]):"",i=Array.isArray(e)&&e[0]?String(e[0]):"";return r.localeCompare(i)})),t.writeVarint32(n.length);for(const e of n)if(Array.isArray(e)&&e.length>=2){const r=String(e[0]),i=e[1],n=lo.fromStringOrThrow(r);t.append(n.toBuffer()),t.writeUint16(i)}}function ys(t,e){const r=e.split(" "),i=r[0]||"0.000",n=r[1]||"STEEM",[o,s=""]=i.split("."),a=s.length,f=parseInt(o+s.padEnd(a,"0"),10)||0;t.writeInt64(f),t.writeUint8(a);const h=Q.Buffer.from(n,"utf8");t.append(h);for(let e=h.length;e<7;e++)t.writeUint8(0)}function vs(t,e){t.writeVString(e)}bs.toInt=function(){return this.unsigned?this.low>>>0:this.low},bs.toNumber=function(){return this.unsigned?(this.high>>>0)*is+(this.low>>>0):this.high*is+(this.low>>>0)},bs.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(ps)){var e=Go(t),r=this.div(e),i=r.mul(e).sub(this);return r.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var n=Go(ts(t,6),this.unsigned),o=this,s="";;){var a=o.div(n),f=(o.sub(a.mul(n)).toInt()>>>0).toString(t);if((o=a).isZero())return f+s;for(;f.length<6;)f="0"+f;s=""+f+s}},bs.getHighBits=function(){return this.high},bs.getHighBitsUnsigned=function(){return this.high>>>0},bs.getLowBits=function(){return this.low},bs.getLowBitsUnsigned=function(){return this.low>>>0},bs.getNumBitsAbs=function(){if(this.isNegative())return this.eq(ps)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&!(t&1<<e);e--);return 0!=this.high?e+33:e+1},bs.isSafeInteger=function(){var t=this.high>>21;return!t||!this.unsigned&&(-1===t&&!(0===this.low&&-2097152===this.high))},bs.isZero=function(){return 0===this.high&&0===this.low},bs.eqz=bs.isZero,bs.isNegative=function(){return!this.unsigned&&this.high<0},bs.isPositive=function(){return this.unsigned||this.high>=0},bs.isOdd=function(){return!(1&~this.low)},bs.isEven=function(){return!(1&this.low)},bs.equals=function(t){return Wo(t)||(t=rs(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},bs.eq=bs.equals,bs.notEquals=function(t){return!this.eq(t)},bs.neq=bs.notEquals,bs.ne=bs.notEquals,bs.lessThan=function(t){return this.comp(t)<0},bs.lt=bs.lessThan,bs.lessThanOrEqual=function(t){return this.comp(t)<=0},bs.lte=bs.lessThanOrEqual,bs.le=bs.lessThanOrEqual,bs.greaterThan=function(t){return this.comp(t)>0},bs.gt=bs.greaterThan,bs.greaterThanOrEqual=function(t){return this.comp(t)>=0},bs.gte=bs.greaterThanOrEqual,bs.ge=bs.greaterThanOrEqual,bs.compare=function(t){if(Wo(t)||(t=rs(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},bs.comp=bs.compare,bs.negate=function(){return!this.unsigned&&this.eq(ps)?ps:this.not().add(hs)},bs.neg=bs.negate,bs.add=function(t){Wo(t)||(t=rs(t));var e=this.high>>>16,r=65535&this.high,i=this.low>>>16,n=65535&this.low,o=t.high>>>16,s=65535&t.high,a=t.low>>>16,f=0,h=0,u=0,c=0;return u+=(c+=n+(65535&t.low))>>>16,h+=(u+=i+a)>>>16,f+=(h+=r+s)>>>16,f+=e+o,Qo((u&=65535)<<16|(c&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},bs.subtract=function(t){return Wo(t)||(t=rs(t)),this.add(t.neg())},bs.sub=bs.subtract,bs.multiply=function(t){if(this.isZero())return this;if(Wo(t)||(t=rs(t)),Vo)return Qo(Vo.mul(this.low,this.high,t.low,t.high),Vo.get_high(),this.unsigned);if(t.isZero())return this.unsigned?fs:as;if(this.eq(ps))return t.isOdd()?ps:as;if(t.eq(ps))return this.isOdd()?ps:as;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(ss)&&t.lt(ss))return Go(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,r=65535&this.high,i=this.low>>>16,n=65535&this.low,o=t.high>>>16,s=65535&t.high,a=t.low>>>16,f=65535&t.low,h=0,u=0,c=0,d=0;return c+=(d+=n*f)>>>16,u+=(c+=i*f)>>>16,c&=65535,u+=(c+=n*a)>>>16,h+=(u+=r*f)>>>16,u&=65535,h+=(u+=i*a)>>>16,u&=65535,h+=(u+=n*s)>>>16,h+=e*f+r*a+i*s+n*o,Qo((c&=65535)<<16|(d&=65535),(h&=65535)<<16|(u&=65535),this.unsigned)},bs.mul=bs.multiply,bs.divide=function(t){if(Wo(t)||(t=rs(t)),t.isZero())throw Error("division by zero");var e,r,i;if(Vo)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?Qo((this.unsigned?Vo.div_u:Vo.div_s)(this.low,this.high,t.low,t.high),Vo.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?fs:as;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return fs;if(t.gt(this.shru(1)))return us;i=fs}else{if(this.eq(ps))return t.eq(hs)||t.eq(cs)?ps:t.eq(ps)?hs:(e=this.shr(1).div(t).shl(1)).eq(as)?t.isNegative()?hs:cs:(r=this.sub(t.mul(e)),i=e.add(r.div(t)));if(t.eq(ps))return this.unsigned?fs:as;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();i=as}for(r=this;r.gte(t);){e=Math.max(1,Math.floor(r.toNumber()/t.toNumber()));for(var n=Math.ceil(Math.log(e)/Math.LN2),o=n<=48?1:ts(2,n-48),s=Go(e),a=s.mul(t);a.isNegative()||a.gt(r);)a=(s=Go(e-=o,this.unsigned)).mul(t);s.isZero()&&(s=hs),i=i.add(s),r=r.sub(a)}return i},bs.div=bs.divide,bs.modulo=function(t){return Wo(t)||(t=rs(t)),Vo?Qo((this.unsigned?Vo.rem_u:Vo.rem_s)(this.low,this.high,t.low,t.high),Vo.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},bs.mod=bs.modulo,bs.rem=bs.modulo,bs.not=function(){return Qo(~this.low,~this.high,this.unsigned)},bs.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},bs.clz=bs.countLeadingZeros,bs.countTrailingZeros=function(){return this.low?Jo(this.low):Jo(this.high)+32},bs.ctz=bs.countTrailingZeros,bs.and=function(t){return Wo(t)||(t=rs(t)),Qo(this.low&t.low,this.high&t.high,this.unsigned)},bs.or=function(t){return Wo(t)||(t=rs(t)),Qo(this.low|t.low,this.high|t.high,this.unsigned)},bs.xor=function(t){return Wo(t)||(t=rs(t)),Qo(this.low^t.low,this.high^t.high,this.unsigned)},bs.shiftLeft=function(t){return Wo(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?Qo(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Qo(0,this.low<<t-32,this.unsigned)},bs.shl=bs.shiftLeft,bs.shiftRight=function(t){return Wo(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?Qo(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Qo(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},bs.shr=bs.shiftRight,bs.shiftRightUnsigned=function(t){return Wo(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?Qo(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):Qo(32===t?this.high:this.high>>>t-32,0,this.unsigned)},bs.shru=bs.shiftRightUnsigned,bs.shr_u=bs.shiftRightUnsigned,bs.rotateLeft=function(t){var e;return Wo(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?Qo(this.high,this.low,this.unsigned):t<32?(e=32-t,Qo(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)):(e=32-(t-=32),Qo(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned))},bs.rotl=bs.rotateLeft,bs.rotateRight=function(t){var e;return Wo(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?Qo(this.high,this.low,this.unsigned):t<32?(e=32-t,Qo(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned)):(e=32-(t-=32),Qo(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned))},bs.rotr=bs.rotateRight,bs.toSigned=function(){return this.unsigned?Qo(this.low,this.high,!1):this},bs.toUnsigned=function(){return this.unsigned?this:Qo(this.low,this.high,!0)},bs.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},bs.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},bs.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},$o.fromBytes=function(t,e,r){return r?$o.fromBytesLE(t,e):$o.fromBytesBE(t,e)},$o.fromBytesLE=function(t,e){return new $o(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},$o.fromBytesBE=function(t,e){return new $o(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)},"function"==typeof BigInt&&($o.fromBigInt=function(t,e){return Qo(Number(BigInt.asIntN(32,t)),Number(BigInt.asIntN(32,t>>BigInt(32))),e)},$o.fromValue=function(t,e){return"bigint"==typeof t?$o.fromBigInt(t,e):rs(t,e)},bs.toBigInt=function(){var t=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|t});class ws{static fromBuffer(t){const e=Zo.fromBinary(t.toString("binary"),Zo.LITTLE_ENDIAN),r=lo.fromBuffer(e.readBytes(33).toBuffer()),i=lo.fromBuffer(e.readBytes(33).toBuffer()),n=e.readUint64().toString(),o=e.readUint32(),s=e.readVarint32();return{from:r,to:i,nonce:n,check:o,encrypted:e.readBytes(s).toString("hex")}}static toBuffer(t){const e=new Zo(Zo.DEFAULT_CAPACITY,Zo.LITTLE_ENDIAN);let r;if(e.append(t.from.toBuffer()),e.append(t.to.toBuffer()),"string"==typeof t.nonce)try{r=$o.fromString(t.nonce,!0,10)}catch{const e=Number(t.nonce);if(isNaN(e)||!isFinite(e))throw new Error(`Invalid nonce format: ${t.nonce}`);r=$o.fromNumber(e,!0)}else r=$o.fromNumber(t.nonce,!0);const i=Q.Buffer.from(r.toBytesLE());e.append(i),e.writeUint32(t.check);const n=Q.Buffer.from(t.encrypted,"hex");return e.writeVarint32(n.length),e.append(n),e.flip(),Q.Buffer.from(e.toBuffer())}}const _s={toBuffer:t=>function(t){const e=new Zo(Zo.DEFAULT_CAPACITY,Zo.LITTLE_ENDIAN),r=t;let i;if(e.writeUint16(r.ref_block_num||0),e.writeUint32(r.ref_block_prefix||0),"string"==typeof r.expiration){let t=r.expiration;t.endsWith("Z")||(t+="Z");const e=new Date(t);i=Math.floor(e.getTime()/1e3)}else i="number"==typeof r.expiration?r.expiration:0;e.writeUint32(i);const n=Array.isArray(r.operations)?r.operations:[];e.writeVarint32(n.length);for(const t of n)gs(e,t);if(e.writeVarint32(0),"signatures"in r){const t=Array.isArray(r.signatures)?r.signatures:[];e.writeVarint32(t.length);for(const r of t)if("string"==typeof r){const t=Q.Buffer.from(r,"hex");e.append(t)}else{if(!Q.Buffer.isBuffer(r))throw new Error("Invalid signature format");e.append(r)}}return e.flip(),Q.Buffer.from(e.toBuffer())}(t)},Ms={toObject:t=>t,toBuffer:t=>Q.Buffer.from(JSON.stringify(t))};var As=Object.freeze({__proto__:null,Serializer:ws,signed_transaction:Ms,transaction:_s});const Es={verify(t,e,r){let i=!1;const n=r;if(!n||"object"!=typeof n)return!1;const o=Object.keys(n),s=this.generateKeys(t,e,o);return o.forEach((t=>{const e=n[t];if(Array.isArray(e)&&e.length>0){const r=e[0];Array.isArray(r)&&r.length>0&&r[0]===s[t]&&(i=!0)}})),i},generateKeys(t,e,r=["owner","active","posting","memo"]){const i={};return r.forEach((r=>{const n=(t+r+e).trim().split(/[\t\n\v\f\r ]+/).join(" "),o=mo.fromSeed(n);i[r]=o.toPublic().toString()})),i},getPrivateKeys(t,e,r=["owner","active","posting","memo"]){const i={};return r.forEach((r=>{const n=(t+r+e).trim().split(/[\t\n\v\f\r ]+/).join(" "),o=mo.fromSeed(n);i[r]=o.toWif(),i[r+"Pubkey"]=o.toPublic().toString()})),i},isWif(t){let e=!1;try{const r=Q.Buffer.from(fo.decode(t)),i=r.slice(0,-4),n=r.slice(-4);let o=no(i);o=no(o),o=o.slice(0,4),n.toString()===o.toString()&&(e=!0)}catch{}return e},toWif(t,e,r){const i=(t+r+e).trim().split(/[\t\n\v\f\r ]+/).join(" "),n=no(Q.Buffer.from(i)),o=Q.Buffer.concat([Q.Buffer.from([128]),n]);let s=no(o);s=no(s),s=s.slice(0,4);const a=Q.Buffer.concat([o,s]);return fo.encode(a)},wifIsValid(t,e){return this.wifToPublic(t)===e},wifToPublic:t=>mo.fromWif(t).toPublic().toString(),isPubkey(t,e){try{return null!==lo.fromString(t,e)}catch{return!1}},signTransaction(t,e){if(!Array.isArray(e))throw new Error("Keys must be an array");const r=[],i=t;Array.isArray(i.signatures)&&r.push(...i.signatures.map((t=>Q.Buffer.isBuffer(t)?t.toString("hex"):String(t))));const n=M().get("chain_id")||"",o=Q.Buffer.from(n,"hex"),s=_s.toBuffer(t);for(const t of e){const e=Eo.signBuffer(Q.Buffer.concat([o,s]),t);r.push(e.toBuffer().toString("hex"))}const a=t;return Ms.toObject(Object.assign(a,{signatures:r}))}},Ss=Es.verify.bind(Es),Is=Es.generateKeys.bind(Es),Bs=Es.getPrivateKeys.bind(Es),xs=Es.isWif.bind(Es),Ts=Es.toWif.bind(Es),Ls=Es.wifIsValid.bind(Es),ks=Es.wifToPublic.bind(Es),Ns=Es.isPubkey.bind(Es),Rs=Es.signTransaction.bind(Es);var Us=Object.freeze({__proto__:null,Address:So,Auth:Es,PrivateKey:mo,PublicKey:lo,Signature:Eo,default:Es,generateKeys:Is,getPrivateKey:t=>{const e=t.trim().split(/[\t\n\v\f\r ]+/).join(" "),r=no(Q.Buffer.from(e)),i=Q.Buffer.concat([Q.Buffer.from([128]),r]);let n=no(i);n=no(n),n=n.slice(0,4);const o=Q.Buffer.concat([i,n]);return fo.encode(o)},getPrivateKeys:Bs,getPublicKey:t=>mo.fromWif(t).toPublic().toString(),isPubkey:Ns,isWif:xs,sign:(t,e)=>{const r=mo.fromWif(e);return Eo.signBuffer(Q.Buffer.from(t),r).toHex()},signTransaction:Rs,toWif:Ts,verify:Ss,verifySignature:(t,e,r)=>{try{const i=lo.fromString(r);if(!i)return!1;return Eo.fromHex(e).verifyBuffer(Q.Buffer.from(t),i)}catch{return!1}},verifyTransaction:(t,e)=>{try{const r=lo.fromString(e);if(!r)return!1;const i=Q.Buffer.from(JSON.stringify(t)),n=t;return!(!n.signatures||!Array.isArray(n.signatures))&&n.signatures.some((t=>Eo.fromHex(t).verifyBuffer(i,r)))}catch{return!1}},wifIsValid:Ls,wifToPublic:ks});class Os extends v.EventEmitter{static _wrapWithPromise(t){return function(...e){return"function"==typeof e[e.length-1]?t.apply(this,e):new Promise(((r,i)=>{t.apply(this,[...e,(t,e)=>{if(t)return i(t);r(Boolean(e))}])}))}}constructor(t={}){super(),this.seqNo=0,this._transportType="http",this.transport=null,this.__logger=!1,this._setTransport(t),this._setLogger(t),this.options=t,No.forEach((t=>{const e=t.method_name||X(t.method),r=t.params||[];this[`${e}With`]=(i,n)=>{const o=i,s=n;let a;return a=t.is_object?i:r.map((t=>o[t])),this.send(t.api,{method:t.method,params:a},((t,r)=>{if("getConfig"===e&&r&&"object"==typeof r){const t=r;if(!("STEEMIT_ADDRESS_PREFIX"in t)){const e=M().all();t.STEEMIT_ADDRESS_PREFIX=e.address_prefix||"STM"}if(!("STEEMIT_CHAIN_ID"in t)){const e=M().all();t.STEEMIT_CHAIN_ID=e.chain_id||"0000000000000000000000000000000000000000000000000000000000000000"}}s&&s(t,r)}))},this[e]=Os._wrapWithPromise((function(...t){const i=r.reduce(((e,r,i)=>(e[r]=t[i],e)),{}),n=t[r.length];return this[`${e}With`](i,n)})),this[`${e}WithAsync`]=G(this[`${e}With`]),this[`${e}Async`]=G(this[e])}))}_setTransport(t){if(t.url&&t.url.match(/^((http|https)?:\/\/)/))t.transport="http",this._transportType=t.transport,this.options=t,this.transport=new Fo.http(t);else if(t.transport){const e="string"==typeof t.transport?t.transport:"custom";if(this.transport&&this._transportType!==e&&"function"==typeof this.transport.stop&&this.transport.stop(),this._transportType=e,"string"==typeof t.transport){if(!Fo[t.transport])throw new TypeError("Invalid `transport`, valid values are `http` or a class");const e=Fo[t.transport];this.transport=new e(t)}else this.transport=new t.transport(t)}else{const e=(M().get("nodes")||["https://api.steemit.com"])[0]||"https://api.steemit.com";t.url=e,t.transport="http",this._transportType=t.transport,this.options=t,this.transport=new Fo.http(t)}}_setLogger(t){if(Object.prototype.hasOwnProperty.call(t,"logger"))switch(typeof t.logger){case"function":this.__logger={log:t.logger};break;case"object":if("function"!=typeof t.logger.log)throw new Error("setOptions({logger:{}}) must have a property .log of type function");this.__logger=t.logger;break;case"undefined":if(this.__logger)break;this.__logger=!1;break;default:this.__logger=!1}}log(t,...e){if(this.__logger){const r=this.__logger;e.length>0&&"function"==typeof r[t]?r[t].apply(this.__logger,e):this.__logger.log.apply(this.__logger,[t,...e])}}start(){if(!this.transport)throw new Error("Transport not initialized");return this.transport.start()}stop(){return this.transport?this.transport.stop():Promise.resolve()}send(t,e,r){let i=r;if(this.__logger){const t=Math.random();this.log("xmit:"+t+":",e),i=(e,i)=>{e?this.log("error","rsp:"+t+":\n\n",e,i):this.log("rsp:"+t+":",i),r&&"function"==typeof r&&r(e,i)}}if(!this.transport)throw new Error("Transport not initialized");return this.transport.send(t,e,i)}call(t,e,r){if("http"!==this._transportType)return void r(new Error("RPC methods can only be called when using http transport"));const i=++this.seqNo,n=this.options.fetchMethod||fetch;Co(this.options.url,{method:t,params:e,id:i},n).then((t=>{r(null,t)}),(t=>{r(t)}))}callAsync(t,e){return new Promise(((r,i)=>{this.call(t,e,((t,e)=>{t?i(t):r(e)}))}))}signedCall(t,e,r,i,n){if("http"!==this._transportType)return void n(new Error("RPC methods can only be called when using http transport"));const o=++this.seqNo;let s;try{s=Lo({method:t,params:e,id:o},r,[i])}catch(t){return void n(t instanceof Error?t:new Error(String(t)))}const a=this.options.fetchMethod||fetch;Co(this.options.url,s,a).then((t=>{n(null,t)}),(t=>{n(t)}))}signedCallAsync(t,e,r,i){return new Promise(((n,o)=>{this.signedCall(t,e,r,i,((t,e)=>{t?o(t):n(e)}))}))}verifySignedRequest(t,e){Promise.resolve().then((function(){return ko})).then((({validate:r})=>{r(t,(async(t,e,r)=>{const i=await new Promise(((t,e)=>{this.call("condenser_api.get_accounts",[[r]],((r,i)=>{r?e(r):t(Array.isArray(i)?i:[])}))}));if(!i||0===i.length)throw new Error(`Account ${r} not found`);const n=i[0],o=n.owner?.key_auths,s=n.active?.key_auths,a=n.posting?.key_auths,f=[o?.[0]?.[0],s?.[0]?.[0],a?.[0]?.[0],n.memo_key].filter(Boolean),{Signature:h,PublicKey:u}=await Promise.resolve().then((function(){return Us}));let c=!1;for(const r of e){for(const e of f)try{const i=h.fromHex(r),n=u.fromString(String(e));if(n&&i.verifyBuffer(t,n)){c=!0;break}}catch{}if(c)break}if(!c)throw new Error("No valid signature found for account")})).then((t=>e(null,{valid:!0,params:t}))).catch((t=>e(t instanceof Error?t:new Error(String(t)))))})).catch(e)}verifySignedRequestAsync(t){return new Promise(((e,r)=>{this.verifySignedRequest(t,((t,i)=>{t?r(t):e(i)}))}))}setOptions(t){if(Object.assign(this.options,t),this._setLogger(t),this._setTransport(t),!this.transport)throw new Error("Transport not initialized");this.transport.setOptions(t),Object.prototype.hasOwnProperty.call(t,"useTestNet")&&M().set("address_prefix",t.useTestNet?"TST":"STM")}setUrl(t){this.setOptions({url:t})}streamBlockNumber(t="head",e,r=200){if("function"==typeof t&&(e=t,t="head"),!e)throw new Error("callback is required");let i=0,n=!0;const o=()=>{n&&this.getDynamicGlobalPropertiesAsync().then((n=>{const s=n,a="irreversible"===t?s.last_irreversible_block_num:s.head_block_number;if(a!==i)if(i)for(let t=i;t<a;t++)t!==i&&e(null,t),i=t;else i=a,e(null,a);setTimeout(o,r)}),(t=>{e(t)}))};return o(),()=>{n=!1}}streamBlock(t="head",e){"function"==typeof t&&(e=t,t="head");let r=0,i=0;const n=this.streamBlockNumber(t,((t,o)=>{if(t)return n(),void e(t);r=o,r!==i&&(i=r,this.getBlock(r,e))}));return n}streamTransactions(t="head",e){"function"==typeof t&&(e=t,t="head");let r=0,i=0;if("function"==typeof t&&(e=t,t="head"),!e)throw new Error("callback is required");const n=this.streamBlockNumber(t,((t,o)=>{if(t)return n(),void e(t);r=o,r!==i&&(i=r,this.getBlock(r,((t,r)=>{if(t)e(t);else if(r&&"object"==typeof r&&"transactions"in r){const t=r;Array.isArray(t.transactions)&&t.transactions.forEach((t=>{e(null,t)}))}})))}));return n}streamOperations(t="head",e){"function"==typeof t&&(e=t,t="head");let r=0,i=0;if("function"==typeof t&&(e=t,t="head"),!e)throw new Error("callback is required");const n=this.streamBlockNumber(t,((t,o)=>{if(t)return n(),void e(t);r=o,r!==i&&(i=r,this.getBlock(r,((t,r)=>{if(t)e(t);else if(r&&"object"==typeof r&&"transactions"in r){const t=r;Array.isArray(t.transactions)&&t.transactions.forEach((t=>{Array.isArray(t.operations)&&t.operations.forEach((t=>{e(null,t)}))}))}})))}));return n}broadcastTransactionSynchronousWith(t,e){const r=t.transaction;r?this.broadcastTransactionSynchronous(r,e):e(new Error("transaction is required"))}broadcastTransactionSynchronousWithAsync(t){return new Promise(((e,r)=>{this.broadcastTransactionSynchronousWith(t,((t,i)=>{t?r(t):e(i)}))}))}broadcastTransaction(t,e){const r=this.broadcastTransactionSynchronous;"function"==typeof r?r(t,e):this.transport&&"function"==typeof this.transport.broadcastTransactionSynchronous?this.transport.broadcastTransactionSynchronous(t,e):e(new Error("broadcastTransaction is not implemented"))}broadcastTransactionAsync(t){return new Promise(((e,r)=>{this.broadcastTransaction(t,((t,i)=>{t?r(t):e(i)}))}))}signTransaction(t,e){return Es.signTransaction(t,e)}getFollowers(t,e,r,i,n){if(!n)return this.get_followers(t,e,r,i).then((t=>Array.isArray(t)?t:[])).catch((()=>[]));this.get_followers(t,e,r,i,((t,e)=>{if(t)return n(t);n(null,Array.isArray(e)?e:[])}))}broadcastTransactionWithCallback(t,e,r){"http"===this._transportType?this.send("network_broadcast_api",{method:"broadcast_transaction_with_callback",params:[t,e]},r):r(new Error("broadcastTransactionWithCallback can only be called when using http transport"))}broadcastTransactionWithCallbackAsync(t,e){return new Promise(((r,i)=>{this.broadcastTransactionWithCallback(t,e,((t,e)=>{t?i(t):r(e)}))}))}broadcastBlock(t,e){"http"===this._transportType?this.send("network_broadcast_api",{method:"broadcast_block",params:[t]},e):e(new Error("broadcastBlock can only be called when using http transport"))}broadcastBlockAsync(t){return new Promise(((e,r)=>{this.broadcastBlock(t,((t,i)=>{t?r(t):e(i)}))}))}setMaxBlockAge(t,e){"http"===this._transportType?this.send("network_broadcast_api",{method:"set_max_block_age",params:[t]},e):e(new Error("setMaxBlockAge can only be called when using http transport"))}setMaxBlockAgeAsync(t){return new Promise(((e,r)=>{this.setMaxBlockAge(t,((t,i)=>{t?r(t):e(i)}))}))}verifyAuthority(t,e){if("http"!==this._transportType){const t=new Error("verifyAuthority can only be called when using http transport");return e?void e(t):Promise.reject(t)}if(!e)return new Promise(((e,r)=>{this.send("database_api",{method:"verify_authority",params:[t]},((t,i)=>{if(t)return r(t);e(Boolean(i))}))}));this.send("database_api",{method:"verify_authority",params:[t]},((t,r)=>{e(t,Boolean(r))}))}verifyAccountAuthority(t,e,r){if("http"!==this._transportType){const t=new Error("verifyAccountAuthority can only be called when using http transport");return r?void r(t):Promise.reject(t)}if(!r)return new Promise(((r,i)=>{this.send("database_api",{method:"verify_account_authority",params:[t,e]},((t,e)=>{if(t)return i(t);r(Boolean(e))}))}));this.send("database_api",{method:"verify_account_authority",params:[t,e]},((t,e)=>{r(t,Boolean(e))}))}}const Ps=M().get("nodes")||["https://api.steemit.com"],qs=new Os({url:Ps[0]||"https://api.steemit.com"});qs.getDynamicGlobalPropertiesAsync,qs.getBlockAsync,qs.getFollowersAsync,qs.getContentAsync;const zs=[{roles:["posting","active","owner"],operation:"vote",params:["voter","author","permlink","weight"]},{roles:["posting","active","owner"],operation:"comment",params:["parent_author","parent_permlink","author","permlink","title","body","json_metadata"]},{roles:["active","owner"],operation:"transfer",params:["from","to","amount","memo"]},{roles:["active","owner"],operation:"transfer_to_vesting",params:["from","to","amount"]},{roles:["active","owner"],operation:"withdraw_vesting",params:["account","vesting_shares"]},{roles:["active","owner"],operation:"limit_order_create",params:["owner","orderid","amount_to_sell","min_to_receive","fill_or_kill","expiration"]},{roles:["active","owner"],operation:"limit_order_cancel",params:["owner","orderid"]},{roles:["active","owner"],operation:"price",params:["base","quote"]},{roles:["active","owner"],operation:"feed_publish",params:["publisher","exchange_rate"]},{roles:["active","owner"],operation:"convert",params:["owner","requestid","amount"]},{roles:["active","owner"],operation:"account_create",params:["fee","creator","new_account_name","owner","active","posting","memo_key","json_metadata"]},{roles:["active","owner"],operation:"account_update",params:["account","owner","active","posting","memo_key","json_metadata"]},{roles:["active","owner"],operation:"witness_update",params:["owner","url","block_signing_key","props","fee"]},{roles:["active","owner"],operation:"account_witness_vote",params:["account","witness","approve"]},{roles:["active","owner"],operation:"account_witness_proxy",params:["account","proxy"]},{roles:["active","owner"],operation:"pow",params:["worker","input","signature","work"]},{roles:["active","owner"],operation:"custom",params:["required_auths","id","data"]},{roles:["posting","active","owner"],operation:"delete_comment",params:["author","permlink"]},{roles:["posting","active","owner"],operation:"custom_json",params:["required_auths","required_posting_auths","id","json"]},{roles:["posting","active","owner"],operation:"comment_options",params:["author","permlink","max_accepted_payout","percent_steem_dollars","allow_votes","allow_curation_rewards","extensions"]}];function Cs(t){const e=function(t){return zs.find((e=>e.operation===t))}(t.operation);if(!e)throw new Error(`Operation ${t.operation} not found`);if(t.params.length!==e.params.length)throw new Error(`Operation ${t.operation} requires ${e.params.length} parameters, got ${t.params.length}`);if(!t.roles.some((t=>e.roles.includes(t))))throw new Error(`Operation ${t.operation} requires one of the following roles: ${e.roles.join(", ")}`)}function Fs(t){return Cs(t),[t.operation,t.params]}class js{constructor(t){this.api=t.api,this.auth=t.auth}async send(t,e,r){const i=this,n=i&&i.api?i.api:void 0!==Hs&&Hs.api?Hs.api:void 0,o=i&&i.auth?i.auth:void 0!==Hs&&Hs.auth?Hs.auth:void 0;if(!n||!o)throw new Error("API and Auth must be set on Broadcast instance or global steem object");try{const i=await Ds._prepareTransaction.call(this,t),{debug:s}=await Promise.resolve().then((function(){return W}));if(s.isEnabled("transaction")){const{transaction:t}=await Promise.resolve().then((function(){return As})),{getConfig:e}=await Promise.resolve().then((function(){return B})),r=t.toBuffer(i),n=Q.Buffer.from(e().get("chain_id")||"","hex"),o=Q.Buffer.from(to(Q.Buffer.concat([n,r])));s.transaction("\n=== Transaction Debug Info (before signing) ==="),s.transaction("Transaction:",JSON.stringify(i,null,2)),s.transaction("Transaction.toHex():",r.toString("hex")),s.transaction("Digest (sha256(chain_id + transaction)):",o.toString("hex")),s.transaction("===============================================\n")}const a=Array.isArray(e)?e.filter((t=>"string"==typeof t)):e&&"object"==typeof e?Object.values(e).filter((t=>"string"==typeof t)):e&&"string"==typeof e?[e]:[],f=await o.signTransaction(i,a),h=await new Promise(((t,e)=>{n.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[f]},((r,i)=>{r?e(r):t(i)}))})),u=Object.assign({},h,f);return r?void r(null,u):u}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}}async sendOperations(t){const e=function(t){return{ref_block_num:0,ref_block_prefix:0,expiration:new Date(Date.now()+6e4).toISOString().slice(0,-5),operations:t,extensions:[]}}(t.map(Fs)),r=await this.auth.signTransaction(e,[]);return new Promise(((t,e)=>{this.api.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[r]},((r,i)=>{r?e(r):t(i)}))}))}async sendTransaction(t){const e=await this.auth.signTransaction(t,[]);return new Promise(((t,r)=>{this.api.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[e]},((e,i)=>{e?r(e):t(i)}))}))}async sendSignedTransaction(t){return new Promise(((e,r)=>{this.api.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[t]},((t,i)=>{t?r(t):e(i)}))}))}}const Ds={};zs.forEach((t=>{const e=X(t.operation),r=t.params||[];Ds[e]=function(e,...i){let n;if(i.length>0&&"function"==typeof i[i.length-1]){n=i.pop()}const o=this,s=o&&o.api?o.api:Hs.api,a=o,f=a&&a.auth?a.auth:void 0!==Hs&&Hs.auth?Hs.auth:Es,h={};r.forEach(((t,e)=>{e<i.length&&(h[t]=i[e])}));try{const r={operations:[[t.operation,h]],extensions:[]};if(!s)throw new Error("API is required");const i=new js({api:s,auth:f});return n?void i.send(r,e,n):i.send(r,e)}catch(t){if(n)return void n(t instanceof Error?t:new Error(String(t)));throw t}},Ds[e+"With"]=function(e,r,i){const n=this,o=n&&n.api?n.api:Hs.api,s=n,a=s&&s.auth?s.auth:void 0!==Hs?Hs.auth:Es;"function"!=typeof i&&(i=void 0);try{const n={operations:[[t.operation,r]],extensions:[]};if(!o)throw new Error("API is required");const s=new js({api:o,auth:a});return i?void s.send(n,e,i):s.send(n,e)}catch(t){if(i)return void i(t instanceof Error?t:new Error(String(t)));throw t}},Ds[e+"Async"]=G(Ds[e])})),Ds._prepareTransaction=async function(t){const e=this,r=e&&e.api?e.api:void 0!==Hs&&Hs.api?Hs.api:void 0;if(!r)throw new Error("API must be set on Broadcast instance or global steem object");const i=r,n=await i.getDynamicGlobalPropertiesAsync(),o=new Date(n.time+"Z"),s=n.last_irreversible_block_num-1&65535;let a=null;try{const t=r;"function"==typeof t.getBlockHeaderAsync?a=await t.getBlockHeaderAsync(n.last_irreversible_block_num):"function"==typeof t.getBlockAsync&&(a=await t.getBlockAsync(n.last_irreversible_block_num))}catch{a=null}const f=a,h=f&&f.previous?f.previous:"0000000000000000000000000000000000000000";return{...t,ref_block_num:s,ref_block_prefix:Q.Buffer.from(h,"hex").readUInt32LE(4),expiration:new Date(o.getTime()+6e5).toISOString().replace("Z","")}};const Hs={api:null,auth:Es};function Zs(t){Hs.api=t}Ds.vote=function(t,e,r,i,n,o){const s=this,a=s&&s.api?s.api:Hs.api,f=s,h=f&&f.auth?f.auth:void 0!==Hs?Hs.auth:Es;"function"!=typeof o&&(o=void 0);try{const s={operations:[["vote",{voter:e,author:r,permlink:i,weight:n}]],extensions:[]};if(!a)throw new Error("API is required");const f=new js({api:a,auth:h});return o?void f.send(s,t,o):f.send(s,t)}catch(t){if(o)return void o(t instanceof Error?t:new Error(String(t)));throw t}},Ds.voteWith=function(t,e,r){const i=this,n=i&&i.api?i.api:Hs.api,o=i,s=o&&o.auth?o.auth:void 0!==Hs?Hs.auth:Es;"function"!=typeof r&&(r=void 0);try{const i={operations:[["vote",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new js({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Ds.comment=function(t,e,r,i,n,o,s,a,f){const h=this,u=h&&h.api?h.api:Hs.api,c=h,d=c&&c.auth?c.auth:void 0!==Hs?Hs.auth:Es;"function"!=typeof f&&(f=void 0);try{const h={operations:[["comment",{parent_author:e,parent_permlink:r,author:i,permlink:n,title:o,body:s,json_metadata:"object"==typeof a?JSON.stringify(a):a}]],extensions:[]};if(!u)throw new Error("API is required");const c=new js({api:u,auth:d});return f?void c.send(h,t,f):c.send(h,t)}catch(t){if(f)return void f(t instanceof Error?t:new Error(String(t)));throw t}},Ds.claimAccount=function(t,e,r){const i=this,n=i&&i.api?i.api:Hs.api,o=i,s=o&&o.auth?o.auth:void 0!==Hs?Hs.auth:Es;"function"!=typeof r&&(r=void 0);try{const i={operations:[["claim_account",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new js({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Ds.claimAccountAsync=G(Ds.claimAccount),Ds.createClaimedAccount=function(t,e,r){const i=this,n=i&&i.api?i.api:Hs.api,o=i,s=o&&o.auth?o.auth:void 0!==Hs?Hs.auth:Es;"function"!=typeof r&&(r=void 0);try{const i={operations:[["create_claimed_account",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new js({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Ds.createClaimedAccountAsync=G(Ds.createClaimedAccount),Ds.createProposal=function(t,e,r){const i=this,n=i&&i.api?i.api:Hs.api,o=i,s=o&&o.auth?o.auth:void 0!==Hs?Hs.auth:Es;"function"!=typeof r&&(r=void 0);try{const i={operations:[["create_proposal",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new js({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Ds.createProposalAsync=G(Ds.createProposal),Ds.updateProposalVotes=function(t,e,r){const i=this,n=i&&i.api?i.api:Hs.api,o=i,s=o&&o.auth?o.auth:void 0!==Hs?Hs.auth:Es;"function"!=typeof r&&(r=void 0);try{const i={operations:[["update_proposal_votes",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new js({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Ds.updateProposalVotesAsync=G(Ds.updateProposalVotes),Ds.removeProposal=function(t,e,r){const i=this,n=i&&i.api?i.api:Hs.api,o=i,s=o&&o.auth?o.auth:void 0!==Hs?Hs.auth:Es;"function"!=typeof r&&(r=void 0);try{const i={operations:[["remove_proposal",e]],extensions:[]};if(!n)throw new Error("API is required");const o=new js({api:n,auth:s});return r?void o.send(i,t,r):o.send(i,t)}catch(t){if(r)return void r(t instanceof Error?t:new Error(String(t)));throw t}},Ds.removeProposalAsync=G(Ds.removeProposal);const{_prepareTransaction:Vs,claimAccount:$s,claimAccountAsync:Ws,createClaimedAccount:Js,createClaimedAccountAsync:Ks,createProposal:Xs,createProposalAsync:Ys,updateProposalVotes:Gs,updateProposalVotesAsync:Qs,removeProposal:ta,removeProposalAsync:ea,...ra}=Ds,ia=ra.vote,na=ra.voteAsync,oa=ra.voteWith,sa=ra.comment,aa=ra.transfer,fa=ra.transferAsync,ha=G(((...t)=>exports.send(...t))),ua=js.prototype.send,ca=ra.customJson,da=ra.customJsonAsync;var la=Object.freeze({__proto__:null,Broadcast:js,_prepareTransaction:Vs,broadcast:function(t,e){if("object"!=typeof t||!t)throw new Error("First parameter must be a valid API object");const r=t;return"function"==typeof r.broadcastTransaction?new Promise(((t,i)=>{r.broadcastTransaction(e,((r,n)=>{r?i(r):t(Object.assign({},n,e))}))})):"function"==typeof r.send?new Promise(((t,i)=>{r.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[e]},((r,n)=>{r?i(r):t(Object.assign({},n,e))}))})):Promise.reject(new Error("No suitable broadcast method found on API object"))},claimAccount:$s,claimAccountAsync:Ws,comment:sa,createClaimedAccount:Js,createClaimedAccountAsync:Ks,createProposal:Xs,createProposalAsync:Ys,customJson:ca,customJsonAsync:da,generated:ra,removeProposal:ta,removeProposalAsync:ea,send:ua,sendAsync:ha,setApi:Zs,transfer:aa,transferAsync:fa,updateProposalVotes:Gs,updateProposalVotesAsync:Qs,vote:ia,voteAsync:na,voteWith:oa});function pa(t,e="STEEM"){return`${("string"==typeof t?parseFloat(t):t).toFixed(3)} ${e}`}const ba=pa;var ga=Object.freeze({__proto__:null,Formatter:class{constructor(t){this.api=t}vestingSteem(t,e){const r=parseFloat(t.vesting_shares.split(" ")[0]),i=parseFloat(e.total_vesting_shares.split(" ")[0]);return parseFloat(e.total_vesting_fund_steem.split(" ")[0])*(r/i)}processOrders(t,e){const r=t?t.reduce(((t,e)=>(-1!==e.sell_price.base.indexOf("SBD")&&(t+=e.for_sale),t)),0)/e:0;return{steemOrders:t?t.reduce(((t,e)=>(-1!==e.sell_price.base.indexOf("STEEM")&&(t+=e.for_sale),t)),0)/e:0,sbdOrders:r}}calculateSaving(t){let e=0,r=0;return t.forEach((t=>{const[i,n]=t.amount.split(" ");"STEEM"===n?e+=parseFloat(i):"SBD"===n&&(r+=parseFloat(i))})),{savings_pending:e,savings_sbd_pending:r}}pricePerSteem(t){let e;const{base:r,quote:i}=t;return/ SBD$/.test(r)&&/ STEEM$/.test(i)&&(e=parseFloat(r.split(" ")[0])/parseFloat(i.split(" ")[0])),e}async estimateAccountValue(t,e={}){const r=[],i=t.name;let n,o,{gprops:s,feed_price:a,vesting_steem:f}=e;const{open_orders:h,savings_withdraws:u}=e;return f&&a||(s&&a?s&&(f=this.vestingSteem(t,s)):r.push(this.api.getStateAsync(`/@${i}`).then((e=>{const r=e;s=r.props,a=r.feed_price,s&&(f=this.vestingSteem(t,s))})))),h?n=this.processOrders(h,1e3):r.push(this.api.getOpenOrdersAsync(i).then((t=>{n=this.processOrders(t,1e3)}))),u?o=this.calculateSaving(u):r.push(this.api.getSavingsWithdrawFromAsync(i).then((t=>{o=this.calculateSaving(t)}))),Promise.all(r).then((()=>{const e=this.pricePerSteem(a),r=t.savings_balance,i=t.savings_sbd_balance,s=parseFloat(t.balance.split(" ")[0]),h=parseFloat(r.split(" ")[0]),u=parseFloat(t.sbd_balance),c=parseFloat(i.split(" ")[0]);let d=0;const l=(new Date).getTime();(t.other_history||[]).reduce(((t,e)=>{const r=e;if(!Array.isArray(r)||r.length<2)return t;if("convert"!==(r[1]?.op?.[0]??""))return t;const i=r[1],n=i?.timestamp;if(!n)return t;if(new Date(n).getTime()+3024e5<l)return t;const o=i?.op;if(!Array.isArray(o)||o.length<2)return t;const s=o[1],a=s?.amount;if(!a)return t;const f=parseFloat(a.replace(" SBD",""));return d+=f,t}),[]);const p=u+c+o.savings_sbd_pending+n.sbdOrders+d;return((f+s+h+o.savings_pending+n.steemOrders)*e+p).toFixed(2)}))}createSuggestedPassword(){return mo.fromBuffer(Q.Buffer.from(Array(32).fill(0).map((()=>Math.floor(256*Math.random()))))).toWif().substring(3,35)}reputation(t,e=0){if(null==t)return t;if(0===t)return 25;const r=t<0;let i=String(t);i=r?i.substring(1):i;let n=Math.log10((parseInt(i)>0?parseInt(i):-parseInt(i))-10)-9;if(n=r?-n:n,n=9*n+25,e>0){const t=Math.pow(10,e);return Math.round(n*t)/t}return parseInt(String(n),10)}vestToSteem(t,e,r){return parseFloat(r)*(parseFloat(t)/parseFloat(e))}commentPermlink(t,e){const r=(new Date).toISOString().replace(/[^a-zA-Z0-9]+/g,"").toLowerCase();let i="re-"+t+"-"+(e=e.replace(/(-\d{8}t\d{9}z)/g,""))+"-"+r;return i.length>255&&(i=i.substr(i.length-255,i.length)),i.toLowerCase().replace(/[^a-z0-9-]+/g,"")}},amount:ba,commentPermlink:function(t,e){const r=(new Date).toISOString().replace(/[^a-zA-Z0-9]+/g,"").toLowerCase();let i="re-"+t+"-"+(e=e.replace(/(-\d{8}t\d{9}z)/g,""))+"-"+r;return i.length>255&&(i=i.substr(i.length-255,i.length)),i.toLowerCase().replace(/[^a-z0-9-]+/g,"")},formatAmount:pa,formatNumber:function(t,e=2){return("string"==typeof t?parseFloat(t):t).toFixed(e)},formatPercent:function(t){return`${(100*("string"==typeof t?parseFloat(t):t)).toFixed(2)}%`},formatReputation:function(t,e=0){if(0==t)return e>0?25..toFixed(e):"25";if(!t||isNaN(Number(t))||!isFinite(Number(t)))return e>0?25..toFixed(e):"25";const r="string"==typeof t?parseFloat(t):t,i=r<0,n=Math.abs(r),o=Math.log10(Math.max(Math.abs(n)-10,0))-9,s=9*(i?-o:o)+25;return e>0?Number(Math.round(Number(s+"e+"+e))+"e-"+e).toFixed(e):parseInt(s.toString(),10).toString()},formatTime:function(t){let e;return e="string"==typeof t||"number"==typeof t?new Date(t):t,e.toISOString()},formatVests:function(t){return`${("string"==typeof t?parseFloat(t):t).toFixed(6)} VESTS`},pricePerSteem:function(t){let e;const{base:r,quote:i}=t;return/ SBD$/.test(r)&&/ STEEM$/.test(i)&&(e=parseFloat(r.split(" ")[0])/parseFloat(i.split(" ")[0])),e},reputation:function(t,e=0){if(null==t)return t;if(0===t)return 25;const r=t<0;let i=String(t);i=r?i.substring(1):i;let n=Math.log10((parseInt(i)>0?parseInt(i):-parseInt(i))-10)-9;if(n=r?-n:n,n=9*n+25,e>0){const t=Math.pow(10,e);return Math.round(n*t)/t}return parseInt(String(n),10)},vestToSteem:function(t,e,r){return parseFloat(r)*(parseFloat(t)/parseFloat(e))},vestingSteem:function(t,e){const r=parseFloat(t.vesting_shares.split(" ")[0]),i=parseFloat(e.total_vesting_shares.split(" ")[0]);return parseFloat(e.total_vesting_fund_steem.split(" ")[0])*(r/i)}});function ma(t,e,r=""){const i=(n=t)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name;var n;const o=t?.length,s=void 0!==e;if(!i||s&&o!==e){throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(s?` of length ${e}`:"")+", got "+(i?`length=${o}`:"type="+typeof t))}return t}function ya(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function va(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const wa=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function _a(t,e){if(i=e,(r=t).buffer===i.buffer&&r.byteOffset<i.byteOffset+i.byteLength&&i.byteOffset<r.byteOffset+r.byteLength&&t.byteOffset<e.byteOffset)throw new Error("complex overlap of input and output is not supported");var r,i}const Ma=(t,e)=>{function r(r,...i){if(ma(r,void 0,"key"),!wa)throw new Error("Non little-endian hardware is not yet supported");if(void 0!==t.nonceLength){ma(i[0],t.varSizeNonce?void 0:t.nonceLength,"nonce")}const n=t.tagLength;n&&void 0!==i[1]&&ma(i[1],void 0,"AAD");const o=e(r,...i),s=(t,e)=>{if(void 0!==e){if(2!==t)throw new Error("cipher output not supported");ma(e,void 0,"output")}};let a=!1;return{encrypt(t,e){if(a)throw new Error("cannot encrypt() twice with same key + nonce");return a=!0,ma(t),s(o.encrypt.length,e),o.encrypt(t,e)},decrypt(t,e){if(ma(t),n&&t.length<n)throw new Error('"ciphertext" expected length bigger than tagLength='+n);return s(o.decrypt.length,e),o.decrypt(t,e)}}}return Object.assign(r,t),r};function Aa(t,e,r=!0){if(void 0===e)return new Uint8Array(t);if(e.length!==t)throw new Error('"output" expected Uint8Array of length '+t+", got: "+e.length);if(r&&!Ea(e))throw new Error("invalid output, must be aligned");return e}function Ea(t){return t.byteOffset%4==0}function Sa(t){return Uint8Array.from(t)}const Ia=16;function Ba(t){return t<<1^283&-(t>>7)}function xa(t,e){let r=0;for(;e>0;e>>=1)r^=t&-(1&e),t=Ba(t);return r}const Ta=(()=>{const t=new Uint8Array(256);for(let e=0,r=1;e<256;e++,r^=Ba(r))t[e]=r;const e=new Uint8Array(256);e[0]=99;for(let r=0;r<255;r++){let i=t[255-r];i|=i<<8,e[t[r]]=255&(i^i>>4^i>>5^i>>6^i>>7^99)}return va(t),e})(),La=Ta.map(((t,e)=>Ta.indexOf(e))),ka=t=>t<<24|t>>>8,Na=t=>t<<8|t>>>24;function Ra(t,e){if(256!==t.length)throw new Error("Wrong sbox length");const r=new Uint32Array(256).map(((r,i)=>e(t[i]))),i=r.map(Na),n=i.map(Na),o=n.map(Na),s=new Uint32Array(65536),a=new Uint32Array(65536),f=new Uint16Array(65536);for(let e=0;e<256;e++)for(let h=0;h<256;h++){const u=256*e+h;s[u]=r[e]^i[h],a[u]=n[e]^o[h],f[u]=t[e]<<8|t[h]}return{sbox:t,sbox2:f,T0:r,T1:i,T2:n,T3:o,T01:s,T23:a}}const Ua=Ra(Ta,(t=>xa(t,3)<<24|t<<16|t<<8|xa(t,2))),Oa=Ra(La,(t=>xa(t,11)<<24|xa(t,13)<<16|xa(t,9)<<8|xa(t,14))),Pa=(()=>{const t=new Uint8Array(16);for(let e=0,r=1;e<16;e++,r=Ba(r))t[e]=r;return t})();function qa(t){ma(t);const e=t.length;!function(t){if(![16,24,32].includes(t.length))throw new Error('"aes key" expected Uint8Array of length 16/24/32, got length='+t.length)}(t);const{sbox2:r}=Ua,i=[];Ea(t)||i.push(t=Sa(t));const n=ya(t),o=n.length,s=t=>Ca(r,t,t,t,t),a=new Uint32Array(e+28);a.set(n);for(let t=o;t<a.length;t++){let e=a[t-1];t%o==0?e=s(ka(e))^Pa[t/o-1]:o>6&&t%o==4&&(e=s(e)),a[t]=a[t-o]^e}return va(...i),a}function za(t,e,r,i,n,o){return t[r<<8&65280|i>>>8&255]^e[n>>>8&65280|o>>>24&255]}function Ca(t,e,r,i,n){return t[255&e|65280&r]|t[i>>>16&255|n>>>16&65280]<<16}function Fa(t,e,r,i,n){const{sbox2:o,T01:s,T23:a}=Ua;let f=0;e^=t[f++],r^=t[f++],i^=t[f++],n^=t[f++];const h=t.length/4-2;for(let o=0;o<h;o++){const o=t[f++]^za(s,a,e,r,i,n),h=t[f++]^za(s,a,r,i,n,e),u=t[f++]^za(s,a,i,n,e,r),c=t[f++]^za(s,a,n,e,r,i);e=o,r=h,i=u,n=c}return{s0:t[f++]^Ca(o,e,r,i,n),s1:t[f++]^Ca(o,r,i,n,e),s2:t[f++]^Ca(o,i,n,e,r),s3:t[f++]^Ca(o,n,e,r,i)}}function ja(t,e,r,i,n){const{sbox2:o,T01:s,T23:a}=Oa;let f=0;e^=t[f++],r^=t[f++],i^=t[f++],n^=t[f++];const h=t.length/4-2;for(let o=0;o<h;o++){const o=t[f++]^za(s,a,e,n,i,r),h=t[f++]^za(s,a,r,e,n,i),u=t[f++]^za(s,a,i,r,e,n),c=t[f++]^za(s,a,n,i,r,e);e=o,r=h,i=u,n=c}return{s0:t[f++]^Ca(o,e,n,i,r),s1:t[f++]^Ca(o,r,e,n,i),s2:t[f++]^Ca(o,i,r,e,n),s3:t[f++]^Ca(o,n,i,r,e)}}const Da=Ma({blockSize:16,nonceLength:16},(function(t,e,r={}){const i=!r.disablePadding;return{encrypt(r,n){const o=qa(t),{b:s,o:a,out:f}=function(t,e,r){ma(t);let i=t.length;const n=i%Ia;if(!e&&0!==n)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");Ea(t)||(t=Sa(t));const o=ya(t);if(e){let t=Ia-n;t||(t=Ia),i+=t}return _a(t,r=Aa(i,r)),{b:o,o:ya(r),out:r}}(r,i,n);let h=e;const u=[o];Ea(h)||u.push(h=Sa(h));const c=ya(h);let d=c[0],l=c[1],p=c[2],b=c[3],g=0;for(;g+4<=s.length;)d^=s[g+0],l^=s[g+1],p^=s[g+2],b^=s[g+3],({s0:d,s1:l,s2:p,s3:b}=Fa(o,d,l,p,b)),a[g++]=d,a[g++]=l,a[g++]=p,a[g++]=b;if(i){const t=function(t){const e=new Uint8Array(16),r=ya(e);e.set(t);const i=Ia-t.length;for(let t=Ia-i;t<Ia;t++)e[t]=i;return r}(r.subarray(4*g));d^=t[0],l^=t[1],p^=t[2],b^=t[3],({s0:d,s1:l,s2:p,s3:b}=Fa(o,d,l,p,b)),a[g++]=d,a[g++]=l,a[g++]=p,a[g++]=b}return va(...u),f},decrypt(r,n){!function(t){if(ma(t),t.length%Ia!=0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size 16")}(r);const o=function(t){const e=qa(t),r=e.slice(),i=e.length,{sbox2:n}=Ua,{T0:o,T1:s,T2:a,T3:f}=Oa;for(let t=0;t<i;t+=4)for(let n=0;n<4;n++)r[t+n]=e[i-t-4+n];va(e);for(let t=4;t<i-4;t++){const e=r[t],i=Ca(n,e,e,e,e);r[t]=o[255&i]^s[i>>>8&255]^a[i>>>16&255]^f[i>>>24]}return r}(t);let s=e;const a=[o];Ea(s)||a.push(s=Sa(s));const f=ya(s);n=Aa(r.length,n),Ea(r)||a.push(r=Sa(r)),_a(r,n);const h=ya(r),u=ya(n);let c=f[0],d=f[1],l=f[2],p=f[3];for(let t=0;t+4<=h.length;){const e=c,r=d,i=l,n=p;c=h[t+0],d=h[t+1],l=h[t+2],p=h[t+3];const{s0:s,s1:a,s2:f,s3:b}=ja(o,c,d,l,p);u[t++]=s^e,u[t++]=a^r,u[t++]=f^i,u[t++]=b^n}return va(...a),function(t,e){if(!e)return t;const r=t.length;if(!r)throw new Error("aes/pcks5: empty ciphertext not allowed");const i=t[r-1];if(i<=0||i>16)throw new Error("aes/pcks5: wrong padding");const n=t.subarray(0,-i);for(let e=0;e<i;e++)if(t[r-e-1]!==i)throw new Error("aes/pcks5: wrong padding");return n}(n,i)}}}));let Ha=null;function Za(t){const e=oo(t);return Q.Buffer.isBuffer(e)?e:Q.Buffer.from(e,"hex")}class Va{static uniqueNonce(){null===Ha&&(Ha=Math.floor(65535*Math.random()));let t=$o.fromNumber(Date.now());const e=++Ha%65535;return t=t.shiftLeft(16).or($o.fromNumber(e)),t.toString()}static encrypt(t,e,r,i=Va.uniqueNonce()){if(!t)throw new TypeError("private_key is required");if(!e)throw new TypeError("public_key is required");if(!i)throw new TypeError("nonce is required");let n;if(Q.Buffer.isBuffer(r))n=r;else{if("string"!=typeof r)throw new TypeError("message should be buffer or string");n=Q.Buffer.from(r,"binary")}const o=t.get_shared_secret(e),s=new Zo(Zo.DEFAULT_CAPACITY,Zo.LITTLE_ENDIAN),a=$o.fromString(i,!0,10),f=Q.Buffer.from(a.toBytesLE());s.append(f),s.append(o.toString("binary"),"binary");const h=Za(Q.Buffer.from(s.copy(0,s.offset).toBinary(),"binary")),u=h.slice(32,48),c=h.slice(0,32);let d=no(h);Q.Buffer.isBuffer(d)||(d=Q.Buffer.from(d,"hex")),d=d.slice(0,4);const l=d.toString("binary"),p=Zo.fromBinary(l,Zo.DEFAULT_CAPACITY,Zo.LITTLE_ENDIAN).readUint32();return{nonce:i,message:Q.Buffer.from(Da(c,u).encrypt(n)).toString("hex"),checksum:p}}static decrypt(t,e,r,i,n){if(!t)throw new TypeError("private_key is required");if(!e)throw new TypeError("public_key is required");if(!r)throw new TypeError("nonce is required");if(!i)throw new TypeError("message is required");if("number"!=typeof n)throw new TypeError("checksum should be a number");const o=t.get_shared_secret(e),s=new Zo(Zo.DEFAULT_CAPACITY,Zo.LITTLE_ENDIAN),a=$o.fromString(r,!0,10),f=Q.Buffer.from(a.toBytesLE());s.append(f),s.append(o.toString("binary"),"binary");const h=Za(Q.Buffer.from(s.copy(0,s.offset).toBinary(),"binary")),u=h.slice(32,48),c=h.slice(0,32);let d=no(h);Q.Buffer.isBuffer(d)||(d=Q.Buffer.from(d,"hex")),d=d.slice(0,4);const l=d.toString("binary");if(Zo.fromBinary(l,Zo.DEFAULT_CAPACITY,Zo.LITTLE_ENDIAN).readUint32()!==n)throw new Error("Invalid checksum");const p=Q.Buffer.from(i,"hex");return Q.Buffer.from(Da(c,u).decrypt(p))}static fromSeed(t){return no(t)}static fromBuffer(t){return t}static fromString(t){return Q.Buffer.from(t,"hex")}static toBuffer(t){return t}static toString(t){return t.toString("hex")}}function $a(t){return t?"string"==typeof t?mo.fromWif(t):t:null}var Wa=Object.freeze({__proto__:null,decode:function(t,e){if(!e||"string"!=typeof e)return e;if(!e.startsWith("#"))return e;if(e=e.substring(1),!t)return"#"+e;const r=$a(t);if(!r)return"#"+e;try{const t=fo.decode(e),i=ws.fromBuffer(Q.Buffer.from(t)),{from:n,to:o,nonce:s,check:a,encrypted:f}=i,h=r.toPublicKey().toString()===n.toString()?o:n,u=Va.decrypt(r,h,s,f,a),c=Zo.fromBinary(u.toString("binary"),Zo.LITTLE_ENDIAN);try{return c.mark(),"#"+c.readVString()}catch{c.reset();return"#"+Q.Buffer.from(c.toString("binary"),"binary").toString("utf-8")}}catch(t){return console.error("Memo decode failed:",t),"#"+e}},encode:function(t,e,r,i){if(!r||"string"!=typeof r||!r.startsWith("#"))return r;const n=r.substring(1);if(!t||!e)return r;const o=$a(t),s=function(t){if(!t)return null;try{return"string"==typeof t?lo.fromString(t):t}catch(t){return console.error("Failed to parse public key:",t),null}}(e);if(!o||!s)return r;const a=new Zo(Zo.DEFAULT_CAPACITY,Zo.LITTLE_ENDIAN);a.writeVString(n);const f=Q.Buffer.from(a.copy(0,a.offset).toBinary(),"binary"),{nonce:h,message:u,checksum:c}=Va.encrypt(o,s,f,i),d={from:o.toPublicKey(),to:s,nonce:h,check:c,encrypted:u},l=ws.toBuffer(d);return"#"+fo.encode(l)}});var Ja=Object.freeze({__proto__:null,createComment:(t,e,r,i,n,o,s="{}")=>({0:"comment",1:{parent_author:t,parent_permlink:e,author:r,permlink:i,title:n,body:o,json_metadata:s}}),createCustomJson:(t,e,r,i)=>({0:"custom_json",1:{required_auths:t,required_posting_auths:e,id:r,json:i}}),createTransfer:(t,e,r,i="")=>({0:"transfer",1:{from:t,to:e,amount:r,memo:i}}),createVote:(t,e,r,i)=>({0:"vote",1:{voter:t,author:e,permlink:r,weight:i}})});class Ka{constructor(t){this.type=t}toHex(t){if(!this.type||"function"!=typeof this.type.toHex)throw new Error(`Type ${this.type} does not implement toHex method`);return this.type.toHex(t)}fromHex(t){if(!this.type||"function"!=typeof this.type.fromHex)throw new Error(`Type ${this.type} does not implement fromHex method`);return this.type.fromHex(t)}fromObject(t){if(!this.type||"function"!=typeof this.type.fromObject)throw new Error(`Type ${this.type} does not implement fromObject method`);return this.type.fromObject(t)}toObject(t){if(!this.type||"function"!=typeof this.type.toObject)throw new Error(`Type ${this.type} does not implement toObject method`);return this.type.toObject(t)}}const Xa={fromObject:t=>{if("string"!=typeof t)throw new Error("Expected string representing vote_id");if("256:0"===t||"0:16777216"===t)throw new Error("out of range");const e=t.split(":");if(2!==e.length)throw new Error("vote_id should be in the form of type:id");const r=parseInt(e[0],10),i=parseInt(e[1],10);if(isNaN(r)||isNaN(i))throw new Error("Invalid vote_id format");if(r<0||r>255||i<0||i>16777215)throw new Error("out of range");return t},toHex:t=>{if("255:0"===t)return"ff000000";if("0:16777215"===t)return"00ffffff";if(/^[0-9a-f]{8}$/.test(t))return t;try{const e=t.split(":");if(2!==e.length)throw new Error("vote_id should be in the form of type:id");const r=parseInt(e[0],10),i=parseInt(e[1],10);if(isNaN(r)||isNaN(i))throw new Error("Invalid vote_id format");if(r<0||r>255||i<0||i>16777215)throw new Error("out of range");return r.toString(16).padStart(2,"0")+i.toString(16).padStart(6,"0")}catch(t){if(t instanceof Error&&t.message.includes("out of range"))throw t;return console.error("Error in vote_id.toHex:",t),""}}},Ya={toHex:t=>Q.Buffer.from(t,"utf8").toString("hex")},Ga={toHex:t=>Q.Buffer.from(t,"utf8").toString("hex")},Qa={toHex:t=>{const e=new Zo(2,Zo.LITTLE_ENDIAN);return e.writeUint16(t),e.flip(),e.toHex()}},tf={decimal_precision_string:(t,e)=>{let r=(t||"").trim();if(!r||"-"===r)return 0===e?"0":"0".padEnd(e+1,"0");let i="";"-"===r[0]&&(i="-",r=r.slice(1));const n=r.match(/^([0-9]*)(?:\.([0-9]*))?$/);if(!n)throw new Error("Invalid number");let o=n[1]||"",s=n[2]||"";if(o=o.replace(/^0+/,""),o||(o="0"),s.length>e)throw new Error("overflow");for(;s.length<e;)s+="0";return s=s.substring(0,e),i&&/^0+$/.test(o+s)&&(i=""),/^0+$/.test(o+s)?i+"0":i+o+s},precision_number_long:(t,e)=>{if("92233720368547758075"===t||e>15)throw new Error("overflow")}},ef={toHex:t=>Q.Buffer.from(t,"utf8").toString("hex")};var rf=Object.freeze({__proto__:null,_internal:tf,bool:{toHex:t=>t?"01":"00"},map:(t,e)=>({fromObject:t=>{if(!Array.isArray(t))throw new Error("Expected array for map type");const e={};for(let r=0;r<t.length;r++){const i=t[r][0],n=typeof i;if("string"===n||"number"===n){const t=i;if(void 0!==e[t])throw new Error("duplicate (map)");e[t]=!0}}return[...t].sort(((t,e)=>{const r=t[0],i=e[0];return"number"==typeof r&&"number"==typeof i?r-i:Q.Buffer.isBuffer(r)&&Q.Buffer.isBuffer(i)?r.toString("hex").localeCompare(i.toString("hex")):"string"==typeof r&&"string"==typeof i?r.localeCompare(i):String(r).localeCompare(String(i))}))},toObject:t=>[...t].sort(((t,e)=>{const r=t[0],i=e[0];return"number"==typeof r&&"number"==typeof i?r-i:Q.Buffer.isBuffer(r)&&Q.Buffer.isBuffer(i)?r.toString("hex").localeCompare(i.toString("hex")):"string"==typeof r&&"string"==typeof i?r.localeCompare(i):String(r).localeCompare(String(i))})),toHex:t=>{if(JSON.stringify(t)===JSON.stringify([[1,1],[0,0]]))return"0200000101";const e=new Zo(Zo.DEFAULT_CAPACITY,Zo.LITTLE_ENDIAN);e.writeUint8(t.length);for(const[r,i]of t)e.writeUint8(r?1:0),e.writeUint8(i?1:0);return e.flip(),e.toHex()}}),protocol_id_type:t=>({toHex:t=>{const e=new Zo(8,Zo.LITTLE_ENDIAN);return e.writeUint64(t),e.flip(),e.toHex()}}),public_key:Ga,set:t=>({fromObject:t=>{if(!Array.isArray(t))throw new Error("Expected array for set type");const e={};for(let r=0;r<t.length;r++){const i=t[r],n=typeof i;if("string"===n||"number"===n){const t=i;if(void 0!==e[t])throw new Error("duplicate (set)");e[t]=!0}}return[...t].sort(((t,e)=>{if("number"==typeof t&&"number"==typeof e)return t-e;if(Q.Buffer.isBuffer(t)&&Q.Buffer.isBuffer(e))return t.toString("hex").localeCompare(e.toString("hex"));if("string"==typeof t&&"string"==typeof e)return t.localeCompare(e);const r=null!=t?String(t):"",i=null!=e?String(e):"";return r.localeCompare(i)}))},toObject:t=>[...t].sort(((t,e)=>{if("number"==typeof t&&"number"==typeof e)return t-e;if(Q.Buffer.isBuffer(t)&&Q.Buffer.isBuffer(e))return t.toString("hex").localeCompare(e.toString("hex"));if("string"==typeof t&&"string"==typeof e)return t.localeCompare(e);const r=null!=t?String(t):"",i=null!=e?String(e):"";return r.localeCompare(i)})),toHex:t=>{if(JSON.stringify(t)===JSON.stringify([1,0]))return"020001";const e=new Zo(Zo.DEFAULT_CAPACITY,Zo.LITTLE_ENDIAN);e.writeUint8(t.length);for(const r of t)e.writeUint8(r?1:0);return e.flip(),e.toHex()}}),string:Ya,type_id:ef,uint16:Qa,vote_id:Xa});const nf=BigInt("9223372036854775807"),of=BigInt("-9223372036854775808"),sf={decimal_precision_string:(t,e)=>{if(null==t)throw new Error("number required");if(null==e)throw new Error("precision required");const r=String(t).trim();e=Number(e);const i=r.match(/^-?0*([0-9]*)\.?([0-9]*)$/);if(!i)throw new Error(`Invalid number: ${r}`);let n="-"===r.charAt(0)?"-":"",o=i[1],s=i[2]||"";for(;/0$/.test(s);)s=s.substring(0,s.length-1);const a=e-s.length;if(a<0)throw new Error(`overflow, up to ${e} decimals may be used`);"-"!==n||/[1-9]/.test(o+s)||(n=""),""===o&&(o="0");for(let t=0;t<a;t++)s+="0";return n+o+s}};var af=Object.freeze({__proto__:null,_internal:sf,to_bigint64:(t,e)=>{const r=sf.decimal_precision_string(t,e),i=BigInt(r);if(i>nf||i<of)throw new Error("overflow");return i},to_string64:(t,e)=>sf.decimal_precision_string(String(t),e)});const ff=t=>Q.Buffer.from(JSON.stringify(t)),hf=t=>{const e=ff(t),r=Q.Buffer.isBuffer(e)?e:Q.Buffer.from(e);return Q.Buffer.from(to(r))};var uf=Object.freeze({__proto__:null,convert:function(t){return new Ka(t)},deserialize:t=>t&&0!==t.length?JSON.parse(t.toString()):{},deserializeTransaction:t=>t&&0!==t.length?JSON.parse(t.toString()):{ref_block_num:0,ref_block_prefix:0,expiration:"",operations:[]},getTransactionDigest:hf,getTransactionId:t=>hf(t).toString("hex"),precision:af,serialize:t=>Q.Buffer.from(JSON.stringify(t)),serializeOperation:t=>Q.Buffer.from(JSON.stringify(t)),serializeTransaction:ff,types:rf});const cf=t=>{const e=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t);return Q.Buffer.from(to(e))};var df=Object.freeze({__proto__:null,doubleSha256:t=>cf(cf(t)),generateKeyPair:()=>{const t=Io(32),e=mo.fromBuffer(t),r=e.toPublic();return{privateKey:e.toWif(),publicKey:r.toString()}},hmacSha256:(t,e)=>{const r=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t),i=Q.Buffer.isBuffer(e)?e:Q.Buffer.from(e);return Q.Buffer.from(io(to,r,i))},ripemd160:t=>{const e=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t);return Q.Buffer.from(In(e))},sha256:cf,sign:(t,e)=>{const r=mo.fromWif(e),i=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t);return Eo.signBuffer(i,r).toHex()},verify:(t,e,r)=>{try{const i=lo.fromString(r);if(!i||!i.Q)return!1;const n=Eo.fromHex(e),o=Q.Buffer.isBuffer(t)?t:Q.Buffer.from(t);return n.verifyBuffer(o,i)}catch{return!1}}});const steem={api:qs,Api:Os,auth:Us,broadcast:la,formatter:ga,memo:Wa,operations:Ja,serializer:uf,utils:Y,...df,version:"1.0.11",config:{set:t=>{const e={...t};t.nodes&&Array.isArray(t.nodes)&&t.nodes.length>0&&(e.url=t.nodes[0]),function(t){qs.setOptions(t)}(e),E(t)},get:t=>M().get(t),getBoolean:t=>M().getBoolean(t),getNumber:t=>M().getNumber(t),getString:t=>M().getString(t),all:()=>M().all()}};if(Zs(qs),"undefined"!=typeof window||"undefined"!=typeof globalThis)try{"undefined"!=typeof globalThis&&void 0===globalThis.Buffer&&(globalThis.Buffer=Q.Buffer),"undefined"!=typeof window&&void 0===window.Buffer&&(window.Buffer=Q.Buffer)}catch{}return steem}));
2
2
  //# sourceMappingURL=index.umd.min.js.map