!function(e){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=e();elseif("function"==typeofdefine&&define.amd)define([],e);else{vart;t="undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:this,t.OAUTH3_crypto_fallback=e()}}(function(){returnfunctione(t,r,i){functionn(a,s){if(!r[a]){if(!t[a]){varo="function"==typeofrequire&&require;if(!s&&o)returno(a,!0);if(f)returnf(a,!0);varh=newError("Cannot find module '"+a+"'");throwh.code="MODULE_NOT_FOUND",h}varc=r[a]={exports:{}};t[a][0].call(c.exports,function(e){varr=t[a][1][e];returnn(r||e)},c,c.exports,e,t,r,i)}returnr[a].exports}for(varf="function"==typeofrequire&&require,a=0;a<i.length;a++)n(i[a]);returnn}({1:[function(e,t,r){(function(t){!function(){"use strict";functioni(e){returnl("sha256").update(e).digest()}functionn(e,r){returnb.pbkdf2Sync(e,t(r),8192,16,"sha256")}functionf(e,r,i){varn=p.createCipheriv("aes-128-gcm",t(e),t(r));returnt.concat([n.update(t(i)),n.final(),n.getAuthTag()])}functiona(e,r,i){varn=p.createDecipheriv("aes-128-gcm",t(e),t(r));returnn.setAuthTag(t(i.slice(-16))),t.concat([n.update(t(i.slice(0,-16))),n.final()])}functions(e,r){vari=e.toArrayLike(t);if(!r||i.length===r)returni;if(i.length<r)returnt.concat([t(r-i.length).fill(0),i]);if(i.length>r)thrownewError("EC signature number bigger than expected");thrownewError('invalid size "'+r+'" converting BigNumber to Buffer')}functiono(e){returns(e).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=*$/,"")}functionh(){vare=m.genKeyPair(),t={key_ops:["verify"],kty:"EC",crv:"P-256",x:o(e.getPublic().getX()),y:o(e.getPublic().getY())},r=JSON.parse(JSON.stringify(t));returnr.key_ops=["sign"],r.d=o(e.getPrivate()),{privateKey:r,publicKey:t}}functionc(e,r){varn=m.keyFromPrivate(t(e.d,"base64")),f=n.sign(i(r));returnt.concat([s(f.r,32),s(f.s,32)])}functiond(e,r,n){varf=m.keyFromPublic({x:t(e.x,"base64"),y:t(e.y,"base64")}),a={r:t(n.slice(0,n.length/2)),s:t(n.slice(n.length/2))};returnf.verify(i(r),a)}functionu(e){returnfunction(){vart=arguments;returnnewOAUTH3.PromiseA(function(r){r(e.apply(null,t))})}}varl=e("create-hash"),b=e("pbkdf2"),p=e("browserify-aes"),m=e("elliptic/lib/elliptic/ec")("p256");r.sha256=u(i),r.pbkdf2=u(n),r.encrypt=u(f),r.decrypt=u(a),r.sign=u(c),r.verify=u(d),r.genEcdsaKeyPair=u(h)}()}).call(this,e("buffer").Buffer)},{"browserify-aes":8,buffer:23,"create-hash":26,"elliptic/lib/elliptic/ec":37,pbkdf2:61}],2:[function(e,t,r){"use strict";functioni(e){vart=e.length;if(t%4>0)thrownewError("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}functionn(e){return3*e.length/4-i(e)}functionf(e){vart,r,n,f,a,s,o=e.length;a=i(e),s=newd(3*o/4-a),n=a>0?o-4:o;varh=0;for(t=0,r=0;t<n;t+=4,r+=3)f=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],s[h++]=f>>16&255,s[h++]=f>>8&255,s[h++]=255&f;return2===a?(f=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,s[h++]=255&f):1===a&&(f=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,s[h++]=f>>8&255,s[h++]=255&f),s}functiona(e){returnh[e>>18&63]+h[e>>12&63]+h[e>>6&63]+h[63&e]}functions(e,t,r){for(vari,n=[],f=t;f<r;f+=3)i=(e[f]<<16)+(e[f+1]<<8)+e[f+2],n.push(a(i));returnn.join("")}functiono(e){for(vart,r=e.length,i=r%3,n="",f=[],a=0,o=r-i;a<o;a+=16383)f.push(s(e,a,a+16383>o?o:a+16383));return1===i?(t=e[r-1],n+=h[t>>2],n+=h[t<<4&63],n+="=="):2===i&&(t=(e[r-2]<<8)+e[r-1],n+=h[t>>10],n+=h[t>>4&63],n+=h[t<<2&63],n+="="),f.push(n),f.join("")}r.byteLength=n,r.toByteArray=f,r.fromByteArray=o;for(varh=[],c=[],d="undefined"!=typeofUint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,b=u.length;l<b;++l)h[l]=u[l],c[u.charCodeAt(l)]=l;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],3:[function(e,t,r){!function(t,r){"use strict";functioni(e,t){if(!e)thrownewError(t||"Assertion failed")}functionn(e,t){e.super_=t;varr=function(){};r.prototype=t.prototype,e.prototype=newr
;return!(this.length<=r)&&!!(this.words[r]&n)},f.prototype.imaskn=function(e){i("number"==typeofe&&e>=0);vart=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)returnthis;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){varn=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}returnthis.strip()},f.prototype.maskn=function(e){returnthis.clone().imaskn(e)},f.prototype.iaddn=function(e){returni("number"==typeofe),i(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)},f.prototype._iaddn=function(e){this.words[0]+=e;for(vart=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]++;returnthis.length=Math.max(this.length,t+1),this},f.prototype.isubn=function(e){if(i("number"==typeofe),i(e<67108864),e<0)returnthis.iaddn(-e);if(0!==this.negative)returnthis.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;elsefor(vart=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;returnthis.strip()},f.prototype.addn=function(e){returnthis.clone().iaddn(e)},f.prototype.subn=function(e){returnthis.clone().isubn(e)},f.prototype.iabs=function(){returnthis.negative=0,this},f.prototype.abs=function(){returnthis.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){varn,f=e.length+r;this._expand(f);vara,s=0;for(n=0;n<e.length;n++){a=(0|this.words[n+r])+s;varo=(0|e.words[n])*t;a-=67108863&o,s=(a>>26)-(o/67108864|0),this.words[n+r]=67108863&a}for(;n<this.length-r;n++)a=(0|this.words[n+r])+s,s=a>>26,this.words[n+r]=67108863&a;if(0===s)returnthis.strip();for(i(s===-1),s=0,n=0;n<this.length;n++)a=-(0|this.words[n])+s,s=a>>26,this.words[n]=67108863&a;returnthis.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){varr=this.length-e.length,i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);vars,o=i.length-n.length;if("mod"!==t){s=newf(null),s.length=o+1,s.words=newArray(s.length);for(varh=0;h<s.length;h++)s.words[h]=0}varc=i.clone()._ishlnsubmul(n,1,o);0===c.negative&&(i=c,s&&(s.words[o]=1));for(vard=o-1;d>=0;d--){varu=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(u=Math.min(u/a|0,67108863),i._ishlnsubmul(n,u,d);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);s&&(s.words[d]=u)}returns&&s.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},f.prototype.divmod=function(e,t,r){if(i(!e.isZero()),this.isZero())return{div:newf(0),mod:newf(0)};varn,a,s;return0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:n,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:newf(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:newf(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:newf(this.modn(e.words[0]))}:this._wordDiv(e,t)},f.prototype.div=function(e){returnthis.divmod(e,"div",!1).div},f.prototype.mod=function(e){returnthis.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){returnthis.divmod(e,"mod",!0).mod},f.prototype.divRound=function(e){vart=this.divmod(e);if(t.mod.isZero())returnt.div;varr=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),f=r.cmp(i);returnf<0||1===n&&0===f?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},f.prototype.modn=function(e){i(e<=67108863);for(vart=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;returnr},f.prototype.idi
varn=e("./aes"),f=e("cipher-base");e("inherits")(i,f),t.exports=i,i.prototype._update=function(e){returnthis._mode.encrypt(this,e,this._decrypt)},i.prototype._final=function(){this._cipher.scrub()}}).call(this,e("buffer").Buffer)},{"./aes":6,buffer:23,"cipher-base":24,inherits:56}],21:[function(e,t,r){(function(t){"use strict";vari=e("buffer"),n=i.Buffer,f=i.SlowBuffer,a=i.kMaxLength||2147483647;r.alloc=function(e,t,r){if("function"==typeofn.alloc)returnn.alloc(e,t,r);if("number"==typeofr)thrownewTypeError("encoding must not be number");if("number"!=typeofe)thrownewTypeError("size must be a number");if(e>a)thrownewRangeError("size is too large");vari=r,f=t;void0===f&&(i=void0,f=0);vars=newn(e);if("string"==typeoff)for(varo=newn(f,i),h=o.length,c=-1;++c<e;)s[c]=o[c%h];elses.fill(f);returns},r.allocUnsafe=function(e){if("function"==typeofn.allocUnsafe)returnn.allocUnsafe(e);if("number"!=typeofe)thrownewTypeError("size must be a number");if(e>a)thrownewRangeError("size is too large");returnnewn(e)},r.from=function(e,r,i){if("function"==typeofn.from&&(!t.Uint8Array||Uint8Array.from!==n.from))returnn.from(e,r,i);if("number"==typeofe)thrownewTypeError('"value" argument must not be a number');if("string"==typeofe)returnnewn(e,r);if("undefined"!=typeofArrayBuffer&&einstanceofArrayBuffer){varf=r;if(1===arguments.length)returnnewn(e);void0===f&&(f=0);vara=i;if(void0===a&&(a=e.byteLength-f),f>=e.byteLength)thrownewRangeError("'offset' is out of bounds");if(a>e.byteLength-f)thrownewRangeError("'length' is out of bounds");returnnewn(e.slice(f,f+a))}if(n.isBuffer(e)){vars=newn(e.length);returne.copy(s,0,0,e.length),s}if(e){if(Array.isArray(e)||"undefined"!=typeofArrayBuffer&&e.bufferinstanceofArrayBuffer||"length"ine)returnnewn(e);if("Buffer"===e.type&&Array.isArray(e.data))returnnewn(e.data)}thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},r.allocUnsafeSlow=function(e){if("function"==typeofn.allocUnsafeSlow)returnn.allocUnsafeSlow(e);if("number"!=typeofe)thrownewTypeError("size must be a number");if(e>=a)thrownewRangeError("size is too large");returnnewf(e)}}).call(this,"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{})},{buffer:23}],22:[function(e,t,r){(function(e){t.exports=function(t,r){for(vari=Math.min(t.length,r.length),n=newe(i),f=0;f<i;++f)n[f]=t[f]^r[f];returnn}}).call(this,e("buffer").Buffer)},{buffer:23}],23:[function(e,t,r){"use strict";functioni(e){if(e>K)thrownewRangeError("Invalid typed array length");vart=newUint8Array(e);returnt.__proto__=n.prototype,t}functionn(e,t,r){if("number"==typeofe){if("string"==typeoft)thrownewError("If encoding is specified then the first argument must be a string");returno(e)}returnf(e,t,r)}functionf(e,t,r){if("number"==typeofe)thrownewTypeError('"value" argument must not be a number');returneinstanceofArrayBuffer?d(e,t,r):"string"==typeofe?h(e,t):u(e)}functiona(e){if("number"!=typeofe)thrownewTypeError('"size" argument must be a number');if(e<0)thrownewRangeError('"size" argument must not be negative')}functions(e,t,r){returna(e),e<=0?i(e):void0!==t?"string"==typeofr?i(e).fill(t,r):i(e).fill(t):i(e)}functiono(e){returna(e),i(e<0?0:0|l(e))}functionh(e,t){if("string"==typeoft&&""!==t||(t="utf8"),!n.isEncoding(t))thrownewTypeError('"encoding" must be a valid string encoding');varr=0|p(e,t),f=i(r),a=f.write(e,t);returna!==r&&(f=f.slice(0,a)),f}functionc(e){for(vart=e.length<0?0:0|l(e.length),r=i(t),n=0;n<t;n+=1)r[n]=255&e[n];returnr}functiond(e,t,r){if(t<0||e.byteLength<t)thrownewRangeError("'offset' is out of bounds");if(e.byteLength<t+(r||0))thrownewRangeError("'length' is out of bounds");vari;returni=void0===t&&void0===r?newUint8Array(e):void0===r?newUint8Array(e,t):newUint8Array(e,t,r),i.__proto__=n.prototype,i}functionu(e){if(n.isBuffer(e)){vart=0|l(e.length),r=i(t);return0===r.length?r:(e.copy(r,0,0,t),r)}if(e){if(ArrayBuffer.isView(e)||"length"
if(d>=0&&A++,M=M.dblp(A),d<0)break;for(vary=0;y<i;y++){varu,E=S[y];0!==E&&(E>0?u=a[y][E-1>>1]:E<0&&(u=a[y][-E-1>>1].neg()),M="affine"===u.type?M.mixedAdd(u):M.add(u))}}for(vard=0;d<i;d++)a[d]=null;returnn?M:M.toP()},i.BasePoint=n,n.prototype.eq=function(){thrownewError("Not implemented")},n.prototype.validate=function(){returnthis.curve.validate(this)},i.prototype.decodePoint=function(e,t){e=s.toArray(e,t);varr=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r){6===e[0]?c(e[e.length-1]%2==0):7===e[0]&&c(e[e.length-1]%2==1);returnthis.point(e.slice(1,1+r),e.slice(1+r,1+2*r))}if((2===e[0]||3===e[0])&&e.length-1===r)returnthis.pointFromX(e.slice(1,1+r),3===e[0]);thrownewError("Unknown point format")},n.prototype.encodeCompressed=function(e){returnthis.encode(e,!0)},n.prototype._encode=function(e){vart=this.curve.p.byteLength(),r=this.getX().toArray("be",t);returne?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},n.prototype.encode=function(e,t){returns.encode(this._encode(t),e)},n.prototype.precompute=function(e){if(this.precomputed)returnthis;vart={doubles:null,naf:null,beta:null};returnt.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},n.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;vart=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},n.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)returnthis.precomputed.doubles;for(varr=[this],i=this,n=0;n<t;n+=e){for(varf=0;f<e;f++)i=i.dbl();r.push(i)}return{step:e,points:r}},n.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)returnthis.precomputed.naf;for(vart=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},n.prototype._getBeta=function(){returnnull},n.prototype.dblp=function(e){for(vart=this,r=0;r<e;r++)t=t.dbl();returnt}},{"../../elliptic":30,"bn.js":3}],32:[function(e,t,r){"use strict";functioni(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&(0|e.a)==-1,this.extended=this.mOneA,h.call(this,"edwards",e),this.a=news(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=news(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=news(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}functionn(e,t,r,i,n){h.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=news(t,16),this.y=news(r,16),this.z=i?news(i,16):this.curve.one,this.t=n&&news(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}varf=e("../curve"),a=e("../../elliptic"),s=e("bn.js"),o=e("inherits"),h=f.base,c=a.utils.assert;o(i,h),t.exports=i,i.prototype._mulA=function(e){returnthis.mOneA?e.redNeg():this.a.redMul(e)},i.prototype._mulC=function(e){returnthis.oneC?e:this.c.redMul(e)},i.prototype.jpoint=function(e,t,r,i){returnthis.point(e,t,r,i)},i.prototype.pointFromX=function(e,t){e=news(e,16),e.red||(e=e.toRed(this.red));varr=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),n=this.one.redSub(this.c2.redMul(this.d).redMul(r)),f=i.redMul(n.redInvm()),a=f.redSqrt();if(0!==a.redSqr().redSub(f).cmp(this.zero))thrownewError("invalid point");varo=a.fromRed().isOdd();return(t&&!o||!t&&o)&&(a=a.redNeg()),this.point(e,a)},i.prototype.pointFromY=function(e,t){e=news(e,16),e.red||(e=e.toRed(this.red));varr=e.redSqr(),i=r.redSub(this.one),n=r.redMul(this.d).redAdd(this.one),f=i.redMul(n.redInvm());if(0===f.cmp(this.zero)){if(t)thrownewError("invalid point");returnthis.point(this.zero,e)}vara=f.redSqrt();
null!==t.recoveryParam)returnt.recoveryParam;for(varn=0;n<4;n++){varf;try{f=this.recoverPubKey(e,t,n)}catch(e){continue}if(f.eq(r))returnn}thrownewError("Unable to find valid recovery factor")}},{"../../elliptic":30,"./key":38,"./signature":39,"bn.js":3,"hmac-drbg":54}],38:[function(e,t,r){"use strict";functioni(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}varn=e("bn.js"),f=e("../../elliptic"),a=f.utils,s=a.assert;t.exports=i,i.fromPublic=function(e,t,r){returntinstanceofi?t:newi(e,{pub:t,pubEnc:r})},i.fromPrivate=function(e,t,r){returntinstanceofi?t:newi(e,{priv:t,privEnc:r})},i.prototype.validate=function(){vare=this.getPublic();returne.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(e,t){return"string"==typeofe&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=newn(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?s(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||s(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i.prototype.derive=function(e){returne.mul(this.priv).getX()},i.prototype.sign=function(e,t,r){returnthis.ec.sign(e,this,t,r)},i.prototype.verify=function(e,t){returnthis.ec.verify(e,t,this)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":30,"bn.js":3}],39:[function(e,t,r){"use strict";functioni(e,t){if(einstanceofi)returne;this._importDER(e,t)||(d(e.r&&e.s,"Signature without r or s"),this.r=newo(e.r,16),this.s=newo(e.s,16),void0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}functionn(){this.place=0}functionf(e,t){varr=e[t.place++];if(!(128&r))returnr;for(vari=15&r,n=0,f=0,a=t.place;f<i;f++,a++)n<<=8,n|=e[a];returnt.place=a,n}functiona(e){for(vart=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return0===t?e:e.slice(t)}functions(e,t){if(t<128)returnvoide.push(t);varr=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}varo=e("bn.js"),h=e("../../elliptic"),c=h.utils,d=c.assert;t.exports=i,i.prototype._importDER=function(e,t){e=c.toArray(e,t);varr=newn;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;vari=f(e,r),a=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;vars=f(e,r);if(e.length!==s+r.place)return!1;varh=e.slice(r.place,s+r.place);return0===a[0]&&128&a[1]&&(a=a.slice(1)),0===h[0]&&128&h[1]&&(h=h.slice(1)),this.r=newo(a),this.s=newo(h),this.recoveryParam=null,!0},i.prototype.toDER=function(e){vart=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=a(t),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);vari=[2];s(i,t.length),i=i.concat(t),i.push(2),s(i,r.length);varn=i.concat(r),f=[48];returns(f,n.length),f=f.concat(n),c.encode(f,e)}},{"../../elliptic":30,"bn.js":3}],40:[function(e,t,r){"use strict";functioni(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(thisinstanceofi))returnnewi(e);vare=f.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}varn=e("hash.js"),f=e("../../elliptic"),a=f.utils,s=a.assert,o=a.parseBytes,h=e("./key"),c=e("./signature");t.exports=i,i.prototype.sign=function(e,t){e=o(e);varr=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),f=
r?e._writev(n,t.onwrite):e._write(n,f,t.onwrite),t.sync=!1}functionu(e,t,r,i,n){--t.pendingcb,r?A(n,i):n(i),e._writableState.errorEmitted=!0,e.emit("error",i)}functionl(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}functionb(e,t){varr=e._writableState,i=r.sync,n=r.writecb;if(l(r),t)u(e,r,i,t,n);else{varf=g(r);f||r.corked||r.bufferProcessing||!r.bufferedRequest||v(e,r),i?x(p,e,r,f,n):p(e,r,f,n)}}functionp(e,t,r,i){r||m(e,t),t.pendingcb--,i(),w(e,t)}functionm(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}functionv(e,t){t.bufferProcessing=!0;varr=t.bufferedRequest;if(e._writev&&r&&r.next){vari=t.bufferedRequestCount,n=newArray(i),f=t.corkedRequestsFree;f.entry=r;for(vara=0;r;)n[a]=r,r=r.next,a+=1;d(e,t,!0,t.length,n,"",f.finish),t.pendingcb++,t.lastBufferedRequest=null,f.next?(t.corkedRequestsFree=f.next,f.next=null):t.corkedRequestsFree=newM(t)}else{for(;r;){vars=r.chunk,o=r.encoding,h=r.callback;if(d(e,t,!1,t.objectMode?1:s.length,s,o,h),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}functiong(e){returne.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}functiony(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}functionw(e,t){varr=g(t);returnr&&(0===t.pendingcb?(y(e,t),t.finished=!0,e.emit("finish")):y(e,t)),r}function_(e,t,r){t.ending=!0,w(e,t),r&&(t.finished?A(r):e.once("finish",r)),t.ended=!0,e.writable=!1}functionM(e){vart=this;this.next=null,this.entry=null,this.finish=function(r){vari=t.entry;for(t.entry=null;i;){varn=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}t.exports=a;varS,A=e("process-nextick-args"),x=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?setImmediate:A;a.WritableState=f;varE=e("core-util-is");E.inherits=e("inherits");vark,I={deprecate:e("util-deprecate")};!function(){try{k=e("stream")}catch(e){}finally{k||(k=e("events").EventEmitter)}}();varB=e("buffer").Buffer,R=e("buffer-shims");E.inherits(a,k),f.prototype.getBuffer=function(){for(vare=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;returnt},function(){try{Object.defineProperty(f.prototype,"buffer",{get:I.deprecate(function(){returnthis.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();varz;"function"==typeofSymbol&&Symbol.hasInstance&&"function"==typeofFunction.prototype[Symbol.hasInstance]?(z=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(e){return!!z.call(this,e)||e&&e._writableStateinstanceoff}})):z=function(e){returneinstanceofthis},a.prototype.pipe=function(){this.emit("error",newError("Cannot pipe, not readable"))},a.prototype.write=function(e,t,r){varn=this._writableState,f=!1,a=B.isBuffer(e);return"function"==typeoft&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeofr&&(r=i),n.ended?s(this,r):(a||o(this,n,e,r))&&(n.pendingcb++,f=c(this,n,a,e,t,r)),f},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){vare=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||v(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeofe&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))thrownewTypeError("Unknown encoding: "+e);returnthis._writableState.defaultEncoding=e,this},a.prototype._write=function(e,t,r){r(newError("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,r){vari=this._writableState;"function"==typeofe?(r=e,e=null,t=null):"function"==typeoft&&(r=t,t=null),null!==e&&void0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||_(this,i,r)}}).call(this,e("_process"))},{"./_stream_duplex":66,_process:64,buffer:23,"buffer-shims":21,"core-util-is":25,events:46,inherits