UNPKG

git-rest-wrapper

Version:

A "universal" / normalized API wrapper for common git hosting services.

10 lines 2.34 MB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gitrest=e():t.gitrest=e()}(this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=113)}([function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},function(t,e,n){ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ var i=n(4),r=i.Buffer;function l(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=i:(l(i,e),e.Buffer=o),o.prototype=Object.create(r.prototype),l(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 i.SlowBuffer(t)}},function(t,e){var n,i,r=t.exports={};function l(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===l||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:l}catch(t){n=l}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var u,s=[],c=!1,p=-1;function h(){c&&u&&(c=!1,u.length?s=u.concat(s):p=-1,s.length&&f())}function f(){if(!c){var t=a(h);c=!0;for(var e=s.length;e;){for(u=s,s=[];++p<e;)u&&u[p].run();p=-1,e=s.length}u=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function _(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new d(t,e)),1!==s.length||c||a(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=_,r.addListener=_,r.once=_,r.off=_,r.removeListener=_,r.removeAllListeners=_,r.emit=_,r.prependListener=_,r.prependOnceListener=_,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){(function(t){!function(t,e){"use strict";function i(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 l(t,e,n){if(l.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"==typeof t?t.exports=l:e.BN=l,l.BN=l,l.wordSize=26;try{o=n(162).Buffer}catch(t){}function a(t,e,n){for(var i=0,r=Math.min(t.length,n),l=e;l<r;l++){var o=t.charCodeAt(l)-48;i<<=4,i|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return i}function u(t,e,n,i){for(var r=0,l=Math.min(t.length,n),o=e;o<l;o++){var a=t.charCodeAt(o)-48;r*=i,r+=a>=49?a-49+10:a>=17?a-17+10:a}return r}l.isBN=function(t){return t instanceof l||null!==t&&"object"==typeof t&&t.constructor.wordSize===l.wordSize&&Array.isArray(t.words)},l.max=function(t,e){return t.cmp(e)>0?t:e},l.min=function(t,e){return t.cmp(e)<0?t:e},l.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},l.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},l.prototype._initArray=function(t,e,n){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var l,o,a=0;if("be"===n)for(r=t.length-1,l=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[l]|=o<<a&67108863,this.words[l+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,l++);else if("le"===n)for(r=0,l=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[l]|=o<<a&67108863,this.words[l+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,l++);return this.strip()},l.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,r,l=0;for(n=t.length-6,i=0;n>=e;n-=6)r=a(t,n,n+6),this.words[i]|=r<<l&67108863,this.words[i+1]|=r>>>26-l&4194303,(l+=24)>=26&&(l-=26,i++);n+6!==e&&(r=a(t,e,n+6),this.words[i]|=r<<l&67108863,this.words[i+1]|=r>>>26-l&4194303),this.strip()},l.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var i=0,r=1;r<=67108863;r*=e)i++;i--,r=r/e|0;for(var l=t.length-n,o=l%i,a=Math.min(l,l-o)+n,s=0,c=n;c<a;c+=i)s=u(t,c,c+i,e),this.imuln(r),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==o){var p=1;for(s=u(t,c,t.length,e),c=0;c<o;c++)p*=e;this.imuln(p),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}},l.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},l.prototype.clone=function(){var t=new l(null);return this.copy(t),t},l.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},l.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},l.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},l.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,n){n.negative=e.negative^t.negative;var i=t.length+e.length|0;n.length=i,i=i-1|0;var r=0|t.words[0],l=0|e.words[0],o=r*l,a=67108863&o,u=o/67108864|0;n.words[0]=a;for(var s=1;s<i;s++){for(var c=u>>>26,p=67108863&u,h=Math.min(s,e.length-1),f=Math.max(0,s-t.length+1);f<=h;f++){var d=s-f|0;c+=(o=(r=0|t.words[d])*(l=0|e.words[f])+p)/67108864|0,p=67108863&o}n.words[s]=0|p,u=0|c}return 0!==u?n.words[s]=0|u:n.length--,n.strip()}l.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var r=0,l=0,o=0;o<this.length;o++){var a=this.words[o],u=(16777215&(a<<r|l)).toString(16);n=0!==(l=a>>>24-r&16777215)||o!==this.length-1?s[6-u.length]+u+n:u+n,(r+=2)>=26&&(r-=26,o--)}for(0!==l&&(n=l.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],f=p[t];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var _=d.modn(f).toString(t);n=(d=d.idivn(f)).isZero()?_+n:s[h-_.length]+_+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},l.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},l.prototype.toJSON=function(){return this.toString(16)},l.prototype.toBuffer=function(t,e){return i(void 0!==o),this.toArrayLike(o,t,e)},l.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},l.prototype.toArrayLike=function(t,e,n){var r=this.byteLength(),l=n||Math.max(1,r);i(r<=l,"byte array longer than desired length"),i(l>0,"Requested array length <= 0"),this.strip();var o,a,u="le"===e,s=new t(l),c=this.clone();if(u){for(a=0;!c.isZero();a++)o=c.andln(255),c.iushrn(8),s[a]=o;for(;a<l;a++)s[a]=0}else{for(a=0;a<l-r;a++)s[a]=0;for(a=0;!c.isZero();a++)o=c.andln(255),c.iushrn(8),s[l-a-1]=o}return s},Math.clz32?l.prototype._countBits=function(t){return 32-Math.clz32(t)}:l.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},l.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},l.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},l.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},l.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},l.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},l.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},l.prototype.isNeg=function(){return 0!==this.negative},l.prototype.neg=function(){return this.clone().ineg()},l.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},l.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},l.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},l.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},l.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},l.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this.strip()},l.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},l.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},l.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},l.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var i=0;i<n.length;i++)this.words[i]=e.words[i]^n.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},l.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},l.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},l.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},l.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return n>0&&(this.words[r]=~this.words[r]&67108863>>26-n),this.strip()},l.prototype.notn=function(t){return this.clone().inotn(t)},l.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var n=t/26|0,r=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<r:this.words[n]&~(1<<r),this.strip()},l.prototype.iadd=function(t){var e,n,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,i=t):(n=t,i=this);for(var r=0,l=0;l<i.length;l++)e=(0|n.words[l])+(0|i.words[l])+r,this.words[l]=67108863&e,r=e>>>26;for(;0!==r&&l<n.length;l++)e=(0|n.words[l])+r,this.words[l]=67108863&e,r=e>>>26;if(this.length=n.length,0!==r)this.words[this.length]=r,this.length++;else if(n!==this)for(;l<n.length;l++)this.words[l]=n.words[l];return this},l.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},l.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,i,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(n=this,i=t):(n=t,i=this);for(var l=0,o=0;o<i.length;o++)l=(e=(0|n.words[o])-(0|i.words[o])+l)>>26,this.words[o]=67108863&e;for(;0!==l&&o<n.length;o++)l=(e=(0|n.words[o])+l)>>26,this.words[o]=67108863&e;if(0===l&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this.strip()},l.prototype.sub=function(t){return this.clone().isub(t)};var f=function(t,e,n){var i,r,l,o=t.words,a=e.words,u=n.words,s=0,c=0|o[0],p=8191&c,h=c>>>13,f=0|o[1],d=8191&f,_=f>>>13,y=0|o[2],m=8191&y,v=y>>>13,$=0|o[3],b=8191&$,g=$>>>13,w=0|o[4],k=8191&w,x=w>>>13,S=0|o[5],C=8191&S,E=S>>>13,j=0|o[6],z=8191&j,R=j>>>13,O=0|o[7],P=8191&O,T=O>>>13,N=0|o[8],M=8191&N,I=N>>>13,A=0|o[9],q=8191&A,L=A>>>13,U=0|a[0],B=8191&U,D=U>>>13,F=0|a[1],H=8191&F,K=F>>>13,V=0|a[2],W=8191&V,J=V>>>13,G=0|a[3],Y=8191&G,Z=G>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],nt=8191&et,it=et>>>13,rt=0|a[6],lt=8191&rt,ot=rt>>>13,at=0|a[7],ut=8191&at,st=at>>>13,ct=0|a[8],pt=8191&ct,ht=ct>>>13,ft=0|a[9],dt=8191&ft,_t=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var yt=(s+(i=Math.imul(p,B))|0)+((8191&(r=(r=Math.imul(p,D))+Math.imul(h,B)|0))<<13)|0;s=((l=Math.imul(h,D))+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(d,B),r=(r=Math.imul(d,D))+Math.imul(_,B)|0,l=Math.imul(_,D);var mt=(s+(i=i+Math.imul(p,H)|0)|0)+((8191&(r=(r=r+Math.imul(p,K)|0)+Math.imul(h,H)|0))<<13)|0;s=((l=l+Math.imul(h,K)|0)+(r>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,B),r=(r=Math.imul(m,D))+Math.imul(v,B)|0,l=Math.imul(v,D),i=i+Math.imul(d,H)|0,r=(r=r+Math.imul(d,K)|0)+Math.imul(_,H)|0,l=l+Math.imul(_,K)|0;var vt=(s+(i=i+Math.imul(p,W)|0)|0)+((8191&(r=(r=r+Math.imul(p,J)|0)+Math.imul(h,W)|0))<<13)|0;s=((l=l+Math.imul(h,J)|0)+(r>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(b,B),r=(r=Math.imul(b,D))+Math.imul(g,B)|0,l=Math.imul(g,D),i=i+Math.imul(m,H)|0,r=(r=r+Math.imul(m,K)|0)+Math.imul(v,H)|0,l=l+Math.imul(v,K)|0,i=i+Math.imul(d,W)|0,r=(r=r+Math.imul(d,J)|0)+Math.imul(_,W)|0,l=l+Math.imul(_,J)|0;var $t=(s+(i=i+Math.imul(p,Y)|0)|0)+((8191&(r=(r=r+Math.imul(p,Z)|0)+Math.imul(h,Y)|0))<<13)|0;s=((l=l+Math.imul(h,Z)|0)+(r>>>13)|0)+($t>>>26)|0,$t&=67108863,i=Math.imul(k,B),r=(r=Math.imul(k,D))+Math.imul(x,B)|0,l=Math.imul(x,D),i=i+Math.imul(b,H)|0,r=(r=r+Math.imul(b,K)|0)+Math.imul(g,H)|0,l=l+Math.imul(g,K)|0,i=i+Math.imul(m,W)|0,r=(r=r+Math.imul(m,J)|0)+Math.imul(v,W)|0,l=l+Math.imul(v,J)|0,i=i+Math.imul(d,Y)|0,r=(r=r+Math.imul(d,Z)|0)+Math.imul(_,Y)|0,l=l+Math.imul(_,Z)|0;var bt=(s+(i=i+Math.imul(p,Q)|0)|0)+((8191&(r=(r=r+Math.imul(p,tt)|0)+Math.imul(h,Q)|0))<<13)|0;s=((l=l+Math.imul(h,tt)|0)+(r>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(C,B),r=(r=Math.imul(C,D))+Math.imul(E,B)|0,l=Math.imul(E,D),i=i+Math.imul(k,H)|0,r=(r=r+Math.imul(k,K)|0)+Math.imul(x,H)|0,l=l+Math.imul(x,K)|0,i=i+Math.imul(b,W)|0,r=(r=r+Math.imul(b,J)|0)+Math.imul(g,W)|0,l=l+Math.imul(g,J)|0,i=i+Math.imul(m,Y)|0,r=(r=r+Math.imul(m,Z)|0)+Math.imul(v,Y)|0,l=l+Math.imul(v,Z)|0,i=i+Math.imul(d,Q)|0,r=(r=r+Math.imul(d,tt)|0)+Math.imul(_,Q)|0,l=l+Math.imul(_,tt)|0;var gt=(s+(i=i+Math.imul(p,nt)|0)|0)+((8191&(r=(r=r+Math.imul(p,it)|0)+Math.imul(h,nt)|0))<<13)|0;s=((l=l+Math.imul(h,it)|0)+(r>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(z,B),r=(r=Math.imul(z,D))+Math.imul(R,B)|0,l=Math.imul(R,D),i=i+Math.imul(C,H)|0,r=(r=r+Math.imul(C,K)|0)+Math.imul(E,H)|0,l=l+Math.imul(E,K)|0,i=i+Math.imul(k,W)|0,r=(r=r+Math.imul(k,J)|0)+Math.imul(x,W)|0,l=l+Math.imul(x,J)|0,i=i+Math.imul(b,Y)|0,r=(r=r+Math.imul(b,Z)|0)+Math.imul(g,Y)|0,l=l+Math.imul(g,Z)|0,i=i+Math.imul(m,Q)|0,r=(r=r+Math.imul(m,tt)|0)+Math.imul(v,Q)|0,l=l+Math.imul(v,tt)|0,i=i+Math.imul(d,nt)|0,r=(r=r+Math.imul(d,it)|0)+Math.imul(_,nt)|0,l=l+Math.imul(_,it)|0;var wt=(s+(i=i+Math.imul(p,lt)|0)|0)+((8191&(r=(r=r+Math.imul(p,ot)|0)+Math.imul(h,lt)|0))<<13)|0;s=((l=l+Math.imul(h,ot)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(P,B),r=(r=Math.imul(P,D))+Math.imul(T,B)|0,l=Math.imul(T,D),i=i+Math.imul(z,H)|0,r=(r=r+Math.imul(z,K)|0)+Math.imul(R,H)|0,l=l+Math.imul(R,K)|0,i=i+Math.imul(C,W)|0,r=(r=r+Math.imul(C,J)|0)+Math.imul(E,W)|0,l=l+Math.imul(E,J)|0,i=i+Math.imul(k,Y)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(x,Y)|0,l=l+Math.imul(x,Z)|0,i=i+Math.imul(b,Q)|0,r=(r=r+Math.imul(b,tt)|0)+Math.imul(g,Q)|0,l=l+Math.imul(g,tt)|0,i=i+Math.imul(m,nt)|0,r=(r=r+Math.imul(m,it)|0)+Math.imul(v,nt)|0,l=l+Math.imul(v,it)|0,i=i+Math.imul(d,lt)|0,r=(r=r+Math.imul(d,ot)|0)+Math.imul(_,lt)|0,l=l+Math.imul(_,ot)|0;var kt=(s+(i=i+Math.imul(p,ut)|0)|0)+((8191&(r=(r=r+Math.imul(p,st)|0)+Math.imul(h,ut)|0))<<13)|0;s=((l=l+Math.imul(h,st)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(M,B),r=(r=Math.imul(M,D))+Math.imul(I,B)|0,l=Math.imul(I,D),i=i+Math.imul(P,H)|0,r=(r=r+Math.imul(P,K)|0)+Math.imul(T,H)|0,l=l+Math.imul(T,K)|0,i=i+Math.imul(z,W)|0,r=(r=r+Math.imul(z,J)|0)+Math.imul(R,W)|0,l=l+Math.imul(R,J)|0,i=i+Math.imul(C,Y)|0,r=(r=r+Math.imul(C,Z)|0)+Math.imul(E,Y)|0,l=l+Math.imul(E,Z)|0,i=i+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,tt)|0)+Math.imul(x,Q)|0,l=l+Math.imul(x,tt)|0,i=i+Math.imul(b,nt)|0,r=(r=r+Math.imul(b,it)|0)+Math.imul(g,nt)|0,l=l+Math.imul(g,it)|0,i=i+Math.imul(m,lt)|0,r=(r=r+Math.imul(m,ot)|0)+Math.imul(v,lt)|0,l=l+Math.imul(v,ot)|0,i=i+Math.imul(d,ut)|0,r=(r=r+Math.imul(d,st)|0)+Math.imul(_,ut)|0,l=l+Math.imul(_,st)|0;var xt=(s+(i=i+Math.imul(p,pt)|0)|0)+((8191&(r=(r=r+Math.imul(p,ht)|0)+Math.imul(h,pt)|0))<<13)|0;s=((l=l+Math.imul(h,ht)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,B),r=(r=Math.imul(q,D))+Math.imul(L,B)|0,l=Math.imul(L,D),i=i+Math.imul(M,H)|0,r=(r=r+Math.imul(M,K)|0)+Math.imul(I,H)|0,l=l+Math.imul(I,K)|0,i=i+Math.imul(P,W)|0,r=(r=r+Math.imul(P,J)|0)+Math.imul(T,W)|0,l=l+Math.imul(T,J)|0,i=i+Math.imul(z,Y)|0,r=(r=r+Math.imul(z,Z)|0)+Math.imul(R,Y)|0,l=l+Math.imul(R,Z)|0,i=i+Math.imul(C,Q)|0,r=(r=r+Math.imul(C,tt)|0)+Math.imul(E,Q)|0,l=l+Math.imul(E,tt)|0,i=i+Math.imul(k,nt)|0,r=(r=r+Math.imul(k,it)|0)+Math.imul(x,nt)|0,l=l+Math.imul(x,it)|0,i=i+Math.imul(b,lt)|0,r=(r=r+Math.imul(b,ot)|0)+Math.imul(g,lt)|0,l=l+Math.imul(g,ot)|0,i=i+Math.imul(m,ut)|0,r=(r=r+Math.imul(m,st)|0)+Math.imul(v,ut)|0,l=l+Math.imul(v,st)|0,i=i+Math.imul(d,pt)|0,r=(r=r+Math.imul(d,ht)|0)+Math.imul(_,pt)|0,l=l+Math.imul(_,ht)|0;var St=(s+(i=i+Math.imul(p,dt)|0)|0)+((8191&(r=(r=r+Math.imul(p,_t)|0)+Math.imul(h,dt)|0))<<13)|0;s=((l=l+Math.imul(h,_t)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(q,H),r=(r=Math.imul(q,K))+Math.imul(L,H)|0,l=Math.imul(L,K),i=i+Math.imul(M,W)|0,r=(r=r+Math.imul(M,J)|0)+Math.imul(I,W)|0,l=l+Math.imul(I,J)|0,i=i+Math.imul(P,Y)|0,r=(r=r+Math.imul(P,Z)|0)+Math.imul(T,Y)|0,l=l+Math.imul(T,Z)|0,i=i+Math.imul(z,Q)|0,r=(r=r+Math.imul(z,tt)|0)+Math.imul(R,Q)|0,l=l+Math.imul(R,tt)|0,i=i+Math.imul(C,nt)|0,r=(r=r+Math.imul(C,it)|0)+Math.imul(E,nt)|0,l=l+Math.imul(E,it)|0,i=i+Math.imul(k,lt)|0,r=(r=r+Math.imul(k,ot)|0)+Math.imul(x,lt)|0,l=l+Math.imul(x,ot)|0,i=i+Math.imul(b,ut)|0,r=(r=r+Math.imul(b,st)|0)+Math.imul(g,ut)|0,l=l+Math.imul(g,st)|0,i=i+Math.imul(m,pt)|0,r=(r=r+Math.imul(m,ht)|0)+Math.imul(v,pt)|0,l=l+Math.imul(v,ht)|0;var Ct=(s+(i=i+Math.imul(d,dt)|0)|0)+((8191&(r=(r=r+Math.imul(d,_t)|0)+Math.imul(_,dt)|0))<<13)|0;s=((l=l+Math.imul(_,_t)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(q,W),r=(r=Math.imul(q,J))+Math.imul(L,W)|0,l=Math.imul(L,J),i=i+Math.imul(M,Y)|0,r=(r=r+Math.imul(M,Z)|0)+Math.imul(I,Y)|0,l=l+Math.imul(I,Z)|0,i=i+Math.imul(P,Q)|0,r=(r=r+Math.imul(P,tt)|0)+Math.imul(T,Q)|0,l=l+Math.imul(T,tt)|0,i=i+Math.imul(z,nt)|0,r=(r=r+Math.imul(z,it)|0)+Math.imul(R,nt)|0,l=l+Math.imul(R,it)|0,i=i+Math.imul(C,lt)|0,r=(r=r+Math.imul(C,ot)|0)+Math.imul(E,lt)|0,l=l+Math.imul(E,ot)|0,i=i+Math.imul(k,ut)|0,r=(r=r+Math.imul(k,st)|0)+Math.imul(x,ut)|0,l=l+Math.imul(x,st)|0,i=i+Math.imul(b,pt)|0,r=(r=r+Math.imul(b,ht)|0)+Math.imul(g,pt)|0,l=l+Math.imul(g,ht)|0;var Et=(s+(i=i+Math.imul(m,dt)|0)|0)+((8191&(r=(r=r+Math.imul(m,_t)|0)+Math.imul(v,dt)|0))<<13)|0;s=((l=l+Math.imul(v,_t)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,Y),r=(r=Math.imul(q,Z))+Math.imul(L,Y)|0,l=Math.imul(L,Z),i=i+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(I,Q)|0,l=l+Math.imul(I,tt)|0,i=i+Math.imul(P,nt)|0,r=(r=r+Math.imul(P,it)|0)+Math.imul(T,nt)|0,l=l+Math.imul(T,it)|0,i=i+Math.imul(z,lt)|0,r=(r=r+Math.imul(z,ot)|0)+Math.imul(R,lt)|0,l=l+Math.imul(R,ot)|0,i=i+Math.imul(C,ut)|0,r=(r=r+Math.imul(C,st)|0)+Math.imul(E,ut)|0,l=l+Math.imul(E,st)|0,i=i+Math.imul(k,pt)|0,r=(r=r+Math.imul(k,ht)|0)+Math.imul(x,pt)|0,l=l+Math.imul(x,ht)|0;var jt=(s+(i=i+Math.imul(b,dt)|0)|0)+((8191&(r=(r=r+Math.imul(b,_t)|0)+Math.imul(g,dt)|0))<<13)|0;s=((l=l+Math.imul(g,_t)|0)+(r>>>13)|0)+(jt>>>26)|0,jt&=67108863,i=Math.imul(q,Q),r=(r=Math.imul(q,tt))+Math.imul(L,Q)|0,l=Math.imul(L,tt),i=i+Math.imul(M,nt)|0,r=(r=r+Math.imul(M,it)|0)+Math.imul(I,nt)|0,l=l+Math.imul(I,it)|0,i=i+Math.imul(P,lt)|0,r=(r=r+Math.imul(P,ot)|0)+Math.imul(T,lt)|0,l=l+Math.imul(T,ot)|0,i=i+Math.imul(z,ut)|0,r=(r=r+Math.imul(z,st)|0)+Math.imul(R,ut)|0,l=l+Math.imul(R,st)|0,i=i+Math.imul(C,pt)|0,r=(r=r+Math.imul(C,ht)|0)+Math.imul(E,pt)|0,l=l+Math.imul(E,ht)|0;var zt=(s+(i=i+Math.imul(k,dt)|0)|0)+((8191&(r=(r=r+Math.imul(k,_t)|0)+Math.imul(x,dt)|0))<<13)|0;s=((l=l+Math.imul(x,_t)|0)+(r>>>13)|0)+(zt>>>26)|0,zt&=67108863,i=Math.imul(q,nt),r=(r=Math.imul(q,it))+Math.imul(L,nt)|0,l=Math.imul(L,it),i=i+Math.imul(M,lt)|0,r=(r=r+Math.imul(M,ot)|0)+Math.imul(I,lt)|0,l=l+Math.imul(I,ot)|0,i=i+Math.imul(P,ut)|0,r=(r=r+Math.imul(P,st)|0)+Math.imul(T,ut)|0,l=l+Math.imul(T,st)|0,i=i+Math.imul(z,pt)|0,r=(r=r+Math.imul(z,ht)|0)+Math.imul(R,pt)|0,l=l+Math.imul(R,ht)|0;var Rt=(s+(i=i+Math.imul(C,dt)|0)|0)+((8191&(r=(r=r+Math.imul(C,_t)|0)+Math.imul(E,dt)|0))<<13)|0;s=((l=l+Math.imul(E,_t)|0)+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,lt),r=(r=Math.imul(q,ot))+Math.imul(L,lt)|0,l=Math.imul(L,ot),i=i+Math.imul(M,ut)|0,r=(r=r+Math.imul(M,st)|0)+Math.imul(I,ut)|0,l=l+Math.imul(I,st)|0,i=i+Math.imul(P,pt)|0,r=(r=r+Math.imul(P,ht)|0)+Math.imul(T,pt)|0,l=l+Math.imul(T,ht)|0;var Ot=(s+(i=i+Math.imul(z,dt)|0)|0)+((8191&(r=(r=r+Math.imul(z,_t)|0)+Math.imul(R,dt)|0))<<13)|0;s=((l=l+Math.imul(R,_t)|0)+(r>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,ut),r=(r=Math.imul(q,st))+Math.imul(L,ut)|0,l=Math.imul(L,st),i=i+Math.imul(M,pt)|0,r=(r=r+Math.imul(M,ht)|0)+Math.imul(I,pt)|0,l=l+Math.imul(I,ht)|0;var Pt=(s+(i=i+Math.imul(P,dt)|0)|0)+((8191&(r=(r=r+Math.imul(P,_t)|0)+Math.imul(T,dt)|0))<<13)|0;s=((l=l+Math.imul(T,_t)|0)+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(q,pt),r=(r=Math.imul(q,ht))+Math.imul(L,pt)|0,l=Math.imul(L,ht);var Tt=(s+(i=i+Math.imul(M,dt)|0)|0)+((8191&(r=(r=r+Math.imul(M,_t)|0)+Math.imul(I,dt)|0))<<13)|0;s=((l=l+Math.imul(I,_t)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863;var Nt=(s+(i=Math.imul(q,dt))|0)+((8191&(r=(r=Math.imul(q,_t))+Math.imul(L,dt)|0))<<13)|0;return s=((l=Math.imul(L,_t))+(r>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=yt,u[1]=mt,u[2]=vt,u[3]=$t,u[4]=bt,u[5]=gt,u[6]=wt,u[7]=kt,u[8]=xt,u[9]=St,u[10]=Ct,u[11]=Et,u[12]=jt,u[13]=zt,u[14]=Rt,u[15]=Ot,u[16]=Pt,u[17]=Tt,u[18]=Nt,0!==s&&(u[19]=s,n.length++),n};function d(t,e,n){return(new _).mulp(t,e,n)}function _(t,e){this.x=t,this.y=e}Math.imul||(f=h),l.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):n<63?h(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var i=0,r=0,l=0;l<n.length-1;l++){var o=r;r=0;for(var a=67108863&i,u=Math.min(l,e.length-1),s=Math.max(0,l-t.length+1);s<=u;s++){var c=l-s,p=(0|t.words[c])*(0|e.words[s]),h=67108863&p;a=67108863&(h=h+a|0),r+=(o=(o=o+(p/67108864|0)|0)+(h>>>26)|0)>>>26,o&=67108863}n.words[l]=a,i=o,o=r}return 0!==i?n.words[l]=i:n.length--,n.strip()}(this,t,e):d(this,t,e)},_.prototype.makeRBT=function(t){for(var e=new Array(t),n=l.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,n,t);return e},_.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var i=0,r=0;r<e;r++)i|=(1&t)<<e-r-1,t>>=1;return i},_.prototype.permute=function(t,e,n,i,r,l){for(var o=0;o<l;o++)i[o]=e[t[o]],r[o]=n[t[o]]},_.prototype.transform=function(t,e,n,i,r,l){this.permute(l,t,e,n,i,r);for(var o=1;o<r;o<<=1)for(var a=o<<1,u=Math.cos(2*Math.PI/a),s=Math.sin(2*Math.PI/a),c=0;c<r;c+=a)for(var p=u,h=s,f=0;f<o;f++){var d=n[c+f],_=i[c+f],y=n[c+f+o],m=i[c+f+o],v=p*y-h*m;m=p*m+h*y,y=v,n[c+f]=d+y,i[c+f]=_+m,n[c+f+o]=d-y,i[c+f+o]=_-m,f!==a&&(v=u*p-s*h,h=u*h+s*p,p=v)}},_.prototype.guessLen13b=function(t,e){var n=1|Math.max(e,t),i=1&n,r=0;for(n=n/2|0;n;n>>>=1)r++;return 1<<r+1+i},_.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var i=0;i<n/2;i++){var r=t[i];t[i]=t[n-i-1],t[n-i-1]=r,r=e[i],e[i]=-e[n-i-1],e[n-i-1]=-r}},_.prototype.normalize13b=function(t,e){for(var n=0,i=0;i<e/2;i++){var r=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+n;t[i]=67108863&r,n=r<67108864?0:r/67108864|0}return t},_.prototype.convert13b=function(t,e,n,r){for(var l=0,o=0;o<e;o++)l+=0|t[o],n[2*o]=8191&l,l>>>=13,n[2*o+1]=8191&l,l>>>=13;for(o=2*e;o<r;++o)n[o]=0;i(0===l),i(0==(-8192&l))},_.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},_.prototype.mulp=function(t,e,n){var i=2*this.guessLen13b(t.length,e.length),r=this.makeRBT(i),l=this.stub(i),o=new Array(i),a=new Array(i),u=new Array(i),s=new Array(i),c=new Array(i),p=new Array(i),h=n.words;h.length=i,this.convert13b(t.words,t.length,o,i),this.convert13b(e.words,e.length,s,i),this.transform(o,l,a,u,i,r),this.transform(s,l,c,p,i,r);for(var f=0;f<i;f++){var d=a[f]*c[f]-u[f]*p[f];u[f]=a[f]*p[f]+u[f]*c[f],a[f]=d}return this.conjugate(a,u,i),this.transform(a,u,h,l,i,r),this.conjugate(h,l,i),this.normalize13b(h,i),n.negative=t.negative^e.negative,n.length=t.length+e.length,n.strip()},l.prototype.mul=function(t){var e=new l(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},l.prototype.mulf=function(t){var e=new l(null);return e.words=new Array(this.length+t.length),d(this,t,e)},l.prototype.imul=function(t){return this.clone().mulTo(t,this)},l.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,n=0;n<this.length;n++){var r=(0|this.words[n])*t,l=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=l>>>26,this.words[n]=67108863&l}return 0!==e&&(this.words[n]=e,this.length++),this},l.prototype.muln=function(t){return this.clone().imuln(t)},l.prototype.sqr=function(){return this.mul(this)},l.prototype.isqr=function(){return this.imul(this.clone())},l.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var i=n/26|0,r=n%26;e[n]=(t.words[i]&1<<r)>>>r}return e}(t);if(0===e.length)return new l(1);for(var n=this,i=0;i<e.length&&0===e[i];i++,n=n.sqr());if(++i<e.length)for(var r=n.sqr();i<e.length;i++,r=r.sqr())0!==e[i]&&(n=n.mul(r));return n},l.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,n=t%26,r=(t-n)/26,l=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&l,u=(0|this.words[e])-a<<n;this.words[e]=u|o,o=a>>>26-n}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},l.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},l.prototype.iushrn=function(t,e,n){var r;i("number"==typeof t&&t>=0),r=e?(e-e%26)/26:0;var l=t%26,o=Math.min((t-l)/26,this.length),a=67108863^67108863>>>l<<l,u=n;if(r-=o,r=Math.max(0,r),u){for(var s=0;s<o;s++)u.words[s]=this.words[s];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,s=0;s<this.length;s++)this.words[s]=this.words[s+o];else this.words[0]=0,this.length=1;var c=0;for(s=this.length-1;s>=0&&(0!==c||s>=r);s--){var p=0|this.words[s];this.words[s]=c<<26-l|p>>>l,c=p&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},l.prototype.ishrn=function(t,e,n){return i(0===this.negative),this.iushrn(t,e,n)},l.prototype.shln=function(t){return this.clone().ishln(t)},l.prototype.ushln=function(t){return this.clone().iushln(t)},l.prototype.shrn=function(t){return this.clone().ishrn(t)},l.prototype.ushrn=function(t){return this.clone().iushrn(t)},l.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,r=1<<e;return!(this.length<=n)&&!!(this.words[n]&r)},l.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},l.prototype.maskn=function(t){return this.clone().imaskn(t)},l.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},l.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},l.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},l.prototype.addn=function(t){return this.clone().iaddn(t)},l.prototype.subn=function(t){return this.clone().isubn(t)},l.prototype.iabs=function(){return this.negative=0,this},l.prototype.abs=function(){return this.clone().iabs()},l.prototype._ishlnsubmul=function(t,e,n){var r,l,o=t.length+n;this._expand(o);var a=0;for(r=0;r<t.length;r++){l=(0|this.words[r+n])+a;var u=(0|t.words[r])*e;a=((l-=67108863&u)>>26)-(u/67108864|0),this.words[r+n]=67108863&l}for(;r<this.length-n;r++)a=(l=(0|this.words[r+n])+a)>>26,this.words[r+n]=67108863&l;if(0===a)return this.strip();for(i(-1===a),a=0,r=0;r<this.length;r++)a=(l=-(0|this.words[r])+a)>>26,this.words[r]=67108863&l;return this.negative=1,this.strip()},l.prototype._wordDiv=function(t,e){var n=(this.length,t.length),i=this.clone(),r=t,o=0|r.words[r.length-1];0!==(n=26-this._countBits(o))&&(r=r.ushln(n),i.iushln(n),o=0|r.words[r.length-1]);var a,u=i.length-r.length;if("mod"!==e){(a=new l(null)).length=u+1,a.words=new Array(a.length);for(var s=0;s<a.length;s++)a.words[s]=0}var c=i.clone()._ishlnsubmul(r,1,u);0===c.negative&&(i=c,a&&(a.words[u]=1));for(var p=u-1;p>=0;p--){var h=67108864*(0|i.words[r.length+p])+(0|i.words[r.length+p-1]);for(h=Math.min(h/o|0,67108863),i._ishlnsubmul(r,h,p);0!==i.negative;)h--,i.negative=0,i._ishlnsubmul(r,1,p),i.isZero()||(i.negative^=1);a&&(a.words[p]=h)}return a&&a.strip(),i.strip(),"div"!==e&&0!==n&&i.iushrn(n),{div:a||null,mod:i}},l.prototype.divmod=function(t,e,n){return i(!t.isZero()),this.isZero()?{div:new l(0),mod:new l(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(r=a.div.neg()),"div"!==e&&(o=a.mod.neg(),n&&0!==o.negative&&o.iadd(t)),{div:r,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(r=a.div.neg()),{div:r,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),n&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new l(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new l(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new l(this.modn(t.words[0]))}:this._wordDiv(t,e);var r,o,a},l.prototype.div=function(t){return this.divmod(t,"div",!1).div},l.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},l.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},l.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,i=t.ushrn(1),r=t.andln(1),l=n.cmp(i);return l<0||1===r&&0===l?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},l.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,n=0,r=this.length-1;r>=0;r--)n=(e*n+(0|this.words[r]))%t;return n},l.prototype.idivn=function(t){i(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var r=(0|this.words[n])+67108864*e;this.words[n]=r/t|0,e=r%t}return this.strip()},l.prototype.divn=function(t){return this.clone().idivn(t)},l.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r=new l(1),o=new l(0),a=new l(0),u=new l(1),s=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++s;for(var c=n.clone(),p=e.clone();!e.isZero();){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(c),o.isub(p)),r.iushrn(1),o.iushrn(1);for(var d=0,_=1;0==(n.words[0]&_)&&d<26;++d,_<<=1);if(d>0)for(n.iushrn(d);d-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(p)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),r.isub(a),o.isub(u)):(n.isub(e),a.isub(r),u.isub(o))}return{a:a,b:u,gcd:n.iushln(s)}},l.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r,o=new l(1),a=new l(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var s=0,c=1;0==(e.words[0]&c)&&s<26;++s,c<<=1);if(s>0)for(e.iushrn(s);s-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var p=0,h=1;0==(n.words[0]&h)&&p<26;++p,h<<=1);if(p>0)for(n.iushrn(p);p-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a)):(n.isub(e),a.isub(o))}return(r=0===e.cmpn(1)?o:a).cmpn(0)<0&&r.iadd(t),r},l.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 i=0;e.isEven()&&n.isEven();i++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var r=e.cmp(n);if(r<0){var l=e;e=n,n=l}else if(0===r||0===n.cmpn(1))break;e.isub(n)}return n.iushln(i)},l.prototype.invm=function(t){return this.egcd(t).a.umod(t)},l.prototype.isEven=function(){return 0==(1&this.words[0])},l.prototype.isOdd=function(){return 1==(1&this.words[0])},l.prototype.andln=function(t){return this.words[0]&t},l.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,n=(t-e)/26,r=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=r,this;for(var l=r,o=n;0!==l&&o<this.length;o++){var a=0|this.words[o];l=(a+=l)>>>26,a&=67108863,this.words[o]=a}return 0!==l&&(this.words[o]=l,this.length++),this},l.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},l.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),i(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},l.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},l.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var i=0|this.words[n],r=0|t.words[n];if(i!==r){i<r?e=-1:i>r&&(e=1);break}}return e},l.prototype.gtn=function(t){return 1===this.cmpn(t)},l.prototype.gt=function(t){return 1===this.cmp(t)},l.prototype.gten=function(t){return this.cmpn(t)>=0},l.prototype.gte=function(t){return this.cmp(t)>=0},l.prototype.ltn=function(t){return-1===this.cmpn(t)},l.prototype.lt=function(t){return-1===this.cmp(t)},l.prototype.lten=function(t){return this.cmpn(t)<=0},l.prototype.lte=function(t){return this.cmp(t)<=0},l.prototype.eqn=function(t){return 0===this.cmpn(t)},l.prototype.eq=function(t){return 0===this.cmp(t)},l.red=function(t){return new w(t)},l.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},l.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},l.prototype._forceRed=function(t){return this.red=t,this},l.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},l.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},l.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},l.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},l.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},l.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},l.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},l.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},l.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},l.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},l.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},l.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},l.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},l.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new l(e,16),this.n=this.p.bitLength(),this.k=new l(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function $(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function g(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=l._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new l(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new l(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.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 i=e<this.n?-1:n.ucmp(this.p);return 0===i?(n.words[0]=0,n.length=1):i>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},r(v,m),v.prototype.split=function(t,e){for(var n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var r=t.words[9];for(e.words[e.length++]=4194303&r,i=10;i<t.length;i++){var l=0|t.words[i];t.words[i-10]=(4194303&l)<<4|r>>>22,r=l}r>>>=22,t.words[i-10]=r,0===r&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var i=0|t.words[n];e+=977*i,t.words[n]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r($,m),r(b,m),r(g,m),g.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var i=19*(0|t.words[n])+e,r=67108863&i;i>>>=26,t.words[n]=r,e=i}return 0!==e&&(t.words[t.length++]=e),t},l._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new $;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new g}return y[t]=e,e},w.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var n=this.m.add(new l(1)).iushrn(2);return this.pow(t,n)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);i(!r.isZero());var a=new l(1).toRed(this),u=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new l(2*c*c).toRed(this);0!==this.pow(c,s).cmp(u);)c.redIAdd(u);for(var p=this.pow(c,r),h=this.pow(t,r.addn(1).iushrn(1)),f=this.pow(t,r),d=o;0!==f.cmp(a);){for(var _=f,y=0;0!==_.cmp(a);y++)_=_.redSqr();i(y<d);var m=this.pow(p,new l(1).iushln(d-y-1));h=h.redMul(m),p=m.redSqr(),f=f.redMul(p),d=y}return h},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new l(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new l(1).toRed(this),n[1]=t;for(var i=2;i<n.length;i++)n[i]=this.mul(n[i-1],t);var r=n[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var s=e.words[i],c=u-1;c>=0;c--){var p=s>>c&1;r!==n[0]&&(r=this.sqr(r)),0!==p||0!==o?(o<<=1,o|=p,(4===++a||0===i&&0===c)&&(r=this.mul(r,n[o]),a=0,o=0)):a=0}u=26}return r},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},l.mont=function(t){return new k(t)},r(k,w),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),i=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=n.isub(i).iushrn(this.shift),l=r;return r.cmp(this.m)>=0?l=r.isub(this.m):r.cmpn(0)<0&&(l=r.iadd(this.m)),l._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new l(0)._forceRed(this);var n=t.mul(e),i=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=n.isub(i).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(45)(t))},function(t,e,n){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ var i=n(118),r=n(119),l=n(59);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return p(this,t)}return s(this,t,e,n)}function s(t,e,n,i){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,i){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,n):new Uint8Array(e,n,i);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=h(t,e);return t}(t,e,n,i):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|d(e,n),r=(t=a(t,i)).write(e,n);r!==i&&(t=t.slice(0,r));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|f(e.length);return 0===(t=a(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(i=e.length)!=i?a(t,0):h(t,e);if("Buffer"===e.type&&l(e.data))return h(t,e.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function p(t,e){if(c(e),t=a(t,e<0?0:0|f(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e){var n=e.length<0?0:0|f(e.length);t=a(t,n);for(var i=0;i<n;i+=1)t[i]=255&e[i];return t}function f(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}fu