>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new M;else if("p192"===t)e=new A;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new I}return v[t]=e,e},N.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},N.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},N.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},N.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},N.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)},N.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},N.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)},N.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},N.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},N.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},N.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},N.prototype.isqr=function(t){return this.imul(t,t.clone())},N.prototype.sqr=function(t){return this.mul(t,t)},N.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,o),d=this.pow(t,o.addn(1).iushrn(1)),f=this.pow(t,o),p=a;0!==f.cmp(s);){for(var y=f,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;r--){for(var c=e.words[r],l=u-1;l>=0;l--){var h=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},N.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},N.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new E(t)},r(E,N),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var 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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(sr,L);var cr=sr.exports,lr={exports:{}};
+O=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof h?e:h,o=Object.create(i.prototype),a=new I(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return E()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=b(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function d(){}function f(){}var p={};s(p,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(N([])));m&&m!==e&&n.call(m,i)&&(p=m);var g=f.prototype=h.prototype=Object.create(p);function v(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function N(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function z(t){return(z="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})(t)}function P(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function _(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){P(o,r,i,a,s,"next",t)}function s(t){P(o,r,i,a,s,"throw",t)}a(void 0)}))}}function B(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R(t,e){for(var n=0;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Z(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function J(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Z(t)}function X(t){var e=V();return function(){var n,r=W(t);if(e){var i=W(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return J(this,n)}}function K(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=W(t)););return t}function $(){return($="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=K(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}}).apply(this,arguments)}function tt(t,e){return nt(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||it(t,e)||at()}function et(t){return function(t){if(Array.isArray(t))return ot(t)}(t)||rt(t)||it(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(t){if(Array.isArray(t))return t}function rt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function it(t,e){if(t){if("string"==typeof t)return ot(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ot(t,e):void 0}}function ot(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var ut={},ct=void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},lt=[],ht=[],dt="undefined"!=typeof Uint8Array?Uint8Array:Array,ft=!1;function pt(){ft=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,n=t.length;e>18&63]+lt[i>>12&63]+lt[i>>6&63]+lt[63&i]);return o.join("")}function mt(t){var e;ft||pt();for(var n=t.length,r=n%3,i="",o=[],a=16383,s=0,u=n-r;su?u:s+a));return 1===r?(e=t[n-1],i+=lt[e>>2],i+=lt[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=lt[e>>10],i+=lt[e>>4&63],i+=lt[e<<2&63],i+="="),o.push(i),o.join("")}function gt(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,h=n?i-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)}function vt(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;t[n+f]=255&a,f+=p,a/=256,c-=8);t[n+f-p]|=128*y}var wt={}.toString,bt=Array.isArray||function(t){return"[object Array]"==wt.call(t)};Nt.TYPED_ARRAY_SUPPORT=void 0===ct.TYPED_ARRAY_SUPPORT||ct.TYPED_ARRAY_SUPPORT;var Mt=At();function At(){return Nt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function It(t,e){if(At()=At())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+At().toString(16)+" bytes");return 0|t}function St(t){return!(null==t||!t._isBuffer)}function jt(t,e){if(St(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 re(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return ie(t).length;default:if(r)return re(t).length;e=(""+e).toLowerCase(),r=!0}}function Ct(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 Ht(this,e,n);case"utf8":case"utf-8":return Wt(this,e,n);case"ascii":return Ft(this,e,n);case"latin1":case"binary":return Vt(this,e,n);case"base64":return Yt(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Gt(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function Dt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Ot(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=Nt.from(e,r)),St(e))return 0===e.length?-1:zt(t,e,n,r,i);if("number"==typeof e)return e&=255,Nt.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):zt(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function zt(t,e,n,r,i){var o,a=1,s=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;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=n;os&&(n=s-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 a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function Yt(t,e,n){return 0===e&&n===t.length?mt(t):mt(t.slice(e,n))}function Wt(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),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,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),""},Nt.prototype.compare=function(t,e,n,r,i){if(!St(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),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=t.slice(e,n),l=0;li)&&(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 Pt(this,t,e,n);case"utf8":case"utf-8":return _t(this,t,e,n);case"ascii":return Bt(this,t,e,n);case"latin1":case"binary":return Rt(this,t,e,n);case"base64":return Ut(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Qt(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Nt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ft(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 Zt(t,e,n,r,i,o){if(!St(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function Jt(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 Xt(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 Kt(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 $t(t,e,n,r,i){return i||Kt(t,0,n,4),vt(t,e,n,r,23,4),n+4}function te(t,e,n,r,i){return i||Kt(t,0,n,8),vt(t,e,n,r,52,8),n+8}Nt.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},Nt.prototype.readUInt8=function(t,e){return e||qt(t,1,this.length),this[t]},Nt.prototype.readUInt16LE=function(t,e){return e||qt(t,2,this.length),this[t]|this[t+1]<<8},Nt.prototype.readUInt16BE=function(t,e){return e||qt(t,2,this.length),this[t]<<8|this[t+1]},Nt.prototype.readUInt32LE=function(t,e){return e||qt(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Nt.prototype.readUInt32BE=function(t,e){return e||qt(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Nt.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||qt(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},Nt.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||qt(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},Nt.prototype.readInt8=function(t,e){return e||qt(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Nt.prototype.readInt16LE=function(t,e){e||qt(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},Nt.prototype.readInt16BE=function(t,e){e||qt(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},Nt.prototype.readInt32LE=function(t,e){return e||qt(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Nt.prototype.readInt32BE=function(t,e){return e||qt(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Nt.prototype.readFloatLE=function(t,e){return e||qt(t,4,this.length),gt(this,t,!0,23,4)},Nt.prototype.readFloatBE=function(t,e){return e||qt(t,4,this.length),gt(this,t,!1,23,4)},Nt.prototype.readDoubleLE=function(t,e){return e||qt(t,8,this.length),gt(this,t,!0,52,8)},Nt.prototype.readDoubleBE=function(t,e){return e||qt(t,8,this.length),gt(this,t,!1,52,8)},Nt.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||Zt(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},Nt.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||Zt(this,t,e,1,255,0),Nt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Nt.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||Zt(this,t,e,2,65535,0),Nt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Jt(this,t,e,!0),e+2},Nt.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||Zt(this,t,e,2,65535,0),Nt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Jt(this,t,e,!1),e+2},Nt.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||Zt(this,t,e,4,4294967295,0),Nt.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Xt(this,t,e,!0),e+4},Nt.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||Zt(this,t,e,4,4294967295,0),Nt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Xt(this,t,e,!1),e+4},Nt.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);Zt(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+n},Nt.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);Zt(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},Nt.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||Zt(this,t,e,1,127,-128),Nt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Nt.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||Zt(this,t,e,2,32767,-32768),Nt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Jt(this,t,e,!0),e+2},Nt.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||Zt(this,t,e,2,32767,-32768),Nt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Jt(this,t,e,!1),e+2},Nt.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||Zt(this,t,e,4,2147483647,-2147483648),Nt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Xt(this,t,e,!0),e+4},Nt.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||Zt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Nt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Xt(this,t,e,!1),e+4},Nt.prototype.writeFloatLE=function(t,e,n){return $t(this,t,e,!0,n)},Nt.prototype.writeFloatBE=function(t,e,n){return $t(this,t,e,!1,n)},Nt.prototype.writeDoubleLE=function(t,e,n){return te(this,t,e,!0,n)},Nt.prototype.writeDoubleBE=function(t,e,n){return te(this,t,e,!1,n)},Nt.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||!Nt.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(a+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 ie(t){return function(t){var e,n,r,i,o,a;ft||pt();var s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[s-2]?2:"="===t[s-1]?1:0,a=new dt(3*s/4-o),r=o>0?s-4:s;var u=0;for(e=0,n=0;e>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=ht[t.charCodeAt(e)]<<2|ht[t.charCodeAt(e+1)]>>4,a[u++]=255&i):1===o&&(i=ht[t.charCodeAt(e)]<<10|ht[t.charCodeAt(e+1)]<<4|ht[t.charCodeAt(e+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(ee,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function oe(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function ae(t){return null!=t&&(!!t._isBuffer||se(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&se(t.slice(0,0))}(t))}function se(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var ue=Object.freeze({__proto__:null,Buffer:Nt,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),Nt.alloc(+t)},isBuffer:ae,kMaxLength:Mt});function ce(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("Wrong positive integer: ".concat(t))}function le(t){return t instanceof Uint8Array||null!=t&&"object"===z(t)&&"Uint8Array"===t.constructor.name}function he(t){if(!le(t))throw new Error("Expected Uint8Array");for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&!n.includes(t.length))throw new Error("Expected Uint8Array of length ".concat(n,", not of length=").concat(t.length))}function de(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function fe(t,e){he(t);var n=e.outputLen;if(t.length>>e};if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function we(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got ".concat(z(t)));return new Uint8Array((new TextEncoder).encode(t))}function be(t){if("string"==typeof t&&(t=we(t)),!me(t))throw new Error("expected Uint8Array, got ".concat(z(t)));return t}function Me(){for(var t=0,e=0;e0&&void 0!==arguments[0]?arguments[0]:32;if(pe&&"function"==typeof pe.getRandomValues)return pe.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}var Ee=function(t){Y(n,Ae);var e=X(n);function n(t,r,i,o){var a;return B(this,n),(a=e.call(this)).blockLen=t,a.outputLen=r,a.padOffset=i,a.isLE=o,a.finished=!1,a.length=0,a.pos=0,a.destroyed=!1,a.buffer=new Uint8Array(t),a.view=ge(a.buffer),a}return U(n,[{key:"update",value:function(t){de(this);for(var e=this.view,n=this.buffer,r=this.blockLen,i=(t=be(t)).length,o=0;or-o&&(this.process(n,0),o=0);for(var a=o;a>i&o),s=Number(n&o),u=r?4:0,c=r?0:4;t.setUint32(e+u,a,r),t.setUint32(e+c,s,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);var s=ge(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");var c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(var h=0;h1&&void 0!==arguments[1]&&arguments[1];return e?{h:Number(t&xe),l:Number(t>>ke&xe)}:{h:0|Number(t>>ke&xe),l:0|Number(t&xe)}}function Le(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Uint32Array(t.length),r=new Uint32Array(t.length),i=0;i>>32-n},je=function(t,e,n){return e<>>32-n},Ce=function(t,e,n){return e<>>64-n},De=function(t,e,n){return t<>>64-n};var Oe={fromBig:Te,split:Le,toBig:function(t,e){return BigInt(t>>>0)<>>0)},shrSH:function(t,e,n){return t>>>n},shrSL:function(t,e,n){return t<<32-n|e>>>n},rotrSH:function(t,e,n){return t>>>n|e<<32-n},rotrSL:function(t,e,n){return t<<32-n|e>>>n},rotrBH:function(t,e,n){return t<<64-n|e>>>n-32},rotrBL:function(t,e,n){return t>>>n-32|e<<64-n},rotr32H:function(t,e){return e},rotr32L:function(t,e){return t},rotlSH:Se,rotlSL:je,rotlBH:Ce,rotlBL:De,add:function(t,e,n,r){var i=(e>>>0)+(r>>>0);return{h:t+n+(i/Math.pow(2,32)|0)|0,l:0|i}},add3L:function(t,e,n){return(t>>>0)+(e>>>0)+(n>>>0)},add3H:function(t,e,n,r){return e+n+r+(t/Math.pow(2,32)|0)|0},add4L:function(t,e,n,r){return(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)},add4H:function(t,e,n,r,i){return e+n+r+i+(t/Math.pow(2,32)|0)|0},add5H:function(t,e,n,r,i,o){return e+n+r+i+o+(t/Math.pow(2,32)|0)|0},add5L:function(t,e,n,r,i){return(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0)}},ze=tt(function(){return Oe.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((function(t){return BigInt(t)})))}(),2),Pe=ze[0],_e=ze[1],Be=new Uint32Array(80),Re=new Uint32Array(80),Ue=function(t){Y(n,Ee);var e=X(n);function n(){var t;return B(this,n),(t=e.call(this,128,64,16,!1)).Ah=1779033703,t.Al=-205731576,t.Bh=-1150833019,t.Bl=-2067093701,t.Ch=1013904242,t.Cl=-23791573,t.Dh=-1521486534,t.Dl=1595750129,t.Eh=1359893119,t.El=-1377402159,t.Fh=-1694144372,t.Fl=725511199,t.Gh=528734635,t.Gl=-79577749,t.Hh=1541459225,t.Hl=327033209,t}return U(n,[{key:"get",value:function(){return[this.Ah,this.Al,this.Bh,this.Bl,this.Ch,this.Cl,this.Dh,this.Dl,this.Eh,this.El,this.Fh,this.Fl,this.Gh,this.Gl,this.Hh,this.Hl]}},{key:"set",value:function(t,e,n,r,i,o,a,s,u,c,l,h,d,f,p,y){this.Ah=0|t,this.Al=0|e,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|l,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|y}},{key:"process",value:function(t,e){for(var n=0;n<16;n++,e+=4)Be[n]=t.getUint32(e),Re[n]=t.getUint32(e+=4);for(var r=16;r<80;r++){var i=0|Be[r-15],o=0|Re[r-15],a=Oe.rotrSH(i,o,1)^Oe.rotrSH(i,o,8)^Oe.shrSH(i,o,7),s=Oe.rotrSL(i,o,1)^Oe.rotrSL(i,o,8)^Oe.shrSL(i,o,7),u=0|Be[r-2],c=0|Re[r-2],l=Oe.rotrSH(u,c,19)^Oe.rotrBH(u,c,61)^Oe.shrSH(u,c,6),h=Oe.rotrSL(u,c,19)^Oe.rotrBL(u,c,61)^Oe.shrSL(u,c,6),d=Oe.add4L(s,h,Re[r-7],Re[r-16]),f=Oe.add4H(d,a,l,Be[r-7],Be[r-16]);Be[r]=0|f,Re[r]=0|d}for(var p=this.Ah,y=this.Al,m=this.Bh,g=this.Bl,v=this.Ch,w=this.Cl,b=this.Dh,M=this.Dl,A=this.Eh,I=this.El,N=this.Fh,E=this.Fl,x=this.Gh,k=this.Gl,T=this.Hh,L=this.Hl,S=0;S<80;S++){var j=Oe.rotrSH(A,I,14)^Oe.rotrSH(A,I,18)^Oe.rotrBH(A,I,41),C=Oe.rotrSL(A,I,14)^Oe.rotrSL(A,I,18)^Oe.rotrBL(A,I,41),D=A&N^~A&x,O=I&E^~I&k,z=Oe.add5L(L,C,O,_e[S],Re[S]),P=Oe.add5H(z,T,j,D,Pe[S],Be[S]),_=0|z,B=Oe.rotrSH(p,y,28)^Oe.rotrBH(p,y,34)^Oe.rotrBH(p,y,39),R=Oe.rotrSL(p,y,28)^Oe.rotrBL(p,y,34)^Oe.rotrBL(p,y,39),U=p&m^p&v^m&v,Q=y&g^y&w^g&w;T=0|x,L=0|k,x=0|N,k=0|E,N=0|A,E=0|I;var Y=Oe.add(0|b,0|M,0|P,0|_);A=Y.h,I=Y.l,b=0|v,M=0|w,v=0|m,w=0|g,m=0|p,g=0|y;var W=Oe.add3L(_,R,Q);p=Oe.add3H(W,P,B,U),y=0|W}var F=Oe.add(0|this.Ah,0|this.Al,0|p,0|y);p=F.h,y=F.l;var V=Oe.add(0|this.Bh,0|this.Bl,0|m,0|g);m=V.h,g=V.l;var H=Oe.add(0|this.Ch,0|this.Cl,0|v,0|w);v=H.h,w=H.l;var G=Oe.add(0|this.Dh,0|this.Dl,0|b,0|M);b=G.h,M=G.l;var q=Oe.add(0|this.Eh,0|this.El,0|A,0|I);A=q.h,I=q.l;var Z=Oe.add(0|this.Fh,0|this.Fl,0|N,0|E);N=Z.h,E=Z.l;var J=Oe.add(0|this.Gh,0|this.Gl,0|x,0|k);x=J.h,k=J.l;var X=Oe.add(0|this.Hh,0|this.Hl,0|T,0|L);T=X.h,L=X.l,this.set(p,y,m,g,v,w,b,M,A,I,N,E,x,k,T,L)}},{key:"roundClean",value:function(){Be.fill(0),Re.fill(0)}},{key:"destroy",value:function(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}]),n}(),Qe=Ie((function(){return new Ue})),Ye=BigInt(0),We=BigInt(1),Fe=BigInt(2);function Ve(t){return t instanceof Uint8Array||null!=t&&"object"===z(t)&&"Uint8Array"===t.constructor.name}var He=Array.from({length:256},(function(t,e){return e.toString(16).padStart(2,"0")}));function Ge(t){if(!Ve(t))throw new Error("Uint8Array expected");for(var e="",n=0;n=Je&&t<=Xe?t-Je:t>=Ke&&t<=$e?t-(Ke-10):t>=tn&&t<=en?t-(tn-10):void 0}function rn(t){if("string"!=typeof t)throw new Error("hex string expected, got "+z(t));var e=t.length,n=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);for(var r=new Uint8Array(n),i=0,o=0;i0&&void 0!==arguments[0]?arguments[0]:dn();i=s(fn([0]),t),r=s(),0!==t.length&&(i=s(fn([1]),t),r=s())},c=function(){if(o++>=1e3)throw new Error("drbg: tried 1000 values");for(var t=0,n=[];t2&&void 0!==arguments[2]?arguments[2]:{},r=function(e,n,r){var i=yn[n];if("function"!=typeof i)throw new Error('Invalid validator "'.concat(n,'", expected function'));var o=t[e];if(!(r&&void 0===o||i(o,t)))throw new Error("Invalid param ".concat(String(e),"=").concat(o," (").concat(z(o),"), expected ").concat(n))},i=0,o=Object.entries(e);iYe;t>>=We,e+=1);return e},bitGet:function(t,e){return t>>BigInt(e)&We},bitSet:function(t,e,n){return t|(n?We:Ye)<=vn?n:e+n}function xn(t,e,n){if(n<=vn||e 0");if(n===wn)return vn;for(var r=wn;e>vn;)e&wn&&(r=r*t%n),t=t*t%n,e>>=wn;return r}function kn(t,e,n){for(var r=t;e-- >vn;)r*=r,r%=n;return r}function Tn(t,e){if(t===vn||e<=vn)throw new Error("invert: expected positive integers, got n=".concat(t," mod=").concat(e));for(var n=En(t,e),r=e,i=vn,o=wn;n!==vn;){var a=r%n,s=i-o*(r/n);r=n,n=a,i=o,o=s}if(r!==wn)throw new Error("invert: does not exist");return En(i,e)}function Ln(t){if(t%An===Mn){var e=(t+wn)/An;return function(t,n){var r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}if(t%Nn===In){var n=(t-In)/Nn;return function(t,e){var r=t.mul(e,bn),i=t.pow(r,n),o=t.mul(e,i),a=t.mul(t.mul(o,bn),i),s=t.mul(o,t.sub(a,t.ONE));if(!t.eql(t.sqr(s),e))throw new Error("Cannot find square root");return s}}return function(t){var e,n,r,i=(t-wn)/bn;for(e=t-wn,n=0;e%bn===vn;e/=bn,n++);for(r=bn;r 0");if(n===vn)return t.ONE;if(n===wn)return e;for(var r=t.ONE,i=e;n>vn;)n&wn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=wn;return r}function Cn(t,e){var n=new Array(e.length),r=e.reduce((function(e,r,i){return t.is0(r)?e:(n[i]=e,t.mul(e,r))}),t.ONE),i=t.inv(r);return e.reduceRight((function(e,r,i){return t.is0(r)?e:(n[i]=t.mul(e,n[i]),t.mul(e,r))}),i),n}function Dn(t,e){var n=void 0!==e?e:t.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function On(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(t<=vn)throw new Error("Expected Field ORDER > 0, got ".concat(t));var i=Dn(t,e),o=i.nBitLength,a=i.nByteLength;if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");var s=Ln(t),u=Object.freeze({ORDER:t,BITS:o,BYTES:a,MASK:hn(o),ZERO:vn,ONE:wn,create:function(e){return En(e,t)},isValid:function(e){if("bigint"!=typeof e)throw new Error("Invalid field element: expected bigint, got ".concat(z(e)));return vn<=e&&e_n;)n&Bn&&(r=r.add(i)),i=i.double(),n>>=Bn;return r},precomputeWindow:function(t,e){for(var n=r(e),i=n.windows,o=n.windowSize,a=[],s=t,u=s,c=0;c>=f,m>u&&(m-=d,o+=Bn);var g=y,v=y+Math.abs(m)-1,w=p%2!=0,b=m<0;0===m?l=l.add(n(w,i[g])):c=c.add(n(b,i[v]))}return{p:c,f:l}},wNAFCached:function(t,e,n,r){var i=t._WINDOW_SIZE||1,o=e.get(t);return o||(o=this.precomputeWindow(t,i),1!==i&&e.set(t,r(o))),this.wNAF(i,o,n)}}}function Un(t){return mn(t.Fp,Sn.reduce((function(t,e){return t[e]="function",t}),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),mn(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze(D(D(D({},Dn(t.n,t.nBitLength)),t),{p:t.Fp.ORDER}))}var Qn=BigInt(0),Yn=BigInt(1),Wn=BigInt(2),Fn=BigInt(8),Vn={zip215:!0};function Hn(t){var e,n,r=(n=Un(e=t),mn(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze(D({},n))),i=r.Fp,o=r.n,a=r.prehash,s=r.hash,u=r.randomBytes,c=r.nByteLength,l=r.h,h=Wn<1&&void 0!==arguments[1]&&arguments[1],o=r.d,a=r.a,s=i.BYTES,u=(e=cn("pointHex",e,s)).slice(),c=e[s-1];u[s-1]=-129&c;var l=an(u);l===Qn||w(l,n?h:i.ORDER);var p=d(l*l),y=d(p-Yn),m=d(o*p-a),g=f(y,m),v=g.isValid,b=g.value;if(!v)throw new Error("Point.fromHex: invalid y coordinate");var M=(b&Yn)===Yn,A=0!=(128&c);if(!n&&b===Qn&&A)throw new Error("Point.fromHex: x=0 and x_0=1");return A!==M&&(b=d(-b)),t.fromAffine({x:b,y:l})}},{key:"fromPrivateKey",value:function(t){return L(t).point}}]),t}();I.BASE=new I(r.Gx,r.Gy,Yn,d(r.Gx*r.Gy)),I.ZERO=new I(Qn,Yn,Yn,Qn);var N=I.BASE,E=I.ZERO,x=Rn(I,8*c);function k(t){return En(t,o)}function T(t){return k(an(t))}function L(t){var e=c;t=cn("private key",t,e);var n=cn("hashed private key",s(t),2*e),r=p(n.slice(0,e)),i=n.slice(e,2*e),o=T(r),a=N.multiply(o),u=a.toRawBytes();return{head:r,prefix:i,scalar:o,point:a,pointBytes:u}}function S(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array,e=arguments.length,n=new Array(e>1?e-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:{};t=cn("message",t),a&&(t=a(t));var r=L(e),o=r.prefix,s=r.scalar,u=r.pointBytes,l=S(n.context,o,t),h=N.multiply(l).toRawBytes(),d=S(n.context,h,u,t),f=k(l+d*s);b(f);var p=ln(h,un(f,i.BYTES));return cn("result",p,2*c)},verify:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:j,o=r.context,s=r.zip215,u=i.BYTES;t=cn("signature",t,2*u),e=cn("message",e),a&&(e=a(e));var c,l,h,d=an(t.slice(u,2*u));try{c=I.fromHex(n,s),l=I.fromHex(t.slice(0,u),s),h=N.multiplyUnsafe(d)}catch(t){return!1}if(!s&&c.isSmallOrder())return!1;var f=S(o,l.toRawBytes(),c.toRawBytes(),e),p=l.add(c.multiplyUnsafe(f));return p.subtract(h).clearCofactor().equals(I.ZERO)},ExtendedPoint:I,utils:{getExtendedPublicKey:L,randomPrivateKey:function(){return u(i.BYTES)},precompute:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.BASE;return e._setWindowSize(t),e.multiply(BigInt(3)),e}}}}var Gn=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),qn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);var Zn=BigInt(1),Jn=BigInt(2),Xn=BigInt(5),Kn=BigInt(10),$n=BigInt(20),tr=BigInt(40),er=BigInt(80);var nr=On(Gn,void 0,!0),rr={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:nr,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Qe,randomBytes:Ne,adjustScalarBytes:function(t){return t[0]&=248,t[31]&=127,t[31]|=64,t},uvRatio:function(t,e){var n=Gn,r=En(e*e*e,n),i=En(r*r*e,n),o=En(t*r*function(t){var e=Gn,n=t*t%e*t%e,r=kn(n,Jn,e)*n%e,i=kn(r,Zn,e)*t%e,o=kn(i,Xn,e)*i%e,a=kn(o,Kn,e)*o%e,s=kn(a,$n,e)*a%e,u=kn(s,tr,e)*s%e,c=kn(u,er,e)*u%e,l=kn(c,er,e)*u%e,h=kn(l,Kn,e)*o%e;return{pow_p_5_8:kn(h,Jn,e)*t%e,b2:n}}(t*i).pow_p_5_8,n),a=En(e*o*o,n),s=o,u=En(o*qn,n),c=a===t,l=a===En(-t,n),h=a===En(-t*qn,n);return c&&(o=s),(l||h)&&(o=u),(En(o,n)&wn)===wn&&(o=En(-o,n)),{isValid:c||l,value:o}}},ir=Hn(rr);function or(t,e,n){if(e.length>255)throw new Error("Context is too big");return Me(we("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,e.length]),e,t)}D(D({},rr),{},{domain:or}),D(D({},rr),{},{domain:or,prehash:Qe});var ar=(nr.ORDER+BigInt(3))/BigInt(8);nr.pow(Jn,ar),nr.sqrt(nr.neg(nr.ONE)),nr.ORDER,BigInt(5),BigInt(8),BigInt(486662),function(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");var n=t.sqrt(e);t.isOdd(n)&&t.neg(n)}(nr,nr.neg(BigInt(486664))),BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var sr={exports:{}},ur=j(ue);!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.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 o;"object"===z(t)?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:ur.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function s(t,e,n){var r=a(t,n);return n-1>=e&&(r|=a(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"===z(t))return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)i=s(t,e,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.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,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}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],f=[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 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],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,h=67108863&u,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;l+=(a=(i=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&a}n.words[c]=0|h,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modrn(l).toString(t);r=(p=p.idivn(l)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},i.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=a>>>24,o+=2)}if(n=0&&(t[n--]=a>>8&255),n>=0&&(t[n--]=a>>16&255),6===o?(n>=0&&(t[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.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},i.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},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.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)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.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)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|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)},i.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,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,f=0|a[1],p=8191&f,y=f>>>13,m=0|a[2],g=8191&m,v=m>>>13,w=0|a[3],b=8191&w,M=w>>>13,A=0|a[4],I=8191&A,N=A>>>13,E=0|a[5],x=8191&E,k=E>>>13,T=0|a[6],L=8191&T,S=T>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,P=O>>>13,_=0|a[9],B=8191&_,R=_>>>13,U=0|s[0],Q=8191&U,Y=U>>>13,W=0|s[1],F=8191&W,V=W>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,tt=K>>>13,et=0|s[5],nt=8191&et,rt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,lt=0|s[8],ht=8191<,dt=lt>>>13,ft=0|s[9],pt=8191&ft,yt=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(c+(r=Math.imul(h,Q))|0)+((8191&(i=(i=Math.imul(h,Y))+Math.imul(d,Q)|0))<<13)|0;c=((o=Math.imul(d,Y))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,Q),i=(i=Math.imul(p,Y))+Math.imul(y,Q)|0,o=Math.imul(y,Y);var gt=(c+(r=r+Math.imul(h,F)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,F)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(g,Q),i=(i=Math.imul(g,Y))+Math.imul(v,Q)|0,o=Math.imul(v,Y),r=r+Math.imul(p,F)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var vt=(c+(r=r+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(b,Q),i=(i=Math.imul(b,Y))+Math.imul(M,Q)|0,o=Math.imul(M,Y),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var wt=(c+(r=r+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,Q),i=(i=Math.imul(I,Y))+Math.imul(N,Q)|0,o=Math.imul(N,Y),r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var bt=(c+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(x,Q),i=(i=Math.imul(x,Y))+Math.imul(k,Q)|0,o=Math.imul(k,Y),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(N,F)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0;var Mt=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,Y))+Math.imul(S,Q)|0,o=Math.imul(S,Y),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(y,nt)|0,o=o+Math.imul(y,rt)|0;var At=(c+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(C,Q),i=(i=Math.imul(C,Y))+Math.imul(D,Q)|0,o=Math.imul(D,Y),r=r+Math.imul(L,F)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(g,nt)|0,i=(i=i+Math.imul(g,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0;var It=(c+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(z,Q),i=(i=Math.imul(z,Y))+Math.imul(P,Q)|0,o=Math.imul(P,Y),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(L,G)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(b,nt)|0,i=(i=i+Math.imul(b,rt)|0)+Math.imul(M,nt)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0;var Nt=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(B,Q),i=(i=Math.imul(B,Y))+Math.imul(R,Q)|0,o=Math.imul(R,Y),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(P,F)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(L,J)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(N,nt)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,dt)|0;var Et=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,yt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(R,F)|0,o=Math.imul(R,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,r=r+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var xt=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,q))+Math.imul(R,G)|0,o=Math.imul(R,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(L,nt)|0,i=(i=i+Math.imul(L,rt)|0)+Math.imul(S,nt)|0,o=o+Math.imul(S,rt)|0,r=r+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,r=r+Math.imul(b,ht)|0,i=(i=i+Math.imul(b,dt)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,dt)|0;var kt=(c+(r=r+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,yt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,X))+Math.imul(R,J)|0,o=Math.imul(R,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(C,nt)|0,i=(i=i+Math.imul(C,rt)|0)+Math.imul(D,nt)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,r=r+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,r=r+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var Tt=(c+(r=r+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,yt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,tt))+Math.imul(R,$)|0,o=Math.imul(R,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(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,dt)|0;var Lt=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(B,nt),i=(i=Math.imul(B,rt))+Math.imul(R,nt)|0,o=Math.imul(R,rt),r=r+Math.imul(z,ot)|0,i=(i=i+Math.imul(z,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,dt)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,dt)|0;var St=(c+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,yt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,yt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(B,ot),i=(i=Math.imul(B,at))+Math.imul(R,ot)|0,o=Math.imul(R,at),r=r+Math.imul(z,ut)|0,i=(i=i+Math.imul(z,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,r=r+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,dt)|0;var jt=(c+(r=r+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,yt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ut),i=(i=Math.imul(B,ct))+Math.imul(R,ut)|0,o=Math.imul(R,ct),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 Ct=(c+(r=r+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,yt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,yt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(R,ht)|0,o=Math.imul(R,dt);var Dt=(c+(r=r+Math.imul(z,pt)|0)|0)+((8191&(i=(i=i+Math.imul(z,yt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,yt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var Ot=(c+(r=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,yt))+Math.imul(R,pt)|0))<<13)|0;return c=((o=Math.imul(R,yt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=mt,u[1]=gt,u[2]=vt,u[3]=wt,u[4]=bt,u[5]=Mt,u[6]=At,u[7]=It,u[8]=Nt,u[9]=Et,u[10]=xt,u[11]=kt,u[12]=Tt,u[13]=Lt,u[14]=St,u[15]=jt,u[16]=Ct,u[17]=Dt,u[18]=Ot,0!==c&&(u[19]=c,n.length++),n};function m(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,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(t,e,n){return m(t,e,n)}Math.imul||(y=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):n<63?p(this,t,e):n<1024?m(this,t,e):g(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),g(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.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 i(1);for(var n=this,r=0;r=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,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,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,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},i.prototype.isubn=function(t){if(n("number"==typeof t),n(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+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==e){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var d=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(o,d,h);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=d)}return s&&s._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(o=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:o,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,a,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.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)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s),a.isub(u)):(r.isub(e),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(o=0===e.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(t),o},i.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)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(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},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new N(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function N(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){N.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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 i(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):void 0!==n.strip?n.strip():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)},r(b,w),b.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.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},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new M;else if("p192"===t)e=new A;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new I}return v[t]=e,e},N.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},N.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},N.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},N.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},N.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)},N.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},N.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)},N.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},N.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},N.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},N.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},N.prototype.isqr=function(t){return this.imul(t,t.clone())},N.prototype.sqr=function(t){return this.mul(t,t)},N.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,o),d=this.pow(t,o.addn(1).iushrn(1)),f=this.pow(t,o),p=a;0!==f.cmp(s);){for(var y=f,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;r--){for(var c=e.words[r],l=u-1;l>=0;l--){var h=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},N.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},N.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new E(t)},r(E,N),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var 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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(sr,L);var cr=sr.exports,lr={exports:{}};
/*! safe-buffer. MIT License. Feross Aboukhadijeh */
-!function(t,e){var n=ur,r=n.Buffer;function i(t,e){for(var n in t)e[n]=t[n]}function o(t,e,n){return r(t,e,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=o),o.prototype=Object.create(r.prototype),i(r,o),o.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return r(t,e,n)},o.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=r(t);return void 0!==e?"string"==typeof n?i.fill(e,n):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}}(lr,lr.exports);var hr=lr.exports.Buffer;var dr=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n>>0,c=new Uint8Array(o);t[n];){var l=e[t.charCodeAt(n)];if(255===l)return;for(var h=0,d=o-1;(0!==l||h>>0,c[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=h,n++}for(var f=o-i;f!==o&&0===c[f];)f++;var p=hr.allocUnsafe(r+(o-f));p.fill(0,0,r);for(var y=r;f!==o;)p[y++]=c[f++];return p}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=hr.from(e)),!hr.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var n=0,r=0,i=0,o=e.length;i!==o&&0===e[i];)i++,n++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var h=e[i],d=0,f=u-1;(0!==h||d>>0,l[f]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");r=d,i++}for(var p=u-r;p!==u&&0===l[p];)p++;for(var y=s.repeat(n);p>>3,s=ve(o,17)^ve(o,19)^o>>>10;mr[r]=s+mr[r-7]+a+mr[r-16]|0}for(var u,c=this.A,l=this.B,h=this.C,d=this.D,f=this.E,p=this.F,y=this.G,m=this.H,g=0;g<64;g++){var v=m+(ve(f,6)^ve(f,11)^ve(f,25))+((u=f)&p^~u&y)+pr[g]+mr[g]|0,w=(ve(c,2)^ve(c,13)^ve(c,22))+fr(c,l,h)|0;m=y,y=p,p=f,f=d+v|0,d=h,h=l,l=c,c=v+w|0}c=c+this.A|0,l=l+this.B|0,h=h+this.C|0,d=d+this.D|0,f=f+this.E|0,p=p+this.F|0,y=y+this.G|0,m=m+this.H|0,this.set(c,l,h,d,f,p,y,m)}},{key:"roundClean",value:function(){mr.fill(0)}},{key:"destroy",value:function(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}]),n}(),vr=Ie((function(){return new gr})),wr={},br={exports:{}};!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.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 o;"object"===z(t)?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:ur.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function s(t,e,n){var r=a(t,n);return n-1>=e&&(r|=a(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"===z(t))return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)i=s(t,e,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.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,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}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],f=[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 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],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,h=67108863&u,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;l+=(a=(i=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&a}n.words[c]=0|h,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modrn(l).toString(t);r=(p=p.idivn(l)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},i.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=a>>>24,o+=2)}if(n=0&&(t[n--]=a>>8&255),n>=0&&(t[n--]=a>>16&255),6===o?(n>=0&&(t[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.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},i.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},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.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)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.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)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|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)},i.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,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,f=0|a[1],p=8191&f,y=f>>>13,m=0|a[2],g=8191&m,v=m>>>13,w=0|a[3],b=8191&w,M=w>>>13,A=0|a[4],I=8191&A,N=A>>>13,E=0|a[5],x=8191&E,k=E>>>13,T=0|a[6],L=8191&T,S=T>>>13,j=0|a[7],D=8191&j,C=j>>>13,O=0|a[8],z=8191&O,P=O>>>13,_=0|a[9],B=8191&_,R=_>>>13,U=0|s[0],Q=8191&U,Y=U>>>13,W=0|s[1],F=8191&W,V=W>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,tt=K>>>13,et=0|s[5],nt=8191&et,rt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,lt=0|s[8],ht=8191<,dt=lt>>>13,ft=0|s[9],pt=8191&ft,yt=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(c+(r=Math.imul(h,Q))|0)+((8191&(i=(i=Math.imul(h,Y))+Math.imul(d,Q)|0))<<13)|0;c=((o=Math.imul(d,Y))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,Q),i=(i=Math.imul(p,Y))+Math.imul(y,Q)|0,o=Math.imul(y,Y);var gt=(c+(r=r+Math.imul(h,F)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,F)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(g,Q),i=(i=Math.imul(g,Y))+Math.imul(v,Q)|0,o=Math.imul(v,Y),r=r+Math.imul(p,F)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var vt=(c+(r=r+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(b,Q),i=(i=Math.imul(b,Y))+Math.imul(M,Q)|0,o=Math.imul(M,Y),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var wt=(c+(r=r+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,Q),i=(i=Math.imul(I,Y))+Math.imul(N,Q)|0,o=Math.imul(N,Y),r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var bt=(c+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(x,Q),i=(i=Math.imul(x,Y))+Math.imul(k,Q)|0,o=Math.imul(k,Y),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(N,F)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0;var Mt=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,Y))+Math.imul(S,Q)|0,o=Math.imul(S,Y),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(y,nt)|0,o=o+Math.imul(y,rt)|0;var At=(c+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(D,Q),i=(i=Math.imul(D,Y))+Math.imul(C,Q)|0,o=Math.imul(C,Y),r=r+Math.imul(L,F)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(g,nt)|0,i=(i=i+Math.imul(g,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0;var It=(c+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(z,Q),i=(i=Math.imul(z,Y))+Math.imul(P,Q)|0,o=Math.imul(P,Y),r=r+Math.imul(D,F)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(C,F)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(L,G)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(b,nt)|0,i=(i=i+Math.imul(b,rt)|0)+Math.imul(M,nt)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0;var Nt=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(B,Q),i=(i=Math.imul(B,Y))+Math.imul(R,Q)|0,o=Math.imul(R,Y),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(P,F)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(D,G)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,q)|0,r=r+Math.imul(L,J)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(N,nt)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,dt)|0;var Et=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,yt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(R,F)|0,o=Math.imul(R,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,q)|0,r=r+Math.imul(D,J)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,X)|0,r=r+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,r=r+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var xt=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,q))+Math.imul(R,G)|0,o=Math.imul(R,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(L,nt)|0,i=(i=i+Math.imul(L,rt)|0)+Math.imul(S,nt)|0,o=o+Math.imul(S,rt)|0,r=r+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,r=r+Math.imul(b,ht)|0,i=(i=i+Math.imul(b,dt)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,dt)|0;var kt=(c+(r=r+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,yt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,X))+Math.imul(R,J)|0,o=Math.imul(R,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(D,nt)|0,i=(i=i+Math.imul(D,rt)|0)+Math.imul(C,nt)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,r=r+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,r=r+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var Tt=(c+(r=r+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,yt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,tt))+Math.imul(R,$)|0,o=Math.imul(R,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(D,ot)|0,i=(i=i+Math.imul(D,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,r=r+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,dt)|0;var Lt=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(B,nt),i=(i=Math.imul(B,rt))+Math.imul(R,nt)|0,o=Math.imul(R,rt),r=r+Math.imul(z,ot)|0,i=(i=i+Math.imul(z,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,r=r+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,dt)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,dt)|0;var St=(c+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,yt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,yt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(B,ot),i=(i=Math.imul(B,at))+Math.imul(R,ot)|0,o=Math.imul(R,at),r=r+Math.imul(z,ut)|0,i=(i=i+Math.imul(z,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,r=r+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,dt)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,dt)|0;var jt=(c+(r=r+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,yt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ut),i=(i=Math.imul(B,ct))+Math.imul(R,ut)|0,o=Math.imul(R,ct),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 Dt=(c+(r=r+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,yt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,yt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(R,ht)|0,o=Math.imul(R,dt);var Ct=(c+(r=r+Math.imul(z,pt)|0)|0)+((8191&(i=(i=i+Math.imul(z,yt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,yt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Ot=(c+(r=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,yt))+Math.imul(R,pt)|0))<<13)|0;return c=((o=Math.imul(R,yt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=mt,u[1]=gt,u[2]=vt,u[3]=wt,u[4]=bt,u[5]=Mt,u[6]=At,u[7]=It,u[8]=Nt,u[9]=Et,u[10]=xt,u[11]=kt,u[12]=Tt,u[13]=Lt,u[14]=St,u[15]=jt,u[16]=Dt,u[17]=Ct,u[18]=Ot,0!==c&&(u[19]=c,n.length++),n};function m(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,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(t,e,n){return m(t,e,n)}Math.imul||(y=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):n<63?p(this,t,e):n<1024?m(this,t,e):g(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),g(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.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 i(1);for(var n=this,r=0;r=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,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,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<