diff --git a/dist/terraform/index.js b/dist/terraform/index.js index 774ddff..6443895 100644 --- a/dist/terraform/index.js +++ b/dist/terraform/index.js @@ -13,4 +13,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */function od(Ae,ke){if("function"!=typeof ke&&null!==ke)throw new TypeError("Class extends value "+ke+" is not a constructor or null");function r(){this.constructor=Ae}sd(Ae,ke),Ae.prototype=null===ke?Object.create(ke):(r.prototype=ke.prototype,new r)}function cd(Ae){if(!Ae)throw new TypeError("Assertion failed")}function ud(){}function hd(Ae){return"object"==typeof Ae&&null!==Ae||"function"==typeof Ae}function fd(Ae){if("function"!=typeof Ae)return!1;var ke=!1;try{new Ae({start:function(){ke=!0}})}catch(Ae){}return ke}function dd(Ae){return!!hd(Ae)&&"function"==typeof Ae.getReader}function ld(Ae){return!!hd(Ae)&&"function"==typeof Ae.getWriter}function pd(Ae){return!!hd(Ae)&&(!!dd(Ae.readable)&&!!ld(Ae.writable))}function yd(Ae){try{return Ae.getReader({mode:"byob"}).releaseLock(),!0}catch(Ae){return!1}}function bd(Ae,ke){var Ce=(void 0===ke?{}:ke).type;return cd(dd(Ae)),cd(!1===Ae.locked),"bytes"===(Ce=md(Ce))?new Md(Ae):new Pd(Ae)}function md(Ae){var ke=Ae+"";if("bytes"===ke)return ke;if(void 0===Ae)return Ae;throw new RangeError("Invalid type is specified")}var Rd=function(){function e(Ae){this._underlyingReader=void 0,this._readerMode=void 0,this._readableStreamController=void 0,this._pendingRead=void 0,this._underlyingStream=Ae,this._attachDefaultReader()}return e.prototype.start=function(Ae){this._readableStreamController=Ae},e.prototype.cancel=function(Ae){return cd(void 0!==this._underlyingReader),this._underlyingReader.cancel(Ae)},e.prototype._attachDefaultReader=function(){if("default"!==this._readerMode){this._detachReader();var Ae=this._underlyingStream.getReader();this._readerMode="default",this._attachReader(Ae)}},e.prototype._attachReader=function(Ae){var ke=this;cd(void 0===this._underlyingReader),this._underlyingReader=Ae;var Ce=this._underlyingReader.closed;Ce&&Ce.then((function(){return ke._finishPendingRead()})).then((function(){Ae===ke._underlyingReader&&ke._readableStreamController.close()}),(function(Ce){Ae===ke._underlyingReader&&ke._readableStreamController.error(Ce)})).catch(ud)},e.prototype._detachReader=function(){void 0!==this._underlyingReader&&(this._underlyingReader.releaseLock(),this._underlyingReader=void 0,this._readerMode=void 0)},e.prototype._pullWithDefaultReader=function(){var Ae=this;this._attachDefaultReader();var ke=this._underlyingReader.read().then((function(ke){var Ce=Ae._readableStreamController;ke.done?Ae._tryClose():Ce.enqueue(ke.value)}));return this._setPendingRead(ke),ke},e.prototype._tryClose=function(){try{this._readableStreamController.close()}catch(Ae){}},e.prototype._setPendingRead=function(Ae){var ke,Ce=this,i=function(){Ce._pendingRead===ke&&(Ce._pendingRead=void 0)};this._pendingRead=ke=Ae.then(i,i)},e.prototype._finishPendingRead=function(){var Ae=this;if(this._pendingRead){var t=function(){return Ae._finishPendingRead()};return this._pendingRead.then(t,t)}},e}(),Pd=function(Ae){function t(){return null!==Ae&&Ae.apply(this,arguments)||this}return od(t,Ae),t.prototype.pull=function(){return this._pullWithDefaultReader()},t}(Rd);function vd(Ae){return new Uint8Array(Ae.buffer,Ae.byteOffset,Ae.byteLength)}var Md=function(Ae){function t(ke){var Ce=this,qe=yd(ke);return(Ce=Ae.call(this,ke)||this)._supportsByob=qe,Ce}return od(t,Ae),Object.defineProperty(t.prototype,"type",{get:function(){return"bytes"},enumerable:!1,configurable:!0}),t.prototype._attachByobReader=function(){if("byob"!==this._readerMode){cd(this._supportsByob),this._detachReader();var Ae=this._underlyingStream.getReader({mode:"byob"});this._readerMode="byob",this._attachReader(Ae)}},t.prototype.pull=function(){if(this._supportsByob){var Ae=this._readableStreamController.byobRequest;if(Ae)return this._pullWithByobRequest(Ae)}return this._pullWithDefaultReader()},t.prototype._pullWithByobRequest=function(Ae){var ke=this;this._attachByobReader();var Ce=new Uint8Array(Ae.view.byteLength),qe=this._underlyingReader.read(Ce).then((function(Ce){var qe,ze,Ve;ke._readableStreamController,Ce.done?(ke._tryClose(),Ae.respond(0)):(qe=Ce.value,ze=Ae.view,Ve=vd(qe),vd(ze).set(Ve,0),Ae.respond(Ce.value.byteLength))}));return this._setPendingRead(qe),qe},t}(Rd);function kd(Ae){cd(ld(Ae)),cd(!1===Ae.locked);var ke=Ae.getWriter();return new Td(ke)}var Td=function(){function e(Ae){var ke=this;this._writableStreamController=void 0,this._pendingWrite=void 0,this._state="writable",this._storedError=void 0,this._underlyingWriter=Ae,this._errorPromise=new Promise((function(Ae,Ce){ke._errorPromiseReject=Ce})),this._errorPromise.catch(ud)}return e.prototype.start=function(Ae){var ke=this;this._writableStreamController=Ae,this._underlyingWriter.closed.then((function(){ke._state="closed"})).catch((function(Ae){return ke._finishErroring(Ae)}))},e.prototype.write=function(Ae){var ke=this,Ce=this._underlyingWriter;if(null===Ce.desiredSize)return Ce.ready;var qe=Ce.write(Ae);qe.catch((function(Ae){return ke._finishErroring(Ae)})),Ce.ready.catch((function(Ae){return ke._startErroring(Ae)}));var ze=Promise.race([qe,this._errorPromise]);return this._setPendingWrite(ze),ze},e.prototype.close=function(){var Ae=this;return void 0===this._pendingWrite?this._underlyingWriter.close():this._finishPendingWrite().then((function(){return Ae.close()}))},e.prototype.abort=function(Ae){if("errored"!==this._state)return this._underlyingWriter.abort(Ae)},e.prototype._setPendingWrite=function(Ae){var ke,Ce=this,i=function(){Ce._pendingWrite===ke&&(Ce._pendingWrite=void 0)};this._pendingWrite=ke=Ae.then(i,i)},e.prototype._finishPendingWrite=function(){var Ae=this;if(void 0===this._pendingWrite)return Promise.resolve();var t=function(){return Ae._finishPendingWrite()};return this._pendingWrite.then(t,t)},e.prototype._startErroring=function(Ae){var ke=this;if("writable"===this._state){this._state="erroring",this._storedError=Ae;var r=function(){return ke._finishErroring(Ae)};void 0===this._pendingWrite?r():this._finishPendingWrite().then(r,r),this._writableStreamController.error(Ae)}},e.prototype._finishErroring=function(Ae){"writable"===this._state&&this._startErroring(Ae),"erroring"===this._state&&(this._state="errored",this._errorPromiseReject(this._storedError))},e}();function Sd(Ae){cd(pd(Ae));var ke=Ae.readable,Ce=Ae.writable;cd(!1===ke.locked),cd(!1===Ce.locked);var qe,ze=ke.getReader();try{qe=Ce.getWriter()}catch(Ae){throw ze.releaseLock(),Ae}return new Id(ze,qe)}var Id=function(){function e(Ae,ke){var Ce=this;this._transformStreamController=void 0,this._onRead=function(Ae){if(!Ae.done)return Ce._transformStreamController.enqueue(Ae.value),Ce._reader.read().then(Ce._onRead)},this._onError=function(Ae){Ce._flushReject(Ae),Ce._transformStreamController.error(Ae),Ce._reader.cancel(Ae).catch(ud),Ce._writer.abort(Ae).catch(ud)},this._onTerminate=function(){Ce._flushResolve(),Ce._transformStreamController.terminate();var Ae=new TypeError("TransformStream terminated");Ce._writer.abort(Ae).catch(ud)},this._reader=Ae,this._writer=ke,this._flushPromise=new Promise((function(Ae,ke){Ce._flushResolve=Ae,Ce._flushReject=ke}))}return e.prototype.start=function(Ae){this._transformStreamController=Ae,this._reader.read().then(this._onRead).then(this._onTerminate,this._onError);var ke=this._reader.closed;ke&&ke.then(this._onTerminate,this._onError)},e.prototype.transform=function(Ae){return this._writer.write(Ae)},e.prototype.flush=function(){var Ae=this;return this._writer.close().then((function(){return Ae._flushPromise}))},e}(),Dd=Object.freeze({__proto__:null,createReadableStreamWrapper:function(Ae){cd(function(Ae){return!!fd(Ae)&&!!dd(new Ae)}(Ae));var ke=function(Ae){try{return new Ae({type:"bytes"}),!0}catch(Ae){return!1}}(Ae);return function(Ce,qe){var ze=(void 0===qe?{}:qe).type;if("bytes"!==(ze=md(ze))||ke||(ze=void 0),Ce.constructor===Ae&&("bytes"!==ze||yd(Ce)))return Ce;if("bytes"===ze){var Ve=bd(Ce,{type:ze});return new Ae(Ve)}Ve=bd(Ce);return new Ae(Ve)}},createTransformStreamWrapper:function(Ae){return cd(function(Ae){return!!fd(Ae)&&!!pd(new Ae)}(Ae)),function(ke){if(ke.constructor===Ae)return ke;var Ce=Sd(ke);return new Ae(Ce)}},createWrappingReadableSource:bd,createWrappingTransformer:Sd,createWrappingWritableSink:kd,createWritableStreamWrapper:function(Ae){return cd(function(Ae){return!!fd(Ae)&&!!ld(new Ae)}(Ae)),function(ke){if(ke.constructor===Ae)return ke;var Ce=kd(ke);return new Ae(Ce)}}}),Od=bt((function(Ae){!function(Ae,ke){function r(Ae,ke){if(!Ae)throw Error(ke||"Assertion failed")}function i(Ae,ke){Ae.super_=ke;var r=function(){};r.prototype=ke.prototype,Ae.prototype=new r,Ae.prototype.constructor=Ae}function n(Ae,ke,Ce){if(n.isBN(Ae))return Ae;this.negative=0,this.words=null,this.length=0,this.red=null,null!==Ae&&("le"!==ke&&"be"!==ke||(Ce=ke,ke=10),this._init(Ae||0,ke||10,Ce||"be"))}var Ce;"object"==typeof Ae?Ae.exports=n:ke.BN=n,n.BN=n,n.wordSize=26;try{Ce=ct.default.Buffer}catch(Ae){}function s(Ae,ke,Ce){for(var qe=0,ze=Math.min(Ae.length,Ce),Ve=ke;Ve=49&&tt<=54?tt-49+10:tt>=17&&tt<=22?tt-17+10:15&tt}return qe}function o(Ae,ke,Ce,qe){for(var ze=0,Ve=Math.min(Ae.length,Ce),tt=ke;tt=49?rt-49+10:rt>=17?rt-17+10:rt}return ze}n.isBN=function(Ae){return Ae instanceof n||null!==Ae&&"object"==typeof Ae&&Ae.constructor.wordSize===n.wordSize&&Array.isArray(Ae.words)},n.max=function(Ae,ke){return Ae.cmp(ke)>0?Ae:ke},n.min=function(Ae,ke){return Ae.cmp(ke)<0?Ae:ke},n.prototype._init=function(Ae,ke,Ce){if("number"==typeof Ae)return this._initNumber(Ae,ke,Ce);if("object"==typeof Ae)return this._initArray(Ae,ke,Ce);"hex"===ke&&(ke=16),r(ke===(0|ke)&&ke>=2&&ke<=36);var qe=0;"-"===(Ae=Ae.toString().replace(/\s+/g,""))[0]&&qe++,16===ke?this._parseHex(Ae,qe):this._parseBase(Ae,ke,qe),"-"===Ae[0]&&(this.negative=1),this.strip(),"le"===Ce&&this._initArray(this.toArray(),ke,Ce)},n.prototype._initNumber=function(Ae,ke,Ce){Ae<0&&(this.negative=1,Ae=-Ae),Ae<67108864?(this.words=[67108863&Ae],this.length=1):Ae<4503599627370496?(this.words=[67108863&Ae,Ae/67108864&67108863],this.length=2):(r(Ae<9007199254740992),this.words=[67108863&Ae,Ae/67108864&67108863,1],this.length=3),"le"===Ce&&this._initArray(this.toArray(),ke,Ce)},n.prototype._initArray=function(Ae,ke,Ce){if(r("number"==typeof Ae.length),Ae.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Ae.length/3),this.words=Array(this.length);for(var qe=0;qe=0;qe-=3)Ve=Ae[qe]|Ae[qe-1]<<8|Ae[qe-2]<<16,this.words[ze]|=Ve<>>26-tt&67108863,(tt+=24)>=26&&(tt-=26,ze++);else if("le"===Ce)for(qe=0,ze=0;qe>>26-tt&67108863,(tt+=24)>=26&&(tt-=26,ze++);return this.strip()},n.prototype._parseHex=function(Ae,ke){this.length=Math.ceil((Ae.length-ke)/6),this.words=Array(this.length);for(var Ce=0;Ce=ke;Ce-=6)ze=s(Ae,Ce,Ce+6),this.words[qe]|=ze<>>26-Ve&4194303,(Ve+=24)>=26&&(Ve-=26,qe++);Ce+6!==ke&&(ze=s(Ae,ke,Ce+6),this.words[qe]|=ze<>>26-Ve&4194303),this.strip()},n.prototype._parseBase=function(Ae,ke,Ce){this.words=[0],this.length=1;for(var qe=0,ze=1;ze<=67108863;ze*=ke)qe++;qe--,ze=ze/ke|0;for(var Ve=Ae.length-Ce,tt=Ve%qe,rt=Math.min(Ve,Ve-tt)+Ce,nt=0,it=Ce;it1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var qe=["","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"],ze=[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],Ve=[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(Ae,ke,Ce){Ce.negative=ke.negative^Ae.negative;var qe=Ae.length+ke.length|0;Ce.length=qe,qe=qe-1|0;var ze=0|Ae.words[0],Ve=0|ke.words[0],tt=ze*Ve,rt=67108863&tt,nt=tt/67108864|0;Ce.words[0]=rt;for(var it=1;it>>26,ct=67108863&nt,ht=Math.min(it,ke.length-1),ft=Math.max(0,it-Ae.length+1);ft<=ht;ft++){var mt=it-ft|0;ot+=(tt=(ze=0|Ae.words[mt])*(Ve=0|ke.words[ft])+ct)/67108864|0,ct=67108863&tt}Ce.words[it]=0|ct,nt=0|ot}return 0!==nt?Ce.words[it]=0|nt:Ce.length--,Ce.strip()}n.prototype.toString=function(Ae,ke){var Ce;if(ke=0|ke||1,16===(Ae=Ae||10)||"hex"===Ae){Ce="";for(var tt=0,rt=0,nt=0;nt>>24-tt&16777215)||nt!==this.length-1?qe[6-ot.length]+ot+Ce:ot+Ce,(tt+=2)>=26&&(tt-=26,nt--)}for(0!==rt&&(Ce=rt.toString(16)+Ce);Ce.length%ke!=0;)Ce="0"+Ce;return 0!==this.negative&&(Ce="-"+Ce),Ce}if(Ae===(0|Ae)&&Ae>=2&&Ae<=36){var ct=ze[Ae],ht=Ve[Ae];Ce="";var ft=this.clone();for(ft.negative=0;!ft.isZero();){var mt=ft.modn(ht).toString(Ae);Ce=(ft=ft.idivn(ht)).isZero()?mt+Ce:qe[ct-mt.length]+mt+Ce}for(this.isZero()&&(Ce="0"+Ce);Ce.length%ke!=0;)Ce="0"+Ce;return 0!==this.negative&&(Ce="-"+Ce),Ce}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var Ae=this.words[0];return 2===this.length?Ae+=67108864*this.words[1]:3===this.length&&1===this.words[2]?Ae+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-Ae:Ae},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(Ae,ke){return r(void 0!==Ce),this.toArrayLike(Ce,Ae,ke)},n.prototype.toArray=function(Ae,ke){return this.toArrayLike(Array,Ae,ke)},n.prototype.toArrayLike=function(Ae,ke,Ce){var qe=this.byteLength(),ze=Ce||Math.max(1,qe);r(qe<=ze,"byte array longer than desired length"),r(ze>0,"Requested array length <= 0"),this.strip();var Ve,tt,rt="le"===ke,nt=new Ae(ze),it=this.clone();if(rt){for(tt=0;!it.isZero();tt++)Ve=it.andln(255),it.iushrn(8),nt[tt]=Ve;for(;tt=4096&&(Ce+=13,ke>>>=13),ke>=64&&(Ce+=7,ke>>>=7),ke>=8&&(Ce+=4,ke>>>=4),ke>=2&&(Ce+=2,ke>>>=2),Ce+ke},n.prototype._zeroBits=function(Ae){if(0===Ae)return 26;var ke=Ae,Ce=0;return 0==(8191&ke)&&(Ce+=13,ke>>>=13),0==(127&ke)&&(Ce+=7,ke>>>=7),0==(15&ke)&&(Ce+=4,ke>>>=4),0==(3&ke)&&(Ce+=2,ke>>>=2),0==(1&ke)&&Ce++,Ce},n.prototype.bitLength=function(){var Ae=this.words[this.length-1],ke=this._countBits(Ae);return 26*(this.length-1)+ke},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Ae=0,ke=0;keAe.length?this.clone().ior(Ae):Ae.clone().ior(this)},n.prototype.uor=function(Ae){return this.length>Ae.length?this.clone().iuor(Ae):Ae.clone().iuor(this)},n.prototype.iuand=function(Ae){var ke;ke=this.length>Ae.length?Ae:this;for(var Ce=0;CeAe.length?this.clone().iand(Ae):Ae.clone().iand(this)},n.prototype.uand=function(Ae){return this.length>Ae.length?this.clone().iuand(Ae):Ae.clone().iuand(this)},n.prototype.iuxor=function(Ae){var ke,Ce;this.length>Ae.length?(ke=this,Ce=Ae):(ke=Ae,Ce=this);for(var qe=0;qeAe.length?this.clone().ixor(Ae):Ae.clone().ixor(this)},n.prototype.uxor=function(Ae){return this.length>Ae.length?this.clone().iuxor(Ae):Ae.clone().iuxor(this)},n.prototype.inotn=function(Ae){r("number"==typeof Ae&&Ae>=0);var ke=0|Math.ceil(Ae/26),Ce=Ae%26;this._expand(ke),Ce>0&&ke--;for(var qe=0;qe0&&(this.words[qe]=~this.words[qe]&67108863>>26-Ce),this.strip()},n.prototype.notn=function(Ae){return this.clone().inotn(Ae)},n.prototype.setn=function(Ae,ke){r("number"==typeof Ae&&Ae>=0);var Ce=Ae/26|0,qe=Ae%26;return this._expand(Ce+1),this.words[Ce]=ke?this.words[Ce]|1<Ae.length?(Ce=this,qe=Ae):(Ce=Ae,qe=this);for(var ze=0,Ve=0;Ve>>26;for(;0!==ze&&Ve>>26;if(this.length=Ce.length,0!==ze)this.words[this.length]=ze,this.length++;else if(Ce!==this)for(;VeAe.length?this.clone().iadd(Ae):Ae.clone().iadd(this)},n.prototype.isub=function(Ae){if(0!==Ae.negative){Ae.negative=0;var ke=this.iadd(Ae);return Ae.negative=1,ke._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(Ae),this.negative=1,this._normSign();var Ce,qe,ze=this.cmp(Ae);if(0===ze)return this.negative=0,this.length=1,this.words[0]=0,this;ze>0?(Ce=this,qe=Ae):(Ce=Ae,qe=this);for(var Ve=0,tt=0;tt>26,this.words[tt]=67108863&ke;for(;0!==Ve&&tt>26,this.words[tt]=67108863&ke;if(0===Ve&&tt>>13,ft=0|tt[1],mt=8191&ft,yt=ft>>>13,Et=0|tt[2],kt=8191&Et,St=Et>>>13,Rt=0|tt[3],Pt=8191&Rt,Tt=Rt>>>13,It=0|tt[4],Bt=8191&It,Dt=It>>>13,Ot=0|tt[5],Nt=8191&Ot,Ut=Ot>>>13,Lt=0|tt[6],Kt=8191&Lt,Ft=Lt>>>13,qt=0|tt[7],zt=8191&qt,Ht=qt>>>13,$t=0|tt[8],Gt=8191&$t,Vt=$t>>>13,Xt=0|tt[9],Zt=8191&Xt,Yt=Xt>>>13,Qt=0|rt[0],Jt=8191&Qt,er=Qt>>>13,tr=0|rt[1],rr=8191&tr,nr=tr>>>13,ir=0|rt[2],sr=8191&ir,vr=ir>>>13,_r=0|rt[3],Er=8191&_r,Ar=_r>>>13,kr=0|rt[4],Sr=8191&kr,xr=kr>>>13,Rr=0|rt[5],Ir=8191&Rr,Br=Rr>>>13,Dr=0|rt[6],Ur=8191&Dr,Lr=Dr>>>13,Gr=0|rt[7],Vr=8191&Gr,Xr=Gr>>>13,Qr=0|rt[8],sn=8191&Qr,on=Qr>>>13,an=0|rt[9],cn=8191&an,un=an>>>13;Ce.negative=Ae.negative^ke.negative,Ce.length=19;var hn=(it+(qe=Math.imul(ct,Jt))|0)+((8191&(ze=(ze=Math.imul(ct,er))+Math.imul(ht,Jt)|0))<<13)|0;it=((Ve=Math.imul(ht,er))+(ze>>>13)|0)+(hn>>>26)|0,hn&=67108863,qe=Math.imul(mt,Jt),ze=(ze=Math.imul(mt,er))+Math.imul(yt,Jt)|0,Ve=Math.imul(yt,er);var mn=(it+(qe=qe+Math.imul(ct,rr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,nr)|0)+Math.imul(ht,rr)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,nr)|0)+(ze>>>13)|0)+(mn>>>26)|0,mn&=67108863,qe=Math.imul(kt,Jt),ze=(ze=Math.imul(kt,er))+Math.imul(St,Jt)|0,Ve=Math.imul(St,er),qe=qe+Math.imul(mt,rr)|0,ze=(ze=ze+Math.imul(mt,nr)|0)+Math.imul(yt,rr)|0,Ve=Ve+Math.imul(yt,nr)|0;var bn=(it+(qe=qe+Math.imul(ct,sr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,vr)|0)+Math.imul(ht,sr)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,vr)|0)+(ze>>>13)|0)+(bn>>>26)|0,bn&=67108863,qe=Math.imul(Pt,Jt),ze=(ze=Math.imul(Pt,er))+Math.imul(Tt,Jt)|0,Ve=Math.imul(Tt,er),qe=qe+Math.imul(kt,rr)|0,ze=(ze=ze+Math.imul(kt,nr)|0)+Math.imul(St,rr)|0,Ve=Ve+Math.imul(St,nr)|0,qe=qe+Math.imul(mt,sr)|0,ze=(ze=ze+Math.imul(mt,vr)|0)+Math.imul(yt,sr)|0,Ve=Ve+Math.imul(yt,vr)|0;var vn=(it+(qe=qe+Math.imul(ct,Er)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Ar)|0)+Math.imul(ht,Er)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,Ar)|0)+(ze>>>13)|0)+(vn>>>26)|0,vn&=67108863,qe=Math.imul(Bt,Jt),ze=(ze=Math.imul(Bt,er))+Math.imul(Dt,Jt)|0,Ve=Math.imul(Dt,er),qe=qe+Math.imul(Pt,rr)|0,ze=(ze=ze+Math.imul(Pt,nr)|0)+Math.imul(Tt,rr)|0,Ve=Ve+Math.imul(Tt,nr)|0,qe=qe+Math.imul(kt,sr)|0,ze=(ze=ze+Math.imul(kt,vr)|0)+Math.imul(St,sr)|0,Ve=Ve+Math.imul(St,vr)|0,qe=qe+Math.imul(mt,Er)|0,ze=(ze=ze+Math.imul(mt,Ar)|0)+Math.imul(yt,Er)|0,Ve=Ve+Math.imul(yt,Ar)|0;var _n=(it+(qe=qe+Math.imul(ct,Sr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,xr)|0)+Math.imul(ht,Sr)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,xr)|0)+(ze>>>13)|0)+(_n>>>26)|0,_n&=67108863,qe=Math.imul(Nt,Jt),ze=(ze=Math.imul(Nt,er))+Math.imul(Ut,Jt)|0,Ve=Math.imul(Ut,er),qe=qe+Math.imul(Bt,rr)|0,ze=(ze=ze+Math.imul(Bt,nr)|0)+Math.imul(Dt,rr)|0,Ve=Ve+Math.imul(Dt,nr)|0,qe=qe+Math.imul(Pt,sr)|0,ze=(ze=ze+Math.imul(Pt,vr)|0)+Math.imul(Tt,sr)|0,Ve=Ve+Math.imul(Tt,vr)|0,qe=qe+Math.imul(kt,Er)|0,ze=(ze=ze+Math.imul(kt,Ar)|0)+Math.imul(St,Er)|0,Ve=Ve+Math.imul(St,Ar)|0,qe=qe+Math.imul(mt,Sr)|0,ze=(ze=ze+Math.imul(mt,xr)|0)+Math.imul(yt,Sr)|0,Ve=Ve+Math.imul(yt,xr)|0;var En=(it+(qe=qe+Math.imul(ct,Ir)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Br)|0)+Math.imul(ht,Ir)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,Br)|0)+(ze>>>13)|0)+(En>>>26)|0,En&=67108863,qe=Math.imul(Kt,Jt),ze=(ze=Math.imul(Kt,er))+Math.imul(Ft,Jt)|0,Ve=Math.imul(Ft,er),qe=qe+Math.imul(Nt,rr)|0,ze=(ze=ze+Math.imul(Nt,nr)|0)+Math.imul(Ut,rr)|0,Ve=Ve+Math.imul(Ut,nr)|0,qe=qe+Math.imul(Bt,sr)|0,ze=(ze=ze+Math.imul(Bt,vr)|0)+Math.imul(Dt,sr)|0,Ve=Ve+Math.imul(Dt,vr)|0,qe=qe+Math.imul(Pt,Er)|0,ze=(ze=ze+Math.imul(Pt,Ar)|0)+Math.imul(Tt,Er)|0,Ve=Ve+Math.imul(Tt,Ar)|0,qe=qe+Math.imul(kt,Sr)|0,ze=(ze=ze+Math.imul(kt,xr)|0)+Math.imul(St,Sr)|0,Ve=Ve+Math.imul(St,xr)|0,qe=qe+Math.imul(mt,Ir)|0,ze=(ze=ze+Math.imul(mt,Br)|0)+Math.imul(yt,Ir)|0,Ve=Ve+Math.imul(yt,Br)|0;var An=(it+(qe=qe+Math.imul(ct,Ur)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Lr)|0)+Math.imul(ht,Ur)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,Lr)|0)+(ze>>>13)|0)+(An>>>26)|0,An&=67108863,qe=Math.imul(zt,Jt),ze=(ze=Math.imul(zt,er))+Math.imul(Ht,Jt)|0,Ve=Math.imul(Ht,er),qe=qe+Math.imul(Kt,rr)|0,ze=(ze=ze+Math.imul(Kt,nr)|0)+Math.imul(Ft,rr)|0,Ve=Ve+Math.imul(Ft,nr)|0,qe=qe+Math.imul(Nt,sr)|0,ze=(ze=ze+Math.imul(Nt,vr)|0)+Math.imul(Ut,sr)|0,Ve=Ve+Math.imul(Ut,vr)|0,qe=qe+Math.imul(Bt,Er)|0,ze=(ze=ze+Math.imul(Bt,Ar)|0)+Math.imul(Dt,Er)|0,Ve=Ve+Math.imul(Dt,Ar)|0,qe=qe+Math.imul(Pt,Sr)|0,ze=(ze=ze+Math.imul(Pt,xr)|0)+Math.imul(Tt,Sr)|0,Ve=Ve+Math.imul(Tt,xr)|0,qe=qe+Math.imul(kt,Ir)|0,ze=(ze=ze+Math.imul(kt,Br)|0)+Math.imul(St,Ir)|0,Ve=Ve+Math.imul(St,Br)|0,qe=qe+Math.imul(mt,Ur)|0,ze=(ze=ze+Math.imul(mt,Lr)|0)+Math.imul(yt,Ur)|0,Ve=Ve+Math.imul(yt,Lr)|0;var kn=(it+(qe=qe+Math.imul(ct,Vr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Xr)|0)+Math.imul(ht,Vr)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,Xr)|0)+(ze>>>13)|0)+(kn>>>26)|0,kn&=67108863,qe=Math.imul(Gt,Jt),ze=(ze=Math.imul(Gt,er))+Math.imul(Vt,Jt)|0,Ve=Math.imul(Vt,er),qe=qe+Math.imul(zt,rr)|0,ze=(ze=ze+Math.imul(zt,nr)|0)+Math.imul(Ht,rr)|0,Ve=Ve+Math.imul(Ht,nr)|0,qe=qe+Math.imul(Kt,sr)|0,ze=(ze=ze+Math.imul(Kt,vr)|0)+Math.imul(Ft,sr)|0,Ve=Ve+Math.imul(Ft,vr)|0,qe=qe+Math.imul(Nt,Er)|0,ze=(ze=ze+Math.imul(Nt,Ar)|0)+Math.imul(Ut,Er)|0,Ve=Ve+Math.imul(Ut,Ar)|0,qe=qe+Math.imul(Bt,Sr)|0,ze=(ze=ze+Math.imul(Bt,xr)|0)+Math.imul(Dt,Sr)|0,Ve=Ve+Math.imul(Dt,xr)|0,qe=qe+Math.imul(Pt,Ir)|0,ze=(ze=ze+Math.imul(Pt,Br)|0)+Math.imul(Tt,Ir)|0,Ve=Ve+Math.imul(Tt,Br)|0,qe=qe+Math.imul(kt,Ur)|0,ze=(ze=ze+Math.imul(kt,Lr)|0)+Math.imul(St,Ur)|0,Ve=Ve+Math.imul(St,Lr)|0,qe=qe+Math.imul(mt,Vr)|0,ze=(ze=ze+Math.imul(mt,Xr)|0)+Math.imul(yt,Vr)|0,Ve=Ve+Math.imul(yt,Xr)|0;var Sn=(it+(qe=qe+Math.imul(ct,sn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,on)|0)+Math.imul(ht,sn)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,on)|0)+(ze>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,qe=Math.imul(Zt,Jt),ze=(ze=Math.imul(Zt,er))+Math.imul(Yt,Jt)|0,Ve=Math.imul(Yt,er),qe=qe+Math.imul(Gt,rr)|0,ze=(ze=ze+Math.imul(Gt,nr)|0)+Math.imul(Vt,rr)|0,Ve=Ve+Math.imul(Vt,nr)|0,qe=qe+Math.imul(zt,sr)|0,ze=(ze=ze+Math.imul(zt,vr)|0)+Math.imul(Ht,sr)|0,Ve=Ve+Math.imul(Ht,vr)|0,qe=qe+Math.imul(Kt,Er)|0,ze=(ze=ze+Math.imul(Kt,Ar)|0)+Math.imul(Ft,Er)|0,Ve=Ve+Math.imul(Ft,Ar)|0,qe=qe+Math.imul(Nt,Sr)|0,ze=(ze=ze+Math.imul(Nt,xr)|0)+Math.imul(Ut,Sr)|0,Ve=Ve+Math.imul(Ut,xr)|0,qe=qe+Math.imul(Bt,Ir)|0,ze=(ze=ze+Math.imul(Bt,Br)|0)+Math.imul(Dt,Ir)|0,Ve=Ve+Math.imul(Dt,Br)|0,qe=qe+Math.imul(Pt,Ur)|0,ze=(ze=ze+Math.imul(Pt,Lr)|0)+Math.imul(Tt,Ur)|0,Ve=Ve+Math.imul(Tt,Lr)|0,qe=qe+Math.imul(kt,Vr)|0,ze=(ze=ze+Math.imul(kt,Xr)|0)+Math.imul(St,Vr)|0,Ve=Ve+Math.imul(St,Xr)|0,qe=qe+Math.imul(mt,sn)|0,ze=(ze=ze+Math.imul(mt,on)|0)+Math.imul(yt,sn)|0,Ve=Ve+Math.imul(yt,on)|0;var Pn=(it+(qe=qe+Math.imul(ct,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,un)|0)+Math.imul(ht,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,un)|0)+(ze>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,qe=Math.imul(Zt,rr),ze=(ze=Math.imul(Zt,nr))+Math.imul(Yt,rr)|0,Ve=Math.imul(Yt,nr),qe=qe+Math.imul(Gt,sr)|0,ze=(ze=ze+Math.imul(Gt,vr)|0)+Math.imul(Vt,sr)|0,Ve=Ve+Math.imul(Vt,vr)|0,qe=qe+Math.imul(zt,Er)|0,ze=(ze=ze+Math.imul(zt,Ar)|0)+Math.imul(Ht,Er)|0,Ve=Ve+Math.imul(Ht,Ar)|0,qe=qe+Math.imul(Kt,Sr)|0,ze=(ze=ze+Math.imul(Kt,xr)|0)+Math.imul(Ft,Sr)|0,Ve=Ve+Math.imul(Ft,xr)|0,qe=qe+Math.imul(Nt,Ir)|0,ze=(ze=ze+Math.imul(Nt,Br)|0)+Math.imul(Ut,Ir)|0,Ve=Ve+Math.imul(Ut,Br)|0,qe=qe+Math.imul(Bt,Ur)|0,ze=(ze=ze+Math.imul(Bt,Lr)|0)+Math.imul(Dt,Ur)|0,Ve=Ve+Math.imul(Dt,Lr)|0,qe=qe+Math.imul(Pt,Vr)|0,ze=(ze=ze+Math.imul(Pt,Xr)|0)+Math.imul(Tt,Vr)|0,Ve=Ve+Math.imul(Tt,Xr)|0,qe=qe+Math.imul(kt,sn)|0,ze=(ze=ze+Math.imul(kt,on)|0)+Math.imul(St,sn)|0,Ve=Ve+Math.imul(St,on)|0;var Dn=(it+(qe=qe+Math.imul(mt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(mt,un)|0)+Math.imul(yt,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(yt,un)|0)+(ze>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,qe=Math.imul(Zt,sr),ze=(ze=Math.imul(Zt,vr))+Math.imul(Yt,sr)|0,Ve=Math.imul(Yt,vr),qe=qe+Math.imul(Gt,Er)|0,ze=(ze=ze+Math.imul(Gt,Ar)|0)+Math.imul(Vt,Er)|0,Ve=Ve+Math.imul(Vt,Ar)|0,qe=qe+Math.imul(zt,Sr)|0,ze=(ze=ze+Math.imul(zt,xr)|0)+Math.imul(Ht,Sr)|0,Ve=Ve+Math.imul(Ht,xr)|0,qe=qe+Math.imul(Kt,Ir)|0,ze=(ze=ze+Math.imul(Kt,Br)|0)+Math.imul(Ft,Ir)|0,Ve=Ve+Math.imul(Ft,Br)|0,qe=qe+Math.imul(Nt,Ur)|0,ze=(ze=ze+Math.imul(Nt,Lr)|0)+Math.imul(Ut,Ur)|0,Ve=Ve+Math.imul(Ut,Lr)|0,qe=qe+Math.imul(Bt,Vr)|0,ze=(ze=ze+Math.imul(Bt,Xr)|0)+Math.imul(Dt,Vr)|0,Ve=Ve+Math.imul(Dt,Xr)|0,qe=qe+Math.imul(Pt,sn)|0,ze=(ze=ze+Math.imul(Pt,on)|0)+Math.imul(Tt,sn)|0,Ve=Ve+Math.imul(Tt,on)|0;var On=(it+(qe=qe+Math.imul(kt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(kt,un)|0)+Math.imul(St,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(St,un)|0)+(ze>>>13)|0)+(On>>>26)|0,On&=67108863,qe=Math.imul(Zt,Er),ze=(ze=Math.imul(Zt,Ar))+Math.imul(Yt,Er)|0,Ve=Math.imul(Yt,Ar),qe=qe+Math.imul(Gt,Sr)|0,ze=(ze=ze+Math.imul(Gt,xr)|0)+Math.imul(Vt,Sr)|0,Ve=Ve+Math.imul(Vt,xr)|0,qe=qe+Math.imul(zt,Ir)|0,ze=(ze=ze+Math.imul(zt,Br)|0)+Math.imul(Ht,Ir)|0,Ve=Ve+Math.imul(Ht,Br)|0,qe=qe+Math.imul(Kt,Ur)|0,ze=(ze=ze+Math.imul(Kt,Lr)|0)+Math.imul(Ft,Ur)|0,Ve=Ve+Math.imul(Ft,Lr)|0,qe=qe+Math.imul(Nt,Vr)|0,ze=(ze=ze+Math.imul(Nt,Xr)|0)+Math.imul(Ut,Vr)|0,Ve=Ve+Math.imul(Ut,Xr)|0,qe=qe+Math.imul(Bt,sn)|0,ze=(ze=ze+Math.imul(Bt,on)|0)+Math.imul(Dt,sn)|0,Ve=Ve+Math.imul(Dt,on)|0;var Un=(it+(qe=qe+Math.imul(Pt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Pt,un)|0)+Math.imul(Tt,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Tt,un)|0)+(ze>>>13)|0)+(Un>>>26)|0,Un&=67108863,qe=Math.imul(Zt,Sr),ze=(ze=Math.imul(Zt,xr))+Math.imul(Yt,Sr)|0,Ve=Math.imul(Yt,xr),qe=qe+Math.imul(Gt,Ir)|0,ze=(ze=ze+Math.imul(Gt,Br)|0)+Math.imul(Vt,Ir)|0,Ve=Ve+Math.imul(Vt,Br)|0,qe=qe+Math.imul(zt,Ur)|0,ze=(ze=ze+Math.imul(zt,Lr)|0)+Math.imul(Ht,Ur)|0,Ve=Ve+Math.imul(Ht,Lr)|0,qe=qe+Math.imul(Kt,Vr)|0,ze=(ze=ze+Math.imul(Kt,Xr)|0)+Math.imul(Ft,Vr)|0,Ve=Ve+Math.imul(Ft,Xr)|0,qe=qe+Math.imul(Nt,sn)|0,ze=(ze=ze+Math.imul(Nt,on)|0)+Math.imul(Ut,sn)|0,Ve=Ve+Math.imul(Ut,on)|0;var Fn=(it+(qe=qe+Math.imul(Bt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Bt,un)|0)+Math.imul(Dt,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Dt,un)|0)+(ze>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,qe=Math.imul(Zt,Ir),ze=(ze=Math.imul(Zt,Br))+Math.imul(Yt,Ir)|0,Ve=Math.imul(Yt,Br),qe=qe+Math.imul(Gt,Ur)|0,ze=(ze=ze+Math.imul(Gt,Lr)|0)+Math.imul(Vt,Ur)|0,Ve=Ve+Math.imul(Vt,Lr)|0,qe=qe+Math.imul(zt,Vr)|0,ze=(ze=ze+Math.imul(zt,Xr)|0)+Math.imul(Ht,Vr)|0,Ve=Ve+Math.imul(Ht,Xr)|0,qe=qe+Math.imul(Kt,sn)|0,ze=(ze=ze+Math.imul(Kt,on)|0)+Math.imul(Ft,sn)|0,Ve=Ve+Math.imul(Ft,on)|0;var qn=(it+(qe=qe+Math.imul(Nt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Nt,un)|0)+Math.imul(Ut,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Ut,un)|0)+(ze>>>13)|0)+(qn>>>26)|0,qn&=67108863,qe=Math.imul(Zt,Ur),ze=(ze=Math.imul(Zt,Lr))+Math.imul(Yt,Ur)|0,Ve=Math.imul(Yt,Lr),qe=qe+Math.imul(Gt,Vr)|0,ze=(ze=ze+Math.imul(Gt,Xr)|0)+Math.imul(Vt,Vr)|0,Ve=Ve+Math.imul(Vt,Xr)|0,qe=qe+Math.imul(zt,sn)|0,ze=(ze=ze+Math.imul(zt,on)|0)+Math.imul(Ht,sn)|0,Ve=Ve+Math.imul(Ht,on)|0;var Hn=(it+(qe=qe+Math.imul(Kt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Kt,un)|0)+Math.imul(Ft,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Ft,un)|0)+(ze>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,qe=Math.imul(Zt,Vr),ze=(ze=Math.imul(Zt,Xr))+Math.imul(Yt,Vr)|0,Ve=Math.imul(Yt,Xr),qe=qe+Math.imul(Gt,sn)|0,ze=(ze=ze+Math.imul(Gt,on)|0)+Math.imul(Vt,sn)|0,Ve=Ve+Math.imul(Vt,on)|0;var $n=(it+(qe=qe+Math.imul(zt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(zt,un)|0)+Math.imul(Ht,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Ht,un)|0)+(ze>>>13)|0)+($n>>>26)|0,$n&=67108863,qe=Math.imul(Zt,sn),ze=(ze=Math.imul(Zt,on))+Math.imul(Yt,sn)|0,Ve=Math.imul(Yt,on);var Gn=(it+(qe=qe+Math.imul(Gt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Gt,un)|0)+Math.imul(Vt,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Vt,un)|0)+(ze>>>13)|0)+(Gn>>>26)|0,Gn&=67108863;var Vn=(it+(qe=Math.imul(Zt,cn))|0)+((8191&(ze=(ze=Math.imul(Zt,un))+Math.imul(Yt,cn)|0))<<13)|0;return it=((Ve=Math.imul(Yt,un))+(ze>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,nt[0]=hn,nt[1]=mn,nt[2]=bn,nt[3]=vn,nt[4]=_n,nt[5]=En,nt[6]=An,nt[7]=kn,nt[8]=Sn,nt[9]=Pn,nt[10]=Dn,nt[11]=On,nt[12]=Un,nt[13]=Fn,nt[14]=qn,nt[15]=Hn,nt[16]=$n,nt[17]=Gn,nt[18]=Vn,0!==it&&(nt[19]=it,Ce.length++),Ce};function p(Ae,ke,Ce){return(new y).mulp(Ae,ke,Ce)}function y(Ae,ke){this.x=Ae,this.y=ke}Math.imul||(l=d),n.prototype.mulTo=function(Ae,ke){var Ce=this.length+Ae.length;return 10===this.length&&10===Ae.length?l(this,Ae,ke):Ce<63?d(this,Ae,ke):Ce<1024?function(Ae,ke,Ce){Ce.negative=ke.negative^Ae.negative,Ce.length=Ae.length+ke.length;for(var qe=0,ze=0,Ve=0;Ve>>26)|0)>>>26,tt&=67108863}Ce.words[Ve]=rt,qe=tt,tt=ze}return 0!==qe?Ce.words[Ve]=qe:Ce.length--,Ce.strip()}(this,Ae,ke):p(this,Ae,ke)},y.prototype.makeRBT=function(Ae){for(var ke=Array(Ae),Ce=n.prototype._countBits(Ae)-1,qe=0;qe>=1;return qe},y.prototype.permute=function(Ae,ke,Ce,qe,ze,Ve){for(var tt=0;tt>>=1)ze++;return 1<>>=13,Ce[2*Ve+1]=8191&ze,ze>>>=13;for(Ve=2*ke;Ve>=26,ke+=qe/67108864|0,ke+=ze>>>26,this.words[Ce]=67108863&ze}return 0!==ke&&(this.words[Ce]=ke,this.length++),this},n.prototype.muln=function(Ae){return this.clone().imuln(Ae)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(Ae){var ke=function(Ae){for(var ke=Array(Ae.bitLength()),Ce=0;Ce>>ze}return ke}(Ae);if(0===ke.length)return new n(1);for(var Ce=this,qe=0;qe=0);var ke,Ce=Ae%26,qe=(Ae-Ce)/26,ze=67108863>>>26-Ce<<26-Ce;if(0!==Ce){var Ve=0;for(ke=0;ke>>26-Ce}Ve&&(this.words[ke]=Ve,this.length++)}if(0!==qe){for(ke=this.length-1;ke>=0;ke--)this.words[ke+qe]=this.words[ke];for(ke=0;ke=0),qe=ke?(ke-ke%26)/26:0;var ze=Ae%26,Ve=Math.min((Ae-ze)/26,this.length),tt=67108863^67108863>>>ze<Ve)for(this.length-=Ve,nt=0;nt=0&&(0!==it||nt>=qe);nt--){var ot=0|this.words[nt];this.words[nt]=it<<26-ze|ot>>>ze,it=ot&tt}return rt&&0!==it&&(rt.words[rt.length++]=it),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(Ae,ke,Ce){return r(0===this.negative),this.iushrn(Ae,ke,Ce)},n.prototype.shln=function(Ae){return this.clone().ishln(Ae)},n.prototype.ushln=function(Ae){return this.clone().iushln(Ae)},n.prototype.shrn=function(Ae){return this.clone().ishrn(Ae)},n.prototype.ushrn=function(Ae){return this.clone().iushrn(Ae)},n.prototype.testn=function(Ae){r("number"==typeof Ae&&Ae>=0);var ke=Ae%26,Ce=(Ae-ke)/26,qe=1<=0);var ke=Ae%26,Ce=(Ae-ke)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=Ce)return this;if(0!==ke&&Ce++,this.length=Math.min(Ce,this.length),0!==ke){var qe=67108863^67108863>>>ke<=67108864;ke++)this.words[ke]-=67108864,ke===this.length-1?this.words[ke+1]=1:this.words[ke+1]++;return this.length=Math.max(this.length,ke+1),this},n.prototype.isubn=function(Ae){if(r("number"==typeof Ae),r(Ae<67108864),Ae<0)return this.iaddn(-Ae);if(0!==this.negative)return this.negative=0,this.iaddn(Ae),this.negative=1,this;if(this.words[0]-=Ae,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var ke=0;ke>26)-(rt/67108864|0),this.words[qe+Ce]=67108863&ze}for(;qe>26,this.words[qe+Ce]=67108863&ze;if(0===tt)return this.strip();for(r(-1===tt),tt=0,qe=0;qe>26,this.words[qe]=67108863&ze;return this.negative=1,this.strip()},n.prototype._wordDiv=function(Ae,ke){var Ce=(this.length,Ae.length),qe=this.clone(),ze=Ae,Ve=0|ze.words[ze.length-1];0!==(Ce=26-this._countBits(Ve))&&(ze=ze.ushln(Ce),qe.iushln(Ce),Ve=0|ze.words[ze.length-1]);var tt,rt=qe.length-ze.length;if("mod"!==ke){(tt=new n(null)).length=rt+1,tt.words=Array(tt.length);for(var nt=0;nt=0;ot--){var ct=67108864*(0|qe.words[ze.length+ot])+(0|qe.words[ze.length+ot-1]);for(ct=Math.min(ct/Ve|0,67108863),qe._ishlnsubmul(ze,ct,ot);0!==qe.negative;)ct--,qe.negative=0,qe._ishlnsubmul(ze,1,ot),qe.isZero()||(qe.negative^=1);tt&&(tt.words[ot]=ct)}return tt&&tt.strip(),qe.strip(),"div"!==ke&&0!==Ce&&qe.iushrn(Ce),{div:tt||null,mod:qe}},n.prototype.divmod=function(Ae,ke,Ce){return r(!Ae.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===Ae.negative?(Ve=this.neg().divmod(Ae,ke),"mod"!==ke&&(qe=Ve.div.neg()),"div"!==ke&&(ze=Ve.mod.neg(),Ce&&0!==ze.negative&&ze.iadd(Ae)),{div:qe,mod:ze}):0===this.negative&&0!==Ae.negative?(Ve=this.divmod(Ae.neg(),ke),"mod"!==ke&&(qe=Ve.div.neg()),{div:qe,mod:Ve.mod}):0!=(this.negative&Ae.negative)?(Ve=this.neg().divmod(Ae.neg(),ke),"div"!==ke&&(ze=Ve.mod.neg(),Ce&&0!==ze.negative&&ze.isub(Ae)),{div:Ve.div,mod:ze}):Ae.length>this.length||this.cmp(Ae)<0?{div:new n(0),mod:this}:1===Ae.length?"div"===ke?{div:this.divn(Ae.words[0]),mod:null}:"mod"===ke?{div:null,mod:new n(this.modn(Ae.words[0]))}:{div:this.divn(Ae.words[0]),mod:new n(this.modn(Ae.words[0]))}:this._wordDiv(Ae,ke);var qe,ze,Ve},n.prototype.div=function(Ae){return this.divmod(Ae,"div",!1).div},n.prototype.mod=function(Ae){return this.divmod(Ae,"mod",!1).mod},n.prototype.umod=function(Ae){return this.divmod(Ae,"mod",!0).mod},n.prototype.divRound=function(Ae){var ke=this.divmod(Ae);if(ke.mod.isZero())return ke.div;var Ce=0!==ke.div.negative?ke.mod.isub(Ae):ke.mod,qe=Ae.ushrn(1),ze=Ae.andln(1),Ve=Ce.cmp(qe);return Ve<0||1===ze&&0===Ve?ke.div:0!==ke.div.negative?ke.div.isubn(1):ke.div.iaddn(1)},n.prototype.modn=function(Ae){r(Ae<=67108863);for(var ke=(1<<26)%Ae,Ce=0,qe=this.length-1;qe>=0;qe--)Ce=(ke*Ce+(0|this.words[qe]))%Ae;return Ce},n.prototype.idivn=function(Ae){r(Ae<=67108863);for(var ke=0,Ce=this.length-1;Ce>=0;Ce--){var qe=(0|this.words[Ce])+67108864*ke;this.words[Ce]=qe/Ae|0,ke=qe%Ae}return this.strip()},n.prototype.divn=function(Ae){return this.clone().idivn(Ae)},n.prototype.egcd=function(Ae){r(0===Ae.negative),r(!Ae.isZero());var ke=this,Ce=Ae.clone();ke=0!==ke.negative?ke.umod(Ae):ke.clone();for(var qe=new n(1),ze=new n(0),Ve=new n(0),tt=new n(1),rt=0;ke.isEven()&&Ce.isEven();)ke.iushrn(1),Ce.iushrn(1),++rt;for(var nt=Ce.clone(),it=ke.clone();!ke.isZero();){for(var ot=0,ct=1;0==(ke.words[0]&ct)&&ot<26;++ot,ct<<=1);if(ot>0)for(ke.iushrn(ot);ot-- >0;)(qe.isOdd()||ze.isOdd())&&(qe.iadd(nt),ze.isub(it)),qe.iushrn(1),ze.iushrn(1);for(var ht=0,ft=1;0==(Ce.words[0]&ft)&&ht<26;++ht,ft<<=1);if(ht>0)for(Ce.iushrn(ht);ht-- >0;)(Ve.isOdd()||tt.isOdd())&&(Ve.iadd(nt),tt.isub(it)),Ve.iushrn(1),tt.iushrn(1);ke.cmp(Ce)>=0?(ke.isub(Ce),qe.isub(Ve),ze.isub(tt)):(Ce.isub(ke),Ve.isub(qe),tt.isub(ze))}return{a:Ve,b:tt,gcd:Ce.iushln(rt)}},n.prototype._invmp=function(Ae){r(0===Ae.negative),r(!Ae.isZero());var ke=this,Ce=Ae.clone();ke=0!==ke.negative?ke.umod(Ae):ke.clone();for(var qe,ze=new n(1),Ve=new n(0),tt=Ce.clone();ke.cmpn(1)>0&&Ce.cmpn(1)>0;){for(var rt=0,nt=1;0==(ke.words[0]&nt)&&rt<26;++rt,nt<<=1);if(rt>0)for(ke.iushrn(rt);rt-- >0;)ze.isOdd()&&ze.iadd(tt),ze.iushrn(1);for(var it=0,ot=1;0==(Ce.words[0]&ot)&&it<26;++it,ot<<=1);if(it>0)for(Ce.iushrn(it);it-- >0;)Ve.isOdd()&&Ve.iadd(tt),Ve.iushrn(1);ke.cmp(Ce)>=0?(ke.isub(Ce),ze.isub(Ve)):(Ce.isub(ke),Ve.isub(ze))}return(qe=0===ke.cmpn(1)?ze:Ve).cmpn(0)<0&&qe.iadd(Ae),qe},n.prototype.gcd=function(Ae){if(this.isZero())return Ae.abs();if(Ae.isZero())return this.abs();var ke=this.clone(),Ce=Ae.clone();ke.negative=0,Ce.negative=0;for(var qe=0;ke.isEven()&&Ce.isEven();qe++)ke.iushrn(1),Ce.iushrn(1);for(;;){for(;ke.isEven();)ke.iushrn(1);for(;Ce.isEven();)Ce.iushrn(1);var ze=ke.cmp(Ce);if(ze<0){var Ve=ke;ke=Ce,Ce=Ve}else if(0===ze||0===Ce.cmpn(1))break;ke.isub(Ce)}return Ce.iushln(qe)},n.prototype.invm=function(Ae){return this.egcd(Ae).a.umod(Ae)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(Ae){return this.words[0]&Ae},n.prototype.bincn=function(Ae){r("number"==typeof Ae);var ke=Ae%26,Ce=(Ae-ke)/26,qe=1<>>26,tt&=67108863,this.words[Ve]=tt}return 0!==ze&&(this.words[Ve]=ze,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(Ae){var ke,Ce=Ae<0;if(0!==this.negative&&!Ce)return-1;if(0===this.negative&&Ce)return 1;if(this.strip(),this.length>1)ke=1;else{Ce&&(Ae=-Ae),r(Ae<=67108863,"Number is too big");var qe=0|this.words[0];ke=qe===Ae?0:qeAe.length)return 1;if(this.length=0;Ce--){var qe=0|this.words[Ce],ze=0|Ae.words[Ce];if(qe!==ze){qeze&&(ke=1);break}}return ke},n.prototype.gtn=function(Ae){return 1===this.cmpn(Ae)},n.prototype.gt=function(Ae){return 1===this.cmp(Ae)},n.prototype.gten=function(Ae){return this.cmpn(Ae)>=0},n.prototype.gte=function(Ae){return this.cmp(Ae)>=0},n.prototype.ltn=function(Ae){return-1===this.cmpn(Ae)},n.prototype.lt=function(Ae){return-1===this.cmp(Ae)},n.prototype.lten=function(Ae){return this.cmpn(Ae)<=0},n.prototype.lte=function(Ae){return this.cmp(Ae)<=0},n.prototype.eqn=function(Ae){return 0===this.cmpn(Ae)},n.prototype.eq=function(Ae){return 0===this.cmp(Ae)},n.red=function(Ae){return new k(Ae)},n.prototype.toRed=function(Ae){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),Ae.convertTo(this)._forceRed(Ae)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(Ae){return this.red=Ae,this},n.prototype.forceRed=function(Ae){return r(!this.red,"Already a number in reduction context"),this._forceRed(Ae)},n.prototype.redAdd=function(Ae){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,Ae)},n.prototype.redIAdd=function(Ae){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Ae)},n.prototype.redSub=function(Ae){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,Ae)},n.prototype.redISub=function(Ae){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,Ae)},n.prototype.redShl=function(Ae){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,Ae)},n.prototype.redMul=function(Ae){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ae),this.red.mul(this,Ae)},n.prototype.redIMul=function(Ae){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ae),this.red.imul(this,Ae)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(Ae){return r(this.red&&!Ae.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Ae)};var tt={k256:null,p224:null,p192:null,p25519:null};function m(Ae,ke){this.name=Ae,this.p=new n(ke,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(Ae){if("string"==typeof Ae){var ke=n._prime(Ae);this.m=ke.p,this.prime=ke}else r(Ae.gtn(1),"modulus must be greater than 1"),this.m=Ae,this.prime=null}function A(Ae){k.call(this,Ae),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 Ae=new n(null);return Ae.words=Array(Math.ceil(this.n/13)),Ae},m.prototype.ireduce=function(Ae){var ke,Ce=Ae;do{this.split(Ce,this.tmp),ke=(Ce=(Ce=this.imulK(Ce)).iadd(this.tmp)).bitLength()}while(ke>this.n);var qe=ke0?Ce.isub(this.p):Ce.strip(),Ce},m.prototype.split=function(Ae,ke){Ae.iushrn(this.n,0,ke)},m.prototype.imulK=function(Ae){return Ae.imul(this.k)},i(g,m),g.prototype.split=function(Ae,ke){for(var Ce=4194303,qe=Math.min(Ae.length,9),ze=0;ze>>22,Ve=tt}Ve>>>=22,Ae.words[ze-10]=Ve,0===Ve&&Ae.length>10?Ae.length-=10:Ae.length-=9},g.prototype.imulK=function(Ae){Ae.words[Ae.length]=0,Ae.words[Ae.length+1]=0,Ae.length+=2;for(var ke=0,Ce=0;Ce>>=26,Ae.words[Ce]=ze,ke=qe}return 0!==ke&&(Ae.words[Ae.length++]=ke),Ae},n._prime=function(Ae){if(tt[Ae])return tt[Ae];var ke;if("k256"===Ae)ke=new g;else if("p224"===Ae)ke=new w;else if("p192"===Ae)ke=new v;else{if("p25519"!==Ae)throw Error("Unknown prime "+Ae);ke=new _}return tt[Ae]=ke,ke},k.prototype._verify1=function(Ae){r(0===Ae.negative,"red works only with positives"),r(Ae.red,"red works only with red numbers")},k.prototype._verify2=function(Ae,ke){r(0==(Ae.negative|ke.negative),"red works only with positives"),r(Ae.red&&Ae.red===ke.red,"red works only with red numbers")},k.prototype.imod=function(Ae){return this.prime?this.prime.ireduce(Ae)._forceRed(this):Ae.umod(this.m)._forceRed(this)},k.prototype.neg=function(Ae){return Ae.isZero()?Ae.clone():this.m.sub(Ae)._forceRed(this)},k.prototype.add=function(Ae,ke){this._verify2(Ae,ke);var Ce=Ae.add(ke);return Ce.cmp(this.m)>=0&&Ce.isub(this.m),Ce._forceRed(this)},k.prototype.iadd=function(Ae,ke){this._verify2(Ae,ke);var Ce=Ae.iadd(ke);return Ce.cmp(this.m)>=0&&Ce.isub(this.m),Ce},k.prototype.sub=function(Ae,ke){this._verify2(Ae,ke);var Ce=Ae.sub(ke);return Ce.cmpn(0)<0&&Ce.iadd(this.m),Ce._forceRed(this)},k.prototype.isub=function(Ae,ke){this._verify2(Ae,ke);var Ce=Ae.isub(ke);return Ce.cmpn(0)<0&&Ce.iadd(this.m),Ce},k.prototype.shl=function(Ae,ke){return this._verify1(Ae),this.imod(Ae.ushln(ke))},k.prototype.imul=function(Ae,ke){return this._verify2(Ae,ke),this.imod(Ae.imul(ke))},k.prototype.mul=function(Ae,ke){return this._verify2(Ae,ke),this.imod(Ae.mul(ke))},k.prototype.isqr=function(Ae){return this.imul(Ae,Ae.clone())},k.prototype.sqr=function(Ae){return this.mul(Ae,Ae)},k.prototype.sqrt=function(Ae){if(Ae.isZero())return Ae.clone();var ke=this.m.andln(3);if(r(ke%2==1),3===ke){var Ce=this.m.add(new n(1)).iushrn(2);return this.pow(Ae,Ce)}for(var qe=this.m.subn(1),ze=0;!qe.isZero()&&0===qe.andln(1);)ze++,qe.iushrn(1);r(!qe.isZero());var Ve=new n(1).toRed(this),tt=Ve.redNeg(),rt=this.m.subn(1).iushrn(1),nt=this.m.bitLength();for(nt=new n(2*nt*nt).toRed(this);0!==this.pow(nt,rt).cmp(tt);)nt.redIAdd(tt);for(var it=this.pow(nt,qe),ot=this.pow(Ae,qe.addn(1).iushrn(1)),ct=this.pow(Ae,qe),ht=ze;0!==ct.cmp(Ve);){for(var ft=ct,mt=0;0!==ft.cmp(Ve);mt++)ft=ft.redSqr();r(mt=0;qe--){for(var nt=ke.words[qe],it=rt-1;it>=0;it--){var ot=nt>>it&1;ze!==Ce[0]&&(ze=this.sqr(ze)),0!==ot||0!==Ve?(Ve<<=1,Ve|=ot,(4===++tt||0===qe&&0===it)&&(ze=this.mul(ze,Ce[Ve]),tt=0,Ve=0)):tt=0}rt=26}return ze},k.prototype.convertTo=function(Ae){var ke=Ae.umod(this.m);return ke===Ae?ke.clone():ke},k.prototype.convertFrom=function(Ae){var ke=Ae.clone();return ke.red=null,ke},n.mont=function(Ae){return new A(Ae)},i(A,k),A.prototype.convertTo=function(Ae){return this.imod(Ae.ushln(this.shift))},A.prototype.convertFrom=function(Ae){var ke=this.imod(Ae.mul(this.rinv));return ke.red=null,ke},A.prototype.imul=function(Ae,ke){if(Ae.isZero()||ke.isZero())return Ae.words[0]=0,Ae.length=1,Ae;var Ce=Ae.imul(ke),qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ze=Ce.isub(qe).iushrn(this.shift),Ve=ze;return ze.cmp(this.m)>=0?Ve=ze.isub(this.m):ze.cmpn(0)<0&&(Ve=ze.iadd(this.m)),Ve._forceRed(this)},A.prototype.mul=function(Ae,ke){if(Ae.isZero()||ke.isZero())return new n(0)._forceRed(this);var Ce=Ae.mul(ke),qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ze=Ce.isub(qe).iushrn(this.shift),Ve=ze;return ze.cmp(this.m)>=0?Ve=ze.isub(this.m):ze.cmpn(0)<0&&(Ve=ze.iadd(this.m)),Ve._forceRed(this)},A.prototype.invm=function(Ae){return this.imod(Ae._invmp(this.m).mul(this.r2))._forceRed(this)}}(Ae,Ur)})),Kd=Object.freeze({__proto__:null,default:Od,__moduleExports:Od});class Cd{constructor(Ae){if(void 0===Ae)throw Error("Invalid BigInteger input");this.value=new Od(Ae)}clone(){const Ae=new Cd(null);return this.value.copy(Ae.value),Ae}iinc(){return this.value.iadd(new Od(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new Od(1)),this}dec(){return this.clone().idec()}iadd(Ae){return this.value.iadd(Ae.value),this}add(Ae){return this.clone().iadd(Ae)}isub(Ae){return this.value.isub(Ae.value),this}sub(Ae){return this.clone().isub(Ae)}imul(Ae){return this.value.imul(Ae.value),this}mul(Ae){return this.clone().imul(Ae)}imod(Ae){return this.value=this.value.umod(Ae.value),this}mod(Ae){return this.clone().imod(Ae)}modExp(Ae,ke){const Ce=ke.isEven()?Od.red(ke.value):Od.mont(ke.value),qe=this.clone();return qe.value=qe.value.toRed(Ce).redPow(Ae.value).fromRed(),qe}modInv(Ae){if(!this.gcd(Ae).isOne())throw Error("Inverse does not exist");return new Cd(this.value.invm(Ae.value))}gcd(Ae){return new Cd(this.value.gcd(Ae.value))}ileftShift(Ae){return this.value.ishln(Ae.value.toNumber()),this}leftShift(Ae){return this.clone().ileftShift(Ae)}irightShift(Ae){return this.value.ishrn(Ae.value.toNumber()),this}rightShift(Ae){return this.clone().irightShift(Ae)}equal(Ae){return this.value.eq(Ae.value)}lt(Ae){return this.value.lt(Ae.value)}lte(Ae){return this.value.lte(Ae.value)}gt(Ae){return this.value.gt(Ae.value)}gte(Ae){return this.value.gte(Ae.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new Od(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const Ae=this.clone();return Ae.value=Ae.value.abs(),Ae}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(Ae){return this.value.testn(Ae)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(Ae="be",ke){return this.value.toArrayLike(Uint8Array,Ae,ke)}}var Fd,jd=Object.freeze({__proto__:null,default:Cd}),qd=bt((function(Ae,ke){var Ce=ke;function i(Ae){return 1===Ae.length?"0"+Ae:Ae}function n(Ae){for(var ke="",Ce=0;Ce>8,tt=255&ze;Ve?Ce.push(Ve,tt):Ce.push(tt)}return Ce},Ce.zero2=i,Ce.toHex=n,Ce.encode=function(Ae,ke){return"hex"===ke?n(Ae):Ae}})),zd=bt((function(Ae,ke){var Ce=ke;Ce.assert=Dr,Ce.toArray=qd.toArray,Ce.zero2=qd.zero2,Ce.toHex=qd.toHex,Ce.encode=qd.encode,Ce.getNAF=function(Ae,ke){for(var Ce=[],qe=1<=0;){var Ve;if(ze.isOdd()){var tt=ze.andln(qe-1);Ve=tt>(qe>>1)-1?(qe>>1)-tt:tt,ze.isubn(Ve)}else Ve=0;Ce.push(Ve);for(var rt=0!==ze.cmpn(0)&&0===ze.andln(qe-1)?ke+1:1,nt=1;nt0||ke.cmpn(-ze)>0;){var Ve,tt,rt,nt=Ae.andln(3)+qe&3,it=ke.andln(3)+ze&3;if(3===nt&&(nt=-1),3===it&&(it=-1),0==(1&nt))Ve=0;else Ve=3!==(rt=Ae.andln(7)+qe&7)&&5!==rt||2!==it?nt:-nt;if(Ce[0].push(Ve),0==(1&it))tt=0;else tt=3!==(rt=ke.andln(7)+ze&7)&&5!==rt||2!==nt?it:-it;Ce[1].push(tt),2*qe===Ve+1&&(qe=1-qe),2*ze===tt+1&&(ze=1-ze),Ae.iushrn(1),ke.iushrn(1)}return Ce},Ce.cachedProperty=function(Ae,ke,Ce){var qe="_"+ke;Ae.prototype[ke]=function(){return void 0!==this[qe]?this[qe]:this[qe]=Ce.call(this)}},Ce.parseBytes=function(Ae){return"string"==typeof Ae?Ce.toArray(Ae,"hex"):Ae},Ce.intFromLE=function(Ae){return new Od(Ae,"hex","le")}})),Ud=function(Ae){return Fd||(Fd=new Bd(null)),Fd.generate(Ae)};function Bd(Ae){this.rand=Ae}var Gd=Bd;if(Bd.prototype.generate=function(Ae){return this._rand(Ae)},Bd.prototype._rand=function(Ae){if(this.rand.getBytes)return this.rand.getBytes(Ae);for(var ke=new Uint8Array(Ae),Ce=0;Ce0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var tp=Nd;function Ld(Ae,ke){this.curve=Ae,this.type=ke,this.precomputed=null}Nd.prototype.point=function(){throw Error("Not implemented")},Nd.prototype.validate=function(){throw Error("Not implemented")},Nd.prototype._fixedNafMul=function(Ae,ke){ep(Ae.precomputed);var Ce=Ae._getDoubles(),qe=Yd(ke,1),ze=(1<=tt;ke--)rt=(rt<<1)+qe[ke];Ve.push(rt)}for(var nt=this.jpoint(null,null,null),it=this.jpoint(null,null,null),ot=ze;ot>0;ot--){for(tt=0;tt=0;rt--){for(ke=0;rt>=0&&0===Ve[rt];rt--)ke++;if(rt>=0&&ke++,tt=tt.dblp(ke),rt<0)break;var nt=Ve[rt];ep(0!==nt),tt="affine"===Ae.type?nt>0?tt.mixedAdd(ze[nt-1>>1]):tt.mixedAdd(ze[-nt-1>>1].neg()):nt>0?tt.add(ze[nt-1>>1]):tt.add(ze[-nt-1>>1].neg())}return"affine"===Ae.type?tt.toP():tt},Nd.prototype._wnafMulAdd=function(Ae,ke,Ce,qe,ze){for(var Ve=this._wnafT1,tt=this._wnafT2,rt=this._wnafT3,nt=0,it=0;it=1;it-=2){var ct=it-1,ht=it;if(1===Ve[ct]&&1===Ve[ht]){var ft=[ke[ct],null,null,ke[ht]];0===ke[ct].y.cmp(ke[ht].y)?(ft[1]=ke[ct].add(ke[ht]),ft[2]=ke[ct].toJ().mixedAdd(ke[ht].neg())):0===ke[ct].y.cmp(ke[ht].y.redNeg())?(ft[1]=ke[ct].toJ().mixedAdd(ke[ht]),ft[2]=ke[ct].add(ke[ht].neg())):(ft[1]=ke[ct].toJ().mixedAdd(ke[ht]),ft[2]=ke[ct].toJ().mixedAdd(ke[ht].neg()));var mt=[-3,-1,-5,-7,0,7,5,1,3],yt=Qd(Ce[ct],Ce[ht]);nt=Math.max(yt[0].length,nt),rt[ct]=Array(nt),rt[ht]=Array(nt);for(var Et=0;Et=0;it--){for(var Tt=0;it>=0;){var It=!0;for(Et=0;Et=0&&Tt++,Rt=Rt.dblp(Tt),it<0)break;for(Et=0;Et0?Bt=tt[Et][Dt-1>>1]:Dt<0&&(Bt=tt[Et][-Dt-1>>1].neg()),Rt="affine"===Bt.type?Rt.mixedAdd(Bt):Rt.add(Bt))}}for(it=0;it=Math.ceil((Ae.bitLength()+1)/ke.step)},Ld.prototype._getDoubles=function(Ae,ke){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var Ce=[this],qe=this,ze=0;ze=0&&(Ve=ke,tt=Ce),qe.negative&&(qe=qe.neg(),ze=ze.neg()),Ve.negative&&(Ve=Ve.neg(),tt=tt.neg()),[{a:qe,b:ze},{a:Ve,b:tt}]},Hd.prototype._endoSplit=function(Ae){var ke=this.endo.basis,Ce=ke[0],qe=ke[1],ze=qe.b.mul(Ae).divRound(this.n),Ve=Ce.b.neg().mul(Ae).divRound(this.n),tt=ze.mul(Ce.a),rt=Ve.mul(qe.a),nt=ze.mul(Ce.b),it=Ve.mul(qe.b);return{k1:Ae.sub(tt).sub(rt),k2:nt.add(it).neg()}},Hd.prototype.pointFromX=function(Ae,ke){(Ae=new Od(Ae,16)).red||(Ae=Ae.toRed(this.red));var Ce=Ae.redSqr().redMul(Ae).redIAdd(Ae.redMul(this.a)).redIAdd(this.b),qe=Ce.redSqrt();if(0!==qe.redSqr().redSub(Ce).cmp(this.zero))throw Error("invalid point");var ze=qe.fromRed().isOdd();return(ke&&!ze||!ke&&ze)&&(qe=qe.redNeg()),this.point(Ae,qe)},Hd.prototype.validate=function(Ae){if(Ae.inf)return!0;var ke=Ae.x,Ce=Ae.y,qe=this.a.redMul(ke),ze=ke.redSqr().redMul(ke).redIAdd(qe).redIAdd(this.b);return 0===Ce.redSqr().redISub(ze).cmpn(0)},Hd.prototype._endoWnafMulAdd=function(Ae,ke,Ce){for(var qe=this._endoWnafT1,ze=this._endoWnafT2,Ve=0;Ve":""},Vd.prototype.isInfinity=function(){return this.inf},Vd.prototype.add=function(Ae){if(this.inf)return Ae;if(Ae.inf)return this;if(this.eq(Ae))return this.dbl();if(this.neg().eq(Ae))return this.curve.point(null,null);if(0===this.x.cmp(Ae.x))return this.curve.point(null,null);var ke=this.y.redSub(Ae.y);0!==ke.cmpn(0)&&(ke=ke.redMul(this.x.redSub(Ae.x).redInvm()));var Ce=ke.redSqr().redISub(this.x).redISub(Ae.x),qe=ke.redMul(this.x.redSub(Ce)).redISub(this.y);return this.curve.point(Ce,qe)},Vd.prototype.dbl=function(){if(this.inf)return this;var Ae=this.y.redAdd(this.y);if(0===Ae.cmpn(0))return this.curve.point(null,null);var ke=this.curve.a,Ce=this.x.redSqr(),qe=Ae.redInvm(),ze=Ce.redAdd(Ce).redIAdd(Ce).redIAdd(ke).redMul(qe),Ve=ze.redSqr().redISub(this.x.redAdd(this.x)),tt=ze.redMul(this.x.redSub(Ve)).redISub(this.y);return this.curve.point(Ve,tt)},Vd.prototype.getX=function(){return this.x.fromRed()},Vd.prototype.getY=function(){return this.y.fromRed()},Vd.prototype.mul=function(Ae){return Ae=new Od(Ae,16),this.isInfinity()?this:this._hasDoubles(Ae)?this.curve._fixedNafMul(this,Ae):this.curve.endo?this.curve._endoWnafMulAdd([this],[Ae]):this.curve._wnafMul(this,Ae)},Vd.prototype.mulAdd=function(Ae,ke,Ce){var qe=[this,ke],ze=[Ae,Ce];return this.curve.endo?this.curve._endoWnafMulAdd(qe,ze):this.curve._wnafMulAdd(1,qe,ze,2)},Vd.prototype.jmulAdd=function(Ae,ke,Ce){var qe=[this,ke],ze=[Ae,Ce];return this.curve.endo?this.curve._endoWnafMulAdd(qe,ze,!0):this.curve._wnafMulAdd(1,qe,ze,2,!0)},Vd.prototype.eq=function(Ae){return this===Ae||this.inf===Ae.inf&&(this.inf||0===this.x.cmp(Ae.x)&&0===this.y.cmp(Ae.y))},Vd.prototype.neg=function(Ae){if(this.inf)return this;var ke=this.curve.point(this.x,this.y.redNeg());if(Ae&&this.precomputed){var Ce=this.precomputed,i=function(Ae){return Ae.neg()};ke.precomputed={naf:Ce.naf&&{wnd:Ce.naf.wnd,points:Ce.naf.points.map(i)},doubles:Ce.doubles&&{step:Ce.doubles.step,points:Ce.doubles.points.map(i)}}}return ke},Vd.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Gr($d,tp.BasePoint),Hd.prototype.jpoint=function(Ae,ke,Ce){return new $d(this,Ae,ke,Ce)},$d.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var Ae=this.z.redInvm(),ke=Ae.redSqr(),Ce=this.x.redMul(ke),qe=this.y.redMul(ke).redMul(Ae);return this.curve.point(Ce,qe)},$d.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},$d.prototype.add=function(Ae){if(this.isInfinity())return Ae;if(Ae.isInfinity())return this;var ke=Ae.z.redSqr(),Ce=this.z.redSqr(),qe=this.x.redMul(ke),ze=Ae.x.redMul(Ce),Ve=this.y.redMul(ke.redMul(Ae.z)),tt=Ae.y.redMul(Ce.redMul(this.z)),rt=qe.redSub(ze),nt=Ve.redSub(tt);if(0===rt.cmpn(0))return 0!==nt.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var it=rt.redSqr(),ot=it.redMul(rt),ct=qe.redMul(it),ht=nt.redSqr().redIAdd(ot).redISub(ct).redISub(ct),ft=nt.redMul(ct.redISub(ht)).redISub(Ve.redMul(ot)),mt=this.z.redMul(Ae.z).redMul(rt);return this.curve.jpoint(ht,ft,mt)},$d.prototype.mixedAdd=function(Ae){if(this.isInfinity())return Ae.toJ();if(Ae.isInfinity())return this;var ke=this.z.redSqr(),Ce=this.x,qe=Ae.x.redMul(ke),ze=this.y,Ve=Ae.y.redMul(ke).redMul(this.z),tt=Ce.redSub(qe),rt=ze.redSub(Ve);if(0===tt.cmpn(0))return 0!==rt.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var nt=tt.redSqr(),it=nt.redMul(tt),ot=Ce.redMul(nt),ct=rt.redSqr().redIAdd(it).redISub(ot).redISub(ot),ht=rt.redMul(ot.redISub(ct)).redISub(ze.redMul(it)),ft=this.z.redMul(tt);return this.curve.jpoint(ct,ht,ft)},$d.prototype.dblp=function(Ae){if(0===Ae)return this;if(this.isInfinity())return this;if(!Ae)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var ke=this,Ce=0;Ce=0)return!1;if(Ce.redIAdd(ze),0===this.x.cmp(Ce))return!0}},$d.prototype.inspect=function(){return this.isInfinity()?"":""},$d.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Gr(Zd,tp);var ip=Zd;function Xd(Ae,ke,Ce){tp.BasePoint.call(this,Ae,"projective"),null===ke&&null===Ce?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Od(ke,16),this.z=new Od(Ce,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Zd.prototype.validate=function(Ae){var ke=Ae.normalize().x,Ce=ke.redSqr(),qe=Ce.redMul(ke).redAdd(Ce.redMul(this.a)).redAdd(ke);return 0===qe.redSqrt().redSqr().cmp(qe)},Gr(Xd,tp.BasePoint),Zd.prototype.decodePoint=function(Ae,ke){if(33===(Ae=zd.toArray(Ae,ke)).length&&64===Ae[0]&&(Ae=Ae.slice(1,33).reverse()),32!==Ae.length)throw Error("Unknown point compression format");return this.point(Ae,1)},Zd.prototype.point=function(Ae,ke){return new Xd(this,Ae,ke)},Zd.prototype.pointFromJSON=function(Ae){return Xd.fromJSON(this,Ae)},Xd.prototype.precompute=function(){},Xd.prototype._encode=function(Ae){var ke=this.curve.p.byteLength();return Ae?[64].concat(this.getX().toArray("le",ke)):this.getX().toArray("be",ke)},Xd.fromJSON=function(Ae,ke){return new Xd(Ae,ke[0],ke[1]||Ae.one)},Xd.prototype.inspect=function(){return this.isInfinity()?"":""},Xd.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Xd.prototype.dbl=function(){var Ae=this.x.redAdd(this.z).redSqr(),ke=this.x.redSub(this.z).redSqr(),Ce=Ae.redSub(ke),qe=Ae.redMul(ke),ze=Ce.redMul(ke.redAdd(this.curve.a24.redMul(Ce)));return this.curve.point(qe,ze)},Xd.prototype.add=function(){throw Error("Not supported on Montgomery curve")},Xd.prototype.diffAdd=function(Ae,ke){var Ce=this.x.redAdd(this.z),qe=this.x.redSub(this.z),ze=Ae.x.redAdd(Ae.z),Ve=Ae.x.redSub(Ae.z).redMul(Ce),tt=ze.redMul(qe),rt=ke.z.redMul(Ve.redAdd(tt).redSqr()),nt=ke.x.redMul(Ve.redISub(tt).redSqr());return this.curve.point(rt,nt)},Xd.prototype.mul=function(Ae){for(var ke=(Ae=new Od(Ae,16)).clone(),Ce=this,qe=this.curve.point(null,null),ze=[];0!==ke.cmpn(0);ke.iushrn(1))ze.push(ke.andln(1));for(var Ve=ze.length-1;Ve>=0;Ve--)0===ze[Ve]?(Ce=Ce.diffAdd(qe,this),qe=qe.dbl()):(qe=Ce.diffAdd(qe,this),Ce=Ce.dbl());return qe},Xd.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},Xd.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},Xd.prototype.eq=function(Ae){return 0===this.getX().cmp(Ae.getX())},Xd.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Xd.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var sp=zd.assert;function Jd(Ae){this.twisted=1!=(0|Ae.a),this.mOneA=this.twisted&&-1==(0|Ae.a),this.extended=this.mOneA,tp.call(this,"edwards",Ae),this.a=new Od(Ae.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Od(Ae.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Od(Ae.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),sp(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|Ae.c)}Gr(Jd,tp);var op=Jd;function tl(Ae,ke,Ce,qe,ze){tp.BasePoint.call(this,Ae,"projective"),null===ke&&null===Ce&&null===qe?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Od(ke,16),this.y=new Od(Ce,16),this.z=qe?new Od(qe,16):this.curve.one,this.t=ze&&new Od(ze,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()))))}Jd.prototype._mulA=function(Ae){return this.mOneA?Ae.redNeg():this.a.redMul(Ae)},Jd.prototype._mulC=function(Ae){return this.oneC?Ae:this.c.redMul(Ae)},Jd.prototype.jpoint=function(Ae,ke,Ce,qe){return this.point(Ae,ke,Ce,qe)},Jd.prototype.pointFromX=function(Ae,ke){(Ae=new Od(Ae,16)).red||(Ae=Ae.toRed(this.red));var Ce=Ae.redSqr(),qe=this.c2.redSub(this.a.redMul(Ce)),ze=this.one.redSub(this.c2.redMul(this.d).redMul(Ce)),Ve=qe.redMul(ze.redInvm()),tt=Ve.redSqrt();if(0!==tt.redSqr().redSub(Ve).cmp(this.zero))throw Error("invalid point");var rt=tt.fromRed().isOdd();return(ke&&!rt||!ke&&rt)&&(tt=tt.redNeg()),this.point(Ae,tt)},Jd.prototype.pointFromY=function(Ae,ke){(Ae=new Od(Ae,16)).red||(Ae=Ae.toRed(this.red));var Ce=Ae.redSqr(),qe=Ce.redSub(this.c2),ze=Ce.redMul(this.d).redMul(this.c2).redSub(this.a),Ve=qe.redMul(ze.redInvm());if(0===Ve.cmp(this.zero)){if(ke)throw Error("invalid point");return this.point(this.zero,Ae)}var tt=Ve.redSqrt();if(0!==tt.redSqr().redSub(Ve).cmp(this.zero))throw Error("invalid point");return tt.fromRed().isOdd()!==ke&&(tt=tt.redNeg()),this.point(tt,Ae)},Jd.prototype.validate=function(Ae){if(Ae.isInfinity())return!0;Ae.normalize();var ke=Ae.x.redSqr(),Ce=Ae.y.redSqr(),qe=ke.redMul(this.a).redAdd(Ce),ze=this.c2.redMul(this.one.redAdd(this.d.redMul(ke).redMul(Ce)));return 0===qe.cmp(ze)},Gr(tl,tp.BasePoint),Jd.prototype.pointFromJSON=function(Ae){return tl.fromJSON(this,Ae)},Jd.prototype.point=function(Ae,ke,Ce,qe){return new tl(this,Ae,ke,Ce,qe)},tl.fromJSON=function(Ae,ke){return new tl(Ae,ke[0],ke[1],ke[2])},tl.prototype.inspect=function(){return this.isInfinity()?"":""},tl.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},tl.prototype._extDbl=function(){var Ae=this.x.redSqr(),ke=this.y.redSqr(),Ce=this.z.redSqr();Ce=Ce.redIAdd(Ce);var qe=this.curve._mulA(Ae),ze=this.x.redAdd(this.y).redSqr().redISub(Ae).redISub(ke),Ve=qe.redAdd(ke),tt=Ve.redSub(Ce),rt=qe.redSub(ke),nt=ze.redMul(tt),it=Ve.redMul(rt),ot=ze.redMul(rt),ct=tt.redMul(Ve);return this.curve.point(nt,it,ct,ot)},tl.prototype._projDbl=function(){var Ae,ke,Ce,qe=this.x.redAdd(this.y).redSqr(),ze=this.x.redSqr(),Ve=this.y.redSqr();if(this.curve.twisted){var tt=(it=this.curve._mulA(ze)).redAdd(Ve);if(this.zOne)Ae=qe.redSub(ze).redSub(Ve).redMul(tt.redSub(this.curve.two)),ke=tt.redMul(it.redSub(Ve)),Ce=tt.redSqr().redSub(tt).redSub(tt);else{var rt=this.z.redSqr(),nt=tt.redSub(rt).redISub(rt);Ae=qe.redSub(ze).redISub(Ve).redMul(nt),ke=tt.redMul(it.redSub(Ve)),Ce=tt.redMul(nt)}}else{var it=ze.redAdd(Ve);rt=this.curve._mulC(this.z).redSqr(),nt=it.redSub(rt).redSub(rt);Ae=this.curve._mulC(qe.redISub(it)).redMul(nt),ke=this.curve._mulC(it).redMul(ze.redISub(Ve)),Ce=it.redMul(nt)}return this.curve.point(Ae,ke,Ce)},tl.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},tl.prototype._extAdd=function(Ae){var ke=this.y.redSub(this.x).redMul(Ae.y.redSub(Ae.x)),Ce=this.y.redAdd(this.x).redMul(Ae.y.redAdd(Ae.x)),qe=this.t.redMul(this.curve.dd).redMul(Ae.t),ze=this.z.redMul(Ae.z.redAdd(Ae.z)),Ve=Ce.redSub(ke),tt=ze.redSub(qe),rt=ze.redAdd(qe),nt=Ce.redAdd(ke),it=Ve.redMul(tt),ot=rt.redMul(nt),ct=Ve.redMul(nt),ht=tt.redMul(rt);return this.curve.point(it,ot,ht,ct)},tl.prototype._projAdd=function(Ae){var ke,Ce,qe=this.z.redMul(Ae.z),ze=qe.redSqr(),Ve=this.x.redMul(Ae.x),tt=this.y.redMul(Ae.y),rt=this.curve.d.redMul(Ve).redMul(tt),nt=ze.redSub(rt),it=ze.redAdd(rt),ot=this.x.redAdd(this.y).redMul(Ae.x.redAdd(Ae.y)).redISub(Ve).redISub(tt),ct=qe.redMul(nt).redMul(ot);return this.curve.twisted?(ke=qe.redMul(it).redMul(tt.redSub(this.curve._mulA(Ve))),Ce=nt.redMul(it)):(ke=qe.redMul(it).redMul(tt.redSub(Ve)),Ce=this.curve._mulC(nt).redMul(it)),this.curve.point(ct,ke,Ce)},tl.prototype.add=function(Ae){return this.isInfinity()?Ae:Ae.isInfinity()?this:this.curve.extended?this._extAdd(Ae):this._projAdd(Ae)},tl.prototype.mul=function(Ae){return this._hasDoubles(Ae)?this.curve._fixedNafMul(this,Ae):this.curve._wnafMul(this,Ae)},tl.prototype.mulAdd=function(Ae,ke,Ce){return this.curve._wnafMulAdd(1,[this,ke],[Ae,Ce],2,!1)},tl.prototype.jmulAdd=function(Ae,ke,Ce){return this.curve._wnafMulAdd(1,[this,ke],[Ae,Ce],2,!0)},tl.prototype.normalize=function(){if(this.zOne)return this;var Ae=this.z.redInvm();return this.x=this.x.redMul(Ae),this.y=this.y.redMul(Ae),this.t&&(this.t=this.t.redMul(Ae)),this.z=this.curve.one,this.zOne=!0,this},tl.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},tl.prototype.getX=function(){return this.normalize(),this.x.fromRed()},tl.prototype.getY=function(){return this.normalize(),this.y.fromRed()},tl.prototype.eq=function(Ae){return this===Ae||0===this.getX().cmp(Ae.getX())&&0===this.getY().cmp(Ae.getY())},tl.prototype.eqXToP=function(Ae){var ke=Ae.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(ke))return!0;for(var Ce=Ae.clone(),qe=this.curve.redN.redMul(this.z);;){if(Ce.iadd(this.curve.n),Ce.cmp(this.curve.p)>=0)return!1;if(ke.redIAdd(qe),0===this.x.cmp(ke))return!0}},tl.prototype.toP=tl.prototype.normalize,tl.prototype.mixedAdd=tl.prototype.add;var ap=bt((function(Ae,ke){var Ce=ke;Ce.base=tp,Ce.short=np,Ce.mont=ip,Ce.edwards=op})),up=Vr.rotl32,hp=Vr.sum32,lp=Vr.sum32_5,fp=on.ft_1,dp=Qr.BlockHash,pp=[1518500249,1859775393,2400959708,3395469782];function ul(){if(!(this instanceof ul))return new ul;dp.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}Vr.inherits(ul,dp);var mp=ul;ul.blockSize=512,ul.outSize=160,ul.hmacStrength=80,ul.padLength=64,ul.prototype._update=function(Ae,ke){for(var Ce=this.W,qe=0;qe<16;qe++)Ce[qe]=Ae[ke+qe];for(;qethis.blockSize&&(Ae=(new this.Hash).update(Ae).digest()),Dr(Ae.length<=this.blockSize);for(var ke=Ae.length;ke=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(ke,Ce,qe)}var _p=ml;ml.prototype._init=function(Ae,ke,Ce){var qe=Ae.concat(ke).concat(Ce);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var ze=0;ze=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Ae.concat(Ce||[])),this._reseed=1},ml.prototype.generate=function(Ae,ke,Ce,qe){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof ke&&(qe=Ce,Ce=ke,ke=null),Ce&&(Ce=qd.toArray(Ce,qe||"hex"),this._update(Ce));for(var ze=[];ze.length"};var kp=zd.assert;function Al(Ae,ke){if(Ae instanceof Al)return Ae;this._importDER(Ae,ke)||(kp(Ae.r&&Ae.s,"Signature without r or s"),this.r=new Od(Ae.r,16),this.s=new Od(Ae.s,16),void 0===Ae.recoveryParam?this.recoveryParam=null:this.recoveryParam=Ae.recoveryParam)}var Sp=Al;function El(){this.place=0}function Pl(Ae,ke){var Ce=Ae[ke.place++];if(!(128&Ce))return Ce;for(var qe=15&Ce,ze=0,Ve=0,tt=ke.place;Ve>>3);for(Ae.push(128|Ce);--Ce;)Ae.push(ke>>>(Ce<<3)&255);Ae.push(ke)}}Al.prototype._importDER=function(Ae,ke){Ae=zd.toArray(Ae,ke);var Ce=new El;if(48!==Ae[Ce.place++])return!1;if(Pl(Ae,Ce)+Ce.place!==Ae.length)return!1;if(2!==Ae[Ce.place++])return!1;var qe=Pl(Ae,Ce),ze=Ae.slice(Ce.place,qe+Ce.place);if(Ce.place+=qe,2!==Ae[Ce.place++])return!1;var Ve=Pl(Ae,Ce);if(Ae.length!==Ve+Ce.place)return!1;var tt=Ae.slice(Ce.place,Ve+Ce.place);return 0===ze[0]&&128&ze[1]&&(ze=ze.slice(1)),0===tt[0]&&128&tt[1]&&(tt=tt.slice(1)),this.r=new Od(ze),this.s=new Od(tt),this.recoveryParam=null,!0},Al.prototype.toDER=function(Ae){var ke=this.r.toArray(),Ce=this.s.toArray();for(128&ke[0]&&(ke=[0].concat(ke)),128&Ce[0]&&(Ce=[0].concat(Ce)),ke=xl(ke),Ce=xl(Ce);!(Ce[0]||128&Ce[1]);)Ce=Ce.slice(1);var qe=[2];Ml(qe,ke.length),(qe=qe.concat(ke)).push(2),Ml(qe,Ce.length);var ze=qe.concat(Ce),Ve=[48];return Ml(Ve,ze.length),Ve=Ve.concat(ze),zd.encode(Ve,Ae)};var xp=zd.assert;function Kl(Ae){if(!(this instanceof Kl))return new Kl(Ae);"string"==typeof Ae&&(xp(wp.hasOwnProperty(Ae),"Unknown curve "+Ae),Ae=wp[Ae]),Ae instanceof wp.PresetCurve&&(Ae={curve:Ae}),this.curve=Ae.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=Ae.curve.g,this.g.precompute(Ae.curve.n.bitLength()+1),this.hash=Ae.hash||Ae.curve.hash}var Rp=Kl;Kl.prototype.keyPair=function(Ae){return new Ap(this,Ae)},Kl.prototype.keyFromPrivate=function(Ae,ke){return Ap.fromPrivate(this,Ae,ke)},Kl.prototype.keyFromPublic=function(Ae,ke){return Ap.fromPublic(this,Ae,ke)},Kl.prototype.genKeyPair=function(Ae){Ae||(Ae={});var ke=new _p({hash:this.hash,pers:Ae.pers,persEnc:Ae.persEnc||"utf8",entropy:Ae.entropy||Ud(this.hash.hmacStrength),entropyEnc:Ae.entropy&&Ae.entropyEnc||"utf8",nonce:this.n.toArray()});if("mont"===this.curve.type){var Ce=new Od(ke.generate(32));return this.keyFromPrivate(Ce)}for(var qe=this.n.byteLength(),ze=this.n.sub(new Od(2));;){if(!((Ce=new Od(ke.generate(qe))).cmp(ze)>0))return Ce.iaddn(1),this.keyFromPrivate(Ce)}},Kl.prototype._truncateToN=function(Ae,ke,Ce){var qe=(Ce=Ce||8*Ae.byteLength())-this.n.bitLength();return qe>0&&(Ae=Ae.ushrn(qe)),!ke&&Ae.cmp(this.n)>=0?Ae.sub(this.n):Ae},Kl.prototype.truncateMsg=function(Ae){var ke;return Ae instanceof Uint8Array?(ke=8*Ae.byteLength,Ae=this._truncateToN(new Od(Ae,16),!1,ke)):"string"==typeof Ae?(ke=4*Ae.length,Ae=this._truncateToN(new Od(Ae,16),!1,ke)):Ae=this._truncateToN(new Od(Ae,16)),Ae},Kl.prototype.sign=function(Ae,ke,Ce,qe){"object"==typeof Ce&&(qe=Ce,Ce=null),qe||(qe={}),ke=this.keyFromPrivate(ke,Ce),Ae=this.truncateMsg(Ae);for(var ze=this.n.byteLength(),Ve=ke.getPrivate().toArray("be",ze),tt=Ae.toArray("be",ze),rt=new _p({hash:this.hash,entropy:Ve,nonce:tt,pers:qe.pers,persEnc:qe.persEnc||"utf8"}),nt=this.n.sub(new Od(1)),it=0;;it++){var ot=qe.k?qe.k(it):new Od(rt.generate(this.n.byteLength()));if(!((ot=this._truncateToN(ot,!0)).cmpn(1)<=0||ot.cmp(nt)>=0)){var ct=this.g.mul(ot);if(!ct.isInfinity()){var ht=ct.getX(),ft=ht.umod(this.n);if(0!==ft.cmpn(0)){var mt=ot.invm(this.n).mul(ft.mul(ke.getPrivate()).iadd(Ae));if(0!==(mt=mt.umod(this.n)).cmpn(0)){var yt=(ct.getY().isOdd()?1:0)|(0!==ht.cmp(ft)?2:0);return qe.canonical&&mt.cmp(this.nh)>0&&(mt=this.n.sub(mt),yt^=1),new Sp({r:ft,s:mt,recoveryParam:yt})}}}}}},Kl.prototype.verify=function(Ae,ke,Ce,qe){return Ce=this.keyFromPublic(Ce,qe),ke=new Sp(ke,"hex"),this._verify(this.truncateMsg(Ae),ke,Ce)||this._verify(this._truncateToN(new Od(Ae,16)),ke,Ce)},Kl.prototype._verify=function(Ae,ke,Ce){var qe=ke.r,ze=ke.s;if(qe.cmpn(1)<0||qe.cmp(this.n)>=0)return!1;if(ze.cmpn(1)<0||ze.cmp(this.n)>=0)return!1;var Ve,tt=ze.invm(this.n),rt=tt.mul(Ae).umod(this.n),nt=tt.mul(qe).umod(this.n);return this.curve._maxwellTrick?!(Ve=this.g.jmulAdd(rt,Ce.getPublic(),nt)).isInfinity()&&Ve.eqXToP(qe):!(Ve=this.g.mulAdd(rt,Ce.getPublic(),nt)).isInfinity()&&0===Ve.getX().umod(this.n).cmp(qe)},Kl.prototype.recoverPubKey=function(Ae,ke,Ce,qe){xp((3&Ce)===Ce,"The recovery param is more than two bits"),ke=new Sp(ke,qe);var ze=this.n,Ve=new Od(Ae),tt=ke.r,rt=ke.s,nt=1&Ce,it=Ce>>1;if(tt.cmp(this.curve.p.umod(this.curve.n))>=0&&it)throw Error("Unable to find sencond key candinate");tt=it?this.curve.pointFromX(tt.add(this.curve.n),nt):this.curve.pointFromX(tt,nt);var ot=ke.r.invm(ze),ct=ze.sub(Ve).mul(ot).umod(ze),ht=rt.mul(ot).umod(ze);return this.g.mulAdd(ct,tt,ht)},Kl.prototype.getKeyRecoveryParam=function(Ae,ke,Ce,qe){if(null!==(ke=new Sp(ke,qe)).recoveryParam)return ke.recoveryParam;for(var ze=0;ze<4;ze++){var Ve;try{Ve=this.recoverPubKey(Ae,ke,ze)}catch(Ae){continue}if(Ve.eq(Ce))return ze}throw Error("Unable to find valid recovery factor")};var Pp=zd.assert,Mp=zd.parseBytes,Cp=zd.cachedProperty;function Bl(Ae,ke){if(this.eddsa=Ae,ke.hasOwnProperty("secret")&&(this._secret=Mp(ke.secret)),Ae.isPoint(ke.pub))this._pub=ke.pub;else if(this._pubBytes=Mp(ke.pub),this._pubBytes&&33===this._pubBytes.length&&64===this._pubBytes[0]&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&32!==this._pubBytes.length)throw Error("Unknown point compression format")}Bl.fromPublic=function(Ae,ke){return ke instanceof Bl?ke:new Bl(Ae,{pub:ke})},Bl.fromSecret=function(Ae,ke){return ke instanceof Bl?ke:new Bl(Ae,{secret:ke})},Bl.prototype.secret=function(){return this._secret},Cp(Bl,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Cp(Bl,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Cp(Bl,"privBytes",(function(){var Ae=this.eddsa,ke=this.hash(),Ce=Ae.encodingLength-1,qe=ke.slice(0,Ae.encodingLength);return qe[0]&=248,qe[Ce]&=127,qe[Ce]|=64,qe})),Cp(Bl,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Cp(Bl,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Cp(Bl,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Bl.prototype.sign=function(Ae){return Pp(this._secret,"KeyPair can only verify"),this.eddsa.sign(Ae,this)},Bl.prototype.verify=function(Ae,ke){return this.eddsa.verify(Ae,ke,this)},Bl.prototype.getSecret=function(Ae){return Pp(this._secret,"KeyPair is public only"),zd.encode(this.secret(),Ae)},Bl.prototype.getPublic=function(Ae,ke){return zd.encode((ke?[64]:[]).concat(this.pubBytes()),Ae)};var Tp=Bl,Ip=zd.assert,Bp=zd.cachedProperty,Dp=zd.parseBytes;function Fl(Ae,ke){this.eddsa=Ae,"object"!=typeof ke&&(ke=Dp(ke)),Array.isArray(ke)&&(ke={R:ke.slice(0,Ae.encodingLength),S:ke.slice(Ae.encodingLength)}),Ip(ke.R&&ke.S,"Signature without R or S"),Ae.isPoint(ke.R)&&(this._R=ke.R),ke.S instanceof Od&&(this._S=ke.S),this._Rencoded=Array.isArray(ke.R)?ke.R:ke.Rencoded,this._Sencoded=Array.isArray(ke.S)?ke.S:ke.Sencoded}Bp(Fl,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Bp(Fl,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Bp(Fl,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Bp(Fl,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Fl.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Fl.prototype.toHex=function(){return zd.encode(this.toBytes(),"hex").toUpperCase()};var Op=Fl,Np=zd.assert,Up=zd.parseBytes;function Wl(Ae){if(Np("ed25519"===Ae,"only tested with ed25519 so far"),!(this instanceof Wl))return new Wl(Ae);Ae=wp[Ae].curve;this.curve=Ae,this.g=Ae.g,this.g.precompute(Ae.n.bitLength()+1),this.pointClass=Ae.point().constructor,this.encodingLength=Math.ceil(Ae.n.bitLength()/8),this.hash=bp.sha512}var Lp=Wl;Wl.prototype.sign=function(Ae,ke){Ae=Up(Ae);var Ce=this.keyFromSecret(ke),qe=this.hashInt(Ce.messagePrefix(),Ae),ze=this.g.mul(qe),Ve=this.encodePoint(ze),tt=this.hashInt(Ve,Ce.pubBytes(),Ae).mul(Ce.priv()),rt=qe.add(tt).umod(this.curve.n);return this.makeSignature({R:ze,S:rt,Rencoded:Ve})},Wl.prototype.verify=function(Ae,ke,Ce){Ae=Up(Ae),ke=this.makeSignature(ke);var qe=this.keyFromPublic(Ce),ze=this.hashInt(ke.Rencoded(),qe.pubBytes(),Ae),Ve=this.g.mul(ke.S());return ke.R().add(qe.pub().mul(ze)).eq(Ve)},Wl.prototype.hashInt=function(){for(var Ae=this.hash(),ke=0;ke0)throw Error("Unknown option: "+Ce.join(", "));return new pc(Ae)},ke.createMessage=async function({text:Ae,binary:ke,filename:Ce,date:qe=new Date,format:ze=(void 0!==Ae?"utf8":"binary"),...Ve}){let tt=void 0!==Ae?Ae:ke;if(void 0===tt)throw Error("createMessage: must pass options object containing `text` or `binary`");if(Ae&&!Xt.isString(Ae)&&!Xt.isStream(Ae))throw Error("createMessage: options.text must be a string or stream");if(ke&&!Xt.isUint8Array(ke)&&!Xt.isStream(ke))throw Error("createMessage: options.binary must be a Uint8Array or stream");const rt=Object.keys(Ve);if(rt.length>0)throw Error("Unknown option: "+rt.join(", "));const nt=Xt.isStream(tt);nt&&(await F(),tt=j(tt));const it=new Hs(qe);void 0!==Ae?it.setText(tt,er.write(er.literal,ze)):it.setBytes(tt,er.write(er.literal,ze)),void 0!==Ce&&it.setFilename(Ce);const ot=new so;ot.push(it);const ct=new hc(ot);return ct.fromStream=nt,ct},ke.decrypt=async function({message:Ae,decryptionKeys:ke,passwords:Ce,sessionKeys:qe,verificationKeys:ze,expectSigned:Ve=!1,format:tt="utf8",signature:rt=null,date:nt=new Date,config:it,...ot}){if(wc(it={...tr,...it}),yc(Ae),ze=vc(ze),ke=vc(ke),Ce=vc(Ce),qe=vc(qe),ot.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decrypt, pass `decryptionKeys` instead");if(ot.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.decrypt, pass `verificationKeys` instead");const ct=Object.keys(ot);if(ct.length>0)throw Error("Unknown option: "+ct.join(", "));try{const ot=await Ae.decrypt(ke,Ce,qe,nt,it);ze||(ze=[]);const ct={};if(ct.signatures=rt?await ot.verifyDetached(rt,ze,nt,it):await ot.verify(ze,nt,it),ct.data="binary"===tt?ot.getLiteralData():ot.getText(),ct.filename=ot.getFilename(),kc(ct,Ae),Ve){if(0===ze.length)throw Error("Verification keys are required to verify message signatures");if(0===ct.signatures.length)throw Error("Message is not signed");ct.data=W([ct.data,ae((async()=>{await Xt.anyPromise(ct.signatures.map((Ae=>Ae.verified)))}))])}return ct.data=await _c(ct.data,Ae.fromStream,tt),ct}catch(Ae){throw Xt.wrapError("Error decrypting message",Ae)}},ke.decryptKey=async function({privateKey:Ae,passphrase:ke,config:Ce,...qe}){wc(Ce={...tr,...Ce});const ze=Object.keys(qe);if(ze.length>0)throw Error("Unknown option: "+ze.join(", "));if(!Ae.isPrivate())throw Error("Cannot decrypt a public key");const Ve=Ae.clone(!0),tt=Xt.isArray(ke)?ke:[ke];try{return await Promise.all(Ve.getKeys().map((Ae=>Xt.anyPromise(tt.map((ke=>Ae.keyPacket.decrypt(ke))))))),await Ve.validate(Ce),Ve}catch(Ae){throw Ve.clearPrivateParams(),Xt.wrapError("Error decrypting private key",Ae)}},ke.decryptSessionKeys=async function({message:Ae,decryptionKeys:ke,passwords:Ce,date:qe=new Date,config:ze,...Ve}){if(wc(ze={...tr,...ze}),yc(Ae),ke=vc(ke),Ce=vc(Ce),Ve.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decryptSessionKeys, pass `decryptionKeys` instead");const tt=Object.keys(Ve);if(tt.length>0)throw Error("Unknown option: "+tt.join(", "));try{return await Ae.decryptSessionKeys(ke,Ce,qe,ze)}catch(Ae){throw Xt.wrapError("Error decrypting session keys",Ae)}},ke.encrypt=async function({message:Ae,encryptionKeys:ke,signingKeys:Ce,passwords:qe,sessionKey:ze,format:Ve="armored",signature:tt=null,wildcard:rt=!1,signingKeyIDs:nt=[],encryptionKeyIDs:it=[],date:ot=new Date,signingUserIDs:ct=[],encryptionUserIDs:ht=[],config:ft,...mt}){if(wc(ft={...tr,...ft}),yc(Ae),mc(Ve),ke=vc(ke),Ce=vc(Ce),qe=vc(qe),nt=vc(nt),it=vc(it),ct=vc(ct),ht=vc(ht),mt.detached)throw Error("The `detached` option has been removed from openpgp.encrypt, separately call openpgp.sign instead. Don't forget to remove the `privateKeys` option as well.");if(mt.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encrypt, pass `encryptionKeys` instead");if(mt.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.encrypt, pass `signingKeys` instead");if(void 0!==mt.armor)throw Error("The `armor` option has been removed from openpgp.encrypt, pass `format` instead.");const yt=Object.keys(mt);if(yt.length>0)throw Error("Unknown option: "+yt.join(", "));Ce||(Ce=[]);const Et=Ae.fromStream;try{if((Ce.length||tt)&&(Ae=await Ae.sign(Ce,tt,nt,ot,ct,ft)),Ae=Ae.compress(await jo("compression",ke,ot,ht,ft),ft),Ae=await Ae.encrypt(ke,qe,ze,rt,it,ot,ht,ft),"object"===Ve)return Ae;const mt="armored"===Ve;return _c(mt?Ae.armor(ft):Ae.write(),Et,mt?"utf8":"binary")}catch(Ae){throw Xt.wrapError("Error encrypting message",Ae)}},ke.encryptKey=async function({privateKey:Ae,passphrase:ke,config:Ce,...qe}){wc(Ce={...tr,...Ce});const ze=Object.keys(qe);if(ze.length>0)throw Error("Unknown option: "+ze.join(", "));if(!Ae.isPrivate())throw Error("Cannot encrypt a public key");const Ve=Ae.clone(!0),tt=Ve.getKeys(),rt=Xt.isArray(ke)?ke:Array(tt.length).fill(ke);if(rt.length!==tt.length)throw Error("Invalid number of passphrases given for key encryption");try{return await Promise.all(tt.map((async(Ae,ke)=>{const{keyPacket:qe}=Ae;await qe.encrypt(rt[ke],Ce),qe.clearPrivateParams()}))),Ve}catch(Ae){throw Ve.clearPrivateParams(),Xt.wrapError("Error encrypting private key",Ae)}},ke.encryptSessionKey=async function({data:Ae,algorithm:ke,aeadAlgorithm:Ce,encryptionKeys:qe,passwords:ze,format:Ve="armored",wildcard:tt=!1,encryptionKeyIDs:rt=[],date:nt=new Date,encryptionUserIDs:it=[],config:ot,...ct}){if(wc(ot={...tr,...ot}),function(Ae,ke){if(!Xt.isUint8Array(Ae))throw Error("Parameter ["+(ke||"data")+"] must be of type Uint8Array")}(Ae),function(Ae,ke){if(!Xt.isString(Ae))throw Error("Parameter ["+(ke||"data")+"] must be of type String")}(ke,"algorithm"),mc(Ve),qe=vc(qe),ze=vc(ze),rt=vc(rt),it=vc(it),ct.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encryptSessionKey, pass `encryptionKeys` instead");const ht=Object.keys(ct);if(ht.length>0)throw Error("Unknown option: "+ht.join(", "));try{return Ac(await hc.encryptSessionKey(Ae,ke,Ce,qe,ze,tt,rt,nt,it,ot),Ve,ot)}catch(Ae){throw Xt.wrapError("Error encrypting session key",Ae)}},ke.enums=er,ke.generateKey=async function({userIDs:Ae=[],passphrase:ke="",type:Ce="ecc",rsaBits:qe=4096,curve:ze="curve25519",keyExpirationTime:Ve=0,date:tt=new Date,subkeys:rt=[{}],format:nt="armored",config:it,...ot}){wc(it={...tr,...it}),Ae=vc(Ae);const ct=Object.keys(ot);if(ct.length>0)throw Error("Unknown option: "+ct.join(", "));if(0===Ae.length)throw Error("UserIDs are required for key generation");if("rsa"===Ce&&qeVo(Ae.subkeys[Ce],Ae)));let Ce=[zo(Ae,ke)];Ce=Ce.concat(Ae.subkeys.map((Ae=>To(Ae,ke))));const qe=await Promise.all(Ce),ze=await sc(qe[0],qe.slice(1),Ae,ke),Ve=await ze.getRevocationCertificate(Ae.date,ke);return ze.revocationSignatures=[],{key:ze,revocationCertificate:Ve}}(ht,it);return Ae.getKeys().forEach((({keyPacket:Ae})=>Xo(Ae,it))),{privateKey:Ac(Ae,nt,it),publicKey:Ac(Ae.toPublic(),nt,it),revocationCertificate:ke}}catch(Ae){throw Xt.wrapError("Error generating keypair",Ae)}},ke.generateSessionKey=async function({encryptionKeys:Ae,date:ke=new Date,encryptionUserIDs:Ce=[],config:qe,...ze}){if(wc(qe={...tr,...qe}),Ae=vc(Ae),Ce=vc(Ce),ze.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.generateSessionKey, pass `encryptionKeys` instead");const Ve=Object.keys(ze);if(Ve.length>0)throw Error("Unknown option: "+Ve.join(", "));try{return await hc.generateSessionKey(Ae,ke,Ce,qe)}catch(Ae){throw Xt.wrapError("Error generating session key",Ae)}},ke.readCleartextMessage=async function({cleartextMessage:Ae,config:ke,...Ce}){if(ke={...tr,...ke},!Ae)throw Error("readCleartextMessage: must pass options object containing `cleartextMessage`");if(!Xt.isString(Ae))throw Error("readCleartextMessage: options.cleartextMessage must be a string");const qe=Object.keys(Ce);if(qe.length>0)throw Error("Unknown option: "+qe.join(", "));const ze=await Pe(Ae);if(ze.type!==er.armor.signed)throw Error("No cleartext signed message.");const Ve=await so.fromBinary(ze.data,Ul,ke);!function(Ae,ke){const r=function(Ae){const r=Ae=>ke=>Ae.hashAlgorithm===ke;for(let Ce=0;Ce0)throw Error("Unknown option: "+ze.join(", "));let Ve;if(Ae){const{type:ke,data:qe}=await Pe(Ae,Ce);if(ke!==er.armor.publicKey&&ke!==er.armor.privateKey)throw Error("Armored text not of type key");Ve=qe}else Ve=ke;return rc(await so.fromBinary(Ve,Il,Ce))},ke.readKeys=async function({armoredKeys:Ae,binaryKeys:ke,config:Ce,...qe}){Ce={...tr,...Ce};let ze=Ae||ke;if(!ze)throw Error("readKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(Ae&&!Xt.isString(Ae))throw Error("readKeys: options.armoredKeys must be a string");if(ke&&!Xt.isUint8Array(ke))throw Error("readKeys: options.binaryKeys must be a Uint8Array");const Ve=Object.keys(qe);if(Ve.length>0)throw Error("Unknown option: "+Ve.join(", "));if(Ae){const{type:ke,data:qe}=await Pe(Ae,Ce);if(ke!==er.armor.publicKey&&ke!==er.armor.privateKey)throw Error("Armored text not of type key");ze=qe}const tt=[],rt=await so.fromBinary(ze,Il,Ce),nt=rt.indexOfTag(er.packet.publicKey,er.packet.secretKey);if(0===nt.length)throw Error("No key packet found");for(let Ae=0;Ae0)throw Error("Unknown option: "+Ve.join(", "));const tt=Xt.isStream(ze);if(tt&&(await F(),ze=j(ze)),Ae){const{type:Ae,data:ke}=await Pe(ze,Ce);if(Ae!==er.armor.message)throw Error("Armored text not of type message");ze=ke}const rt=await so.fromBinary(ze,Dl,Ce),nt=new hc(rt);return nt.fromStream=tt,nt},ke.readPrivateKey=async function({armoredKey:Ae,binaryKey:ke,config:Ce,...qe}){if(Ce={...tr,...Ce},!Ae&&!ke)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(Ae&&!Xt.isString(Ae))throw Error("readPrivateKey: options.armoredKey must be a string");if(ke&&!Xt.isUint8Array(ke))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const ze=Object.keys(qe);if(ze.length>0)throw Error("Unknown option: "+ze.join(", "));let Ve;if(Ae){const{type:ke,data:qe}=await Pe(Ae,Ce);if(ke!==er.armor.privateKey)throw Error("Armored text not of type private key");Ve=qe}else Ve=ke;const tt=await so.fromBinary(Ve,Il,Ce);return new nc(tt)},ke.readPrivateKeys=async function({armoredKeys:Ae,binaryKeys:ke,config:Ce}){Ce={...tr,...Ce};let qe=Ae||ke;if(!qe)throw Error("readPrivateKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(Ae&&!Xt.isString(Ae))throw Error("readPrivateKeys: options.armoredKeys must be a string");if(ke&&!Xt.isUint8Array(ke))throw Error("readPrivateKeys: options.binaryKeys must be a Uint8Array");if(Ae){const{type:ke,data:ze}=await Pe(Ae,Ce);if(ke!==er.armor.privateKey)throw Error("Armored text not of type private key");qe=ze}const ze=[],Ve=await so.fromBinary(qe,Il,Ce),tt=Ve.indexOfTag(er.packet.secretKey);if(0===tt.length)throw Error("No secret key packet found");for(let Ae=0;Ae0)throw Error("Unknown option: "+Ve.join(", "));if(Ae){const{type:Ae,data:ke}=await Pe(ze,Ce);if(Ae!==er.armor.signature)throw Error("Armored text not of type signature");ze=ke}const tt=await so.fromBinary(ze,Cl,Ce);return new Bo(tt)},ke.reformatKey=async function({privateKey:Ae,userIDs:ke=[],passphrase:Ce="",keyExpirationTime:qe=0,date:ze,format:Ve="armored",config:tt,...rt}){wc(tt={...tr,...tt}),ke=vc(ke);const nt=Object.keys(rt);if(nt.length>0)throw Error("Unknown option: "+nt.join(", "));if(0===ke.length)throw Error("UserIDs are required for key reformat");const it={privateKey:Ae,userIDs:ke,passphrase:Ce,keyExpirationTime:qe,date:ze};try{const{key:Ae,revocationCertificate:ke}=await async function(Ae,ke){Ae=o(Ae);const{privateKey:Ce}=Ae;if(!Ce.isPrivate())throw Error("Cannot reformat a public key");if(Ce.keyPacket.isDummy())throw Error("Cannot reformat a gnu-dummy primary key");if(!Ce.getKeys().every((({keyPacket:Ae})=>Ae.isDecrypted())))throw Error("Key is not decrypted");const qe=Ce.keyPacket;Ae.subkeys||(Ae.subkeys=await Promise.all(Ce.subkeys.map((async Ae=>{const Ce=Ae.keyPacket,ze={key:qe,bind:Ce},Ve=await qo(Ae.bindingSignatures,qe,er.signature.subkeyBinding,ze,null,ke).catch((()=>({})));return{sign:Ve.keyFlags&&Ve.keyFlags[0]&er.keyFlags.signData}}))));const ze=Ce.subkeys.map((Ae=>Ae.keyPacket));if(Ae.subkeys.length!==ze.length)throw Error("Number of subkey options does not match number of subkeys");Ae.subkeys=Ae.subkeys.map((ke=>o(ke,Ae)));const Ve=await sc(qe,ze,Ae,ke),tt=await Ve.getRevocationCertificate(Ae.date,ke);return Ve.revocationSignatures=[],{key:Ve,revocationCertificate:tt};function o(Ae,ke={}){return Ae.keyExpirationTime=Ae.keyExpirationTime||ke.keyExpirationTime,Ae.passphrase=Xt.isString(Ae.passphrase)?Ae.passphrase:ke.passphrase,Ae.date=Ae.date||ke.date,Ae}}(it,tt);return{privateKey:Ac(Ae,Ve,tt),publicKey:Ac(Ae.toPublic(),Ve,tt),revocationCertificate:ke}}catch(Ae){throw Xt.wrapError("Error reformatting keypair",Ae)}},ke.revokeKey=async function({key:Ae,revocationCertificate:ke,reasonForRevocation:Ce,date:qe=new Date,format:ze="armored",config:Ve,...tt}){wc(Ve={...tr,...Ve});const rt=Object.keys(tt);if(rt.length>0)throw Error("Unknown option: "+rt.join(", "));try{const tt=ke?await Ae.applyRevocationCertificate(ke,qe,Ve):await Ae.revoke(Ce,qe,Ve);return tt.isPrivate()?{privateKey:Ac(tt,ze,Ve),publicKey:Ac(tt.toPublic(),ze,Ve)}:{privateKey:null,publicKey:Ac(tt,ze,Ve)}}catch(Ae){throw Xt.wrapError("Error revoking key",Ae)}},ke.sign=async function({message:Ae,signingKeys:ke,format:Ce="armored",detached:qe=!1,signingKeyIDs:ze=[],date:Ve=new Date,signingUserIDs:tt=[],config:rt,...nt}){if(wc(rt={...tr,...rt}),bc(Ae),mc(Ce),ke=vc(ke),ze=vc(ze),tt=vc(tt),nt.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.sign, pass `signingKeys` instead");if(void 0!==nt.armor)throw Error("The `armor` option has been removed from openpgp.sign, pass `format` instead.");const it=Object.keys(nt);if(it.length>0)throw Error("Unknown option: "+it.join(", "));if(Ae instanceof pc&&"binary"===Ce)throw Error("Cannot return signed cleartext message in binary format");if(Ae instanceof pc&&qe)throw Error("Cannot detach-sign a cleartext message");if(!ke||0===ke.length)throw Error("No signing keys provided");try{let nt;if(nt=qe?await Ae.signDetached(ke,void 0,ze,Ve,tt,rt):await Ae.sign(ke,void 0,ze,Ve,tt,rt),"object"===Ce)return nt;const it="armored"===Ce;return nt=it?nt.armor(rt):nt.write(),qe&&(nt=X(Ae.packets.write(),(async(Ae,ke)=>{await Promise.all([V(nt,ke),ie(Ae).catch((()=>{}))])}))),_c(nt,Ae.fromStream,it?"utf8":"binary")}catch(Ae){throw Xt.wrapError("Error signing message",Ae)}},ke.unarmor=Pe,ke.verify=async function({message:Ae,verificationKeys:ke,expectSigned:Ce=!1,format:qe="utf8",signature:ze=null,date:Ve=new Date,config:tt,...rt}){if(wc(tt={...tr,...tt}),bc(Ae),ke=vc(ke),rt.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.verify, pass `verificationKeys` instead");const nt=Object.keys(rt);if(nt.length>0)throw Error("Unknown option: "+nt.join(", "));if(Ae instanceof pc&&"binary"===qe)throw Error("Can't return cleartext message data as binary");if(Ae instanceof pc&&ze)throw Error("Can't verify detached cleartext signature");try{const rt={};if(rt.signatures=ze?await Ae.verifyDetached(ze,ke,Ve,tt):await Ae.verify(ke,Ve,tt),rt.data="binary"===qe?Ae.getLiteralData():Ae.getText(),Ae.fromStream&&kc(rt,Ae),Ce){if(0===rt.signatures.length)throw Error("Message is not signed");rt.data=W([rt.data,ae((async()=>{await Xt.anyPromise(rt.signatures.map((Ae=>Ae.verified)))}))])}return rt.data=await _c(rt.data,Ae.fromStream,qe),rt}catch(Ae){throw Xt.wrapError("Error verifying signed message",Ae)}}},7822:Ae=>{Ae.exports=Pend;function Pend(){this.pending=0;this.max=Infinity;this.listeners=[];this.waiting=[];this.error=null}Pend.prototype.go=function(Ae){if(this.pending0&&Ae.pending{"use strict";var qe=Ce(4300);var ze=qe.Buffer;var Ve={};var tt;for(tt in qe){if(!qe.hasOwnProperty(tt))continue;if(tt==="SlowBuffer"||tt==="Buffer")continue;Ve[tt]=qe[tt]}var rt=Ve.Buffer={};for(tt in ze){if(!ze.hasOwnProperty(tt))continue;if(tt==="allocUnsafe"||tt==="allocUnsafeSlow")continue;rt[tt]=ze[tt]}Ve.Buffer.prototype=ze.prototype;if(!rt.from||rt.from===Uint8Array.from){rt.from=function(Ae,ke,Ce){if(typeof Ae==="number"){throw new TypeError('The "value" argument must not be of type number. Received type '+typeof Ae)}if(Ae&&typeof Ae.length==="undefined"){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ae)}return ze(Ae,ke,Ce)}}if(!rt.alloc){rt.alloc=function(Ae,ke,Ce){if(typeof Ae!=="number"){throw new TypeError('The "size" argument must be of type number. Received type '+typeof Ae)}if(Ae<0||Ae>=2*(1<<30)){throw new RangeError('The value "'+Ae+'" is invalid for option "size"')}var qe=ze(Ae);if(!ke||ke.length===0){qe.fill(0)}else if(typeof Ce==="string"){qe.fill(ke,Ce)}else{qe.fill(ke)}return qe}}if(!Ve.kStringMaxLength){try{Ve.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(Ae){}}if(!Ve.constants){Ve.constants={MAX_LENGTH:Ve.kMaxLength};if(Ve.kStringMaxLength){Ve.constants.MAX_STRING_LENGTH=Ve.kStringMaxLength}}Ae.exports=Ve},1918:(Ae,ke)=>{ke=Ae.exports=SemVer;var Ce;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){Ce=function(){var Ae=Array.prototype.slice.call(arguments,0);Ae.unshift("SEMVER");console.log.apply(console,Ae)}}else{Ce=function(){}}ke.SEMVER_SPEC_VERSION="2.0.0";var qe=256;var ze=Number.MAX_SAFE_INTEGER||9007199254740991;var Ve=16;var tt=ke.re=[];var rt=ke.src=[];var nt=ke.tokens={};var it=0;function tok(Ae){nt[Ae]=it++}tok("NUMERICIDENTIFIER");rt[nt.NUMERICIDENTIFIER]="0|[1-9]\\d*";tok("NUMERICIDENTIFIERLOOSE");rt[nt.NUMERICIDENTIFIERLOOSE]="[0-9]+";tok("NONNUMERICIDENTIFIER");rt[nt.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";tok("MAINVERSION");rt[nt.MAINVERSION]="("+rt[nt.NUMERICIDENTIFIER]+")\\."+"("+rt[nt.NUMERICIDENTIFIER]+")\\."+"("+rt[nt.NUMERICIDENTIFIER]+")";tok("MAINVERSIONLOOSE");rt[nt.MAINVERSIONLOOSE]="("+rt[nt.NUMERICIDENTIFIERLOOSE]+")\\."+"("+rt[nt.NUMERICIDENTIFIERLOOSE]+")\\."+"("+rt[nt.NUMERICIDENTIFIERLOOSE]+")";tok("PRERELEASEIDENTIFIER");rt[nt.PRERELEASEIDENTIFIER]="(?:"+rt[nt.NUMERICIDENTIFIER]+"|"+rt[nt.NONNUMERICIDENTIFIER]+")";tok("PRERELEASEIDENTIFIERLOOSE");rt[nt.PRERELEASEIDENTIFIERLOOSE]="(?:"+rt[nt.NUMERICIDENTIFIERLOOSE]+"|"+rt[nt.NONNUMERICIDENTIFIER]+")";tok("PRERELEASE");rt[nt.PRERELEASE]="(?:-("+rt[nt.PRERELEASEIDENTIFIER]+"(?:\\."+rt[nt.PRERELEASEIDENTIFIER]+")*))";tok("PRERELEASELOOSE");rt[nt.PRERELEASELOOSE]="(?:-?("+rt[nt.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+rt[nt.PRERELEASEIDENTIFIERLOOSE]+")*))";tok("BUILDIDENTIFIER");rt[nt.BUILDIDENTIFIER]="[0-9A-Za-z-]+";tok("BUILD");rt[nt.BUILD]="(?:\\+("+rt[nt.BUILDIDENTIFIER]+"(?:\\."+rt[nt.BUILDIDENTIFIER]+")*))";tok("FULL");tok("FULLPLAIN");rt[nt.FULLPLAIN]="v?"+rt[nt.MAINVERSION]+rt[nt.PRERELEASE]+"?"+rt[nt.BUILD]+"?";rt[nt.FULL]="^"+rt[nt.FULLPLAIN]+"$";tok("LOOSEPLAIN");rt[nt.LOOSEPLAIN]="[v=\\s]*"+rt[nt.MAINVERSIONLOOSE]+rt[nt.PRERELEASELOOSE]+"?"+rt[nt.BUILD]+"?";tok("LOOSE");rt[nt.LOOSE]="^"+rt[nt.LOOSEPLAIN]+"$";tok("GTLT");rt[nt.GTLT]="((?:<|>)?=?)";tok("XRANGEIDENTIFIERLOOSE");rt[nt.XRANGEIDENTIFIERLOOSE]=rt[nt.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";tok("XRANGEIDENTIFIER");rt[nt.XRANGEIDENTIFIER]=rt[nt.NUMERICIDENTIFIER]+"|x|X|\\*";tok("XRANGEPLAIN");rt[nt.XRANGEPLAIN]="[v=\\s]*("+rt[nt.XRANGEIDENTIFIER]+")"+"(?:\\.("+rt[nt.XRANGEIDENTIFIER]+")"+"(?:\\.("+rt[nt.XRANGEIDENTIFIER]+")"+"(?:"+rt[nt.PRERELEASE]+")?"+rt[nt.BUILD]+"?"+")?)?";tok("XRANGEPLAINLOOSE");rt[nt.XRANGEPLAINLOOSE]="[v=\\s]*("+rt[nt.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+rt[nt.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+rt[nt.XRANGEIDENTIFIERLOOSE]+")"+"(?:"+rt[nt.PRERELEASELOOSE]+")?"+rt[nt.BUILD]+"?"+")?)?";tok("XRANGE");rt[nt.XRANGE]="^"+rt[nt.GTLT]+"\\s*"+rt[nt.XRANGEPLAIN]+"$";tok("XRANGELOOSE");rt[nt.XRANGELOOSE]="^"+rt[nt.GTLT]+"\\s*"+rt[nt.XRANGEPLAINLOOSE]+"$";tok("COERCE");rt[nt.COERCE]="(^|[^\\d])"+"(\\d{1,"+Ve+"})"+"(?:\\.(\\d{1,"+Ve+"}))?"+"(?:\\.(\\d{1,"+Ve+"}))?"+"(?:$|[^\\d])";tok("COERCERTL");tt[nt.COERCERTL]=new RegExp(rt[nt.COERCE],"g");tok("LONETILDE");rt[nt.LONETILDE]="(?:~>?)";tok("TILDETRIM");rt[nt.TILDETRIM]="(\\s*)"+rt[nt.LONETILDE]+"\\s+";tt[nt.TILDETRIM]=new RegExp(rt[nt.TILDETRIM],"g");var ot="$1~";tok("TILDE");rt[nt.TILDE]="^"+rt[nt.LONETILDE]+rt[nt.XRANGEPLAIN]+"$";tok("TILDELOOSE");rt[nt.TILDELOOSE]="^"+rt[nt.LONETILDE]+rt[nt.XRANGEPLAINLOOSE]+"$";tok("LONECARET");rt[nt.LONECARET]="(?:\\^)";tok("CARETTRIM");rt[nt.CARETTRIM]="(\\s*)"+rt[nt.LONECARET]+"\\s+";tt[nt.CARETTRIM]=new RegExp(rt[nt.CARETTRIM],"g");var ct="$1^";tok("CARET");rt[nt.CARET]="^"+rt[nt.LONECARET]+rt[nt.XRANGEPLAIN]+"$";tok("CARETLOOSE");rt[nt.CARETLOOSE]="^"+rt[nt.LONECARET]+rt[nt.XRANGEPLAINLOOSE]+"$";tok("COMPARATORLOOSE");rt[nt.COMPARATORLOOSE]="^"+rt[nt.GTLT]+"\\s*("+rt[nt.LOOSEPLAIN]+")$|^$";tok("COMPARATOR");rt[nt.COMPARATOR]="^"+rt[nt.GTLT]+"\\s*("+rt[nt.FULLPLAIN]+")$|^$";tok("COMPARATORTRIM");rt[nt.COMPARATORTRIM]="(\\s*)"+rt[nt.GTLT]+"\\s*("+rt[nt.LOOSEPLAIN]+"|"+rt[nt.XRANGEPLAIN]+")";tt[nt.COMPARATORTRIM]=new RegExp(rt[nt.COMPARATORTRIM],"g");var ht="$1$2$3";tok("HYPHENRANGE");rt[nt.HYPHENRANGE]="^\\s*("+rt[nt.XRANGEPLAIN]+")"+"\\s+-\\s+"+"("+rt[nt.XRANGEPLAIN]+")"+"\\s*$";tok("HYPHENRANGELOOSE");rt[nt.HYPHENRANGELOOSE]="^\\s*("+rt[nt.XRANGEPLAINLOOSE]+")"+"\\s+-\\s+"+"("+rt[nt.XRANGEPLAINLOOSE]+")"+"\\s*$";tok("STAR");rt[nt.STAR]="(<|>)?=?\\s*\\*";for(var ft=0;ftqe){return null}var Ce=ke.loose?tt[nt.LOOSE]:tt[nt.FULL];if(!Ce.test(Ae)){return null}try{return new SemVer(Ae,ke)}catch(Ae){return null}}ke.valid=valid;function valid(Ae,ke){var Ce=parse(Ae,ke);return Ce?Ce.version:null}ke.clean=clean;function clean(Ae,ke){var Ce=parse(Ae.trim().replace(/^[=v]+/,""),ke);return Ce?Ce.version:null}ke.SemVer=SemVer;function SemVer(Ae,ke){if(!ke||typeof ke!=="object"){ke={loose:!!ke,includePrerelease:false}}if(Ae instanceof SemVer){if(Ae.loose===ke.loose){return Ae}else{Ae=Ae.version}}else if(typeof Ae!=="string"){throw new TypeError("Invalid Version: "+Ae)}if(Ae.length>qe){throw new TypeError("version is longer than "+qe+" characters")}if(!(this instanceof SemVer)){return new SemVer(Ae,ke)}Ce("SemVer",Ae,ke);this.options=ke;this.loose=!!ke.loose;var Ve=Ae.trim().match(ke.loose?tt[nt.LOOSE]:tt[nt.FULL]);if(!Ve){throw new TypeError("Invalid Version: "+Ae)}this.raw=Ae;this.major=+Ve[1];this.minor=+Ve[2];this.patch=+Ve[3];if(this.major>ze||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>ze||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>ze||this.patch<0){throw new TypeError("Invalid patch version")}if(!Ve[4]){this.prerelease=[]}else{this.prerelease=Ve[4].split(".").map((function(Ae){if(/^[0-9]+$/.test(Ae)){var ke=+Ae;if(ke>=0&&ke=0){if(typeof this.prerelease[Ce]==="number"){this.prerelease[Ce]++;Ce=-2}}if(Ce===-1){this.prerelease.push(0)}}if(ke){if(this.prerelease[0]===ke){if(isNaN(this.prerelease[1])){this.prerelease=[ke,0]}}else{this.prerelease=[ke,0]}}break;default:throw new Error("invalid increment argument: "+Ae)}this.format();this.raw=this.version;return this};ke.inc=inc;function inc(Ae,ke,Ce,qe){if(typeof Ce==="string"){qe=Ce;Ce=undefined}try{return new SemVer(Ae,Ce).inc(ke,qe).version}catch(Ae){return null}}ke.diff=diff;function diff(Ae,ke){if(eq(Ae,ke)){return null}else{var Ce=parse(Ae);var qe=parse(ke);var ze="";if(Ce.prerelease.length||qe.prerelease.length){ze="pre";var Ve="prerelease"}for(var tt in Ce){if(tt==="major"||tt==="minor"||tt==="patch"){if(Ce[tt]!==qe[tt]){return ze+tt}}}return Ve}}ke.compareIdentifiers=compareIdentifiers;var mt=/^[0-9]+$/;function compareIdentifiers(Ae,ke){var Ce=mt.test(Ae);var qe=mt.test(ke);if(Ce&&qe){Ae=+Ae;ke=+ke}return Ae===ke?0:Ce&&!qe?-1:qe&&!Ce?1:Ae0}ke.lt=lt;function lt(Ae,ke,Ce){return compare(Ae,ke,Ce)<0}ke.eq=eq;function eq(Ae,ke,Ce){return compare(Ae,ke,Ce)===0}ke.neq=neq;function neq(Ae,ke,Ce){return compare(Ae,ke,Ce)!==0}ke.gte=gte;function gte(Ae,ke,Ce){return compare(Ae,ke,Ce)>=0}ke.lte=lte;function lte(Ae,ke,Ce){return compare(Ae,ke,Ce)<=0}ke.cmp=cmp;function cmp(Ae,ke,Ce,qe){switch(ke){case"===":if(typeof Ae==="object")Ae=Ae.version;if(typeof Ce==="object")Ce=Ce.version;return Ae===Ce;case"!==":if(typeof Ae==="object")Ae=Ae.version;if(typeof Ce==="object")Ce=Ce.version;return Ae!==Ce;case"":case"=":case"==":return eq(Ae,Ce,qe);case"!=":return neq(Ae,Ce,qe);case">":return gt(Ae,Ce,qe);case">=":return gte(Ae,Ce,qe);case"<":return lt(Ae,Ce,qe);case"<=":return lte(Ae,Ce,qe);default:throw new TypeError("Invalid operator: "+ke)}}ke.Comparator=Comparator;function Comparator(Ae,ke){if(!ke||typeof ke!=="object"){ke={loose:!!ke,includePrerelease:false}}if(Ae instanceof Comparator){if(Ae.loose===!!ke.loose){return Ae}else{Ae=Ae.value}}if(!(this instanceof Comparator)){return new Comparator(Ae,ke)}Ce("comparator",Ae,ke);this.options=ke;this.loose=!!ke.loose;this.parse(Ae);if(this.semver===yt){this.value=""}else{this.value=this.operator+this.semver.version}Ce("comp",this)}var yt={};Comparator.prototype.parse=function(Ae){var ke=this.options.loose?tt[nt.COMPARATORLOOSE]:tt[nt.COMPARATOR];var Ce=Ae.match(ke);if(!Ce){throw new TypeError("Invalid comparator: "+Ae)}this.operator=Ce[1]!==undefined?Ce[1]:"";if(this.operator==="="){this.operator=""}if(!Ce[2]){this.semver=yt}else{this.semver=new SemVer(Ce[2],this.options.loose)}};Comparator.prototype.toString=function(){return this.value};Comparator.prototype.test=function(Ae){Ce("Comparator.test",Ae,this.options.loose);if(this.semver===yt||Ae===yt){return true}if(typeof Ae==="string"){try{Ae=new SemVer(Ae,this.options)}catch(Ae){return false}}return cmp(Ae,this.operator,this.semver,this.options)};Comparator.prototype.intersects=function(Ae,ke){if(!(Ae instanceof Comparator)){throw new TypeError("a Comparator is required")}if(!ke||typeof ke!=="object"){ke={loose:!!ke,includePrerelease:false}}var Ce;if(this.operator===""){if(this.value===""){return true}Ce=new Range(Ae.value,ke);return satisfies(this.value,Ce,ke)}else if(Ae.operator===""){if(Ae.value===""){return true}Ce=new Range(this.value,ke);return satisfies(Ae.semver,Ce,ke)}var qe=(this.operator===">="||this.operator===">")&&(Ae.operator===">="||Ae.operator===">");var ze=(this.operator==="<="||this.operator==="<")&&(Ae.operator==="<="||Ae.operator==="<");var Ve=this.semver.version===Ae.semver.version;var tt=(this.operator===">="||this.operator==="<=")&&(Ae.operator===">="||Ae.operator==="<=");var rt=cmp(this.semver,"<",Ae.semver,ke)&&((this.operator===">="||this.operator===">")&&(Ae.operator==="<="||Ae.operator==="<"));var nt=cmp(this.semver,">",Ae.semver,ke)&&((this.operator==="<="||this.operator==="<")&&(Ae.operator===">="||Ae.operator===">"));return qe||ze||Ve&&tt||rt||nt};ke.Range=Range;function Range(Ae,ke){if(!ke||typeof ke!=="object"){ke={loose:!!ke,includePrerelease:false}}if(Ae instanceof Range){if(Ae.loose===!!ke.loose&&Ae.includePrerelease===!!ke.includePrerelease){return Ae}else{return new Range(Ae.raw,ke)}}if(Ae instanceof Comparator){return new Range(Ae.value,ke)}if(!(this instanceof Range)){return new Range(Ae,ke)}this.options=ke;this.loose=!!ke.loose;this.includePrerelease=!!ke.includePrerelease;this.raw=Ae;this.set=Ae.split(/\s*\|\|\s*/).map((function(Ae){return this.parseRange(Ae.trim())}),this).filter((function(Ae){return Ae.length}));if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+Ae)}this.format()}Range.prototype.format=function(){this.range=this.set.map((function(Ae){return Ae.join(" ").trim()})).join("||").trim();return this.range};Range.prototype.toString=function(){return this.range};Range.prototype.parseRange=function(Ae){var ke=this.options.loose;Ae=Ae.trim();var qe=ke?tt[nt.HYPHENRANGELOOSE]:tt[nt.HYPHENRANGE];Ae=Ae.replace(qe,hyphenReplace);Ce("hyphen replace",Ae);Ae=Ae.replace(tt[nt.COMPARATORTRIM],ht);Ce("comparator trim",Ae,tt[nt.COMPARATORTRIM]);Ae=Ae.replace(tt[nt.TILDETRIM],ot);Ae=Ae.replace(tt[nt.CARETTRIM],ct);Ae=Ae.split(/\s+/).join(" ");var ze=ke?tt[nt.COMPARATORLOOSE]:tt[nt.COMPARATOR];var Ve=Ae.split(" ").map((function(Ae){return parseComparator(Ae,this.options)}),this).join(" ").split(/\s+/);if(this.options.loose){Ve=Ve.filter((function(Ae){return!!Ae.match(ze)}))}Ve=Ve.map((function(Ae){return new Comparator(Ae,this.options)}),this);return Ve};Range.prototype.intersects=function(Ae,ke){if(!(Ae instanceof Range)){throw new TypeError("a Range is required")}return this.set.some((function(Ce){return isSatisfiable(Ce,ke)&&Ae.set.some((function(Ae){return isSatisfiable(Ae,ke)&&Ce.every((function(Ce){return Ae.every((function(Ae){return Ce.intersects(Ae,ke)}))}))}))}))};function isSatisfiable(Ae,ke){var Ce=true;var qe=Ae.slice();var ze=qe.pop();while(Ce&&qe.length){Ce=qe.every((function(Ae){return ze.intersects(Ae,ke)}));ze=qe.pop()}return Ce}ke.toComparators=toComparators;function toComparators(Ae,ke){return new Range(Ae,ke).set.map((function(Ae){return Ae.map((function(Ae){return Ae.value})).join(" ").trim().split(" ")}))}function parseComparator(Ae,ke){Ce("comp",Ae,ke);Ae=replaceCarets(Ae,ke);Ce("caret",Ae);Ae=replaceTildes(Ae,ke);Ce("tildes",Ae);Ae=replaceXRanges(Ae,ke);Ce("xrange",Ae);Ae=replaceStars(Ae,ke);Ce("stars",Ae);return Ae}function isX(Ae){return!Ae||Ae.toLowerCase()==="x"||Ae==="*"}function replaceTildes(Ae,ke){return Ae.trim().split(/\s+/).map((function(Ae){return replaceTilde(Ae,ke)})).join(" ")}function replaceTilde(Ae,ke){var qe=ke.loose?tt[nt.TILDELOOSE]:tt[nt.TILDE];return Ae.replace(qe,(function(ke,qe,ze,Ve,tt){Ce("tilde",Ae,ke,qe,ze,Ve,tt);var rt;if(isX(qe)){rt=""}else if(isX(ze)){rt=">="+qe+".0.0 <"+(+qe+1)+".0.0"}else if(isX(Ve)){rt=">="+qe+"."+ze+".0 <"+qe+"."+(+ze+1)+".0"}else if(tt){Ce("replaceTilde pr",tt);rt=">="+qe+"."+ze+"."+Ve+"-"+tt+" <"+qe+"."+(+ze+1)+".0"}else{rt=">="+qe+"."+ze+"."+Ve+" <"+qe+"."+(+ze+1)+".0"}Ce("tilde return",rt);return rt}))}function replaceCarets(Ae,ke){return Ae.trim().split(/\s+/).map((function(Ae){return replaceCaret(Ae,ke)})).join(" ")}function replaceCaret(Ae,ke){Ce("caret",Ae,ke);var qe=ke.loose?tt[nt.CARETLOOSE]:tt[nt.CARET];return Ae.replace(qe,(function(ke,qe,ze,Ve,tt){Ce("caret",Ae,ke,qe,ze,Ve,tt);var rt;if(isX(qe)){rt=""}else if(isX(ze)){rt=">="+qe+".0.0 <"+(+qe+1)+".0.0"}else if(isX(Ve)){if(qe==="0"){rt=">="+qe+"."+ze+".0 <"+qe+"."+(+ze+1)+".0"}else{rt=">="+qe+"."+ze+".0 <"+(+qe+1)+".0.0"}}else if(tt){Ce("replaceCaret pr",tt);if(qe==="0"){if(ze==="0"){rt=">="+qe+"."+ze+"."+Ve+"-"+tt+" <"+qe+"."+ze+"."+(+Ve+1)}else{rt=">="+qe+"."+ze+"."+Ve+"-"+tt+" <"+qe+"."+(+ze+1)+".0"}}else{rt=">="+qe+"."+ze+"."+Ve+"-"+tt+" <"+(+qe+1)+".0.0"}}else{Ce("no pr");if(qe==="0"){if(ze==="0"){rt=">="+qe+"."+ze+"."+Ve+" <"+qe+"."+ze+"."+(+Ve+1)}else{rt=">="+qe+"."+ze+"."+Ve+" <"+qe+"."+(+ze+1)+".0"}}else{rt=">="+qe+"."+ze+"."+Ve+" <"+(+qe+1)+".0.0"}}Ce("caret return",rt);return rt}))}function replaceXRanges(Ae,ke){Ce("replaceXRanges",Ae,ke);return Ae.split(/\s+/).map((function(Ae){return replaceXRange(Ae,ke)})).join(" ")}function replaceXRange(Ae,ke){Ae=Ae.trim();var qe=ke.loose?tt[nt.XRANGELOOSE]:tt[nt.XRANGE];return Ae.replace(qe,(function(qe,ze,Ve,tt,rt,nt){Ce("xRange",Ae,qe,ze,Ve,tt,rt,nt);var it=isX(Ve);var ot=it||isX(tt);var ct=ot||isX(rt);var ht=ct;if(ze==="="&&ht){ze=""}nt=ke.includePrerelease?"-0":"";if(it){if(ze===">"||ze==="<"){qe="<0.0.0-0"}else{qe="*"}}else if(ze&&ht){if(ot){tt=0}rt=0;if(ze===">"){ze=">=";if(ot){Ve=+Ve+1;tt=0;rt=0}else{tt=+tt+1;rt=0}}else if(ze==="<="){ze="<";if(ot){Ve=+Ve+1}else{tt=+tt+1}}qe=ze+Ve+"."+tt+"."+rt+nt}else if(ot){qe=">="+Ve+".0.0"+nt+" <"+(+Ve+1)+".0.0"+nt}else if(ct){qe=">="+Ve+"."+tt+".0"+nt+" <"+Ve+"."+(+tt+1)+".0"+nt}Ce("xRange return",qe);return qe}))}function replaceStars(Ae,ke){Ce("replaceStars",Ae,ke);return Ae.trim().replace(tt[nt.STAR],"")}function hyphenReplace(Ae,ke,Ce,qe,ze,Ve,tt,rt,nt,it,ot,ct,ht){if(isX(Ce)){ke=""}else if(isX(qe)){ke=">="+Ce+".0.0"}else if(isX(ze)){ke=">="+Ce+"."+qe+".0"}else{ke=">="+ke}if(isX(nt)){rt=""}else if(isX(it)){rt="<"+(+nt+1)+".0.0"}else if(isX(ot)){rt="<"+nt+"."+(+it+1)+".0"}else if(ct){rt="<="+nt+"."+it+"."+ot+"-"+ct}else{rt="<="+rt}return(ke+" "+rt).trim()}Range.prototype.test=function(Ae){if(!Ae){return false}if(typeof Ae==="string"){try{Ae=new SemVer(Ae,this.options)}catch(Ae){return false}}for(var ke=0;ke0){var Ve=Ae[ze].semver;if(Ve.major===ke.major&&Ve.minor===ke.minor&&Ve.patch===ke.patch){return true}}}return false}return true}ke.satisfies=satisfies;function satisfies(Ae,ke,Ce){try{ke=new Range(ke,Ce)}catch(Ae){return false}return ke.test(Ae)}ke.maxSatisfying=maxSatisfying;function maxSatisfying(Ae,ke,Ce){var qe=null;var ze=null;try{var Ve=new Range(ke,Ce)}catch(Ae){return null}Ae.forEach((function(Ae){if(Ve.test(Ae)){if(!qe||ze.compare(Ae)===-1){qe=Ae;ze=new SemVer(qe,Ce)}}}));return qe}ke.minSatisfying=minSatisfying;function minSatisfying(Ae,ke,Ce){var qe=null;var ze=null;try{var Ve=new Range(ke,Ce)}catch(Ae){return null}Ae.forEach((function(Ae){if(Ve.test(Ae)){if(!qe||ze.compare(Ae)===1){qe=Ae;ze=new SemVer(qe,Ce)}}}));return qe}ke.minVersion=minVersion;function minVersion(Ae,ke){Ae=new Range(Ae,ke);var Ce=new SemVer("0.0.0");if(Ae.test(Ce)){return Ce}Ce=new SemVer("0.0.0-0");if(Ae.test(Ce)){return Ce}Ce=null;for(var qe=0;qe":if(ke.prerelease.length===0){ke.patch++}else{ke.prerelease.push(0)}ke.raw=ke.format();case"":case">=":if(!Ce||gt(Ce,ke)){Ce=ke}break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+Ae.operator)}}))}if(Ce&&Ae.test(Ce)){return Ce}return null}ke.validRange=validRange;function validRange(Ae,ke){try{return new Range(Ae,ke).range||"*"}catch(Ae){return null}}ke.ltr=ltr;function ltr(Ae,ke,Ce){return outside(Ae,ke,"<",Ce)}ke.gtr=gtr;function gtr(Ae,ke,Ce){return outside(Ae,ke,">",Ce)}ke.outside=outside;function outside(Ae,ke,Ce,qe){Ae=new SemVer(Ae,qe);ke=new Range(ke,qe);var ze,Ve,tt,rt,nt;switch(Ce){case">":ze=gt;Ve=lte;tt=lt;rt=">";nt=">=";break;case"<":ze=lt;Ve=gte;tt=gt;rt="<";nt="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(Ae,ke,qe)){return false}for(var it=0;it=0.0.0")}ct=ct||Ae;ht=ht||Ae;if(ze(Ae.semver,ct.semver,qe)){ct=Ae}else if(tt(Ae.semver,ht.semver,qe)){ht=Ae}}));if(ct.operator===rt||ct.operator===nt){return false}if((!ht.operator||ht.operator===rt)&&Ve(Ae,ht.semver)){return false}else if(ht.operator===nt&&tt(Ae,ht.semver)){return false}}return true}ke.prerelease=prerelease;function prerelease(Ae,ke){var Ce=parse(Ae,ke);return Ce&&Ce.prerelease.length?Ce.prerelease:null}ke.intersects=intersects;function intersects(Ae,ke,Ce){Ae=new Range(Ae,Ce);ke=new Range(ke,Ce);return Ae.intersects(ke)}ke.coerce=coerce;function coerce(Ae,ke){if(Ae instanceof SemVer){return Ae}if(typeof Ae==="number"){Ae=String(Ae)}if(typeof Ae!=="string"){return null}ke=ke||{};var Ce=null;if(!ke.rtl){Ce=Ae.match(tt[nt.COERCE])}else{var qe;while((qe=tt[nt.COERCERTL].exec(Ae))&&(!Ce||Ce.index+Ce[0].length!==Ae.length)){if(!Ce||qe.index+qe[0].length!==Ce.index+Ce[0].length){Ce=qe}tt[nt.COERCERTL].lastIndex=qe.index+qe[1].length+qe[2].length}tt[nt.COERCERTL].lastIndex=-1}if(Ce===null){return null}return parse(Ce[2]+"."+(Ce[3]||"0")+"."+(Ce[4]||"0"),ke)}},6461:(Ae,ke,Ce)=>{Ae.exports=Ce(8013)},8013:(Ae,ke,Ce)=>{"use strict";var qe=Ce(1808);var ze=Ce(4404);var Ve=Ce(3685);var tt=Ce(5687);var rt=Ce(2361);var nt=Ce(9491);var it=Ce(3837);ke.httpOverHttp=httpOverHttp;ke.httpsOverHttp=httpsOverHttp;ke.httpOverHttps=httpOverHttps;ke.httpsOverHttps=httpsOverHttps;function httpOverHttp(Ae){var ke=new TunnelingAgent(Ae);ke.request=Ve.request;return ke}function httpsOverHttp(Ae){var ke=new TunnelingAgent(Ae);ke.request=Ve.request;ke.createSocket=createSecureSocket;ke.defaultPort=443;return ke}function httpOverHttps(Ae){var ke=new TunnelingAgent(Ae);ke.request=tt.request;return ke}function httpsOverHttps(Ae){var ke=new TunnelingAgent(Ae);ke.request=tt.request;ke.createSocket=createSecureSocket;ke.defaultPort=443;return ke}function TunnelingAgent(Ae){var ke=this;ke.options=Ae||{};ke.proxyOptions=ke.options.proxy||{};ke.maxSockets=ke.options.maxSockets||Ve.Agent.defaultMaxSockets;ke.requests=[];ke.sockets=[];ke.on("free",(function onFree(Ae,Ce,qe,ze){var Ve=toOptions(Ce,qe,ze);for(var tt=0,rt=ke.requests.length;tt=this.maxSockets){ze.requests.push(Ve);return}ze.createSocket(Ve,(function(ke){ke.on("free",onFree);ke.on("close",onCloseOrRemove);ke.on("agentRemove",onCloseOrRemove);Ae.onSocket(ke);function onFree(){ze.emit("free",ke,Ve)}function onCloseOrRemove(Ae){ze.removeSocket(ke);ke.removeListener("free",onFree);ke.removeListener("close",onCloseOrRemove);ke.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(Ae,ke){var Ce=this;var qe={};Ce.sockets.push(qe);var ze=mergeOptions({},Ce.proxyOptions,{method:"CONNECT",path:Ae.host+":"+Ae.port,agent:false,headers:{host:Ae.host+":"+Ae.port}});if(Ae.localAddress){ze.localAddress=Ae.localAddress}if(ze.proxyAuth){ze.headers=ze.headers||{};ze.headers["Proxy-Authorization"]="Basic "+new Buffer(ze.proxyAuth).toString("base64")}ot("making CONNECT request");var Ve=Ce.request(ze);Ve.useChunkedEncodingByDefault=false;Ve.once("response",onResponse);Ve.once("upgrade",onUpgrade);Ve.once("connect",onConnect);Ve.once("error",onError);Ve.end();function onResponse(Ae){Ae.upgrade=true}function onUpgrade(Ae,ke,Ce){process.nextTick((function(){onConnect(Ae,ke,Ce)}))}function onConnect(ze,tt,rt){Ve.removeAllListeners();tt.removeAllListeners();if(ze.statusCode!==200){ot("tunneling socket could not be established, statusCode=%d",ze.statusCode);tt.destroy();var nt=new Error("tunneling socket could not be established, "+"statusCode="+ze.statusCode);nt.code="ECONNRESET";Ae.request.emit("error",nt);Ce.removeSocket(qe);return}if(rt.length>0){ot("got illegal response body from proxy");tt.destroy();var nt=new Error("got illegal response body from proxy");nt.code="ECONNRESET";Ae.request.emit("error",nt);Ce.removeSocket(qe);return}ot("tunneling connection has established");Ce.sockets[Ce.sockets.indexOf(qe)]=tt;return ke(tt)}function onError(ke){Ve.removeAllListeners();ot("tunneling socket could not be established, cause=%s\n",ke.message,ke.stack);var ze=new Error("tunneling socket could not be established, "+"cause="+ke.message);ze.code="ECONNRESET";Ae.request.emit("error",ze);Ce.removeSocket(qe)}};TunnelingAgent.prototype.removeSocket=function removeSocket(Ae){var ke=this.sockets.indexOf(Ae);if(ke===-1){return}this.sockets.splice(ke,1);var Ce=this.requests.shift();if(Ce){this.createSocket(Ce,(function(Ae){Ce.request.onSocket(Ae)}))}};function createSecureSocket(Ae,ke){var Ce=this;TunnelingAgent.prototype.createSocket.call(Ce,Ae,(function(qe){var Ve=Ae.request.getHeader("host");var tt=mergeOptions({},Ce.options,{socket:qe,servername:Ve?Ve.replace(/:.*$/,""):Ae.host});var rt=ze.connect(0,tt);Ce.sockets[Ce.sockets.indexOf(qe)]=rt;ke(rt)}))}function toOptions(Ae,ke,Ce){if(typeof Ae==="string"){return{host:Ae,port:ke,localAddress:Ce}}return Ae}function mergeOptions(Ae){for(var ke=1,Ce=arguments.length;ke{var ke=[];for(var Ce=0;Ce<256;++Ce){ke[Ce]=(Ce+256).toString(16).substr(1)}function bytesToUuid(Ae,Ce){var qe=Ce||0;var ze=ke;return[ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]],"-",ze[Ae[qe++]],ze[Ae[qe++]],"-",ze[Ae[qe++]],ze[Ae[qe++]],"-",ze[Ae[qe++]],ze[Ae[qe++]],"-",ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]]].join("")}Ae.exports=bytesToUuid},6175:(Ae,ke,Ce)=>{var qe=Ce(6113);Ae.exports=function nodeRNG(){return qe.randomBytes(16)}},6294:(Ae,ke,Ce)=>{var qe=Ce(6175);var ze=Ce(5213);function v4(Ae,ke,Ce){var Ve=ke&&Ce||0;if(typeof Ae=="string"){ke=Ae==="binary"?new Array(16):null;Ae=null}Ae=Ae||{};var tt=Ae.random||(Ae.rng||qe)();tt[6]=tt[6]&15|64;tt[8]=tt[8]&63|128;if(ke){for(var rt=0;rt<16;++rt){ke[Ve+rt]=tt[rt]}}return ke||ze(tt)}Ae.exports=v4},9330:Ae=>{"use strict";Ae.exports=function(Ae){Ae.prototype[Symbol.iterator]=function*(){for(let Ae=this.head;Ae;Ae=Ae.next){yield Ae.value}}}},2177:(Ae,ke,Ce)=>{"use strict";Ae.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(Ae){var ke=this;if(!(ke instanceof Yallist)){ke=new Yallist}ke.tail=null;ke.head=null;ke.length=0;if(Ae&&typeof Ae.forEach==="function"){Ae.forEach((function(Ae){ke.push(Ae)}))}else if(arguments.length>0){for(var Ce=0,qe=arguments.length;Ce1){Ce=ke}else if(this.head){qe=this.head.next;Ce=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var ze=0;qe!==null;ze++){Ce=Ae(Ce,qe.value,ze);qe=qe.next}return Ce};Yallist.prototype.reduceReverse=function(Ae,ke){var Ce;var qe=this.tail;if(arguments.length>1){Ce=ke}else if(this.tail){qe=this.tail.prev;Ce=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var ze=this.length-1;qe!==null;ze--){Ce=Ae(Ce,qe.value,ze);qe=qe.prev}return Ce};Yallist.prototype.toArray=function(){var Ae=new Array(this.length);for(var ke=0,Ce=this.head;Ce!==null;ke++){Ae[ke]=Ce.value;Ce=Ce.next}return Ae};Yallist.prototype.toArrayReverse=function(){var Ae=new Array(this.length);for(var ke=0,Ce=this.tail;Ce!==null;ke++){Ae[ke]=Ce.value;Ce=Ce.prev}return Ae};Yallist.prototype.slice=function(Ae,ke){ke=ke||this.length;if(ke<0){ke+=this.length}Ae=Ae||0;if(Ae<0){Ae+=this.length}var Ce=new Yallist;if(kethis.length){ke=this.length}for(var qe=0,ze=this.head;ze!==null&&qethis.length){ke=this.length}for(var qe=this.length,ze=this.tail;ze!==null&&qe>ke;qe--){ze=ze.prev}for(;ze!==null&&qe>Ae;qe--,ze=ze.prev){Ce.push(ze.value)}return Ce};Yallist.prototype.splice=function(Ae,ke,...Ce){if(Ae>this.length){Ae=this.length-1}if(Ae<0){Ae=this.length+Ae}for(var qe=0,ze=this.head;ze!==null&&qe{var qe=Ce(7147);var ze=Ce(9796);var Ve=Ce(2357);var tt=Ce(5918);var rt=Ce(3837);var nt=Ce(2361).EventEmitter;var it=Ce(2781).Transform;var ot=Ce(2781).PassThrough;var ct=Ce(2781).Writable;ke.open=open;ke.fromFd=fromFd;ke.fromBuffer=fromBuffer;ke.fromRandomAccessReader=fromRandomAccessReader;ke.dosDateTimeToDate=dosDateTimeToDate;ke.validateFileName=validateFileName;ke.ZipFile=ZipFile;ke.Entry=Entry;ke.RandomAccessReader=RandomAccessReader;function open(Ae,ke,Ce){if(typeof ke==="function"){Ce=ke;ke=null}if(ke==null)ke={};if(ke.autoClose==null)ke.autoClose=true;if(ke.lazyEntries==null)ke.lazyEntries=false;if(ke.decodeStrings==null)ke.decodeStrings=true;if(ke.validateEntrySizes==null)ke.validateEntrySizes=true;if(ke.strictFileNames==null)ke.strictFileNames=false;if(Ce==null)Ce=defaultCallback;qe.open(Ae,"r",(function(Ae,ze){if(Ae)return Ce(Ae);fromFd(ze,ke,(function(Ae,ke){if(Ae)qe.close(ze,defaultCallback);Ce(Ae,ke)}))}))}function fromFd(Ae,ke,Ce){if(typeof ke==="function"){Ce=ke;ke=null}if(ke==null)ke={};if(ke.autoClose==null)ke.autoClose=false;if(ke.lazyEntries==null)ke.lazyEntries=false;if(ke.decodeStrings==null)ke.decodeStrings=true;if(ke.validateEntrySizes==null)ke.validateEntrySizes=true;if(ke.strictFileNames==null)ke.strictFileNames=false;if(Ce==null)Ce=defaultCallback;qe.fstat(Ae,(function(qe,ze){if(qe)return Ce(qe);var tt=Ve.createFromFd(Ae,{autoClose:true});fromRandomAccessReader(tt,ze.size,ke,Ce)}))}function fromBuffer(Ae,ke,Ce){if(typeof ke==="function"){Ce=ke;ke=null}if(ke==null)ke={};ke.autoClose=false;if(ke.lazyEntries==null)ke.lazyEntries=false;if(ke.decodeStrings==null)ke.decodeStrings=true;if(ke.validateEntrySizes==null)ke.validateEntrySizes=true;if(ke.strictFileNames==null)ke.strictFileNames=false;var qe=Ve.createFromBuffer(Ae,{maxChunkSize:65536});fromRandomAccessReader(qe,Ae.length,ke,Ce)}function fromRandomAccessReader(Ae,ke,Ce,qe){if(typeof Ce==="function"){qe=Ce;Ce=null}if(Ce==null)Ce={};if(Ce.autoClose==null)Ce.autoClose=true;if(Ce.lazyEntries==null)Ce.lazyEntries=false;if(Ce.decodeStrings==null)Ce.decodeStrings=true;var ze=!!Ce.decodeStrings;if(Ce.validateEntrySizes==null)Ce.validateEntrySizes=true;if(Ce.strictFileNames==null)Ce.strictFileNames=false;if(qe==null)qe=defaultCallback;if(typeof ke!=="number")throw new Error("expected totalSize parameter to be a number");if(ke>Number.MAX_SAFE_INTEGER){throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.")}Ae.ref();var Ve=22;var tt=65535;var rt=Math.min(Ve+tt,ke);var nt=ft(rt);var it=ke-nt.length;readAndAssertNoEof(Ae,nt,0,rt,it,(function(tt){if(tt)return qe(tt);for(var ot=rt-Ve;ot>=0;ot-=1){if(nt.readUInt32LE(ot)!==101010256)continue;var ct=nt.slice(ot);var ht=ct.readUInt16LE(4);if(ht!==0){return qe(new Error("multi-disk zip files are not supported: found disk number: "+ht))}var mt=ct.readUInt16LE(10);var yt=ct.readUInt32LE(16);var Et=ct.readUInt16LE(20);var kt=ct.length-Ve;if(Et!==kt){return qe(new Error("invalid comment length. expected: "+kt+". found: "+Et))}var St=ze?decodeBuffer(ct,22,ct.length,false):ct.slice(22);if(!(mt===65535||yt===4294967295)){return qe(null,new ZipFile(Ae,yt,ke,mt,St,Ce.autoClose,Ce.lazyEntries,ze,Ce.validateEntrySizes,Ce.strictFileNames))}var Rt=ft(20);var Pt=it+ot-Rt.length;readAndAssertNoEof(Ae,Rt,0,Rt.length,Pt,(function(Ve){if(Ve)return qe(Ve);if(Rt.readUInt32LE(0)!==117853008){return qe(new Error("invalid zip64 end of central directory locator signature"))}var tt=readUInt64LE(Rt,8);var rt=ft(56);readAndAssertNoEof(Ae,rt,0,rt.length,tt,(function(Ve){if(Ve)return qe(Ve);if(rt.readUInt32LE(0)!==101075792){return qe(new Error("invalid zip64 end of central directory record signature"))}mt=readUInt64LE(rt,32);yt=readUInt64LE(rt,48);return qe(null,new ZipFile(Ae,yt,ke,mt,St,Ce.autoClose,Ce.lazyEntries,ze,Ce.validateEntrySizes,Ce.strictFileNames))}))}));return}qe(new Error("end of central directory record signature not found"))}))}rt.inherits(ZipFile,nt);function ZipFile(Ae,ke,Ce,qe,ze,Ve,tt,rt,it,ot){var ct=this;nt.call(ct);ct.reader=Ae;ct.reader.on("error",(function(Ae){emitError(ct,Ae)}));ct.reader.once("close",(function(){ct.emit("close")}));ct.readEntryCursor=ke;ct.fileSize=Ce;ct.entryCount=qe;ct.comment=ze;ct.entriesRead=0;ct.autoClose=!!Ve;ct.lazyEntries=!!tt;ct.decodeStrings=!!rt;ct.validateEntrySizes=!!it;ct.strictFileNames=!!ot;ct.isOpen=true;ct.emittedError=false;if(!ct.lazyEntries)ct._readEntry()}ZipFile.prototype.close=function(){if(!this.isOpen)return;this.isOpen=false;this.reader.unref()};function emitErrorAndAutoClose(Ae,ke){if(Ae.autoClose)Ae.close();emitError(Ae,ke)}function emitError(Ae,ke){if(Ae.emittedError)return;Ae.emittedError=true;Ae.emit("error",ke)}ZipFile.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};ZipFile.prototype._readEntry=function(){var Ae=this;if(Ae.entryCount===Ae.entriesRead){setImmediate((function(){if(Ae.autoClose)Ae.close();if(Ae.emittedError)return;Ae.emit("end")}));return}if(Ae.emittedError)return;var ke=ft(46);readAndAssertNoEof(Ae.reader,ke,0,ke.length,Ae.readEntryCursor,(function(Ce){if(Ce)return emitErrorAndAutoClose(Ae,Ce);if(Ae.emittedError)return;var qe=new Entry;var ze=ke.readUInt32LE(0);if(ze!==33639248)return emitErrorAndAutoClose(Ae,new Error("invalid central directory file header signature: 0x"+ze.toString(16)));qe.versionMadeBy=ke.readUInt16LE(4);qe.versionNeededToExtract=ke.readUInt16LE(6);qe.generalPurposeBitFlag=ke.readUInt16LE(8);qe.compressionMethod=ke.readUInt16LE(10);qe.lastModFileTime=ke.readUInt16LE(12);qe.lastModFileDate=ke.readUInt16LE(14);qe.crc32=ke.readUInt32LE(16);qe.compressedSize=ke.readUInt32LE(20);qe.uncompressedSize=ke.readUInt32LE(24);qe.fileNameLength=ke.readUInt16LE(28);qe.extraFieldLength=ke.readUInt16LE(30);qe.fileCommentLength=ke.readUInt16LE(32);qe.internalFileAttributes=ke.readUInt16LE(36);qe.externalFileAttributes=ke.readUInt32LE(38);qe.relativeOffsetOfLocalHeader=ke.readUInt32LE(42);if(qe.generalPurposeBitFlag&64)return emitErrorAndAutoClose(Ae,new Error("strong encryption is not supported"));Ae.readEntryCursor+=46;ke=ft(qe.fileNameLength+qe.extraFieldLength+qe.fileCommentLength);readAndAssertNoEof(Ae.reader,ke,0,ke.length,Ae.readEntryCursor,(function(Ce){if(Ce)return emitErrorAndAutoClose(Ae,Ce);if(Ae.emittedError)return;var ze=(qe.generalPurposeBitFlag&2048)!==0;qe.fileName=Ae.decodeStrings?decodeBuffer(ke,0,qe.fileNameLength,ze):ke.slice(0,qe.fileNameLength);var Ve=qe.fileNameLength+qe.extraFieldLength;var rt=ke.slice(qe.fileNameLength,Ve);qe.extraFields=[];var nt=0;while(ntrt.length)return emitErrorAndAutoClose(Ae,new Error("extra field length exceeds extra field buffer size"));var mt=ft(ot);rt.copy(mt,0,ct,ht);qe.extraFields.push({id:it,data:mt});nt=ht}qe.fileComment=Ae.decodeStrings?decodeBuffer(ke,Ve,Ve+qe.fileCommentLength,ze):ke.slice(Ve,Ve+qe.fileCommentLength);qe.comment=qe.fileComment;Ae.readEntryCursor+=ke.length;Ae.entriesRead+=1;if(qe.uncompressedSize===4294967295||qe.compressedSize===4294967295||qe.relativeOffsetOfLocalHeader===4294967295){var yt=null;for(var nt=0;ntyt.length){return emitErrorAndAutoClose(Ae,new Error("zip64 extended information extra field does not include uncompressed size"))}qe.uncompressedSize=readUInt64LE(yt,kt);kt+=8}if(qe.compressedSize===4294967295){if(kt+8>yt.length){return emitErrorAndAutoClose(Ae,new Error("zip64 extended information extra field does not include compressed size"))}qe.compressedSize=readUInt64LE(yt,kt);kt+=8}if(qe.relativeOffsetOfLocalHeader===4294967295){if(kt+8>yt.length){return emitErrorAndAutoClose(Ae,new Error("zip64 extended information extra field does not include relative header offset"))}qe.relativeOffsetOfLocalHeader=readUInt64LE(yt,kt);kt+=8}}if(Ae.decodeStrings){for(var nt=0;ntAe.compressedSize)throw new Error("options.start > entry.compressedSize")}if(ke.end!=null){tt=ke.end;if(tt<0)throw new Error("options.end < 0");if(tt>Ae.compressedSize)throw new Error("options.end > entry.compressedSize");if(ttqe.fileSize){return Ce(new Error("file data overflows file bounds: "+mt+" + "+Ae.compressedSize+" > "+qe.fileSize))}}var Et=qe.reader.createReadStream({start:mt+Ve,end:mt+tt});var kt=Et;if(ft){var St=false;var Rt=ze.createInflateRaw();Et.on("error",(function(Ae){setImmediate((function(){if(!St)Rt.emit("error",Ae)}))}));Et.pipe(Rt);if(qe.validateEntrySizes){kt=new AssertByteCountStream(Ae.uncompressedSize);Rt.on("error",(function(Ae){setImmediate((function(){if(!St)kt.emit("error",Ae)}))}));Rt.pipe(kt)}else{kt=Rt}kt.destroy=function(){St=true;if(Rt!==kt)Rt.unpipe(kt);Et.unpipe(Rt);Et.destroy()}}Ce(null,kt)}finally{qe.reader.unref()}}))};function Entry(){}Entry.prototype.getLastModDate=function(){return dosDateTimeToDate(this.lastModFileDate,this.lastModFileTime)};Entry.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Entry.prototype.isCompressed=function(){return this.compressionMethod===8};function dosDateTimeToDate(Ae,ke){var Ce=Ae&31;var qe=(Ae>>5&15)-1;var ze=(Ae>>9&127)+1980;var Ve=0;var tt=(ke&31)*2;var rt=ke>>5&63;var nt=ke>>11&31;return new Date(ze,qe,Ce,nt,rt,tt,Ve)}function validateFileName(Ae){if(Ae.indexOf("\\")!==-1){return"invalid characters in fileName: "+Ae}if(/^[a-zA-Z]:/.test(Ae)||/^\//.test(Ae)){return"absolute path: "+Ae}if(Ae.split("/").indexOf("..")!==-1){return"invalid relative path: "+Ae}return null}function readAndAssertNoEof(Ae,ke,Ce,qe,ze,Ve){if(qe===0){return setImmediate((function(){Ve(null,ft(0))}))}Ae.read(ke,Ce,qe,ze,(function(Ae,ke){if(Ae)return Ve(Ae);if(kethis.expectedByteCount){var qe="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return Ce(new Error(qe))}Ce(null,Ae)};AssertByteCountStream.prototype._flush=function(Ae){if(this.actualByteCount0)return;if(Ae.refCount<0)throw new Error("invalid unref");Ae.close(onCloseDone);function onCloseDone(ke){if(ke)return Ae.emit("error",ke);Ae.emit("close")}};RandomAccessReader.prototype.createReadStream=function(Ae){var ke=Ae.start;var Ce=Ae.end;if(ke===Ce){var qe=new ot;setImmediate((function(){qe.end()}));return qe}var ze=this._readStreamForRange(ke,Ce);var Ve=false;var tt=new RefUnrefFilter(this);ze.on("error",(function(Ae){setImmediate((function(){if(!Ve)tt.emit("error",Ae)}))}));tt.destroy=function(){ze.unpipe(tt);tt.unref();ze.destroy()};var rt=new AssertByteCountStream(Ce-ke);tt.on("error",(function(Ae){setImmediate((function(){if(!Ve)rt.emit("error",Ae)}))}));rt.destroy=function(){Ve=true;tt.unpipe(rt);tt.destroy()};return ze.pipe(tt).pipe(rt)};RandomAccessReader.prototype._readStreamForRange=function(Ae,ke){throw new Error("not implemented")};RandomAccessReader.prototype.read=function(Ae,ke,Ce,qe,ze){var Ve=this.createReadStream({start:qe,end:qe+Ce});var tt=new ct;var rt=0;tt._write=function(Ce,qe,ze){Ce.copy(Ae,ke+rt,0,Ce.length);rt+=Ce.length;ze()};tt.on("finish",ze);Ve.on("error",(function(Ae){ze(Ae)}));Ve.pipe(tt)};RandomAccessReader.prototype.close=function(Ae){setImmediate(Ae)};rt.inherits(RefUnrefFilter,ot);function RefUnrefFilter(Ae){ot.call(this);this.context=Ae;this.context.ref();this.unreffedYet=false}RefUnrefFilter.prototype._flush=function(Ae){this.unref();Ae()};RefUnrefFilter.prototype.unref=function(Ae){if(this.unreffedYet)return;this.unreffedYet=true;this.context.unref()};var ht="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function decodeBuffer(Ae,ke,Ce,qe){if(qe){return Ae.toString("utf8",ke,Ce)}else{var ze="";for(var Ve=ke;Ve{module.exports=eval("require")("supports-color")},9491:Ae=>{"use strict";Ae.exports=require("assert")},4300:Ae=>{"use strict";Ae.exports=require("buffer")},2081:Ae=>{"use strict";Ae.exports=require("child_process")},6113:Ae=>{"use strict";Ae.exports=require("crypto")},2361:Ae=>{"use strict";Ae.exports=require("events")},7147:Ae=>{"use strict";Ae.exports=require("fs")},3685:Ae=>{"use strict";Ae.exports=require("http")},5687:Ae=>{"use strict";Ae.exports=require("https")},1808:Ae=>{"use strict";Ae.exports=require("net")},2037:Ae=>{"use strict";Ae.exports=require("os")},1017:Ae=>{"use strict";Ae.exports=require("path")},7282:Ae=>{"use strict";Ae.exports=require("process")},2781:Ae=>{"use strict";Ae.exports=require("stream")},1576:Ae=>{"use strict";Ae.exports=require("string_decoder")},9512:Ae=>{"use strict";Ae.exports=require("timers")},4404:Ae=>{"use strict";Ae.exports=require("tls")},6224:Ae=>{"use strict";Ae.exports=require("tty")},7310:Ae=>{"use strict";Ae.exports=require("url")},3837:Ae=>{"use strict";Ae.exports=require("util")},9796:Ae=>{"use strict";Ae.exports=require("zlib")}};var __webpack_module_cache__={};function __nccwpck_require__(Ae){var ke=__webpack_module_cache__[Ae];if(ke!==undefined){return ke.exports}var Ce=__webpack_module_cache__[Ae]={id:Ae,loaded:false,exports:{}};var qe=true;try{__webpack_modules__[Ae].call(Ce.exports,Ce,Ce.exports,__nccwpck_require__);qe=false}finally{if(qe)delete __webpack_module_cache__[Ae]}Ce.loaded=true;return Ce.exports}(()=>{__nccwpck_require__.nmd=Ae=>{Ae.paths=[];if(!Ae.children)Ae.children=[];return Ae}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{const Ae=__nccwpck_require__(2037);const ke=__nccwpck_require__(7147).promises;const Ce=__nccwpck_require__(1017);const qe=__nccwpck_require__(3837);const ze=qe.promisify(__nccwpck_require__(2081).exec);const Ve=__nccwpck_require__(4714);const tt=__nccwpck_require__(4596);const rt=__nccwpck_require__(1779);const nt=__nccwpck_require__(7514);const{stdout:it}=__nccwpck_require__(7282);(async()=>{try{const qe=Ve.getInput("scalr_hostname",{required:true});const ze=Ve.getInput("scalr_token",{required:true});const it=Ve.getInput("terraform_version",{required:true});Ve.info(`Preparing to download Terraform version ${it}`);const ot=await nt.getRelease("terraform",it);const ct={win32:"windows"}[Ae.platform()]||Ae.platform();const ht={x32:"386",x64:"amd64"}[Ae.arch()]||Ae.arch();const ft=ot.getBuild(ct,ht);if(!ft)throw new Error("No matching version found");Ve.info(`Downloading compressed Terraform binary from ${ft.url}`);const mt=await tt.downloadTool(ft.url);if(!mt)throw new Error("Failed to download Terraform");Ve.info("Decompressing Terraform binary");const yt=await tt.extractZip(mt);if(!yt)throw new Error("Failed to decompress Terraform");Ve.info("Add Terraform to PATH");Ve.addPath(yt);Ve.info("Rename Terraform binary to make way for the wrapper");const Et=Ae.platform().startsWith("win")?".exe":"";let kt=[yt,`terraform${Et}`].join(Ce.sep);let St=[yt,`terraform-bin${Et}`].join(Ce.sep);await rt.mv(kt,St);Ve.info("Install wrapper to forward Terraform output to future actions");kt=Ce.resolve([__dirname,"..","wrapper","index.js"].join(Ce.sep));St=[yt,"terraform"].join(Ce.sep);await rt.cp(kt,St);let Rt=process.env.TF_CLI_CONFIG_FILE;if(!Rt)Rt=ct=="windows"?`${process.env.APPDATA}/terraform.rc`:`${process.env.HOME}/.terraformrc`;Ve.info(`Generating Terraform credentials file at ${Rt}`);await rt.mkdirP(Ce.dirname(Rt));await ke.writeFile(Rt,`credentials "${qe}" {\n token = "${ze}"\n}`)}catch(Ae){Ve.setFailed(Ae.message)}})()})();module.exports=__webpack_exports__})(); \ No newline at end of file +***************************************************************************** */function od(Ae,ke){if("function"!=typeof ke&&null!==ke)throw new TypeError("Class extends value "+ke+" is not a constructor or null");function r(){this.constructor=Ae}sd(Ae,ke),Ae.prototype=null===ke?Object.create(ke):(r.prototype=ke.prototype,new r)}function cd(Ae){if(!Ae)throw new TypeError("Assertion failed")}function ud(){}function hd(Ae){return"object"==typeof Ae&&null!==Ae||"function"==typeof Ae}function fd(Ae){if("function"!=typeof Ae)return!1;var ke=!1;try{new Ae({start:function(){ke=!0}})}catch(Ae){}return ke}function dd(Ae){return!!hd(Ae)&&"function"==typeof Ae.getReader}function ld(Ae){return!!hd(Ae)&&"function"==typeof Ae.getWriter}function pd(Ae){return!!hd(Ae)&&(!!dd(Ae.readable)&&!!ld(Ae.writable))}function yd(Ae){try{return Ae.getReader({mode:"byob"}).releaseLock(),!0}catch(Ae){return!1}}function bd(Ae,ke){var Ce=(void 0===ke?{}:ke).type;return cd(dd(Ae)),cd(!1===Ae.locked),"bytes"===(Ce=md(Ce))?new Md(Ae):new Pd(Ae)}function md(Ae){var ke=Ae+"";if("bytes"===ke)return ke;if(void 0===Ae)return Ae;throw new RangeError("Invalid type is specified")}var Rd=function(){function e(Ae){this._underlyingReader=void 0,this._readerMode=void 0,this._readableStreamController=void 0,this._pendingRead=void 0,this._underlyingStream=Ae,this._attachDefaultReader()}return e.prototype.start=function(Ae){this._readableStreamController=Ae},e.prototype.cancel=function(Ae){return cd(void 0!==this._underlyingReader),this._underlyingReader.cancel(Ae)},e.prototype._attachDefaultReader=function(){if("default"!==this._readerMode){this._detachReader();var Ae=this._underlyingStream.getReader();this._readerMode="default",this._attachReader(Ae)}},e.prototype._attachReader=function(Ae){var ke=this;cd(void 0===this._underlyingReader),this._underlyingReader=Ae;var Ce=this._underlyingReader.closed;Ce&&Ce.then((function(){return ke._finishPendingRead()})).then((function(){Ae===ke._underlyingReader&&ke._readableStreamController.close()}),(function(Ce){Ae===ke._underlyingReader&&ke._readableStreamController.error(Ce)})).catch(ud)},e.prototype._detachReader=function(){void 0!==this._underlyingReader&&(this._underlyingReader.releaseLock(),this._underlyingReader=void 0,this._readerMode=void 0)},e.prototype._pullWithDefaultReader=function(){var Ae=this;this._attachDefaultReader();var ke=this._underlyingReader.read().then((function(ke){var Ce=Ae._readableStreamController;ke.done?Ae._tryClose():Ce.enqueue(ke.value)}));return this._setPendingRead(ke),ke},e.prototype._tryClose=function(){try{this._readableStreamController.close()}catch(Ae){}},e.prototype._setPendingRead=function(Ae){var ke,Ce=this,i=function(){Ce._pendingRead===ke&&(Ce._pendingRead=void 0)};this._pendingRead=ke=Ae.then(i,i)},e.prototype._finishPendingRead=function(){var Ae=this;if(this._pendingRead){var t=function(){return Ae._finishPendingRead()};return this._pendingRead.then(t,t)}},e}(),Pd=function(Ae){function t(){return null!==Ae&&Ae.apply(this,arguments)||this}return od(t,Ae),t.prototype.pull=function(){return this._pullWithDefaultReader()},t}(Rd);function vd(Ae){return new Uint8Array(Ae.buffer,Ae.byteOffset,Ae.byteLength)}var Md=function(Ae){function t(ke){var Ce=this,qe=yd(ke);return(Ce=Ae.call(this,ke)||this)._supportsByob=qe,Ce}return od(t,Ae),Object.defineProperty(t.prototype,"type",{get:function(){return"bytes"},enumerable:!1,configurable:!0}),t.prototype._attachByobReader=function(){if("byob"!==this._readerMode){cd(this._supportsByob),this._detachReader();var Ae=this._underlyingStream.getReader({mode:"byob"});this._readerMode="byob",this._attachReader(Ae)}},t.prototype.pull=function(){if(this._supportsByob){var Ae=this._readableStreamController.byobRequest;if(Ae)return this._pullWithByobRequest(Ae)}return this._pullWithDefaultReader()},t.prototype._pullWithByobRequest=function(Ae){var ke=this;this._attachByobReader();var Ce=new Uint8Array(Ae.view.byteLength),qe=this._underlyingReader.read(Ce).then((function(Ce){var qe,ze,Ve;ke._readableStreamController,Ce.done?(ke._tryClose(),Ae.respond(0)):(qe=Ce.value,ze=Ae.view,Ve=vd(qe),vd(ze).set(Ve,0),Ae.respond(Ce.value.byteLength))}));return this._setPendingRead(qe),qe},t}(Rd);function kd(Ae){cd(ld(Ae)),cd(!1===Ae.locked);var ke=Ae.getWriter();return new Td(ke)}var Td=function(){function e(Ae){var ke=this;this._writableStreamController=void 0,this._pendingWrite=void 0,this._state="writable",this._storedError=void 0,this._underlyingWriter=Ae,this._errorPromise=new Promise((function(Ae,Ce){ke._errorPromiseReject=Ce})),this._errorPromise.catch(ud)}return e.prototype.start=function(Ae){var ke=this;this._writableStreamController=Ae,this._underlyingWriter.closed.then((function(){ke._state="closed"})).catch((function(Ae){return ke._finishErroring(Ae)}))},e.prototype.write=function(Ae){var ke=this,Ce=this._underlyingWriter;if(null===Ce.desiredSize)return Ce.ready;var qe=Ce.write(Ae);qe.catch((function(Ae){return ke._finishErroring(Ae)})),Ce.ready.catch((function(Ae){return ke._startErroring(Ae)}));var ze=Promise.race([qe,this._errorPromise]);return this._setPendingWrite(ze),ze},e.prototype.close=function(){var Ae=this;return void 0===this._pendingWrite?this._underlyingWriter.close():this._finishPendingWrite().then((function(){return Ae.close()}))},e.prototype.abort=function(Ae){if("errored"!==this._state)return this._underlyingWriter.abort(Ae)},e.prototype._setPendingWrite=function(Ae){var ke,Ce=this,i=function(){Ce._pendingWrite===ke&&(Ce._pendingWrite=void 0)};this._pendingWrite=ke=Ae.then(i,i)},e.prototype._finishPendingWrite=function(){var Ae=this;if(void 0===this._pendingWrite)return Promise.resolve();var t=function(){return Ae._finishPendingWrite()};return this._pendingWrite.then(t,t)},e.prototype._startErroring=function(Ae){var ke=this;if("writable"===this._state){this._state="erroring",this._storedError=Ae;var r=function(){return ke._finishErroring(Ae)};void 0===this._pendingWrite?r():this._finishPendingWrite().then(r,r),this._writableStreamController.error(Ae)}},e.prototype._finishErroring=function(Ae){"writable"===this._state&&this._startErroring(Ae),"erroring"===this._state&&(this._state="errored",this._errorPromiseReject(this._storedError))},e}();function Sd(Ae){cd(pd(Ae));var ke=Ae.readable,Ce=Ae.writable;cd(!1===ke.locked),cd(!1===Ce.locked);var qe,ze=ke.getReader();try{qe=Ce.getWriter()}catch(Ae){throw ze.releaseLock(),Ae}return new Id(ze,qe)}var Id=function(){function e(Ae,ke){var Ce=this;this._transformStreamController=void 0,this._onRead=function(Ae){if(!Ae.done)return Ce._transformStreamController.enqueue(Ae.value),Ce._reader.read().then(Ce._onRead)},this._onError=function(Ae){Ce._flushReject(Ae),Ce._transformStreamController.error(Ae),Ce._reader.cancel(Ae).catch(ud),Ce._writer.abort(Ae).catch(ud)},this._onTerminate=function(){Ce._flushResolve(),Ce._transformStreamController.terminate();var Ae=new TypeError("TransformStream terminated");Ce._writer.abort(Ae).catch(ud)},this._reader=Ae,this._writer=ke,this._flushPromise=new Promise((function(Ae,ke){Ce._flushResolve=Ae,Ce._flushReject=ke}))}return e.prototype.start=function(Ae){this._transformStreamController=Ae,this._reader.read().then(this._onRead).then(this._onTerminate,this._onError);var ke=this._reader.closed;ke&&ke.then(this._onTerminate,this._onError)},e.prototype.transform=function(Ae){return this._writer.write(Ae)},e.prototype.flush=function(){var Ae=this;return this._writer.close().then((function(){return Ae._flushPromise}))},e}(),Dd=Object.freeze({__proto__:null,createReadableStreamWrapper:function(Ae){cd(function(Ae){return!!fd(Ae)&&!!dd(new Ae)}(Ae));var ke=function(Ae){try{return new Ae({type:"bytes"}),!0}catch(Ae){return!1}}(Ae);return function(Ce,qe){var ze=(void 0===qe?{}:qe).type;if("bytes"!==(ze=md(ze))||ke||(ze=void 0),Ce.constructor===Ae&&("bytes"!==ze||yd(Ce)))return Ce;if("bytes"===ze){var Ve=bd(Ce,{type:ze});return new Ae(Ve)}Ve=bd(Ce);return new Ae(Ve)}},createTransformStreamWrapper:function(Ae){return cd(function(Ae){return!!fd(Ae)&&!!pd(new Ae)}(Ae)),function(ke){if(ke.constructor===Ae)return ke;var Ce=Sd(ke);return new Ae(Ce)}},createWrappingReadableSource:bd,createWrappingTransformer:Sd,createWrappingWritableSink:kd,createWritableStreamWrapper:function(Ae){return cd(function(Ae){return!!fd(Ae)&&!!ld(new Ae)}(Ae)),function(ke){if(ke.constructor===Ae)return ke;var Ce=kd(ke);return new Ae(Ce)}}}),Od=bt((function(Ae){!function(Ae,ke){function r(Ae,ke){if(!Ae)throw Error(ke||"Assertion failed")}function i(Ae,ke){Ae.super_=ke;var r=function(){};r.prototype=ke.prototype,Ae.prototype=new r,Ae.prototype.constructor=Ae}function n(Ae,ke,Ce){if(n.isBN(Ae))return Ae;this.negative=0,this.words=null,this.length=0,this.red=null,null!==Ae&&("le"!==ke&&"be"!==ke||(Ce=ke,ke=10),this._init(Ae||0,ke||10,Ce||"be"))}var Ce;"object"==typeof Ae?Ae.exports=n:ke.BN=n,n.BN=n,n.wordSize=26;try{Ce=ct.default.Buffer}catch(Ae){}function s(Ae,ke,Ce){for(var qe=0,ze=Math.min(Ae.length,Ce),Ve=ke;Ve=49&&tt<=54?tt-49+10:tt>=17&&tt<=22?tt-17+10:15&tt}return qe}function o(Ae,ke,Ce,qe){for(var ze=0,Ve=Math.min(Ae.length,Ce),tt=ke;tt=49?rt-49+10:rt>=17?rt-17+10:rt}return ze}n.isBN=function(Ae){return Ae instanceof n||null!==Ae&&"object"==typeof Ae&&Ae.constructor.wordSize===n.wordSize&&Array.isArray(Ae.words)},n.max=function(Ae,ke){return Ae.cmp(ke)>0?Ae:ke},n.min=function(Ae,ke){return Ae.cmp(ke)<0?Ae:ke},n.prototype._init=function(Ae,ke,Ce){if("number"==typeof Ae)return this._initNumber(Ae,ke,Ce);if("object"==typeof Ae)return this._initArray(Ae,ke,Ce);"hex"===ke&&(ke=16),r(ke===(0|ke)&&ke>=2&&ke<=36);var qe=0;"-"===(Ae=Ae.toString().replace(/\s+/g,""))[0]&&qe++,16===ke?this._parseHex(Ae,qe):this._parseBase(Ae,ke,qe),"-"===Ae[0]&&(this.negative=1),this.strip(),"le"===Ce&&this._initArray(this.toArray(),ke,Ce)},n.prototype._initNumber=function(Ae,ke,Ce){Ae<0&&(this.negative=1,Ae=-Ae),Ae<67108864?(this.words=[67108863&Ae],this.length=1):Ae<4503599627370496?(this.words=[67108863&Ae,Ae/67108864&67108863],this.length=2):(r(Ae<9007199254740992),this.words=[67108863&Ae,Ae/67108864&67108863,1],this.length=3),"le"===Ce&&this._initArray(this.toArray(),ke,Ce)},n.prototype._initArray=function(Ae,ke,Ce){if(r("number"==typeof Ae.length),Ae.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Ae.length/3),this.words=Array(this.length);for(var qe=0;qe=0;qe-=3)Ve=Ae[qe]|Ae[qe-1]<<8|Ae[qe-2]<<16,this.words[ze]|=Ve<>>26-tt&67108863,(tt+=24)>=26&&(tt-=26,ze++);else if("le"===Ce)for(qe=0,ze=0;qe>>26-tt&67108863,(tt+=24)>=26&&(tt-=26,ze++);return this.strip()},n.prototype._parseHex=function(Ae,ke){this.length=Math.ceil((Ae.length-ke)/6),this.words=Array(this.length);for(var Ce=0;Ce=ke;Ce-=6)ze=s(Ae,Ce,Ce+6),this.words[qe]|=ze<>>26-Ve&4194303,(Ve+=24)>=26&&(Ve-=26,qe++);Ce+6!==ke&&(ze=s(Ae,ke,Ce+6),this.words[qe]|=ze<>>26-Ve&4194303),this.strip()},n.prototype._parseBase=function(Ae,ke,Ce){this.words=[0],this.length=1;for(var qe=0,ze=1;ze<=67108863;ze*=ke)qe++;qe--,ze=ze/ke|0;for(var Ve=Ae.length-Ce,tt=Ve%qe,rt=Math.min(Ve,Ve-tt)+Ce,nt=0,it=Ce;it1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var qe=["","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"],ze=[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],Ve=[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(Ae,ke,Ce){Ce.negative=ke.negative^Ae.negative;var qe=Ae.length+ke.length|0;Ce.length=qe,qe=qe-1|0;var ze=0|Ae.words[0],Ve=0|ke.words[0],tt=ze*Ve,rt=67108863&tt,nt=tt/67108864|0;Ce.words[0]=rt;for(var it=1;it>>26,ct=67108863&nt,ht=Math.min(it,ke.length-1),ft=Math.max(0,it-Ae.length+1);ft<=ht;ft++){var mt=it-ft|0;ot+=(tt=(ze=0|Ae.words[mt])*(Ve=0|ke.words[ft])+ct)/67108864|0,ct=67108863&tt}Ce.words[it]=0|ct,nt=0|ot}return 0!==nt?Ce.words[it]=0|nt:Ce.length--,Ce.strip()}n.prototype.toString=function(Ae,ke){var Ce;if(ke=0|ke||1,16===(Ae=Ae||10)||"hex"===Ae){Ce="";for(var tt=0,rt=0,nt=0;nt>>24-tt&16777215)||nt!==this.length-1?qe[6-ot.length]+ot+Ce:ot+Ce,(tt+=2)>=26&&(tt-=26,nt--)}for(0!==rt&&(Ce=rt.toString(16)+Ce);Ce.length%ke!=0;)Ce="0"+Ce;return 0!==this.negative&&(Ce="-"+Ce),Ce}if(Ae===(0|Ae)&&Ae>=2&&Ae<=36){var ct=ze[Ae],ht=Ve[Ae];Ce="";var ft=this.clone();for(ft.negative=0;!ft.isZero();){var mt=ft.modn(ht).toString(Ae);Ce=(ft=ft.idivn(ht)).isZero()?mt+Ce:qe[ct-mt.length]+mt+Ce}for(this.isZero()&&(Ce="0"+Ce);Ce.length%ke!=0;)Ce="0"+Ce;return 0!==this.negative&&(Ce="-"+Ce),Ce}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var Ae=this.words[0];return 2===this.length?Ae+=67108864*this.words[1]:3===this.length&&1===this.words[2]?Ae+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-Ae:Ae},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(Ae,ke){return r(void 0!==Ce),this.toArrayLike(Ce,Ae,ke)},n.prototype.toArray=function(Ae,ke){return this.toArrayLike(Array,Ae,ke)},n.prototype.toArrayLike=function(Ae,ke,Ce){var qe=this.byteLength(),ze=Ce||Math.max(1,qe);r(qe<=ze,"byte array longer than desired length"),r(ze>0,"Requested array length <= 0"),this.strip();var Ve,tt,rt="le"===ke,nt=new Ae(ze),it=this.clone();if(rt){for(tt=0;!it.isZero();tt++)Ve=it.andln(255),it.iushrn(8),nt[tt]=Ve;for(;tt=4096&&(Ce+=13,ke>>>=13),ke>=64&&(Ce+=7,ke>>>=7),ke>=8&&(Ce+=4,ke>>>=4),ke>=2&&(Ce+=2,ke>>>=2),Ce+ke},n.prototype._zeroBits=function(Ae){if(0===Ae)return 26;var ke=Ae,Ce=0;return 0==(8191&ke)&&(Ce+=13,ke>>>=13),0==(127&ke)&&(Ce+=7,ke>>>=7),0==(15&ke)&&(Ce+=4,ke>>>=4),0==(3&ke)&&(Ce+=2,ke>>>=2),0==(1&ke)&&Ce++,Ce},n.prototype.bitLength=function(){var Ae=this.words[this.length-1],ke=this._countBits(Ae);return 26*(this.length-1)+ke},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Ae=0,ke=0;keAe.length?this.clone().ior(Ae):Ae.clone().ior(this)},n.prototype.uor=function(Ae){return this.length>Ae.length?this.clone().iuor(Ae):Ae.clone().iuor(this)},n.prototype.iuand=function(Ae){var ke;ke=this.length>Ae.length?Ae:this;for(var Ce=0;CeAe.length?this.clone().iand(Ae):Ae.clone().iand(this)},n.prototype.uand=function(Ae){return this.length>Ae.length?this.clone().iuand(Ae):Ae.clone().iuand(this)},n.prototype.iuxor=function(Ae){var ke,Ce;this.length>Ae.length?(ke=this,Ce=Ae):(ke=Ae,Ce=this);for(var qe=0;qeAe.length?this.clone().ixor(Ae):Ae.clone().ixor(this)},n.prototype.uxor=function(Ae){return this.length>Ae.length?this.clone().iuxor(Ae):Ae.clone().iuxor(this)},n.prototype.inotn=function(Ae){r("number"==typeof Ae&&Ae>=0);var ke=0|Math.ceil(Ae/26),Ce=Ae%26;this._expand(ke),Ce>0&&ke--;for(var qe=0;qe0&&(this.words[qe]=~this.words[qe]&67108863>>26-Ce),this.strip()},n.prototype.notn=function(Ae){return this.clone().inotn(Ae)},n.prototype.setn=function(Ae,ke){r("number"==typeof Ae&&Ae>=0);var Ce=Ae/26|0,qe=Ae%26;return this._expand(Ce+1),this.words[Ce]=ke?this.words[Ce]|1<Ae.length?(Ce=this,qe=Ae):(Ce=Ae,qe=this);for(var ze=0,Ve=0;Ve>>26;for(;0!==ze&&Ve>>26;if(this.length=Ce.length,0!==ze)this.words[this.length]=ze,this.length++;else if(Ce!==this)for(;VeAe.length?this.clone().iadd(Ae):Ae.clone().iadd(this)},n.prototype.isub=function(Ae){if(0!==Ae.negative){Ae.negative=0;var ke=this.iadd(Ae);return Ae.negative=1,ke._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(Ae),this.negative=1,this._normSign();var Ce,qe,ze=this.cmp(Ae);if(0===ze)return this.negative=0,this.length=1,this.words[0]=0,this;ze>0?(Ce=this,qe=Ae):(Ce=Ae,qe=this);for(var Ve=0,tt=0;tt>26,this.words[tt]=67108863&ke;for(;0!==Ve&&tt>26,this.words[tt]=67108863&ke;if(0===Ve&&tt>>13,ft=0|tt[1],mt=8191&ft,yt=ft>>>13,Et=0|tt[2],kt=8191&Et,St=Et>>>13,Rt=0|tt[3],Pt=8191&Rt,Tt=Rt>>>13,It=0|tt[4],Bt=8191&It,Dt=It>>>13,Ot=0|tt[5],Nt=8191&Ot,Ut=Ot>>>13,Lt=0|tt[6],Kt=8191&Lt,Ft=Lt>>>13,qt=0|tt[7],zt=8191&qt,Ht=qt>>>13,$t=0|tt[8],Gt=8191&$t,Vt=$t>>>13,Xt=0|tt[9],Zt=8191&Xt,Yt=Xt>>>13,Qt=0|rt[0],Jt=8191&Qt,er=Qt>>>13,tr=0|rt[1],rr=8191&tr,nr=tr>>>13,ir=0|rt[2],sr=8191&ir,vr=ir>>>13,_r=0|rt[3],Er=8191&_r,Ar=_r>>>13,kr=0|rt[4],Sr=8191&kr,xr=kr>>>13,Rr=0|rt[5],Ir=8191&Rr,Br=Rr>>>13,Dr=0|rt[6],Ur=8191&Dr,Lr=Dr>>>13,Gr=0|rt[7],Vr=8191&Gr,Xr=Gr>>>13,Qr=0|rt[8],sn=8191&Qr,on=Qr>>>13,an=0|rt[9],cn=8191&an,un=an>>>13;Ce.negative=Ae.negative^ke.negative,Ce.length=19;var hn=(it+(qe=Math.imul(ct,Jt))|0)+((8191&(ze=(ze=Math.imul(ct,er))+Math.imul(ht,Jt)|0))<<13)|0;it=((Ve=Math.imul(ht,er))+(ze>>>13)|0)+(hn>>>26)|0,hn&=67108863,qe=Math.imul(mt,Jt),ze=(ze=Math.imul(mt,er))+Math.imul(yt,Jt)|0,Ve=Math.imul(yt,er);var mn=(it+(qe=qe+Math.imul(ct,rr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,nr)|0)+Math.imul(ht,rr)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,nr)|0)+(ze>>>13)|0)+(mn>>>26)|0,mn&=67108863,qe=Math.imul(kt,Jt),ze=(ze=Math.imul(kt,er))+Math.imul(St,Jt)|0,Ve=Math.imul(St,er),qe=qe+Math.imul(mt,rr)|0,ze=(ze=ze+Math.imul(mt,nr)|0)+Math.imul(yt,rr)|0,Ve=Ve+Math.imul(yt,nr)|0;var bn=(it+(qe=qe+Math.imul(ct,sr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,vr)|0)+Math.imul(ht,sr)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,vr)|0)+(ze>>>13)|0)+(bn>>>26)|0,bn&=67108863,qe=Math.imul(Pt,Jt),ze=(ze=Math.imul(Pt,er))+Math.imul(Tt,Jt)|0,Ve=Math.imul(Tt,er),qe=qe+Math.imul(kt,rr)|0,ze=(ze=ze+Math.imul(kt,nr)|0)+Math.imul(St,rr)|0,Ve=Ve+Math.imul(St,nr)|0,qe=qe+Math.imul(mt,sr)|0,ze=(ze=ze+Math.imul(mt,vr)|0)+Math.imul(yt,sr)|0,Ve=Ve+Math.imul(yt,vr)|0;var vn=(it+(qe=qe+Math.imul(ct,Er)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Ar)|0)+Math.imul(ht,Er)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,Ar)|0)+(ze>>>13)|0)+(vn>>>26)|0,vn&=67108863,qe=Math.imul(Bt,Jt),ze=(ze=Math.imul(Bt,er))+Math.imul(Dt,Jt)|0,Ve=Math.imul(Dt,er),qe=qe+Math.imul(Pt,rr)|0,ze=(ze=ze+Math.imul(Pt,nr)|0)+Math.imul(Tt,rr)|0,Ve=Ve+Math.imul(Tt,nr)|0,qe=qe+Math.imul(kt,sr)|0,ze=(ze=ze+Math.imul(kt,vr)|0)+Math.imul(St,sr)|0,Ve=Ve+Math.imul(St,vr)|0,qe=qe+Math.imul(mt,Er)|0,ze=(ze=ze+Math.imul(mt,Ar)|0)+Math.imul(yt,Er)|0,Ve=Ve+Math.imul(yt,Ar)|0;var _n=(it+(qe=qe+Math.imul(ct,Sr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,xr)|0)+Math.imul(ht,Sr)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,xr)|0)+(ze>>>13)|0)+(_n>>>26)|0,_n&=67108863,qe=Math.imul(Nt,Jt),ze=(ze=Math.imul(Nt,er))+Math.imul(Ut,Jt)|0,Ve=Math.imul(Ut,er),qe=qe+Math.imul(Bt,rr)|0,ze=(ze=ze+Math.imul(Bt,nr)|0)+Math.imul(Dt,rr)|0,Ve=Ve+Math.imul(Dt,nr)|0,qe=qe+Math.imul(Pt,sr)|0,ze=(ze=ze+Math.imul(Pt,vr)|0)+Math.imul(Tt,sr)|0,Ve=Ve+Math.imul(Tt,vr)|0,qe=qe+Math.imul(kt,Er)|0,ze=(ze=ze+Math.imul(kt,Ar)|0)+Math.imul(St,Er)|0,Ve=Ve+Math.imul(St,Ar)|0,qe=qe+Math.imul(mt,Sr)|0,ze=(ze=ze+Math.imul(mt,xr)|0)+Math.imul(yt,Sr)|0,Ve=Ve+Math.imul(yt,xr)|0;var En=(it+(qe=qe+Math.imul(ct,Ir)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Br)|0)+Math.imul(ht,Ir)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,Br)|0)+(ze>>>13)|0)+(En>>>26)|0,En&=67108863,qe=Math.imul(Kt,Jt),ze=(ze=Math.imul(Kt,er))+Math.imul(Ft,Jt)|0,Ve=Math.imul(Ft,er),qe=qe+Math.imul(Nt,rr)|0,ze=(ze=ze+Math.imul(Nt,nr)|0)+Math.imul(Ut,rr)|0,Ve=Ve+Math.imul(Ut,nr)|0,qe=qe+Math.imul(Bt,sr)|0,ze=(ze=ze+Math.imul(Bt,vr)|0)+Math.imul(Dt,sr)|0,Ve=Ve+Math.imul(Dt,vr)|0,qe=qe+Math.imul(Pt,Er)|0,ze=(ze=ze+Math.imul(Pt,Ar)|0)+Math.imul(Tt,Er)|0,Ve=Ve+Math.imul(Tt,Ar)|0,qe=qe+Math.imul(kt,Sr)|0,ze=(ze=ze+Math.imul(kt,xr)|0)+Math.imul(St,Sr)|0,Ve=Ve+Math.imul(St,xr)|0,qe=qe+Math.imul(mt,Ir)|0,ze=(ze=ze+Math.imul(mt,Br)|0)+Math.imul(yt,Ir)|0,Ve=Ve+Math.imul(yt,Br)|0;var An=(it+(qe=qe+Math.imul(ct,Ur)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Lr)|0)+Math.imul(ht,Ur)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,Lr)|0)+(ze>>>13)|0)+(An>>>26)|0,An&=67108863,qe=Math.imul(zt,Jt),ze=(ze=Math.imul(zt,er))+Math.imul(Ht,Jt)|0,Ve=Math.imul(Ht,er),qe=qe+Math.imul(Kt,rr)|0,ze=(ze=ze+Math.imul(Kt,nr)|0)+Math.imul(Ft,rr)|0,Ve=Ve+Math.imul(Ft,nr)|0,qe=qe+Math.imul(Nt,sr)|0,ze=(ze=ze+Math.imul(Nt,vr)|0)+Math.imul(Ut,sr)|0,Ve=Ve+Math.imul(Ut,vr)|0,qe=qe+Math.imul(Bt,Er)|0,ze=(ze=ze+Math.imul(Bt,Ar)|0)+Math.imul(Dt,Er)|0,Ve=Ve+Math.imul(Dt,Ar)|0,qe=qe+Math.imul(Pt,Sr)|0,ze=(ze=ze+Math.imul(Pt,xr)|0)+Math.imul(Tt,Sr)|0,Ve=Ve+Math.imul(Tt,xr)|0,qe=qe+Math.imul(kt,Ir)|0,ze=(ze=ze+Math.imul(kt,Br)|0)+Math.imul(St,Ir)|0,Ve=Ve+Math.imul(St,Br)|0,qe=qe+Math.imul(mt,Ur)|0,ze=(ze=ze+Math.imul(mt,Lr)|0)+Math.imul(yt,Ur)|0,Ve=Ve+Math.imul(yt,Lr)|0;var kn=(it+(qe=qe+Math.imul(ct,Vr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Xr)|0)+Math.imul(ht,Vr)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,Xr)|0)+(ze>>>13)|0)+(kn>>>26)|0,kn&=67108863,qe=Math.imul(Gt,Jt),ze=(ze=Math.imul(Gt,er))+Math.imul(Vt,Jt)|0,Ve=Math.imul(Vt,er),qe=qe+Math.imul(zt,rr)|0,ze=(ze=ze+Math.imul(zt,nr)|0)+Math.imul(Ht,rr)|0,Ve=Ve+Math.imul(Ht,nr)|0,qe=qe+Math.imul(Kt,sr)|0,ze=(ze=ze+Math.imul(Kt,vr)|0)+Math.imul(Ft,sr)|0,Ve=Ve+Math.imul(Ft,vr)|0,qe=qe+Math.imul(Nt,Er)|0,ze=(ze=ze+Math.imul(Nt,Ar)|0)+Math.imul(Ut,Er)|0,Ve=Ve+Math.imul(Ut,Ar)|0,qe=qe+Math.imul(Bt,Sr)|0,ze=(ze=ze+Math.imul(Bt,xr)|0)+Math.imul(Dt,Sr)|0,Ve=Ve+Math.imul(Dt,xr)|0,qe=qe+Math.imul(Pt,Ir)|0,ze=(ze=ze+Math.imul(Pt,Br)|0)+Math.imul(Tt,Ir)|0,Ve=Ve+Math.imul(Tt,Br)|0,qe=qe+Math.imul(kt,Ur)|0,ze=(ze=ze+Math.imul(kt,Lr)|0)+Math.imul(St,Ur)|0,Ve=Ve+Math.imul(St,Lr)|0,qe=qe+Math.imul(mt,Vr)|0,ze=(ze=ze+Math.imul(mt,Xr)|0)+Math.imul(yt,Vr)|0,Ve=Ve+Math.imul(yt,Xr)|0;var Sn=(it+(qe=qe+Math.imul(ct,sn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,on)|0)+Math.imul(ht,sn)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,on)|0)+(ze>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,qe=Math.imul(Zt,Jt),ze=(ze=Math.imul(Zt,er))+Math.imul(Yt,Jt)|0,Ve=Math.imul(Yt,er),qe=qe+Math.imul(Gt,rr)|0,ze=(ze=ze+Math.imul(Gt,nr)|0)+Math.imul(Vt,rr)|0,Ve=Ve+Math.imul(Vt,nr)|0,qe=qe+Math.imul(zt,sr)|0,ze=(ze=ze+Math.imul(zt,vr)|0)+Math.imul(Ht,sr)|0,Ve=Ve+Math.imul(Ht,vr)|0,qe=qe+Math.imul(Kt,Er)|0,ze=(ze=ze+Math.imul(Kt,Ar)|0)+Math.imul(Ft,Er)|0,Ve=Ve+Math.imul(Ft,Ar)|0,qe=qe+Math.imul(Nt,Sr)|0,ze=(ze=ze+Math.imul(Nt,xr)|0)+Math.imul(Ut,Sr)|0,Ve=Ve+Math.imul(Ut,xr)|0,qe=qe+Math.imul(Bt,Ir)|0,ze=(ze=ze+Math.imul(Bt,Br)|0)+Math.imul(Dt,Ir)|0,Ve=Ve+Math.imul(Dt,Br)|0,qe=qe+Math.imul(Pt,Ur)|0,ze=(ze=ze+Math.imul(Pt,Lr)|0)+Math.imul(Tt,Ur)|0,Ve=Ve+Math.imul(Tt,Lr)|0,qe=qe+Math.imul(kt,Vr)|0,ze=(ze=ze+Math.imul(kt,Xr)|0)+Math.imul(St,Vr)|0,Ve=Ve+Math.imul(St,Xr)|0,qe=qe+Math.imul(mt,sn)|0,ze=(ze=ze+Math.imul(mt,on)|0)+Math.imul(yt,sn)|0,Ve=Ve+Math.imul(yt,on)|0;var Pn=(it+(qe=qe+Math.imul(ct,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,un)|0)+Math.imul(ht,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(ht,un)|0)+(ze>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,qe=Math.imul(Zt,rr),ze=(ze=Math.imul(Zt,nr))+Math.imul(Yt,rr)|0,Ve=Math.imul(Yt,nr),qe=qe+Math.imul(Gt,sr)|0,ze=(ze=ze+Math.imul(Gt,vr)|0)+Math.imul(Vt,sr)|0,Ve=Ve+Math.imul(Vt,vr)|0,qe=qe+Math.imul(zt,Er)|0,ze=(ze=ze+Math.imul(zt,Ar)|0)+Math.imul(Ht,Er)|0,Ve=Ve+Math.imul(Ht,Ar)|0,qe=qe+Math.imul(Kt,Sr)|0,ze=(ze=ze+Math.imul(Kt,xr)|0)+Math.imul(Ft,Sr)|0,Ve=Ve+Math.imul(Ft,xr)|0,qe=qe+Math.imul(Nt,Ir)|0,ze=(ze=ze+Math.imul(Nt,Br)|0)+Math.imul(Ut,Ir)|0,Ve=Ve+Math.imul(Ut,Br)|0,qe=qe+Math.imul(Bt,Ur)|0,ze=(ze=ze+Math.imul(Bt,Lr)|0)+Math.imul(Dt,Ur)|0,Ve=Ve+Math.imul(Dt,Lr)|0,qe=qe+Math.imul(Pt,Vr)|0,ze=(ze=ze+Math.imul(Pt,Xr)|0)+Math.imul(Tt,Vr)|0,Ve=Ve+Math.imul(Tt,Xr)|0,qe=qe+Math.imul(kt,sn)|0,ze=(ze=ze+Math.imul(kt,on)|0)+Math.imul(St,sn)|0,Ve=Ve+Math.imul(St,on)|0;var Dn=(it+(qe=qe+Math.imul(mt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(mt,un)|0)+Math.imul(yt,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(yt,un)|0)+(ze>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,qe=Math.imul(Zt,sr),ze=(ze=Math.imul(Zt,vr))+Math.imul(Yt,sr)|0,Ve=Math.imul(Yt,vr),qe=qe+Math.imul(Gt,Er)|0,ze=(ze=ze+Math.imul(Gt,Ar)|0)+Math.imul(Vt,Er)|0,Ve=Ve+Math.imul(Vt,Ar)|0,qe=qe+Math.imul(zt,Sr)|0,ze=(ze=ze+Math.imul(zt,xr)|0)+Math.imul(Ht,Sr)|0,Ve=Ve+Math.imul(Ht,xr)|0,qe=qe+Math.imul(Kt,Ir)|0,ze=(ze=ze+Math.imul(Kt,Br)|0)+Math.imul(Ft,Ir)|0,Ve=Ve+Math.imul(Ft,Br)|0,qe=qe+Math.imul(Nt,Ur)|0,ze=(ze=ze+Math.imul(Nt,Lr)|0)+Math.imul(Ut,Ur)|0,Ve=Ve+Math.imul(Ut,Lr)|0,qe=qe+Math.imul(Bt,Vr)|0,ze=(ze=ze+Math.imul(Bt,Xr)|0)+Math.imul(Dt,Vr)|0,Ve=Ve+Math.imul(Dt,Xr)|0,qe=qe+Math.imul(Pt,sn)|0,ze=(ze=ze+Math.imul(Pt,on)|0)+Math.imul(Tt,sn)|0,Ve=Ve+Math.imul(Tt,on)|0;var On=(it+(qe=qe+Math.imul(kt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(kt,un)|0)+Math.imul(St,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(St,un)|0)+(ze>>>13)|0)+(On>>>26)|0,On&=67108863,qe=Math.imul(Zt,Er),ze=(ze=Math.imul(Zt,Ar))+Math.imul(Yt,Er)|0,Ve=Math.imul(Yt,Ar),qe=qe+Math.imul(Gt,Sr)|0,ze=(ze=ze+Math.imul(Gt,xr)|0)+Math.imul(Vt,Sr)|0,Ve=Ve+Math.imul(Vt,xr)|0,qe=qe+Math.imul(zt,Ir)|0,ze=(ze=ze+Math.imul(zt,Br)|0)+Math.imul(Ht,Ir)|0,Ve=Ve+Math.imul(Ht,Br)|0,qe=qe+Math.imul(Kt,Ur)|0,ze=(ze=ze+Math.imul(Kt,Lr)|0)+Math.imul(Ft,Ur)|0,Ve=Ve+Math.imul(Ft,Lr)|0,qe=qe+Math.imul(Nt,Vr)|0,ze=(ze=ze+Math.imul(Nt,Xr)|0)+Math.imul(Ut,Vr)|0,Ve=Ve+Math.imul(Ut,Xr)|0,qe=qe+Math.imul(Bt,sn)|0,ze=(ze=ze+Math.imul(Bt,on)|0)+Math.imul(Dt,sn)|0,Ve=Ve+Math.imul(Dt,on)|0;var Un=(it+(qe=qe+Math.imul(Pt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Pt,un)|0)+Math.imul(Tt,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Tt,un)|0)+(ze>>>13)|0)+(Un>>>26)|0,Un&=67108863,qe=Math.imul(Zt,Sr),ze=(ze=Math.imul(Zt,xr))+Math.imul(Yt,Sr)|0,Ve=Math.imul(Yt,xr),qe=qe+Math.imul(Gt,Ir)|0,ze=(ze=ze+Math.imul(Gt,Br)|0)+Math.imul(Vt,Ir)|0,Ve=Ve+Math.imul(Vt,Br)|0,qe=qe+Math.imul(zt,Ur)|0,ze=(ze=ze+Math.imul(zt,Lr)|0)+Math.imul(Ht,Ur)|0,Ve=Ve+Math.imul(Ht,Lr)|0,qe=qe+Math.imul(Kt,Vr)|0,ze=(ze=ze+Math.imul(Kt,Xr)|0)+Math.imul(Ft,Vr)|0,Ve=Ve+Math.imul(Ft,Xr)|0,qe=qe+Math.imul(Nt,sn)|0,ze=(ze=ze+Math.imul(Nt,on)|0)+Math.imul(Ut,sn)|0,Ve=Ve+Math.imul(Ut,on)|0;var Fn=(it+(qe=qe+Math.imul(Bt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Bt,un)|0)+Math.imul(Dt,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Dt,un)|0)+(ze>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,qe=Math.imul(Zt,Ir),ze=(ze=Math.imul(Zt,Br))+Math.imul(Yt,Ir)|0,Ve=Math.imul(Yt,Br),qe=qe+Math.imul(Gt,Ur)|0,ze=(ze=ze+Math.imul(Gt,Lr)|0)+Math.imul(Vt,Ur)|0,Ve=Ve+Math.imul(Vt,Lr)|0,qe=qe+Math.imul(zt,Vr)|0,ze=(ze=ze+Math.imul(zt,Xr)|0)+Math.imul(Ht,Vr)|0,Ve=Ve+Math.imul(Ht,Xr)|0,qe=qe+Math.imul(Kt,sn)|0,ze=(ze=ze+Math.imul(Kt,on)|0)+Math.imul(Ft,sn)|0,Ve=Ve+Math.imul(Ft,on)|0;var qn=(it+(qe=qe+Math.imul(Nt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Nt,un)|0)+Math.imul(Ut,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Ut,un)|0)+(ze>>>13)|0)+(qn>>>26)|0,qn&=67108863,qe=Math.imul(Zt,Ur),ze=(ze=Math.imul(Zt,Lr))+Math.imul(Yt,Ur)|0,Ve=Math.imul(Yt,Lr),qe=qe+Math.imul(Gt,Vr)|0,ze=(ze=ze+Math.imul(Gt,Xr)|0)+Math.imul(Vt,Vr)|0,Ve=Ve+Math.imul(Vt,Xr)|0,qe=qe+Math.imul(zt,sn)|0,ze=(ze=ze+Math.imul(zt,on)|0)+Math.imul(Ht,sn)|0,Ve=Ve+Math.imul(Ht,on)|0;var Hn=(it+(qe=qe+Math.imul(Kt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Kt,un)|0)+Math.imul(Ft,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Ft,un)|0)+(ze>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,qe=Math.imul(Zt,Vr),ze=(ze=Math.imul(Zt,Xr))+Math.imul(Yt,Vr)|0,Ve=Math.imul(Yt,Xr),qe=qe+Math.imul(Gt,sn)|0,ze=(ze=ze+Math.imul(Gt,on)|0)+Math.imul(Vt,sn)|0,Ve=Ve+Math.imul(Vt,on)|0;var $n=(it+(qe=qe+Math.imul(zt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(zt,un)|0)+Math.imul(Ht,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Ht,un)|0)+(ze>>>13)|0)+($n>>>26)|0,$n&=67108863,qe=Math.imul(Zt,sn),ze=(ze=Math.imul(Zt,on))+Math.imul(Yt,sn)|0,Ve=Math.imul(Yt,on);var Gn=(it+(qe=qe+Math.imul(Gt,cn)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Gt,un)|0)+Math.imul(Vt,cn)|0))<<13)|0;it=((Ve=Ve+Math.imul(Vt,un)|0)+(ze>>>13)|0)+(Gn>>>26)|0,Gn&=67108863;var Vn=(it+(qe=Math.imul(Zt,cn))|0)+((8191&(ze=(ze=Math.imul(Zt,un))+Math.imul(Yt,cn)|0))<<13)|0;return it=((Ve=Math.imul(Yt,un))+(ze>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,nt[0]=hn,nt[1]=mn,nt[2]=bn,nt[3]=vn,nt[4]=_n,nt[5]=En,nt[6]=An,nt[7]=kn,nt[8]=Sn,nt[9]=Pn,nt[10]=Dn,nt[11]=On,nt[12]=Un,nt[13]=Fn,nt[14]=qn,nt[15]=Hn,nt[16]=$n,nt[17]=Gn,nt[18]=Vn,0!==it&&(nt[19]=it,Ce.length++),Ce};function p(Ae,ke,Ce){return(new y).mulp(Ae,ke,Ce)}function y(Ae,ke){this.x=Ae,this.y=ke}Math.imul||(l=d),n.prototype.mulTo=function(Ae,ke){var Ce=this.length+Ae.length;return 10===this.length&&10===Ae.length?l(this,Ae,ke):Ce<63?d(this,Ae,ke):Ce<1024?function(Ae,ke,Ce){Ce.negative=ke.negative^Ae.negative,Ce.length=Ae.length+ke.length;for(var qe=0,ze=0,Ve=0;Ve>>26)|0)>>>26,tt&=67108863}Ce.words[Ve]=rt,qe=tt,tt=ze}return 0!==qe?Ce.words[Ve]=qe:Ce.length--,Ce.strip()}(this,Ae,ke):p(this,Ae,ke)},y.prototype.makeRBT=function(Ae){for(var ke=Array(Ae),Ce=n.prototype._countBits(Ae)-1,qe=0;qe>=1;return qe},y.prototype.permute=function(Ae,ke,Ce,qe,ze,Ve){for(var tt=0;tt>>=1)ze++;return 1<>>=13,Ce[2*Ve+1]=8191&ze,ze>>>=13;for(Ve=2*ke;Ve>=26,ke+=qe/67108864|0,ke+=ze>>>26,this.words[Ce]=67108863&ze}return 0!==ke&&(this.words[Ce]=ke,this.length++),this},n.prototype.muln=function(Ae){return this.clone().imuln(Ae)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(Ae){var ke=function(Ae){for(var ke=Array(Ae.bitLength()),Ce=0;Ce>>ze}return ke}(Ae);if(0===ke.length)return new n(1);for(var Ce=this,qe=0;qe=0);var ke,Ce=Ae%26,qe=(Ae-Ce)/26,ze=67108863>>>26-Ce<<26-Ce;if(0!==Ce){var Ve=0;for(ke=0;ke>>26-Ce}Ve&&(this.words[ke]=Ve,this.length++)}if(0!==qe){for(ke=this.length-1;ke>=0;ke--)this.words[ke+qe]=this.words[ke];for(ke=0;ke=0),qe=ke?(ke-ke%26)/26:0;var ze=Ae%26,Ve=Math.min((Ae-ze)/26,this.length),tt=67108863^67108863>>>ze<Ve)for(this.length-=Ve,nt=0;nt=0&&(0!==it||nt>=qe);nt--){var ot=0|this.words[nt];this.words[nt]=it<<26-ze|ot>>>ze,it=ot&tt}return rt&&0!==it&&(rt.words[rt.length++]=it),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(Ae,ke,Ce){return r(0===this.negative),this.iushrn(Ae,ke,Ce)},n.prototype.shln=function(Ae){return this.clone().ishln(Ae)},n.prototype.ushln=function(Ae){return this.clone().iushln(Ae)},n.prototype.shrn=function(Ae){return this.clone().ishrn(Ae)},n.prototype.ushrn=function(Ae){return this.clone().iushrn(Ae)},n.prototype.testn=function(Ae){r("number"==typeof Ae&&Ae>=0);var ke=Ae%26,Ce=(Ae-ke)/26,qe=1<=0);var ke=Ae%26,Ce=(Ae-ke)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=Ce)return this;if(0!==ke&&Ce++,this.length=Math.min(Ce,this.length),0!==ke){var qe=67108863^67108863>>>ke<=67108864;ke++)this.words[ke]-=67108864,ke===this.length-1?this.words[ke+1]=1:this.words[ke+1]++;return this.length=Math.max(this.length,ke+1),this},n.prototype.isubn=function(Ae){if(r("number"==typeof Ae),r(Ae<67108864),Ae<0)return this.iaddn(-Ae);if(0!==this.negative)return this.negative=0,this.iaddn(Ae),this.negative=1,this;if(this.words[0]-=Ae,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var ke=0;ke>26)-(rt/67108864|0),this.words[qe+Ce]=67108863&ze}for(;qe>26,this.words[qe+Ce]=67108863&ze;if(0===tt)return this.strip();for(r(-1===tt),tt=0,qe=0;qe>26,this.words[qe]=67108863&ze;return this.negative=1,this.strip()},n.prototype._wordDiv=function(Ae,ke){var Ce=(this.length,Ae.length),qe=this.clone(),ze=Ae,Ve=0|ze.words[ze.length-1];0!==(Ce=26-this._countBits(Ve))&&(ze=ze.ushln(Ce),qe.iushln(Ce),Ve=0|ze.words[ze.length-1]);var tt,rt=qe.length-ze.length;if("mod"!==ke){(tt=new n(null)).length=rt+1,tt.words=Array(tt.length);for(var nt=0;nt=0;ot--){var ct=67108864*(0|qe.words[ze.length+ot])+(0|qe.words[ze.length+ot-1]);for(ct=Math.min(ct/Ve|0,67108863),qe._ishlnsubmul(ze,ct,ot);0!==qe.negative;)ct--,qe.negative=0,qe._ishlnsubmul(ze,1,ot),qe.isZero()||(qe.negative^=1);tt&&(tt.words[ot]=ct)}return tt&&tt.strip(),qe.strip(),"div"!==ke&&0!==Ce&&qe.iushrn(Ce),{div:tt||null,mod:qe}},n.prototype.divmod=function(Ae,ke,Ce){return r(!Ae.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===Ae.negative?(Ve=this.neg().divmod(Ae,ke),"mod"!==ke&&(qe=Ve.div.neg()),"div"!==ke&&(ze=Ve.mod.neg(),Ce&&0!==ze.negative&&ze.iadd(Ae)),{div:qe,mod:ze}):0===this.negative&&0!==Ae.negative?(Ve=this.divmod(Ae.neg(),ke),"mod"!==ke&&(qe=Ve.div.neg()),{div:qe,mod:Ve.mod}):0!=(this.negative&Ae.negative)?(Ve=this.neg().divmod(Ae.neg(),ke),"div"!==ke&&(ze=Ve.mod.neg(),Ce&&0!==ze.negative&&ze.isub(Ae)),{div:Ve.div,mod:ze}):Ae.length>this.length||this.cmp(Ae)<0?{div:new n(0),mod:this}:1===Ae.length?"div"===ke?{div:this.divn(Ae.words[0]),mod:null}:"mod"===ke?{div:null,mod:new n(this.modn(Ae.words[0]))}:{div:this.divn(Ae.words[0]),mod:new n(this.modn(Ae.words[0]))}:this._wordDiv(Ae,ke);var qe,ze,Ve},n.prototype.div=function(Ae){return this.divmod(Ae,"div",!1).div},n.prototype.mod=function(Ae){return this.divmod(Ae,"mod",!1).mod},n.prototype.umod=function(Ae){return this.divmod(Ae,"mod",!0).mod},n.prototype.divRound=function(Ae){var ke=this.divmod(Ae);if(ke.mod.isZero())return ke.div;var Ce=0!==ke.div.negative?ke.mod.isub(Ae):ke.mod,qe=Ae.ushrn(1),ze=Ae.andln(1),Ve=Ce.cmp(qe);return Ve<0||1===ze&&0===Ve?ke.div:0!==ke.div.negative?ke.div.isubn(1):ke.div.iaddn(1)},n.prototype.modn=function(Ae){r(Ae<=67108863);for(var ke=(1<<26)%Ae,Ce=0,qe=this.length-1;qe>=0;qe--)Ce=(ke*Ce+(0|this.words[qe]))%Ae;return Ce},n.prototype.idivn=function(Ae){r(Ae<=67108863);for(var ke=0,Ce=this.length-1;Ce>=0;Ce--){var qe=(0|this.words[Ce])+67108864*ke;this.words[Ce]=qe/Ae|0,ke=qe%Ae}return this.strip()},n.prototype.divn=function(Ae){return this.clone().idivn(Ae)},n.prototype.egcd=function(Ae){r(0===Ae.negative),r(!Ae.isZero());var ke=this,Ce=Ae.clone();ke=0!==ke.negative?ke.umod(Ae):ke.clone();for(var qe=new n(1),ze=new n(0),Ve=new n(0),tt=new n(1),rt=0;ke.isEven()&&Ce.isEven();)ke.iushrn(1),Ce.iushrn(1),++rt;for(var nt=Ce.clone(),it=ke.clone();!ke.isZero();){for(var ot=0,ct=1;0==(ke.words[0]&ct)&&ot<26;++ot,ct<<=1);if(ot>0)for(ke.iushrn(ot);ot-- >0;)(qe.isOdd()||ze.isOdd())&&(qe.iadd(nt),ze.isub(it)),qe.iushrn(1),ze.iushrn(1);for(var ht=0,ft=1;0==(Ce.words[0]&ft)&&ht<26;++ht,ft<<=1);if(ht>0)for(Ce.iushrn(ht);ht-- >0;)(Ve.isOdd()||tt.isOdd())&&(Ve.iadd(nt),tt.isub(it)),Ve.iushrn(1),tt.iushrn(1);ke.cmp(Ce)>=0?(ke.isub(Ce),qe.isub(Ve),ze.isub(tt)):(Ce.isub(ke),Ve.isub(qe),tt.isub(ze))}return{a:Ve,b:tt,gcd:Ce.iushln(rt)}},n.prototype._invmp=function(Ae){r(0===Ae.negative),r(!Ae.isZero());var ke=this,Ce=Ae.clone();ke=0!==ke.negative?ke.umod(Ae):ke.clone();for(var qe,ze=new n(1),Ve=new n(0),tt=Ce.clone();ke.cmpn(1)>0&&Ce.cmpn(1)>0;){for(var rt=0,nt=1;0==(ke.words[0]&nt)&&rt<26;++rt,nt<<=1);if(rt>0)for(ke.iushrn(rt);rt-- >0;)ze.isOdd()&&ze.iadd(tt),ze.iushrn(1);for(var it=0,ot=1;0==(Ce.words[0]&ot)&&it<26;++it,ot<<=1);if(it>0)for(Ce.iushrn(it);it-- >0;)Ve.isOdd()&&Ve.iadd(tt),Ve.iushrn(1);ke.cmp(Ce)>=0?(ke.isub(Ce),ze.isub(Ve)):(Ce.isub(ke),Ve.isub(ze))}return(qe=0===ke.cmpn(1)?ze:Ve).cmpn(0)<0&&qe.iadd(Ae),qe},n.prototype.gcd=function(Ae){if(this.isZero())return Ae.abs();if(Ae.isZero())return this.abs();var ke=this.clone(),Ce=Ae.clone();ke.negative=0,Ce.negative=0;for(var qe=0;ke.isEven()&&Ce.isEven();qe++)ke.iushrn(1),Ce.iushrn(1);for(;;){for(;ke.isEven();)ke.iushrn(1);for(;Ce.isEven();)Ce.iushrn(1);var ze=ke.cmp(Ce);if(ze<0){var Ve=ke;ke=Ce,Ce=Ve}else if(0===ze||0===Ce.cmpn(1))break;ke.isub(Ce)}return Ce.iushln(qe)},n.prototype.invm=function(Ae){return this.egcd(Ae).a.umod(Ae)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(Ae){return this.words[0]&Ae},n.prototype.bincn=function(Ae){r("number"==typeof Ae);var ke=Ae%26,Ce=(Ae-ke)/26,qe=1<>>26,tt&=67108863,this.words[Ve]=tt}return 0!==ze&&(this.words[Ve]=ze,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(Ae){var ke,Ce=Ae<0;if(0!==this.negative&&!Ce)return-1;if(0===this.negative&&Ce)return 1;if(this.strip(),this.length>1)ke=1;else{Ce&&(Ae=-Ae),r(Ae<=67108863,"Number is too big");var qe=0|this.words[0];ke=qe===Ae?0:qeAe.length)return 1;if(this.length=0;Ce--){var qe=0|this.words[Ce],ze=0|Ae.words[Ce];if(qe!==ze){qeze&&(ke=1);break}}return ke},n.prototype.gtn=function(Ae){return 1===this.cmpn(Ae)},n.prototype.gt=function(Ae){return 1===this.cmp(Ae)},n.prototype.gten=function(Ae){return this.cmpn(Ae)>=0},n.prototype.gte=function(Ae){return this.cmp(Ae)>=0},n.prototype.ltn=function(Ae){return-1===this.cmpn(Ae)},n.prototype.lt=function(Ae){return-1===this.cmp(Ae)},n.prototype.lten=function(Ae){return this.cmpn(Ae)<=0},n.prototype.lte=function(Ae){return this.cmp(Ae)<=0},n.prototype.eqn=function(Ae){return 0===this.cmpn(Ae)},n.prototype.eq=function(Ae){return 0===this.cmp(Ae)},n.red=function(Ae){return new k(Ae)},n.prototype.toRed=function(Ae){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),Ae.convertTo(this)._forceRed(Ae)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(Ae){return this.red=Ae,this},n.prototype.forceRed=function(Ae){return r(!this.red,"Already a number in reduction context"),this._forceRed(Ae)},n.prototype.redAdd=function(Ae){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,Ae)},n.prototype.redIAdd=function(Ae){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Ae)},n.prototype.redSub=function(Ae){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,Ae)},n.prototype.redISub=function(Ae){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,Ae)},n.prototype.redShl=function(Ae){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,Ae)},n.prototype.redMul=function(Ae){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ae),this.red.mul(this,Ae)},n.prototype.redIMul=function(Ae){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ae),this.red.imul(this,Ae)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(Ae){return r(this.red&&!Ae.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Ae)};var tt={k256:null,p224:null,p192:null,p25519:null};function m(Ae,ke){this.name=Ae,this.p=new n(ke,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(Ae){if("string"==typeof Ae){var ke=n._prime(Ae);this.m=ke.p,this.prime=ke}else r(Ae.gtn(1),"modulus must be greater than 1"),this.m=Ae,this.prime=null}function A(Ae){k.call(this,Ae),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 Ae=new n(null);return Ae.words=Array(Math.ceil(this.n/13)),Ae},m.prototype.ireduce=function(Ae){var ke,Ce=Ae;do{this.split(Ce,this.tmp),ke=(Ce=(Ce=this.imulK(Ce)).iadd(this.tmp)).bitLength()}while(ke>this.n);var qe=ke0?Ce.isub(this.p):Ce.strip(),Ce},m.prototype.split=function(Ae,ke){Ae.iushrn(this.n,0,ke)},m.prototype.imulK=function(Ae){return Ae.imul(this.k)},i(g,m),g.prototype.split=function(Ae,ke){for(var Ce=4194303,qe=Math.min(Ae.length,9),ze=0;ze>>22,Ve=tt}Ve>>>=22,Ae.words[ze-10]=Ve,0===Ve&&Ae.length>10?Ae.length-=10:Ae.length-=9},g.prototype.imulK=function(Ae){Ae.words[Ae.length]=0,Ae.words[Ae.length+1]=0,Ae.length+=2;for(var ke=0,Ce=0;Ce>>=26,Ae.words[Ce]=ze,ke=qe}return 0!==ke&&(Ae.words[Ae.length++]=ke),Ae},n._prime=function(Ae){if(tt[Ae])return tt[Ae];var ke;if("k256"===Ae)ke=new g;else if("p224"===Ae)ke=new w;else if("p192"===Ae)ke=new v;else{if("p25519"!==Ae)throw Error("Unknown prime "+Ae);ke=new _}return tt[Ae]=ke,ke},k.prototype._verify1=function(Ae){r(0===Ae.negative,"red works only with positives"),r(Ae.red,"red works only with red numbers")},k.prototype._verify2=function(Ae,ke){r(0==(Ae.negative|ke.negative),"red works only with positives"),r(Ae.red&&Ae.red===ke.red,"red works only with red numbers")},k.prototype.imod=function(Ae){return this.prime?this.prime.ireduce(Ae)._forceRed(this):Ae.umod(this.m)._forceRed(this)},k.prototype.neg=function(Ae){return Ae.isZero()?Ae.clone():this.m.sub(Ae)._forceRed(this)},k.prototype.add=function(Ae,ke){this._verify2(Ae,ke);var Ce=Ae.add(ke);return Ce.cmp(this.m)>=0&&Ce.isub(this.m),Ce._forceRed(this)},k.prototype.iadd=function(Ae,ke){this._verify2(Ae,ke);var Ce=Ae.iadd(ke);return Ce.cmp(this.m)>=0&&Ce.isub(this.m),Ce},k.prototype.sub=function(Ae,ke){this._verify2(Ae,ke);var Ce=Ae.sub(ke);return Ce.cmpn(0)<0&&Ce.iadd(this.m),Ce._forceRed(this)},k.prototype.isub=function(Ae,ke){this._verify2(Ae,ke);var Ce=Ae.isub(ke);return Ce.cmpn(0)<0&&Ce.iadd(this.m),Ce},k.prototype.shl=function(Ae,ke){return this._verify1(Ae),this.imod(Ae.ushln(ke))},k.prototype.imul=function(Ae,ke){return this._verify2(Ae,ke),this.imod(Ae.imul(ke))},k.prototype.mul=function(Ae,ke){return this._verify2(Ae,ke),this.imod(Ae.mul(ke))},k.prototype.isqr=function(Ae){return this.imul(Ae,Ae.clone())},k.prototype.sqr=function(Ae){return this.mul(Ae,Ae)},k.prototype.sqrt=function(Ae){if(Ae.isZero())return Ae.clone();var ke=this.m.andln(3);if(r(ke%2==1),3===ke){var Ce=this.m.add(new n(1)).iushrn(2);return this.pow(Ae,Ce)}for(var qe=this.m.subn(1),ze=0;!qe.isZero()&&0===qe.andln(1);)ze++,qe.iushrn(1);r(!qe.isZero());var Ve=new n(1).toRed(this),tt=Ve.redNeg(),rt=this.m.subn(1).iushrn(1),nt=this.m.bitLength();for(nt=new n(2*nt*nt).toRed(this);0!==this.pow(nt,rt).cmp(tt);)nt.redIAdd(tt);for(var it=this.pow(nt,qe),ot=this.pow(Ae,qe.addn(1).iushrn(1)),ct=this.pow(Ae,qe),ht=ze;0!==ct.cmp(Ve);){for(var ft=ct,mt=0;0!==ft.cmp(Ve);mt++)ft=ft.redSqr();r(mt=0;qe--){for(var nt=ke.words[qe],it=rt-1;it>=0;it--){var ot=nt>>it&1;ze!==Ce[0]&&(ze=this.sqr(ze)),0!==ot||0!==Ve?(Ve<<=1,Ve|=ot,(4===++tt||0===qe&&0===it)&&(ze=this.mul(ze,Ce[Ve]),tt=0,Ve=0)):tt=0}rt=26}return ze},k.prototype.convertTo=function(Ae){var ke=Ae.umod(this.m);return ke===Ae?ke.clone():ke},k.prototype.convertFrom=function(Ae){var ke=Ae.clone();return ke.red=null,ke},n.mont=function(Ae){return new A(Ae)},i(A,k),A.prototype.convertTo=function(Ae){return this.imod(Ae.ushln(this.shift))},A.prototype.convertFrom=function(Ae){var ke=this.imod(Ae.mul(this.rinv));return ke.red=null,ke},A.prototype.imul=function(Ae,ke){if(Ae.isZero()||ke.isZero())return Ae.words[0]=0,Ae.length=1,Ae;var Ce=Ae.imul(ke),qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ze=Ce.isub(qe).iushrn(this.shift),Ve=ze;return ze.cmp(this.m)>=0?Ve=ze.isub(this.m):ze.cmpn(0)<0&&(Ve=ze.iadd(this.m)),Ve._forceRed(this)},A.prototype.mul=function(Ae,ke){if(Ae.isZero()||ke.isZero())return new n(0)._forceRed(this);var Ce=Ae.mul(ke),qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ze=Ce.isub(qe).iushrn(this.shift),Ve=ze;return ze.cmp(this.m)>=0?Ve=ze.isub(this.m):ze.cmpn(0)<0&&(Ve=ze.iadd(this.m)),Ve._forceRed(this)},A.prototype.invm=function(Ae){return this.imod(Ae._invmp(this.m).mul(this.r2))._forceRed(this)}}(Ae,Ur)})),Kd=Object.freeze({__proto__:null,default:Od,__moduleExports:Od});class Cd{constructor(Ae){if(void 0===Ae)throw Error("Invalid BigInteger input");this.value=new Od(Ae)}clone(){const Ae=new Cd(null);return this.value.copy(Ae.value),Ae}iinc(){return this.value.iadd(new Od(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new Od(1)),this}dec(){return this.clone().idec()}iadd(Ae){return this.value.iadd(Ae.value),this}add(Ae){return this.clone().iadd(Ae)}isub(Ae){return this.value.isub(Ae.value),this}sub(Ae){return this.clone().isub(Ae)}imul(Ae){return this.value.imul(Ae.value),this}mul(Ae){return this.clone().imul(Ae)}imod(Ae){return this.value=this.value.umod(Ae.value),this}mod(Ae){return this.clone().imod(Ae)}modExp(Ae,ke){const Ce=ke.isEven()?Od.red(ke.value):Od.mont(ke.value),qe=this.clone();return qe.value=qe.value.toRed(Ce).redPow(Ae.value).fromRed(),qe}modInv(Ae){if(!this.gcd(Ae).isOne())throw Error("Inverse does not exist");return new Cd(this.value.invm(Ae.value))}gcd(Ae){return new Cd(this.value.gcd(Ae.value))}ileftShift(Ae){return this.value.ishln(Ae.value.toNumber()),this}leftShift(Ae){return this.clone().ileftShift(Ae)}irightShift(Ae){return this.value.ishrn(Ae.value.toNumber()),this}rightShift(Ae){return this.clone().irightShift(Ae)}equal(Ae){return this.value.eq(Ae.value)}lt(Ae){return this.value.lt(Ae.value)}lte(Ae){return this.value.lte(Ae.value)}gt(Ae){return this.value.gt(Ae.value)}gte(Ae){return this.value.gte(Ae.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new Od(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const Ae=this.clone();return Ae.value=Ae.value.abs(),Ae}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(Ae){return this.value.testn(Ae)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(Ae="be",ke){return this.value.toArrayLike(Uint8Array,Ae,ke)}}var Fd,jd=Object.freeze({__proto__:null,default:Cd}),qd=bt((function(Ae,ke){var Ce=ke;function i(Ae){return 1===Ae.length?"0"+Ae:Ae}function n(Ae){for(var ke="",Ce=0;Ce>8,tt=255&ze;Ve?Ce.push(Ve,tt):Ce.push(tt)}return Ce},Ce.zero2=i,Ce.toHex=n,Ce.encode=function(Ae,ke){return"hex"===ke?n(Ae):Ae}})),zd=bt((function(Ae,ke){var Ce=ke;Ce.assert=Dr,Ce.toArray=qd.toArray,Ce.zero2=qd.zero2,Ce.toHex=qd.toHex,Ce.encode=qd.encode,Ce.getNAF=function(Ae,ke){for(var Ce=[],qe=1<=0;){var Ve;if(ze.isOdd()){var tt=ze.andln(qe-1);Ve=tt>(qe>>1)-1?(qe>>1)-tt:tt,ze.isubn(Ve)}else Ve=0;Ce.push(Ve);for(var rt=0!==ze.cmpn(0)&&0===ze.andln(qe-1)?ke+1:1,nt=1;nt0||ke.cmpn(-ze)>0;){var Ve,tt,rt,nt=Ae.andln(3)+qe&3,it=ke.andln(3)+ze&3;if(3===nt&&(nt=-1),3===it&&(it=-1),0==(1&nt))Ve=0;else Ve=3!==(rt=Ae.andln(7)+qe&7)&&5!==rt||2!==it?nt:-nt;if(Ce[0].push(Ve),0==(1&it))tt=0;else tt=3!==(rt=ke.andln(7)+ze&7)&&5!==rt||2!==nt?it:-it;Ce[1].push(tt),2*qe===Ve+1&&(qe=1-qe),2*ze===tt+1&&(ze=1-ze),Ae.iushrn(1),ke.iushrn(1)}return Ce},Ce.cachedProperty=function(Ae,ke,Ce){var qe="_"+ke;Ae.prototype[ke]=function(){return void 0!==this[qe]?this[qe]:this[qe]=Ce.call(this)}},Ce.parseBytes=function(Ae){return"string"==typeof Ae?Ce.toArray(Ae,"hex"):Ae},Ce.intFromLE=function(Ae){return new Od(Ae,"hex","le")}})),Ud=function(Ae){return Fd||(Fd=new Bd(null)),Fd.generate(Ae)};function Bd(Ae){this.rand=Ae}var Gd=Bd;if(Bd.prototype.generate=function(Ae){return this._rand(Ae)},Bd.prototype._rand=function(Ae){if(this.rand.getBytes)return this.rand.getBytes(Ae);for(var ke=new Uint8Array(Ae),Ce=0;Ce0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var tp=Nd;function Ld(Ae,ke){this.curve=Ae,this.type=ke,this.precomputed=null}Nd.prototype.point=function(){throw Error("Not implemented")},Nd.prototype.validate=function(){throw Error("Not implemented")},Nd.prototype._fixedNafMul=function(Ae,ke){ep(Ae.precomputed);var Ce=Ae._getDoubles(),qe=Yd(ke,1),ze=(1<=tt;ke--)rt=(rt<<1)+qe[ke];Ve.push(rt)}for(var nt=this.jpoint(null,null,null),it=this.jpoint(null,null,null),ot=ze;ot>0;ot--){for(tt=0;tt=0;rt--){for(ke=0;rt>=0&&0===Ve[rt];rt--)ke++;if(rt>=0&&ke++,tt=tt.dblp(ke),rt<0)break;var nt=Ve[rt];ep(0!==nt),tt="affine"===Ae.type?nt>0?tt.mixedAdd(ze[nt-1>>1]):tt.mixedAdd(ze[-nt-1>>1].neg()):nt>0?tt.add(ze[nt-1>>1]):tt.add(ze[-nt-1>>1].neg())}return"affine"===Ae.type?tt.toP():tt},Nd.prototype._wnafMulAdd=function(Ae,ke,Ce,qe,ze){for(var Ve=this._wnafT1,tt=this._wnafT2,rt=this._wnafT3,nt=0,it=0;it=1;it-=2){var ct=it-1,ht=it;if(1===Ve[ct]&&1===Ve[ht]){var ft=[ke[ct],null,null,ke[ht]];0===ke[ct].y.cmp(ke[ht].y)?(ft[1]=ke[ct].add(ke[ht]),ft[2]=ke[ct].toJ().mixedAdd(ke[ht].neg())):0===ke[ct].y.cmp(ke[ht].y.redNeg())?(ft[1]=ke[ct].toJ().mixedAdd(ke[ht]),ft[2]=ke[ct].add(ke[ht].neg())):(ft[1]=ke[ct].toJ().mixedAdd(ke[ht]),ft[2]=ke[ct].toJ().mixedAdd(ke[ht].neg()));var mt=[-3,-1,-5,-7,0,7,5,1,3],yt=Qd(Ce[ct],Ce[ht]);nt=Math.max(yt[0].length,nt),rt[ct]=Array(nt),rt[ht]=Array(nt);for(var Et=0;Et=0;it--){for(var Tt=0;it>=0;){var It=!0;for(Et=0;Et=0&&Tt++,Rt=Rt.dblp(Tt),it<0)break;for(Et=0;Et0?Bt=tt[Et][Dt-1>>1]:Dt<0&&(Bt=tt[Et][-Dt-1>>1].neg()),Rt="affine"===Bt.type?Rt.mixedAdd(Bt):Rt.add(Bt))}}for(it=0;it=Math.ceil((Ae.bitLength()+1)/ke.step)},Ld.prototype._getDoubles=function(Ae,ke){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var Ce=[this],qe=this,ze=0;ze=0&&(Ve=ke,tt=Ce),qe.negative&&(qe=qe.neg(),ze=ze.neg()),Ve.negative&&(Ve=Ve.neg(),tt=tt.neg()),[{a:qe,b:ze},{a:Ve,b:tt}]},Hd.prototype._endoSplit=function(Ae){var ke=this.endo.basis,Ce=ke[0],qe=ke[1],ze=qe.b.mul(Ae).divRound(this.n),Ve=Ce.b.neg().mul(Ae).divRound(this.n),tt=ze.mul(Ce.a),rt=Ve.mul(qe.a),nt=ze.mul(Ce.b),it=Ve.mul(qe.b);return{k1:Ae.sub(tt).sub(rt),k2:nt.add(it).neg()}},Hd.prototype.pointFromX=function(Ae,ke){(Ae=new Od(Ae,16)).red||(Ae=Ae.toRed(this.red));var Ce=Ae.redSqr().redMul(Ae).redIAdd(Ae.redMul(this.a)).redIAdd(this.b),qe=Ce.redSqrt();if(0!==qe.redSqr().redSub(Ce).cmp(this.zero))throw Error("invalid point");var ze=qe.fromRed().isOdd();return(ke&&!ze||!ke&&ze)&&(qe=qe.redNeg()),this.point(Ae,qe)},Hd.prototype.validate=function(Ae){if(Ae.inf)return!0;var ke=Ae.x,Ce=Ae.y,qe=this.a.redMul(ke),ze=ke.redSqr().redMul(ke).redIAdd(qe).redIAdd(this.b);return 0===Ce.redSqr().redISub(ze).cmpn(0)},Hd.prototype._endoWnafMulAdd=function(Ae,ke,Ce){for(var qe=this._endoWnafT1,ze=this._endoWnafT2,Ve=0;Ve":""},Vd.prototype.isInfinity=function(){return this.inf},Vd.prototype.add=function(Ae){if(this.inf)return Ae;if(Ae.inf)return this;if(this.eq(Ae))return this.dbl();if(this.neg().eq(Ae))return this.curve.point(null,null);if(0===this.x.cmp(Ae.x))return this.curve.point(null,null);var ke=this.y.redSub(Ae.y);0!==ke.cmpn(0)&&(ke=ke.redMul(this.x.redSub(Ae.x).redInvm()));var Ce=ke.redSqr().redISub(this.x).redISub(Ae.x),qe=ke.redMul(this.x.redSub(Ce)).redISub(this.y);return this.curve.point(Ce,qe)},Vd.prototype.dbl=function(){if(this.inf)return this;var Ae=this.y.redAdd(this.y);if(0===Ae.cmpn(0))return this.curve.point(null,null);var ke=this.curve.a,Ce=this.x.redSqr(),qe=Ae.redInvm(),ze=Ce.redAdd(Ce).redIAdd(Ce).redIAdd(ke).redMul(qe),Ve=ze.redSqr().redISub(this.x.redAdd(this.x)),tt=ze.redMul(this.x.redSub(Ve)).redISub(this.y);return this.curve.point(Ve,tt)},Vd.prototype.getX=function(){return this.x.fromRed()},Vd.prototype.getY=function(){return this.y.fromRed()},Vd.prototype.mul=function(Ae){return Ae=new Od(Ae,16),this.isInfinity()?this:this._hasDoubles(Ae)?this.curve._fixedNafMul(this,Ae):this.curve.endo?this.curve._endoWnafMulAdd([this],[Ae]):this.curve._wnafMul(this,Ae)},Vd.prototype.mulAdd=function(Ae,ke,Ce){var qe=[this,ke],ze=[Ae,Ce];return this.curve.endo?this.curve._endoWnafMulAdd(qe,ze):this.curve._wnafMulAdd(1,qe,ze,2)},Vd.prototype.jmulAdd=function(Ae,ke,Ce){var qe=[this,ke],ze=[Ae,Ce];return this.curve.endo?this.curve._endoWnafMulAdd(qe,ze,!0):this.curve._wnafMulAdd(1,qe,ze,2,!0)},Vd.prototype.eq=function(Ae){return this===Ae||this.inf===Ae.inf&&(this.inf||0===this.x.cmp(Ae.x)&&0===this.y.cmp(Ae.y))},Vd.prototype.neg=function(Ae){if(this.inf)return this;var ke=this.curve.point(this.x,this.y.redNeg());if(Ae&&this.precomputed){var Ce=this.precomputed,i=function(Ae){return Ae.neg()};ke.precomputed={naf:Ce.naf&&{wnd:Ce.naf.wnd,points:Ce.naf.points.map(i)},doubles:Ce.doubles&&{step:Ce.doubles.step,points:Ce.doubles.points.map(i)}}}return ke},Vd.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Gr($d,tp.BasePoint),Hd.prototype.jpoint=function(Ae,ke,Ce){return new $d(this,Ae,ke,Ce)},$d.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var Ae=this.z.redInvm(),ke=Ae.redSqr(),Ce=this.x.redMul(ke),qe=this.y.redMul(ke).redMul(Ae);return this.curve.point(Ce,qe)},$d.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},$d.prototype.add=function(Ae){if(this.isInfinity())return Ae;if(Ae.isInfinity())return this;var ke=Ae.z.redSqr(),Ce=this.z.redSqr(),qe=this.x.redMul(ke),ze=Ae.x.redMul(Ce),Ve=this.y.redMul(ke.redMul(Ae.z)),tt=Ae.y.redMul(Ce.redMul(this.z)),rt=qe.redSub(ze),nt=Ve.redSub(tt);if(0===rt.cmpn(0))return 0!==nt.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var it=rt.redSqr(),ot=it.redMul(rt),ct=qe.redMul(it),ht=nt.redSqr().redIAdd(ot).redISub(ct).redISub(ct),ft=nt.redMul(ct.redISub(ht)).redISub(Ve.redMul(ot)),mt=this.z.redMul(Ae.z).redMul(rt);return this.curve.jpoint(ht,ft,mt)},$d.prototype.mixedAdd=function(Ae){if(this.isInfinity())return Ae.toJ();if(Ae.isInfinity())return this;var ke=this.z.redSqr(),Ce=this.x,qe=Ae.x.redMul(ke),ze=this.y,Ve=Ae.y.redMul(ke).redMul(this.z),tt=Ce.redSub(qe),rt=ze.redSub(Ve);if(0===tt.cmpn(0))return 0!==rt.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var nt=tt.redSqr(),it=nt.redMul(tt),ot=Ce.redMul(nt),ct=rt.redSqr().redIAdd(it).redISub(ot).redISub(ot),ht=rt.redMul(ot.redISub(ct)).redISub(ze.redMul(it)),ft=this.z.redMul(tt);return this.curve.jpoint(ct,ht,ft)},$d.prototype.dblp=function(Ae){if(0===Ae)return this;if(this.isInfinity())return this;if(!Ae)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var ke=this,Ce=0;Ce=0)return!1;if(Ce.redIAdd(ze),0===this.x.cmp(Ce))return!0}},$d.prototype.inspect=function(){return this.isInfinity()?"":""},$d.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Gr(Zd,tp);var ip=Zd;function Xd(Ae,ke,Ce){tp.BasePoint.call(this,Ae,"projective"),null===ke&&null===Ce?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Od(ke,16),this.z=new Od(Ce,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Zd.prototype.validate=function(Ae){var ke=Ae.normalize().x,Ce=ke.redSqr(),qe=Ce.redMul(ke).redAdd(Ce.redMul(this.a)).redAdd(ke);return 0===qe.redSqrt().redSqr().cmp(qe)},Gr(Xd,tp.BasePoint),Zd.prototype.decodePoint=function(Ae,ke){if(33===(Ae=zd.toArray(Ae,ke)).length&&64===Ae[0]&&(Ae=Ae.slice(1,33).reverse()),32!==Ae.length)throw Error("Unknown point compression format");return this.point(Ae,1)},Zd.prototype.point=function(Ae,ke){return new Xd(this,Ae,ke)},Zd.prototype.pointFromJSON=function(Ae){return Xd.fromJSON(this,Ae)},Xd.prototype.precompute=function(){},Xd.prototype._encode=function(Ae){var ke=this.curve.p.byteLength();return Ae?[64].concat(this.getX().toArray("le",ke)):this.getX().toArray("be",ke)},Xd.fromJSON=function(Ae,ke){return new Xd(Ae,ke[0],ke[1]||Ae.one)},Xd.prototype.inspect=function(){return this.isInfinity()?"":""},Xd.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Xd.prototype.dbl=function(){var Ae=this.x.redAdd(this.z).redSqr(),ke=this.x.redSub(this.z).redSqr(),Ce=Ae.redSub(ke),qe=Ae.redMul(ke),ze=Ce.redMul(ke.redAdd(this.curve.a24.redMul(Ce)));return this.curve.point(qe,ze)},Xd.prototype.add=function(){throw Error("Not supported on Montgomery curve")},Xd.prototype.diffAdd=function(Ae,ke){var Ce=this.x.redAdd(this.z),qe=this.x.redSub(this.z),ze=Ae.x.redAdd(Ae.z),Ve=Ae.x.redSub(Ae.z).redMul(Ce),tt=ze.redMul(qe),rt=ke.z.redMul(Ve.redAdd(tt).redSqr()),nt=ke.x.redMul(Ve.redISub(tt).redSqr());return this.curve.point(rt,nt)},Xd.prototype.mul=function(Ae){for(var ke=(Ae=new Od(Ae,16)).clone(),Ce=this,qe=this.curve.point(null,null),ze=[];0!==ke.cmpn(0);ke.iushrn(1))ze.push(ke.andln(1));for(var Ve=ze.length-1;Ve>=0;Ve--)0===ze[Ve]?(Ce=Ce.diffAdd(qe,this),qe=qe.dbl()):(qe=Ce.diffAdd(qe,this),Ce=Ce.dbl());return qe},Xd.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},Xd.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},Xd.prototype.eq=function(Ae){return 0===this.getX().cmp(Ae.getX())},Xd.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Xd.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var sp=zd.assert;function Jd(Ae){this.twisted=1!=(0|Ae.a),this.mOneA=this.twisted&&-1==(0|Ae.a),this.extended=this.mOneA,tp.call(this,"edwards",Ae),this.a=new Od(Ae.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Od(Ae.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Od(Ae.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),sp(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|Ae.c)}Gr(Jd,tp);var op=Jd;function tl(Ae,ke,Ce,qe,ze){tp.BasePoint.call(this,Ae,"projective"),null===ke&&null===Ce&&null===qe?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Od(ke,16),this.y=new Od(Ce,16),this.z=qe?new Od(qe,16):this.curve.one,this.t=ze&&new Od(ze,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()))))}Jd.prototype._mulA=function(Ae){return this.mOneA?Ae.redNeg():this.a.redMul(Ae)},Jd.prototype._mulC=function(Ae){return this.oneC?Ae:this.c.redMul(Ae)},Jd.prototype.jpoint=function(Ae,ke,Ce,qe){return this.point(Ae,ke,Ce,qe)},Jd.prototype.pointFromX=function(Ae,ke){(Ae=new Od(Ae,16)).red||(Ae=Ae.toRed(this.red));var Ce=Ae.redSqr(),qe=this.c2.redSub(this.a.redMul(Ce)),ze=this.one.redSub(this.c2.redMul(this.d).redMul(Ce)),Ve=qe.redMul(ze.redInvm()),tt=Ve.redSqrt();if(0!==tt.redSqr().redSub(Ve).cmp(this.zero))throw Error("invalid point");var rt=tt.fromRed().isOdd();return(ke&&!rt||!ke&&rt)&&(tt=tt.redNeg()),this.point(Ae,tt)},Jd.prototype.pointFromY=function(Ae,ke){(Ae=new Od(Ae,16)).red||(Ae=Ae.toRed(this.red));var Ce=Ae.redSqr(),qe=Ce.redSub(this.c2),ze=Ce.redMul(this.d).redMul(this.c2).redSub(this.a),Ve=qe.redMul(ze.redInvm());if(0===Ve.cmp(this.zero)){if(ke)throw Error("invalid point");return this.point(this.zero,Ae)}var tt=Ve.redSqrt();if(0!==tt.redSqr().redSub(Ve).cmp(this.zero))throw Error("invalid point");return tt.fromRed().isOdd()!==ke&&(tt=tt.redNeg()),this.point(tt,Ae)},Jd.prototype.validate=function(Ae){if(Ae.isInfinity())return!0;Ae.normalize();var ke=Ae.x.redSqr(),Ce=Ae.y.redSqr(),qe=ke.redMul(this.a).redAdd(Ce),ze=this.c2.redMul(this.one.redAdd(this.d.redMul(ke).redMul(Ce)));return 0===qe.cmp(ze)},Gr(tl,tp.BasePoint),Jd.prototype.pointFromJSON=function(Ae){return tl.fromJSON(this,Ae)},Jd.prototype.point=function(Ae,ke,Ce,qe){return new tl(this,Ae,ke,Ce,qe)},tl.fromJSON=function(Ae,ke){return new tl(Ae,ke[0],ke[1],ke[2])},tl.prototype.inspect=function(){return this.isInfinity()?"":""},tl.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},tl.prototype._extDbl=function(){var Ae=this.x.redSqr(),ke=this.y.redSqr(),Ce=this.z.redSqr();Ce=Ce.redIAdd(Ce);var qe=this.curve._mulA(Ae),ze=this.x.redAdd(this.y).redSqr().redISub(Ae).redISub(ke),Ve=qe.redAdd(ke),tt=Ve.redSub(Ce),rt=qe.redSub(ke),nt=ze.redMul(tt),it=Ve.redMul(rt),ot=ze.redMul(rt),ct=tt.redMul(Ve);return this.curve.point(nt,it,ct,ot)},tl.prototype._projDbl=function(){var Ae,ke,Ce,qe=this.x.redAdd(this.y).redSqr(),ze=this.x.redSqr(),Ve=this.y.redSqr();if(this.curve.twisted){var tt=(it=this.curve._mulA(ze)).redAdd(Ve);if(this.zOne)Ae=qe.redSub(ze).redSub(Ve).redMul(tt.redSub(this.curve.two)),ke=tt.redMul(it.redSub(Ve)),Ce=tt.redSqr().redSub(tt).redSub(tt);else{var rt=this.z.redSqr(),nt=tt.redSub(rt).redISub(rt);Ae=qe.redSub(ze).redISub(Ve).redMul(nt),ke=tt.redMul(it.redSub(Ve)),Ce=tt.redMul(nt)}}else{var it=ze.redAdd(Ve);rt=this.curve._mulC(this.z).redSqr(),nt=it.redSub(rt).redSub(rt);Ae=this.curve._mulC(qe.redISub(it)).redMul(nt),ke=this.curve._mulC(it).redMul(ze.redISub(Ve)),Ce=it.redMul(nt)}return this.curve.point(Ae,ke,Ce)},tl.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},tl.prototype._extAdd=function(Ae){var ke=this.y.redSub(this.x).redMul(Ae.y.redSub(Ae.x)),Ce=this.y.redAdd(this.x).redMul(Ae.y.redAdd(Ae.x)),qe=this.t.redMul(this.curve.dd).redMul(Ae.t),ze=this.z.redMul(Ae.z.redAdd(Ae.z)),Ve=Ce.redSub(ke),tt=ze.redSub(qe),rt=ze.redAdd(qe),nt=Ce.redAdd(ke),it=Ve.redMul(tt),ot=rt.redMul(nt),ct=Ve.redMul(nt),ht=tt.redMul(rt);return this.curve.point(it,ot,ht,ct)},tl.prototype._projAdd=function(Ae){var ke,Ce,qe=this.z.redMul(Ae.z),ze=qe.redSqr(),Ve=this.x.redMul(Ae.x),tt=this.y.redMul(Ae.y),rt=this.curve.d.redMul(Ve).redMul(tt),nt=ze.redSub(rt),it=ze.redAdd(rt),ot=this.x.redAdd(this.y).redMul(Ae.x.redAdd(Ae.y)).redISub(Ve).redISub(tt),ct=qe.redMul(nt).redMul(ot);return this.curve.twisted?(ke=qe.redMul(it).redMul(tt.redSub(this.curve._mulA(Ve))),Ce=nt.redMul(it)):(ke=qe.redMul(it).redMul(tt.redSub(Ve)),Ce=this.curve._mulC(nt).redMul(it)),this.curve.point(ct,ke,Ce)},tl.prototype.add=function(Ae){return this.isInfinity()?Ae:Ae.isInfinity()?this:this.curve.extended?this._extAdd(Ae):this._projAdd(Ae)},tl.prototype.mul=function(Ae){return this._hasDoubles(Ae)?this.curve._fixedNafMul(this,Ae):this.curve._wnafMul(this,Ae)},tl.prototype.mulAdd=function(Ae,ke,Ce){return this.curve._wnafMulAdd(1,[this,ke],[Ae,Ce],2,!1)},tl.prototype.jmulAdd=function(Ae,ke,Ce){return this.curve._wnafMulAdd(1,[this,ke],[Ae,Ce],2,!0)},tl.prototype.normalize=function(){if(this.zOne)return this;var Ae=this.z.redInvm();return this.x=this.x.redMul(Ae),this.y=this.y.redMul(Ae),this.t&&(this.t=this.t.redMul(Ae)),this.z=this.curve.one,this.zOne=!0,this},tl.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},tl.prototype.getX=function(){return this.normalize(),this.x.fromRed()},tl.prototype.getY=function(){return this.normalize(),this.y.fromRed()},tl.prototype.eq=function(Ae){return this===Ae||0===this.getX().cmp(Ae.getX())&&0===this.getY().cmp(Ae.getY())},tl.prototype.eqXToP=function(Ae){var ke=Ae.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(ke))return!0;for(var Ce=Ae.clone(),qe=this.curve.redN.redMul(this.z);;){if(Ce.iadd(this.curve.n),Ce.cmp(this.curve.p)>=0)return!1;if(ke.redIAdd(qe),0===this.x.cmp(ke))return!0}},tl.prototype.toP=tl.prototype.normalize,tl.prototype.mixedAdd=tl.prototype.add;var ap=bt((function(Ae,ke){var Ce=ke;Ce.base=tp,Ce.short=np,Ce.mont=ip,Ce.edwards=op})),up=Vr.rotl32,hp=Vr.sum32,lp=Vr.sum32_5,fp=on.ft_1,dp=Qr.BlockHash,pp=[1518500249,1859775393,2400959708,3395469782];function ul(){if(!(this instanceof ul))return new ul;dp.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}Vr.inherits(ul,dp);var mp=ul;ul.blockSize=512,ul.outSize=160,ul.hmacStrength=80,ul.padLength=64,ul.prototype._update=function(Ae,ke){for(var Ce=this.W,qe=0;qe<16;qe++)Ce[qe]=Ae[ke+qe];for(;qethis.blockSize&&(Ae=(new this.Hash).update(Ae).digest()),Dr(Ae.length<=this.blockSize);for(var ke=Ae.length;ke=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(ke,Ce,qe)}var _p=ml;ml.prototype._init=function(Ae,ke,Ce){var qe=Ae.concat(ke).concat(Ce);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var ze=0;ze=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Ae.concat(Ce||[])),this._reseed=1},ml.prototype.generate=function(Ae,ke,Ce,qe){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof ke&&(qe=Ce,Ce=ke,ke=null),Ce&&(Ce=qd.toArray(Ce,qe||"hex"),this._update(Ce));for(var ze=[];ze.length"};var kp=zd.assert;function Al(Ae,ke){if(Ae instanceof Al)return Ae;this._importDER(Ae,ke)||(kp(Ae.r&&Ae.s,"Signature without r or s"),this.r=new Od(Ae.r,16),this.s=new Od(Ae.s,16),void 0===Ae.recoveryParam?this.recoveryParam=null:this.recoveryParam=Ae.recoveryParam)}var Sp=Al;function El(){this.place=0}function Pl(Ae,ke){var Ce=Ae[ke.place++];if(!(128&Ce))return Ce;for(var qe=15&Ce,ze=0,Ve=0,tt=ke.place;Ve>>3);for(Ae.push(128|Ce);--Ce;)Ae.push(ke>>>(Ce<<3)&255);Ae.push(ke)}}Al.prototype._importDER=function(Ae,ke){Ae=zd.toArray(Ae,ke);var Ce=new El;if(48!==Ae[Ce.place++])return!1;if(Pl(Ae,Ce)+Ce.place!==Ae.length)return!1;if(2!==Ae[Ce.place++])return!1;var qe=Pl(Ae,Ce),ze=Ae.slice(Ce.place,qe+Ce.place);if(Ce.place+=qe,2!==Ae[Ce.place++])return!1;var Ve=Pl(Ae,Ce);if(Ae.length!==Ve+Ce.place)return!1;var tt=Ae.slice(Ce.place,Ve+Ce.place);return 0===ze[0]&&128&ze[1]&&(ze=ze.slice(1)),0===tt[0]&&128&tt[1]&&(tt=tt.slice(1)),this.r=new Od(ze),this.s=new Od(tt),this.recoveryParam=null,!0},Al.prototype.toDER=function(Ae){var ke=this.r.toArray(),Ce=this.s.toArray();for(128&ke[0]&&(ke=[0].concat(ke)),128&Ce[0]&&(Ce=[0].concat(Ce)),ke=xl(ke),Ce=xl(Ce);!(Ce[0]||128&Ce[1]);)Ce=Ce.slice(1);var qe=[2];Ml(qe,ke.length),(qe=qe.concat(ke)).push(2),Ml(qe,Ce.length);var ze=qe.concat(Ce),Ve=[48];return Ml(Ve,ze.length),Ve=Ve.concat(ze),zd.encode(Ve,Ae)};var xp=zd.assert;function Kl(Ae){if(!(this instanceof Kl))return new Kl(Ae);"string"==typeof Ae&&(xp(wp.hasOwnProperty(Ae),"Unknown curve "+Ae),Ae=wp[Ae]),Ae instanceof wp.PresetCurve&&(Ae={curve:Ae}),this.curve=Ae.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=Ae.curve.g,this.g.precompute(Ae.curve.n.bitLength()+1),this.hash=Ae.hash||Ae.curve.hash}var Rp=Kl;Kl.prototype.keyPair=function(Ae){return new Ap(this,Ae)},Kl.prototype.keyFromPrivate=function(Ae,ke){return Ap.fromPrivate(this,Ae,ke)},Kl.prototype.keyFromPublic=function(Ae,ke){return Ap.fromPublic(this,Ae,ke)},Kl.prototype.genKeyPair=function(Ae){Ae||(Ae={});var ke=new _p({hash:this.hash,pers:Ae.pers,persEnc:Ae.persEnc||"utf8",entropy:Ae.entropy||Ud(this.hash.hmacStrength),entropyEnc:Ae.entropy&&Ae.entropyEnc||"utf8",nonce:this.n.toArray()});if("mont"===this.curve.type){var Ce=new Od(ke.generate(32));return this.keyFromPrivate(Ce)}for(var qe=this.n.byteLength(),ze=this.n.sub(new Od(2));;){if(!((Ce=new Od(ke.generate(qe))).cmp(ze)>0))return Ce.iaddn(1),this.keyFromPrivate(Ce)}},Kl.prototype._truncateToN=function(Ae,ke,Ce){var qe=(Ce=Ce||8*Ae.byteLength())-this.n.bitLength();return qe>0&&(Ae=Ae.ushrn(qe)),!ke&&Ae.cmp(this.n)>=0?Ae.sub(this.n):Ae},Kl.prototype.truncateMsg=function(Ae){var ke;return Ae instanceof Uint8Array?(ke=8*Ae.byteLength,Ae=this._truncateToN(new Od(Ae,16),!1,ke)):"string"==typeof Ae?(ke=4*Ae.length,Ae=this._truncateToN(new Od(Ae,16),!1,ke)):Ae=this._truncateToN(new Od(Ae,16)),Ae},Kl.prototype.sign=function(Ae,ke,Ce,qe){"object"==typeof Ce&&(qe=Ce,Ce=null),qe||(qe={}),ke=this.keyFromPrivate(ke,Ce),Ae=this.truncateMsg(Ae);for(var ze=this.n.byteLength(),Ve=ke.getPrivate().toArray("be",ze),tt=Ae.toArray("be",ze),rt=new _p({hash:this.hash,entropy:Ve,nonce:tt,pers:qe.pers,persEnc:qe.persEnc||"utf8"}),nt=this.n.sub(new Od(1)),it=0;;it++){var ot=qe.k?qe.k(it):new Od(rt.generate(this.n.byteLength()));if(!((ot=this._truncateToN(ot,!0)).cmpn(1)<=0||ot.cmp(nt)>=0)){var ct=this.g.mul(ot);if(!ct.isInfinity()){var ht=ct.getX(),ft=ht.umod(this.n);if(0!==ft.cmpn(0)){var mt=ot.invm(this.n).mul(ft.mul(ke.getPrivate()).iadd(Ae));if(0!==(mt=mt.umod(this.n)).cmpn(0)){var yt=(ct.getY().isOdd()?1:0)|(0!==ht.cmp(ft)?2:0);return qe.canonical&&mt.cmp(this.nh)>0&&(mt=this.n.sub(mt),yt^=1),new Sp({r:ft,s:mt,recoveryParam:yt})}}}}}},Kl.prototype.verify=function(Ae,ke,Ce,qe){return Ce=this.keyFromPublic(Ce,qe),ke=new Sp(ke,"hex"),this._verify(this.truncateMsg(Ae),ke,Ce)||this._verify(this._truncateToN(new Od(Ae,16)),ke,Ce)},Kl.prototype._verify=function(Ae,ke,Ce){var qe=ke.r,ze=ke.s;if(qe.cmpn(1)<0||qe.cmp(this.n)>=0)return!1;if(ze.cmpn(1)<0||ze.cmp(this.n)>=0)return!1;var Ve,tt=ze.invm(this.n),rt=tt.mul(Ae).umod(this.n),nt=tt.mul(qe).umod(this.n);return this.curve._maxwellTrick?!(Ve=this.g.jmulAdd(rt,Ce.getPublic(),nt)).isInfinity()&&Ve.eqXToP(qe):!(Ve=this.g.mulAdd(rt,Ce.getPublic(),nt)).isInfinity()&&0===Ve.getX().umod(this.n).cmp(qe)},Kl.prototype.recoverPubKey=function(Ae,ke,Ce,qe){xp((3&Ce)===Ce,"The recovery param is more than two bits"),ke=new Sp(ke,qe);var ze=this.n,Ve=new Od(Ae),tt=ke.r,rt=ke.s,nt=1&Ce,it=Ce>>1;if(tt.cmp(this.curve.p.umod(this.curve.n))>=0&&it)throw Error("Unable to find sencond key candinate");tt=it?this.curve.pointFromX(tt.add(this.curve.n),nt):this.curve.pointFromX(tt,nt);var ot=ke.r.invm(ze),ct=ze.sub(Ve).mul(ot).umod(ze),ht=rt.mul(ot).umod(ze);return this.g.mulAdd(ct,tt,ht)},Kl.prototype.getKeyRecoveryParam=function(Ae,ke,Ce,qe){if(null!==(ke=new Sp(ke,qe)).recoveryParam)return ke.recoveryParam;for(var ze=0;ze<4;ze++){var Ve;try{Ve=this.recoverPubKey(Ae,ke,ze)}catch(Ae){continue}if(Ve.eq(Ce))return ze}throw Error("Unable to find valid recovery factor")};var Pp=zd.assert,Mp=zd.parseBytes,Cp=zd.cachedProperty;function Bl(Ae,ke){if(this.eddsa=Ae,ke.hasOwnProperty("secret")&&(this._secret=Mp(ke.secret)),Ae.isPoint(ke.pub))this._pub=ke.pub;else if(this._pubBytes=Mp(ke.pub),this._pubBytes&&33===this._pubBytes.length&&64===this._pubBytes[0]&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&32!==this._pubBytes.length)throw Error("Unknown point compression format")}Bl.fromPublic=function(Ae,ke){return ke instanceof Bl?ke:new Bl(Ae,{pub:ke})},Bl.fromSecret=function(Ae,ke){return ke instanceof Bl?ke:new Bl(Ae,{secret:ke})},Bl.prototype.secret=function(){return this._secret},Cp(Bl,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Cp(Bl,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Cp(Bl,"privBytes",(function(){var Ae=this.eddsa,ke=this.hash(),Ce=Ae.encodingLength-1,qe=ke.slice(0,Ae.encodingLength);return qe[0]&=248,qe[Ce]&=127,qe[Ce]|=64,qe})),Cp(Bl,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Cp(Bl,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Cp(Bl,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Bl.prototype.sign=function(Ae){return Pp(this._secret,"KeyPair can only verify"),this.eddsa.sign(Ae,this)},Bl.prototype.verify=function(Ae,ke){return this.eddsa.verify(Ae,ke,this)},Bl.prototype.getSecret=function(Ae){return Pp(this._secret,"KeyPair is public only"),zd.encode(this.secret(),Ae)},Bl.prototype.getPublic=function(Ae,ke){return zd.encode((ke?[64]:[]).concat(this.pubBytes()),Ae)};var Tp=Bl,Ip=zd.assert,Bp=zd.cachedProperty,Dp=zd.parseBytes;function Fl(Ae,ke){this.eddsa=Ae,"object"!=typeof ke&&(ke=Dp(ke)),Array.isArray(ke)&&(ke={R:ke.slice(0,Ae.encodingLength),S:ke.slice(Ae.encodingLength)}),Ip(ke.R&&ke.S,"Signature without R or S"),Ae.isPoint(ke.R)&&(this._R=ke.R),ke.S instanceof Od&&(this._S=ke.S),this._Rencoded=Array.isArray(ke.R)?ke.R:ke.Rencoded,this._Sencoded=Array.isArray(ke.S)?ke.S:ke.Sencoded}Bp(Fl,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Bp(Fl,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Bp(Fl,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Bp(Fl,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Fl.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Fl.prototype.toHex=function(){return zd.encode(this.toBytes(),"hex").toUpperCase()};var Op=Fl,Np=zd.assert,Up=zd.parseBytes;function Wl(Ae){if(Np("ed25519"===Ae,"only tested with ed25519 so far"),!(this instanceof Wl))return new Wl(Ae);Ae=wp[Ae].curve;this.curve=Ae,this.g=Ae.g,this.g.precompute(Ae.n.bitLength()+1),this.pointClass=Ae.point().constructor,this.encodingLength=Math.ceil(Ae.n.bitLength()/8),this.hash=bp.sha512}var Lp=Wl;Wl.prototype.sign=function(Ae,ke){Ae=Up(Ae);var Ce=this.keyFromSecret(ke),qe=this.hashInt(Ce.messagePrefix(),Ae),ze=this.g.mul(qe),Ve=this.encodePoint(ze),tt=this.hashInt(Ve,Ce.pubBytes(),Ae).mul(Ce.priv()),rt=qe.add(tt).umod(this.curve.n);return this.makeSignature({R:ze,S:rt,Rencoded:Ve})},Wl.prototype.verify=function(Ae,ke,Ce){Ae=Up(Ae),ke=this.makeSignature(ke);var qe=this.keyFromPublic(Ce),ze=this.hashInt(ke.Rencoded(),qe.pubBytes(),Ae),Ve=this.g.mul(ke.S());return ke.R().add(qe.pub().mul(ze)).eq(Ve)},Wl.prototype.hashInt=function(){for(var Ae=this.hash(),ke=0;ke0)throw Error("Unknown option: "+Ce.join(", "));return new pc(Ae)},ke.createMessage=async function({text:Ae,binary:ke,filename:Ce,date:qe=new Date,format:ze=(void 0!==Ae?"utf8":"binary"),...Ve}){let tt=void 0!==Ae?Ae:ke;if(void 0===tt)throw Error("createMessage: must pass options object containing `text` or `binary`");if(Ae&&!Xt.isString(Ae)&&!Xt.isStream(Ae))throw Error("createMessage: options.text must be a string or stream");if(ke&&!Xt.isUint8Array(ke)&&!Xt.isStream(ke))throw Error("createMessage: options.binary must be a Uint8Array or stream");const rt=Object.keys(Ve);if(rt.length>0)throw Error("Unknown option: "+rt.join(", "));const nt=Xt.isStream(tt);nt&&(await F(),tt=j(tt));const it=new Hs(qe);void 0!==Ae?it.setText(tt,er.write(er.literal,ze)):it.setBytes(tt,er.write(er.literal,ze)),void 0!==Ce&&it.setFilename(Ce);const ot=new so;ot.push(it);const ct=new hc(ot);return ct.fromStream=nt,ct},ke.decrypt=async function({message:Ae,decryptionKeys:ke,passwords:Ce,sessionKeys:qe,verificationKeys:ze,expectSigned:Ve=!1,format:tt="utf8",signature:rt=null,date:nt=new Date,config:it,...ot}){if(wc(it={...tr,...it}),yc(Ae),ze=vc(ze),ke=vc(ke),Ce=vc(Ce),qe=vc(qe),ot.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decrypt, pass `decryptionKeys` instead");if(ot.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.decrypt, pass `verificationKeys` instead");const ct=Object.keys(ot);if(ct.length>0)throw Error("Unknown option: "+ct.join(", "));try{const ot=await Ae.decrypt(ke,Ce,qe,nt,it);ze||(ze=[]);const ct={};if(ct.signatures=rt?await ot.verifyDetached(rt,ze,nt,it):await ot.verify(ze,nt,it),ct.data="binary"===tt?ot.getLiteralData():ot.getText(),ct.filename=ot.getFilename(),kc(ct,Ae),Ve){if(0===ze.length)throw Error("Verification keys are required to verify message signatures");if(0===ct.signatures.length)throw Error("Message is not signed");ct.data=W([ct.data,ae((async()=>{await Xt.anyPromise(ct.signatures.map((Ae=>Ae.verified)))}))])}return ct.data=await _c(ct.data,Ae.fromStream,tt),ct}catch(Ae){throw Xt.wrapError("Error decrypting message",Ae)}},ke.decryptKey=async function({privateKey:Ae,passphrase:ke,config:Ce,...qe}){wc(Ce={...tr,...Ce});const ze=Object.keys(qe);if(ze.length>0)throw Error("Unknown option: "+ze.join(", "));if(!Ae.isPrivate())throw Error("Cannot decrypt a public key");const Ve=Ae.clone(!0),tt=Xt.isArray(ke)?ke:[ke];try{return await Promise.all(Ve.getKeys().map((Ae=>Xt.anyPromise(tt.map((ke=>Ae.keyPacket.decrypt(ke))))))),await Ve.validate(Ce),Ve}catch(Ae){throw Ve.clearPrivateParams(),Xt.wrapError("Error decrypting private key",Ae)}},ke.decryptSessionKeys=async function({message:Ae,decryptionKeys:ke,passwords:Ce,date:qe=new Date,config:ze,...Ve}){if(wc(ze={...tr,...ze}),yc(Ae),ke=vc(ke),Ce=vc(Ce),Ve.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decryptSessionKeys, pass `decryptionKeys` instead");const tt=Object.keys(Ve);if(tt.length>0)throw Error("Unknown option: "+tt.join(", "));try{return await Ae.decryptSessionKeys(ke,Ce,qe,ze)}catch(Ae){throw Xt.wrapError("Error decrypting session keys",Ae)}},ke.encrypt=async function({message:Ae,encryptionKeys:ke,signingKeys:Ce,passwords:qe,sessionKey:ze,format:Ve="armored",signature:tt=null,wildcard:rt=!1,signingKeyIDs:nt=[],encryptionKeyIDs:it=[],date:ot=new Date,signingUserIDs:ct=[],encryptionUserIDs:ht=[],config:ft,...mt}){if(wc(ft={...tr,...ft}),yc(Ae),mc(Ve),ke=vc(ke),Ce=vc(Ce),qe=vc(qe),nt=vc(nt),it=vc(it),ct=vc(ct),ht=vc(ht),mt.detached)throw Error("The `detached` option has been removed from openpgp.encrypt, separately call openpgp.sign instead. Don't forget to remove the `privateKeys` option as well.");if(mt.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encrypt, pass `encryptionKeys` instead");if(mt.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.encrypt, pass `signingKeys` instead");if(void 0!==mt.armor)throw Error("The `armor` option has been removed from openpgp.encrypt, pass `format` instead.");const yt=Object.keys(mt);if(yt.length>0)throw Error("Unknown option: "+yt.join(", "));Ce||(Ce=[]);const Et=Ae.fromStream;try{if((Ce.length||tt)&&(Ae=await Ae.sign(Ce,tt,nt,ot,ct,ft)),Ae=Ae.compress(await jo("compression",ke,ot,ht,ft),ft),Ae=await Ae.encrypt(ke,qe,ze,rt,it,ot,ht,ft),"object"===Ve)return Ae;const mt="armored"===Ve;return _c(mt?Ae.armor(ft):Ae.write(),Et,mt?"utf8":"binary")}catch(Ae){throw Xt.wrapError("Error encrypting message",Ae)}},ke.encryptKey=async function({privateKey:Ae,passphrase:ke,config:Ce,...qe}){wc(Ce={...tr,...Ce});const ze=Object.keys(qe);if(ze.length>0)throw Error("Unknown option: "+ze.join(", "));if(!Ae.isPrivate())throw Error("Cannot encrypt a public key");const Ve=Ae.clone(!0),tt=Ve.getKeys(),rt=Xt.isArray(ke)?ke:Array(tt.length).fill(ke);if(rt.length!==tt.length)throw Error("Invalid number of passphrases given for key encryption");try{return await Promise.all(tt.map((async(Ae,ke)=>{const{keyPacket:qe}=Ae;await qe.encrypt(rt[ke],Ce),qe.clearPrivateParams()}))),Ve}catch(Ae){throw Ve.clearPrivateParams(),Xt.wrapError("Error encrypting private key",Ae)}},ke.encryptSessionKey=async function({data:Ae,algorithm:ke,aeadAlgorithm:Ce,encryptionKeys:qe,passwords:ze,format:Ve="armored",wildcard:tt=!1,encryptionKeyIDs:rt=[],date:nt=new Date,encryptionUserIDs:it=[],config:ot,...ct}){if(wc(ot={...tr,...ot}),function(Ae,ke){if(!Xt.isUint8Array(Ae))throw Error("Parameter ["+(ke||"data")+"] must be of type Uint8Array")}(Ae),function(Ae,ke){if(!Xt.isString(Ae))throw Error("Parameter ["+(ke||"data")+"] must be of type String")}(ke,"algorithm"),mc(Ve),qe=vc(qe),ze=vc(ze),rt=vc(rt),it=vc(it),ct.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encryptSessionKey, pass `encryptionKeys` instead");const ht=Object.keys(ct);if(ht.length>0)throw Error("Unknown option: "+ht.join(", "));try{return Ac(await hc.encryptSessionKey(Ae,ke,Ce,qe,ze,tt,rt,nt,it,ot),Ve,ot)}catch(Ae){throw Xt.wrapError("Error encrypting session key",Ae)}},ke.enums=er,ke.generateKey=async function({userIDs:Ae=[],passphrase:ke="",type:Ce="ecc",rsaBits:qe=4096,curve:ze="curve25519",keyExpirationTime:Ve=0,date:tt=new Date,subkeys:rt=[{}],format:nt="armored",config:it,...ot}){wc(it={...tr,...it}),Ae=vc(Ae);const ct=Object.keys(ot);if(ct.length>0)throw Error("Unknown option: "+ct.join(", "));if(0===Ae.length)throw Error("UserIDs are required for key generation");if("rsa"===Ce&&qeVo(Ae.subkeys[Ce],Ae)));let Ce=[zo(Ae,ke)];Ce=Ce.concat(Ae.subkeys.map((Ae=>To(Ae,ke))));const qe=await Promise.all(Ce),ze=await sc(qe[0],qe.slice(1),Ae,ke),Ve=await ze.getRevocationCertificate(Ae.date,ke);return ze.revocationSignatures=[],{key:ze,revocationCertificate:Ve}}(ht,it);return Ae.getKeys().forEach((({keyPacket:Ae})=>Xo(Ae,it))),{privateKey:Ac(Ae,nt,it),publicKey:Ac(Ae.toPublic(),nt,it),revocationCertificate:ke}}catch(Ae){throw Xt.wrapError("Error generating keypair",Ae)}},ke.generateSessionKey=async function({encryptionKeys:Ae,date:ke=new Date,encryptionUserIDs:Ce=[],config:qe,...ze}){if(wc(qe={...tr,...qe}),Ae=vc(Ae),Ce=vc(Ce),ze.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.generateSessionKey, pass `encryptionKeys` instead");const Ve=Object.keys(ze);if(Ve.length>0)throw Error("Unknown option: "+Ve.join(", "));try{return await hc.generateSessionKey(Ae,ke,Ce,qe)}catch(Ae){throw Xt.wrapError("Error generating session key",Ae)}},ke.readCleartextMessage=async function({cleartextMessage:Ae,config:ke,...Ce}){if(ke={...tr,...ke},!Ae)throw Error("readCleartextMessage: must pass options object containing `cleartextMessage`");if(!Xt.isString(Ae))throw Error("readCleartextMessage: options.cleartextMessage must be a string");const qe=Object.keys(Ce);if(qe.length>0)throw Error("Unknown option: "+qe.join(", "));const ze=await Pe(Ae);if(ze.type!==er.armor.signed)throw Error("No cleartext signed message.");const Ve=await so.fromBinary(ze.data,Ul,ke);!function(Ae,ke){const r=function(Ae){const r=Ae=>ke=>Ae.hashAlgorithm===ke;for(let Ce=0;Ce0)throw Error("Unknown option: "+ze.join(", "));let Ve;if(Ae){const{type:ke,data:qe}=await Pe(Ae,Ce);if(ke!==er.armor.publicKey&&ke!==er.armor.privateKey)throw Error("Armored text not of type key");Ve=qe}else Ve=ke;return rc(await so.fromBinary(Ve,Il,Ce))},ke.readKeys=async function({armoredKeys:Ae,binaryKeys:ke,config:Ce,...qe}){Ce={...tr,...Ce};let ze=Ae||ke;if(!ze)throw Error("readKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(Ae&&!Xt.isString(Ae))throw Error("readKeys: options.armoredKeys must be a string");if(ke&&!Xt.isUint8Array(ke))throw Error("readKeys: options.binaryKeys must be a Uint8Array");const Ve=Object.keys(qe);if(Ve.length>0)throw Error("Unknown option: "+Ve.join(", "));if(Ae){const{type:ke,data:qe}=await Pe(Ae,Ce);if(ke!==er.armor.publicKey&&ke!==er.armor.privateKey)throw Error("Armored text not of type key");ze=qe}const tt=[],rt=await so.fromBinary(ze,Il,Ce),nt=rt.indexOfTag(er.packet.publicKey,er.packet.secretKey);if(0===nt.length)throw Error("No key packet found");for(let Ae=0;Ae0)throw Error("Unknown option: "+Ve.join(", "));const tt=Xt.isStream(ze);if(tt&&(await F(),ze=j(ze)),Ae){const{type:Ae,data:ke}=await Pe(ze,Ce);if(Ae!==er.armor.message)throw Error("Armored text not of type message");ze=ke}const rt=await so.fromBinary(ze,Dl,Ce),nt=new hc(rt);return nt.fromStream=tt,nt},ke.readPrivateKey=async function({armoredKey:Ae,binaryKey:ke,config:Ce,...qe}){if(Ce={...tr,...Ce},!Ae&&!ke)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(Ae&&!Xt.isString(Ae))throw Error("readPrivateKey: options.armoredKey must be a string");if(ke&&!Xt.isUint8Array(ke))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const ze=Object.keys(qe);if(ze.length>0)throw Error("Unknown option: "+ze.join(", "));let Ve;if(Ae){const{type:ke,data:qe}=await Pe(Ae,Ce);if(ke!==er.armor.privateKey)throw Error("Armored text not of type private key");Ve=qe}else Ve=ke;const tt=await so.fromBinary(Ve,Il,Ce);return new nc(tt)},ke.readPrivateKeys=async function({armoredKeys:Ae,binaryKeys:ke,config:Ce}){Ce={...tr,...Ce};let qe=Ae||ke;if(!qe)throw Error("readPrivateKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(Ae&&!Xt.isString(Ae))throw Error("readPrivateKeys: options.armoredKeys must be a string");if(ke&&!Xt.isUint8Array(ke))throw Error("readPrivateKeys: options.binaryKeys must be a Uint8Array");if(Ae){const{type:ke,data:ze}=await Pe(Ae,Ce);if(ke!==er.armor.privateKey)throw Error("Armored text not of type private key");qe=ze}const ze=[],Ve=await so.fromBinary(qe,Il,Ce),tt=Ve.indexOfTag(er.packet.secretKey);if(0===tt.length)throw Error("No secret key packet found");for(let Ae=0;Ae0)throw Error("Unknown option: "+Ve.join(", "));if(Ae){const{type:Ae,data:ke}=await Pe(ze,Ce);if(Ae!==er.armor.signature)throw Error("Armored text not of type signature");ze=ke}const tt=await so.fromBinary(ze,Cl,Ce);return new Bo(tt)},ke.reformatKey=async function({privateKey:Ae,userIDs:ke=[],passphrase:Ce="",keyExpirationTime:qe=0,date:ze,format:Ve="armored",config:tt,...rt}){wc(tt={...tr,...tt}),ke=vc(ke);const nt=Object.keys(rt);if(nt.length>0)throw Error("Unknown option: "+nt.join(", "));if(0===ke.length)throw Error("UserIDs are required for key reformat");const it={privateKey:Ae,userIDs:ke,passphrase:Ce,keyExpirationTime:qe,date:ze};try{const{key:Ae,revocationCertificate:ke}=await async function(Ae,ke){Ae=o(Ae);const{privateKey:Ce}=Ae;if(!Ce.isPrivate())throw Error("Cannot reformat a public key");if(Ce.keyPacket.isDummy())throw Error("Cannot reformat a gnu-dummy primary key");if(!Ce.getKeys().every((({keyPacket:Ae})=>Ae.isDecrypted())))throw Error("Key is not decrypted");const qe=Ce.keyPacket;Ae.subkeys||(Ae.subkeys=await Promise.all(Ce.subkeys.map((async Ae=>{const Ce=Ae.keyPacket,ze={key:qe,bind:Ce},Ve=await qo(Ae.bindingSignatures,qe,er.signature.subkeyBinding,ze,null,ke).catch((()=>({})));return{sign:Ve.keyFlags&&Ve.keyFlags[0]&er.keyFlags.signData}}))));const ze=Ce.subkeys.map((Ae=>Ae.keyPacket));if(Ae.subkeys.length!==ze.length)throw Error("Number of subkey options does not match number of subkeys");Ae.subkeys=Ae.subkeys.map((ke=>o(ke,Ae)));const Ve=await sc(qe,ze,Ae,ke),tt=await Ve.getRevocationCertificate(Ae.date,ke);return Ve.revocationSignatures=[],{key:Ve,revocationCertificate:tt};function o(Ae,ke={}){return Ae.keyExpirationTime=Ae.keyExpirationTime||ke.keyExpirationTime,Ae.passphrase=Xt.isString(Ae.passphrase)?Ae.passphrase:ke.passphrase,Ae.date=Ae.date||ke.date,Ae}}(it,tt);return{privateKey:Ac(Ae,Ve,tt),publicKey:Ac(Ae.toPublic(),Ve,tt),revocationCertificate:ke}}catch(Ae){throw Xt.wrapError("Error reformatting keypair",Ae)}},ke.revokeKey=async function({key:Ae,revocationCertificate:ke,reasonForRevocation:Ce,date:qe=new Date,format:ze="armored",config:Ve,...tt}){wc(Ve={...tr,...Ve});const rt=Object.keys(tt);if(rt.length>0)throw Error("Unknown option: "+rt.join(", "));try{const tt=ke?await Ae.applyRevocationCertificate(ke,qe,Ve):await Ae.revoke(Ce,qe,Ve);return tt.isPrivate()?{privateKey:Ac(tt,ze,Ve),publicKey:Ac(tt.toPublic(),ze,Ve)}:{privateKey:null,publicKey:Ac(tt,ze,Ve)}}catch(Ae){throw Xt.wrapError("Error revoking key",Ae)}},ke.sign=async function({message:Ae,signingKeys:ke,format:Ce="armored",detached:qe=!1,signingKeyIDs:ze=[],date:Ve=new Date,signingUserIDs:tt=[],config:rt,...nt}){if(wc(rt={...tr,...rt}),bc(Ae),mc(Ce),ke=vc(ke),ze=vc(ze),tt=vc(tt),nt.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.sign, pass `signingKeys` instead");if(void 0!==nt.armor)throw Error("The `armor` option has been removed from openpgp.sign, pass `format` instead.");const it=Object.keys(nt);if(it.length>0)throw Error("Unknown option: "+it.join(", "));if(Ae instanceof pc&&"binary"===Ce)throw Error("Cannot return signed cleartext message in binary format");if(Ae instanceof pc&&qe)throw Error("Cannot detach-sign a cleartext message");if(!ke||0===ke.length)throw Error("No signing keys provided");try{let nt;if(nt=qe?await Ae.signDetached(ke,void 0,ze,Ve,tt,rt):await Ae.sign(ke,void 0,ze,Ve,tt,rt),"object"===Ce)return nt;const it="armored"===Ce;return nt=it?nt.armor(rt):nt.write(),qe&&(nt=X(Ae.packets.write(),(async(Ae,ke)=>{await Promise.all([V(nt,ke),ie(Ae).catch((()=>{}))])}))),_c(nt,Ae.fromStream,it?"utf8":"binary")}catch(Ae){throw Xt.wrapError("Error signing message",Ae)}},ke.unarmor=Pe,ke.verify=async function({message:Ae,verificationKeys:ke,expectSigned:Ce=!1,format:qe="utf8",signature:ze=null,date:Ve=new Date,config:tt,...rt}){if(wc(tt={...tr,...tt}),bc(Ae),ke=vc(ke),rt.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.verify, pass `verificationKeys` instead");const nt=Object.keys(rt);if(nt.length>0)throw Error("Unknown option: "+nt.join(", "));if(Ae instanceof pc&&"binary"===qe)throw Error("Can't return cleartext message data as binary");if(Ae instanceof pc&&ze)throw Error("Can't verify detached cleartext signature");try{const rt={};if(rt.signatures=ze?await Ae.verifyDetached(ze,ke,Ve,tt):await Ae.verify(ke,Ve,tt),rt.data="binary"===qe?Ae.getLiteralData():Ae.getText(),Ae.fromStream&&kc(rt,Ae),Ce){if(0===rt.signatures.length)throw Error("Message is not signed");rt.data=W([rt.data,ae((async()=>{await Xt.anyPromise(rt.signatures.map((Ae=>Ae.verified)))}))])}return rt.data=await _c(rt.data,Ae.fromStream,qe),rt}catch(Ae){throw Xt.wrapError("Error verifying signed message",Ae)}}},7822:Ae=>{Ae.exports=Pend;function Pend(){this.pending=0;this.max=Infinity;this.listeners=[];this.waiting=[];this.error=null}Pend.prototype.go=function(Ae){if(this.pending0&&Ae.pending{"use strict";var qe=Ce(4300);var ze=qe.Buffer;var Ve={};var tt;for(tt in qe){if(!qe.hasOwnProperty(tt))continue;if(tt==="SlowBuffer"||tt==="Buffer")continue;Ve[tt]=qe[tt]}var rt=Ve.Buffer={};for(tt in ze){if(!ze.hasOwnProperty(tt))continue;if(tt==="allocUnsafe"||tt==="allocUnsafeSlow")continue;rt[tt]=ze[tt]}Ve.Buffer.prototype=ze.prototype;if(!rt.from||rt.from===Uint8Array.from){rt.from=function(Ae,ke,Ce){if(typeof Ae==="number"){throw new TypeError('The "value" argument must not be of type number. Received type '+typeof Ae)}if(Ae&&typeof Ae.length==="undefined"){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ae)}return ze(Ae,ke,Ce)}}if(!rt.alloc){rt.alloc=function(Ae,ke,Ce){if(typeof Ae!=="number"){throw new TypeError('The "size" argument must be of type number. Received type '+typeof Ae)}if(Ae<0||Ae>=2*(1<<30)){throw new RangeError('The value "'+Ae+'" is invalid for option "size"')}var qe=ze(Ae);if(!ke||ke.length===0){qe.fill(0)}else if(typeof Ce==="string"){qe.fill(ke,Ce)}else{qe.fill(ke)}return qe}}if(!Ve.kStringMaxLength){try{Ve.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(Ae){}}if(!Ve.constants){Ve.constants={MAX_LENGTH:Ve.kMaxLength};if(Ve.kStringMaxLength){Ve.constants.MAX_STRING_LENGTH=Ve.kStringMaxLength}}Ae.exports=Ve},1918:(Ae,ke)=>{ke=Ae.exports=SemVer;var Ce;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){Ce=function(){var Ae=Array.prototype.slice.call(arguments,0);Ae.unshift("SEMVER");console.log.apply(console,Ae)}}else{Ce=function(){}}ke.SEMVER_SPEC_VERSION="2.0.0";var qe=256;var ze=Number.MAX_SAFE_INTEGER||9007199254740991;var Ve=16;var tt=ke.re=[];var rt=ke.src=[];var nt=ke.tokens={};var it=0;function tok(Ae){nt[Ae]=it++}tok("NUMERICIDENTIFIER");rt[nt.NUMERICIDENTIFIER]="0|[1-9]\\d*";tok("NUMERICIDENTIFIERLOOSE");rt[nt.NUMERICIDENTIFIERLOOSE]="[0-9]+";tok("NONNUMERICIDENTIFIER");rt[nt.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";tok("MAINVERSION");rt[nt.MAINVERSION]="("+rt[nt.NUMERICIDENTIFIER]+")\\."+"("+rt[nt.NUMERICIDENTIFIER]+")\\."+"("+rt[nt.NUMERICIDENTIFIER]+")";tok("MAINVERSIONLOOSE");rt[nt.MAINVERSIONLOOSE]="("+rt[nt.NUMERICIDENTIFIERLOOSE]+")\\."+"("+rt[nt.NUMERICIDENTIFIERLOOSE]+")\\."+"("+rt[nt.NUMERICIDENTIFIERLOOSE]+")";tok("PRERELEASEIDENTIFIER");rt[nt.PRERELEASEIDENTIFIER]="(?:"+rt[nt.NUMERICIDENTIFIER]+"|"+rt[nt.NONNUMERICIDENTIFIER]+")";tok("PRERELEASEIDENTIFIERLOOSE");rt[nt.PRERELEASEIDENTIFIERLOOSE]="(?:"+rt[nt.NUMERICIDENTIFIERLOOSE]+"|"+rt[nt.NONNUMERICIDENTIFIER]+")";tok("PRERELEASE");rt[nt.PRERELEASE]="(?:-("+rt[nt.PRERELEASEIDENTIFIER]+"(?:\\."+rt[nt.PRERELEASEIDENTIFIER]+")*))";tok("PRERELEASELOOSE");rt[nt.PRERELEASELOOSE]="(?:-?("+rt[nt.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+rt[nt.PRERELEASEIDENTIFIERLOOSE]+")*))";tok("BUILDIDENTIFIER");rt[nt.BUILDIDENTIFIER]="[0-9A-Za-z-]+";tok("BUILD");rt[nt.BUILD]="(?:\\+("+rt[nt.BUILDIDENTIFIER]+"(?:\\."+rt[nt.BUILDIDENTIFIER]+")*))";tok("FULL");tok("FULLPLAIN");rt[nt.FULLPLAIN]="v?"+rt[nt.MAINVERSION]+rt[nt.PRERELEASE]+"?"+rt[nt.BUILD]+"?";rt[nt.FULL]="^"+rt[nt.FULLPLAIN]+"$";tok("LOOSEPLAIN");rt[nt.LOOSEPLAIN]="[v=\\s]*"+rt[nt.MAINVERSIONLOOSE]+rt[nt.PRERELEASELOOSE]+"?"+rt[nt.BUILD]+"?";tok("LOOSE");rt[nt.LOOSE]="^"+rt[nt.LOOSEPLAIN]+"$";tok("GTLT");rt[nt.GTLT]="((?:<|>)?=?)";tok("XRANGEIDENTIFIERLOOSE");rt[nt.XRANGEIDENTIFIERLOOSE]=rt[nt.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";tok("XRANGEIDENTIFIER");rt[nt.XRANGEIDENTIFIER]=rt[nt.NUMERICIDENTIFIER]+"|x|X|\\*";tok("XRANGEPLAIN");rt[nt.XRANGEPLAIN]="[v=\\s]*("+rt[nt.XRANGEIDENTIFIER]+")"+"(?:\\.("+rt[nt.XRANGEIDENTIFIER]+")"+"(?:\\.("+rt[nt.XRANGEIDENTIFIER]+")"+"(?:"+rt[nt.PRERELEASE]+")?"+rt[nt.BUILD]+"?"+")?)?";tok("XRANGEPLAINLOOSE");rt[nt.XRANGEPLAINLOOSE]="[v=\\s]*("+rt[nt.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+rt[nt.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+rt[nt.XRANGEIDENTIFIERLOOSE]+")"+"(?:"+rt[nt.PRERELEASELOOSE]+")?"+rt[nt.BUILD]+"?"+")?)?";tok("XRANGE");rt[nt.XRANGE]="^"+rt[nt.GTLT]+"\\s*"+rt[nt.XRANGEPLAIN]+"$";tok("XRANGELOOSE");rt[nt.XRANGELOOSE]="^"+rt[nt.GTLT]+"\\s*"+rt[nt.XRANGEPLAINLOOSE]+"$";tok("COERCE");rt[nt.COERCE]="(^|[^\\d])"+"(\\d{1,"+Ve+"})"+"(?:\\.(\\d{1,"+Ve+"}))?"+"(?:\\.(\\d{1,"+Ve+"}))?"+"(?:$|[^\\d])";tok("COERCERTL");tt[nt.COERCERTL]=new RegExp(rt[nt.COERCE],"g");tok("LONETILDE");rt[nt.LONETILDE]="(?:~>?)";tok("TILDETRIM");rt[nt.TILDETRIM]="(\\s*)"+rt[nt.LONETILDE]+"\\s+";tt[nt.TILDETRIM]=new RegExp(rt[nt.TILDETRIM],"g");var ot="$1~";tok("TILDE");rt[nt.TILDE]="^"+rt[nt.LONETILDE]+rt[nt.XRANGEPLAIN]+"$";tok("TILDELOOSE");rt[nt.TILDELOOSE]="^"+rt[nt.LONETILDE]+rt[nt.XRANGEPLAINLOOSE]+"$";tok("LONECARET");rt[nt.LONECARET]="(?:\\^)";tok("CARETTRIM");rt[nt.CARETTRIM]="(\\s*)"+rt[nt.LONECARET]+"\\s+";tt[nt.CARETTRIM]=new RegExp(rt[nt.CARETTRIM],"g");var ct="$1^";tok("CARET");rt[nt.CARET]="^"+rt[nt.LONECARET]+rt[nt.XRANGEPLAIN]+"$";tok("CARETLOOSE");rt[nt.CARETLOOSE]="^"+rt[nt.LONECARET]+rt[nt.XRANGEPLAINLOOSE]+"$";tok("COMPARATORLOOSE");rt[nt.COMPARATORLOOSE]="^"+rt[nt.GTLT]+"\\s*("+rt[nt.LOOSEPLAIN]+")$|^$";tok("COMPARATOR");rt[nt.COMPARATOR]="^"+rt[nt.GTLT]+"\\s*("+rt[nt.FULLPLAIN]+")$|^$";tok("COMPARATORTRIM");rt[nt.COMPARATORTRIM]="(\\s*)"+rt[nt.GTLT]+"\\s*("+rt[nt.LOOSEPLAIN]+"|"+rt[nt.XRANGEPLAIN]+")";tt[nt.COMPARATORTRIM]=new RegExp(rt[nt.COMPARATORTRIM],"g");var ht="$1$2$3";tok("HYPHENRANGE");rt[nt.HYPHENRANGE]="^\\s*("+rt[nt.XRANGEPLAIN]+")"+"\\s+-\\s+"+"("+rt[nt.XRANGEPLAIN]+")"+"\\s*$";tok("HYPHENRANGELOOSE");rt[nt.HYPHENRANGELOOSE]="^\\s*("+rt[nt.XRANGEPLAINLOOSE]+")"+"\\s+-\\s+"+"("+rt[nt.XRANGEPLAINLOOSE]+")"+"\\s*$";tok("STAR");rt[nt.STAR]="(<|>)?=?\\s*\\*";for(var ft=0;ftqe){return null}var Ce=ke.loose?tt[nt.LOOSE]:tt[nt.FULL];if(!Ce.test(Ae)){return null}try{return new SemVer(Ae,ke)}catch(Ae){return null}}ke.valid=valid;function valid(Ae,ke){var Ce=parse(Ae,ke);return Ce?Ce.version:null}ke.clean=clean;function clean(Ae,ke){var Ce=parse(Ae.trim().replace(/^[=v]+/,""),ke);return Ce?Ce.version:null}ke.SemVer=SemVer;function SemVer(Ae,ke){if(!ke||typeof ke!=="object"){ke={loose:!!ke,includePrerelease:false}}if(Ae instanceof SemVer){if(Ae.loose===ke.loose){return Ae}else{Ae=Ae.version}}else if(typeof Ae!=="string"){throw new TypeError("Invalid Version: "+Ae)}if(Ae.length>qe){throw new TypeError("version is longer than "+qe+" characters")}if(!(this instanceof SemVer)){return new SemVer(Ae,ke)}Ce("SemVer",Ae,ke);this.options=ke;this.loose=!!ke.loose;var Ve=Ae.trim().match(ke.loose?tt[nt.LOOSE]:tt[nt.FULL]);if(!Ve){throw new TypeError("Invalid Version: "+Ae)}this.raw=Ae;this.major=+Ve[1];this.minor=+Ve[2];this.patch=+Ve[3];if(this.major>ze||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>ze||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>ze||this.patch<0){throw new TypeError("Invalid patch version")}if(!Ve[4]){this.prerelease=[]}else{this.prerelease=Ve[4].split(".").map((function(Ae){if(/^[0-9]+$/.test(Ae)){var ke=+Ae;if(ke>=0&&ke=0){if(typeof this.prerelease[Ce]==="number"){this.prerelease[Ce]++;Ce=-2}}if(Ce===-1){this.prerelease.push(0)}}if(ke){if(this.prerelease[0]===ke){if(isNaN(this.prerelease[1])){this.prerelease=[ke,0]}}else{this.prerelease=[ke,0]}}break;default:throw new Error("invalid increment argument: "+Ae)}this.format();this.raw=this.version;return this};ke.inc=inc;function inc(Ae,ke,Ce,qe){if(typeof Ce==="string"){qe=Ce;Ce=undefined}try{return new SemVer(Ae,Ce).inc(ke,qe).version}catch(Ae){return null}}ke.diff=diff;function diff(Ae,ke){if(eq(Ae,ke)){return null}else{var Ce=parse(Ae);var qe=parse(ke);var ze="";if(Ce.prerelease.length||qe.prerelease.length){ze="pre";var Ve="prerelease"}for(var tt in Ce){if(tt==="major"||tt==="minor"||tt==="patch"){if(Ce[tt]!==qe[tt]){return ze+tt}}}return Ve}}ke.compareIdentifiers=compareIdentifiers;var mt=/^[0-9]+$/;function compareIdentifiers(Ae,ke){var Ce=mt.test(Ae);var qe=mt.test(ke);if(Ce&&qe){Ae=+Ae;ke=+ke}return Ae===ke?0:Ce&&!qe?-1:qe&&!Ce?1:Ae0}ke.lt=lt;function lt(Ae,ke,Ce){return compare(Ae,ke,Ce)<0}ke.eq=eq;function eq(Ae,ke,Ce){return compare(Ae,ke,Ce)===0}ke.neq=neq;function neq(Ae,ke,Ce){return compare(Ae,ke,Ce)!==0}ke.gte=gte;function gte(Ae,ke,Ce){return compare(Ae,ke,Ce)>=0}ke.lte=lte;function lte(Ae,ke,Ce){return compare(Ae,ke,Ce)<=0}ke.cmp=cmp;function cmp(Ae,ke,Ce,qe){switch(ke){case"===":if(typeof Ae==="object")Ae=Ae.version;if(typeof Ce==="object")Ce=Ce.version;return Ae===Ce;case"!==":if(typeof Ae==="object")Ae=Ae.version;if(typeof Ce==="object")Ce=Ce.version;return Ae!==Ce;case"":case"=":case"==":return eq(Ae,Ce,qe);case"!=":return neq(Ae,Ce,qe);case">":return gt(Ae,Ce,qe);case">=":return gte(Ae,Ce,qe);case"<":return lt(Ae,Ce,qe);case"<=":return lte(Ae,Ce,qe);default:throw new TypeError("Invalid operator: "+ke)}}ke.Comparator=Comparator;function Comparator(Ae,ke){if(!ke||typeof ke!=="object"){ke={loose:!!ke,includePrerelease:false}}if(Ae instanceof Comparator){if(Ae.loose===!!ke.loose){return Ae}else{Ae=Ae.value}}if(!(this instanceof Comparator)){return new Comparator(Ae,ke)}Ce("comparator",Ae,ke);this.options=ke;this.loose=!!ke.loose;this.parse(Ae);if(this.semver===yt){this.value=""}else{this.value=this.operator+this.semver.version}Ce("comp",this)}var yt={};Comparator.prototype.parse=function(Ae){var ke=this.options.loose?tt[nt.COMPARATORLOOSE]:tt[nt.COMPARATOR];var Ce=Ae.match(ke);if(!Ce){throw new TypeError("Invalid comparator: "+Ae)}this.operator=Ce[1]!==undefined?Ce[1]:"";if(this.operator==="="){this.operator=""}if(!Ce[2]){this.semver=yt}else{this.semver=new SemVer(Ce[2],this.options.loose)}};Comparator.prototype.toString=function(){return this.value};Comparator.prototype.test=function(Ae){Ce("Comparator.test",Ae,this.options.loose);if(this.semver===yt||Ae===yt){return true}if(typeof Ae==="string"){try{Ae=new SemVer(Ae,this.options)}catch(Ae){return false}}return cmp(Ae,this.operator,this.semver,this.options)};Comparator.prototype.intersects=function(Ae,ke){if(!(Ae instanceof Comparator)){throw new TypeError("a Comparator is required")}if(!ke||typeof ke!=="object"){ke={loose:!!ke,includePrerelease:false}}var Ce;if(this.operator===""){if(this.value===""){return true}Ce=new Range(Ae.value,ke);return satisfies(this.value,Ce,ke)}else if(Ae.operator===""){if(Ae.value===""){return true}Ce=new Range(this.value,ke);return satisfies(Ae.semver,Ce,ke)}var qe=(this.operator===">="||this.operator===">")&&(Ae.operator===">="||Ae.operator===">");var ze=(this.operator==="<="||this.operator==="<")&&(Ae.operator==="<="||Ae.operator==="<");var Ve=this.semver.version===Ae.semver.version;var tt=(this.operator===">="||this.operator==="<=")&&(Ae.operator===">="||Ae.operator==="<=");var rt=cmp(this.semver,"<",Ae.semver,ke)&&((this.operator===">="||this.operator===">")&&(Ae.operator==="<="||Ae.operator==="<"));var nt=cmp(this.semver,">",Ae.semver,ke)&&((this.operator==="<="||this.operator==="<")&&(Ae.operator===">="||Ae.operator===">"));return qe||ze||Ve&&tt||rt||nt};ke.Range=Range;function Range(Ae,ke){if(!ke||typeof ke!=="object"){ke={loose:!!ke,includePrerelease:false}}if(Ae instanceof Range){if(Ae.loose===!!ke.loose&&Ae.includePrerelease===!!ke.includePrerelease){return Ae}else{return new Range(Ae.raw,ke)}}if(Ae instanceof Comparator){return new Range(Ae.value,ke)}if(!(this instanceof Range)){return new Range(Ae,ke)}this.options=ke;this.loose=!!ke.loose;this.includePrerelease=!!ke.includePrerelease;this.raw=Ae;this.set=Ae.split(/\s*\|\|\s*/).map((function(Ae){return this.parseRange(Ae.trim())}),this).filter((function(Ae){return Ae.length}));if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+Ae)}this.format()}Range.prototype.format=function(){this.range=this.set.map((function(Ae){return Ae.join(" ").trim()})).join("||").trim();return this.range};Range.prototype.toString=function(){return this.range};Range.prototype.parseRange=function(Ae){var ke=this.options.loose;Ae=Ae.trim();var qe=ke?tt[nt.HYPHENRANGELOOSE]:tt[nt.HYPHENRANGE];Ae=Ae.replace(qe,hyphenReplace);Ce("hyphen replace",Ae);Ae=Ae.replace(tt[nt.COMPARATORTRIM],ht);Ce("comparator trim",Ae,tt[nt.COMPARATORTRIM]);Ae=Ae.replace(tt[nt.TILDETRIM],ot);Ae=Ae.replace(tt[nt.CARETTRIM],ct);Ae=Ae.split(/\s+/).join(" ");var ze=ke?tt[nt.COMPARATORLOOSE]:tt[nt.COMPARATOR];var Ve=Ae.split(" ").map((function(Ae){return parseComparator(Ae,this.options)}),this).join(" ").split(/\s+/);if(this.options.loose){Ve=Ve.filter((function(Ae){return!!Ae.match(ze)}))}Ve=Ve.map((function(Ae){return new Comparator(Ae,this.options)}),this);return Ve};Range.prototype.intersects=function(Ae,ke){if(!(Ae instanceof Range)){throw new TypeError("a Range is required")}return this.set.some((function(Ce){return isSatisfiable(Ce,ke)&&Ae.set.some((function(Ae){return isSatisfiable(Ae,ke)&&Ce.every((function(Ce){return Ae.every((function(Ae){return Ce.intersects(Ae,ke)}))}))}))}))};function isSatisfiable(Ae,ke){var Ce=true;var qe=Ae.slice();var ze=qe.pop();while(Ce&&qe.length){Ce=qe.every((function(Ae){return ze.intersects(Ae,ke)}));ze=qe.pop()}return Ce}ke.toComparators=toComparators;function toComparators(Ae,ke){return new Range(Ae,ke).set.map((function(Ae){return Ae.map((function(Ae){return Ae.value})).join(" ").trim().split(" ")}))}function parseComparator(Ae,ke){Ce("comp",Ae,ke);Ae=replaceCarets(Ae,ke);Ce("caret",Ae);Ae=replaceTildes(Ae,ke);Ce("tildes",Ae);Ae=replaceXRanges(Ae,ke);Ce("xrange",Ae);Ae=replaceStars(Ae,ke);Ce("stars",Ae);return Ae}function isX(Ae){return!Ae||Ae.toLowerCase()==="x"||Ae==="*"}function replaceTildes(Ae,ke){return Ae.trim().split(/\s+/).map((function(Ae){return replaceTilde(Ae,ke)})).join(" ")}function replaceTilde(Ae,ke){var qe=ke.loose?tt[nt.TILDELOOSE]:tt[nt.TILDE];return Ae.replace(qe,(function(ke,qe,ze,Ve,tt){Ce("tilde",Ae,ke,qe,ze,Ve,tt);var rt;if(isX(qe)){rt=""}else if(isX(ze)){rt=">="+qe+".0.0 <"+(+qe+1)+".0.0"}else if(isX(Ve)){rt=">="+qe+"."+ze+".0 <"+qe+"."+(+ze+1)+".0"}else if(tt){Ce("replaceTilde pr",tt);rt=">="+qe+"."+ze+"."+Ve+"-"+tt+" <"+qe+"."+(+ze+1)+".0"}else{rt=">="+qe+"."+ze+"."+Ve+" <"+qe+"."+(+ze+1)+".0"}Ce("tilde return",rt);return rt}))}function replaceCarets(Ae,ke){return Ae.trim().split(/\s+/).map((function(Ae){return replaceCaret(Ae,ke)})).join(" ")}function replaceCaret(Ae,ke){Ce("caret",Ae,ke);var qe=ke.loose?tt[nt.CARETLOOSE]:tt[nt.CARET];return Ae.replace(qe,(function(ke,qe,ze,Ve,tt){Ce("caret",Ae,ke,qe,ze,Ve,tt);var rt;if(isX(qe)){rt=""}else if(isX(ze)){rt=">="+qe+".0.0 <"+(+qe+1)+".0.0"}else if(isX(Ve)){if(qe==="0"){rt=">="+qe+"."+ze+".0 <"+qe+"."+(+ze+1)+".0"}else{rt=">="+qe+"."+ze+".0 <"+(+qe+1)+".0.0"}}else if(tt){Ce("replaceCaret pr",tt);if(qe==="0"){if(ze==="0"){rt=">="+qe+"."+ze+"."+Ve+"-"+tt+" <"+qe+"."+ze+"."+(+Ve+1)}else{rt=">="+qe+"."+ze+"."+Ve+"-"+tt+" <"+qe+"."+(+ze+1)+".0"}}else{rt=">="+qe+"."+ze+"."+Ve+"-"+tt+" <"+(+qe+1)+".0.0"}}else{Ce("no pr");if(qe==="0"){if(ze==="0"){rt=">="+qe+"."+ze+"."+Ve+" <"+qe+"."+ze+"."+(+Ve+1)}else{rt=">="+qe+"."+ze+"."+Ve+" <"+qe+"."+(+ze+1)+".0"}}else{rt=">="+qe+"."+ze+"."+Ve+" <"+(+qe+1)+".0.0"}}Ce("caret return",rt);return rt}))}function replaceXRanges(Ae,ke){Ce("replaceXRanges",Ae,ke);return Ae.split(/\s+/).map((function(Ae){return replaceXRange(Ae,ke)})).join(" ")}function replaceXRange(Ae,ke){Ae=Ae.trim();var qe=ke.loose?tt[nt.XRANGELOOSE]:tt[nt.XRANGE];return Ae.replace(qe,(function(qe,ze,Ve,tt,rt,nt){Ce("xRange",Ae,qe,ze,Ve,tt,rt,nt);var it=isX(Ve);var ot=it||isX(tt);var ct=ot||isX(rt);var ht=ct;if(ze==="="&&ht){ze=""}nt=ke.includePrerelease?"-0":"";if(it){if(ze===">"||ze==="<"){qe="<0.0.0-0"}else{qe="*"}}else if(ze&&ht){if(ot){tt=0}rt=0;if(ze===">"){ze=">=";if(ot){Ve=+Ve+1;tt=0;rt=0}else{tt=+tt+1;rt=0}}else if(ze==="<="){ze="<";if(ot){Ve=+Ve+1}else{tt=+tt+1}}qe=ze+Ve+"."+tt+"."+rt+nt}else if(ot){qe=">="+Ve+".0.0"+nt+" <"+(+Ve+1)+".0.0"+nt}else if(ct){qe=">="+Ve+"."+tt+".0"+nt+" <"+Ve+"."+(+tt+1)+".0"+nt}Ce("xRange return",qe);return qe}))}function replaceStars(Ae,ke){Ce("replaceStars",Ae,ke);return Ae.trim().replace(tt[nt.STAR],"")}function hyphenReplace(Ae,ke,Ce,qe,ze,Ve,tt,rt,nt,it,ot,ct,ht){if(isX(Ce)){ke=""}else if(isX(qe)){ke=">="+Ce+".0.0"}else if(isX(ze)){ke=">="+Ce+"."+qe+".0"}else{ke=">="+ke}if(isX(nt)){rt=""}else if(isX(it)){rt="<"+(+nt+1)+".0.0"}else if(isX(ot)){rt="<"+nt+"."+(+it+1)+".0"}else if(ct){rt="<="+nt+"."+it+"."+ot+"-"+ct}else{rt="<="+rt}return(ke+" "+rt).trim()}Range.prototype.test=function(Ae){if(!Ae){return false}if(typeof Ae==="string"){try{Ae=new SemVer(Ae,this.options)}catch(Ae){return false}}for(var ke=0;ke0){var Ve=Ae[ze].semver;if(Ve.major===ke.major&&Ve.minor===ke.minor&&Ve.patch===ke.patch){return true}}}return false}return true}ke.satisfies=satisfies;function satisfies(Ae,ke,Ce){try{ke=new Range(ke,Ce)}catch(Ae){return false}return ke.test(Ae)}ke.maxSatisfying=maxSatisfying;function maxSatisfying(Ae,ke,Ce){var qe=null;var ze=null;try{var Ve=new Range(ke,Ce)}catch(Ae){return null}Ae.forEach((function(Ae){if(Ve.test(Ae)){if(!qe||ze.compare(Ae)===-1){qe=Ae;ze=new SemVer(qe,Ce)}}}));return qe}ke.minSatisfying=minSatisfying;function minSatisfying(Ae,ke,Ce){var qe=null;var ze=null;try{var Ve=new Range(ke,Ce)}catch(Ae){return null}Ae.forEach((function(Ae){if(Ve.test(Ae)){if(!qe||ze.compare(Ae)===1){qe=Ae;ze=new SemVer(qe,Ce)}}}));return qe}ke.minVersion=minVersion;function minVersion(Ae,ke){Ae=new Range(Ae,ke);var Ce=new SemVer("0.0.0");if(Ae.test(Ce)){return Ce}Ce=new SemVer("0.0.0-0");if(Ae.test(Ce)){return Ce}Ce=null;for(var qe=0;qe":if(ke.prerelease.length===0){ke.patch++}else{ke.prerelease.push(0)}ke.raw=ke.format();case"":case">=":if(!Ce||gt(Ce,ke)){Ce=ke}break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+Ae.operator)}}))}if(Ce&&Ae.test(Ce)){return Ce}return null}ke.validRange=validRange;function validRange(Ae,ke){try{return new Range(Ae,ke).range||"*"}catch(Ae){return null}}ke.ltr=ltr;function ltr(Ae,ke,Ce){return outside(Ae,ke,"<",Ce)}ke.gtr=gtr;function gtr(Ae,ke,Ce){return outside(Ae,ke,">",Ce)}ke.outside=outside;function outside(Ae,ke,Ce,qe){Ae=new SemVer(Ae,qe);ke=new Range(ke,qe);var ze,Ve,tt,rt,nt;switch(Ce){case">":ze=gt;Ve=lte;tt=lt;rt=">";nt=">=";break;case"<":ze=lt;Ve=gte;tt=gt;rt="<";nt="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(Ae,ke,qe)){return false}for(var it=0;it=0.0.0")}ct=ct||Ae;ht=ht||Ae;if(ze(Ae.semver,ct.semver,qe)){ct=Ae}else if(tt(Ae.semver,ht.semver,qe)){ht=Ae}}));if(ct.operator===rt||ct.operator===nt){return false}if((!ht.operator||ht.operator===rt)&&Ve(Ae,ht.semver)){return false}else if(ht.operator===nt&&tt(Ae,ht.semver)){return false}}return true}ke.prerelease=prerelease;function prerelease(Ae,ke){var Ce=parse(Ae,ke);return Ce&&Ce.prerelease.length?Ce.prerelease:null}ke.intersects=intersects;function intersects(Ae,ke,Ce){Ae=new Range(Ae,Ce);ke=new Range(ke,Ce);return Ae.intersects(ke)}ke.coerce=coerce;function coerce(Ae,ke){if(Ae instanceof SemVer){return Ae}if(typeof Ae==="number"){Ae=String(Ae)}if(typeof Ae!=="string"){return null}ke=ke||{};var Ce=null;if(!ke.rtl){Ce=Ae.match(tt[nt.COERCE])}else{var qe;while((qe=tt[nt.COERCERTL].exec(Ae))&&(!Ce||Ce.index+Ce[0].length!==Ae.length)){if(!Ce||qe.index+qe[0].length!==Ce.index+Ce[0].length){Ce=qe}tt[nt.COERCERTL].lastIndex=qe.index+qe[1].length+qe[2].length}tt[nt.COERCERTL].lastIndex=-1}if(Ce===null){return null}return parse(Ce[2]+"."+(Ce[3]||"0")+"."+(Ce[4]||"0"),ke)}},6461:(Ae,ke,Ce)=>{Ae.exports=Ce(8013)},8013:(Ae,ke,Ce)=>{"use strict";var qe=Ce(1808);var ze=Ce(4404);var Ve=Ce(3685);var tt=Ce(5687);var rt=Ce(2361);var nt=Ce(9491);var it=Ce(3837);ke.httpOverHttp=httpOverHttp;ke.httpsOverHttp=httpsOverHttp;ke.httpOverHttps=httpOverHttps;ke.httpsOverHttps=httpsOverHttps;function httpOverHttp(Ae){var ke=new TunnelingAgent(Ae);ke.request=Ve.request;return ke}function httpsOverHttp(Ae){var ke=new TunnelingAgent(Ae);ke.request=Ve.request;ke.createSocket=createSecureSocket;ke.defaultPort=443;return ke}function httpOverHttps(Ae){var ke=new TunnelingAgent(Ae);ke.request=tt.request;return ke}function httpsOverHttps(Ae){var ke=new TunnelingAgent(Ae);ke.request=tt.request;ke.createSocket=createSecureSocket;ke.defaultPort=443;return ke}function TunnelingAgent(Ae){var ke=this;ke.options=Ae||{};ke.proxyOptions=ke.options.proxy||{};ke.maxSockets=ke.options.maxSockets||Ve.Agent.defaultMaxSockets;ke.requests=[];ke.sockets=[];ke.on("free",(function onFree(Ae,Ce,qe,ze){var Ve=toOptions(Ce,qe,ze);for(var tt=0,rt=ke.requests.length;tt=this.maxSockets){ze.requests.push(Ve);return}ze.createSocket(Ve,(function(ke){ke.on("free",onFree);ke.on("close",onCloseOrRemove);ke.on("agentRemove",onCloseOrRemove);Ae.onSocket(ke);function onFree(){ze.emit("free",ke,Ve)}function onCloseOrRemove(Ae){ze.removeSocket(ke);ke.removeListener("free",onFree);ke.removeListener("close",onCloseOrRemove);ke.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(Ae,ke){var Ce=this;var qe={};Ce.sockets.push(qe);var ze=mergeOptions({},Ce.proxyOptions,{method:"CONNECT",path:Ae.host+":"+Ae.port,agent:false,headers:{host:Ae.host+":"+Ae.port}});if(Ae.localAddress){ze.localAddress=Ae.localAddress}if(ze.proxyAuth){ze.headers=ze.headers||{};ze.headers["Proxy-Authorization"]="Basic "+new Buffer(ze.proxyAuth).toString("base64")}ot("making CONNECT request");var Ve=Ce.request(ze);Ve.useChunkedEncodingByDefault=false;Ve.once("response",onResponse);Ve.once("upgrade",onUpgrade);Ve.once("connect",onConnect);Ve.once("error",onError);Ve.end();function onResponse(Ae){Ae.upgrade=true}function onUpgrade(Ae,ke,Ce){process.nextTick((function(){onConnect(Ae,ke,Ce)}))}function onConnect(ze,tt,rt){Ve.removeAllListeners();tt.removeAllListeners();if(ze.statusCode!==200){ot("tunneling socket could not be established, statusCode=%d",ze.statusCode);tt.destroy();var nt=new Error("tunneling socket could not be established, "+"statusCode="+ze.statusCode);nt.code="ECONNRESET";Ae.request.emit("error",nt);Ce.removeSocket(qe);return}if(rt.length>0){ot("got illegal response body from proxy");tt.destroy();var nt=new Error("got illegal response body from proxy");nt.code="ECONNRESET";Ae.request.emit("error",nt);Ce.removeSocket(qe);return}ot("tunneling connection has established");Ce.sockets[Ce.sockets.indexOf(qe)]=tt;return ke(tt)}function onError(ke){Ve.removeAllListeners();ot("tunneling socket could not be established, cause=%s\n",ke.message,ke.stack);var ze=new Error("tunneling socket could not be established, "+"cause="+ke.message);ze.code="ECONNRESET";Ae.request.emit("error",ze);Ce.removeSocket(qe)}};TunnelingAgent.prototype.removeSocket=function removeSocket(Ae){var ke=this.sockets.indexOf(Ae);if(ke===-1){return}this.sockets.splice(ke,1);var Ce=this.requests.shift();if(Ce){this.createSocket(Ce,(function(Ae){Ce.request.onSocket(Ae)}))}};function createSecureSocket(Ae,ke){var Ce=this;TunnelingAgent.prototype.createSocket.call(Ce,Ae,(function(qe){var Ve=Ae.request.getHeader("host");var tt=mergeOptions({},Ce.options,{socket:qe,servername:Ve?Ve.replace(/:.*$/,""):Ae.host});var rt=ze.connect(0,tt);Ce.sockets[Ce.sockets.indexOf(qe)]=rt;ke(rt)}))}function toOptions(Ae,ke,Ce){if(typeof Ae==="string"){return{host:Ae,port:ke,localAddress:Ce}}return Ae}function mergeOptions(Ae){for(var ke=1,Ce=arguments.length;ke{var ke=[];for(var Ce=0;Ce<256;++Ce){ke[Ce]=(Ce+256).toString(16).substr(1)}function bytesToUuid(Ae,Ce){var qe=Ce||0;var ze=ke;return[ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]],"-",ze[Ae[qe++]],ze[Ae[qe++]],"-",ze[Ae[qe++]],ze[Ae[qe++]],"-",ze[Ae[qe++]],ze[Ae[qe++]],"-",ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]],ze[Ae[qe++]]].join("")}Ae.exports=bytesToUuid},6175:(Ae,ke,Ce)=>{var qe=Ce(6113);Ae.exports=function nodeRNG(){return qe.randomBytes(16)}},6294:(Ae,ke,Ce)=>{var qe=Ce(6175);var ze=Ce(5213);function v4(Ae,ke,Ce){var Ve=ke&&Ce||0;if(typeof Ae=="string"){ke=Ae==="binary"?new Array(16):null;Ae=null}Ae=Ae||{};var tt=Ae.random||(Ae.rng||qe)();tt[6]=tt[6]&15|64;tt[8]=tt[8]&63|128;if(ke){for(var rt=0;rt<16;++rt){ke[Ve+rt]=tt[rt]}}return ke||ze(tt)}Ae.exports=v4},9330:Ae=>{"use strict";Ae.exports=function(Ae){Ae.prototype[Symbol.iterator]=function*(){for(let Ae=this.head;Ae;Ae=Ae.next){yield Ae.value}}}},2177:(Ae,ke,Ce)=>{"use strict";Ae.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(Ae){var ke=this;if(!(ke instanceof Yallist)){ke=new Yallist}ke.tail=null;ke.head=null;ke.length=0;if(Ae&&typeof Ae.forEach==="function"){Ae.forEach((function(Ae){ke.push(Ae)}))}else if(arguments.length>0){for(var Ce=0,qe=arguments.length;Ce1){Ce=ke}else if(this.head){qe=this.head.next;Ce=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var ze=0;qe!==null;ze++){Ce=Ae(Ce,qe.value,ze);qe=qe.next}return Ce};Yallist.prototype.reduceReverse=function(Ae,ke){var Ce;var qe=this.tail;if(arguments.length>1){Ce=ke}else if(this.tail){qe=this.tail.prev;Ce=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var ze=this.length-1;qe!==null;ze--){Ce=Ae(Ce,qe.value,ze);qe=qe.prev}return Ce};Yallist.prototype.toArray=function(){var Ae=new Array(this.length);for(var ke=0,Ce=this.head;Ce!==null;ke++){Ae[ke]=Ce.value;Ce=Ce.next}return Ae};Yallist.prototype.toArrayReverse=function(){var Ae=new Array(this.length);for(var ke=0,Ce=this.tail;Ce!==null;ke++){Ae[ke]=Ce.value;Ce=Ce.prev}return Ae};Yallist.prototype.slice=function(Ae,ke){ke=ke||this.length;if(ke<0){ke+=this.length}Ae=Ae||0;if(Ae<0){Ae+=this.length}var Ce=new Yallist;if(kethis.length){ke=this.length}for(var qe=0,ze=this.head;ze!==null&&qethis.length){ke=this.length}for(var qe=this.length,ze=this.tail;ze!==null&&qe>ke;qe--){ze=ze.prev}for(;ze!==null&&qe>Ae;qe--,ze=ze.prev){Ce.push(ze.value)}return Ce};Yallist.prototype.splice=function(Ae,ke,...Ce){if(Ae>this.length){Ae=this.length-1}if(Ae<0){Ae=this.length+Ae}for(var qe=0,ze=this.head;ze!==null&&qe{var qe=Ce(7147);var ze=Ce(9796);var Ve=Ce(2357);var tt=Ce(5918);var rt=Ce(3837);var nt=Ce(2361).EventEmitter;var it=Ce(2781).Transform;var ot=Ce(2781).PassThrough;var ct=Ce(2781).Writable;ke.open=open;ke.fromFd=fromFd;ke.fromBuffer=fromBuffer;ke.fromRandomAccessReader=fromRandomAccessReader;ke.dosDateTimeToDate=dosDateTimeToDate;ke.validateFileName=validateFileName;ke.ZipFile=ZipFile;ke.Entry=Entry;ke.RandomAccessReader=RandomAccessReader;function open(Ae,ke,Ce){if(typeof ke==="function"){Ce=ke;ke=null}if(ke==null)ke={};if(ke.autoClose==null)ke.autoClose=true;if(ke.lazyEntries==null)ke.lazyEntries=false;if(ke.decodeStrings==null)ke.decodeStrings=true;if(ke.validateEntrySizes==null)ke.validateEntrySizes=true;if(ke.strictFileNames==null)ke.strictFileNames=false;if(Ce==null)Ce=defaultCallback;qe.open(Ae,"r",(function(Ae,ze){if(Ae)return Ce(Ae);fromFd(ze,ke,(function(Ae,ke){if(Ae)qe.close(ze,defaultCallback);Ce(Ae,ke)}))}))}function fromFd(Ae,ke,Ce){if(typeof ke==="function"){Ce=ke;ke=null}if(ke==null)ke={};if(ke.autoClose==null)ke.autoClose=false;if(ke.lazyEntries==null)ke.lazyEntries=false;if(ke.decodeStrings==null)ke.decodeStrings=true;if(ke.validateEntrySizes==null)ke.validateEntrySizes=true;if(ke.strictFileNames==null)ke.strictFileNames=false;if(Ce==null)Ce=defaultCallback;qe.fstat(Ae,(function(qe,ze){if(qe)return Ce(qe);var tt=Ve.createFromFd(Ae,{autoClose:true});fromRandomAccessReader(tt,ze.size,ke,Ce)}))}function fromBuffer(Ae,ke,Ce){if(typeof ke==="function"){Ce=ke;ke=null}if(ke==null)ke={};ke.autoClose=false;if(ke.lazyEntries==null)ke.lazyEntries=false;if(ke.decodeStrings==null)ke.decodeStrings=true;if(ke.validateEntrySizes==null)ke.validateEntrySizes=true;if(ke.strictFileNames==null)ke.strictFileNames=false;var qe=Ve.createFromBuffer(Ae,{maxChunkSize:65536});fromRandomAccessReader(qe,Ae.length,ke,Ce)}function fromRandomAccessReader(Ae,ke,Ce,qe){if(typeof Ce==="function"){qe=Ce;Ce=null}if(Ce==null)Ce={};if(Ce.autoClose==null)Ce.autoClose=true;if(Ce.lazyEntries==null)Ce.lazyEntries=false;if(Ce.decodeStrings==null)Ce.decodeStrings=true;var ze=!!Ce.decodeStrings;if(Ce.validateEntrySizes==null)Ce.validateEntrySizes=true;if(Ce.strictFileNames==null)Ce.strictFileNames=false;if(qe==null)qe=defaultCallback;if(typeof ke!=="number")throw new Error("expected totalSize parameter to be a number");if(ke>Number.MAX_SAFE_INTEGER){throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.")}Ae.ref();var Ve=22;var tt=65535;var rt=Math.min(Ve+tt,ke);var nt=ft(rt);var it=ke-nt.length;readAndAssertNoEof(Ae,nt,0,rt,it,(function(tt){if(tt)return qe(tt);for(var ot=rt-Ve;ot>=0;ot-=1){if(nt.readUInt32LE(ot)!==101010256)continue;var ct=nt.slice(ot);var ht=ct.readUInt16LE(4);if(ht!==0){return qe(new Error("multi-disk zip files are not supported: found disk number: "+ht))}var mt=ct.readUInt16LE(10);var yt=ct.readUInt32LE(16);var Et=ct.readUInt16LE(20);var kt=ct.length-Ve;if(Et!==kt){return qe(new Error("invalid comment length. expected: "+kt+". found: "+Et))}var St=ze?decodeBuffer(ct,22,ct.length,false):ct.slice(22);if(!(mt===65535||yt===4294967295)){return qe(null,new ZipFile(Ae,yt,ke,mt,St,Ce.autoClose,Ce.lazyEntries,ze,Ce.validateEntrySizes,Ce.strictFileNames))}var Rt=ft(20);var Pt=it+ot-Rt.length;readAndAssertNoEof(Ae,Rt,0,Rt.length,Pt,(function(Ve){if(Ve)return qe(Ve);if(Rt.readUInt32LE(0)!==117853008){return qe(new Error("invalid zip64 end of central directory locator signature"))}var tt=readUInt64LE(Rt,8);var rt=ft(56);readAndAssertNoEof(Ae,rt,0,rt.length,tt,(function(Ve){if(Ve)return qe(Ve);if(rt.readUInt32LE(0)!==101075792){return qe(new Error("invalid zip64 end of central directory record signature"))}mt=readUInt64LE(rt,32);yt=readUInt64LE(rt,48);return qe(null,new ZipFile(Ae,yt,ke,mt,St,Ce.autoClose,Ce.lazyEntries,ze,Ce.validateEntrySizes,Ce.strictFileNames))}))}));return}qe(new Error("end of central directory record signature not found"))}))}rt.inherits(ZipFile,nt);function ZipFile(Ae,ke,Ce,qe,ze,Ve,tt,rt,it,ot){var ct=this;nt.call(ct);ct.reader=Ae;ct.reader.on("error",(function(Ae){emitError(ct,Ae)}));ct.reader.once("close",(function(){ct.emit("close")}));ct.readEntryCursor=ke;ct.fileSize=Ce;ct.entryCount=qe;ct.comment=ze;ct.entriesRead=0;ct.autoClose=!!Ve;ct.lazyEntries=!!tt;ct.decodeStrings=!!rt;ct.validateEntrySizes=!!it;ct.strictFileNames=!!ot;ct.isOpen=true;ct.emittedError=false;if(!ct.lazyEntries)ct._readEntry()}ZipFile.prototype.close=function(){if(!this.isOpen)return;this.isOpen=false;this.reader.unref()};function emitErrorAndAutoClose(Ae,ke){if(Ae.autoClose)Ae.close();emitError(Ae,ke)}function emitError(Ae,ke){if(Ae.emittedError)return;Ae.emittedError=true;Ae.emit("error",ke)}ZipFile.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};ZipFile.prototype._readEntry=function(){var Ae=this;if(Ae.entryCount===Ae.entriesRead){setImmediate((function(){if(Ae.autoClose)Ae.close();if(Ae.emittedError)return;Ae.emit("end")}));return}if(Ae.emittedError)return;var ke=ft(46);readAndAssertNoEof(Ae.reader,ke,0,ke.length,Ae.readEntryCursor,(function(Ce){if(Ce)return emitErrorAndAutoClose(Ae,Ce);if(Ae.emittedError)return;var qe=new Entry;var ze=ke.readUInt32LE(0);if(ze!==33639248)return emitErrorAndAutoClose(Ae,new Error("invalid central directory file header signature: 0x"+ze.toString(16)));qe.versionMadeBy=ke.readUInt16LE(4);qe.versionNeededToExtract=ke.readUInt16LE(6);qe.generalPurposeBitFlag=ke.readUInt16LE(8);qe.compressionMethod=ke.readUInt16LE(10);qe.lastModFileTime=ke.readUInt16LE(12);qe.lastModFileDate=ke.readUInt16LE(14);qe.crc32=ke.readUInt32LE(16);qe.compressedSize=ke.readUInt32LE(20);qe.uncompressedSize=ke.readUInt32LE(24);qe.fileNameLength=ke.readUInt16LE(28);qe.extraFieldLength=ke.readUInt16LE(30);qe.fileCommentLength=ke.readUInt16LE(32);qe.internalFileAttributes=ke.readUInt16LE(36);qe.externalFileAttributes=ke.readUInt32LE(38);qe.relativeOffsetOfLocalHeader=ke.readUInt32LE(42);if(qe.generalPurposeBitFlag&64)return emitErrorAndAutoClose(Ae,new Error("strong encryption is not supported"));Ae.readEntryCursor+=46;ke=ft(qe.fileNameLength+qe.extraFieldLength+qe.fileCommentLength);readAndAssertNoEof(Ae.reader,ke,0,ke.length,Ae.readEntryCursor,(function(Ce){if(Ce)return emitErrorAndAutoClose(Ae,Ce);if(Ae.emittedError)return;var ze=(qe.generalPurposeBitFlag&2048)!==0;qe.fileName=Ae.decodeStrings?decodeBuffer(ke,0,qe.fileNameLength,ze):ke.slice(0,qe.fileNameLength);var Ve=qe.fileNameLength+qe.extraFieldLength;var rt=ke.slice(qe.fileNameLength,Ve);qe.extraFields=[];var nt=0;while(ntrt.length)return emitErrorAndAutoClose(Ae,new Error("extra field length exceeds extra field buffer size"));var mt=ft(ot);rt.copy(mt,0,ct,ht);qe.extraFields.push({id:it,data:mt});nt=ht}qe.fileComment=Ae.decodeStrings?decodeBuffer(ke,Ve,Ve+qe.fileCommentLength,ze):ke.slice(Ve,Ve+qe.fileCommentLength);qe.comment=qe.fileComment;Ae.readEntryCursor+=ke.length;Ae.entriesRead+=1;if(qe.uncompressedSize===4294967295||qe.compressedSize===4294967295||qe.relativeOffsetOfLocalHeader===4294967295){var yt=null;for(var nt=0;ntyt.length){return emitErrorAndAutoClose(Ae,new Error("zip64 extended information extra field does not include uncompressed size"))}qe.uncompressedSize=readUInt64LE(yt,kt);kt+=8}if(qe.compressedSize===4294967295){if(kt+8>yt.length){return emitErrorAndAutoClose(Ae,new Error("zip64 extended information extra field does not include compressed size"))}qe.compressedSize=readUInt64LE(yt,kt);kt+=8}if(qe.relativeOffsetOfLocalHeader===4294967295){if(kt+8>yt.length){return emitErrorAndAutoClose(Ae,new Error("zip64 extended information extra field does not include relative header offset"))}qe.relativeOffsetOfLocalHeader=readUInt64LE(yt,kt);kt+=8}}if(Ae.decodeStrings){for(var nt=0;ntAe.compressedSize)throw new Error("options.start > entry.compressedSize")}if(ke.end!=null){tt=ke.end;if(tt<0)throw new Error("options.end < 0");if(tt>Ae.compressedSize)throw new Error("options.end > entry.compressedSize");if(ttqe.fileSize){return Ce(new Error("file data overflows file bounds: "+mt+" + "+Ae.compressedSize+" > "+qe.fileSize))}}var Et=qe.reader.createReadStream({start:mt+Ve,end:mt+tt});var kt=Et;if(ft){var St=false;var Rt=ze.createInflateRaw();Et.on("error",(function(Ae){setImmediate((function(){if(!St)Rt.emit("error",Ae)}))}));Et.pipe(Rt);if(qe.validateEntrySizes){kt=new AssertByteCountStream(Ae.uncompressedSize);Rt.on("error",(function(Ae){setImmediate((function(){if(!St)kt.emit("error",Ae)}))}));Rt.pipe(kt)}else{kt=Rt}kt.destroy=function(){St=true;if(Rt!==kt)Rt.unpipe(kt);Et.unpipe(Rt);Et.destroy()}}Ce(null,kt)}finally{qe.reader.unref()}}))};function Entry(){}Entry.prototype.getLastModDate=function(){return dosDateTimeToDate(this.lastModFileDate,this.lastModFileTime)};Entry.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Entry.prototype.isCompressed=function(){return this.compressionMethod===8};function dosDateTimeToDate(Ae,ke){var Ce=Ae&31;var qe=(Ae>>5&15)-1;var ze=(Ae>>9&127)+1980;var Ve=0;var tt=(ke&31)*2;var rt=ke>>5&63;var nt=ke>>11&31;return new Date(ze,qe,Ce,nt,rt,tt,Ve)}function validateFileName(Ae){if(Ae.indexOf("\\")!==-1){return"invalid characters in fileName: "+Ae}if(/^[a-zA-Z]:/.test(Ae)||/^\//.test(Ae)){return"absolute path: "+Ae}if(Ae.split("/").indexOf("..")!==-1){return"invalid relative path: "+Ae}return null}function readAndAssertNoEof(Ae,ke,Ce,qe,ze,Ve){if(qe===0){return setImmediate((function(){Ve(null,ft(0))}))}Ae.read(ke,Ce,qe,ze,(function(Ae,ke){if(Ae)return Ve(Ae);if(kethis.expectedByteCount){var qe="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return Ce(new Error(qe))}Ce(null,Ae)};AssertByteCountStream.prototype._flush=function(Ae){if(this.actualByteCount0)return;if(Ae.refCount<0)throw new Error("invalid unref");Ae.close(onCloseDone);function onCloseDone(ke){if(ke)return Ae.emit("error",ke);Ae.emit("close")}};RandomAccessReader.prototype.createReadStream=function(Ae){var ke=Ae.start;var Ce=Ae.end;if(ke===Ce){var qe=new ot;setImmediate((function(){qe.end()}));return qe}var ze=this._readStreamForRange(ke,Ce);var Ve=false;var tt=new RefUnrefFilter(this);ze.on("error",(function(Ae){setImmediate((function(){if(!Ve)tt.emit("error",Ae)}))}));tt.destroy=function(){ze.unpipe(tt);tt.unref();ze.destroy()};var rt=new AssertByteCountStream(Ce-ke);tt.on("error",(function(Ae){setImmediate((function(){if(!Ve)rt.emit("error",Ae)}))}));rt.destroy=function(){Ve=true;tt.unpipe(rt);tt.destroy()};return ze.pipe(tt).pipe(rt)};RandomAccessReader.prototype._readStreamForRange=function(Ae,ke){throw new Error("not implemented")};RandomAccessReader.prototype.read=function(Ae,ke,Ce,qe,ze){var Ve=this.createReadStream({start:qe,end:qe+Ce});var tt=new ct;var rt=0;tt._write=function(Ce,qe,ze){Ce.copy(Ae,ke+rt,0,Ce.length);rt+=Ce.length;ze()};tt.on("finish",ze);Ve.on("error",(function(Ae){ze(Ae)}));Ve.pipe(tt)};RandomAccessReader.prototype.close=function(Ae){setImmediate(Ae)};rt.inherits(RefUnrefFilter,ot);function RefUnrefFilter(Ae){ot.call(this);this.context=Ae;this.context.ref();this.unreffedYet=false}RefUnrefFilter.prototype._flush=function(Ae){this.unref();Ae()};RefUnrefFilter.prototype.unref=function(Ae){if(this.unreffedYet)return;this.unreffedYet=true;this.context.unref()};var ht="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function decodeBuffer(Ae,ke,Ce,qe){if(qe){return Ae.toString("utf8",ke,Ce)}else{var ze="";for(var Ve=ke;Ve{module.exports=eval("require")("supports-color")},9491:Ae=>{"use strict";Ae.exports=require("assert")},4300:Ae=>{"use strict";Ae.exports=require("buffer")},2081:Ae=>{"use strict";Ae.exports=require("child_process")},6113:Ae=>{"use strict";Ae.exports=require("crypto")},2361:Ae=>{"use strict";Ae.exports=require("events")},7147:Ae=>{"use strict";Ae.exports=require("fs")},3685:Ae=>{"use strict";Ae.exports=require("http")},5687:Ae=>{"use strict";Ae.exports=require("https")},1808:Ae=>{"use strict";Ae.exports=require("net")},2037:Ae=>{"use strict";Ae.exports=require("os")},1017:Ae=>{"use strict";Ae.exports=require("path")},7282:Ae=>{"use strict";Ae.exports=require("process")},2781:Ae=>{"use strict";Ae.exports=require("stream")},1576:Ae=>{"use strict";Ae.exports=require("string_decoder")},9512:Ae=>{"use strict";Ae.exports=require("timers")},4404:Ae=>{"use strict";Ae.exports=require("tls")},6224:Ae=>{"use strict";Ae.exports=require("tty")},7310:Ae=>{"use strict";Ae.exports=require("url")},3837:Ae=>{"use strict";Ae.exports=require("util")},9796:Ae=>{"use strict";Ae.exports=require("zlib")}};var __webpack_module_cache__={};function __nccwpck_require__(Ae){var ke=__webpack_module_cache__[Ae];if(ke!==undefined){return ke.exports}var Ce=__webpack_module_cache__[Ae]={id:Ae,loaded:false,exports:{}};var qe=true;try{__webpack_modules__[Ae].call(Ce.exports,Ce,Ce.exports,__nccwpck_require__);qe=false}finally{if(qe)delete __webpack_module_cache__[Ae]}Ce.loaded=true;return Ce.exports}(()=>{__nccwpck_require__.nmd=Ae=>{Ae.paths=[];if(!Ae.children)Ae.children=[];return Ae}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{const Ae=__nccwpck_require__(2037);const ke=__nccwpck_require__(7147).promises;const Ce=__nccwpck_require__(1017);const qe=__nccwpck_require__(3837);const ze=qe.promisify(__nccwpck_require__(2081).exec);const Ve=__nccwpck_require__(4714);const tt=__nccwpck_require__(4596);const rt=__nccwpck_require__(1779);const nt=__nccwpck_require__(7514);const{stdout:it}=__nccwpck_require__(7282);(async()=>{try{const qe=Ve.getInput("scalr_hostname",{required:true});const ze=Ve.getInput("scalr_token",{required:true});const it=Ve.getInput("terraform_version",{required:true});const ot=Ve.getInput("terraform_wrapper")==="true";Ve.info(`Preparing to download Terraform version ${it}`);const ct=await nt.getRelease("terraform",it);const ht={win32:"windows"}[Ae.platform()]||Ae.platform();const ft={x32:"386",x64:"amd64"}[Ae.arch()]||Ae.arch();const mt=ct.getBuild(ht,ft);if(!mt)throw new Error("No matching version found");Ve.info(`Downloading compressed Terraform binary from ${mt.url}`);const yt=await tt.downloadTool(mt.url);if(!yt)throw new Error("Failed to download Terraform");Ve.info("Decompressing Terraform binary");const Et=await tt.extractZip(yt);if(!Et)throw new Error("Failed to decompress Terraform");Ve.info("Add Terraform to PATH");Ve.addPath(Et);if(ot){Ve.info("Rename Terraform binary to make way for the wrapper");const ke=Ae.platform().startsWith("win")?".exe":"";let qe=[Et,`terraform${ke}`].join(Ce.sep);let ze=[Et,`terraform-bin${ke}`].join(Ce.sep);await rt.mv(qe,ze);Ve.info("Install wrapper to forward Terraform output to future actions");qe=Ce.resolve([__dirname,"..","wrapper","index.js"].join(Ce.sep));ze=[Et,"terraform"].join(Ce.sep);await rt.cp(qe,ze)}let kt=process.env.TF_CLI_CONFIG_FILE;if(!kt)kt=ht=="windows"?`${process.env.APPDATA}/terraform.rc`:`${process.env.HOME}/.terraformrc`;Ve.info(`Generating Terraform credentials file at ${kt}`);await rt.mkdirP(Ce.dirname(kt));await ke.writeFile(kt,`credentials "${qe}" {\n token = "${ze}"\n}`)}catch(Ae){Ve.setFailed(Ae.message)}})()})();module.exports=__webpack_exports__})(); \ No newline at end of file