react-qrcode-scan
Version:
React componnent write by typescript for scan qrcode base on instascan.js
10 lines • 1.87 MB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("react-qrcode-scan",["react"],t):"object"==typeof exports?exports["react-qrcode-scan"]=t(require("react")):e["react-qrcode-scan"]=t(e.react)}(window,(function(__WEBPACK_EXTERNAL_MODULE__108__){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=107)}([function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},function(e,t,i){
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var r=i(4),n=r.Buffer;function a(e,t){for(var i in e)t[i]=e[i]}function f(e,t,i){return n(e,t,i)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=f),f.prototype=Object.create(n.prototype),a(n,f),f.from=function(e,t,i){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,i)},f.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"==typeof i?r.fill(t,i):r.fill(t):r.fill(0),r},f.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},f.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t){var i,r,n=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}function o(e){if(i===setTimeout)return setTimeout(e,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(e){i=a}try{r="function"==typeof clearTimeout?clearTimeout:f}catch(e){r=f}}();var s,u=[],c=!1,l=-1;function d(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=o(d);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===f||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];u.push(new b(e,t)),1!==u.length||c||o(h)},b.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(e,t,i){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function a(e,t,i){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var f;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{f=i(174).Buffer}catch(e){}function o(e,t,i){for(var r=0,n=Math.min(e.length,i),a=t;a<n;a++){var f=e.charCodeAt(a)-48;r<<=4,r|=f>=49&&f<=54?f-49+10:f>=17&&f<=22?f-17+10:15&f}return r}function s(e,t,i,r){for(var n=0,a=Math.min(e.length,i),f=t;f<a;f++){var o=e.charCodeAt(f)-48;n*=r,n+=o>=49?o-49+10:o>=17?o-17+10:o}return n}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&n++,16===t?this._parseHex(e,n):this._parseBase(e,t,n),"-"===e[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),t,i)},a.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},a.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,f,o=0;if("be"===i)for(n=e.length-1,a=0;n>=0;n-=3)f=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=f<<o&67108863,this.words[a+1]=f>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===i)for(n=0,a=0;n<e.length;n+=3)f=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[a]|=f<<o&67108863,this.words[a+1]=f>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,a=0;for(i=e.length-6,r=0;i>=t;i-=6)n=o(e,i,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,r++);i+6!==t&&(n=o(e,t,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var a=e.length-i,f=a%r,o=Math.min(a,a-f)+i,u=0,c=i;c<o;c+=r)u=s(e,c,c+r,t),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==f){var l=1;for(u=s(e,c,e.length,t),c=0;c<f;c++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","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],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,i){i.negative=t.negative^e.negative;var r=e.length+t.length|0;i.length=r,r=r-1|0;var n=0|e.words[0],a=0|t.words[0],f=n*a,o=67108863&f,s=f/67108864|0;i.words[0]=o;for(var u=1;u<r;u++){for(var c=s>>>26,l=67108863&s,d=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=d;h++){var b=u-h|0;c+=(f=(n=0|e.words[b])*(a=0|t.words[h])+l)/67108864|0,l=67108863&f}i.words[u]=0|l,s=0|c}return 0!==s?i.words[u]=0|s:i.length--,i.strip()}a.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,a=0,f=0;f<this.length;f++){var o=this.words[f],s=(16777215&(o<<n|a)).toString(16);i=0!==(a=o>>>24-n&16777215)||f!==this.length-1?u[6-s.length]+s+i:s+i,(n+=2)>=26&&(n-=26,f--)}for(0!==a&&(i=a.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var d=c[e],h=l[e];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var p=b.modn(h).toString(e);i=(b=b.idivn(h)).isZero()?p+i:u[d-p.length]+p+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return r(void 0!==f),this.toArrayLike(f,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),a=i||Math.max(1,n);r(n<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var f,o,s="le"===t,u=new e(a),c=this.clone();if(s){for(o=0;!c.isZero();o++)f=c.andln(255),c.iushrn(8),u[o]=f;for(;o<a;o++)u[o]=0}else{for(o=0;o<a-n;o++)u[o]=0;for(o=0;!c.isZero();o++)f=c.andln(255),c.iushrn(8),u[a-o-1]=f}return u},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 0==(8191&t)&&(i+=13,t>>>=13),0==(127&t)&&(i+=7,t>>>=7),0==(15&t)&&(i+=4,t>>>=4),0==(3&t)&&(i+=2,t>>>=2),0==(1&t)&&i++,i},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var i=this._zeroBits(this.words[t]);if(e+=i,26!==i)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var r=0;r<i.length;r++)this.words[r]=t.words[r]^i.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},a.prototype.iadd=function(e){var t,i,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(i=this,r=e):(i=e,r=this);for(var n=0,a=0;a<r.length;a++)t=(0|i.words[a])+(0|r.words[a])+n,this.words[a]=67108863&t,n=t>>>26;for(;0!==n&&a<i.length;a++)t=(0|i.words[a])+n,this.words[a]=67108863&t,n=t>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=e):(i=e,r=this);for(var a=0,f=0;f<r.length;f++)a=(t=(0|i.words[f])-(0|r.words[f])+a)>>26,this.words[f]=67108863&t;for(;0!==a&&f<i.length;f++)a=(t=(0|i.words[f])+a)>>26,this.words[f]=67108863&t;if(0===a&&f<i.length&&i!==this)for(;f<i.length;f++)this.words[f]=i.words[f];return this.length=Math.max(this.length,f),i!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,i){var r,n,a,f=e.words,o=t.words,s=i.words,u=0,c=0|f[0],l=8191&c,d=c>>>13,h=0|f[1],b=8191&h,p=h>>>13,v=0|f[2],k=8191&v,w=v>>>13,m=0|f[3],_=8191&m,g=m>>>13,y=0|f[4],S=8191&y,E=y>>>13,M=0|f[5],A=8191&M,R=M>>>13,C=0|f[6],T=8191&C,O=C>>>13,P=0|f[7],x=8191&P,F=P>>>13,D=0|f[8],I=8191&D,L=D>>>13,B=0|f[9],N=8191&B,j=B>>>13,U=0|o[0],z=8191&U,H=U>>>13,q=0|o[1],W=8191&q,G=q>>>13,Y=0|o[2],V=8191&Y,K=Y>>>13,X=0|o[3],Z=8191&X,J=X>>>13,$=0|o[4],Q=8191&$,ee=$>>>13,te=0|o[5],ie=8191&te,re=te>>>13,ne=0|o[6],ae=8191&ne,fe=ne>>>13,oe=0|o[7],se=8191&oe,ue=oe>>>13,ce=0|o[8],le=8191&ce,de=ce>>>13,he=0|o[9],be=8191&he,pe=he>>>13;i.negative=e.negative^t.negative,i.length=19;var ve=(u+(r=Math.imul(l,z))|0)+((8191&(n=(n=Math.imul(l,H))+Math.imul(d,z)|0))<<13)|0;u=((a=Math.imul(d,H))+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,z),n=(n=Math.imul(b,H))+Math.imul(p,z)|0,a=Math.imul(p,H);var ke=(u+(r=r+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(d,W)|0))<<13)|0;u=((a=a+Math.imul(d,G)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(k,z),n=(n=Math.imul(k,H))+Math.imul(w,z)|0,a=Math.imul(w,H),r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(p,W)|0,a=a+Math.imul(p,G)|0;var we=(u+(r=r+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,K)|0)+Math.imul(d,V)|0))<<13)|0;u=((a=a+Math.imul(d,K)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(_,z),n=(n=Math.imul(_,H))+Math.imul(g,z)|0,a=Math.imul(g,H),r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,G)|0)+Math.imul(w,W)|0,a=a+Math.imul(w,G)|0,r=r+Math.imul(b,V)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(p,V)|0,a=a+Math.imul(p,K)|0;var me=(u+(r=r+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(d,Z)|0))<<13)|0;u=((a=a+Math.imul(d,J)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(S,z),n=(n=Math.imul(S,H))+Math.imul(E,z)|0,a=Math.imul(E,H),r=r+Math.imul(_,W)|0,n=(n=n+Math.imul(_,G)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,G)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(w,V)|0,a=a+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(p,Z)|0,a=a+Math.imul(p,J)|0;var _e=(u+(r=r+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(d,Q)|0))<<13)|0;u=((a=a+Math.imul(d,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(A,z),n=(n=Math.imul(A,H))+Math.imul(R,z)|0,a=Math.imul(R,H),r=r+Math.imul(S,W)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(E,W)|0,a=a+Math.imul(E,G)|0,r=r+Math.imul(_,V)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,K)|0,r=r+Math.imul(k,Z)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(w,Z)|0,a=a+Math.imul(w,J)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(p,Q)|0,a=a+Math.imul(p,ee)|0;var ge=(u+(r=r+Math.imul(l,ie)|0)|0)+((8191&(n=(n=n+Math.imul(l,re)|0)+Math.imul(d,ie)|0))<<13)|0;u=((a=a+Math.imul(d,re)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(T,z),n=(n=Math.imul(T,H))+Math.imul(O,z)|0,a=Math.imul(O,H),r=r+Math.imul(A,W)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,G)|0,r=r+Math.imul(S,V)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,K)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(g,Z)|0,a=a+Math.imul(g,J)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,r=r+Math.imul(b,ie)|0,n=(n=n+Math.imul(b,re)|0)+Math.imul(p,ie)|0,a=a+Math.imul(p,re)|0;var ye=(u+(r=r+Math.imul(l,ae)|0)|0)+((8191&(n=(n=n+Math.imul(l,fe)|0)+Math.imul(d,ae)|0))<<13)|0;u=((a=a+Math.imul(d,fe)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(x,z),n=(n=Math.imul(x,H))+Math.imul(F,z)|0,a=Math.imul(F,H),r=r+Math.imul(T,W)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(O,W)|0,a=a+Math.imul(O,G)|0,r=r+Math.imul(A,V)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(R,V)|0,a=a+Math.imul(R,K)|0,r=r+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,Z)|0,a=a+Math.imul(E,J)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,ee)|0,r=r+Math.imul(k,ie)|0,n=(n=n+Math.imul(k,re)|0)+Math.imul(w,ie)|0,a=a+Math.imul(w,re)|0,r=r+Math.imul(b,ae)|0,n=(n=n+Math.imul(b,fe)|0)+Math.imul(p,ae)|0,a=a+Math.imul(p,fe)|0;var Se=(u+(r=r+Math.imul(l,se)|0)|0)+((8191&(n=(n=n+Math.imul(l,ue)|0)+Math.imul(d,se)|0))<<13)|0;u=((a=a+Math.imul(d,ue)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(I,z),n=(n=Math.imul(I,H))+Math.imul(L,z)|0,a=Math.imul(L,H),r=r+Math.imul(x,W)|0,n=(n=n+Math.imul(x,G)|0)+Math.imul(F,W)|0,a=a+Math.imul(F,G)|0,r=r+Math.imul(T,V)|0,n=(n=n+Math.imul(T,K)|0)+Math.imul(O,V)|0,a=a+Math.imul(O,K)|0,r=r+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(R,Z)|0,a=a+Math.imul(R,J)|0,r=r+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,ee)|0,r=r+Math.imul(_,ie)|0,n=(n=n+Math.imul(_,re)|0)+Math.imul(g,ie)|0,a=a+Math.imul(g,re)|0,r=r+Math.imul(k,ae)|0,n=(n=n+Math.imul(k,fe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,fe)|0,r=r+Math.imul(b,se)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(p,se)|0,a=a+Math.imul(p,ue)|0;var Ee=(u+(r=r+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;u=((a=a+Math.imul(d,de)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(N,z),n=(n=Math.imul(N,H))+Math.imul(j,z)|0,a=Math.imul(j,H),r=r+Math.imul(I,W)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(L,W)|0,a=a+Math.imul(L,G)|0,r=r+Math.imul(x,V)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(F,V)|0,a=a+Math.imul(F,K)|0,r=r+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(O,Z)|0,a=a+Math.imul(O,J)|0,r=r+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,ee)|0,r=r+Math.imul(S,ie)|0,n=(n=n+Math.imul(S,re)|0)+Math.imul(E,ie)|0,a=a+Math.imul(E,re)|0,r=r+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,fe)|0,r=r+Math.imul(k,se)|0,n=(n=n+Math.imul(k,ue)|0)+Math.imul(w,se)|0,a=a+Math.imul(w,ue)|0,r=r+Math.imul(b,le)|0,n=(n=n+Math.imul(b,de)|0)+Math.imul(p,le)|0,a=a+Math.imul(p,de)|0;var Me=(u+(r=r+Math.imul(l,be)|0)|0)+((8191&(n=(n=n+Math.imul(l,pe)|0)+Math.imul(d,be)|0))<<13)|0;u=((a=a+Math.imul(d,pe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(N,W),n=(n=Math.imul(N,G))+Math.imul(j,W)|0,a=Math.imul(j,G),r=r+Math.imul(I,V)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(L,V)|0,a=a+Math.imul(L,K)|0,r=r+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,J)|0)+Math.imul(F,Z)|0,a=a+Math.imul(F,J)|0,r=r+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,r=r+Math.imul(A,ie)|0,n=(n=n+Math.imul(A,re)|0)+Math.imul(R,ie)|0,a=a+Math.imul(R,re)|0,r=r+Math.imul(S,ae)|0,n=(n=n+Math.imul(S,fe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,fe)|0,r=r+Math.imul(_,se)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(g,se)|0,a=a+Math.imul(g,ue)|0,r=r+Math.imul(k,le)|0,n=(n=n+Math.imul(k,de)|0)+Math.imul(w,le)|0,a=a+Math.imul(w,de)|0;var Ae=(u+(r=r+Math.imul(b,be)|0)|0)+((8191&(n=(n=n+Math.imul(b,pe)|0)+Math.imul(p,be)|0))<<13)|0;u=((a=a+Math.imul(p,pe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(N,V),n=(n=Math.imul(N,K))+Math.imul(j,V)|0,a=Math.imul(j,K),r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,J)|0)+Math.imul(L,Z)|0,a=a+Math.imul(L,J)|0,r=r+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(F,Q)|0,a=a+Math.imul(F,ee)|0,r=r+Math.imul(T,ie)|0,n=(n=n+Math.imul(T,re)|0)+Math.imul(O,ie)|0,a=a+Math.imul(O,re)|0,r=r+Math.imul(A,ae)|0,n=(n=n+Math.imul(A,fe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,fe)|0,r=r+Math.imul(S,se)|0,n=(n=n+Math.imul(S,ue)|0)+Math.imul(E,se)|0,a=a+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=(n=n+Math.imul(_,de)|0)+Math.imul(g,le)|0,a=a+Math.imul(g,de)|0;var Re=(u+(r=r+Math.imul(k,be)|0)|0)+((8191&(n=(n=n+Math.imul(k,pe)|0)+Math.imul(w,be)|0))<<13)|0;u=((a=a+Math.imul(w,pe)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(N,Z),n=(n=Math.imul(N,J))+Math.imul(j,Z)|0,a=Math.imul(j,J),r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(L,Q)|0,a=a+Math.imul(L,ee)|0,r=r+Math.imul(x,ie)|0,n=(n=n+Math.imul(x,re)|0)+Math.imul(F,ie)|0,a=a+Math.imul(F,re)|0,r=r+Math.imul(T,ae)|0,n=(n=n+Math.imul(T,fe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,fe)|0,r=r+Math.imul(A,se)|0,n=(n=n+Math.imul(A,ue)|0)+Math.imul(R,se)|0,a=a+Math.imul(R,ue)|0,r=r+Math.imul(S,le)|0,n=(n=n+Math.imul(S,de)|0)+Math.imul(E,le)|0,a=a+Math.imul(E,de)|0;var Ce=(u+(r=r+Math.imul(_,be)|0)|0)+((8191&(n=(n=n+Math.imul(_,pe)|0)+Math.imul(g,be)|0))<<13)|0;u=((a=a+Math.imul(g,pe)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(N,Q),n=(n=Math.imul(N,ee))+Math.imul(j,Q)|0,a=Math.imul(j,ee),r=r+Math.imul(I,ie)|0,n=(n=n+Math.imul(I,re)|0)+Math.imul(L,ie)|0,a=a+Math.imul(L,re)|0,r=r+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,fe)|0)+Math.imul(F,ae)|0,a=a+Math.imul(F,fe)|0,r=r+Math.imul(T,se)|0,n=(n=n+Math.imul(T,ue)|0)+Math.imul(O,se)|0,a=a+Math.imul(O,ue)|0,r=r+Math.imul(A,le)|0,n=(n=n+Math.imul(A,de)|0)+Math.imul(R,le)|0,a=a+Math.imul(R,de)|0;var Te=(u+(r=r+Math.imul(S,be)|0)|0)+((8191&(n=(n=n+Math.imul(S,pe)|0)+Math.imul(E,be)|0))<<13)|0;u=((a=a+Math.imul(E,pe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(N,ie),n=(n=Math.imul(N,re))+Math.imul(j,ie)|0,a=Math.imul(j,re),r=r+Math.imul(I,ae)|0,n=(n=n+Math.imul(I,fe)|0)+Math.imul(L,ae)|0,a=a+Math.imul(L,fe)|0,r=r+Math.imul(x,se)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(F,se)|0,a=a+Math.imul(F,ue)|0,r=r+Math.imul(T,le)|0,n=(n=n+Math.imul(T,de)|0)+Math.imul(O,le)|0,a=a+Math.imul(O,de)|0;var Oe=(u+(r=r+Math.imul(A,be)|0)|0)+((8191&(n=(n=n+Math.imul(A,pe)|0)+Math.imul(R,be)|0))<<13)|0;u=((a=a+Math.imul(R,pe)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(N,ae),n=(n=Math.imul(N,fe))+Math.imul(j,ae)|0,a=Math.imul(j,fe),r=r+Math.imul(I,se)|0,n=(n=n+Math.imul(I,ue)|0)+Math.imul(L,se)|0,a=a+Math.imul(L,ue)|0,r=r+Math.imul(x,le)|0,n=(n=n+Math.imul(x,de)|0)+Math.imul(F,le)|0,a=a+Math.imul(F,de)|0;var Pe=(u+(r=r+Math.imul(T,be)|0)|0)+((8191&(n=(n=n+Math.imul(T,pe)|0)+Math.imul(O,be)|0))<<13)|0;u=((a=a+Math.imul(O,pe)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(N,se),n=(n=Math.imul(N,ue))+Math.imul(j,se)|0,a=Math.imul(j,ue),r=r+Math.imul(I,le)|0,n=(n=n+Math.imul(I,de)|0)+Math.imul(L,le)|0,a=a+Math.imul(L,de)|0;var xe=(u+(r=r+Math.imul(x,be)|0)|0)+((8191&(n=(n=n+Math.imul(x,pe)|0)+Math.imul(F,be)|0))<<13)|0;u=((a=a+Math.imul(F,pe)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(N,le),n=(n=Math.imul(N,de))+Math.imul(j,le)|0,a=Math.imul(j,de);var Fe=(u+(r=r+Math.imul(I,be)|0)|0)+((8191&(n=(n=n+Math.imul(I,pe)|0)+Math.imul(L,be)|0))<<13)|0;u=((a=a+Math.imul(L,pe)|0)+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863;var De=(u+(r=Math.imul(N,be))|0)+((8191&(n=(n=Math.imul(N,pe))+Math.imul(j,be)|0))<<13)|0;return u=((a=Math.imul(j,pe))+(n>>>13)|0)+(De>>>26)|0,De&=67108863,s[0]=ve,s[1]=ke,s[2]=we,s[3]=me,s[4]=_e,s[5]=ge,s[6]=ye,s[7]=Se,s[8]=Ee,s[9]=Me,s[10]=Ae,s[11]=Re,s[12]=Ce,s[13]=Te,s[14]=Oe,s[15]=Pe,s[16]=xe,s[17]=Fe,s[18]=De,0!==u&&(s[19]=u,i.length++),i};function b(e,t,i){return(new p).mulp(e,t,i)}function p(e,t){this.x=e,this.y=t}Math.imul||(h=d),a.prototype.mulTo=function(e,t){var i=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):i<63?d(this,e,t):i<1024?function(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var r=0,n=0,a=0;a<i.length-1;a++){var f=n;n=0;for(var o=67108863&r,s=Math.min(a,t.length-1),u=Math.max(0,a-e.length+1);u<=s;u++){var c=a-u,l=(0|e.words[c])*(0|t.words[u]),d=67108863&l;o=67108863&(d=d+o|0),n+=(f=(f=f+(l/67108864|0)|0)+(d>>>26)|0)>>>26,f&=67108863}i.words[a]=o,r=f,f=n}return 0!==r?i.words[a]=r:i.length--,i.strip()}(this,e,t):b(this,e,t)},p.prototype.makeRBT=function(e){for(var t=new Array(e),i=a.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,i,e);return t},p.prototype.revBin=function(e,t,i){if(0===e||e===i-1)return e;for(var r=0,n=0;n<t;n++)r|=(1&e)<<t-n-1,e>>=1;return r},p.prototype.permute=function(e,t,i,r,n,a){for(var f=0;f<a;f++)r[f]=t[e[f]],n[f]=i[e[f]]},p.prototype.transform=function(e,t,i,r,n,a){this.permute(a,e,t,i,r,n);for(var f=1;f<n;f<<=1)for(var o=f<<1,s=Math.cos(2*Math.PI/o),u=Math.sin(2*Math.PI/o),c=0;c<n;c+=o)for(var l=s,d=u,h=0;h<f;h++){var b=i[c+h],p=r[c+h],v=i[c+h+f],k=r[c+h+f],w=l*v-d*k;k=l*k+d*v,v=w,i[c+h]=b+v,r[c+h]=p+k,i[c+h+f]=b-v,r[c+h+f]=p-k,h!==o&&(w=s*l-u*d,d=s*d+u*l,l=w)}},p.prototype.guessLen13b=function(e,t){var i=1|Math.max(t,e),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},p.prototype.conjugate=function(e,t,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=e[r];e[r]=e[i-r-1],e[i-r-1]=n,n=t[r],t[r]=-t[i-r-1],t[i-r-1]=-n}},p.prototype.normalize13b=function(e,t){for(var i=0,r=0;r<t/2;r++){var n=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+i;e[r]=67108863&n,i=n<67108864?0:n/67108864|0}return e},p.prototype.convert13b=function(e,t,i,n){for(var a=0,f=0;f<t;f++)a+=0|e[f],i[2*f]=8191&a,a>>>=13,i[2*f+1]=8191&a,a>>>=13;for(f=2*t;f<n;++f)i[f]=0;r(0===a),r(0==(-8192&a))},p.prototype.stub=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=0;return t},p.prototype.mulp=function(e,t,i){var r=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(r),a=this.stub(r),f=new Array(r),o=new Array(r),s=new Array(r),u=new Array(r),c=new Array(r),l=new Array(r),d=i.words;d.length=r,this.convert13b(e.words,e.length,f,r),this.convert13b(t.words,t.length,u,r),this.transform(f,a,o,s,r,n),this.transform(u,a,c,l,r,n);for(var h=0;h<r;h++){var b=o[h]*c[h]-s[h]*l[h];s[h]=o[h]*l[h]+s[h]*c[h],o[h]=b}return this.conjugate(o,s,r),this.transform(o,s,d,a,r,n),this.conjugate(d,a,r),this.normalize13b(d,r),i.negative=e.negative^t.negative,i.length=e.length+t.length,i.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),b(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,a=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=a>>>26,this.words[i]=67108863&a}return 0!==t&&(this.words[i]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i<t.length;i++){var r=i/26|0,n=i%26;t[i]=(e.words[r]&1<<n)>>>n}return t}(e);if(0===t.length)return new a(1);for(var i=this,r=0;r<t.length&&0===t[r];r++,i=i.sqr());if(++r<t.length)for(var n=i.sqr();r<t.length;r++,n=n.sqr())0!==t[r]&&(i=i.mul(n));return i},a.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,a=67108863>>>26-i<<26-i;if(0!==i){var f=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,s=(0|this.words[t])-o<<i;this.words[t]=s|f,f=o>>>26-i}f&&(this.words[t]=f,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},a.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var a=e%26,f=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,s=i;if(n-=f,n=Math.max(0,n),s){for(var u=0;u<f;u++)s.words[u]=this.words[u];s.length=f}if(0===f);else if(this.length>f)for(this.length-=f,u=0;u<this.length;u++)this.words[u]=this.words[u+f];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=n);u--){var l=0|this.words[u];this.words[u]=c<<26-a|l>>>a,c=l&o}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i)&&!!(this.words[i]&n)},a.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,i){var n,a,f=e.length+i;this._expand(f);var o=0;for(n=0;n<e.length;n++){a=(0|this.words[n+i])+o;var s=(0|e.words[n])*t;o=((a-=67108863&s)>>26)-(s/67108864|0),this.words[n+i]=67108863&a}for(;n<this.length-i;n++)o=(a=(0|this.words[n+i])+o)>>26,this.words[n+i]=67108863&a;if(0===o)return this.strip();for(r(-1===o),o=0,n=0;n<this.length;n++)o=(a=-(0|this.words[n])+o)>>26,this.words[n]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var i=(this.length,e.length),r=this.clone(),n=e,f=0|n.words[n.length-1];0!==(i=26-this._countBits(f))&&(n=n.ushln(i),r.iushln(i),f=0|n.words[n.length-1]);var o,s=r.length-n.length;if("mod"!==t){(o=new a(null)).length=s+1,o.words=new Array(o.length);for(var u=0;u<o.length;u++)o.words[u]=0}var c=r.clone()._ishlnsubmul(n,1,s);0===c.negative&&(r=c,o&&(o.words[s]=1));for(var l=s-1;l>=0;l--){var d=67108864*(0|r.words[n.length+l])+(0|r.words[n.length+l-1]);for(d=Math.min(d/f|0,67108863),r._ishlnsubmul(n,d,l);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(n,1,l),r.isZero()||(r.negative^=1);o&&(o.words[l]=d)}return o&&o.strip(),r.strip(),"div"!==t&&0!==i&&r.iushrn(i),{div:o||null,mod:r}},a.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(n=o.div.neg()),"div"!==t&&(f=o.mod.neg(),i&&0!==f.negative&&f.iadd(e)),{div:n,mod:f}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(n=o.div.neg()),{div:n,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(f=o.mod.neg(),i&&0!==f.negative&&f.isub(e)),{div:o.div,mod:f}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,f,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),a=i.cmp(r);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},a.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new a(1),f=new a(0),o=new a(0),s=new a(1),u=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++u;for(var c=i.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(n.isOdd()||f.isOdd())&&(n.iadd(c),f.isub(l)),n.iushrn(1),f.iushrn(1);for(var b=0,p=1;0==(i.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(i.iushrn(b);b-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(l)),o.iushrn(1),s.iushrn(1);t.cmp(i)>=0?(t.isub(i),n.isub(o),f.isub(s)):(i.isub(t),o.isub(n),s.isub(f))}return{a:o,b:s,gcd:i.iushln(u)}},a.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,f=new a(1),o=new a(0),s=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,c=1;0==(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(t.iushrn(u);u-- >0;)f.isOdd()&&f.iadd(s),f.iushrn(1);for(var l=0,d=1;0==(i.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(i.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(i)>=0?(t.isub(i),f.isub(o)):(i.isub(t),o.isub(f))}return(n=0===t.cmpn(1)?f:o).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var r=0;t.isEven()&&i.isEven();r++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=t.cmp(i);if(n<0){var a=t;t=i,i=a}else if(0===n||0===i.cmpn(1))break;t.isub(i)}return i.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var a=n,f=i;0!==a&&f<this.length;f++){var o=0|this.words[f];a=(o+=a)>>>26,o&=67108863,this.words[f]=o}return 0!==a&&(this.words[f]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|e.words[i];if(r!==n){r<n?t=-1:r>n&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new y(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function k(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function g(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){y.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}k.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},k.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},k.prototype.split=function(e,t){e.iushrn(this.n,0,t)},k.prototype.imulK=function(e){return e.imul(this.k)},n(w,k),w.prototype.split=function(e,t){for(var i=Math.min(e.length,9),r=0;r<i;r++)t.words[r]=e.words[r];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=4194303&n,r=10;r<e.length;r++){var a=0|e.words[r];e.words[r-10]=(4194303&a)<<4|n>>>22,n=a}n>>>=22,e.words[r-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i<e.length;i++){var r=0|e.words[i];t+=977*r,e.words[i]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(m,k),n(_,k),n(g,k),g.prototype.imulK=function(e){for(var t=0,i=0;i<e.length;i++){var r=19*(0|e.words[i])+t,n=67108863&r;r>>>=26,e.words[i]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new m;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new g}return v[e]=t,t},y.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},y.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},y.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},y.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},y.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},y.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},y.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},y.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},y.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},y.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},y.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},y.prototype.isqr=function(e){return this.imul(e,e.clone())},y.prototype.sqr=function(e){return this.mul(e,e)},y.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new a(1)).iushrn(2);return this.pow(e,i)}for(var n=this.m.subn(1),f=0;!n.isZero()&&0===n.andln(1);)f++,n.iushrn(1);r(!n.isZero());var o=new a(1).toRed(this),s=o.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(s);)c.redIAdd(s);for(var l=this.pow(c,n),d=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),b=f;0!==h.cmp(o);){for(var p=h,v=0;0!==p.cmp(o);v++)p=p.redSqr();r(v<b);var k=this.pow(l,new a(1).iushln(b-v-1));d=d.redMul(k),l=k.redSqr(),h=h.redMul(l),b=v}return d},y.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},y.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var i=new Array(16);i[0]=new a(1).toRed(this),i[1]=e;for(var r=2;r<i.length;r++)i[r]=this.mul(i[r-1],e);var n=i[0],f=0,o=0,s=t.bitLength()%26;for(0===s&&(s=26),r=t.length-1;r>=0;r--){for(var u=t.words[r],c=s-1;c>=0;c--){var l=u>>c&1;n!==i[0]&&(n=this.sqr(n)),0!==l||0!==f?(f<<=1,f|=l,(4===++o||0===r&&0===c)&&(n=this.mul(n,i[f]),o=0,f=0)):o=0}s=26}return n},y.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},y.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new S(e)},n(S,y),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var i=e.mul(t),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),f=n;return n.cmp(this.m)>=0?f=n.isub(this.m):n.cmpn(0)<0&&(f=n.iadd(this.m)),f._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,i(30)(e))},function(e,t,i){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var r=i(129),n=i(130),a=i(53);function f(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(f()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=s.prototype:(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,i){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return u(this,e,t,i)}function u(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,r){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,i):new Uint8Array(t,i,r);s.TYPED_ARRAY_SUPPORT?(e=t).__proto__=s.prototype:e=d(e,t);return e}(e,t,i,r):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!s.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|b(t,i),n=(e=o(e,r)).write(t,i);n!==r&&(e=e.slice(0,n));return e}(e,t,i):function(e,t){if(s.isBuffer(t)){var i=0|h(t.length);return 0===(e=o(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?o(e,0):d(e,t);if("Buffer"===t.type&&a(t.data))return d(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(c(t),e=o(e,t<0?0:0|h(t)),!s.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function d(e,t){var i=t.length<0?0:0|h(t.length);e=o(e,i);for(var r=0;r<i;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=f())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f().toString(16)+" bytes");return 0|e}function b(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret