diff --git a/README.md b/README.md index 0a287b0d8c..cf00451f3f 100644 --- a/README.md +++ b/README.md @@ -16,5 +16,22 @@ To build the site locally: dactyl_build -t en - For more details, see the [contribution guidelines](CONTRIBUTING.md). + + +If you make changes to the [Domain Verification Checker](https://xrpl.org/validator-domain-verifier.html) tool and edit the domain-verifier-checker.js file, you will need to do the following: + +1. Install [webpack](https://webpack.js.org/) and required libraries via npm: + + npm install webpack webpack-cli --save-dev + npm install ripple-binary-codec ripple-address-codec ripple-keypairs + +2. From the project root directory (this step may be different depending on how you installed webpack) + + cd assets/js + webpack-cli domain-verifier-checker.js --optimize-minimize -o domain-verifier-bundle.js + +3. Build the site: + + cd ../.. + dactyl_build -t en diff --git a/assets/js/domain-verifier-bundle.js b/assets/js/domain-verifier-bundle.js new file mode 100644 index 0000000000..39c4b94843 --- /dev/null +++ b/assets/js/domain-verifier-bundle.js @@ -0,0 +1,27 @@ +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=63)}([function(t,e,n){"use strict";var r=n(12),i=n(1);function o(t,e){Object.keys(t||{}).forEach((function(n){e(t[n],n)}))}t.exports=function(t,e){var n=e||t,s="function"==typeof t?t:null;if(null===s)for(var a in n)if(a[0].match(/[A-Z]/)){s=n[a];break}var u=n.inherits;u&&(null===s&&(s=function(){u.apply(this,arguments)}),i(s,u),r.defaults(s,u)),null===s&&(s=function(){});var f,c=s.prototype;function h(t,e,n){c[e]=n||t}if((n.getters||[]).forEach((function(t){var e="_"+t;c[t]=function(){return this[e]}})),o(n.virtuals,(function(t,e){h(t,e,(function(){throw new Error("unimplemented")}))})),o(n.methods,h),o(n,(function(t,e){r.isFunction(t)&&t!==s&&h(t,e)})),r.assign(s,n.statics),"function"==typeof s.init&&s.init(),o(n.cached,(function(t,e){var n="_"+e;h(t,e,(function(){var e=this[n];return void 0===e&&(e=this[n]=t.call(this)),e}))})),n.mixins){var d={};(f=n.mixins,Array.isArray(f)?f:[f]).reverse().forEach((function(t){r.defaults(d,t)})),r.defaults(c,d)}return s}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},function(t,e,n){"use strict";(function(e){var r=n(67); +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */function i(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i=0;f--)if(c[f]!==h[f])return!1;for(f=c.length-1;f>=0;f--)if(a=c[f],!y(t[a],e[a],n,r))return!1;return!0}(t,e,n,r))}return n?t===e:t==e}function w(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function S(t,e,n,r){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&v(i,n,"Missing expected exception"+r);var o="string"==typeof r,a=!t&&i&&!n;if((!t&&s.isError(i)&&o&&_(i,n)||a)&&v(i,n,"Got unwanted exception"+r),t&&i&&n&&!_(i,n)||!t&&i)throw i}d.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return b(g(t.actual),128)+" "+t.operator+" "+b(g(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,i=p(e),o=r.indexOf("\n"+i);if(o>=0){var s=r.indexOf("\n",o+1);r=r.substring(s+1)}this.stack=r}}},s.inherits(d.AssertionError,Error),d.fail=v,d.ok=m,d.equal=function(t,e,n){t!=e&&v(t,e,n,"==",d.equal)},d.notEqual=function(t,e,n){t==e&&v(t,e,n,"!=",d.notEqual)},d.deepEqual=function(t,e,n){y(t,e,!1)||v(t,e,n,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(t,e,n){y(t,e,!0)||v(t,e,n,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(t,e,n){y(t,e,!1)&&v(t,e,n,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function t(e,n,r){y(e,n,!0)&&v(e,n,r,"notDeepStrictEqual",t)},d.strictEqual=function(t,e,n){t!==e&&v(t,e,n,"===",d.strictEqual)},d.notStrictEqual=function(t,e,n){t===e&&v(t,e,n,"!==",d.notStrictEqual)},d.throws=function(t,e,n){S(!0,t,e,n)},d.doesNotThrow=function(t,e,n){S(!1,t,e,n)},d.ifError=function(t){if(t)throw t},d.strict=r((function t(e,n){e||v(e,!0,n,"==",t)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var M=Object.keys||function(t){var e=[];for(var n in t)a.call(t,n)&&e.push(n);return e}}).call(this,n(9))},function(t,e,n){"use strict";var r=n(2);function i(t,e){return t1&&void 0!==arguments[1]?arguments[1]:Array;if(!t||void 0===t.length)throw new Error(t+" is not a sequence");if("string"==typeof t){for(var n=t.length%2,r=new e((t.length+n)/2),i=t.length,o=r.length-1;o>=n;i-=2,o--)r[o]=a(t.slice(i-2,i));return 1===n&&(r[0]=a(t[0])),r}if(t instanceof e)return t;if(e===Uint8Array)return new e(t);for(var s=new e(t.length),u=t.length-1;u>=0;u--)s[u]=t[u];return s},bytesToHex:function(t){for(var e=Array(t.length),n=t.length-1;n>=0;n--)e[n]=s[t[n]];return e.join("")},slice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.constructor;e<0&&(e+=t.length),n<0&&(n+=t.length);for(var i=n-e,o=new r(i),s=n-1;s>=e;s--)o[s-e]=t[s];return o},compareBytes:function(t,e){r(t.length===e.length);for(var n=0;n>>8*i&255;return n}}},function(t,e,n){"use strict";var r=e,i=n(8),o=n(14),s=n(61);r.assert=o,r.toArray=s.toArray,r.zero2=s.zero2,r.toHex=s.toHex,r.encode=s.encode,r.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,r[s]=a,o.iushrn(1)}return r},r.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r=0,i=0;t.cmpn(-r)>0||e.cmpn(-i)>0;){var o,s,a,u=t.andln(3)+r&3,f=e.andln(3)+i&3;if(3===u&&(u=-1),3===f&&(f=-1),0==(1&u))o=0;else o=3!==(a=t.andln(7)+r&7)&&5!==a||2!==f?u:-u;if(n[0].push(o),0==(1&f))s=0;else s=3!==(a=e.andln(7)+i&7)&&5!==a||2!==u?f:-f;n[1].push(s),2*r===o+1&&(r=1-r),2*i===s+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return n},r.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,n){"use strict";(function(t){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var r=n(64),i=n(65),o=n(41);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return C(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(t).length;default:if(r)return C(t).length;e=(""+e).toLowerCase(),r=!0}}function b(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,n);case"utf8":case"utf-8":return x(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return T(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:m(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):m(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,n,r,i){var o,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=n;oa&&(n=a-u),o=n;o>=0;o--){for(var h=!0,d=0;di&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function A(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function x(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+h<=n)switch(h){case 1:f<128&&(c=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&f)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),f=this.slice(r,i),c=t.slice(e,n),h=0;hi)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return _(this,t,e,n);case"latin1":case"binary":return S(this,t,e,n);case"base64":return M(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function B(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function z(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,r,o){return o||z(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function U(t,e,n,r,o){return o||z(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((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),e0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||N(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||N(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||R(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);R(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);R(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function D(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(9))},function(t,e,n){var r=n(5),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function s(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},s.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){"use strict";var r=n(14),i=n(1);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function u(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}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,n[r++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(i=0;i>>0}return s},e.split32=function(t,e){for(var n=new Array(4*t.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,n){return t+e+n>>>0},e.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},e.sum32_5=function(t,e,n,r,i){return t+e+n+r+i>>>0},e.sum64=function(t,e,n,r){var i=t[e],o=r+t[e+1]>>>0,s=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,n,r){return(e+r>>>0>>0},e.sum64_lo=function(t,e,n,r){return e+r>>>0},e.sum64_4_hi=function(t,e,n,r,i,o,s,a){var u=0,f=e;return u+=(f=f+r>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,n,r,i,o,s,a){return e+r+o+a>>>0},e.sum64_5_hi=function(t,e,n,r,i,o,s,a,u,f){var c=0,h=e;return c+=(h=h+r>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,n,r,i,o,s,a,u,f){return e+r+o+a+f>>>0},e.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},e.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},e.shr64_hi=function(t,e,n){return t>>>n},e.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},function(t,e,n){(function(t){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function o(t,e,n){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=n(118).Buffer}catch(t){}function a(t,e,n){for(var r=0,i=Math.min(t.length,n),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function u(t,e,n,r){for(var i=0,o=Math.min(t.length,n),s=e;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initNumber=function(t,e,n){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"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initArray=function(t,e,n){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 i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=6)i=a(t,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==e&&(i=a(t,e,n+6),this.words[r]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,s=o%r,a=Math.min(o,o-s)+n,f=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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"],c=[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],h=[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,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;n.words[0]=a;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&s}n.words[f]=0|h,u=0|c}return 0!==u?n.words[f]=0|u:n.length--,n.strip()}o.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?f[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var d=c[t],l=h[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);n=(p=p.idivn(l)).isZero()?b+n:f[d-b.length]+b+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.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},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,f=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),f[a]=s;for(;a=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.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 n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,l=0|s[1],p=8191&l,b=l>>>13,g=0|s[2],v=8191&g,m=g>>>13,y=0|s[3],w=8191&y,_=y>>>13,S=0|s[4],M=8191&S,E=S>>>13,A=0|s[5],x=8191&A,I=A>>>13,T=0|s[6],k=8191&T,L=T>>>13,N=0|s[7],R=8191&N,O=N>>>13,B=0|s[8],z=8191&B,P=B>>>13,U=0|s[9],F=8191&U,j=U>>>13,C=0|a[0],D=8191&C,q=C>>>13,V=0|a[1],H=8191&V,W=V>>>13,Z=0|a[2],Y=8191&Z,J=Z>>>13,K=0|a[3],$=8191&K,X=K>>>13,G=0|a[4],Q=8191&G,tt=G>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ct=0|a[8],ht=8191&ct,dt=ct>>>13,lt=0|a[9],pt=8191<,bt=lt>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(f+(r=Math.imul(h,D))|0)+((8191&(i=(i=Math.imul(h,q))+Math.imul(d,D)|0))<<13)|0;f=((o=Math.imul(d,q))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,D),i=(i=Math.imul(p,q))+Math.imul(b,D)|0,o=Math.imul(b,q);var vt=(f+(r=r+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,H)|0))<<13)|0;f=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,D),i=(i=Math.imul(v,q))+Math.imul(m,D)|0,o=Math.imul(m,q),r=r+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,W)|0;var mt=(f+(r=r+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(w,D),i=(i=Math.imul(w,q))+Math.imul(_,D)|0,o=Math.imul(_,q),r=r+Math.imul(v,H)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0,r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0;var yt=(f+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,$)|0))<<13)|0;f=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,D),i=(i=Math.imul(M,q))+Math.imul(E,D)|0,o=Math.imul(E,q),r=r+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,X)|0;var wt=(f+(r=r+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(x,D),i=(i=Math.imul(x,q))+Math.imul(I,D)|0,o=Math.imul(I,q),r=r+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,r=r+Math.imul(v,$)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,X)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(f+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(d,nt)|0))<<13)|0;f=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(k,D),i=(i=Math.imul(k,q))+Math.imul(L,D)|0,o=Math.imul(L,q),r=r+Math.imul(x,H)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,W)|0,r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,J)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(b,nt)|0,o=o+Math.imul(b,rt)|0;var St=(f+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(R,D),i=(i=Math.imul(R,q))+Math.imul(O,D)|0,o=Math.imul(O,q),r=r+Math.imul(k,H)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,W)|0,r=r+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,J)|0,r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,X)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(v,nt)|0,i=(i=i+Math.imul(v,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var Mt=(f+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(z,D),i=(i=Math.imul(z,q))+Math.imul(P,D)|0,o=Math.imul(P,q),r=r+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,J)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,X)|0,r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(_,nt)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var Et=(f+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(F,D),i=(i=Math.imul(F,q))+Math.imul(j,D)|0,o=Math.imul(j,q),r=r+Math.imul(z,H)|0,i=(i=i+Math.imul(z,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,r=r+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,J)|0,r=r+Math.imul(k,$)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,X)|0,r=r+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(M,nt)|0,i=(i=i+Math.imul(M,rt)|0)+Math.imul(E,nt)|0,o=o+Math.imul(E,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,r=r+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ft)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var At=(f+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(F,H),i=(i=Math.imul(F,W))+Math.imul(j,H)|0,o=Math.imul(j,W),r=r+Math.imul(z,Y)|0,i=(i=i+Math.imul(z,J)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,J)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(I,nt)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,r=r+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var xt=(f+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(F,Y),i=(i=Math.imul(F,J))+Math.imul(j,Y)|0,o=Math.imul(j,J),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(k,nt)|0,i=(i=i+Math.imul(k,rt)|0)+Math.imul(L,nt)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,r=r+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ft)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var It=(f+(r=r+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,bt)|0)+Math.imul(m,pt)|0))<<13)|0;f=((o=o+Math.imul(m,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(F,$),i=(i=Math.imul(F,X))+Math.imul(j,$)|0,o=Math.imul(j,X),r=r+Math.imul(z,Q)|0,i=(i=i+Math.imul(z,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(O,nt)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,r=r+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,dt)|0;var Tt=(f+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(F,Q),i=(i=Math.imul(F,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul(z,nt)|0,i=(i=i+Math.imul(z,rt)|0)+Math.imul(P,nt)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,r=r+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ft)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,dt)|0;var kt=(f+(r=r+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,bt)|0)+Math.imul(E,pt)|0))<<13)|0;f=((o=o+Math.imul(E,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(F,nt),i=(i=Math.imul(F,rt))+Math.imul(j,nt)|0,o=Math.imul(j,rt),r=r+Math.imul(z,ot)|0,i=(i=i+Math.imul(z,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,r=r+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ft)|0,r=r+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,dt)|0;var Lt=(f+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,bt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(F,ot),i=(i=Math.imul(F,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),r=r+Math.imul(z,ut)|0,i=(i=i+Math.imul(z,ft)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ft)|0,r=r+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,dt)|0;var Nt=(f+(r=r+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,bt)|0)+Math.imul(L,pt)|0))<<13)|0;f=((o=o+Math.imul(L,bt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(F,ut),i=(i=Math.imul(F,ft))+Math.imul(j,ut)|0,o=Math.imul(j,ft),r=r+Math.imul(z,ht)|0,i=(i=i+Math.imul(z,dt)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,dt)|0;var Rt=(f+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(O,pt)|0))<<13)|0;f=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(F,ht),i=(i=Math.imul(F,dt))+Math.imul(j,ht)|0,o=Math.imul(j,dt);var Ot=(f+(r=r+Math.imul(z,pt)|0)|0)+((8191&(i=(i=i+Math.imul(z,bt)|0)+Math.imul(P,pt)|0))<<13)|0;f=((o=o+Math.imul(P,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Bt=(f+(r=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,bt))+Math.imul(j,pt)|0))<<13)|0;return f=((o=Math.imul(j,bt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=gt,u[1]=vt,u[2]=mt,u[3]=yt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=Et,u[9]=At,u[10]=xt,u[11]=It,u[12]=Tt,u[13]=kt,u[14]=Lt,u[15]=Nt,u[16]=Rt,u[17]=Ot,u[18]=Bt,0!==f&&(u[19]=f,n.length++),n};function p(t,e,n){return(new b).mulp(t,e,n)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),n=o.prototype._countBits(t)-1,r=0;r>=1;return r},b.prototype.permute=function(t,e,n,r,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i}return e}(t);if(0===e.length)return new o(1);for(var n=this,r=0;r=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>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},o.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>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),i=t,s=0|i.words[i.length-1];0!==(n=26-this._countBits(s))&&(i=i.ushln(n),r.iushln(n),s=0|i.words[i.length-1]);var a,u=r.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f=0;h--){var d=67108864*(0|r.words[i.length+h])+(0|r.words[i.length+h-1]);for(d=Math.min(d/s|0,67108863),r._ishlnsubmul(i,d,h);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,h),r.isZero()||(r.negative^=1);a&&(a.words[h]=d)}return a&&a.strip(),r.strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},o.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),h=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;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(n.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(a),s.isub(u)):(n.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:n.iushln(f)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(e.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,d=1;0==(n.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.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)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.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 v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._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 M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):n.strip(),n},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(m,v),m.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r>>22,i=o}i>>>=22,t.words[r-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},m.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new m;else if("p224"===t)e=new y;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.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")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new o(1)).iushrn(2);return this.pow(t,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=s;0!==l.cmp(a);){for(var b=l,g=0;0!==b.cmp(a);g++)b=b.redSqr();r(g=0;r--){for(var f=e.words[r],c=u-1;c>=0;c--){var h=f>>c&1;i!==n[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===r&&0===c)&&(i=this.mul(i,n[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},i(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(27)(t))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(3),i=r.bytesToHex,o=r.slice,s=n(37).BytesList,a={toBytesSink:function(t){t.put(this._bytes)},toHex:function(){return i(this.toBytes())},toBytes:function(){if(this._bytes)return o(this._bytes);var t=new s;return this.toBytesSink(t),t.toBytes()},toJSON:function(){return this.toHex()},toString:function(){return this.toHex()}};t.exports={ensureArrayLikeIs:function(t,e){return{withChildren:function(n){if(e instanceof t)return e;for(var r=new t,i=0;i0},gte:function(t){return this.compareTo(t)>-1},lte:function(t){return this.compareTo(t)<1}}}},function(t,e,n){(function(t){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function o(t,e,n){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=n(97).Buffer}catch(t){}function a(t,e,n){for(var i=0,o=Math.min(t.length,n),s=0,a=e;a=49&&f<=54?f-49+10:f>=17&&f<=22?f-17+10:f,s|=u}return r(!(240&s),"Invalid character in "+t),i}function u(t,e,n,i){for(var o=0,s=0,a=Math.min(t.length,n),u=e;u=49?f-49+10:f>=17?f-17+10:f,r(f>=0&&s"}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this._strip(),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initNumber=function(t,e,n){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"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initArray=function(t,e,n){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 i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=6)i=a(t,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==e&&(i=a(t,e,n+6),this.words[r]|=i<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,s=o%r,a=Math.min(o,o-s)+n,f=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for?o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c:o.prototype.inspect=c;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"],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];o.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var f=d[t],c=l[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modrn(c).toString(t);n=(p=p.idivn(c)).isZero()?b+n:h[f-b.length]+b+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.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},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;n.words[0]=a;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&s}n.words[f]=0|h,u=0|c}return 0!==u?n.words[f]=0|u:n.length--,n._strip()}o.prototype.toArrayLike=function(t,e,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=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,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(t[n--]=s>>8&255),n>=0&&(t[n--]=s>>16&255),6===o?(n>=0&&(t[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.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 n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,l=0|s[1],p=8191&l,b=l>>>13,g=0|s[2],v=8191&g,m=g>>>13,y=0|s[3],w=8191&y,_=y>>>13,S=0|s[4],M=8191&S,E=S>>>13,A=0|s[5],x=8191&A,I=A>>>13,T=0|s[6],k=8191&T,L=T>>>13,N=0|s[7],R=8191&N,O=N>>>13,B=0|s[8],z=8191&B,P=B>>>13,U=0|s[9],F=8191&U,j=U>>>13,C=0|a[0],D=8191&C,q=C>>>13,V=0|a[1],H=8191&V,W=V>>>13,Z=0|a[2],Y=8191&Z,J=Z>>>13,K=0|a[3],$=8191&K,X=K>>>13,G=0|a[4],Q=8191&G,tt=G>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ct=0|a[8],ht=8191&ct,dt=ct>>>13,lt=0|a[9],pt=8191<,bt=lt>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(f+(r=Math.imul(h,D))|0)+((8191&(i=(i=Math.imul(h,q))+Math.imul(d,D)|0))<<13)|0;f=((o=Math.imul(d,q))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,D),i=(i=Math.imul(p,q))+Math.imul(b,D)|0,o=Math.imul(b,q);var vt=(f+(r=r+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,H)|0))<<13)|0;f=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,D),i=(i=Math.imul(v,q))+Math.imul(m,D)|0,o=Math.imul(m,q),r=r+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,W)|0;var mt=(f+(r=r+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(w,D),i=(i=Math.imul(w,q))+Math.imul(_,D)|0,o=Math.imul(_,q),r=r+Math.imul(v,H)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0,r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0;var yt=(f+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,$)|0))<<13)|0;f=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,D),i=(i=Math.imul(M,q))+Math.imul(E,D)|0,o=Math.imul(E,q),r=r+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,X)|0;var wt=(f+(r=r+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(x,D),i=(i=Math.imul(x,q))+Math.imul(I,D)|0,o=Math.imul(I,q),r=r+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,r=r+Math.imul(v,$)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,X)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(f+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(d,nt)|0))<<13)|0;f=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(k,D),i=(i=Math.imul(k,q))+Math.imul(L,D)|0,o=Math.imul(L,q),r=r+Math.imul(x,H)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,W)|0,r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,J)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(b,nt)|0,o=o+Math.imul(b,rt)|0;var St=(f+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(R,D),i=(i=Math.imul(R,q))+Math.imul(O,D)|0,o=Math.imul(O,q),r=r+Math.imul(k,H)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,W)|0,r=r+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,J)|0,r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,X)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(v,nt)|0,i=(i=i+Math.imul(v,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var Mt=(f+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(z,D),i=(i=Math.imul(z,q))+Math.imul(P,D)|0,o=Math.imul(P,q),r=r+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,J)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,X)|0,r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(_,nt)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var Et=(f+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(F,D),i=(i=Math.imul(F,q))+Math.imul(j,D)|0,o=Math.imul(j,q),r=r+Math.imul(z,H)|0,i=(i=i+Math.imul(z,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,r=r+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,J)|0,r=r+Math.imul(k,$)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,X)|0,r=r+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(M,nt)|0,i=(i=i+Math.imul(M,rt)|0)+Math.imul(E,nt)|0,o=o+Math.imul(E,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,r=r+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ft)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var At=(f+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(F,H),i=(i=Math.imul(F,W))+Math.imul(j,H)|0,o=Math.imul(j,W),r=r+Math.imul(z,Y)|0,i=(i=i+Math.imul(z,J)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,J)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(I,nt)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,r=r+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var xt=(f+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(F,Y),i=(i=Math.imul(F,J))+Math.imul(j,Y)|0,o=Math.imul(j,J),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(k,nt)|0,i=(i=i+Math.imul(k,rt)|0)+Math.imul(L,nt)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,r=r+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ft)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var It=(f+(r=r+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,bt)|0)+Math.imul(m,pt)|0))<<13)|0;f=((o=o+Math.imul(m,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(F,$),i=(i=Math.imul(F,X))+Math.imul(j,$)|0,o=Math.imul(j,X),r=r+Math.imul(z,Q)|0,i=(i=i+Math.imul(z,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(O,nt)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,r=r+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,dt)|0;var Tt=(f+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(F,Q),i=(i=Math.imul(F,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul(z,nt)|0,i=(i=i+Math.imul(z,rt)|0)+Math.imul(P,nt)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,r=r+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ft)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,dt)|0;var kt=(f+(r=r+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,bt)|0)+Math.imul(E,pt)|0))<<13)|0;f=((o=o+Math.imul(E,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(F,nt),i=(i=Math.imul(F,rt))+Math.imul(j,nt)|0,o=Math.imul(j,rt),r=r+Math.imul(z,ot)|0,i=(i=i+Math.imul(z,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,r=r+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ft)|0,r=r+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,dt)|0;var Lt=(f+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,bt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(F,ot),i=(i=Math.imul(F,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),r=r+Math.imul(z,ut)|0,i=(i=i+Math.imul(z,ft)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ft)|0,r=r+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,dt)|0;var Nt=(f+(r=r+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,bt)|0)+Math.imul(L,pt)|0))<<13)|0;f=((o=o+Math.imul(L,bt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(F,ut),i=(i=Math.imul(F,ft))+Math.imul(j,ut)|0,o=Math.imul(j,ft),r=r+Math.imul(z,ht)|0,i=(i=i+Math.imul(z,dt)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,dt)|0;var Rt=(f+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(O,pt)|0))<<13)|0;f=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(F,ht),i=(i=Math.imul(F,dt))+Math.imul(j,ht)|0,o=Math.imul(j,dt);var Ot=(f+(r=r+Math.imul(z,pt)|0)|0)+((8191&(i=(i=i+Math.imul(z,bt)|0)+Math.imul(P,pt)|0))<<13)|0;f=((o=o+Math.imul(P,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Bt=(f+(r=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,bt))+Math.imul(j,pt)|0))<<13)|0;return f=((o=Math.imul(j,bt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=gt,u[1]=vt,u[2]=mt,u[3]=yt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=Et,u[9]=At,u[10]=xt,u[11]=It,u[12]=Tt,u[13]=kt,u[14]=Lt,u[15]=Nt,u[16]=Rt,u[17]=Ot,u[18]=Bt,0!==f&&(u[19]=f,n.length++),n};function g(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function v(t,e,n){return g(t,e,n)}function m(t,e){this.x=t,this.y=e}Math.imul||(b=p),o.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):n<63?p(this,t,e):n<1024?g(this,t,e):v(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),n=o.prototype._countBits(t)-1,r=0;r>=1;return r},m.prototype.permute=function(t,e,n,r,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i&1}return e}(t);if(0===e.length)return new o(1);for(var n=this,r=0;r=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>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},o.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>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),i=t,s=0|i.words[i.length-1];0!==(n=26-this._countBits(s))&&(i=i.ushln(n),r.iushln(n),s=0|i.words[i.length-1]);var a,u=r.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f=0;h--){var d=67108864*(0|r.words[i.length+h])+(0|r.words[i.length+h-1]);for(d=Math.min(d/s|0,67108863),r._ishlnsubmul(i,d,h);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,h),r.isZero()||(r.negative^=1);a&&(a.words[h]=d)}return a&&a._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},o.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var n=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/t|0,n=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),h=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;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(n.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(a),s.isub(u)):(n.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:n.iushln(f)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(e.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,d=1;0==(n.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new A(t)},o.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)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.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 w(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=o._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 x(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):n._strip(),n},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},i(_,w),_.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r>>22,i=o}i>>>=22,t.words[r-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new S;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):(f(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 n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},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 n=this.m.add(new o(1)).iushrn(2);return this.pow(t,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=s;0!==l.cmp(a);){for(var b=l,g=0;0!==b.cmp(a);g++)b=b.redSqr();r(g=0;r--){for(var f=e.words[r],c=u-1;c>=0;c--){var h=f>>c&1;i!==n[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===r&&0===c)&&(i=this.mul(i,n[s]),a=0,s=0)):a=0}u=26}return i},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},o.mont=function(t){return new x(t)},i(x,A),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(27)(t))},function(t,e,n){(function(t,r){var i; +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){var o="Expected a function",s="__lodash_placeholder__",a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",f="[object Array]",c="[object Boolean]",h="[object Date]",d="[object Error]",l="[object Function]",p="[object GeneratorFunction]",b="[object Map]",g="[object Number]",v="[object Object]",m="[object RegExp]",y="[object Set]",w="[object String]",_="[object Symbol]",S="[object WeakMap]",M="[object ArrayBuffer]",E="[object DataView]",A="[object Float32Array]",x="[object Float64Array]",I="[object Int8Array]",T="[object Int16Array]",k="[object Int32Array]",L="[object Uint8Array]",N="[object Uint16Array]",R="[object Uint32Array]",O=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,U=/[&<>"']/g,F=RegExp(P.source),j=RegExp(U.source),C=/<%-([\s\S]+?)%>/g,D=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Z=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(Z.source),J=/^\s+|\s+$/g,K=/^\s+/,$=/\s+$/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,G=/\{\n\/\* \[wrapped with (.+)\] \*/,Q=/,? & /,tt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,ot=/^0b[01]+$/i,st=/^\[object .+?Constructor\]$/,at=/^0o[0-7]+$/i,ut=/^(?:0|[1-9]\d*)$/,ft=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ct=/($^)/,ht=/['\n\r\u2028\u2029\\]/g,dt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",lt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pt="[\\ud800-\\udfff]",bt="["+lt+"]",gt="["+dt+"]",vt="\\d+",mt="[\\u2700-\\u27bf]",yt="[a-z\\xdf-\\xf6\\xf8-\\xff]",wt="[^\\ud800-\\udfff"+lt+vt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_t="\\ud83c[\\udffb-\\udfff]",St="[^\\ud800-\\udfff]",Mt="(?:\\ud83c[\\udde6-\\uddff]){2}",Et="[\\ud800-\\udbff][\\udc00-\\udfff]",At="[A-Z\\xc0-\\xd6\\xd8-\\xde]",xt="(?:"+yt+"|"+wt+")",It="(?:"+At+"|"+wt+")",Tt="(?:"+gt+"|"+_t+")"+"?",kt="[\\ufe0e\\ufe0f]?"+Tt+("(?:\\u200d(?:"+[St,Mt,Et].join("|")+")[\\ufe0e\\ufe0f]?"+Tt+")*"),Lt="(?:"+[mt,Mt,Et].join("|")+")"+kt,Nt="(?:"+[St+gt+"?",gt,Mt,Et,pt].join("|")+")",Rt=RegExp("['’]","g"),Ot=RegExp(gt,"g"),Bt=RegExp(_t+"(?="+_t+")|"+Nt+kt,"g"),zt=RegExp([At+"?"+yt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[bt,At,"$"].join("|")+")",It+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[bt,At+xt,"$"].join("|")+")",At+"?"+xt+"+(?:['’](?:d|ll|m|re|s|t|ve))?",At+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vt,Lt].join("|"),"g"),Pt=RegExp("[\\u200d\\ud800-\\udfff"+dt+"\\ufe0e\\ufe0f]"),Ut=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ft=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],jt=-1,Ct={};Ct[A]=Ct[x]=Ct[I]=Ct[T]=Ct[k]=Ct[L]=Ct["[object Uint8ClampedArray]"]=Ct[N]=Ct[R]=!0,Ct[u]=Ct[f]=Ct[M]=Ct[c]=Ct[E]=Ct[h]=Ct[d]=Ct[l]=Ct[b]=Ct[g]=Ct[v]=Ct[m]=Ct[y]=Ct[w]=Ct[S]=!1;var Dt={};Dt[u]=Dt[f]=Dt[M]=Dt[E]=Dt[c]=Dt[h]=Dt[A]=Dt[x]=Dt[I]=Dt[T]=Dt[k]=Dt[b]=Dt[g]=Dt[v]=Dt[m]=Dt[y]=Dt[w]=Dt[_]=Dt[L]=Dt["[object Uint8ClampedArray]"]=Dt[N]=Dt[R]=!0,Dt[d]=Dt[l]=Dt[S]=!1;var qt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vt=parseFloat,Ht=parseInt,Wt="object"==typeof t&&t&&t.Object===Object&&t,Zt="object"==typeof self&&self&&self.Object===Object&&self,Yt=Wt||Zt||Function("return this")(),Jt=e&&!e.nodeType&&e,Kt=Jt&&"object"==typeof r&&r&&!r.nodeType&&r,$t=Kt&&Kt.exports===Jt,Xt=$t&&Wt.process,Gt=function(){try{var t=Kt&&Kt.require&&Kt.require("util").types;return t||Xt&&Xt.binding&&Xt.binding("util")}catch(t){}}(),Qt=Gt&&Gt.isArrayBuffer,te=Gt&&Gt.isDate,ee=Gt&&Gt.isMap,ne=Gt&&Gt.isRegExp,re=Gt&&Gt.isSet,ie=Gt&&Gt.isTypedArray;function oe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function se(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function de(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function Be(t,e){for(var n=t.length;n--&&_e(e,t[n],0)>-1;);return n}function ze(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var Pe=xe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ue=xe({"&":"&","<":"<",">":">",'"':""","'":"'"});function Fe(t){return"\\"+qt[t]}function je(t){return Pt.test(t)}function Ce(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function De(t,e){return function(n){return t(e(n))}}function qe(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"});var Je=function t(e){var n,r=(e=null==e?Yt:Je.defaults(Yt.Object(),e,Je.pick(Yt,Ft))).Array,i=e.Date,dt=e.Error,lt=e.Function,pt=e.Math,bt=e.Object,gt=e.RegExp,vt=e.String,mt=e.TypeError,yt=r.prototype,wt=lt.prototype,_t=bt.prototype,St=e["__core-js_shared__"],Mt=wt.toString,Et=_t.hasOwnProperty,At=0,xt=(n=/[^.]+$/.exec(St&&St.keys&&St.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",It=_t.toString,Tt=Mt.call(bt),kt=Yt._,Lt=gt("^"+Mt.call(Et).replace(Z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nt=$t?e.Buffer:void 0,Bt=e.Symbol,Pt=e.Uint8Array,qt=Nt?Nt.allocUnsafe:void 0,Wt=De(bt.getPrototypeOf,bt),Zt=bt.create,Jt=_t.propertyIsEnumerable,Kt=yt.splice,Xt=Bt?Bt.isConcatSpreadable:void 0,Gt=Bt?Bt.iterator:void 0,me=Bt?Bt.toStringTag:void 0,xe=function(){try{var t=Qi(bt,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ke=e.clearTimeout!==Yt.clearTimeout&&e.clearTimeout,$e=i&&i.now!==Yt.Date.now&&i.now,Xe=e.setTimeout!==Yt.setTimeout&&e.setTimeout,Ge=pt.ceil,Qe=pt.floor,tn=bt.getOwnPropertySymbols,en=Nt?Nt.isBuffer:void 0,nn=e.isFinite,rn=yt.join,on=De(bt.keys,bt),sn=pt.max,an=pt.min,un=i.now,fn=e.parseInt,cn=pt.random,hn=yt.reverse,dn=Qi(e,"DataView"),ln=Qi(e,"Map"),pn=Qi(e,"Promise"),bn=Qi(e,"Set"),gn=Qi(e,"WeakMap"),vn=Qi(bt,"create"),mn=gn&&new gn,yn={},wn=Io(dn),_n=Io(ln),Sn=Io(pn),Mn=Io(bn),En=Io(gn),An=Bt?Bt.prototype:void 0,xn=An?An.valueOf:void 0,In=An?An.toString:void 0;function Tn(t){if(Hs(t)&&!Os(t)&&!(t instanceof Rn)){if(t instanceof Nn)return t;if(Et.call(t,"__wrapped__"))return To(t)}return new Nn(t)}var kn=function(){function t(){}return function(e){if(!Vs(e))return{};if(Zt)return Zt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Ln(){}function Nn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Rn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function $n(t,e,n,r,i,o){var s,a=1&e,f=2&e,d=4&e;if(n&&(s=i?n(t,r,i,o):n(t)),void 0!==s)return s;if(!Vs(t))return t;var S=Os(t);if(S){if(s=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Et.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!a)return vi(t,s)}else{var O=no(t),B=O==l||O==p;if(Us(t))return hi(t,a);if(O==v||O==u||B&&!i){if(s=f||B?{}:io(t),!a)return f?function(t,e){return mi(t,eo(t),e)}(t,function(t,e){return t&&mi(e,_a(e),t)}(s,t)):function(t,e){return mi(t,to(t),e)}(t,Zn(s,t))}else{if(!Dt[O])return i?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case M:return di(t);case c:case h:return new r(+t);case E:return function(t,e){var n=e?di(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case A:case x:case I:case T:case k:case L:case"[object Uint8ClampedArray]":case N:case R:return li(t,n);case b:return new r;case g:case w:return new r(t);case m:return function(t){var e=new t.constructor(t.source,rt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case y:return new r;case _:return i=t,xn?bt(xn.call(i)):{}}var i}(t,O,a)}}o||(o=new Un);var z=o.get(t);if(z)return z;o.set(t,s),Ks(t)?t.forEach((function(r){s.add($n(r,e,n,r,t,o))})):Ws(t)&&t.forEach((function(r,i){s.set(i,$n(r,e,n,i,t,o))}));var P=S?void 0:(d?f?Zi:Wi:f?_a:wa)(t);return ae(P||t,(function(r,i){P&&(r=t[i=r]),Vn(s,i,$n(r,e,n,i,t,o))})),s}function Xn(t,e,n){var r=n.length;if(null==t)return!r;for(t=bt(t);r--;){var i=n[r],o=e[i],s=t[i];if(void 0===s&&!(i in t)||!o(s))return!1}return!0}function Gn(t,e,n){if("function"!=typeof t)throw new mt(o);return wo((function(){t.apply(void 0,n)}),e)}function Qn(t,e,n,r){var i=-1,o=he,s=!0,a=t.length,u=[],f=e.length;if(!a)return u;n&&(e=le(e,Le(n))),r?(o=de,s=!1):e.length>=200&&(o=Re,s=!1,e=new Pn(e));t:for(;++i-1},Bn.prototype.set=function(t,e){var n=this.__data__,r=Hn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},zn.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(ln||Bn),string:new On}},zn.prototype.delete=function(t){var e=Xi(this,t).delete(t);return this.size-=e?1:0,e},zn.prototype.get=function(t){return Xi(this,t).get(t)},zn.prototype.has=function(t){return Xi(this,t).has(t)},zn.prototype.set=function(t,e){var n=Xi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Pn.prototype.add=Pn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Pn.prototype.has=function(t){return this.__data__.has(t)},Un.prototype.clear=function(){this.__data__=new Bn,this.size=0},Un.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Un.prototype.get=function(t){return this.__data__.get(t)},Un.prototype.has=function(t){return this.__data__.has(t)},Un.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Bn){var r=n.__data__;if(!ln||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new zn(r)}return n.set(t,e),this.size=n.size,this};var tr=_i(ur),er=_i(fr,!0);function nr(t,e){var n=!0;return tr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function rr(t,e,n){for(var r=-1,i=t.length;++r0&&n(a)?e>1?or(a,e-1,n,r,i):pe(i,a):r||(i[i.length]=a)}return i}var sr=Si(),ar=Si(!0);function ur(t,e){return t&&sr(t,e,wa)}function fr(t,e){return t&&ar(t,e,wa)}function cr(t,e){return ce(e,(function(e){return Cs(t[e])}))}function hr(t,e){for(var n=0,r=(e=ai(e,t)).length;null!=t&&ne}function br(t,e){return null!=t&&Et.call(t,e)}function gr(t,e){return null!=t&&e in bt(t)}function vr(t,e,n){for(var i=n?de:he,o=t[0].length,s=t.length,a=s,u=r(s),f=1/0,c=[];a--;){var h=t[a];a&&e&&(h=le(h,Le(e))),f=an(h.length,f),u[a]=!n&&(e||o>=120&&h.length>=120)?new Pn(a&&h):void 0}h=t[0];var d=-1,l=u[0];t:for(;++d=a)return u;var f=n[r];return u*("desc"==f?-1:1)}}return t.index-e.index}(t,e,n)}))}function Or(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)a!==t&&Kt.call(a,u,1),Kt.call(t,u,1);return t}function zr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;so(i)?Kt.call(t,i,1):Qr(t,i)}}return t}function Pr(t,e){return t+Qe(cn()*(e-t+1))}function Ur(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=Qe(e/2))&&(t+=t)}while(e);return n}function Fr(t,e){return _o(bo(t,e,Za),t+"")}function jr(t){return jn(ka(t))}function Cr(t,e){var n=ka(t);return Eo(n,Kn(e,0,n.length))}function Dr(t,e,n,r){if(!Vs(t))return t;for(var i=-1,o=(e=ai(e,t)).length,s=o-1,a=t;null!=a&&++io?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var s=r(o);++i>>1,s=t[o];null!==s&&!Xs(s)&&(n?s<=e:s=200){var f=e?null:Ui(t);if(f)return Ve(f);s=!1,i=Re,u=new Pn}else u=e?[]:a;t:for(;++r=r?t:Wr(t,e,n)}var ci=Ke||function(t){return Yt.clearTimeout(t)};function hi(t,e){if(e)return t.slice();var n=t.length,r=qt?qt(n):new t.constructor(n);return t.copy(r),r}function di(t){var e=new t.constructor(t.byteLength);return new Pt(e).set(new Pt(t)),e}function li(t,e){var n=e?di(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function pi(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=Xs(t),s=void 0!==e,a=null===e,u=e==e,f=Xs(e);if(!a&&!f&&!o&&t>e||o&&s&&u&&!a&&!f||r&&s&&u||!n&&u||!i)return 1;if(!r&&!o&&!f&&t1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&ao(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=bt(e);++r-1?i[o?e[s]:s]:void 0}}function Ii(t){return Hi((function(e){var n=e.length,r=n,i=Nn.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new mt(o);if(i&&!a&&"wrapper"==Ji(s))var a=new Nn([],!0)}for(r=a?r:n;++r1&&y.reverse(),h&&fa))return!1;var f=o.get(t);if(f&&o.get(e))return f==e;var c=-1,h=!0,d=2&n?new Pn:void 0;for(o.set(t,e),o.set(e,t);++c-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(X,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return ae(a,(function(n){var r="_."+n[0];e&n[1]&&!he(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(G);return e?e[1].split(Q):[]}(r),n)))}function Mo(t){var e=0,n=0;return function(){var r=un(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Eo(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Jo(t,n)}));function es(t){var e=Tn(t);return e.__chain__=!0,e}function ns(t,e){return e(t)}var rs=Hi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Jn(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Rn&&so(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:ns,args:[i],thisArg:void 0}),new Nn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));var is=yi((function(t,e,n){Et.call(t,n)?++t[n]:Yn(t,n,1)}));var os=xi(Ro),ss=xi(Oo);function as(t,e){return(Os(t)?ae:tr)(t,$i(e,3))}function us(t,e){return(Os(t)?ue:er)(t,$i(e,3))}var fs=yi((function(t,e,n){Et.call(t,n)?t[n].push(e):Yn(t,n,[e])}));var cs=Fr((function(t,e,n){var i=-1,o="function"==typeof e,s=zs(t)?r(t.length):[];return tr(t,(function(t){s[++i]=o?oe(e,t,n):mr(t,e,n)})),s})),hs=yi((function(t,e,n){Yn(t,n,e)}));function ds(t,e){return(Os(t)?le:Ir)(t,$i(e,3))}var ls=yi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var ps=Fr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&ao(t,e[0],e[1])?e=[]:n>2&&ao(e[0],e[1],e[2])&&(e=[e[0]]),Rr(t,or(e,1),[])})),bs=$e||function(){return Yt.Date.now()};function gs(t,e,n){return e=n?void 0:e,ji(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function vs(t,e){var n;if("function"!=typeof e)throw new mt(o);return t=ra(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var ms=Fr((function(t,e,n){var r=1;if(n.length){var i=qe(n,Ki(ms));r|=32}return ji(t,r,e,n,i)})),ys=Fr((function(t,e,n){var r=3;if(n.length){var i=qe(n,Ki(ys));r|=32}return ji(e,r,t,n,i)}));function ws(t,e,n){var r,i,s,a,u,f,c=0,h=!1,d=!1,l=!0;if("function"!=typeof t)throw new mt(o);function p(e){var n=r,o=i;return r=i=void 0,c=e,a=t.apply(o,n)}function b(t){return c=t,u=wo(v,e),h?p(t):a}function g(t){var n=t-f;return void 0===f||n>=e||n<0||d&&t-c>=s}function v(){var t=bs();if(g(t))return m(t);u=wo(v,function(t){var n=e-(t-f);return d?an(n,s-(t-c)):n}(t))}function m(t){return u=void 0,l&&r?p(t):(r=i=void 0,a)}function y(){var t=bs(),n=g(t);if(r=arguments,i=this,f=t,n){if(void 0===u)return b(f);if(d)return ci(u),u=wo(v,e),p(f)}return void 0===u&&(u=wo(v,e)),a}return e=oa(e)||0,Vs(n)&&(h=!!n.leading,s=(d="maxWait"in n)?sn(oa(n.maxWait)||0,e):s,l="trailing"in n?!!n.trailing:l),y.cancel=function(){void 0!==u&&ci(u),c=0,r=f=i=u=void 0},y.flush=function(){return void 0===u?a:m(bs())},y}var _s=Fr((function(t,e){return Gn(t,1,e)})),Ss=Fr((function(t,e,n){return Gn(t,oa(e)||0,n)}));function Ms(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new mt(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ms.Cache||zn),n}function Es(t){if("function"!=typeof t)throw new mt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ms.Cache=zn;var As=ui((function(t,e){var n=(e=1==e.length&&Os(e[0])?le(e[0],Le($i())):le(or(e,1),Le($i()))).length;return Fr((function(r){for(var i=-1,o=an(r.length,n);++i=e})),Rs=yr(function(){return arguments}())?yr:function(t){return Hs(t)&&Et.call(t,"callee")&&!Jt.call(t,"callee")},Os=r.isArray,Bs=Qt?Le(Qt):function(t){return Hs(t)&&lr(t)==M};function zs(t){return null!=t&&qs(t.length)&&!Cs(t)}function Ps(t){return Hs(t)&&zs(t)}var Us=en||ou,Fs=te?Le(te):function(t){return Hs(t)&&lr(t)==h};function js(t){if(!Hs(t))return!1;var e=lr(t);return e==d||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Ys(t)}function Cs(t){if(!Vs(t))return!1;var e=lr(t);return e==l||e==p||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ds(t){return"number"==typeof t&&t==ra(t)}function qs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Vs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Hs(t){return null!=t&&"object"==typeof t}var Ws=ee?Le(ee):function(t){return Hs(t)&&no(t)==b};function Zs(t){return"number"==typeof t||Hs(t)&&lr(t)==g}function Ys(t){if(!Hs(t)||lr(t)!=v)return!1;var e=Wt(t);if(null===e)return!0;var n=Et.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Mt.call(n)==Tt}var Js=ne?Le(ne):function(t){return Hs(t)&&lr(t)==m};var Ks=re?Le(re):function(t){return Hs(t)&&no(t)==y};function $s(t){return"string"==typeof t||!Os(t)&&Hs(t)&&lr(t)==w}function Xs(t){return"symbol"==typeof t||Hs(t)&&lr(t)==_}var Gs=ie?Le(ie):function(t){return Hs(t)&&qs(t.length)&&!!Ct[lr(t)]};var Qs=Bi(xr),ta=Bi((function(t,e){return t<=e}));function ea(t){if(!t)return[];if(zs(t))return $s(t)?Ze(t):vi(t);if(Gt&&t[Gt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Gt]());var e=no(t);return(e==b?Ce:e==y?Ve:ka)(t)}function na(t){return t?(t=oa(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ra(t){var e=na(t),n=e%1;return e==e?n?e-n:e:0}function ia(t){return t?Kn(ra(t),0,4294967295):0}function oa(t){if("number"==typeof t)return t;if(Xs(t))return NaN;if(Vs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Vs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(J,"");var n=ot.test(t);return n||at.test(t)?Ht(t.slice(2),n?2:8):it.test(t)?NaN:+t}function sa(t){return mi(t,_a(t))}function aa(t){return null==t?"":Xr(t)}var ua=wi((function(t,e){if(ho(e)||zs(e))mi(e,wa(e),t);else for(var n in e)Et.call(e,n)&&Vn(t,n,e[n])})),fa=wi((function(t,e){mi(e,_a(e),t)})),ca=wi((function(t,e,n,r){mi(e,_a(e),t,r)})),ha=wi((function(t,e,n,r){mi(e,wa(e),t,r)})),da=Hi(Jn);var la=Fr((function(t,e){t=bt(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&ao(e[0],e[1],i)&&(r=1);++n1),e})),mi(t,Zi(t),n),r&&(n=$n(n,7,qi));for(var i=e.length;i--;)Qr(n,e[i]);return n}));var Aa=Hi((function(t,e){return null==t?{}:function(t,e){return Or(t,e,(function(e,n){return ga(t,n)}))}(t,e)}));function xa(t,e){if(null==t)return{};var n=le(Zi(t),(function(t){return[t]}));return e=$i(e),Or(t,n,(function(t,n){return e(t,n[0])}))}var Ia=Fi(wa),Ta=Fi(_a);function ka(t){return null==t?[]:Ne(t,wa(t))}var La=Ei((function(t,e,n){return e=e.toLowerCase(),t+(n?Na(e):e)}));function Na(t){return ja(aa(t).toLowerCase())}function Ra(t){return(t=aa(t))&&t.replace(ft,Pe).replace(Ot,"")}var Oa=Ei((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ba=Ei((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),za=Mi("toLowerCase");var Pa=Ei((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Ua=Ei((function(t,e,n){return t+(n?" ":"")+ja(e)}));var Fa=Ei((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),ja=Mi("toUpperCase");function Ca(t,e,n){return t=aa(t),void 0===(e=n?void 0:e)?function(t){return Ut.test(t)}(t)?function(t){return t.match(zt)||[]}(t):function(t){return t.match(tt)||[]}(t):t.match(e)||[]}var Da=Fr((function(t,e){try{return oe(t,void 0,e)}catch(t){return js(t)?t:new dt(t)}})),qa=Hi((function(t,e){return ae(e,(function(e){e=xo(e),Yn(t,e,ms(t[e],t))})),t}));function Va(t){return function(){return t}}var Ha=Ii(),Wa=Ii(!0);function Za(t){return t}function Ya(t){return Mr("function"==typeof t?t:$n(t,1))}var Ja=Fr((function(t,e){return function(n){return mr(n,t,e)}})),Ka=Fr((function(t,e){return function(n){return mr(t,n,e)}}));function $a(t,e,n){var r=wa(e),i=cr(e,r);null!=n||Vs(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=cr(e,wa(e)));var o=!(Vs(n)&&"chain"in n&&!n.chain),s=Cs(t);return ae(i,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=vi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,pe([this.value()],arguments))})})),t}function Xa(){}var Ga=Ni(le),Qa=Ni(fe),tu=Ni(ve);function eu(t){return uo(t)?Ae(xo(t)):function(t){return function(e){return hr(e,t)}}(t)}var nu=Oi(),ru=Oi(!0);function iu(){return[]}function ou(){return!1}var su=Li((function(t,e){return t+e}),0),au=Pi("ceil"),uu=Li((function(t,e){return t/e}),1),fu=Pi("floor");var cu,hu=Li((function(t,e){return t*e}),1),du=Pi("round"),lu=Li((function(t,e){return t-e}),0);return Tn.after=function(t,e){if("function"!=typeof e)throw new mt(o);return t=ra(t),function(){if(--t<1)return e.apply(this,arguments)}},Tn.ary=gs,Tn.assign=ua,Tn.assignIn=fa,Tn.assignInWith=ca,Tn.assignWith=ha,Tn.at=da,Tn.before=vs,Tn.bind=ms,Tn.bindAll=qa,Tn.bindKey=ys,Tn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Os(t)?t:[t]},Tn.chain=es,Tn.chunk=function(t,e,n){e=(n?ao(t,e,n):void 0===e)?1:sn(ra(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,s=0,a=r(Ge(i/e));oi?0:i+n),(r=void 0===r||r>i?i:ra(r))<0&&(r+=i),r=n>r?0:ia(r);n>>0)?(t=aa(t))&&("string"==typeof e||null!=e&&!Js(e))&&!(e=Xr(e))&&je(t)?fi(Ze(t),0,n):t.split(e,n):[]},Tn.spread=function(t,e){if("function"!=typeof t)throw new mt(o);return e=null==e?0:sn(ra(e),0),Fr((function(n){var r=n[e],i=fi(n,0,e);return r&&pe(i,r),oe(t,this,i)}))},Tn.tail=function(t){var e=null==t?0:t.length;return e?Wr(t,1,e):[]},Tn.take=function(t,e,n){return t&&t.length?Wr(t,0,(e=n||void 0===e?1:ra(e))<0?0:e):[]},Tn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Wr(t,(e=r-(e=n||void 0===e?1:ra(e)))<0?0:e,r):[]},Tn.takeRightWhile=function(t,e){return t&&t.length?ei(t,$i(e,3),!1,!0):[]},Tn.takeWhile=function(t,e){return t&&t.length?ei(t,$i(e,3)):[]},Tn.tap=function(t,e){return e(t),t},Tn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new mt(o);return Vs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ws(t,e,{leading:r,maxWait:e,trailing:i})},Tn.thru=ns,Tn.toArray=ea,Tn.toPairs=Ia,Tn.toPairsIn=Ta,Tn.toPath=function(t){return Os(t)?le(t,xo):Xs(t)?[t]:vi(Ao(aa(t)))},Tn.toPlainObject=sa,Tn.transform=function(t,e,n){var r=Os(t),i=r||Us(t)||Gs(t);if(e=$i(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Vs(t)&&Cs(o)?kn(Wt(t)):{}}return(i?ae:ur)(t,(function(t,r,i){return e(n,t,r,i)})),n},Tn.unary=function(t){return gs(t,1)},Tn.union=Ho,Tn.unionBy=Wo,Tn.unionWith=Zo,Tn.uniq=function(t){return t&&t.length?Gr(t):[]},Tn.uniqBy=function(t,e){return t&&t.length?Gr(t,$i(e,2)):[]},Tn.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Gr(t,void 0,e):[]},Tn.unset=function(t,e){return null==t||Qr(t,e)},Tn.unzip=Yo,Tn.unzipWith=Jo,Tn.update=function(t,e,n){return null==t?t:ti(t,e,si(n))},Tn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:ti(t,e,si(n),r)},Tn.values=ka,Tn.valuesIn=function(t){return null==t?[]:Ne(t,_a(t))},Tn.without=Ko,Tn.words=Ca,Tn.wrap=function(t,e){return xs(si(e),t)},Tn.xor=$o,Tn.xorBy=Xo,Tn.xorWith=Go,Tn.zip=Qo,Tn.zipObject=function(t,e){return ii(t||[],e||[],Vn)},Tn.zipObjectDeep=function(t,e){return ii(t||[],e||[],Dr)},Tn.zipWith=ts,Tn.entries=Ia,Tn.entriesIn=Ta,Tn.extend=fa,Tn.extendWith=ca,$a(Tn,Tn),Tn.add=su,Tn.attempt=Da,Tn.camelCase=La,Tn.capitalize=Na,Tn.ceil=au,Tn.clamp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=oa(n))==n?n:0),void 0!==e&&(e=(e=oa(e))==e?e:0),Kn(oa(t),e,n)},Tn.clone=function(t){return $n(t,4)},Tn.cloneDeep=function(t){return $n(t,5)},Tn.cloneDeepWith=function(t,e){return $n(t,5,e="function"==typeof e?e:void 0)},Tn.cloneWith=function(t,e){return $n(t,4,e="function"==typeof e?e:void 0)},Tn.conformsTo=function(t,e){return null==e||Xn(t,e,wa(e))},Tn.deburr=Ra,Tn.defaultTo=function(t,e){return null==t||t!=t?e:t},Tn.divide=uu,Tn.endsWith=function(t,e,n){t=aa(t),e=Xr(e);var r=t.length,i=n=void 0===n?r:Kn(ra(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},Tn.eq=ks,Tn.escape=function(t){return(t=aa(t))&&j.test(t)?t.replace(U,Ue):t},Tn.escapeRegExp=function(t){return(t=aa(t))&&Y.test(t)?t.replace(Z,"\\$&"):t},Tn.every=function(t,e,n){var r=Os(t)?fe:nr;return n&&ao(t,e,n)&&(e=void 0),r(t,$i(e,3))},Tn.find=os,Tn.findIndex=Ro,Tn.findKey=function(t,e){return ye(t,$i(e,3),ur)},Tn.findLast=ss,Tn.findLastIndex=Oo,Tn.findLastKey=function(t,e){return ye(t,$i(e,3),fr)},Tn.floor=fu,Tn.forEach=as,Tn.forEachRight=us,Tn.forIn=function(t,e){return null==t?t:sr(t,$i(e,3),_a)},Tn.forInRight=function(t,e){return null==t?t:ar(t,$i(e,3),_a)},Tn.forOwn=function(t,e){return t&&ur(t,$i(e,3))},Tn.forOwnRight=function(t,e){return t&&fr(t,$i(e,3))},Tn.get=ba,Tn.gt=Ls,Tn.gte=Ns,Tn.has=function(t,e){return null!=t&&ro(t,e,br)},Tn.hasIn=ga,Tn.head=zo,Tn.identity=Za,Tn.includes=function(t,e,n,r){t=zs(t)?t:ka(t),n=n&&!r?ra(n):0;var i=t.length;return n<0&&(n=sn(i+n,0)),$s(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&_e(t,e,n)>-1},Tn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ra(n);return i<0&&(i=sn(r+i,0)),_e(t,e,i)},Tn.inRange=function(t,e,n){return e=na(e),void 0===n?(n=e,e=0):n=na(n),function(t,e,n){return t>=an(e,n)&&t=-9007199254740991&&t<=9007199254740991},Tn.isSet=Ks,Tn.isString=$s,Tn.isSymbol=Xs,Tn.isTypedArray=Gs,Tn.isUndefined=function(t){return void 0===t},Tn.isWeakMap=function(t){return Hs(t)&&no(t)==S},Tn.isWeakSet=function(t){return Hs(t)&&"[object WeakSet]"==lr(t)},Tn.join=function(t,e){return null==t?"":rn.call(t,e)},Tn.kebabCase=Oa,Tn.last=jo,Tn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=ra(n))<0?sn(r+i,0):an(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):we(t,Me,i,!0)},Tn.lowerCase=Ba,Tn.lowerFirst=za,Tn.lt=Qs,Tn.lte=ta,Tn.max=function(t){return t&&t.length?rr(t,Za,pr):void 0},Tn.maxBy=function(t,e){return t&&t.length?rr(t,$i(e,2),pr):void 0},Tn.mean=function(t){return Ee(t,Za)},Tn.meanBy=function(t,e){return Ee(t,$i(e,2))},Tn.min=function(t){return t&&t.length?rr(t,Za,xr):void 0},Tn.minBy=function(t,e){return t&&t.length?rr(t,$i(e,2),xr):void 0},Tn.stubArray=iu,Tn.stubFalse=ou,Tn.stubObject=function(){return{}},Tn.stubString=function(){return""},Tn.stubTrue=function(){return!0},Tn.multiply=hu,Tn.nth=function(t,e){return t&&t.length?Nr(t,ra(e)):void 0},Tn.noConflict=function(){return Yt._===this&&(Yt._=kt),this},Tn.noop=Xa,Tn.now=bs,Tn.pad=function(t,e,n){t=aa(t);var r=(e=ra(e))?We(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Ri(Qe(i),n)+t+Ri(Ge(i),n)},Tn.padEnd=function(t,e,n){t=aa(t);var r=(e=ra(e))?We(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var i=cn();return an(t+i*(e-t+Vt("1e-"+((i+"").length-1))),e)}return Pr(t,e)},Tn.reduce=function(t,e,n){var r=Os(t)?be:Ie,i=arguments.length<3;return r(t,$i(e,4),n,i,tr)},Tn.reduceRight=function(t,e,n){var r=Os(t)?ge:Ie,i=arguments.length<3;return r(t,$i(e,4),n,i,er)},Tn.repeat=function(t,e,n){return e=(n?ao(t,e,n):void 0===e)?1:ra(e),Ur(aa(t),e)},Tn.replace=function(){var t=arguments,e=aa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Tn.result=function(t,e,n){var r=-1,i=(e=ai(e,t)).length;for(i||(i=1,t=void 0);++r9007199254740991)return[];var n=4294967295,r=an(t,4294967295);t-=4294967295;for(var i=ke(r,e=$i(e));++n=o)return t;var a=n-We(r);if(a<1)return r;var u=s?fi(s,0,a).join(""):t.slice(0,a);if(void 0===i)return u+r;if(s&&(a+=u.length-a),Js(i)){if(t.slice(a).search(i)){var f,c=u;for(i.global||(i=gt(i.source,aa(rt.exec(i))+"g")),i.lastIndex=0;f=i.exec(c);)var h=f.index;u=u.slice(0,void 0===h?a:h)}}else if(t.indexOf(Xr(i),a)!=a){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r},Tn.unescape=function(t){return(t=aa(t))&&F.test(t)?t.replace(P,Ye):t},Tn.uniqueId=function(t){var e=++At;return aa(t)+e},Tn.upperCase=Fa,Tn.upperFirst=ja,Tn.each=as,Tn.eachRight=us,Tn.first=zo,$a(Tn,(cu={},ur(Tn,(function(t,e){Et.call(Tn.prototype,e)||(cu[e]=t)})),cu),{chain:!1}),Tn.VERSION="4.17.15",ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Tn[t].placeholder=Tn})),ae(["drop","take"],(function(t,e){Rn.prototype[t]=function(n){n=void 0===n?1:sn(ra(n),0);var r=this.__filtered__&&!e?new Rn(this):this.clone();return r.__filtered__?r.__takeCount__=an(n,r.__takeCount__):r.__views__.push({size:an(n,4294967295),type:t+(r.__dir__<0?"Right":"")}),r},Rn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ae(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Rn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:$i(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Rn.prototype[t]=function(){return this[n](1).value()[0]}})),ae(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Rn.prototype[t]=function(){return this.__filtered__?new Rn(this):this[n](1)}})),Rn.prototype.compact=function(){return this.filter(Za)},Rn.prototype.find=function(t){return this.filter(t).head()},Rn.prototype.findLast=function(t){return this.reverse().find(t)},Rn.prototype.invokeMap=Fr((function(t,e){return"function"==typeof t?new Rn(this):this.map((function(n){return mr(n,t,e)}))})),Rn.prototype.reject=function(t){return this.filter(Es($i(t)))},Rn.prototype.slice=function(t,e){t=ra(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Rn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=ra(e))<0?n.dropRight(-e):n.take(e-t)),n)},Rn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},ur(Rn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Tn[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&(Tn.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,a=e instanceof Rn,u=s[0],f=a||Os(e),c=function(t){var e=i.apply(Tn,pe([t],s));return r&&h?e[0]:e};f&&n&&"function"==typeof u&&1!=u.length&&(a=f=!1);var h=this.__chain__,d=!!this.__actions__.length,l=o&&!h,p=a&&!d;if(!o&&f){e=p?e:new Rn(this);var b=t.apply(e,s);return b.__actions__.push({func:ns,args:[c],thisArg:void 0}),new Nn(b,h)}return l&&p?t.apply(this,s):(b=this.thru(c),l?r?b.value()[0]:b.value():b)})})),ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=yt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Tn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Os(i)?i:[],t)}return this[n]((function(n){return e.apply(Os(n)?n:[],t)}))}})),ur(Rn.prototype,(function(t,e){var n=Tn[e];if(n){var r=n.name+"";Et.call(yn,r)||(yn[r]=[]),yn[r].push({name:e,func:n})}})),yn[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],Rn.prototype.clone=function(){var t=new Rn(this.__wrapped__);return t.__actions__=vi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=vi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=vi(this.__views__),t},Rn.prototype.reverse=function(){if(this.__filtered__){var t=new Rn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Rn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Os(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},Tn.prototype.plant=function(t){for(var e,n=this;n instanceof Ln;){var r=To(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},Tn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Rn){var e=t;return this.__actions__.length&&(e=new Rn(this)),(e=e.reverse()).__actions__.push({func:ns,args:[Vo],thisArg:void 0}),new Nn(e,this.__chain__)}return this.thru(Vo)},Tn.prototype.toJSON=Tn.prototype.valueOf=Tn.prototype.value=function(){return ni(this.__wrapped__,this.__actions__)},Tn.prototype.first=Tn.prototype.head,Gt&&(Tn.prototype[Gt]=function(){return this}),Tn}();Yt._=Je,void 0===(i=function(){return Je}.call(e,n,e,r))||(r.exports=i)}).call(this)}).call(this,n(9),n(27)(t))},function(t,e,n){"use strict";var r=n(23),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=h;var o=Object.create(n(20));o.inherits=n(1);var s=n(45),a=n(33);o.inherits(h,s);for(var u=i(a.prototype),f=0;f=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,n){var r=e;r.utils=n(7),r.common=n(22),r.sha=n(111),r.ripemd=n(115),r.hmac=n(116),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,f=[],c=!1,h=-1;function d(){c&&u&&(c=!1,u.length?f=u.concat(f):h=-1,f.length&&l())}function l(){if(!c){var t=a(d);c=!0;for(var e=f.length;e;){for(u=f,f=[];++h1)for(var n=1;n=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var i=0;i>>24&255,r[i++]=t>>>16&255,r[i++]=t>>>8&255,r[i++]=255&t}else for(r[i++]=255&t,r[i++]=t>>>8&255,r[i++]=t>>>16&255,r[i++]=t>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o0&&void 0!==arguments[0]?arguments[0]:0,e=c[this.constructor.width];if(t<0||!(t<=e))throw new Error(t+" not in range 0 <= $val <= "+e);this.val=t},statics:{width:0,fromParser:function(t){return new this(this.width>4?t.read(this.width):t.readUIntN(this.width))},from:function(t){return t instanceof this?t:new this(t)}},toJSON:function(){return this.val},valueOf:function(){return this.val},compareTo:function(t){var e,n,o=this.valueOf(),s=t.valueOf();return o instanceof i?s instanceof i?o.cmp(s):o.cmpn(s):s instanceof i?-t.compareTo(this):(r("number"==typeof s),(e=o)<(n=s)?-1:e===n?0:1)},toBytesSink:function(t){t.put(this.toBytes())},toBytes:function(){return f(this.val,this.constructor.width)}});t.exports={UInt:h}},function(t,e,n){"use strict";(function(e){var r=n(0),i=n(21).HashPrefix,o=n(16).Hash256,s=n(3).parseBytes,a=n(42),u=r({Sha512Half:function(){this.hash=a("sha512")},statics:{put:function(t){return(new this).put(t)}},put:function(t){return this.hash.update(s(t,e)),this},finish256:function(){return this.hash.digest().slice(0,32)},finish:function(){return new o(this.finish256())}});function f(){for(var t=new u,e=arguments.length,n=Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function f(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var n=t._getDoubles(),r=o(e,1,this._bitLength),i=(1<=u;e--)f=(f<<1)+r[e];s.push(f)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(u=0;u=0;f--){for(e=0;f>=0&&0===s[f];f--)e++;if(f>=0&&e++,u=u.dblp(e),f<0)break;var c=s[f];a(0!==c),u="affine"===t.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,n,r,i){for(var a=this._wnafT1,u=this._wnafT2,f=this._wnafT3,c=0,h=0;h=1;h-=2){var l=h-1,p=h;if(1===a[l]&&1===a[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],v=s(n[l],n[p]);c=Math.max(v[0].length,c),f[l]=new Array(c),f[p]=new Array(c);for(var m=0;m=0;h--){for(var M=0;h>=0;){var E=!0;for(m=0;m=0&&M++,_=_.dblp(M),h<0)break;for(m=0;m0?A=u[m][x-1>>1]:x<0&&(A=u[m][-x-1>>1].neg()),_="affine"===A.type?_.mixedAdd(A):_.add(A))}}for(h=0;h=Math.ceil((t.bitLength()+1)/e.step)},f.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i>8&255,n>>16&255,n>>24&255,0,0,0,0])]);return r.codec.encodeChecked(a)}function a(e){const n=r.codec.decodeChecked(e),s=function(t){const e=t.slice(0,2);if(o.MAIN.equals(e))return!1;if(o.TEST.equals(e))return!0;throw new Error("Invalid X-address: bad prefix")}(n);return{accountId:n.slice(2,22),tag:function(e){const n=e[22];if(n>=2)throw new Error("Unsupported X-address");if(1===n)return e[23]+256*e[24]+65536*e[25]+16777216*e[26];return i.strictEqual(n,0,"flag must be zero to indicate no tag"),i.ok(t.from("0000000000000000","hex").equals(e.slice(23,31)),"remaining bytes must be zero"),!1}(n),test:s}}e.classicAddressToXAddress=function(t,e,n){return s(r.decodeAccountID(t),e,n)},e.encodeXAddress=s,e.xAddressToClassicAddress=function(t){const{accountId:e,tag:n,test:i}=a(t);return{classicAddress:r.encodeAccountID(e),tag:n,test:i}},e.decodeXAddress=a,e.isValidXAddress=function(t){try{a(t)}catch(t){return!1}return!0}}).call(this,n(5).Buffer)},function(t,e,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function f(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?a.defaultMaxListeners:t._maxListeners}function h(t,e,n,r){var i,o,s,a;if(f(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),s=o[e]),void 0===s)s=o[e]=n,++t._eventsCount;else if("function"==typeof s?s=o[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function d(){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 l(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var f=u.length,c=g(u,f);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):b.call(t,e)},a.prototype.listenerCount=b,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){(e=t.exports=n(45)).Stream=e,e.Readable=e,e.Writable=n(33),e.Duplex=n(13),e.Transform=n(48),e.PassThrough=n(84)},function(t,e,n){var r=n(5),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function s(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=s),o(i,s),s.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},s.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){"use strict";(function(e,r,i){var o=n(23);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=m;var a,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:o.nextTick;m.WritableState=v;var f=Object.create(n(20));f.inherits=n(1);var c={deprecate:n(82)},h=n(46),d=n(32).Buffer,l=i.Uint8Array||function(){};var p,b=n(47);function g(){}function v(t,e){a=a||n(13),t=t||{};var r=e instanceof a;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,f=t.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(f||0===f)?f:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?(o.nextTick(i,r),o.nextTick(E,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(i(r),t._writableState.errorEmitted=!0,t.emit("error",r),E(t,e))}(t,n,r,e,i);else{var s=S(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||_(t,n),r?u(w,t,n,s,i):w(t,n,s,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function m(t){if(a=a||n(13),!(p.call(m,this)||this instanceof a))return new m(t);this._writableState=new v(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),h.call(this)}function y(t,e,n,r,i,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),E(t,e)}function _(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var a=0,u=!0;n;)i[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;i.allBuffers=u,y(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;n;){var f=n.chunk,c=n.encoding,h=n.callback;if(y(t,e,!1,e.objectMode?1:f.length,f,c,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function S(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final((function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),E(t,e)}))}function E(t,e){var n=S(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(M,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}f.inherits(m,h),v.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(v.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===m&&(t&&t._writableState instanceof v)}})):p=function(t){return t instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(t,e,n){var r,i=this._writableState,s=!1,a=!i.objectMode&&(r=t,d.isBuffer(r)||r instanceof l);return a&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof n&&(n=g),i.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),o.nextTick(e,n)}(this,n):(a||function(t,e,n,r){var i=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(r,s),i=!1),i}(this,i,t,n))&&(i.pendingcb++,s=function(t,e,n,r,i,o){if(!n){var s=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=d.from(e,n));return e}(e,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,E(t,e),n&&(e.finished?o.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),m.prototype.destroy=b.destroy,m.prototype._undestroy=b.undestroy,m.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,n(19),n(80).setImmediate,n(9))},function(t,e,n){"use strict";var r=n(83).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=c,this.end=h,e=3;break;default:return this.write=d,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function c(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return i>0&&(t.lastNeed=i-1),i;if(--r=0)return i>0&&(t.lastNeed=i-2),i;if(--r=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";var r=n(0)({inherits:n(36).Hash,statics:{width:20}});t.exports={Hash160:r}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(10),s=o.Comparable,a=o.SerializedType,u=n(3),f=u.compareBytes,c=u.parseBytes,h=i({Hash:function(t){var e=this.constructor.width;this._bytes=t?c(t,Uint8Array):new Uint8Array(e),r.equal(this._bytes.length,e)},mixins:[s,a],statics:{width:NaN,from:function(t){return t instanceof this?t:new this(c(t))},fromParser:function(t,e){return new this(t.read(e||this.width))}},compareTo:function(t){return f(this._bytes,this.constructor.from(t)._bytes)},toString:function(){return this.toHex()},nibblet:function(t){var e=t>0?t/2|0:0,n=this._bytes[e];return t%2==0?n=(240&n)>>>4:n&=15,n}});t.exports={Hash:h}},function(t,e,n){"use strict";var r=n(2),i=n(3),o=i.parseBytes,s=i.bytesToHex,a=n(0),u=n(15),f=u.Type,c=u.Field,h=a({implementing:{put:function(){}},BytesList:function(){this.arrays=[],this.length=0},put:function(t){var e=o(t,Uint8Array);return this.length+=e.length,this.arrays.push(e),this},toBytesSink:function(t){this.arrays.forEach((function(e){t.put(e)}))},toBytes:function(){var t=new Uint8Array(this.length),e=0;return this.arrays.forEach((function(n){t.set(n,e),e+=n.length})),t},toHex:function(){return s(this.toBytes())}}),d=a({BinarySerializer:function(t){this.sink=t},write:function(t){t.toBytesSink(this.sink)},put:function(t){this.sink.put(t)},writeType:function(t,e){this.write(t.from(e))},writeBytesList:function(t){t.toBytesSink(this.sink)},encodeVL:function(t){var e=t,n=new Uint8Array(4);if(e<=192)return n[0]=e,n.subarray(0,1);if(e<=12480)return e-=193,n[0]=193+(e>>>8),n[1]=255&e,n.subarray(0,2);if(e<=918744)return e-=12481,n[0]=241+(e>>>16),n[1]=e>>8&255,n[2]=255&e,n.subarray(0,3);throw new Error("Overflow error")},writeFieldAndValue:function(t,e){var n=this.sink,i=t.associatedType.from(e);r(i.toBytesSink,t),n.put(t.bytes),t.isVLEncoded?this.writeLengthEncoded(i):(i.toBytesSink(n),t.type===f.STObject?n.put(c.ObjectEndMarker.bytes):t.type===f.STArray&&n.put(c.ArrayEndMarker.bytes))},writeLengthEncoded:function(t){var e=new h;t.toBytesSink(e),this.put(this.encodeVL(e.length)),this.writeBytesList(e)}});t.exports={BytesList:h,BinarySerializer:d}},function(t,e,n){"use strict";var r=n(12),i=n(0),o=n(3).slice,s=n(35).Hash160,a=/^[A-Z0-9]{3}$/,u=/^[A-F0-9]{40}$/;function f(t){return r.isString(t)&&(function(t){return 3===t.length}(t)||function(t){return u.test(t)}(t))}function c(t){if(function(t){return f(t)||function(t){return 20===t.length}(t)}(t))return 3===t.length?function(t){var e=new Uint8Array(20);if("XRP"!==t){var n=t.split("").map((function(t){return t.charCodeAt(0)}));e.set(n,12)}return e}(t):t;throw new Error("Unsupported Currency repr: "+t)}var h=s.prototype,d=i({inherits:s,getters:["isNative","iso"],statics:{init:function(){this.XRP=new this(new Uint8Array(20))},from:function(t){return t instanceof this?t:new this(c(t))}},Currency:function(t){s.call(this,t),this.classify()},classify:function(){for(var t=!0,e=this._bytes,n=o(this._bytes,12,15,Array),i=n.map((function(t){return String.fromCharCode(t)})).join(""),s=e.length-1;s>=0;s--)if(0!==e[s]&&12!==s&&13!==s&&14!==s){t=!1;break}var u=t&&"XRP"!==i&&a.test(i);this._isNative=t&&r.isEqual(n,[0,0,0]),this._iso=this._isNative?"XRP":u?i:null},toJSON:function(){return this.iso()?this.iso():h.toJSON.call(this)}});t.exports={Currency:d}},function(t,e,n){var r;function i(t){this.rand=t}if(t.exports=function(t){return r||(r=new i(null)),r.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),n=0;n=this._blockSize;){for(var o=this._blockOffset;o0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,n){t.exports=i;var r=n(30).EventEmitter;function i(){r.call(this)}n(1)(i,r),i.Readable=n(31),i.Writable=n(85),i.Duplex=n(86),i.Transform=n(87),i.PassThrough=n(88),i.Stream=i,i.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(n.on("end",a),n.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(c(),0===r.listenerCount(this,"error"))throw t}function c(){n.removeListener("data",i),t.removeListener("drain",o),n.removeListener("end",a),n.removeListener("close",u),n.removeListener("error",f),t.removeListener("error",f),n.removeListener("end",c),n.removeListener("close",c),t.removeListener("close",c)}return n.on("error",f),t.on("error",f),n.on("end",c),n.on("close",c),t.on("close",c),t.emit("pipe",n),t}},function(t,e,n){"use strict";(function(e,r){var i=n(23);t.exports=y;var o,s=n(41);y.ReadableState=m;n(30).EventEmitter;var a=function(t,e){return t.listeners(e).length},u=n(46),f=n(32).Buffer,c=e.Uint8Array||function(){};var h=Object.create(n(20));h.inherits=n(1);var d=n(77),l=void 0;l=d&&d.debuglog?d.debuglog("stream"):function(){};var p,b=n(78),g=n(47);h.inherits(y,u);var v=["error","close","destroy","pause","resume"];function m(t,e){t=t||{};var r=e instanceof(o=o||n(13));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=n(34).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function y(t){if(o=o||n(13),!(this instanceof y))return new y(t);this._readableState=new m(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function w(t,e,n,r,i){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,M(t)}(t,s)):(i||(o=function(t,e){var n;r=e,f.isBuffer(r)||r instanceof c||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===f.prototype||(e=function(t){return f.from(t)}(e)),r?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?_(t,s,e,!1):A(t,s)):_(t,s,e,!1))):r||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function M(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(E,t):E(t))}function E(t){l("emit readable"),t.emit("readable"),k(t)}function A(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(x,t,e))}function x(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=f.allocUnsafe(t),r=e.head,i=1;r.data.copy(n),t-=r.data.length;for(;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0===(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e);return r}(t,e.buffer,e.decoder),n);var n}function N(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(R,e,t))}function R(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function O(t,e){for(var n=0,r=t.length;n=e.highWaterMark||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?N(this):M(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&N(this),null;var r,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t0?L(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&N(this)),null!==r&&this.emit("data",r),r},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:y;function f(e,r){l("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,l("cleanup"),t.removeListener("close",v),t.removeListener("finish",m),t.removeListener("drain",h),t.removeListener("error",g),t.removeListener("unpipe",f),n.removeListener("end",c),n.removeListener("end",y),n.removeListener("data",b),d=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function c(){l("onend"),t.end()}o.endEmitted?i.nextTick(u):n.once("end",u),t.on("unpipe",f);var h=function(t){return function(){var e=t._readableState;l("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,k(t))}}(n);t.on("drain",h);var d=!1;var p=!1;function b(e){l("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==O(o.pipes,t))&&!d&&(l("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function g(e){l("onerror",e),y(),t.removeListener("error",g),0===a(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",m),y()}function m(){l("onfinish"),t.removeListener("close",v),y()}function y(){l("unpipe"),n.unpipe(t)}return n.on("data",b),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",g),t.once("close",v),t.once("finish",m),t.emit("pipe",n),o.flowing||(l("pipe resume"),n.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function d(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function l(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}r(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,p=0|this._f,b=0|this._g,g=0|this._h,v=0;v<16;++v)n[v]=t.readInt32BE(4*v);for(;v<64;++v)n[v]=0|(((e=n[v-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+n[v-7]+l(n[v-15])+n[v-16];for(var m=0;m<64;++m){var y=g+d(u)+f(u,p,b)+s[m]+n[m]|0,w=h(r)+c(r,i,o)|0;g=b,b=p,p=u,u=a+y|0,a=o,o=i,i=r,r=y+w|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},function(t,e,n){var r=n(1),i=n(17),o=n(6).Buffer,s=[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],a=new Array(160);function u(){this.init(),this._w=a,i.call(this,128,112)}function f(t,e,n){return n^t&(e^n)}function c(t,e,n){return t&e|n&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function v(t,e){return t>>>0>>0?1:0}r(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,m=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,M=0|this._dl,E=0|this._el,A=0|this._fl,x=0|this._gl,I=0|this._hl,T=0;T<32;T+=2)e[T]=t.readInt32BE(4*T),e[T+1]=t.readInt32BE(4*T+4);for(;T<160;T+=2){var k=e[T-30],L=e[T-30+1],N=l(k,L),R=p(L,k),O=b(k=e[T-4],L=e[T-4+1]),B=g(L,k),z=e[T-14],P=e[T-14+1],U=e[T-32],F=e[T-32+1],j=R+P|0,C=N+z+v(j,R)|0;C=(C=C+O+v(j=j+B|0,B)|0)+U+v(j=j+F|0,F)|0,e[T]=C,e[T+1]=j}for(var D=0;D<160;D+=2){C=e[D],j=e[D+1];var q=c(n,r,i),V=c(w,_,S),H=h(n,w),W=h(w,n),Z=d(a,E),Y=d(E,a),J=s[D],K=s[D+1],$=f(a,u,m),X=f(E,A,x),G=I+Y|0,Q=y+Z+v(G,I)|0;Q=(Q=(Q=Q+$+v(G=G+X|0,X)|0)+J+v(G=G+K|0,K)|0)+C+v(G=G+j|0,j)|0;var tt=W+V|0,et=H+q+v(tt,W)|0;y=m,I=x,m=u,x=A,u=a,A=E,a=o+Q+v(E=M+G|0,M)|0,o=i,M=S,i=r,S=_,r=n,_=w,n=Q+et+v(w=G+tt|0,G)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+M|0,this._el=this._el+E|0,this._fl=this._fl+A|0,this._gl=this._gl+x|0,this._hl=this._hl+I|0,this._ah=this._ah+n+v(this._al,w)|0,this._bh=this._bh+r+v(this._bl,_)|0,this._ch=this._ch+i+v(this._cl,S)|0,this._dh=this._dh+o+v(this._dl,M)|0,this._eh=this._eh+a+v(this._el,E)|0,this._fh=this._fh+u+v(this._fl,A)|0,this._gh=this._gh+m+v(this._gl,x)|0,this._hh=this._hh+y+v(this._hl,I)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},function(t,e,n){var r;!function(i){"use strict";var o,s,a,u="0123456789abcdef",f="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",c="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",h={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},d=!0,l="[DecimalError] Invalid argument: ",p=Math.floor,b=Math.pow,g=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,v=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,m=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,y=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,w=f.length-1,_=c.length-1,S={name:"[object Decimal]"};function M(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;en)throw Error(l+t)}function A(t,e,n,r){var i,o,s,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),o=b(10,7-e),a=t[i]%o|0,null==r?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),s=n<4&&99999==a||n>3&&49999==a||5e4==a||0==a):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(t[i+1]/o/100|0)==b(10,e-2)-1||(a==o/2||0==a)&&0==(t[i+1]/o/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),s=(r||n<4)&&9999==a||!r&&n>3&&4999==a):s=((r||n<4)&&a+1==o||!r&&n>3&&a+1==o/2)&&(t[i+1]/o/1e3|0)==b(10,e-3)-1,s}function x(t,e,n){for(var r,i,o=[0],s=0,a=t.length;sn-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}S.absoluteValue=S.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),T(t)},S.ceil=function(){return T(new this.constructor(this),this.e+1,2)},S.comparedTo=S.cmp=function(t){var e,n,r,i,o=this,s=o.d,a=(t=new o.constructor(t)).d,u=o.s,f=t.s;if(!s||!a)return u&&f?u!==f?u:s===a?0:!s^u<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?u:a[0]?-f:0;if(u!==f)return u;if(o.e!==t.e)return o.e>t.e^u<0?1:-1;for(e=0,n=(r=s.length)<(i=a.length)?r:i;ea[e]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},S.cosine=S.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r,i=e.d.length;i<32?(n=Math.ceil(i/3),r=(1/H(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10");t.precision+=n,e=V(t,1,e.times(r),new t(1));for(var o=n;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=n,e}(r,W(r,n)),r.precision=t,r.rounding=e,T(2==a||3==a?n.neg():n,t,e,!0)):new r(1):new r(NaN)},S.cubeRoot=S.cbrt=function(){var t,e,n,r,i,o,s,a,u,f,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(d=!1,(o=c.s*b(c.s*c,1/3))&&Math.abs(o)!=1/0?r=new h(o.toString()):(n=M(c.d),(o=((t=c.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=b(n,1/3),t=p((t+1)/3)-(t%3==(t<0?-1:2)),(r=new h(n=o==1/0?"5e"+t:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+t)).s=c.s),s=(t=h.precision)+3;;)if(f=(u=(a=r).times(a).times(a)).plus(c),r=I(f.plus(c).times(a),f.plus(u),s+2,1),M(a.d).slice(0,s)===(n=M(r.d)).slice(0,s)){if("9999"!=(n=n.slice(s-3,s+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(T(r,t+1,1),e=!r.times(r).times(r).eq(c));break}if(!i&&(T(a,t+1,0),a.times(a).times(a).eq(c))){r=a;break}s+=4,i=1}return d=!0,T(r,t,h.rounding,e)},S.decimalPlaces=S.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=7*((t=e.length-1)-p(this.e/7)),t=e[t])for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n},S.dividedBy=S.div=function(t){return I(this,new this.constructor(t))},S.dividedToIntegerBy=S.divToInt=function(t){var e=this.constructor;return T(I(this,new e(t),0,1,1),e.precision,e.rounding)},S.equals=S.eq=function(t){return 0===this.cmp(t)},S.floor=function(){return T(new this.constructor(this),this.e+1,3)},S.greaterThan=S.gt=function(t){return this.cmp(t)>0},S.greaterThanOrEqualTo=S.gte=function(t){var e=this.cmp(t);return 1==e||0===e},S.hyperbolicCosine=S.cosh=function(){var t,e,n,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?e=(1/H(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=V(s,1,o.times(e),new s(1),!0);for(var u,f=t,c=new s(8);f--;)u=o.times(o),o=a.minus(u.times(c.minus(u.times(c))));return T(o,s.precision=n,s.rounding=r,!0)},S.hyperbolicSine=S.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=V(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=V(o,2,i=i.times(1/H(5,t)),i,!0);for(var s,a=new o(5),u=new o(16),f=new o(20);t--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(f))))}return o.precision=e,o.rounding=n,T(i,e,n,!0)},S.hyperbolicTangent=S.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,I(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},S.inverseCosine=S.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?e.isNeg()?R(n,i,o):new n(0):new n(NaN):e.isZero()?R(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=R(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},S.inverseHyperbolicCosine=S.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,d=!1,n=n.times(n).minus(1).sqrt().plus(n),d=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},S.inverseHyperbolicSine=S.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,d=!1,n=n.times(n).plus(1).sqrt().plus(n),d=!0,r.precision=t,r.rounding=e,n.ln())},S.inverseHyperbolicTangent=S.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?T(new o(i),t,e,!0):(o.precision=n=r-i.e,i=I(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},S.inverseSine=S.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==e?0===e?((t=R(o,n+4,r).times(.5)).s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},S.inverseTangent=S.atan=function(){var t,e,n,r,i,o,s,a,u,f=this,c=f.constructor,h=c.precision,l=c.rounding;if(f.isFinite()){if(f.isZero())return new c(f);if(f.abs().eq(1)&&h+4<=_)return(s=R(c,h+4,l).times(.25)).s=f.s,s}else{if(!f.s)return new c(NaN);if(h+4<=_)return(s=R(c,h+4,l).times(.5)).s=f.s,s}for(c.precision=a=h+10,c.rounding=1,t=n=Math.min(28,a/7+2|0);t;--t)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(d=!1,e=Math.ceil(a/7),r=1,u=f.times(f),s=new c(f),i=f;-1!==t;)if(i=i.times(u),o=s.minus(i.div(r+=2)),i=i.times(u),void 0!==(s=o.plus(i.div(r+=2))).d[e])for(t=e;s.d[t]===o.d[t]&&t--;);return n&&(s=s.times(2<this.d.length-2},S.isNaN=function(){return!this.s},S.isNegative=S.isNeg=function(){return this.s<0},S.isPositive=S.isPos=function(){return this.s>0},S.isZero=function(){return!!this.d&&0===this.d[0]},S.lessThan=S.lt=function(t){return this.cmp(t)<0},S.lessThanOrEqualTo=S.lte=function(t){return this.cmp(t)<1},S.logarithm=S.log=function(t){var e,n,r,i,o,s,a,u,f=this.constructor,c=f.precision,h=f.rounding;if(null==t)t=new f(10),e=!0;else{if(n=(t=new f(t)).d,t.s<0||!n||!n[0]||t.eq(1))return new f(NaN);e=t.eq(10)}if(n=this.d,this.s<0||!n||!n[0]||this.eq(1))return new f(n&&!n[0]?-1/0:1!=this.s?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(d=!1,s=j(this,a=c+5),r=e?N(f,a+10):j(t,a),A((u=I(s,r,a,1)).d,i=c,h))do{if(s=j(this,a+=10),r=e?N(f,a+10):j(t,a),u=I(s,r,a,1),!o){+M(u.d).slice(i+1,i+15)+1==1e14&&(u=T(u,c+1,0));break}}while(A(u.d,i+=10,h));return d=!0,T(u,c,h)},S.minus=S.sub=function(t){var e,n,r,i,o,s,a,u,f,c,h,l,b=this,g=b.constructor;if(t=new g(t),!b.d||!t.d)return b.s&&t.s?b.d?t.s=-t.s:t=new g(t.d||b.s!==t.s?b:NaN):t=new g(NaN),t;if(b.s!=t.s)return t.s=-t.s,b.plus(t);if(f=b.d,l=t.d,a=g.precision,u=g.rounding,!f[0]||!l[0]){if(l[0])t.s=-t.s;else{if(!f[0])return new g(3===u?-0:0);t=new g(b)}return d?T(t,a,u):t}if(n=p(t.e/7),c=p(b.e/7),f=f.slice(),o=c-n){for((h=o<0)?(e=f,o=-o,s=l.length):(e=l,n=c,s=f.length),o>(r=Math.max(Math.ceil(a/7),s)+2)&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for((h=(r=f.length)<(s=l.length))&&(s=r),r=0;r0;--r)f[s++]=0;for(r=l.length;r>o;){if(f[--r](s=(o=Math.ceil(a/7))>s?o+1:s+1)&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((s=f.length)-(i=c.length)<0&&(i=s,n=c,c=f,f=n),e=0;i;)e=(f[--i]=f[i]+c[i]+e)/1e7|0,f[i]%=1e7;for(e&&(f.unshift(e),++r),s=f.length;0==f[--s];)f.pop();return t.d=f,t.e=L(f,r),d?T(t,a,u):t},S.precision=S.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(l+t);return n.d?(e=O(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},S.round=function(){var t=this,e=t.constructor;return T(new e(t),t.e+1,e.rounding)},S.sine=S.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r=e.d.length;if(r<3)return V(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=e.times(1/H(5,n)),e=V(t,2,e,e);for(var i,o=new t(5),s=new t(16),a=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(a))));return e}(r,W(r,n)),r.precision=t,r.rounding=e,T(a>2?n.neg():n,t,e,!0)):new r(NaN)},S.squareRoot=S.sqrt=function(){var t,e,n,r,i,o,s=this,a=s.d,u=s.e,f=s.s,c=s.constructor;if(1!==f||!a||!a[0])return new c(!f||f<0&&(!a||a[0])?NaN:a?s:1/0);for(d=!1,0==(f=Math.sqrt(+s))||f==1/0?(((e=M(a)).length+u)%2==0&&(e+="0"),f=Math.sqrt(e),u=p((u+1)/2)-(u<0||u%2),r=new c(e=f==1/0?"1e"+u:(e=f.toExponential()).slice(0,e.indexOf("e")+1)+u)):r=new c(f.toString()),n=(u=c.precision)+3;;)if(r=(o=r).plus(I(s,o,n+2,1)).times(.5),M(o.d).slice(0,n)===(e=M(r.d)).slice(0,n)){if("9999"!=(e=e.slice(n-3,n+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(T(r,u+1,1),t=!r.times(r).eq(s));break}if(!i&&(T(o,u+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}return d=!0,T(r,u,c.rounding,t)},S.tangent=S.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(n=n.sin()).s=1,n=I(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,T(2==a||4==a?n.neg():n,t,e,!0)):new r(NaN)},S.times=S.mul=function(t){var e,n,r,i,o,s,a,u,f,c=this,h=c.constructor,l=c.d,b=(t=new h(t)).d;if(t.s*=c.s,!(l&&l[0]&&b&&b[0]))return new h(!t.s||l&&!l[0]&&!b||b&&!b[0]&&!l?NaN:l&&b?0*t.s:t.s/0);for(n=p(c.e/7)+p(t.e/7),(u=l.length)<(f=b.length)&&(o=l,l=b,b=o,s=u,u=f,f=s),o=[],r=s=u+f;r--;)o.push(0);for(r=f;--r>=0;){for(e=0,i=u+r;i>r;)a=o[i]+b[r]*l[i-r-1]+e,o[i--]=a%1e7|0,e=a/1e7|0;o[i]=(o[i]+e)%1e7|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=L(o,n),d?T(t,h.precision,h.rounding):t},S.toBinary=function(t,e){return Z(this,2,t,e)},S.toDecimalPlaces=S.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(E(t,0,1e9),void 0===e?e=r.rounding:E(e,0,8),T(n,t+n.e+1,e))},S.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=k(r,!0):(E(t,0,1e9),void 0===e?e=i.rounding:E(e,0,8),n=k(r=T(new i(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n},S.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?n=k(i):(E(t,0,1e9),void 0===e?e=o.rounding:E(e,0,8),n=k(r=T(new o(i),t+i.e+1,e),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},S.toFraction=function(t){var e,n,r,i,o,s,a,u,f,c,h,p,g=this,v=g.d,m=g.constructor;if(!v)return new m(g);if(f=n=new m(1),r=u=new m(0),s=(o=(e=new m(r)).e=O(v)-g.e-1)%7,e.d[0]=b(10,s<0?7+s:s),null==t)t=o>0?e:f;else{if(!(a=new m(t)).isInt()||a.lt(f))throw Error(l+a);t=a.gt(e)?o>0?e:f:a}for(d=!1,a=new m(M(v)),c=m.precision,m.precision=o=7*v.length*2;h=I(a,e,0,1,1),1!=(i=n.plus(h.times(r))).cmp(t);)n=r,r=i,i=f,f=u.plus(h.times(i)),u=i,i=e,e=a.minus(h.times(i)),a=i;return i=I(t.minus(n),r,0,1,1),u=u.plus(i.times(f)),n=n.plus(i.times(r)),u.s=f.s=g.s,p=I(f,r,o,1).minus(g).abs().cmp(I(u,n,o,1).minus(g).abs())<1?[f,r]:[u,n],m.precision=c,d=!0,p},S.toHexadecimal=S.toHex=function(t,e){return Z(this,16,t,e)},S.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),null==t){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),void 0===e?e=r.rounding:E(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(d=!1,n=I(n,t,0,e,1).times(t),d=!0,T(n)):(t.s=n.s,n=t),n},S.toNumber=function(){return+this},S.toOctal=function(t,e){return Z(this,8,t,e)},S.toPower=S.pow=function(t){var e,n,r,i,o,s,a=this,u=a.constructor,f=+(t=new u(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new u(b(+a,f));if((a=new u(a)).eq(1))return a;if(r=u.precision,o=u.rounding,t.eq(1))return T(a,r,o);if((e=p(t.e/7))>=t.d.length-1&&(n=f<0?-f:f)<=9007199254740991)return i=z(u,a,n,r),t.s<0?new u(1).div(i):T(i,r,o);if((s=a.s)<0){if(eu.maxE+1||e0?s/0:0):(d=!1,u.rounding=a.s=1,n=Math.min(12,(e+"").length),(i=F(t.times(j(a,r+n)),r)).d&&A((i=T(i,r+5,1)).d,r,o)&&(e=r+10,+M((i=T(F(t.times(j(a,e+n)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=T(i,r+1,0))),i.s=s,d=!0,u.rounding=o,T(i,r,o))},S.toPrecision=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=k(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(E(t,1,1e9),void 0===e?e=i.rounding:E(e,0,8),n=k(r=T(new i(r),t,e),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n},S.toSignificantDigits=S.toSD=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(E(t,1,1e9),void 0===e?e=n.rounding:E(e,0,8)),T(new n(this),t,e)},S.toString=function(){var t=this,e=t.constructor,n=k(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},S.truncated=S.trunc=function(){return T(new this.constructor(this),this.e+1,1)},S.valueOf=S.toJSON=function(){var t=this,e=t.constructor,n=k(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};var I=function(){function t(t,e,n){var r,i=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+i,t[o]=r%n|0,i=r/n|0;return i&&t.unshift(i),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]1;)t.shift()}return function(r,i,o,a,u,f){var c,h,d,l,b,g,v,m,y,w,_,S,M,E,A,x,I,k,L,N,R=r.constructor,O=r.s==i.s?1:-1,B=r.d,z=i.d;if(!(B&&B[0]&&z&&z[0]))return new R(r.s&&i.s&&(B?!z||B[0]!=z[0]:z)?B&&0==B[0]||!z?0*O:O/0:NaN);for(f?(b=1,h=r.e-i.e):(f=1e7,b=7,h=p(r.e/b)-p(i.e/b)),L=z.length,I=B.length,w=(y=new R(O)).d=[],d=0;z[d]==(B[d]||0);d++);if(z[d]>(B[d]||0)&&h--,null==o?(E=o=R.precision,a=R.rounding):E=u?o+(r.e-i.e)+1:o,E<0)w.push(1),g=!0;else{if(E=E/b+2|0,d=0,1==L){for(l=0,z=z[0],E++;(d1&&(z=t(z,l,f),B=t(B,l,f),L=z.length,I=B.length),x=L,S=(_=B.slice(0,L)).length;S=f/2&&++k;do{l=0,(c=e(z,_,L,S))<0?(M=_[0],L!=S&&(M=M*f+(_[1]||0)),(l=M/k|0)>1?(l>=f&&(l=f-1),1==(c=e(v=t(z,l,f),_,m=v.length,S=_.length))&&(l--,n(v,L=10;l/=10)d++;y.e=d+h*b-1,T(y,u?o+y.e+1:o,a,g)}return y}}();function T(t,e,n,r){var i,o,s,a,u,f,c,h,l,p=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(i=1,a=h[0];a>=10;a/=10)i++;if((o=e-i)<0)o+=7,s=e,u=(c=h[l=0])/b(10,i-s-1)%10|0;else if((l=Math.ceil((o+1)/7))>=(a=h.length)){if(!r)break t;for(;a++<=l;)h.push(0);c=u=0,i=1,s=(o%=7)-7+1}else{for(c=a=h[l],i=1;a>=10;a/=10)i++;u=(s=(o%=7)-7+i)<0?0:c/b(10,i-s-1)%10|0}if(r=r||e<0||void 0!==h[l+1]||(s<0?c:c%b(10,i-s-1)),f=n<4?(u||r)&&(0==n||n==(t.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(o>0?s>0?c/b(10,i-s):0:h[l-1])%10&1||n==(t.s<0?8:7)),e<1||!h[0])return h.length=0,f?(e-=t.e+1,h[0]=b(10,(7-e%7)%7),t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=l,a=1,l--):(h.length=l+1,a=b(10,7-o),h[l]=s>0?(c/b(10,i-s)%b(10,s)|0)*a:0),f)for(;;){if(0==l){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(t.e++,1e7==h[0]&&(h[0]=1));break}if(h[l]+=a,1e7!=h[l])break;h[l--]=0,a=1}for(o=h.length;0===h[--o];)h.pop()}return d&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+B(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+B(-i-1)+o,n&&(r=n-s)>0&&(o+=B(r))):i>=s?(o+=B(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+B(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=B(r))),o}function L(t,e){var n=t[0];for(e*=7;n>=10;n/=10)e++;return e}function N(t,e,n){if(e>w)throw d=!0,n&&(t.precision=n),Error("[DecimalError] Precision limit exceeded");return T(new t(f),e,1,!0)}function R(t,e,n){if(e>_)throw Error("[DecimalError] Precision limit exceeded");return T(new t(c),e,n,!0)}function O(t){var e=t.length-1,n=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function B(t){for(var e="";t--;)e+="0";return e}function z(t,e,n,r){var i,o=new t(1),s=Math.ceil(r/7+4);for(d=!1;;){if(n%2&&Y((o=o.times(e)).d,s)&&(i=!0),0===(n=p(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}Y((e=e.times(e)).d,s)}return d=!0,o}function P(t){return 1&t.d[t.d.length-1]}function U(t,e,n){for(var r,i=new t(e[0]),o=0;++o17)return new l(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(d=!1,u=g):u=e,a=new l(.03125);t.e>-2;)t=t.times(a),h+=5;for(u+=r=Math.log(b(2,h))/Math.LN10*2+5|0,n=o=s=new l(1),l.precision=u;;){if(o=T(o.times(t),u,1),n=n.times(++c),M((a=s.plus(I(o,n,u,1))).d).slice(0,u)===M(s.d).slice(0,u)){for(i=h;i--;)s=T(s.times(s),u,1);if(null!=e)return l.precision=g,s;if(!(f<3&&A(s.d,u-r,p,f)))return T(s,l.precision=g,p,d=!0);l.precision=u+=10,n=o=a=new l(1),c=0,f++}s=a}}function j(t,e){var n,r,i,o,s,a,u,f,c,h,l,p=1,b=t,g=b.d,v=b.constructor,m=v.rounding,y=v.precision;if(b.s<0||!g||!g[0]||!b.e&&1==g[0]&&1==g.length)return new v(g&&!g[0]?-1/0:1!=b.s?NaN:g?0:b);if(null==e?(d=!1,c=y):c=e,v.precision=c+=10,r=(n=M(g)).charAt(0),!(Math.abs(o=b.e)<15e14))return f=N(v,c+2,y).times(o+""),b=j(new v(r+"."+n.slice(1)),c-10).plus(f),v.precision=y,null==e?T(b,y,m,d=!0):b;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=M((b=b.times(t)).d)).charAt(0),p++;for(o=b.e,r>1?(b=new v("0."+n),o++):b=new v(r+"."+n.slice(1)),h=b,u=s=b=I(b.minus(1),b.plus(1),c,1),l=T(b.times(b),c,1),i=3;;){if(s=T(s.times(l),c,1),M((f=u.plus(I(s,new v(i),c,1))).d).slice(0,c)===M(u.d).slice(0,c)){if(u=u.times(2),0!==o&&(u=u.plus(N(v,c+2,y).times(o+""))),u=I(u,new v(p),c,1),null!=e)return v.precision=y,u;if(!A(u.d,c-10,m,a))return T(u,v.precision=y,m,d=!0);v.precision=c+=10,f=s=b=I(h.minus(1),h.plus(1),c,1),l=T(b.times(b),c,1),i=a=1}u=f,i+=2}}function C(t){return String(t.s*t.s/0)}function D(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%7,n<0&&(r+=7),rt.constructor.maxE?(t.d=null,t.e=NaN):t.e0?(f=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),a=(s=e.indexOf("."))>=0,r=t.constructor,a&&(s=(u=(e=e.replace(".","")).length)-s,i=z(r,new r(n),s,2*s)),s=h=(c=x(e,n,1e7)).length-1;0===c[s];--s)c.pop();return s<0?new r(0*t.s):(t.e=L(c,h),t.d=c,d=!1,a&&(t=I(t,i,4*u)),f&&(t=t.times(Math.abs(f)<54?b(2,f):o.pow(2,f))),d=!0,t)}function V(t,e,n,r,i){var o,s,a,u,f=t.precision,c=Math.ceil(f/7);for(d=!1,u=n.times(n),a=new t(r);;){if(s=I(a.times(u),new t(e++*e++),f,1),a=i?r.plus(s):r.minus(s),r=I(s.times(u),new t(e++*e++),f,1),void 0!==(s=a.plus(r)).d[c]){for(o=c;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=r,r=s,s=o}return d=!0,s.d.length=c+1,s}function H(t,e){for(var n=t;--e;)n*=t;return n}function W(t,e){var n,r=e.s<0,i=R(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return a=r?4:1,e;if((n=e.divToInt(i)).isZero())a=r?3:2;else{if((e=e.minus(n.times(i))).lte(o))return a=P(n)?r?2:3:r?4:1,e;a=P(n)?r?1:4:r?3:2}return e.minus(i).abs()}function Z(t,e,n,r){var i,o,a,f,c,h,d,l,p,b=t.constructor,g=void 0!==n;if(g?(E(n,1,1e9),void 0===r?r=b.rounding:E(r,0,8)):(n=b.precision,r=b.rounding),t.isFinite()){for(g?(i=2,16==e?n=4*n-3:8==e&&(n=3*n-2)):i=e,(a=(d=k(t)).indexOf("."))>=0&&(d=d.replace(".",""),(p=new b(1)).e=d.length-a,p.d=x(k(p),10,i),p.e=p.d.length),o=c=(l=x(d,10,i)).length;0==l[--c];)l.pop();if(l[0]){if(a<0?o--:((t=new b(t)).d=l,t.e=o,l=(t=I(t,p,n,r,0,i)).d,o=t.e,h=s),a=l[n],f=i/2,h=h||void 0!==l[n+1],h=r<4?(void 0!==a||h)&&(0===r||r===(t.s<0?3:2)):a>f||a===f&&(4===r||h||6===r&&1&l[n-1]||r===(t.s<0?8:7)),l.length=n,h)for(;++l[--n]>i-1;)l[n]=0,n||(++o,l.unshift(1));for(c=l.length;!l[c-1];--c);for(a=0,d="";a1)if(16==e||8==e){for(a=16==e?4:3,--c;c%a;c++)d+="0";for(c=(l=x(d,i,e)).length;!l[c-1];--c);for(a=1,d="1.";ac)for(o-=c;o--;)d+="0";else oe)return t.length=e,!0}function J(t){return new this(t).abs()}function K(t){return new this(t).acos()}function $(t){return new this(t).acosh()}function X(t,e){return new this(t).plus(e)}function G(t){return new this(t).asin()}function Q(t){return new this(t).asinh()}function tt(t){return new this(t).atan()}function et(t){return new this(t).atanh()}function nt(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(n=e.s<0?R(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=R(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(I(t,e,o,1)),e=R(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(I(t,e,o,1)):(n=R(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function rt(t){return new this(t).cbrt()}function it(t){return T(t=new this(t),t.e+1,2)}function ot(t){if(!t||"object"!=typeof t)throw Error("[DecimalError] Object expected");var e,n,r,i=!0===t.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(e=0;e=o[e+1]&&r<=o[e+2]))throw Error(l+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=h[n]),void 0!==(r=t[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(l+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[n]=!0}else this[n]=!1}return this}function st(t){return new this(t).cos()}function at(t){return new this(t).cosh()}function ut(t,e){return new this(t).div(e)}function ft(t){return new this(t).exp()}function ct(t){return T(t=new this(t),t.e+1,3)}function ht(){var t,e,n=new this(0);for(d=!1,t=0;t=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(e=crypto.randomBytes(r*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(a.push(i%1e7),o+=4);o=r/4}else for(;o=10;i/=10)r++;r<7&&(n-=7-r)}return s.e=n,s.d=a,s}function Mt(t){return T(t=new this(t),t.e+1,this.rounding)}function Et(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function At(t){return new this(t).sin()}function xt(t){return new this(t).sinh()}function It(t){return new this(t).sqrt()}function Tt(t,e){return new this(t).sub(e)}function kt(t){return new this(t).tan()}function Lt(t){return new this(t).tanh()}function Nt(t){return T(t=new this(t),t.e+1,1)}(o=function t(e){var n,r,i;function o(t){var e,n,r,i=this;if(!(i instanceof o))return new o(t);if(i.constructor=o,t instanceof o)return i.s=t.s,void(d?!t.d||t.e>o.maxE?(i.e=NaN,i.d=null):t.e=10;n/=10)e++;return void(d?e>o.maxE?(i.e=NaN,i.d=null):e0&&void 0!==arguments[0]?arguments[0]:0,e=void 0===t?"undefined":r(t);if("number"===e)i(t>=0),this._bytes=new Uint8Array(8),this._bytes.set(c(t,4),4);else if(t instanceof o)this._bytes=f(t.toArray("be",8),Uint8Array),this._toBN=t;else{if("string"===e&&!d.test(t))throw new Error(t+" is not a valid UInt64 hex string");this._bytes=f(t,Uint8Array)}i(8===this._bytes.length)},toJSON:function(){return u(this._bytes)},valueOf:function(){return this.toBN()},cached:{toBN:function(){return new o(this._bytes)}},toBytes:function(){return this._bytes}});t.exports={UInt64:l}},function(t,e,n){"use strict";var r=n(0)({inherits:n(36).Hash,statics:{width:32,init:function(){this.ZERO_256=new this(new Uint8Array(this.width))}}});t.exports={Hash256:r}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(12),o=n(0),s=n(15).Field,a=n(37).BinarySerializer,u=s.ObjectEndMarker,f=o({mixins:n(10).SerializedType,statics:{fromParser:function(t,e){for(var n="number"==typeof e?t.pos()+e:null,r=new this;!t.end(n);){var i=t.readField();if(i===u)break;r[i]=t.readFieldValue(i)}return r},from:function(t){if(t instanceof this)return t;if("object"===(void 0===t?"undefined":r(t)))return i.transform(t,(function(t,e,n){var r=s[n];r?t[r]=r.associatedType.from(e):t[n]=e}),new this);throw new Error(t+" is unsupported")}},fieldKeys:function(){return Object.keys(this).map((function(t){return s[t]})).filter(Boolean)},toJSON:function(){return i.transform(this,(function(t,e,n){t[n]=e&&e.toJSON?e.toJSON():e}),{})},toBytesSink:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},r=new a(t),o=this.fieldKeys(),s=i.sortBy(o,"ordinal");s.filter(n).forEach((function(t){var n=e[t];t.isSerialized&&r.writeFieldAndValue(t,n)}))}});t.exports={STObject:f}},function(t,e,n){"use strict";var r=n(11),i=n(16),o=n(21).HashPrefix,s=n(106).BinaryParser,a=n(37),u=a.BinarySerializer,f=a.BytesList,c=n(3),h=c.bytesToHex,d=c.slice,l=c.parseBytes,p=n(25),b=p.sha512Half,g=p.transactionID,v=function(t){return new s(t)},m=function(t){return t.readType(i.STObject).toJSON()};function y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.prefix,r=e.suffix,o=e.signingFieldsOnly,s=void 0!==o&&o,a=new f;n&&a.put(n);var u=s?function(t){return t.isSigningField}:void 0;return i.STObject.from(t).toBytesSink(a,u),r&&a.put(r),a.toBytes()}t.exports={BinaryParser:s,BinarySerializer:u,BytesList:f,makeParser:v,serializeObject:y,readJSON:m,bytesToHex:h,parseBytes:l,multiSigningData:function(t,e){return y(t,{prefix:o.transactionMultiSig,suffix:i.AccountID.from(e).toBytes(),signingFieldsOnly:!0})},signingData:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.transactionSig;return y(t,{prefix:e,signingFieldsOnly:!0})},signingClaimData:function(t){var e=o.paymentChannelClaim,n=i.Hash256.from(t.channel).toBytes(),s=new i.UInt64(new r(t.amount)).toBytes(),a=new f;return a.put(e),a.put(n),a.put(s),a.toBytes()},binaryToJSON:function(t){return m(v(t))},sha512Half:b,transactionID:g,slice:d}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(16).Hash256,s=n(21).HashPrefix,a=n(25).Sha512Half,u=i({virtuals:{hashPrefix:function(){},isLeaf:function(){},isInner:function(){}},cached:{hash:function(){var t=a.put(this.hashPrefix());return this.toBytesSink(t),t.finish()}}}),f=i({inherits:u,ShaMapLeaf:function(t,e){u.call(this),this.index=t,this.item=e},isLeaf:function(){return!0},isInner:function(){return!1},hashPrefix:function(){return this.item.hashPrefix()},toBytesSink:function(t){this.item.toBytesSink(t),this.index.toBytesSink(t)}}),c=u.prototype,h=i({inherits:u,ShaMapInner:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;u.call(this),this.depth=t,this.slotBits=0,this.branches=Array(16)},isInner:function(){return!0},isLeaf:function(){return!1},hashPrefix:function(){return s.innerNode},setBranch:function(t,e){this.slotBits=this.slotBits|1<>>3},e.g1_256=function(t){return r(t,17)^r(t,19)^t>>>10}},function(t,e,n){"use strict";var r=n(7),i=n(22),o=n(57),s=n(14),a=r.sum32,u=r.sum32_4,f=r.sum32_5,c=o.ch32,h=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,g=i.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function m(){if(!(this instanceof m))return new m;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}r.inherits(m,g),t.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r>8,s=255&i;o?n.push(o,s):n.push(s)}return n},r.zero2=i,r.toHex=o,r.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,n){"use strict";var r=e;r.base=n(26),r.short=n(119),r.mont=n(120),r.edwards=n(121)},function(t,e,n){(function(t){const e=n(66),r=n(29),o=n(109),s="badge badge-danger";var a=0;function u(t,e){let n;return n=e?$("
  • ").appendTo("#log").append(t):$("
  • ").text(t+" ").appendTo("#log"),n.resolve=function(t){return $("").html(t).appendTo(n)},n}function f(){const n=$("#manifest").val();try{var f=e.decode(n)}catch(t){return void u("Error decoding manifest").resolve(t).addClass(s)}let h=f.PublicKey,d=new t(h,"hex").toJSON().data;try{var l=function(t){for(var e=t.toString(),n="",r=0;rCheck if the xrp-ledger.toml file is actually hosted in the /.well-known/ location at the domain in your manifest. Check your server\'s HTTPS settings and certificate, and make sure your server provides the required CORS header.

    ')}})}function c(t){for(var e=[],n=0,r=t.length;n{$("#manifest-entry").submit(h)})}).call(this,n(5).Buffer)},function(t,e,n){"use strict";e.byteLength=function(t){var e=f(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=f(t),s=r[0],a=r[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),c=0,h=a>0?s-4:s;for(n=0;n>16&255,u[c++]=e>>8&255,u[c++]=255&e;2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[c++]=255&e);1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;sa?a:s+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<>1,c=-7,h=n?i-1:0,d=n?-1:1,l=t[e+h];for(h+=d,o=l&(1<<-c)-1,l>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+t[e+h],h+=d,c-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,r),o-=f}return(l?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,u,f=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=r?0:o-1,p=r?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=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[n+l]=255&a,l+=p,a/=256,i-=8);for(s=s<0;t[n+l]=255&s,l+=p,s/=256,f-=8);t[n+l-p]|=128*b}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(2),o=n(71),s=o.quality,a=o.binary,u=a.bytesToHex,f=a.signingData,c=a.signingClaimData,h=a.multiSigningData,d=a.binaryToJSON,l=a.serializeObject,p=a.BinaryParser;t.exports={decode:function(t){return i("string"==typeof t,"binary must be a hex string"),d(t)},encode:function(t){return i("object"===(void 0===t?"undefined":r(t))),u(l(t))},encodeForSigning:function(t){return i("object"===(void 0===t?"undefined":r(t))),u(f(t))},encodeForSigningClaim:function(t){return i("object"===(void 0===t?"undefined":r(t))),u(c(t))},encodeForMultisigning:function(t,e){return i("object"===(void 0===t?"undefined":r(t))),i.equal(t.SigningPubKey,""),u(h(t,e))},encodeQuality:function(t){return i("string"==typeof t),u(s.encode(t))},decodeQuality:function(t){return i("string"==typeof t),s.decode(t).toString()},decodeLedgerData:function(t){i("string"==typeof t,"binary must be a hex string");var e=new p(t);return{ledger_index:e.readUInt32(),total_coins:e.readType(o.UInt64).valueOf().toString(),parent_hash:e.readType(o.Hash256).toHex(),transaction_hash:e.readType(o.Hash256).toHex(),account_hash:e.readType(o.Hash256).toHex(),parent_close_time:e.readUInt32(),close_time:e.readUInt32(),close_time_resolution:e.readUInt8(),close_flags:e.readUInt8()}}}},function(t,e,n){"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,a,u=s(t),f=1;f=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),u=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(n)?r.showHidden=n:n&&e._extend(r,n),m(r.showHidden)&&(r.showHidden=!1),m(r.depth)&&(r.depth=2),m(r.colors)&&(r.colors=!1),m(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),c(r,t,r.depth)}function u(t,e){var n=a.styles[e];return n?"["+a.colors[n][0]+"m"+t+"["+a.colors[n][1]+"m":t}function f(t,e){return t}function c(t,n,r){if(t.customInspect&&n&&M(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return v(i)||(i=c(t,i,r)),i}var o=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(v(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(g(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(b(e))return t.stylize("null","null")}(t,n);if(o)return o;var s=Object.keys(n),a=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(n)),S(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(n);if(0===s.length){if(M(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(y(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return t.stylize(Date.prototype.toString.call(n),"date");if(S(n))return h(n)}var f,w="",E=!1,A=["{","}"];(l(n)&&(E=!0,A=["[","]"]),M(n))&&(w=" [Function"+(n.name?": "+n.name:"")+"]");return y(n)&&(w=" "+RegExp.prototype.toString.call(n)),_(n)&&(w=" "+Date.prototype.toUTCString.call(n)),S(n)&&(w=" "+h(n)),0!==s.length||E&&0!=n.length?r<0?y(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),f=E?function(t,e,n,r,i){for(var o=[],s=0,a=e.length;s=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(f,w,A)):A[0]+w+A[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,n,r,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),T(r,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(n)?c(t,u.value,null):c(t,u.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),m(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function l(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function b(t){return null===t}function g(t){return"number"==typeof t}function v(t){return"string"==typeof t}function m(t){return void 0===t}function y(t){return w(t)&&"[object RegExp]"===E(t)}function w(t){return"object"==typeof t&&null!==t}function _(t){return w(t)&&"[object Date]"===E(t)}function S(t){return w(t)&&("[object Error]"===E(t)||t instanceof Error)}function M(t){return"function"==typeof t}function E(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(n){if(m(o)&&(o=t.env.NODE_DEBUG||""),n=n.toUpperCase(),!s[n])if(new RegExp("\\b"+n+"\\b","i").test(o)){var r=t.pid;s[n]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",n,r,t)}}else s[n]=function(){};return s[n]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=l,e.isBoolean=p,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=m,e.isRegExp=y,e.isObject=w,e.isDate=_,e.isError=S,e.isFunction=M,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(69);var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),x[t.getMonth()],e].join(" ")}function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",I(),e.format.apply(e,arguments))},e.inherits=n(70),e._extend=function(t,e){if(!e||!w(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function L(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(k&&t[k]){var e;if("function"!=typeof(e=t[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,k,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,n,r=new Promise((function(t,r){e=t,n=r})),i=[],o=0;o1&&!e.expectedLength)throw new Error("expectedLength is required because there are >= 2 possible versions");const s="number"==typeof n[0]?1:n[0].length,a=e.expectedLength||o.length-s,u=o.slice(0,-a),f=o.slice(-a);for(let t=0;t= 5");if(!this.verifyCheckSum(e))throw new Error("checksum_invalid");return e.slice(0,-4)}decodeRaw(t){return this.codec.decode(t)}verifyCheckSum(t){const e=this.sha256(this.sha256(t.slice(0,-4))).slice(0,4),n=t.slice(-4);return i.seqEqual(e,n)}}({sha256:function(e){return o("sha256").update(t.from(e)).digest()},alphabet:"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"});function u(t){const e={versions:[0],expectedLength:20};return a.encode(t,e)}function f(t){const e={versions:[0],expectedLength:20};return a.decode(t,e).bytes}e.codec=a,e.encodeSeed=function(t,e){if(16!==t.length)throw new Error("entropy must have length 16");const n={expectedLength:16,versions:"ed25519"===e?s:[33]};return a.encode(t,n)},e.decodeSeed=function(t,e={versionTypes:["ed25519","secp256k1"],versions:[s,33],expectedLength:16}){return a.decode(t,e)},e.encodeAccountID=u,e.encodeAddress=u,e.decodeAccountID=f,e.decodeAddress=f,e.decodeNodePublic=function(t){const e={versions:[28],expectedLength:33};return a.decode(t,e).bytes},e.encodeNodePublic=function(t){const e={versions:[28],expectedLength:33};return a.encode(t,e)},e.encodeAccountPublic=function(t){const e={versions:[35],expectedLength:33};return a.encode(t,e)},e.decodeAccountPublic=function(t){const e={versions:[35],expectedLength:33};return a.decode(t,e).bytes},e.isValidClassicAddress=function(t){try{f(t)}catch(t){return!1}return!0}}).call(this,n(5).Buffer)},function(t,e,n){"use strict";var r=n(6).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");var e=new Uint8Array(256);e.fill(255);for(var n=0;n>>0,c=new Uint8Array(f);t[n];){var h=e[t.charCodeAt(n)];if(255===h)return;for(var d=0,l=f-1;(0!==h||d>>0,c[l]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");o=d,n++}if(" "!==t[n]){for(var p=f-o;p!==f&&0===c[p];)p++;var b=r.allocUnsafe(i+(f-p));b.fill(0,0,i);for(var g=i;p!==f;)b[g++]=c[p++];return b}}}return{encode:function(e){if(!r.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var n=0,i=0,o=0,u=e.length;o!==u&&0===e[o];)o++,n++;for(var c=(u-o)*f+1>>>0,h=new Uint8Array(c);o!==u;){for(var d=e[o],l=0,p=c-1;(0!==d||l>>0,h[p]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");i=l,o++}for(var b=c-i;b!==c&&0===h[b];)b++;for(var g=a.repeat(n);b>>32-e}function f(t,e,n,r,i,o,s){return u(t+(e&n|~e&r)+i+o|0,s)+e|0}function c(t,e,n,r,i,o,s){return u(t+(e&r|n&~r)+i+o|0,s)+e|0}function h(t,e,n,r,i,o,s){return u(t+(e^n^r)+i+o|0,s)+e|0}function d(t,e,n,r,i,o,s){return u(t+(n^(e|~r))+i+o|0,s)+e|0}r(a,i),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var n=this._a,r=this._b,i=this._c,o=this._d;n=f(n,r,i,o,t[0],3614090360,7),o=f(o,n,r,i,t[1],3905402710,12),i=f(i,o,n,r,t[2],606105819,17),r=f(r,i,o,n,t[3],3250441966,22),n=f(n,r,i,o,t[4],4118548399,7),o=f(o,n,r,i,t[5],1200080426,12),i=f(i,o,n,r,t[6],2821735955,17),r=f(r,i,o,n,t[7],4249261313,22),n=f(n,r,i,o,t[8],1770035416,7),o=f(o,n,r,i,t[9],2336552879,12),i=f(i,o,n,r,t[10],4294925233,17),r=f(r,i,o,n,t[11],2304563134,22),n=f(n,r,i,o,t[12],1804603682,7),o=f(o,n,r,i,t[13],4254626195,12),i=f(i,o,n,r,t[14],2792965006,17),n=c(n,r=f(r,i,o,n,t[15],1236535329,22),i,o,t[1],4129170786,5),o=c(o,n,r,i,t[6],3225465664,9),i=c(i,o,n,r,t[11],643717713,14),r=c(r,i,o,n,t[0],3921069994,20),n=c(n,r,i,o,t[5],3593408605,5),o=c(o,n,r,i,t[10],38016083,9),i=c(i,o,n,r,t[15],3634488961,14),r=c(r,i,o,n,t[4],3889429448,20),n=c(n,r,i,o,t[9],568446438,5),o=c(o,n,r,i,t[14],3275163606,9),i=c(i,o,n,r,t[3],4107603335,14),r=c(r,i,o,n,t[8],1163531501,20),n=c(n,r,i,o,t[13],2850285829,5),o=c(o,n,r,i,t[2],4243563512,9),i=c(i,o,n,r,t[7],1735328473,14),n=h(n,r=c(r,i,o,n,t[12],2368359562,20),i,o,t[5],4294588738,4),o=h(o,n,r,i,t[8],2272392833,11),i=h(i,o,n,r,t[11],1839030562,16),r=h(r,i,o,n,t[14],4259657740,23),n=h(n,r,i,o,t[1],2763975236,4),o=h(o,n,r,i,t[4],1272893353,11),i=h(i,o,n,r,t[7],4139469664,16),r=h(r,i,o,n,t[10],3200236656,23),n=h(n,r,i,o,t[13],681279174,4),o=h(o,n,r,i,t[0],3936430074,11),i=h(i,o,n,r,t[3],3572445317,16),r=h(r,i,o,n,t[6],76029189,23),n=h(n,r,i,o,t[9],3654602809,4),o=h(o,n,r,i,t[12],3873151461,11),i=h(i,o,n,r,t[15],530742520,16),n=d(n,r=h(r,i,o,n,t[2],3299628645,23),i,o,t[0],4096336452,6),o=d(o,n,r,i,t[7],1126891415,10),i=d(i,o,n,r,t[14],2878612391,15),r=d(r,i,o,n,t[5],4237533241,21),n=d(n,r,i,o,t[12],1700485571,6),o=d(o,n,r,i,t[3],2399980690,10),i=d(i,o,n,r,t[10],4293915773,15),r=d(r,i,o,n,t[1],2240044497,21),n=d(n,r,i,o,t[8],1873313359,6),o=d(o,n,r,i,t[15],4264355552,10),i=d(i,o,n,r,t[6],2734768916,15),r=d(r,i,o,n,t[13],1309151649,21),n=d(n,r,i,o,t[4],4149444226,6),o=d(o,n,r,i,t[11],3174756917,10),i=d(i,o,n,r,t[2],718787259,15),r=d(r,i,o,n,t[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},function(t,e){},function(t,e,n){"use strict";var r=n(32).Buffer,i=n(79);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e,n,i,o=r.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,n=o,i=a,e.copy(n,i),a+=s.data.length,s=s.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(81),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(9))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,s,a,u=1,f={},c=!1,h=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},r=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(p,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),r=function(e){t.postMessage(s+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n>>32-e}function b(t,e,n,r,i,o,s,a){return p(t+(e^n^r)+o+s|0,a)+i|0}function g(t,e,n,r,i,o,s,a){return p(t+(e&n|~e&r)+o+s|0,a)+i|0}function v(t,e,n,r,i,o,s,a){return p(t+((e|~n)^r)+o+s|0,a)+i|0}function m(t,e,n,r,i,o,s,a){return p(t+(e&r|n&~r)+o+s|0,a)+i|0}function y(t,e,n,r,i,o,s,a){return p(t+(e^(n|~r))+o+s|0,a)+i|0}i(l,o),l.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,l=0|this._e,w=0|this._a,_=0|this._b,S=0|this._c,M=0|this._d,E=0|this._e,A=0;A<80;A+=1){var x,I;A<16?(x=b(n,r,i,o,l,t[a[A]],h[0],f[A]),I=y(w,_,S,M,E,t[u[A]],d[0],c[A])):A<32?(x=g(n,r,i,o,l,t[a[A]],h[1],f[A]),I=m(w,_,S,M,E,t[u[A]],d[1],c[A])):A<48?(x=v(n,r,i,o,l,t[a[A]],h[2],f[A]),I=v(w,_,S,M,E,t[u[A]],d[2],c[A])):A<64?(x=m(n,r,i,o,l,t[a[A]],h[3],f[A]),I=g(w,_,S,M,E,t[u[A]],d[3],c[A])):(x=y(n,r,i,o,l,t[a[A]],h[4],f[A]),I=b(w,_,S,M,E,t[u[A]],d[4],c[A])),n=l,l=o,o=p(i,10),i=r,r=x,w=E,E=M,M=p(S,10),S=_,_=I}var T=this._b+i+M|0;this._b=this._c+o+E|0,this._c=this._d+l+w|0,this._d=this._e+n+_|0,this._e=this._a+r+S|0,this._a=T},l.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=r.alloc?r.alloc(20):new r(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=l},function(t,e,n){(e=t.exports=function(t){t=t.toLowerCase();var n=e[t];if(!n)throw new Error(t+" is not supported (we accept pull requests)");return new n}).sha=n(91),e.sha1=n(92),e.sha224=n(93),e.sha256=n(49),e.sha384=n(94),e.sha512=n(50)},function(t,e,n){var r=n(1),i=n(17),o=n(6).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function f(t){return t<<30|t>>>2}function c(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}r(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,h=0;h<16;++h)n[h]=t.readInt32BE(4*h);for(;h<80;++h)n[h]=n[h-3]^n[h-8]^n[h-14]^n[h-16];for(var d=0;d<80;++d){var l=~~(d/20),p=0|((e=r)<<5|e>>>27)+c(l,i,o,a)+u+n[d]+s[l];u=a,a=o,o=f(i),i=r,r=p}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,n){var r=n(1),i=n(17),o=n(6).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function f(t){return t<<5|t>>>27}function c(t){return t<<30|t>>>2}function h(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}r(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,d=0;d<16;++d)n[d]=t.readInt32BE(4*d);for(;d<80;++d)n[d]=(e=n[d-3]^n[d-8]^n[d-14]^n[d-16])<<1|e>>>31;for(var l=0;l<80;++l){var p=~~(l/20),b=f(r)+h(p,i,o,a)+u+n[l]+s[p]|0;u=a,a=o,o=c(i),i=r,r=b}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,n){var r=n(1),i=n(49),o=n(17),s=n(6).Buffer,a=new Array(64);function u(){this.init(),this._w=a,o.call(this,64,56)}r(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},function(t,e,n){var r=n(1),i=n(50),o=n(17),s=n(6).Buffer,a=new Array(160);function u(){this.init(),this._w=a,o.call(this,128,112)}r(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},function(t,e,n){var r=n(6).Buffer,i=n(44).Transform,o=n(34).StringDecoder;function s(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(1)(s,i),s.prototype.update=function(t,e,n){"string"==typeof t&&(t=r.from(t,e));var i=this._update(t);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,n){var r;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){r=t}finally{n(r)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||r.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,n){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(t);return n&&(r+=this._decoder.end()),r},t.exports=s},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var i=n(12),o=n(2),s=n(11),a=n(51),u=n(0),f=n(10).SerializedType,c=n(3).bytesToHex,h=n(38).Currency,d=n(28).AccountID,l=n(52).UInt64,p=new a("9999999999999999e80"),b=new a("1000000000000000e-96"),g=new a("1e6"),v=new a("1e17"),m=new a("1e-6"),y=v.dividedBy(g);a.config({toExpPos:96,toExpNeg:-112});var w="\nNative values must be described in drops, a million of which equal one XRP.\nThis must be an integer number, with the absolute value not exceeding "+v+"\n\nIOU values must have a maximum precision of 16 significant digits. They are serialized as\na canonicalised mantissa and exponent.\n\nThe valid range for a mantissa is between 1000000000000000 and 9999999999999999\nThe exponent must be >= "+-96+" and <= 80\n\nThus the largest serializable IOU value is:\n"+p.toString()+"\n\nAnd the smallest:\n"+b.toString()+"\n";function _(t){return!i.isUndefined(t)}function S(t){throw new Error(t.toString()+" is an illegal amount\n"+w)}var M={string:function(t){return t.match(/^\d+$/)||S(t),[new a(t).dividedBy(g),h.XRP]},object:function(t){return o(_(t.currency),"currency must be defined"),o(_(t.issuer),"issuer must be defined"),[new a(t.value),h.from(t.currency),d.from(t.issuer)]}},E=u({Amount:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.value=t||new a("0"),this.currency=e||h.XRP,this.issuer=n||null,r&&this.assertValueIsValid()},mixins:f,statics:{from:function(t){if(t instanceof this)return t;var e=M[void 0===t?"undefined":r(t)];if(e)return new(Function.prototype.bind.apply(this,[null].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e>6)-97;return e[1]&=63,new this(new a(i+"0x"+c(e)).times("1e"+u),o,s,!1)}return e[0]&=63,new this(new a(i+"0x"+c(e)).dividedBy(g),h.XRP,null,!1)}},assertValueIsValid:function(){if(!this.isZero())if(this.isNative()){var t=this.value.abs();(t.lt(m)||t.gt(y))&&S(this.value.times(g)),this.verifyNoDecimal(this.value)}else{var e=this.value.precision(),n=this.exponent();(e>16||n>80||n<-96)&&S(this.value)}},isNative:function(){return this.currency.isNative()},mantissa:function(){var t=this.verifyNoDecimal();return new l(new s(t))},verifyNoDecimal:function(){var t=this.value.times("1e"+-this.exponent()).abs().toString();return-1!==t.indexOf(".")&&S(t),t},isZero:function(){return this.value.isZero()},exponent:function(){return this.isNative()?-6:this.value.e-15},valueString:function(){return(this.isNative()?this.value.times(g):this.value).toString()},toBytesSink:function(t){var e=this.isNative(),n=!this.value.isNegative(),r=this.mantissa().toBytes();if(e)r[0]|=n?64:0,t.put(r);else{if(r[0]|=128,!this.isZero()){n&&(r[0]|=64);var i=97+(this.value.e-15);r[0]|=i>>>2,r[1]|=(3&i)<<6}t.put(r),this.currency.toBytesSink(t),this.issuer.toBytesSink(t)}},toJSON:function(){var t=this.valueString();return this.isNative()?t:{value:t,currency:this.currency.toJSON(),issuer:this.issuer.toJSON()}}});t.exports={Amount:E}},function(t,e){},function(t,e,n){"use strict";var r=n(0),i=n(3).parseBytes,o=r({mixins:n(10).SerializedType,Blob:function(t){this._bytes=t?i(t,Uint8Array):new Uint8Array(0)},statics:{fromParser:function(t,e){return new this(t.read(e))},from:function(t){return t instanceof this?t:new this(t)}}});t.exports={Blob:o}},function(t,e,n){"use strict";var r=n(0)({inherits:n(36).Hash,statics:{width:16}});t.exports={Hash128:r}},function(t,e,n){"use strict";var r=n(0),i=n(10),o=i.SerializedType,s=i.ensureArrayLikeIs,a=n(38).Currency,u=n(28).AccountID,f=r({statics:{from:function(t){if(t instanceof this)return t;var e=new f;return t.issuer&&(e.issuer=u.from(t.issuer)),t.account&&(e.account=u.from(t.account)),t.currency&&(e.currency=a.from(t.currency)),e},parse:function(t,e){var n=new f;return 1&e&&(n.account=u.fromParser(t)),16&e&&(n.currency=a.fromParser(t)),32&e&&(n.issuer=u.fromParser(t)),n}},toJSON:function(){var t=this.type(),e={};return 1&t&&(e.account=this.account.toJSON()),32&t&&(e.issuer=this.issuer.toJSON()),16&t&&(e.currency=this.currency.toJSON()),e},type:function(){var t=0;return this.issuer&&(t+=32),this.account&&(t+=1),this.currency&&(t+=16),t}}),c=r({inherits:Array,statics:{from:function(t){return s(c,t).withChildren(f)}},toJSON:function(){return this.map((function(t){return t.toJSON()}))}}),h=r({mixins:o,inherits:Array,statics:{from:function(t){return s(h,t).withChildren(c)},fromParser:function(t){for(var e=new this,n=void 0;!t.end();){var r=t.readUInt8();if(0===r)break;255!==r?(n||(n=new c,e.push(n)),n.push(f.parse(t,r))):n=null}return e}},toJSON:function(){return this.map((function(t){return t.toJSON()}))},toBytesSink:function(t){var e=0;this.forEach((function(n){0!=e++&&t.put([255]),n.forEach((function(e){t.put([e.type()]),e.account&&e.account.toBytesSink(t),e.currency&&e.currency.toBytesSink(t),e.issuer&&e.issuer.toBytesSink(t)}))})),t.put([0])}});t.exports={PathSet:h}},function(t,e,n){"use strict";var r=n(0),i=n(10),o=i.ensureArrayLikeIs,s=i.SerializedType,a=n(15).Field,u=n(54).STObject,f=a.ArrayEndMarker,c=r({mixins:s,inherits:Array,statics:{fromParser:function(t){for(var e=new c;!t.end();){var n=t.readField();if(n===f)break;var r=new u;r[n]=t.readFieldValue(n),e.push(r)}return e},from:function(t){return o(c,t).withChildren(u)}},toJSON:function(){return this.map((function(t){return t.toJSON()}))},toBytesSink:function(t){this.forEach((function(e){return e.toBytesSink(t)}))}});t.exports={STArray:c}},function(t,e,n){"use strict";var r=n(0)({inherits:n(24).UInt,statics:{width:2}});t.exports={UInt16:r}},function(t,e,n){"use strict";var r=n(0)({inherits:n(24).UInt,statics:{width:4}});t.exports={UInt32:r}},function(t,e,n){"use strict";var r=n(0)({inherits:n(24).UInt,statics:{width:1}});t.exports={UInt8:r}},function(t,e,n){"use strict";var r=n(0),i=n(53).Hash256,o=n(10),s=o.ensureArrayLikeIs,a=r({mixins:o.SerializedType,inherits:Array,statics:{fromParser:function(t,e){for(var n=new this,r=(null!==e?e:t.size()-t.pos())/32,o=0;o1&&void 0!==arguments[1]?arguments[1]:Uint8Array,n=this._cursor,i=this._cursor+t;return r(i<=this._buf.length),this._cursor=i,a(this._buf,n,i,e)},readUIntN:function(t){return this.read(t,Array).reduce((function(t,e){return t<<8|e}))>>>0},readUInt8:function(){return this._buf[this._cursor++]},readUInt16:function(){return this.readUIntN(2)},readUInt32:function(){return this.readUIntN(4)},pos:function(){return this._cursor},size:function(){return this._buf.length},end:function(t){var e=this.pos();return e>=this._length||null!==t&&e>=t},readVL:function(){return this.read(this.readVLLength())},readVLLength:function(){var t=this.readUInt8();if(t<=192)return t;if(t<=240)return 193+256*(t-193)+this.readUInt8();if(t<=254)return 12481+65536*(t-241)+256*this.readUInt8()+this.readUInt8();throw new Error("Invalid varint length indicator")},readFieldOrdinal:function(){var t=this.readUInt8();return((240&t)>>>4||this.readUInt8())<<16|(15&t||this.readUInt8())},readField:function(){return o.from(this.readFieldOrdinal())},readType:function(t){return t.fromParser(this)},typeForField:function(t){return t.associatedType},readFieldValue:function(t){var e=this.typeForField(t);if(!e)throw new Error("unsupported: ("+t.name+", "+t.type.name+")");var n=t.isVLEncoded?this.readVLLength():null,r=e.fromParser(this,n);if(void 0===r)throw new Error("fromParser for ("+t.name+", "+t.type.name+") -> undefined ");return r},readFieldAndValue:function(){var t=this.readField();return[t,this.readFieldValue(t)]}});t.exports={BinaryParser:f}},function(t,e,n){"use strict";var r=n(12),i=n(11),o=n(2),s=n(16),a=s.STObject,u=s.Hash256,f=n(56).ShaMap,c=n(21).HashPrefix,h=n(25).Sha512Half,d=n(55),l=d.BinarySerializer,p=d.serializeObject;function b(t,e){var n=new f;return e.forEach((function(e){return n.addItem.apply(n,function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);el(h.sign(p(t),d(e),{canonical:!0}).toDER()),verify:(t,e,n)=>h.verify(p(t),e,d(n))},g={deriveKeypair(t){const e=p(t);return{privateKey:"ED"+l(e),publicKey:"ED"+l(c.keyFromSecret(e).pubBytes())}},sign:(t,e)=>(r(Array.isArray(t),"message must be array of octets"),l(c.sign(t,d(e).slice(1)).toBytes())),verify:(t,e,n)=>c.verify(t,d(e),d(n).slice(1))};function v(t){return{"ecdsa-secp256k1":b,ed25519:g}[t]}function m(t){const e=d(t);return 33===e.length&&237===e[0]?"ed25519":"ecdsa-secp256k1"}function y(t){return a.encodeAccountID(f.computePublicKeyHash(t))}const{decodeSeed:w}=a;t.exports={generateSeed:function(t={}){r(!t.entropy||t.entropy.length>=16,"entropy too short");const e=t.entropy?t.entropy.slice(0,16):i(16),n="ed25519"===t.algorithm?"ed25519":"secp256k1";return a.encodeSeed(e,n)},deriveKeypair:function(t,e){const n=a.decodeSeed(t),r=v("ed25519"===n.type?"ed25519":"ecdsa-secp256k1"),i=r.deriveKeypair(n.bytes,e),o=p("This test message should verify."),s=r.sign(o,i.privateKey);if(!0!==r.verify(o,s,i.publicKey))throw new Error("derived keypair did not generate verifiable signature");return i},sign:function(t,e){return v(m(e)).sign(d(t),e)},verify:function(t,e,n){return v(m(n)).verify(d(t),e,n)},deriveAddress:function(t){return y(e.from(d(t)))},deriveNodeAddress:function(t){const e=a.decodeNodePublic(t);return y(u.accountPublicFromPublicGenerator(e))},decodeSeed:w}}).call(this,n(5).Buffer)},function(t,e){},function(t,e,n){"use strict";e.sha1=n(112),e.sha224=n(113),e.sha256=n(58),e.sha384=n(114),e.sha512=n(59)},function(t,e,n){"use strict";var r=n(7),i=n(22),o=n(57),s=r.rotl32,a=r.sum32,u=r.sum32_5,f=o.ft_1,c=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(d,c),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;rthis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e=0&&(s=e,a=n),r.negative&&(r=r.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:r,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],r=e[1],i=r.b.mul(t).divRound(this.n),o=n.b.neg().mul(t).divRound(this.n),s=i.mul(n.a),a=o.mul(r.a),u=i.mul(n.b),f=o.mul(r.b);return{k1:t.sub(s).sub(a),k2:u.add(f).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var o=r.fromRed().isOdd();return(e&&!o||!e&&o)&&(r=r.redNeg()),this.point(t,r)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,r=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},f.prototype.isInfinity=function(){return this.inf},f.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 n=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},f.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,n=this.x.redSqr(),r=t.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(t){return t=new i(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)},f.prototype.mulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},f.prototype.jmulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},f.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))},f.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,r=function(t){return t.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return e},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,s.BasePoint),u.prototype.jpoint=function(t,e,n){return new c(this,t,e,n)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(n,r)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(e),i=t.x.redMul(n),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(n.redMul(this.z)),a=r.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),c=f.redMul(a),h=r.redMul(f),d=u.redSqr().redIAdd(c).redISub(h).redISub(h),l=u.redMul(h.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,l,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,r=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=n.redSub(r),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),c=n.redMul(u),h=a.redSqr().redIAdd(f).redISub(c).redISub(c),d=a.redMul(c.redISub(h)).redISub(i.redMul(f)),l=this.z.redMul(s);return this.curve.jpoint(h,d,l)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,n=0;n=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,n){"use strict";var r=n(8),i=n(1),o=n(26),s=n(4);function a(t){o.call(this,"mont",t),this.a=new r(t.a,16).toRed(this.red),this.b=new r(t.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,n){o.BasePoint.call(this,t,"projective"),null===e&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(e,16),this.z=new r(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,n=e.redSqr(),r=n.redMul(e).redAdd(n.redMul(this.a)).redAdd(e);return 0===r.redSqrt().redSqr().cmp(r)},i(u,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new u(this,t,e)},a.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),n=t.redSub(e),r=t.redMul(e),i=n.redMul(e.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(n),s=i.redMul(r),a=e.z.redMul(o.redAdd(s).redSqr()),u=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(t){for(var e=t.clone(),n=this,r=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,n){"use strict";var r=n(4),i=n(8),o=n(1),s=n(26),a=r.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function f(t,e,n,r,o){s.BasePoint.call(this,t,"projective"),null===e&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(n,16),this.z=r?new i(r,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,n,r){return this.point(t,e,n,r)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr(),r=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),s=r.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(e&&!u||!e&&u)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr(),r=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),s=r.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),n=t.y.redSqr(),r=e.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(n)));return 0===r.cmp(i)},o(f,s.BasePoint),u.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},u.prototype.point=function(t,e,n,r){return new f(this,t,e,n,r)},f.fromJSON=function(t,e){return new f(t,e[0],e[1],e[2])},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=r.redAdd(e),s=o.redSub(n),a=r.redSub(e),u=i.redMul(s),f=o.redMul(a),c=i.redMul(a),h=s.redMul(o);return this.curve.point(u,f,h,c)},f.prototype._projDbl=function(){var t,e,n,r=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var s=(f=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=r.redSub(i).redSub(o).redMul(s.redSub(this.curve.two)),e=s.redMul(f.redSub(o)),n=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),u=s.redSub(a).redISub(a);t=r.redSub(i).redISub(o).redMul(u),e=s.redMul(f.redSub(o)),n=s.redMul(u)}}else{var f=i.redAdd(o);a=this.curve._mulC(this.z).redSqr(),u=f.redSub(a).redSub(a);t=this.curve._mulC(r.redISub(f)).redMul(u),e=this.curve._mulC(f).redMul(i.redISub(o)),n=f.redMul(u)}return this.curve.point(t,e,n)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),n=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),r=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=n.redSub(e),s=i.redSub(r),a=i.redAdd(r),u=n.redAdd(e),f=o.redMul(s),c=a.redMul(u),h=o.redMul(u),d=s.redMul(a);return this.curve.point(f,c,d,h)},f.prototype._projAdd=function(t){var e,n,r=this.z.redMul(t.z),i=r.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),f=i.redAdd(a),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),h=r.redMul(u).redMul(c);return this.curve.twisted?(e=r.redMul(f).redMul(s.redSub(this.curve._mulA(o))),n=u.redMul(f)):(e=r.redMul(f).redMul(s.redSub(o)),n=this.curve._mulC(u).redMul(f)),this.curve.point(h,e,n)},f.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},f.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,n){return this.curve._wnafMulAdd(1,[this,e],[t,n],2,!1)},f.prototype.jmulAdd=function(t,e,n){return this.curve._wnafMulAdd(1,[this,e],[t,n],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},f.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var n=t.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(r),0===this.x.cmp(e))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,n){"use strict";var r=n(8),i=n(124),o=n(4),s=n(40),a=n(39),u=o.assert,f=n(125),c=n(126);function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(u(s.hasOwnProperty(t),"Unknown curve "+t),t=s[t]),t instanceof s.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}t.exports=h,h.prototype.keyPair=function(t){return new f(this,t)},h.prototype.keyFromPrivate=function(t,e){return f.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return f.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),o=this.n.sub(new r(2));;){var s=new r(e.generate(n));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},h.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,n,o){"object"==typeof n&&(o=n,n=null),o||(o={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new r(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),u=t.toArray("be",s),f=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new r(1)),d=0;;d++){var l=o.k?o.k(d):new r(f.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),g=b.umod(this.n);if(0!==g.cmpn(0)){var v=l.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(v=v.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==b.cmp(g)?2:0);return o.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),m^=1),new c({r:g,s:v,recoveryParam:m})}}}}}},h.prototype.verify=function(t,e,n,i){t=this._truncateToN(new r(t,16)),n=this.keyFromPublic(n,i);var o=(e=new c(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,u=s.invm(this.n),f=u.mul(t).umod(this.n),h=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(f,n.getPublic(),h)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(f,n.getPublic(),h)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(t,e,n,i){u((3&n)===n,"The recovery param is more than two bits"),e=new c(e,i);var o=this.n,s=new r(t),a=e.r,f=e.s,h=1&n,d=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),h):this.curve.pointFromX(a,h);var l=e.r.invm(o),p=o.sub(s).mul(l).umod(o),b=f.mul(l).umod(o);return this.g.mulAdd(p,a,b)},h.prototype.getKeyRecoveryParam=function(t,e,n,r){if(null!==(e=new c(e,r)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},function(t,e,n){"use strict";var r=n(18),i=n(61),o=n(14);function s(t){if(!(this instanceof s))return new s(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=i.toArray(t.entropy,t.entropyEnc||"hex"),n=i.toArray(t.nonce,t.nonceEnc||"hex"),r=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,r)}t.exports=s,s.prototype._init=function(t,e,n){var r=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},s.prototype.generate=function(t,e,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=n,n=e,e=null),n&&(n=i.toArray(n,r||"hex"),this._update(n));for(var o=[];o.length"}},function(t,e,n){"use strict";var r=n(8),i=n(4),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new r(t.r,16),this.s=new r(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var n=t[e.place++];if(!(128&n))return n;for(var r=15&n,i=0,o=0,s=e.place;o>>3);for(t.push(128|n);--n;)t.push(e>>>(n<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var n=new a;if(48!==t[n.place++])return!1;if(u(t,n)+n.place!==t.length)return!1;if(2!==t[n.place++])return!1;var o=u(t,n),s=t.slice(n.place,o+n.place);if(n.place+=o,2!==t[n.place++])return!1;var f=u(t,n);if(t.length!==f+n.place)return!1;var c=t.slice(n.place,f+n.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new r(s),this.s=new r(c),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n)),e=f(e),n=f(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];c(r,e.length),(r=r.concat(e)).push(2),c(r,n.length);var o=r.concat(n),s=[48];return c(s,o.length),s=s.concat(o),i.encode(s,t)}},function(t,e,n){"use strict";var r=n(18),i=n(40),o=n(4),s=o.assert,a=o.parseBytes,u=n(128),f=n(129);function c(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i[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=r.sha512}t.exports=c,c.prototype.sign=function(t,e){t=a(t);var n=this.keyFromSecret(e),r=this.hashInt(n.messagePrefix(),t),i=this.g.mul(r),o=this.encodePoint(i),s=this.hashInt(o,n.pubBytes(),t).mul(n.priv()),u=r.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},c.prototype.verify=function(t,e,n){t=a(t),e=this.makeSignature(e);var r=this.keyFromPublic(n),i=this.hashInt(e.Rencoded(),r.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(r.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e0&&s.cmp(n)<0)return s}throw new Error("impossible unicorn ;)")}e.derivePrivateKey=function(t,e={}){const n=e.validator,r=o.curve.n,i=s(t);if(n)return i;const a=o.g.mul(i),u=e.accountIndex||0;return s(a.encodeCompressed(),u).add(i).mod(r)},e.accountPublicFromPublicGenerator=function(t){const e=o.curve.decodePoint(t),n=s(t,0),r=o.g.mul(n);return e.add(r).encodeCompressed()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(18),i=n(11);e.default=class{constructor(){this.hash=r.sha512()}add(t){return this.hash.update(t),this}addU32(t){return this.add([t>>>24&255,t>>>16&255,t>>>8&255,255&t])}finish(){return this.hash.digest()}first256(){return this.finish().slice(0,32)}first256BN(){return new i(this.first256())}}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});const r=n(2),i=n(18),o=n(11);e.bytesToHex=function(t){return t.map(t=>{const e=t.toString(16).toUpperCase();return e.length>1?e:`0${e}`}).join("")},e.hexToBytes=function(t){return r(t.length%2==0),new o(t,16).toArray(null,t.length/2)},e.computePublicKeyHash=function(e){const n=i.sha256().update(e).digest(),r=i.ripemd160().update(n).digest();return t.from(r)}}).call(this,n(5).Buffer)}]); \ No newline at end of file diff --git a/assets/js/domain-verifier-checker.js b/assets/js/domain-verifier-checker.js new file mode 100644 index 0000000000..0c3c01942b --- /dev/null +++ b/assets/js/domain-verifier-checker.js @@ -0,0 +1,199 @@ +//Browserify was used to create domain-verifier-bundle.js so that we can use 'require' in the browser + +const codec = require("ripple-binary-codec"); +const addressCodec = require("ripple-address-codec"); +const keyCodec = require("ripple-keypairs"); + +const TIPS = + '

    Check if the xrp-ledger.toml file is actually hosted in the /.well-known/ location at the domain in your manifest. Check your server\'s HTTPS settings and certificate, and make sure your server provides the required CORS header.

    '; +const TOML_PATH = "/.well-known/xrp-ledger.toml"; +const CLASS_GOOD = "badge badge-success"; +const CLASS_BAD = "badge badge-danger"; + +var query_param = 0; + +//This function makes the lists that output the status. +function makeLogEntry(text, raw) { + let log; + if (raw) { + log = $("
  • ") + .appendTo("#log") + .append(text); + } else { + log = $("
  • ") + .text(text + " ") + .appendTo("#log"); + } + log.resolve = function(text) { + return $("") + .html(text) + .appendTo(log); + }; + return log; +} +//3. +//Find the validator entry in the TOML file and verify the signature of the attestation. +async function parse_xrpl_toml(data, public_key_hex, public_key, message) { + let parsed; + let log1 = makeLogEntry("Parsing TOML data..."); + try { + parsed = TOML(data); + log1.resolve("SUCCESS").addClass(CLASS_GOOD); + } catch (e) { + log1.resolve(e).addClass(CLASS_BAD); + return; + } + + console.log(parsed); + + let validator_entries = parsed.VALIDATORS; + + if (validator_entries) { + if (!Array.isArray(validator_entries)) { + makeLogEntry("Validators:") + .resolve("Wrong type - should be table-array") + .addClass(CLASS_BAD); + } else { + let validator_found = false; + for (i = 0; i < validator_entries.length; i++) { + let pk = validator_entries[i]["public_key"]; + + if (pk == public_key) { + validator_found = true; + try { + var attestation = validator_entries[i]["attestation"]; + } catch { + makeLogEntry("Attestation Not found").addClass(CLASS_BAD); + } + + try { + var verify = keyCodec.verify( + ascii_to_hexa(message), + attestation, + public_key_hex + ); + } catch (e) { + makeLogEntry("Domain Verification Failed") + .resolve(e) + .addClass(CLASS_BAD); + } + + if (verify) { + makeLogEntry("Domain Verification Succeeded").addClass(CLASS_GOOD); + } else { + makeLogEntry("Domain Verification Failed").addClass(CLASS_BAD); + } + } + } + if (!validator_found) { + makeLogEntry( + "The validator key for this manifest was not found in the TOML file" + ).addClass(CLASS_BAD); + } + } + } else { + makeLogEntry("No Validators Found") + .resolve("Failure") + .addClass(CLASS_BAD); + } +} + +//2. +//Decompose the manifest to obtain the domain and public key. +//Use these to create the message that should have been signed by the validator's private key (the attestation). +//Go to the domain and verify the signature of the attestation field in the appropriate validator entry. +function parse_manifest() { + const manhex = $("#manifest").val(); + + try { + var man = codec.decode(manhex); + } catch (e) { + makeLogEntry("Error decoding manifest") + .resolve(e) + .addClass(CLASS_BAD); + return; + } + + let public_key_hex = man["PublicKey"]; + let buff = new Buffer(public_key_hex, "hex").toJSON().data; + + try { + var domain = hex_to_ascii(man["Domain"]); + } catch { + makeLogEntry("Domain not found in manifest").addClass(CLASS_BAD); + return; + } + + let public_key = addressCodec.encodeNodePublic(buff); + + //This is the message that was signed by the validator's private key. + let message = "[domain-attestation-blob:" + domain + ":" + public_key + "]"; + const url = "https://" + domain + TOML_PATH + "?v=" + query_param++; + const log = makeLogEntry("Checking " + url + "..."); + + $.ajax({ + url: url, + dataType: "text", + success: function(data) { + log.resolve("FOUND").addClass(CLASS_GOOD); + parse_xrpl_toml(data, public_key_hex, public_key, message); + }, + error: function(jqxhr, status, error) { + switch (status) { + case "timeout": + err = "TIMEOUT"; + break; + case "abort": + err = "ABORTED"; + break; + case "error": + err = "ERROR"; + break; + default: + err = "UNKNOWN"; + } + log + .resolve(err) + .addClass(CLASS_BAD) + .after(TIPS); + } + }); +} + +// Nifty hex/ascii helpers: +//https://www.w3resource.com/javascript-exercises/javascript-string-exercise-28.php +function hex_to_ascii(str1) { + var hex = str1.toString(); + var str = ""; + for (var n = 0; n < hex.length; n += 2) { + str += String.fromCharCode(parseInt(hex.substr(n, 2), 16)); + } + return str; +} + +//https://www.w3resource.com/javascript-exercises/javascript-string-exercise-27.php +function ascii_to_hexa(str) { + var arr1 = []; + for (var n = 0, l = str.length; n < l; n++) { + var hex = Number(str.charCodeAt(n)).toString(16); + arr1.push(hex); + } + return arr1.join(""); +} + +function handle_submit(event) { + event.preventDefault(); + + $(".result-title").show(); + $("#result").show(); + $("#log").empty(); + + parse_manifest(); +} + +//1. +//Start the verification process when the user enters a manifest. +$(document).ready(() => { + $("#manifest-entry").submit(handle_submit); +}); + diff --git a/tool/template-validator-domain-verifier.html b/tool/template-validator-domain-verifier.html new file mode 100644 index 0000000000..2642fb10f0 --- /dev/null +++ b/tool/template-validator-domain-verifier.html @@ -0,0 +1,33 @@ +{% extends "template-base.html" %} + +{% block main %} +
    +

    Domain Verification Checker

    + +

    This tool allows you to verify that domain verification is properly configured.

    +

    Enter the manifest found in your validator-keys.json file. Do not confuse this with your validator's secret key.

    +

    To do this with the validator-keys-tool use the following command:

    +
    $ validator-keys show_manifest hex
    +
    +
    +
    + +
    +
    +
    +
    Result
    +
      +
    +
    +
    +{% endblock %} + +{% block endbody %} + + + +{% endblock %}