From bc0f6440932bcbbdf1ca24147d26fc789af2de11 Mon Sep 17 00:00:00 2001 From: TransparentLC Date: Sun, 29 Sep 2024 16:21:48 +0000 Subject: [PATCH] deploy: e65b6c913573c5ed63cea89732b1a402d7524e4b --- ...MVBxJQ.js => bn.interface.min-BM1yc8Pi.js} | 2 +- ...{bn.min-BPUEMPhn.js => bn.min-S9Cz8dhG.js} | 2 +- ...n-BeOSrg7m.js => elliptic.min-ClIauaBs.js} | 2 +- .../{index-B8A58fJZ.js => index-CSDXfIin.js} | 29 ++++++++++--------- index.html | 2 +- 5 files changed, 19 insertions(+), 18 deletions(-) rename assets/{bn.interface.min-BwMVBxJQ.js => bn.interface.min-BM1yc8Pi.js} (96%) rename assets/{bn.min-BPUEMPhn.js => bn.min-S9Cz8dhG.js} (99%) rename assets/{elliptic.min-BeOSrg7m.js => elliptic.min-ClIauaBs.js} (99%) rename assets/{index-B8A58fJZ.js => index-CSDXfIin.js} (66%) diff --git a/assets/bn.interface.min-BwMVBxJQ.js b/assets/bn.interface.min-BM1yc8Pi.js similarity index 96% rename from assets/bn.interface.min-BwMVBxJQ.js rename to assets/bn.interface.min-BM1yc8Pi.js index 6819afe..4ae4868 100644 --- a/assets/bn.interface.min-BwMVBxJQ.js +++ b/assets/bn.interface.min-BM1yc8Pi.js @@ -1 +1 @@ -import t from"./bn.min-BPUEMPhn.js";import"./index-B8A58fJZ.js";/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */class i{constructor(e){if(e===void 0)throw Error("Invalid BigInteger input");this.value=new t(e)}clone(){const e=new i(null);return this.value.copy(e.value),e}iinc(){return this.value.iadd(new t(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new t(1)),this}dec(){return this.clone().idec()}iadd(e){return this.value.iadd(e.value),this}add(e){return this.clone().iadd(e)}isub(e){return this.value.isub(e.value),this}sub(e){return this.clone().isub(e)}imul(e){return this.value.imul(e.value),this}mul(e){return this.clone().imul(e)}imod(e){return this.value=this.value.umod(e.value),this}mod(e){return this.clone().imod(e)}modExp(e,r){const n=r.isEven()?t.red(r.value):t.mont(r.value),u=this.clone();return u.value=u.value.toRed(n).redPow(e.value).fromRed(),u}modInv(e){if(!this.gcd(e).isOne())throw Error("Inverse does not exist");return new i(this.value.invm(e.value))}gcd(e){return new i(this.value.gcd(e.value))}ileftShift(e){return this.value.ishln(e.value.toNumber()),this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value.ishrn(e.value.toNumber()),this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value.eq(e.value)}lt(e){return this.value.lt(e.value)}lte(e){return this.value.lte(e.value)}gt(e){return this.value.gt(e.value)}gte(e){return this.value.gte(e.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new t(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const e=this.clone();return e.value=e.value.abs(),e}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(e){return this.value.testn(e)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(e="be",r){return this.value.toArrayLike(Uint8Array,e,r)}}export{i as default}; +import t from"./bn.min-S9Cz8dhG.js";import"./index-CSDXfIin.js";/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */class i{constructor(e){if(e===void 0)throw Error("Invalid BigInteger input");this.value=new t(e)}clone(){const e=new i(null);return this.value.copy(e.value),e}iinc(){return this.value.iadd(new t(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new t(1)),this}dec(){return this.clone().idec()}iadd(e){return this.value.iadd(e.value),this}add(e){return this.clone().iadd(e)}isub(e){return this.value.isub(e.value),this}sub(e){return this.clone().isub(e)}imul(e){return this.value.imul(e.value),this}mul(e){return this.clone().imul(e)}imod(e){return this.value=this.value.umod(e.value),this}mod(e){return this.clone().imod(e)}modExp(e,r){const n=r.isEven()?t.red(r.value):t.mont(r.value),u=this.clone();return u.value=u.value.toRed(n).redPow(e.value).fromRed(),u}modInv(e){if(!this.gcd(e).isOne())throw Error("Inverse does not exist");return new i(this.value.invm(e.value))}gcd(e){return new i(this.value.gcd(e.value))}ileftShift(e){return this.value.ishln(e.value.toNumber()),this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value.ishrn(e.value.toNumber()),this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value.eq(e.value)}lt(e){return this.value.lt(e.value)}lte(e){return this.value.lte(e.value)}gt(e){return this.value.gt(e.value)}gte(e){return this.value.gte(e.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new t(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const e=this.clone();return e.value=e.value.abs(),e}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(e){return this.value.testn(e)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(e="be",r){return this.value.toArrayLike(Uint8Array,e,r)}}export{i as default}; diff --git a/assets/bn.min-BPUEMPhn.js b/assets/bn.min-S9Cz8dhG.js similarity index 99% rename from assets/bn.min-BPUEMPhn.js rename to assets/bn.min-S9Cz8dhG.js index 0f0563c..3b92f46 100644 --- a/assets/bn.min-BPUEMPhn.js +++ b/assets/bn.min-S9Cz8dhG.js @@ -1 +1 @@ -import{r as ei,t as si}from"./index-B8A58fJZ.js";/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */var ui=ei(function(ii){(function(qt,ri){function m(t,h){if(!t)throw Error(h||"Assertion failed")}function et(t,h){t.super_=h;var e=function(){};e.prototype=h.prototype,t.prototype=new e,t.prototype.constructor=t}function s(t,h,e){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,t!==null&&(h!=="le"&&h!=="be"||(e=h,h=10),this._init(t||0,h||10,e||"be"))}var ot;typeof qt=="object"?qt.exports=s:ri.BN=s,s.BN=s,s.wordSize=26;try{ot=void 0}catch{}function Bt(t,h,e){for(var r=0,i=Math.min(t.length,e),n=h;n=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return r}function Nt(t,h,e,r){for(var i=0,n=Math.min(t.length,e),o=h;o=49?l-49+10:l>=17?l-17+10:l}return i}s.isBN=function(t){return t instanceof s||t!==null&&typeof t=="object"&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,h){return t.cmp(h)>0?t:h},s.min=function(t,h){return t.cmp(h)<0?t:h},s.prototype._init=function(t,h,e){if(typeof t=="number")return this._initNumber(t,h,e);if(typeof t=="object")return this._initArray(t,h,e);h==="hex"&&(h=16),m(h===(0|h)&&h>=2&&h<=36);var r=0;(t=t.toString().replace(/\s+/g,""))[0]==="-"&&r++,h===16?this._parseHex(t,r):this._parseBase(t,h,r),t[0]==="-"&&(this.negative=1),this.strip(),e==="le"&&this._initArray(this.toArray(),h,e)},s.prototype._initNumber=function(t,h,e){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(m(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),e==="le"&&this._initArray(this.toArray(),h,e)},s.prototype._initArray=function(t,h,e){if(m(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var r=0;r=0;r-=3)n=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[i]|=n<>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if(e==="le")for(r=0,i=0;r>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},s.prototype._parseHex=function(t,h){this.length=Math.ceil((t.length-h)/6),this.words=Array(this.length);for(var e=0;e=h;e-=6)i=Bt(t,e,e+6),this.words[r]|=i<>>26-n&4194303,(n+=24)>=26&&(n-=26,r++);e+6!==h&&(i=Bt(t,h,e+6),this.words[r]|=i<>>26-n&4194303),this.strip()},s.prototype._parseBase=function(t,h,e){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=h)r++;r--,i=i/h|0;for(var n=t.length-e,o=n%r,l=Math.min(n,n-o)+e,a=0,u=e;u1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var Lt=["","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"],hi=[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],ni=[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 It(t,h,e){e.negative=h.negative^t.negative;var r=t.length+h.length|0;e.length=r,r=r-1|0;var i=0|t.words[0],n=0|h.words[0],o=i*n,l=67108863&o,a=o/67108864|0;e.words[0]=l;for(var u=1;u>>26,d=67108863&a,p=Math.min(u,h.length-1),M=Math.max(0,u-t.length+1);M<=p;M++){var v=u-M|0;f+=(o=(i=0|t.words[v])*(n=0|h.words[M])+d)/67108864|0,d=67108863&o}e.words[u]=0|d,a=0|f}return a!==0?e.words[u]=0|a:e.length--,e.strip()}s.prototype.toString=function(t,h){var e;if(h=0|h||1,(t=t||10)===16||t==="hex"){e="";for(var r=0,i=0,n=0;n>>24-r&16777215)!==0||n!==this.length-1?Lt[6-l.length]+l+e:l+e,(r+=2)>=26&&(r-=26,n--)}for(i!==0&&(e=i.toString(16)+e);e.length%h!=0;)e="0"+e;return this.negative!==0&&(e="-"+e),e}if(t===(0|t)&&t>=2&&t<=36){var a=hi[t],u=ni[t];e="";var f=this.clone();for(f.negative=0;!f.isZero();){var d=f.modn(u).toString(t);e=(f=f.idivn(u)).isZero()?d+e:Lt[a-d.length]+d+e}for(this.isZero()&&(e="0"+e);e.length%h!=0;)e="0"+e;return this.negative!==0&&(e="-"+e),e}m(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=67108864*this.words[1]:this.length===3&&this.words[2]===1?t+=4503599627370496+67108864*this.words[1]:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,h){return m(ot!==void 0),this.toArrayLike(ot,t,h)},s.prototype.toArray=function(t,h){return this.toArrayLike(Array,t,h)},s.prototype.toArrayLike=function(t,h,e){var r=this.byteLength(),i=e||Math.max(1,r);m(r<=i,"byte array longer than desired length"),m(i>0,"Requested array length <= 0"),this.strip();var n,o,l=h==="le",a=new t(i),u=this.clone();if(l){for(o=0;!u.isZero();o++)n=u.andln(255),u.iushrn(8),a[o]=n;for(;o=4096&&(e+=13,h>>>=13),h>=64&&(e+=7,h>>>=7),h>=8&&(e+=4,h>>>=4),h>=2&&(e+=2,h>>>=2),e+h},s.prototype._zeroBits=function(t){if(t===0)return 26;var h=t,e=0;return!(8191&h)&&(e+=13,h>>>=13),!(127&h)&&(e+=7,h>>>=7),!(15&h)&&(e+=4,h>>>=4),!(3&h)&&(e+=2,h>>>=2),!(1&h)&&e++,e},s.prototype.bitLength=function(){var t=this.words[this.length-1],h=this._countBits(t);return 26*(this.length-1)+h},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,h=0;ht.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var h;h=this.length>t.length?t:this;for(var e=0;et.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var h,e;this.length>t.length?(h=this,e=t):(h=t,e=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){m(typeof t=="number"&&t>=0);var h=0|Math.ceil(t/26),e=t%26;this._expand(h),e>0&&h--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-e),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,h){m(typeof t=="number"&&t>=0);var e=t/26|0,r=t%26;return this._expand(e+1),this.words[e]=h?this.words[e]|1<t.length?(e=this,r=t):(e=t,r=this);for(var i=0,n=0;n>>26;for(;i!==0&&n>>26;if(this.length=e.length,i!==0)this.words[this.length]=i,this.length++;else if(e!==this)for(;nt.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var h=this.iadd(t);return t.negative=1,h._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var e,r,i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var n=0,o=0;o>26,this.words[o]=67108863&h;for(;n!==0&&o>26,this.words[o]=67108863&h;if(n===0&&o>>13,M=0|o[1],v=8191&M,g=M>>>13,rt=0|o[2],c=8191&rt,w=rt>>>13,jt=0|o[3],b=8191&jt,_=jt>>>13,Kt=0|o[4],k=8191&Kt,A=Kt>>>13,Pt=0|o[5],x=8191&Pt,S=Pt>>>13,Ft=0|o[6],Z=8191&Ft,R=Ft>>>13,Ct=0|o[7],q=8191&Ct,B=Ct>>>13,Dt=0|o[8],N=8191&Dt,L=Dt>>>13,Ht=0|o[9],I=8191&Ht,z=Ht>>>13,Jt=0|l[0],E=8191&Jt,T=Jt>>>13,Ut=0|l[1],O=8191&Ut,j=Ut>>>13,Gt=0|l[2],K=8191&Gt,P=Gt>>>13,Qt=0|l[3],F=8191&Qt,C=Qt>>>13,Vt=0|l[4],D=8191&Vt,H=Vt>>>13,Wt=0|l[5],J=8191&Wt,U=Wt>>>13,Xt=0|l[6],G=8191&Xt,Q=Xt>>>13,Yt=0|l[7],V=8191&Yt,W=Yt>>>13,$t=0|l[8],X=8191&$t,Y=$t>>>13,ti=0|l[9],$=8191&ti,tt=ti>>>13;e.negative=t.negative^h.negative,e.length=19;var lt=(u+(r=Math.imul(d,E))|0)+((8191&(i=(i=Math.imul(d,T))+Math.imul(p,E)|0))<<13)|0;u=((n=Math.imul(p,T))+(i>>>13)|0)+(lt>>>26)|0,lt&=67108863,r=Math.imul(v,E),i=(i=Math.imul(v,T))+Math.imul(g,E)|0,n=Math.imul(g,T);var mt=(u+(r=r+Math.imul(d,O)|0)|0)+((8191&(i=(i=i+Math.imul(d,j)|0)+Math.imul(p,O)|0))<<13)|0;u=((n=n+Math.imul(p,j)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(c,E),i=(i=Math.imul(c,T))+Math.imul(w,E)|0,n=Math.imul(w,T),r=r+Math.imul(v,O)|0,i=(i=i+Math.imul(v,j)|0)+Math.imul(g,O)|0,n=n+Math.imul(g,j)|0;var ft=(u+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,P)|0)+Math.imul(p,K)|0))<<13)|0;u=((n=n+Math.imul(p,P)|0)+(i>>>13)|0)+(ft>>>26)|0,ft&=67108863,r=Math.imul(b,E),i=(i=Math.imul(b,T))+Math.imul(_,E)|0,n=Math.imul(_,T),r=r+Math.imul(c,O)|0,i=(i=i+Math.imul(c,j)|0)+Math.imul(w,O)|0,n=n+Math.imul(w,j)|0,r=r+Math.imul(v,K)|0,i=(i=i+Math.imul(v,P)|0)+Math.imul(g,K)|0,n=n+Math.imul(g,P)|0;var dt=(u+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,C)|0)+Math.imul(p,F)|0))<<13)|0;u=((n=n+Math.imul(p,C)|0)+(i>>>13)|0)+(dt>>>26)|0,dt&=67108863,r=Math.imul(k,E),i=(i=Math.imul(k,T))+Math.imul(A,E)|0,n=Math.imul(A,T),r=r+Math.imul(b,O)|0,i=(i=i+Math.imul(b,j)|0)+Math.imul(_,O)|0,n=n+Math.imul(_,j)|0,r=r+Math.imul(c,K)|0,i=(i=i+Math.imul(c,P)|0)+Math.imul(w,K)|0,n=n+Math.imul(w,P)|0,r=r+Math.imul(v,F)|0,i=(i=i+Math.imul(v,C)|0)+Math.imul(g,F)|0,n=n+Math.imul(g,C)|0;var pt=(u+(r=r+Math.imul(d,D)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(p,D)|0))<<13)|0;u=((n=n+Math.imul(p,H)|0)+(i>>>13)|0)+(pt>>>26)|0,pt&=67108863,r=Math.imul(x,E),i=(i=Math.imul(x,T))+Math.imul(S,E)|0,n=Math.imul(S,T),r=r+Math.imul(k,O)|0,i=(i=i+Math.imul(k,j)|0)+Math.imul(A,O)|0,n=n+Math.imul(A,j)|0,r=r+Math.imul(b,K)|0,i=(i=i+Math.imul(b,P)|0)+Math.imul(_,K)|0,n=n+Math.imul(_,P)|0,r=r+Math.imul(c,F)|0,i=(i=i+Math.imul(c,C)|0)+Math.imul(w,F)|0,n=n+Math.imul(w,C)|0,r=r+Math.imul(v,D)|0,i=(i=i+Math.imul(v,H)|0)+Math.imul(g,D)|0,n=n+Math.imul(g,H)|0;var Mt=(u+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,U)|0)+Math.imul(p,J)|0))<<13)|0;u=((n=n+Math.imul(p,U)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(Z,E),i=(i=Math.imul(Z,T))+Math.imul(R,E)|0,n=Math.imul(R,T),r=r+Math.imul(x,O)|0,i=(i=i+Math.imul(x,j)|0)+Math.imul(S,O)|0,n=n+Math.imul(S,j)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,P)|0)+Math.imul(A,K)|0,n=n+Math.imul(A,P)|0,r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,C)|0)+Math.imul(_,F)|0,n=n+Math.imul(_,C)|0,r=r+Math.imul(c,D)|0,i=(i=i+Math.imul(c,H)|0)+Math.imul(w,D)|0,n=n+Math.imul(w,H)|0,r=r+Math.imul(v,J)|0,i=(i=i+Math.imul(v,U)|0)+Math.imul(g,J)|0,n=n+Math.imul(g,U)|0;var vt=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,Q)|0)+Math.imul(p,G)|0))<<13)|0;u=((n=n+Math.imul(p,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(q,E),i=(i=Math.imul(q,T))+Math.imul(B,E)|0,n=Math.imul(B,T),r=r+Math.imul(Z,O)|0,i=(i=i+Math.imul(Z,j)|0)+Math.imul(R,O)|0,n=n+Math.imul(R,j)|0,r=r+Math.imul(x,K)|0,i=(i=i+Math.imul(x,P)|0)+Math.imul(S,K)|0,n=n+Math.imul(S,P)|0,r=r+Math.imul(k,F)|0,i=(i=i+Math.imul(k,C)|0)+Math.imul(A,F)|0,n=n+Math.imul(A,C)|0,r=r+Math.imul(b,D)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(_,D)|0,n=n+Math.imul(_,H)|0,r=r+Math.imul(c,J)|0,i=(i=i+Math.imul(c,U)|0)+Math.imul(w,J)|0,n=n+Math.imul(w,U)|0,r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(g,G)|0,n=n+Math.imul(g,Q)|0;var gt=(u+(r=r+Math.imul(d,V)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(p,V)|0))<<13)|0;u=((n=n+Math.imul(p,W)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(N,E),i=(i=Math.imul(N,T))+Math.imul(L,E)|0,n=Math.imul(L,T),r=r+Math.imul(q,O)|0,i=(i=i+Math.imul(q,j)|0)+Math.imul(B,O)|0,n=n+Math.imul(B,j)|0,r=r+Math.imul(Z,K)|0,i=(i=i+Math.imul(Z,P)|0)+Math.imul(R,K)|0,n=n+Math.imul(R,P)|0,r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,C)|0)+Math.imul(S,F)|0,n=n+Math.imul(S,C)|0,r=r+Math.imul(k,D)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(A,D)|0,n=n+Math.imul(A,H)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,U)|0)+Math.imul(_,J)|0,n=n+Math.imul(_,U)|0,r=r+Math.imul(c,G)|0,i=(i=i+Math.imul(c,Q)|0)+Math.imul(w,G)|0,n=n+Math.imul(w,Q)|0,r=r+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(g,V)|0,n=n+Math.imul(g,W)|0;var ct=(u+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(p,X)|0))<<13)|0;u=((n=n+Math.imul(p,Y)|0)+(i>>>13)|0)+(ct>>>26)|0,ct&=67108863,r=Math.imul(I,E),i=(i=Math.imul(I,T))+Math.imul(z,E)|0,n=Math.imul(z,T),r=r+Math.imul(N,O)|0,i=(i=i+Math.imul(N,j)|0)+Math.imul(L,O)|0,n=n+Math.imul(L,j)|0,r=r+Math.imul(q,K)|0,i=(i=i+Math.imul(q,P)|0)+Math.imul(B,K)|0,n=n+Math.imul(B,P)|0,r=r+Math.imul(Z,F)|0,i=(i=i+Math.imul(Z,C)|0)+Math.imul(R,F)|0,n=n+Math.imul(R,C)|0,r=r+Math.imul(x,D)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(S,D)|0,n=n+Math.imul(S,H)|0,r=r+Math.imul(k,J)|0,i=(i=i+Math.imul(k,U)|0)+Math.imul(A,J)|0,n=n+Math.imul(A,U)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(_,G)|0,n=n+Math.imul(_,Q)|0,r=r+Math.imul(c,V)|0,i=(i=i+Math.imul(c,W)|0)+Math.imul(w,V)|0,n=n+Math.imul(w,W)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(g,X)|0,n=n+Math.imul(g,Y)|0;var wt=(u+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(p,$)|0))<<13)|0;u=((n=n+Math.imul(p,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,O),i=(i=Math.imul(I,j))+Math.imul(z,O)|0,n=Math.imul(z,j),r=r+Math.imul(N,K)|0,i=(i=i+Math.imul(N,P)|0)+Math.imul(L,K)|0,n=n+Math.imul(L,P)|0,r=r+Math.imul(q,F)|0,i=(i=i+Math.imul(q,C)|0)+Math.imul(B,F)|0,n=n+Math.imul(B,C)|0,r=r+Math.imul(Z,D)|0,i=(i=i+Math.imul(Z,H)|0)+Math.imul(R,D)|0,n=n+Math.imul(R,H)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,U)|0)+Math.imul(S,J)|0,n=n+Math.imul(S,U)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(A,G)|0,n=n+Math.imul(A,Q)|0,r=r+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,r=r+Math.imul(c,X)|0,i=(i=i+Math.imul(c,Y)|0)+Math.imul(w,X)|0,n=n+Math.imul(w,Y)|0;var yt=(u+(r=r+Math.imul(v,$)|0)|0)+((8191&(i=(i=i+Math.imul(v,tt)|0)+Math.imul(g,$)|0))<<13)|0;u=((n=n+Math.imul(g,tt)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(I,K),i=(i=Math.imul(I,P))+Math.imul(z,K)|0,n=Math.imul(z,P),r=r+Math.imul(N,F)|0,i=(i=i+Math.imul(N,C)|0)+Math.imul(L,F)|0,n=n+Math.imul(L,C)|0,r=r+Math.imul(q,D)|0,i=(i=i+Math.imul(q,H)|0)+Math.imul(B,D)|0,n=n+Math.imul(B,H)|0,r=r+Math.imul(Z,J)|0,i=(i=i+Math.imul(Z,U)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,U)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,Q)|0)+Math.imul(S,G)|0,n=n+Math.imul(S,Q)|0,r=r+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(A,V)|0,n=n+Math.imul(A,W)|0,r=r+Math.imul(b,X)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0;var bt=(u+(r=r+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(w,$)|0))<<13)|0;u=((n=n+Math.imul(w,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(I,F),i=(i=Math.imul(I,C))+Math.imul(z,F)|0,n=Math.imul(z,C),r=r+Math.imul(N,D)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(L,D)|0,n=n+Math.imul(L,H)|0,r=r+Math.imul(q,J)|0,i=(i=i+Math.imul(q,U)|0)+Math.imul(B,J)|0,n=n+Math.imul(B,U)|0,r=r+Math.imul(Z,G)|0,i=(i=i+Math.imul(Z,Q)|0)+Math.imul(R,G)|0,n=n+Math.imul(R,Q)|0,r=r+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(A,X)|0,n=n+Math.imul(A,Y)|0;var _t=(u+(r=r+Math.imul(b,$)|0)|0)+((8191&(i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0))<<13)|0;u=((n=n+Math.imul(_,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,D),i=(i=Math.imul(I,H))+Math.imul(z,D)|0,n=Math.imul(z,H),r=r+Math.imul(N,J)|0,i=(i=i+Math.imul(N,U)|0)+Math.imul(L,J)|0,n=n+Math.imul(L,U)|0,r=r+Math.imul(q,G)|0,i=(i=i+Math.imul(q,Q)|0)+Math.imul(B,G)|0,n=n+Math.imul(B,Q)|0,r=r+Math.imul(Z,V)|0,i=(i=i+Math.imul(Z,W)|0)+Math.imul(R,V)|0,n=n+Math.imul(R,W)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0;var kt=(u+(r=r+Math.imul(k,$)|0)|0)+((8191&(i=(i=i+Math.imul(k,tt)|0)+Math.imul(A,$)|0))<<13)|0;u=((n=n+Math.imul(A,tt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(I,J),i=(i=Math.imul(I,U))+Math.imul(z,J)|0,n=Math.imul(z,U),r=r+Math.imul(N,G)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(L,G)|0,n=n+Math.imul(L,Q)|0,r=r+Math.imul(q,V)|0,i=(i=i+Math.imul(q,W)|0)+Math.imul(B,V)|0,n=n+Math.imul(B,W)|0,r=r+Math.imul(Z,X)|0,i=(i=i+Math.imul(Z,Y)|0)+Math.imul(R,X)|0,n=n+Math.imul(R,Y)|0;var At=(u+(r=r+Math.imul(x,$)|0)|0)+((8191&(i=(i=i+Math.imul(x,tt)|0)+Math.imul(S,$)|0))<<13)|0;u=((n=n+Math.imul(S,tt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(I,G),i=(i=Math.imul(I,Q))+Math.imul(z,G)|0,n=Math.imul(z,Q),r=r+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,n=n+Math.imul(L,W)|0,r=r+Math.imul(q,X)|0,i=(i=i+Math.imul(q,Y)|0)+Math.imul(B,X)|0,n=n+Math.imul(B,Y)|0;var xt=(u+(r=r+Math.imul(Z,$)|0)|0)+((8191&(i=(i=i+Math.imul(Z,tt)|0)+Math.imul(R,$)|0))<<13)|0;u=((n=n+Math.imul(R,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(I,V),i=(i=Math.imul(I,W))+Math.imul(z,V)|0,n=Math.imul(z,W),r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(L,X)|0,n=n+Math.imul(L,Y)|0;var St=(u+(r=r+Math.imul(q,$)|0)|0)+((8191&(i=(i=i+Math.imul(q,tt)|0)+Math.imul(B,$)|0))<<13)|0;u=((n=n+Math.imul(B,tt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(I,X),i=(i=Math.imul(I,Y))+Math.imul(z,X)|0,n=Math.imul(z,Y);var Zt=(u+(r=r+Math.imul(N,$)|0)|0)+((8191&(i=(i=i+Math.imul(N,tt)|0)+Math.imul(L,$)|0))<<13)|0;u=((n=n+Math.imul(L,tt)|0)+(i>>>13)|0)+(Zt>>>26)|0,Zt&=67108863;var Rt=(u+(r=Math.imul(I,$))|0)+((8191&(i=(i=Math.imul(I,tt))+Math.imul(z,$)|0))<<13)|0;return u=((n=Math.imul(z,tt))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,a[0]=lt,a[1]=mt,a[2]=ft,a[3]=dt,a[4]=pt,a[5]=Mt,a[6]=vt,a[7]=gt,a[8]=ct,a[9]=wt,a[10]=yt,a[11]=bt,a[12]=_t,a[13]=kt,a[14]=At,a[15]=xt,a[16]=St,a[17]=Zt,a[18]=Rt,u!==0&&(a[19]=u,e.length++),e};function Et(t,h,e){return new ht().mulp(t,h,e)}function ht(t,h){this.x=t,this.y=h}Math.imul||(zt=It),s.prototype.mulTo=function(t,h){var e,r=this.length+t.length;return e=this.length===10&&t.length===10?zt(this,t,h):r<63?It(this,t,h):r<1024?function(i,n,o){o.negative=n.negative^i.negative,o.length=i.length+n.length;for(var l=0,a=0,u=0;u>>26)|0)>>>26,f&=67108863}o.words[u]=d,l=f,f=a}return l!==0?o.words[u]=l:o.length--,o.strip()}(this,t,h):Et(this,t,h),e},ht.prototype.makeRBT=function(t){for(var h=Array(t),e=s.prototype._countBits(t)-1,r=0;r>=1;return r},ht.prototype.permute=function(t,h,e,r,i,n){for(var o=0;o>>=1)i++;return 1<>>=13,e[2*n+1]=8191&i,i>>>=13;for(n=2*h;n>=26,h+=r/67108864|0,h+=i>>>26,this.words[e]=67108863&i}return h!==0&&(this.words[e]=h,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var h=function(n){for(var o=Array(n.bitLength()),l=0;l>>u}return o}(t);if(h.length===0)return new s(1);for(var e=this,r=0;r=0);var h,e=t%26,r=(t-e)/26,i=67108863>>>26-e<<26-e;if(e!==0){var n=0;for(h=0;h>>26-e}n&&(this.words[h]=n,this.length++)}if(r!==0){for(h=this.length-1;h>=0;h--)this.words[h+r]=this.words[h];for(h=0;h=0),r=h?(h-h%26)/26:0;var i=t%26,n=Math.min((t-i)/26,this.length),o=67108863^67108863>>>i<n)for(this.length-=n,a=0;a=0&&(u!==0||a>=r);a--){var f=0|this.words[a];this.words[a]=u<<26-i|f>>>i,u=f&o}return l&&u!==0&&(l.words[l.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,h,e){return m(this.negative===0),this.iushrn(t,h,e)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){m(typeof t=="number"&&t>=0);var h=t%26,e=(t-h)/26,r=1<=0);var h=t%26,e=(t-h)/26;if(m(this.negative===0,"imaskn works only with positive numbers"),this.length<=e)return this;if(h!==0&&e++,this.length=Math.min(e,this.length),h!==0){var r=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(t){if(m(typeof t=="number"),m(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-(l/67108864|0),this.words[r+e]=67108863&i}for(;r>26,this.words[r+e]=67108863&i;if(o===0)return this.strip();for(m(o===-1),o=0,r=0;r>26,this.words[r]=67108863&i;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,h){var e=(this.length,t.length),r=this.clone(),i=t,n=0|i.words[i.length-1];(e=26-this._countBits(n))!==0&&(i=i.ushln(e),r.iushln(e),n=0|i.words[i.length-1]);var o,l=r.length-i.length;if(h!=="mod"){(o=new s(null)).length=l+1,o.words=Array(o.length);for(var a=0;a=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/n|0,67108863),r._ishlnsubmul(i,d,f);r.negative!==0;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);o&&(o.words[f]=d)}return o&&o.strip(),r.strip(),h!=="div"&&e!==0&&r.iushrn(e),{div:o||null,mod:r}},s.prototype.divmod=function(t,h,e){return m(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:this.negative!==0&&t.negative===0?(n=this.neg().divmod(t,h),h!=="mod"&&(r=n.div.neg()),h!=="div"&&(i=n.mod.neg(),e&&i.negative!==0&&i.iadd(t)),{div:r,mod:i}):this.negative===0&&t.negative!==0?(n=this.divmod(t.neg(),h),h!=="mod"&&(r=n.div.neg()),{div:r,mod:n.mod}):this.negative&t.negative?(n=this.neg().divmod(t.neg(),h),h!=="div"&&(i=n.mod.neg(),e&&i.negative!==0&&i.isub(t)),{div:n.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:t.length===1?h==="div"?{div:this.divn(t.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,h);var r,i,n},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var h=this.divmod(t);if(h.mod.isZero())return h.div;var e=h.div.negative!==0?h.mod.isub(t):h.mod,r=t.ushrn(1),i=t.andln(1),n=e.cmp(r);return n<0||i===1&&n===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modn=function(t){m(t<=67108863);for(var h=(1<<26)%t,e=0,r=this.length-1;r>=0;r--)e=(h*e+(0|this.words[r]))%t;return e},s.prototype.idivn=function(t){m(t<=67108863);for(var h=0,e=this.length-1;e>=0;e--){var r=(0|this.words[e])+67108864*h;this.words[e]=r/t|0,h=r%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){m(t.negative===0),m(!t.isZero());var h=this,e=t.clone();h=h.negative!==0?h.umod(t):h.clone();for(var r=new s(1),i=new s(0),n=new s(0),o=new s(1),l=0;h.isEven()&&e.isEven();)h.iushrn(1),e.iushrn(1),++l;for(var a=e.clone(),u=h.clone();!h.isZero();){for(var f=0,d=1;!(h.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(h.iushrn(f);f-- >0;)(r.isOdd()||i.isOdd())&&(r.iadd(a),i.isub(u)),r.iushrn(1),i.iushrn(1);for(var p=0,M=1;!(e.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(e.iushrn(p);p-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(a),o.isub(u)),n.iushrn(1),o.iushrn(1);h.cmp(e)>=0?(h.isub(e),r.isub(n),i.isub(o)):(e.isub(h),n.isub(r),o.isub(i))}return{a:n,b:o,gcd:e.iushln(l)}},s.prototype._invmp=function(t){m(t.negative===0),m(!t.isZero());var h=this,e=t.clone();h=h.negative!==0?h.umod(t):h.clone();for(var r,i=new s(1),n=new s(0),o=e.clone();h.cmpn(1)>0&&e.cmpn(1)>0;){for(var l=0,a=1;!(h.words[0]&a)&&l<26;++l,a<<=1);if(l>0)for(h.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(o),i.iushrn(1);for(var u=0,f=1;!(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)n.isOdd()&&n.iadd(o),n.iushrn(1);h.cmp(e)>=0?(h.isub(e),i.isub(n)):(e.isub(h),n.isub(i))}return(r=h.cmpn(1)===0?i:n).cmpn(0)<0&&r.iadd(t),r},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var h=this.clone(),e=t.clone();h.negative=0,e.negative=0;for(var r=0;h.isEven()&&e.isEven();r++)h.iushrn(1),e.iushrn(1);for(;;){for(;h.isEven();)h.iushrn(1);for(;e.isEven();)e.iushrn(1);var i=h.cmp(e);if(i<0){var n=h;h=e,e=n}else if(i===0||e.cmpn(1)===0)break;h.isub(e)}return e.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){m(typeof t=="number");var h=t%26,e=(t-h)/26,r=1<>>26,o&=67108863,this.words[n]=o}return i!==0&&(this.words[n]=i,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(t){var h,e=t<0;if(this.negative!==0&&!e)return-1;if(this.negative===0&&e)return 1;if(this.strip(),this.length>1)h=1;else{e&&(t=-t),m(t<=67108863,"Number is too big");var r=0|this.words[0];h=r===t?0:rt.length)return 1;if(this.length=0;e--){var r=0|this.words[e],i=0|t.words[e];if(r!==i){ri&&(h=1);break}}return h},s.prototype.gtn=function(t){return this.cmpn(t)===1},s.prototype.gt=function(t){return this.cmp(t)===1},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return this.cmpn(t)===-1},s.prototype.lt=function(t){return this.cmp(t)===-1},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return this.cmpn(t)===0},s.prototype.eq=function(t){return this.cmp(t)===0},s.red=function(t){return new y(t)},s.prototype.toRed=function(t){return m(!this.red,"Already a number in reduction context"),m(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return m(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return m(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var ut={k256:null,p224:null,p192:null,p25519:null};function it(t,h){this.name=t,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function st(){it.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Tt(){it.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function Ot(){it.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function at(){it.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if(typeof t=="string"){var h=s._prime(t);this.m=h.p,this.prime=h}else m(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function nt(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}it.prototype._tmp=function(){var t=new s(null);return t.words=Array(Math.ceil(this.n/13)),t},it.prototype.ireduce=function(t){var h,e=t;do this.split(e,this.tmp),h=(e=(e=this.imulK(e)).iadd(this.tmp)).bitLength();while(h>this.n);var r=h0?e.isub(this.p):e.strip(),e},it.prototype.split=function(t,h){t.iushrn(this.n,0,h)},it.prototype.imulK=function(t){return t.imul(this.k)},et(st,it),st.prototype.split=function(t,h){for(var e=4194303,r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,n===0&&t.length>10?t.length-=10:t.length-=9},st.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var h=0,e=0;e>>=26,t.words[e]=i,h=r}return h!==0&&(t.words[t.length++]=h),t},s._prime=function(t){if(ut[t])return ut[t];var h;if(t==="k256")h=new st;else if(t==="p224")h=new Tt;else if(t==="p192")h=new Ot;else{if(t!=="p25519")throw Error("Unknown prime "+t);h=new at}return ut[t]=h,h},y.prototype._verify1=function(t){m(t.negative===0,"red works only with positives"),m(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,h){m((t.negative|h.negative)==0,"red works only with positives"),m(t.red&&t.red===h.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,h){this._verify2(t,h);var e=t.add(h);return e.cmp(this.m)>=0&&e.isub(this.m),e._forceRed(this)},y.prototype.iadd=function(t,h){this._verify2(t,h);var e=t.iadd(h);return e.cmp(this.m)>=0&&e.isub(this.m),e},y.prototype.sub=function(t,h){this._verify2(t,h);var e=t.sub(h);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},y.prototype.isub=function(t,h){this._verify2(t,h);var e=t.isub(h);return e.cmpn(0)<0&&e.iadd(this.m),e},y.prototype.shl=function(t,h){return this._verify1(t),this.imod(t.ushln(h))},y.prototype.imul=function(t,h){return this._verify2(t,h),this.imod(t.imul(h))},y.prototype.mul=function(t,h){return this._verify2(t,h),this.imod(t.mul(h))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var h=this.m.andln(3);if(m(h%2==1),h===3){var e=this.m.add(new s(1)).iushrn(2);return this.pow(t,e)}for(var r=this.m.subn(1),i=0;!r.isZero()&&r.andln(1)===0;)i++,r.iushrn(1);m(!r.isZero());var n=new s(1).toRed(this),o=n.redNeg(),l=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new s(2*a*a).toRed(this);this.pow(a,l).cmp(o)!==0;)a.redIAdd(o);for(var u=this.pow(a,r),f=this.pow(t,r.addn(1).iushrn(1)),d=this.pow(t,r),p=i;d.cmp(n)!==0;){for(var M=d,v=0;M.cmp(n)!==0;v++)M=M.redSqr();m(v=0;r--){for(var a=h.words[r],u=l-1;u>=0;u--){var f=a>>u&1;i!==e[0]&&(i=this.sqr(i)),f!==0||n!==0?(n<<=1,n|=f,(++o===4||r===0&&u===0)&&(i=this.mul(i,e[n]),o=0,n=0)):o=0}l=26}return i},y.prototype.convertTo=function(t){var h=t.umod(this.m);return h===t?h.clone():h},y.prototype.convertFrom=function(t){var h=t.clone();return h.red=null,h},s.mont=function(t){return new nt(t)},et(nt,y),nt.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},nt.prototype.convertFrom=function(t){var h=this.imod(t.mul(this.rinv));return h.red=null,h},nt.prototype.imul=function(t,h){if(t.isZero()||h.isZero())return t.words[0]=0,t.length=1,t;var e=t.imul(h),r=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=e.isub(r).iushrn(this.shift),n=i;return i.cmp(this.m)>=0?n=i.isub(this.m):i.cmpn(0)<0&&(n=i.iadd(this.m)),n._forceRed(this)},nt.prototype.mul=function(t,h){if(t.isZero()||h.isZero())return new s(0)._forceRed(this);var e=t.mul(h),r=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=e.isub(r).iushrn(this.shift),n=i;return i.cmp(this.m)>=0?n=i.isub(this.m):i.cmpn(0)<0&&(n=i.iadd(this.m)),n._forceRed(this)},nt.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}})(ii,si)});export{ui as __moduleExports,ui as default}; +import{r as ei,t as si}from"./index-CSDXfIin.js";/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */var ui=ei(function(ii){(function(qt,ri){function m(t,h){if(!t)throw Error(h||"Assertion failed")}function et(t,h){t.super_=h;var e=function(){};e.prototype=h.prototype,t.prototype=new e,t.prototype.constructor=t}function s(t,h,e){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,t!==null&&(h!=="le"&&h!=="be"||(e=h,h=10),this._init(t||0,h||10,e||"be"))}var ot;typeof qt=="object"?qt.exports=s:ri.BN=s,s.BN=s,s.wordSize=26;try{ot=void 0}catch{}function Bt(t,h,e){for(var r=0,i=Math.min(t.length,e),n=h;n=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return r}function Nt(t,h,e,r){for(var i=0,n=Math.min(t.length,e),o=h;o=49?l-49+10:l>=17?l-17+10:l}return i}s.isBN=function(t){return t instanceof s||t!==null&&typeof t=="object"&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,h){return t.cmp(h)>0?t:h},s.min=function(t,h){return t.cmp(h)<0?t:h},s.prototype._init=function(t,h,e){if(typeof t=="number")return this._initNumber(t,h,e);if(typeof t=="object")return this._initArray(t,h,e);h==="hex"&&(h=16),m(h===(0|h)&&h>=2&&h<=36);var r=0;(t=t.toString().replace(/\s+/g,""))[0]==="-"&&r++,h===16?this._parseHex(t,r):this._parseBase(t,h,r),t[0]==="-"&&(this.negative=1),this.strip(),e==="le"&&this._initArray(this.toArray(),h,e)},s.prototype._initNumber=function(t,h,e){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(m(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),e==="le"&&this._initArray(this.toArray(),h,e)},s.prototype._initArray=function(t,h,e){if(m(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var r=0;r=0;r-=3)n=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[i]|=n<>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if(e==="le")for(r=0,i=0;r>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},s.prototype._parseHex=function(t,h){this.length=Math.ceil((t.length-h)/6),this.words=Array(this.length);for(var e=0;e=h;e-=6)i=Bt(t,e,e+6),this.words[r]|=i<>>26-n&4194303,(n+=24)>=26&&(n-=26,r++);e+6!==h&&(i=Bt(t,h,e+6),this.words[r]|=i<>>26-n&4194303),this.strip()},s.prototype._parseBase=function(t,h,e){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=h)r++;r--,i=i/h|0;for(var n=t.length-e,o=n%r,l=Math.min(n,n-o)+e,a=0,u=e;u1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var Lt=["","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"],hi=[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],ni=[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 It(t,h,e){e.negative=h.negative^t.negative;var r=t.length+h.length|0;e.length=r,r=r-1|0;var i=0|t.words[0],n=0|h.words[0],o=i*n,l=67108863&o,a=o/67108864|0;e.words[0]=l;for(var u=1;u>>26,d=67108863&a,p=Math.min(u,h.length-1),M=Math.max(0,u-t.length+1);M<=p;M++){var v=u-M|0;f+=(o=(i=0|t.words[v])*(n=0|h.words[M])+d)/67108864|0,d=67108863&o}e.words[u]=0|d,a=0|f}return a!==0?e.words[u]=0|a:e.length--,e.strip()}s.prototype.toString=function(t,h){var e;if(h=0|h||1,(t=t||10)===16||t==="hex"){e="";for(var r=0,i=0,n=0;n>>24-r&16777215)!==0||n!==this.length-1?Lt[6-l.length]+l+e:l+e,(r+=2)>=26&&(r-=26,n--)}for(i!==0&&(e=i.toString(16)+e);e.length%h!=0;)e="0"+e;return this.negative!==0&&(e="-"+e),e}if(t===(0|t)&&t>=2&&t<=36){var a=hi[t],u=ni[t];e="";var f=this.clone();for(f.negative=0;!f.isZero();){var d=f.modn(u).toString(t);e=(f=f.idivn(u)).isZero()?d+e:Lt[a-d.length]+d+e}for(this.isZero()&&(e="0"+e);e.length%h!=0;)e="0"+e;return this.negative!==0&&(e="-"+e),e}m(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=67108864*this.words[1]:this.length===3&&this.words[2]===1?t+=4503599627370496+67108864*this.words[1]:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,h){return m(ot!==void 0),this.toArrayLike(ot,t,h)},s.prototype.toArray=function(t,h){return this.toArrayLike(Array,t,h)},s.prototype.toArrayLike=function(t,h,e){var r=this.byteLength(),i=e||Math.max(1,r);m(r<=i,"byte array longer than desired length"),m(i>0,"Requested array length <= 0"),this.strip();var n,o,l=h==="le",a=new t(i),u=this.clone();if(l){for(o=0;!u.isZero();o++)n=u.andln(255),u.iushrn(8),a[o]=n;for(;o=4096&&(e+=13,h>>>=13),h>=64&&(e+=7,h>>>=7),h>=8&&(e+=4,h>>>=4),h>=2&&(e+=2,h>>>=2),e+h},s.prototype._zeroBits=function(t){if(t===0)return 26;var h=t,e=0;return!(8191&h)&&(e+=13,h>>>=13),!(127&h)&&(e+=7,h>>>=7),!(15&h)&&(e+=4,h>>>=4),!(3&h)&&(e+=2,h>>>=2),!(1&h)&&e++,e},s.prototype.bitLength=function(){var t=this.words[this.length-1],h=this._countBits(t);return 26*(this.length-1)+h},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,h=0;ht.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var h;h=this.length>t.length?t:this;for(var e=0;et.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var h,e;this.length>t.length?(h=this,e=t):(h=t,e=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){m(typeof t=="number"&&t>=0);var h=0|Math.ceil(t/26),e=t%26;this._expand(h),e>0&&h--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-e),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,h){m(typeof t=="number"&&t>=0);var e=t/26|0,r=t%26;return this._expand(e+1),this.words[e]=h?this.words[e]|1<t.length?(e=this,r=t):(e=t,r=this);for(var i=0,n=0;n>>26;for(;i!==0&&n>>26;if(this.length=e.length,i!==0)this.words[this.length]=i,this.length++;else if(e!==this)for(;nt.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var h=this.iadd(t);return t.negative=1,h._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var e,r,i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var n=0,o=0;o>26,this.words[o]=67108863&h;for(;n!==0&&o>26,this.words[o]=67108863&h;if(n===0&&o>>13,M=0|o[1],v=8191&M,g=M>>>13,rt=0|o[2],c=8191&rt,w=rt>>>13,jt=0|o[3],b=8191&jt,_=jt>>>13,Kt=0|o[4],k=8191&Kt,A=Kt>>>13,Pt=0|o[5],x=8191&Pt,S=Pt>>>13,Ft=0|o[6],Z=8191&Ft,R=Ft>>>13,Ct=0|o[7],q=8191&Ct,B=Ct>>>13,Dt=0|o[8],N=8191&Dt,L=Dt>>>13,Ht=0|o[9],I=8191&Ht,z=Ht>>>13,Jt=0|l[0],E=8191&Jt,T=Jt>>>13,Ut=0|l[1],O=8191&Ut,j=Ut>>>13,Gt=0|l[2],K=8191&Gt,P=Gt>>>13,Qt=0|l[3],F=8191&Qt,C=Qt>>>13,Vt=0|l[4],D=8191&Vt,H=Vt>>>13,Wt=0|l[5],J=8191&Wt,U=Wt>>>13,Xt=0|l[6],G=8191&Xt,Q=Xt>>>13,Yt=0|l[7],V=8191&Yt,W=Yt>>>13,$t=0|l[8],X=8191&$t,Y=$t>>>13,ti=0|l[9],$=8191&ti,tt=ti>>>13;e.negative=t.negative^h.negative,e.length=19;var lt=(u+(r=Math.imul(d,E))|0)+((8191&(i=(i=Math.imul(d,T))+Math.imul(p,E)|0))<<13)|0;u=((n=Math.imul(p,T))+(i>>>13)|0)+(lt>>>26)|0,lt&=67108863,r=Math.imul(v,E),i=(i=Math.imul(v,T))+Math.imul(g,E)|0,n=Math.imul(g,T);var mt=(u+(r=r+Math.imul(d,O)|0)|0)+((8191&(i=(i=i+Math.imul(d,j)|0)+Math.imul(p,O)|0))<<13)|0;u=((n=n+Math.imul(p,j)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(c,E),i=(i=Math.imul(c,T))+Math.imul(w,E)|0,n=Math.imul(w,T),r=r+Math.imul(v,O)|0,i=(i=i+Math.imul(v,j)|0)+Math.imul(g,O)|0,n=n+Math.imul(g,j)|0;var ft=(u+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,P)|0)+Math.imul(p,K)|0))<<13)|0;u=((n=n+Math.imul(p,P)|0)+(i>>>13)|0)+(ft>>>26)|0,ft&=67108863,r=Math.imul(b,E),i=(i=Math.imul(b,T))+Math.imul(_,E)|0,n=Math.imul(_,T),r=r+Math.imul(c,O)|0,i=(i=i+Math.imul(c,j)|0)+Math.imul(w,O)|0,n=n+Math.imul(w,j)|0,r=r+Math.imul(v,K)|0,i=(i=i+Math.imul(v,P)|0)+Math.imul(g,K)|0,n=n+Math.imul(g,P)|0;var dt=(u+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,C)|0)+Math.imul(p,F)|0))<<13)|0;u=((n=n+Math.imul(p,C)|0)+(i>>>13)|0)+(dt>>>26)|0,dt&=67108863,r=Math.imul(k,E),i=(i=Math.imul(k,T))+Math.imul(A,E)|0,n=Math.imul(A,T),r=r+Math.imul(b,O)|0,i=(i=i+Math.imul(b,j)|0)+Math.imul(_,O)|0,n=n+Math.imul(_,j)|0,r=r+Math.imul(c,K)|0,i=(i=i+Math.imul(c,P)|0)+Math.imul(w,K)|0,n=n+Math.imul(w,P)|0,r=r+Math.imul(v,F)|0,i=(i=i+Math.imul(v,C)|0)+Math.imul(g,F)|0,n=n+Math.imul(g,C)|0;var pt=(u+(r=r+Math.imul(d,D)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(p,D)|0))<<13)|0;u=((n=n+Math.imul(p,H)|0)+(i>>>13)|0)+(pt>>>26)|0,pt&=67108863,r=Math.imul(x,E),i=(i=Math.imul(x,T))+Math.imul(S,E)|0,n=Math.imul(S,T),r=r+Math.imul(k,O)|0,i=(i=i+Math.imul(k,j)|0)+Math.imul(A,O)|0,n=n+Math.imul(A,j)|0,r=r+Math.imul(b,K)|0,i=(i=i+Math.imul(b,P)|0)+Math.imul(_,K)|0,n=n+Math.imul(_,P)|0,r=r+Math.imul(c,F)|0,i=(i=i+Math.imul(c,C)|0)+Math.imul(w,F)|0,n=n+Math.imul(w,C)|0,r=r+Math.imul(v,D)|0,i=(i=i+Math.imul(v,H)|0)+Math.imul(g,D)|0,n=n+Math.imul(g,H)|0;var Mt=(u+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,U)|0)+Math.imul(p,J)|0))<<13)|0;u=((n=n+Math.imul(p,U)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(Z,E),i=(i=Math.imul(Z,T))+Math.imul(R,E)|0,n=Math.imul(R,T),r=r+Math.imul(x,O)|0,i=(i=i+Math.imul(x,j)|0)+Math.imul(S,O)|0,n=n+Math.imul(S,j)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,P)|0)+Math.imul(A,K)|0,n=n+Math.imul(A,P)|0,r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,C)|0)+Math.imul(_,F)|0,n=n+Math.imul(_,C)|0,r=r+Math.imul(c,D)|0,i=(i=i+Math.imul(c,H)|0)+Math.imul(w,D)|0,n=n+Math.imul(w,H)|0,r=r+Math.imul(v,J)|0,i=(i=i+Math.imul(v,U)|0)+Math.imul(g,J)|0,n=n+Math.imul(g,U)|0;var vt=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,Q)|0)+Math.imul(p,G)|0))<<13)|0;u=((n=n+Math.imul(p,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(q,E),i=(i=Math.imul(q,T))+Math.imul(B,E)|0,n=Math.imul(B,T),r=r+Math.imul(Z,O)|0,i=(i=i+Math.imul(Z,j)|0)+Math.imul(R,O)|0,n=n+Math.imul(R,j)|0,r=r+Math.imul(x,K)|0,i=(i=i+Math.imul(x,P)|0)+Math.imul(S,K)|0,n=n+Math.imul(S,P)|0,r=r+Math.imul(k,F)|0,i=(i=i+Math.imul(k,C)|0)+Math.imul(A,F)|0,n=n+Math.imul(A,C)|0,r=r+Math.imul(b,D)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(_,D)|0,n=n+Math.imul(_,H)|0,r=r+Math.imul(c,J)|0,i=(i=i+Math.imul(c,U)|0)+Math.imul(w,J)|0,n=n+Math.imul(w,U)|0,r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(g,G)|0,n=n+Math.imul(g,Q)|0;var gt=(u+(r=r+Math.imul(d,V)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(p,V)|0))<<13)|0;u=((n=n+Math.imul(p,W)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(N,E),i=(i=Math.imul(N,T))+Math.imul(L,E)|0,n=Math.imul(L,T),r=r+Math.imul(q,O)|0,i=(i=i+Math.imul(q,j)|0)+Math.imul(B,O)|0,n=n+Math.imul(B,j)|0,r=r+Math.imul(Z,K)|0,i=(i=i+Math.imul(Z,P)|0)+Math.imul(R,K)|0,n=n+Math.imul(R,P)|0,r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,C)|0)+Math.imul(S,F)|0,n=n+Math.imul(S,C)|0,r=r+Math.imul(k,D)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(A,D)|0,n=n+Math.imul(A,H)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,U)|0)+Math.imul(_,J)|0,n=n+Math.imul(_,U)|0,r=r+Math.imul(c,G)|0,i=(i=i+Math.imul(c,Q)|0)+Math.imul(w,G)|0,n=n+Math.imul(w,Q)|0,r=r+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(g,V)|0,n=n+Math.imul(g,W)|0;var ct=(u+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(p,X)|0))<<13)|0;u=((n=n+Math.imul(p,Y)|0)+(i>>>13)|0)+(ct>>>26)|0,ct&=67108863,r=Math.imul(I,E),i=(i=Math.imul(I,T))+Math.imul(z,E)|0,n=Math.imul(z,T),r=r+Math.imul(N,O)|0,i=(i=i+Math.imul(N,j)|0)+Math.imul(L,O)|0,n=n+Math.imul(L,j)|0,r=r+Math.imul(q,K)|0,i=(i=i+Math.imul(q,P)|0)+Math.imul(B,K)|0,n=n+Math.imul(B,P)|0,r=r+Math.imul(Z,F)|0,i=(i=i+Math.imul(Z,C)|0)+Math.imul(R,F)|0,n=n+Math.imul(R,C)|0,r=r+Math.imul(x,D)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(S,D)|0,n=n+Math.imul(S,H)|0,r=r+Math.imul(k,J)|0,i=(i=i+Math.imul(k,U)|0)+Math.imul(A,J)|0,n=n+Math.imul(A,U)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(_,G)|0,n=n+Math.imul(_,Q)|0,r=r+Math.imul(c,V)|0,i=(i=i+Math.imul(c,W)|0)+Math.imul(w,V)|0,n=n+Math.imul(w,W)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(g,X)|0,n=n+Math.imul(g,Y)|0;var wt=(u+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(p,$)|0))<<13)|0;u=((n=n+Math.imul(p,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,O),i=(i=Math.imul(I,j))+Math.imul(z,O)|0,n=Math.imul(z,j),r=r+Math.imul(N,K)|0,i=(i=i+Math.imul(N,P)|0)+Math.imul(L,K)|0,n=n+Math.imul(L,P)|0,r=r+Math.imul(q,F)|0,i=(i=i+Math.imul(q,C)|0)+Math.imul(B,F)|0,n=n+Math.imul(B,C)|0,r=r+Math.imul(Z,D)|0,i=(i=i+Math.imul(Z,H)|0)+Math.imul(R,D)|0,n=n+Math.imul(R,H)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,U)|0)+Math.imul(S,J)|0,n=n+Math.imul(S,U)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(A,G)|0,n=n+Math.imul(A,Q)|0,r=r+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,r=r+Math.imul(c,X)|0,i=(i=i+Math.imul(c,Y)|0)+Math.imul(w,X)|0,n=n+Math.imul(w,Y)|0;var yt=(u+(r=r+Math.imul(v,$)|0)|0)+((8191&(i=(i=i+Math.imul(v,tt)|0)+Math.imul(g,$)|0))<<13)|0;u=((n=n+Math.imul(g,tt)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(I,K),i=(i=Math.imul(I,P))+Math.imul(z,K)|0,n=Math.imul(z,P),r=r+Math.imul(N,F)|0,i=(i=i+Math.imul(N,C)|0)+Math.imul(L,F)|0,n=n+Math.imul(L,C)|0,r=r+Math.imul(q,D)|0,i=(i=i+Math.imul(q,H)|0)+Math.imul(B,D)|0,n=n+Math.imul(B,H)|0,r=r+Math.imul(Z,J)|0,i=(i=i+Math.imul(Z,U)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,U)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,Q)|0)+Math.imul(S,G)|0,n=n+Math.imul(S,Q)|0,r=r+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(A,V)|0,n=n+Math.imul(A,W)|0,r=r+Math.imul(b,X)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0;var bt=(u+(r=r+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(w,$)|0))<<13)|0;u=((n=n+Math.imul(w,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(I,F),i=(i=Math.imul(I,C))+Math.imul(z,F)|0,n=Math.imul(z,C),r=r+Math.imul(N,D)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(L,D)|0,n=n+Math.imul(L,H)|0,r=r+Math.imul(q,J)|0,i=(i=i+Math.imul(q,U)|0)+Math.imul(B,J)|0,n=n+Math.imul(B,U)|0,r=r+Math.imul(Z,G)|0,i=(i=i+Math.imul(Z,Q)|0)+Math.imul(R,G)|0,n=n+Math.imul(R,Q)|0,r=r+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(A,X)|0,n=n+Math.imul(A,Y)|0;var _t=(u+(r=r+Math.imul(b,$)|0)|0)+((8191&(i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0))<<13)|0;u=((n=n+Math.imul(_,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,D),i=(i=Math.imul(I,H))+Math.imul(z,D)|0,n=Math.imul(z,H),r=r+Math.imul(N,J)|0,i=(i=i+Math.imul(N,U)|0)+Math.imul(L,J)|0,n=n+Math.imul(L,U)|0,r=r+Math.imul(q,G)|0,i=(i=i+Math.imul(q,Q)|0)+Math.imul(B,G)|0,n=n+Math.imul(B,Q)|0,r=r+Math.imul(Z,V)|0,i=(i=i+Math.imul(Z,W)|0)+Math.imul(R,V)|0,n=n+Math.imul(R,W)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0;var kt=(u+(r=r+Math.imul(k,$)|0)|0)+((8191&(i=(i=i+Math.imul(k,tt)|0)+Math.imul(A,$)|0))<<13)|0;u=((n=n+Math.imul(A,tt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(I,J),i=(i=Math.imul(I,U))+Math.imul(z,J)|0,n=Math.imul(z,U),r=r+Math.imul(N,G)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(L,G)|0,n=n+Math.imul(L,Q)|0,r=r+Math.imul(q,V)|0,i=(i=i+Math.imul(q,W)|0)+Math.imul(B,V)|0,n=n+Math.imul(B,W)|0,r=r+Math.imul(Z,X)|0,i=(i=i+Math.imul(Z,Y)|0)+Math.imul(R,X)|0,n=n+Math.imul(R,Y)|0;var At=(u+(r=r+Math.imul(x,$)|0)|0)+((8191&(i=(i=i+Math.imul(x,tt)|0)+Math.imul(S,$)|0))<<13)|0;u=((n=n+Math.imul(S,tt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(I,G),i=(i=Math.imul(I,Q))+Math.imul(z,G)|0,n=Math.imul(z,Q),r=r+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,n=n+Math.imul(L,W)|0,r=r+Math.imul(q,X)|0,i=(i=i+Math.imul(q,Y)|0)+Math.imul(B,X)|0,n=n+Math.imul(B,Y)|0;var xt=(u+(r=r+Math.imul(Z,$)|0)|0)+((8191&(i=(i=i+Math.imul(Z,tt)|0)+Math.imul(R,$)|0))<<13)|0;u=((n=n+Math.imul(R,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(I,V),i=(i=Math.imul(I,W))+Math.imul(z,V)|0,n=Math.imul(z,W),r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(L,X)|0,n=n+Math.imul(L,Y)|0;var St=(u+(r=r+Math.imul(q,$)|0)|0)+((8191&(i=(i=i+Math.imul(q,tt)|0)+Math.imul(B,$)|0))<<13)|0;u=((n=n+Math.imul(B,tt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(I,X),i=(i=Math.imul(I,Y))+Math.imul(z,X)|0,n=Math.imul(z,Y);var Zt=(u+(r=r+Math.imul(N,$)|0)|0)+((8191&(i=(i=i+Math.imul(N,tt)|0)+Math.imul(L,$)|0))<<13)|0;u=((n=n+Math.imul(L,tt)|0)+(i>>>13)|0)+(Zt>>>26)|0,Zt&=67108863;var Rt=(u+(r=Math.imul(I,$))|0)+((8191&(i=(i=Math.imul(I,tt))+Math.imul(z,$)|0))<<13)|0;return u=((n=Math.imul(z,tt))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,a[0]=lt,a[1]=mt,a[2]=ft,a[3]=dt,a[4]=pt,a[5]=Mt,a[6]=vt,a[7]=gt,a[8]=ct,a[9]=wt,a[10]=yt,a[11]=bt,a[12]=_t,a[13]=kt,a[14]=At,a[15]=xt,a[16]=St,a[17]=Zt,a[18]=Rt,u!==0&&(a[19]=u,e.length++),e};function Et(t,h,e){return new ht().mulp(t,h,e)}function ht(t,h){this.x=t,this.y=h}Math.imul||(zt=It),s.prototype.mulTo=function(t,h){var e,r=this.length+t.length;return e=this.length===10&&t.length===10?zt(this,t,h):r<63?It(this,t,h):r<1024?function(i,n,o){o.negative=n.negative^i.negative,o.length=i.length+n.length;for(var l=0,a=0,u=0;u>>26)|0)>>>26,f&=67108863}o.words[u]=d,l=f,f=a}return l!==0?o.words[u]=l:o.length--,o.strip()}(this,t,h):Et(this,t,h),e},ht.prototype.makeRBT=function(t){for(var h=Array(t),e=s.prototype._countBits(t)-1,r=0;r>=1;return r},ht.prototype.permute=function(t,h,e,r,i,n){for(var o=0;o>>=1)i++;return 1<>>=13,e[2*n+1]=8191&i,i>>>=13;for(n=2*h;n>=26,h+=r/67108864|0,h+=i>>>26,this.words[e]=67108863&i}return h!==0&&(this.words[e]=h,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var h=function(n){for(var o=Array(n.bitLength()),l=0;l>>u}return o}(t);if(h.length===0)return new s(1);for(var e=this,r=0;r=0);var h,e=t%26,r=(t-e)/26,i=67108863>>>26-e<<26-e;if(e!==0){var n=0;for(h=0;h>>26-e}n&&(this.words[h]=n,this.length++)}if(r!==0){for(h=this.length-1;h>=0;h--)this.words[h+r]=this.words[h];for(h=0;h=0),r=h?(h-h%26)/26:0;var i=t%26,n=Math.min((t-i)/26,this.length),o=67108863^67108863>>>i<n)for(this.length-=n,a=0;a=0&&(u!==0||a>=r);a--){var f=0|this.words[a];this.words[a]=u<<26-i|f>>>i,u=f&o}return l&&u!==0&&(l.words[l.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,h,e){return m(this.negative===0),this.iushrn(t,h,e)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){m(typeof t=="number"&&t>=0);var h=t%26,e=(t-h)/26,r=1<=0);var h=t%26,e=(t-h)/26;if(m(this.negative===0,"imaskn works only with positive numbers"),this.length<=e)return this;if(h!==0&&e++,this.length=Math.min(e,this.length),h!==0){var r=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(t){if(m(typeof t=="number"),m(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-(l/67108864|0),this.words[r+e]=67108863&i}for(;r>26,this.words[r+e]=67108863&i;if(o===0)return this.strip();for(m(o===-1),o=0,r=0;r>26,this.words[r]=67108863&i;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,h){var e=(this.length,t.length),r=this.clone(),i=t,n=0|i.words[i.length-1];(e=26-this._countBits(n))!==0&&(i=i.ushln(e),r.iushln(e),n=0|i.words[i.length-1]);var o,l=r.length-i.length;if(h!=="mod"){(o=new s(null)).length=l+1,o.words=Array(o.length);for(var a=0;a=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/n|0,67108863),r._ishlnsubmul(i,d,f);r.negative!==0;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);o&&(o.words[f]=d)}return o&&o.strip(),r.strip(),h!=="div"&&e!==0&&r.iushrn(e),{div:o||null,mod:r}},s.prototype.divmod=function(t,h,e){return m(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:this.negative!==0&&t.negative===0?(n=this.neg().divmod(t,h),h!=="mod"&&(r=n.div.neg()),h!=="div"&&(i=n.mod.neg(),e&&i.negative!==0&&i.iadd(t)),{div:r,mod:i}):this.negative===0&&t.negative!==0?(n=this.divmod(t.neg(),h),h!=="mod"&&(r=n.div.neg()),{div:r,mod:n.mod}):this.negative&t.negative?(n=this.neg().divmod(t.neg(),h),h!=="div"&&(i=n.mod.neg(),e&&i.negative!==0&&i.isub(t)),{div:n.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:t.length===1?h==="div"?{div:this.divn(t.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,h);var r,i,n},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var h=this.divmod(t);if(h.mod.isZero())return h.div;var e=h.div.negative!==0?h.mod.isub(t):h.mod,r=t.ushrn(1),i=t.andln(1),n=e.cmp(r);return n<0||i===1&&n===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modn=function(t){m(t<=67108863);for(var h=(1<<26)%t,e=0,r=this.length-1;r>=0;r--)e=(h*e+(0|this.words[r]))%t;return e},s.prototype.idivn=function(t){m(t<=67108863);for(var h=0,e=this.length-1;e>=0;e--){var r=(0|this.words[e])+67108864*h;this.words[e]=r/t|0,h=r%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){m(t.negative===0),m(!t.isZero());var h=this,e=t.clone();h=h.negative!==0?h.umod(t):h.clone();for(var r=new s(1),i=new s(0),n=new s(0),o=new s(1),l=0;h.isEven()&&e.isEven();)h.iushrn(1),e.iushrn(1),++l;for(var a=e.clone(),u=h.clone();!h.isZero();){for(var f=0,d=1;!(h.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(h.iushrn(f);f-- >0;)(r.isOdd()||i.isOdd())&&(r.iadd(a),i.isub(u)),r.iushrn(1),i.iushrn(1);for(var p=0,M=1;!(e.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(e.iushrn(p);p-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(a),o.isub(u)),n.iushrn(1),o.iushrn(1);h.cmp(e)>=0?(h.isub(e),r.isub(n),i.isub(o)):(e.isub(h),n.isub(r),o.isub(i))}return{a:n,b:o,gcd:e.iushln(l)}},s.prototype._invmp=function(t){m(t.negative===0),m(!t.isZero());var h=this,e=t.clone();h=h.negative!==0?h.umod(t):h.clone();for(var r,i=new s(1),n=new s(0),o=e.clone();h.cmpn(1)>0&&e.cmpn(1)>0;){for(var l=0,a=1;!(h.words[0]&a)&&l<26;++l,a<<=1);if(l>0)for(h.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(o),i.iushrn(1);for(var u=0,f=1;!(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)n.isOdd()&&n.iadd(o),n.iushrn(1);h.cmp(e)>=0?(h.isub(e),i.isub(n)):(e.isub(h),n.isub(i))}return(r=h.cmpn(1)===0?i:n).cmpn(0)<0&&r.iadd(t),r},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var h=this.clone(),e=t.clone();h.negative=0,e.negative=0;for(var r=0;h.isEven()&&e.isEven();r++)h.iushrn(1),e.iushrn(1);for(;;){for(;h.isEven();)h.iushrn(1);for(;e.isEven();)e.iushrn(1);var i=h.cmp(e);if(i<0){var n=h;h=e,e=n}else if(i===0||e.cmpn(1)===0)break;h.isub(e)}return e.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){m(typeof t=="number");var h=t%26,e=(t-h)/26,r=1<>>26,o&=67108863,this.words[n]=o}return i!==0&&(this.words[n]=i,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(t){var h,e=t<0;if(this.negative!==0&&!e)return-1;if(this.negative===0&&e)return 1;if(this.strip(),this.length>1)h=1;else{e&&(t=-t),m(t<=67108863,"Number is too big");var r=0|this.words[0];h=r===t?0:rt.length)return 1;if(this.length=0;e--){var r=0|this.words[e],i=0|t.words[e];if(r!==i){ri&&(h=1);break}}return h},s.prototype.gtn=function(t){return this.cmpn(t)===1},s.prototype.gt=function(t){return this.cmp(t)===1},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return this.cmpn(t)===-1},s.prototype.lt=function(t){return this.cmp(t)===-1},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return this.cmpn(t)===0},s.prototype.eq=function(t){return this.cmp(t)===0},s.red=function(t){return new y(t)},s.prototype.toRed=function(t){return m(!this.red,"Already a number in reduction context"),m(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return m(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return m(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var ut={k256:null,p224:null,p192:null,p25519:null};function it(t,h){this.name=t,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function st(){it.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Tt(){it.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function Ot(){it.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function at(){it.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if(typeof t=="string"){var h=s._prime(t);this.m=h.p,this.prime=h}else m(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function nt(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}it.prototype._tmp=function(){var t=new s(null);return t.words=Array(Math.ceil(this.n/13)),t},it.prototype.ireduce=function(t){var h,e=t;do this.split(e,this.tmp),h=(e=(e=this.imulK(e)).iadd(this.tmp)).bitLength();while(h>this.n);var r=h0?e.isub(this.p):e.strip(),e},it.prototype.split=function(t,h){t.iushrn(this.n,0,h)},it.prototype.imulK=function(t){return t.imul(this.k)},et(st,it),st.prototype.split=function(t,h){for(var e=4194303,r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,n===0&&t.length>10?t.length-=10:t.length-=9},st.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var h=0,e=0;e>>=26,t.words[e]=i,h=r}return h!==0&&(t.words[t.length++]=h),t},s._prime=function(t){if(ut[t])return ut[t];var h;if(t==="k256")h=new st;else if(t==="p224")h=new Tt;else if(t==="p192")h=new Ot;else{if(t!=="p25519")throw Error("Unknown prime "+t);h=new at}return ut[t]=h,h},y.prototype._verify1=function(t){m(t.negative===0,"red works only with positives"),m(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,h){m((t.negative|h.negative)==0,"red works only with positives"),m(t.red&&t.red===h.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,h){this._verify2(t,h);var e=t.add(h);return e.cmp(this.m)>=0&&e.isub(this.m),e._forceRed(this)},y.prototype.iadd=function(t,h){this._verify2(t,h);var e=t.iadd(h);return e.cmp(this.m)>=0&&e.isub(this.m),e},y.prototype.sub=function(t,h){this._verify2(t,h);var e=t.sub(h);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},y.prototype.isub=function(t,h){this._verify2(t,h);var e=t.isub(h);return e.cmpn(0)<0&&e.iadd(this.m),e},y.prototype.shl=function(t,h){return this._verify1(t),this.imod(t.ushln(h))},y.prototype.imul=function(t,h){return this._verify2(t,h),this.imod(t.imul(h))},y.prototype.mul=function(t,h){return this._verify2(t,h),this.imod(t.mul(h))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var h=this.m.andln(3);if(m(h%2==1),h===3){var e=this.m.add(new s(1)).iushrn(2);return this.pow(t,e)}for(var r=this.m.subn(1),i=0;!r.isZero()&&r.andln(1)===0;)i++,r.iushrn(1);m(!r.isZero());var n=new s(1).toRed(this),o=n.redNeg(),l=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new s(2*a*a).toRed(this);this.pow(a,l).cmp(o)!==0;)a.redIAdd(o);for(var u=this.pow(a,r),f=this.pow(t,r.addn(1).iushrn(1)),d=this.pow(t,r),p=i;d.cmp(n)!==0;){for(var M=d,v=0;M.cmp(n)!==0;v++)M=M.redSqr();m(v=0;r--){for(var a=h.words[r],u=l-1;u>=0;u--){var f=a>>u&1;i!==e[0]&&(i=this.sqr(i)),f!==0||n!==0?(n<<=1,n|=f,(++o===4||r===0&&u===0)&&(i=this.mul(i,e[n]),o=0,n=0)):o=0}l=26}return i},y.prototype.convertTo=function(t){var h=t.umod(this.m);return h===t?h.clone():h},y.prototype.convertFrom=function(t){var h=t.clone();return h.red=null,h},s.mont=function(t){return new nt(t)},et(nt,y),nt.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},nt.prototype.convertFrom=function(t){var h=this.imod(t.mul(this.rinv));return h.red=null,h},nt.prototype.imul=function(t,h){if(t.isZero()||h.isZero())return t.words[0]=0,t.length=1,t;var e=t.imul(h),r=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=e.isub(r).iushrn(this.shift),n=i;return i.cmp(this.m)>=0?n=i.isub(this.m):i.cmpn(0)<0&&(n=i.iadd(this.m)),n._forceRed(this)},nt.prototype.mul=function(t,h){if(t.isZero()||h.isZero())return new s(0)._forceRed(this);var e=t.mul(h),r=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=e.isub(r).iushrn(this.shift),n=i;return i.cmp(this.m)>=0?n=i.isub(this.m):i.cmpn(0)<0&&(n=i.iadd(this.m)),n._forceRed(this)},nt.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}})(ii,si)});export{ui as __moduleExports,ui as default}; diff --git a/assets/elliptic.min-BeOSrg7m.js b/assets/elliptic.min-ClIauaBs.js similarity index 99% rename from assets/elliptic.min-BeOSrg7m.js rename to assets/elliptic.min-ClIauaBs.js index 3f5fd45..19a171a 100644 --- a/assets/elliptic.min-BeOSrg7m.js +++ b/assets/elliptic.min-ClIauaBs.js @@ -1 +1 @@ -import{r as Y,J as ae,i as T,d as j,g as Ie,x as Me,A as xe,M as Be,z as Ce,y as _e,Y as De}from"./index-B8A58fJZ.js";import u from"./bn.min-BPUEMPhn.js";/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */var be,F=Y(function(e,f){var d=f;function t(c){return c.length===1?"0"+c:c}function a(c){for(var r="",b=0;b>8,s=255&n;o?b.push(o,s):b.push(s)}return b},d.zero2=t,d.toHex=a,d.encode=function(c,r){return r==="hex"?a(c):c}}),v=Y(function(e,f){var d=f;d.assert=ae,d.toArray=F.toArray,d.zero2=F.zero2,d.toHex=F.toHex,d.encode=F.encode,d.getNAF=function(t,a){for(var c=[],r=1<=0;){var i;if(b.isOdd()){var n=b.andln(r-1);i=n>(r>>1)-1?(r>>1)-n:n,b.isubn(i)}else i=0;c.push(i);for(var o=b.cmpn(0)!==0&&b.andln(r-1)===0?a+1:1,s=1;s0||a.cmpn(-b)>0;){var i,n,o,s=t.andln(3)+r&3,h=a.andln(3)+b&3;s===3&&(s=-1),h===3&&(h=-1),(1&s)==0?i=0:i=(o=t.andln(7)+r&7)!==3&&o!==5||h!==2?s:-s,c[0].push(i),(1&h)==0?n=0:n=(o=a.andln(7)+b&7)!==3&&o!==5||s!==2?h:-h,c[1].push(n),2*r===i+1&&(r=1-r),2*b===n+1&&(b=1-b),t.iushrn(1),a.iushrn(1)}return c},d.cachedProperty=function(t,a,c){var r="_"+a;t.prototype[a]=function(){return this[r]!==void 0?this[r]:this[r]=c.call(this)}},d.parseBytes=function(t){return typeof t=="string"?d.toArray(t,"hex"):t},d.intFromLE=function(t){return new u(t,"hex","le")}}),ce=function(e){return be||(be=new k(null)),be.generate(e)};function k(e){this.rand=e}var Fe=k;if(k.prototype.generate=function(e){return this._rand(e)},k.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var f=new Uint8Array(e),d=0;d0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var x=N;function _(e,f){this.curve=e,this.type=f,this.precomputed=null}N.prototype.point=function(){throw Error("Not implemented")},N.prototype.validate=function(){throw Error("Not implemented")},N.prototype._fixedNafMul=function(e,f){$(e.precomputed);var d=e._getDoubles(),t=Z(f,1),a=(1<=r;f--)b=(b<<1)+t[f];c.push(b)}for(var i=this.jpoint(null,null,null),n=this.jpoint(null,null,null),o=a;o>0;o--){for(r=0;r=0;b--){for(f=0;b>=0&&c[b]===0;b--)f++;if(b>=0&&f++,r=r.dblp(f),b<0)break;var i=c[b];$(i!==0),r=e.type==="affine"?i>0?r.mixedAdd(a[i-1>>1]):r.mixedAdd(a[-i-1>>1].neg()):i>0?r.add(a[i-1>>1]):r.add(a[-i-1>>1].neg())}return e.type==="affine"?r.toP():r},N.prototype._wnafMulAdd=function(e,f,d,t,a){for(var c=this._wnafT1,r=this._wnafT2,b=this._wnafT3,i=0,n=0;n=1;n-=2){var s=n-1,h=n;if(c[s]===1&&c[h]===1){var p=[f[s],null,null,f[h]];f[s].y.cmp(f[h].y)===0?(p[1]=f[s].add(f[h]),p[2]=f[s].toJ().mixedAdd(f[h].neg())):f[s].y.cmp(f[h].y.redNeg())===0?(p[1]=f[s].toJ().mixedAdd(f[h]),p[2]=f[s].add(f[h].neg())):(p[1]=f[s].toJ().mixedAdd(f[h]),p[2]=f[s].toJ().mixedAdd(f[h].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],w=ze(d[s],d[h]);i=Math.max(w[0].length,i),b[s]=Array(i),b[h]=Array(i);for(var l=0;l=0;n--){for(var re=0;n>=0;){var pe=!0;for(l=0;l=0&&re++,R=R.dblp(re),n<0)break;for(l=0;l0?X=r[l][W-1>>1]:W<0&&(X=r[l][-W-1>>1].neg()),R=X.type==="affine"?R.mixedAdd(X):R.add(X))}}for(n=0;n=Math.ceil((e.bitLength()+1)/f.step)},_.prototype._getDoubles=function(e,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var d=[this],t=this,a=0;a=0&&(c=f,r=d),t.negative&&(t=t.neg(),a=a.neg()),c.negative&&(c=c.neg(),r=r.neg()),[{a:t,b:a},{a:c,b:r}]},D.prototype._endoSplit=function(e){var f=this.endo.basis,d=f[0],t=f[1],a=t.b.mul(e).divRound(this.n),c=d.b.neg().mul(e).divRound(this.n),r=a.mul(d.a),b=c.mul(t.a),i=a.mul(d.b),n=c.mul(t.b);return{k1:e.sub(r).sub(b),k2:i.add(n).neg()}},D.prototype.pointFromX=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),t=d.redSqrt();if(t.redSqr().redSub(d).cmp(this.zero)!==0)throw Error("invalid point");var a=t.fromRed().isOdd();return(f&&!a||!f&&a)&&(t=t.redNeg()),this.point(e,t)},D.prototype.validate=function(e){if(e.inf)return!0;var f=e.x,d=e.y,t=this.a.redMul(f),a=f.redSqr().redMul(f).redIAdd(t).redIAdd(this.b);return d.redSqr().redISub(a).cmpn(0)===0},D.prototype._endoWnafMulAdd=function(e,f,d){for(var t=this._endoWnafT1,a=this._endoWnafT2,c=0;c":""},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var f=this.y.redSub(e.y);f.cmpn(0)!==0&&(f=f.redMul(this.x.redSub(e.x).redInvm()));var d=f.redSqr().redISub(this.x).redISub(e.x),t=f.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,t)},A.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var f=this.curve.a,d=this.x.redSqr(),t=e.redInvm(),a=d.redAdd(d).redIAdd(d).redIAdd(f).redMul(t),c=a.redSqr().redISub(this.x.redAdd(this.x)),r=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,r)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(e){return e=new u(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},A.prototype.mulAdd=function(e,f,d){var t=[this,f],a=[e,d];return this.curve.endo?this.curve._endoWnafMulAdd(t,a):this.curve._wnafMulAdd(1,t,a,2)},A.prototype.jmulAdd=function(e,f,d){var t=[this,f],a=[e,d];return this.curve.endo?this.curve._endoWnafMulAdd(t,a,!0):this.curve._wnafMulAdd(1,t,a,2,!0)},A.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},A.prototype.neg=function(e){if(this.inf)return this;var f=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var d=this.precomputed,t=function(a){return a.neg()};f.precomputed={naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(t)},doubles:d.doubles&&{step:d.doubles.step,points:d.doubles.points.map(t)}}}return f},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},T(I,x.BasePoint),D.prototype.jpoint=function(e,f,d){return new I(this,e,f,d)},I.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),f=e.redSqr(),d=this.x.redMul(f),t=this.y.redMul(f).redMul(e);return this.curve.point(d,t)},I.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},I.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var f=e.z.redSqr(),d=this.z.redSqr(),t=this.x.redMul(f),a=e.x.redMul(d),c=this.y.redMul(f.redMul(e.z)),r=e.y.redMul(d.redMul(this.z)),b=t.redSub(a),i=c.redSub(r);if(b.cmpn(0)===0)return i.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var n=b.redSqr(),o=n.redMul(b),s=t.redMul(n),h=i.redSqr().redIAdd(o).redISub(s).redISub(s),p=i.redMul(s.redISub(h)).redISub(c.redMul(o)),y=this.z.redMul(e.z).redMul(b);return this.curve.jpoint(h,p,y)},I.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var f=this.z.redSqr(),d=this.x,t=e.x.redMul(f),a=this.y,c=e.y.redMul(f).redMul(this.z),r=d.redSub(t),b=a.redSub(c);if(r.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var i=r.redSqr(),n=i.redMul(r),o=d.redMul(i),s=b.redSqr().redIAdd(n).redISub(o).redISub(o),h=b.redMul(o.redISub(s)).redISub(a.redMul(n)),p=this.z.redMul(r);return this.curve.jpoint(s,h,p)},I.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var f=this,d=0;d=0)return!1;if(d.redIAdd(a),this.x.cmp(d)===0)return!0}},I.prototype.inspect=function(){return this.isInfinity()?"":""},I.prototype.isInfinity=function(){return this.z.cmpn(0)===0},T(K,x);var Pe=K;function g(e,f,d){x.BasePoint.call(this,e,"projective"),f===null&&d===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new u(f,16),this.z=new u(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}K.prototype.validate=function(e){var f=e.normalize().x,d=f.redSqr(),t=d.redMul(f).redAdd(d.redMul(this.a)).redAdd(f);return t.redSqrt().redSqr().cmp(t)===0},T(g,x.BasePoint),K.prototype.decodePoint=function(e,f){if((e=v.toArray(e,f)).length===33&&e[0]===64&&(e=e.slice(1,33).reverse()),e.length!==32)throw Error("Unknown point compression format");return this.point(e,1)},K.prototype.point=function(e,f){return new g(this,e,f)},K.prototype.pointFromJSON=function(e){return g.fromJSON(this,e)},g.prototype.precompute=function(){},g.prototype._encode=function(e){var f=this.curve.p.byteLength();return e?[64].concat(this.getX().toArray("le",f)):this.getX().toArray("be",f)},g.fromJSON=function(e,f){return new g(e,f[0],f[1]||e.one)},g.prototype.inspect=function(){return this.isInfinity()?"":""},g.prototype.isInfinity=function(){return this.z.cmpn(0)===0},g.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),f=this.x.redSub(this.z).redSqr(),d=e.redSub(f),t=e.redMul(f),a=d.redMul(f.redAdd(this.curve.a24.redMul(d)));return this.curve.point(t,a)},g.prototype.add=function(){throw Error("Not supported on Montgomery curve")},g.prototype.diffAdd=function(e,f){var d=this.x.redAdd(this.z),t=this.x.redSub(this.z),a=e.x.redAdd(e.z),c=e.x.redSub(e.z).redMul(d),r=a.redMul(t),b=f.z.redMul(c.redAdd(r).redSqr()),i=f.x.redMul(c.redISub(r).redSqr());return this.curve.point(b,i)},g.prototype.mul=function(e){for(var f=(e=new u(e,16)).clone(),d=this,t=this.curve.point(null,null),a=[];f.cmpn(0)!==0;f.iushrn(1))a.push(f.andln(1));for(var c=a.length-1;c>=0;c--)a[c]===0?(d=d.diffAdd(t,this),t=t.dbl()):(t=d.diffAdd(t,this),d=d.dbl());return t},g.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},g.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},g.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},g.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},g.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Ne=v.assert;function z(e){this.twisted=(0|e.a)!=1,this.mOneA=this.twisted&&(0|e.a)==-1,this.extended=this.mOneA,x.call(this,"edwards",e),this.a=new u(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new u(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new u(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Ne(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(0|e.c)==1}T(z,x);var ke=z;function m(e,f,d,t,a){x.BasePoint.call(this,e,"projective"),f===null&&d===null&&t===null?(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 u(f,16),this.y=new u(d,16),this.z=t?new u(t,16):this.curve.one,this.t=a&&new u(a,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()))))}z.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},z.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},z.prototype.jpoint=function(e,f,d,t){return this.point(e,f,d,t)},z.prototype.pointFromX=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),t=this.c2.redSub(this.a.redMul(d)),a=this.one.redSub(this.c2.redMul(this.d).redMul(d)),c=t.redMul(a.redInvm()),r=c.redSqrt();if(r.redSqr().redSub(c).cmp(this.zero)!==0)throw Error("invalid point");var b=r.fromRed().isOdd();return(f&&!b||!f&&b)&&(r=r.redNeg()),this.point(e,r)},z.prototype.pointFromY=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),t=d.redSub(this.c2),a=d.redMul(this.d).redMul(this.c2).redSub(this.a),c=t.redMul(a.redInvm());if(c.cmp(this.zero)===0){if(f)throw Error("invalid point");return this.point(this.zero,e)}var r=c.redSqrt();if(r.redSqr().redSub(c).cmp(this.zero)!==0)throw Error("invalid point");return r.fromRed().isOdd()!==f&&(r=r.redNeg()),this.point(r,e)},z.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var f=e.x.redSqr(),d=e.y.redSqr(),t=f.redMul(this.a).redAdd(d),a=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(d)));return t.cmp(a)===0},T(m,x.BasePoint),z.prototype.pointFromJSON=function(e){return m.fromJSON(this,e)},z.prototype.point=function(e,f,d,t){return new m(this,e,f,d,t)},m.fromJSON=function(e,f){return new m(e,f[0],f[1],f[2])},m.prototype.inspect=function(){return this.isInfinity()?"":""},m.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},m.prototype._extDbl=function(){var e=this.x.redSqr(),f=this.y.redSqr(),d=this.z.redSqr();d=d.redIAdd(d);var t=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(f),c=t.redAdd(f),r=c.redSub(d),b=t.redSub(f),i=a.redMul(r),n=c.redMul(b),o=a.redMul(b),s=r.redMul(c);return this.curve.point(i,n,s,o)},m.prototype._projDbl=function(){var e,f,d,t=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var r=(n=this.curve._mulA(a)).redAdd(c);if(this.zOne)e=t.redSub(a).redSub(c).redMul(r.redSub(this.curve.two)),f=r.redMul(n.redSub(c)),d=r.redSqr().redSub(r).redSub(r);else{var b=this.z.redSqr(),i=r.redSub(b).redISub(b);e=t.redSub(a).redISub(c).redMul(i),f=r.redMul(n.redSub(c)),d=r.redMul(i)}}else{var n=a.redAdd(c);b=this.curve._mulC(this.z).redSqr(),i=n.redSub(b).redSub(b),e=this.curve._mulC(t.redISub(n)).redMul(i),f=this.curve._mulC(n).redMul(a.redISub(c)),d=n.redMul(i)}return this.curve.point(e,f,d)},m.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},m.prototype._extAdd=function(e){var f=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),d=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),t=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),c=d.redSub(f),r=a.redSub(t),b=a.redAdd(t),i=d.redAdd(f),n=c.redMul(r),o=b.redMul(i),s=c.redMul(i),h=r.redMul(b);return this.curve.point(n,o,h,s)},m.prototype._projAdd=function(e){var f,d,t=this.z.redMul(e.z),a=t.redSqr(),c=this.x.redMul(e.x),r=this.y.redMul(e.y),b=this.curve.d.redMul(c).redMul(r),i=a.redSub(b),n=a.redAdd(b),o=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(c).redISub(r),s=t.redMul(i).redMul(o);return this.curve.twisted?(f=t.redMul(n).redMul(r.redSub(this.curve._mulA(c))),d=i.redMul(n)):(f=t.redMul(n).redMul(r.redSub(c)),d=this.curve._mulC(i).redMul(n)),this.curve.point(s,f,d)},m.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},m.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},m.prototype.mulAdd=function(e,f,d){return this.curve._wnafMulAdd(1,[this,f],[e,d],2,!1)},m.prototype.jmulAdd=function(e,f,d){return this.curve._wnafMulAdd(1,[this,f],[e,d],2,!0)},m.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},m.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},m.prototype.getX=function(){return this.normalize(),this.x.fromRed()},m.prototype.getY=function(){return this.normalize(),this.y.fromRed()},m.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},m.prototype.eqXToP=function(e){var f=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(f)===0)return!0;for(var d=e.clone(),t=this.curve.redN.redMul(this.z);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(t),this.x.cmp(f)===0)return!0}},m.prototype.toP=m.prototype.normalize,m.prototype.mixedAdd=m.prototype.add;var de=Y(function(e,f){var d=f;d.base=x,d.short=Re,d.mont=Pe,d.edwards=ke}),ie=j.rotl32,G=j.sum32,Oe=j.sum32_5,je=xe.ft_1,we=Ie.BlockHash,Le=[1518500249,1859775393,2400959708,3395469782];function q(){if(!(this instanceof q))return new q;we.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}j.inherits(q,we);var Je=q;q.blockSize=512,q.outSize=160,q.hmacStrength=80,q.padLength=64,q.prototype._update=function(e,f){for(var d=this.W,t=0;t<16;t++)d[t]=e[f+t];for(;tthis.blockSize&&(e=new this.Hash().update(e).digest()),ae(e.length<=this.blockSize);for(var f=e.length;f=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(f,d,t)}var ue=O;O.prototype._init=function(e,f,d){var t=e.concat(f).concat(d);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(d||[])),this._reseed=1},O.prototype.generate=function(e,f,d,t){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");typeof f!="string"&&(t=d,d=f,f=null),d&&(d=F.toArray(d,t||"hex"),this._update(d));for(var a=[];a.length"};var Ke=v.assert;function te(e,f){if(e instanceof te)return e;this._importDER(e,f)||(Ke(e.r&&e.s,"Signature without r or s"),this.r=new u(e.r,16),this.s=new u(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var ee=te;function Ue(){this.place=0}function se(e,f){var d=e[f.place++];if(!(128&d))return d;for(var t=15&d,a=0,c=0,r=f.place;c>>3);for(e.push(128|d);--d;)e.push(f>>>(d<<3)&255);e.push(f)}}te.prototype._importDER=function(e,f){e=v.toArray(e,f);var d=new Ue;if(e[d.place++]!==48||se(e,d)+d.place!==e.length||e[d.place++]!==2)return!1;var t=se(e,d),a=e.slice(d.place,t+d.place);if(d.place+=t,e[d.place++]!==2)return!1;var c=se(e,d);if(e.length!==c+d.place)return!1;var r=e.slice(d.place,c+d.place);return a[0]===0&&128&a[1]&&(a=a.slice(1)),r[0]===0&&128&r[1]&&(r=r.slice(1)),this.r=new u(a),this.s=new u(r),this.recoveryParam=null,!0},te.prototype.toDER=function(e){var f=this.r.toArray(),d=this.s.toArray();for(128&f[0]&&(f=[0].concat(f)),128&d[0]&&(d=[0].concat(d)),f=ye(f),d=ye(d);!(d[0]||128&d[1]);)d=d.slice(1);var t=[2];oe(t,f.length),(t=t.concat(f)).push(2),oe(t,d.length);var a=t.concat(d),c=[48];return oe(c,a.length),c=c.concat(a),v.encode(c,e)};var Ee=v.assert;function B(e){if(!(this instanceof B))return new B(e);typeof e=="string"&&(Ee(Q.hasOwnProperty(e),"Unknown curve "+e),e=Q[e]),e instanceof Q.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Ye=B;B.prototype.keyPair=function(e){return new ne(this,e)},B.prototype.keyFromPrivate=function(e,f){return ne.fromPrivate(this,e,f)},B.prototype.keyFromPublic=function(e,f){return ne.fromPublic(this,e,f)},B.prototype.genKeyPair=function(e){e||(e={});var f=new ue({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||ce(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});if(this.curve.type==="mont"){var d=new u(f.generate(32));return this.keyFromPrivate(d)}for(var t=this.n.byteLength(),a=this.n.sub(new u(2));;)if(!((d=new u(f.generate(t))).cmp(a)>0))return d.iaddn(1),this.keyFromPrivate(d)},B.prototype._truncateToN=function(e,f,d){var t=(d=d||8*e.byteLength())-this.n.bitLength();return t>0&&(e=e.ushrn(t)),!f&&e.cmp(this.n)>=0?e.sub(this.n):e},B.prototype.truncateMsg=function(e){var f;return e instanceof Uint8Array?(f=8*e.byteLength,e=this._truncateToN(new u(e,16),!1,f)):typeof e=="string"?(f=4*e.length,e=this._truncateToN(new u(e,16),!1,f)):e=this._truncateToN(new u(e,16)),e},B.prototype.sign=function(e,f,d,t){typeof d=="object"&&(t=d,d=null),t||(t={}),f=this.keyFromPrivate(f,d),e=this.truncateMsg(e);for(var a=this.n.byteLength(),c=f.getPrivate().toArray("be",a),r=e.toArray("be",a),b=new ue({hash:this.hash,entropy:c,nonce:r,pers:t.pers,persEnc:t.persEnc||"utf8"}),i=this.n.sub(new u(1)),n=0;;n++){var o=t.k?t.k(n):new u(b.generate(this.n.byteLength()));if(!((o=this._truncateToN(o,!0)).cmpn(1)<=0||o.cmp(i)>=0)){var s=this.g.mul(o);if(!s.isInfinity()){var h=s.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var y=o.invm(this.n).mul(p.mul(f.getPrivate()).iadd(e));if((y=y.umod(this.n)).cmpn(0)!==0){var w=(s.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return t.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),w^=1),new ee({r:p,s:y,recoveryParam:w})}}}}}},B.prototype.verify=function(e,f,d,t){return d=this.keyFromPublic(d,t),f=new ee(f,"hex"),this._verify(this.truncateMsg(e),f,d)||this._verify(this._truncateToN(new u(e,16)),f,d)},B.prototype._verify=function(e,f,d){var t=f.r,a=f.s;if(t.cmpn(1)<0||t.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c,r=a.invm(this.n),b=r.mul(e).umod(this.n),i=r.mul(t).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(b,d.getPublic(),i)).isInfinity()&&c.eqXToP(t):!(c=this.g.mulAdd(b,d.getPublic(),i)).isInfinity()&&c.getX().umod(this.n).cmp(t)===0},B.prototype.recoverPubKey=function(e,f,d,t){Ee((3&d)===d,"The recovery param is more than two bits"),f=new ee(f,t);var a=this.n,c=new u(e),r=f.r,b=f.s,i=1&d,n=d>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&n)throw Error("Unable to find sencond key candinate");r=n?this.curve.pointFromX(r.add(this.curve.n),i):this.curve.pointFromX(r,i);var o=f.r.invm(a),s=a.sub(c).mul(o).umod(a),h=b.mul(o).umod(a);return this.g.mulAdd(s,r,h)},B.prototype.getKeyRecoveryParam=function(e,f,d,t){if((f=new ee(f,t)).recoveryParam!==null)return f.recoveryParam;for(var a=0;a<4;a++){var c;try{c=this.recoverPubKey(e,f,a)}catch{continue}if(c.eq(d))return a}throw Error("Unable to find valid recovery factor")};var me=v.assert,Ae=v.parseBytes,V=v.cachedProperty;function S(e,f){if(this.eddsa=e,f.hasOwnProperty("secret")&&(this._secret=Ae(f.secret)),e.isPoint(f.pub))this._pub=f.pub;else if(this._pubBytes=Ae(f.pub),this._pubBytes&&this._pubBytes.length===33&&this._pubBytes[0]===64&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&this._pubBytes.length!==32)throw Error("Unknown point compression format")}S.fromPublic=function(e,f){return f instanceof S?f:new S(e,{pub:f})},S.fromSecret=function(e,f){return f instanceof S?f:new S(e,{secret:f})},S.prototype.secret=function(){return this._secret},V(S,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),V(S,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),V(S,"privBytes",function(){var e=this.eddsa,f=this.hash(),d=e.encodingLength-1,t=f.slice(0,e.encodingLength);return t[0]&=248,t[d]&=127,t[d]|=64,t}),V(S,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),V(S,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),V(S,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),S.prototype.sign=function(e){return me(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},S.prototype.verify=function(e,f){return this.eddsa.verify(e,f,this)},S.prototype.getSecret=function(e){return me(this._secret,"KeyPair is public only"),v.encode(this.secret(),e)},S.prototype.getPublic=function(e,f){return v.encode((f?[64]:[]).concat(this.pubBytes()),e)};var he=S,He=v.assert,fe=v.cachedProperty,We=v.parseBytes;function J(e,f){this.eddsa=e,typeof f!="object"&&(f=We(f)),Array.isArray(f)&&(f={R:f.slice(0,e.encodingLength),S:f.slice(e.encodingLength)}),He(f.R&&f.S,"Signature without R or S"),e.isPoint(f.R)&&(this._R=f.R),f.S instanceof u&&(this._S=f.S),this._Rencoded=Array.isArray(f.R)?f.R:f.Rencoded,this._Sencoded=Array.isArray(f.S)?f.S:f.Sencoded}fe(J,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),fe(J,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),fe(J,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),fe(J,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),J.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},J.prototype.toHex=function(){return v.encode(this.toBytes(),"hex").toUpperCase()};var ge=J,Ge=v.assert,Se=v.parseBytes;function M(e){if(Ge(e==="ed25519","only tested with ed25519 so far"),!(this instanceof M))return new M(e);e=Q[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=C.sha512}var Qe=M;M.prototype.sign=function(e,f){e=Se(e);var d=this.keyFromSecret(f),t=this.hashInt(d.messagePrefix(),e),a=this.g.mul(t),c=this.encodePoint(a),r=this.hashInt(c,d.pubBytes(),e).mul(d.priv()),b=t.add(r).umod(this.curve.n);return this.makeSignature({R:a,S:b,Rencoded:c})},M.prototype.verify=function(e,f,d){e=Se(e),f=this.makeSignature(f);var t=this.keyFromPublic(d),a=this.hashInt(f.Rencoded(),t.pubBytes(),e),c=this.g.mul(f.S());return f.R().add(t.pub().mul(a)).eq(c)},M.prototype.hashInt=function(){for(var e=this.hash(),f=0;f>8,s=255&n;o?b.push(o,s):b.push(s)}return b},d.zero2=t,d.toHex=a,d.encode=function(c,r){return r==="hex"?a(c):c}}),v=Y(function(e,f){var d=f;d.assert=ae,d.toArray=F.toArray,d.zero2=F.zero2,d.toHex=F.toHex,d.encode=F.encode,d.getNAF=function(t,a){for(var c=[],r=1<=0;){var i;if(b.isOdd()){var n=b.andln(r-1);i=n>(r>>1)-1?(r>>1)-n:n,b.isubn(i)}else i=0;c.push(i);for(var o=b.cmpn(0)!==0&&b.andln(r-1)===0?a+1:1,s=1;s0||a.cmpn(-b)>0;){var i,n,o,s=t.andln(3)+r&3,h=a.andln(3)+b&3;s===3&&(s=-1),h===3&&(h=-1),(1&s)==0?i=0:i=(o=t.andln(7)+r&7)!==3&&o!==5||h!==2?s:-s,c[0].push(i),(1&h)==0?n=0:n=(o=a.andln(7)+b&7)!==3&&o!==5||s!==2?h:-h,c[1].push(n),2*r===i+1&&(r=1-r),2*b===n+1&&(b=1-b),t.iushrn(1),a.iushrn(1)}return c},d.cachedProperty=function(t,a,c){var r="_"+a;t.prototype[a]=function(){return this[r]!==void 0?this[r]:this[r]=c.call(this)}},d.parseBytes=function(t){return typeof t=="string"?d.toArray(t,"hex"):t},d.intFromLE=function(t){return new u(t,"hex","le")}}),ce=function(e){return be||(be=new k(null)),be.generate(e)};function k(e){this.rand=e}var Fe=k;if(k.prototype.generate=function(e){return this._rand(e)},k.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var f=new Uint8Array(e),d=0;d0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var x=N;function _(e,f){this.curve=e,this.type=f,this.precomputed=null}N.prototype.point=function(){throw Error("Not implemented")},N.prototype.validate=function(){throw Error("Not implemented")},N.prototype._fixedNafMul=function(e,f){$(e.precomputed);var d=e._getDoubles(),t=Z(f,1),a=(1<=r;f--)b=(b<<1)+t[f];c.push(b)}for(var i=this.jpoint(null,null,null),n=this.jpoint(null,null,null),o=a;o>0;o--){for(r=0;r=0;b--){for(f=0;b>=0&&c[b]===0;b--)f++;if(b>=0&&f++,r=r.dblp(f),b<0)break;var i=c[b];$(i!==0),r=e.type==="affine"?i>0?r.mixedAdd(a[i-1>>1]):r.mixedAdd(a[-i-1>>1].neg()):i>0?r.add(a[i-1>>1]):r.add(a[-i-1>>1].neg())}return e.type==="affine"?r.toP():r},N.prototype._wnafMulAdd=function(e,f,d,t,a){for(var c=this._wnafT1,r=this._wnafT2,b=this._wnafT3,i=0,n=0;n=1;n-=2){var s=n-1,h=n;if(c[s]===1&&c[h]===1){var p=[f[s],null,null,f[h]];f[s].y.cmp(f[h].y)===0?(p[1]=f[s].add(f[h]),p[2]=f[s].toJ().mixedAdd(f[h].neg())):f[s].y.cmp(f[h].y.redNeg())===0?(p[1]=f[s].toJ().mixedAdd(f[h]),p[2]=f[s].add(f[h].neg())):(p[1]=f[s].toJ().mixedAdd(f[h]),p[2]=f[s].toJ().mixedAdd(f[h].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],w=ze(d[s],d[h]);i=Math.max(w[0].length,i),b[s]=Array(i),b[h]=Array(i);for(var l=0;l=0;n--){for(var re=0;n>=0;){var pe=!0;for(l=0;l=0&&re++,R=R.dblp(re),n<0)break;for(l=0;l0?X=r[l][W-1>>1]:W<0&&(X=r[l][-W-1>>1].neg()),R=X.type==="affine"?R.mixedAdd(X):R.add(X))}}for(n=0;n=Math.ceil((e.bitLength()+1)/f.step)},_.prototype._getDoubles=function(e,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var d=[this],t=this,a=0;a=0&&(c=f,r=d),t.negative&&(t=t.neg(),a=a.neg()),c.negative&&(c=c.neg(),r=r.neg()),[{a:t,b:a},{a:c,b:r}]},D.prototype._endoSplit=function(e){var f=this.endo.basis,d=f[0],t=f[1],a=t.b.mul(e).divRound(this.n),c=d.b.neg().mul(e).divRound(this.n),r=a.mul(d.a),b=c.mul(t.a),i=a.mul(d.b),n=c.mul(t.b);return{k1:e.sub(r).sub(b),k2:i.add(n).neg()}},D.prototype.pointFromX=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),t=d.redSqrt();if(t.redSqr().redSub(d).cmp(this.zero)!==0)throw Error("invalid point");var a=t.fromRed().isOdd();return(f&&!a||!f&&a)&&(t=t.redNeg()),this.point(e,t)},D.prototype.validate=function(e){if(e.inf)return!0;var f=e.x,d=e.y,t=this.a.redMul(f),a=f.redSqr().redMul(f).redIAdd(t).redIAdd(this.b);return d.redSqr().redISub(a).cmpn(0)===0},D.prototype._endoWnafMulAdd=function(e,f,d){for(var t=this._endoWnafT1,a=this._endoWnafT2,c=0;c":""},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var f=this.y.redSub(e.y);f.cmpn(0)!==0&&(f=f.redMul(this.x.redSub(e.x).redInvm()));var d=f.redSqr().redISub(this.x).redISub(e.x),t=f.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,t)},A.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var f=this.curve.a,d=this.x.redSqr(),t=e.redInvm(),a=d.redAdd(d).redIAdd(d).redIAdd(f).redMul(t),c=a.redSqr().redISub(this.x.redAdd(this.x)),r=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,r)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(e){return e=new u(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},A.prototype.mulAdd=function(e,f,d){var t=[this,f],a=[e,d];return this.curve.endo?this.curve._endoWnafMulAdd(t,a):this.curve._wnafMulAdd(1,t,a,2)},A.prototype.jmulAdd=function(e,f,d){var t=[this,f],a=[e,d];return this.curve.endo?this.curve._endoWnafMulAdd(t,a,!0):this.curve._wnafMulAdd(1,t,a,2,!0)},A.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},A.prototype.neg=function(e){if(this.inf)return this;var f=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var d=this.precomputed,t=function(a){return a.neg()};f.precomputed={naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(t)},doubles:d.doubles&&{step:d.doubles.step,points:d.doubles.points.map(t)}}}return f},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},T(I,x.BasePoint),D.prototype.jpoint=function(e,f,d){return new I(this,e,f,d)},I.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),f=e.redSqr(),d=this.x.redMul(f),t=this.y.redMul(f).redMul(e);return this.curve.point(d,t)},I.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},I.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var f=e.z.redSqr(),d=this.z.redSqr(),t=this.x.redMul(f),a=e.x.redMul(d),c=this.y.redMul(f.redMul(e.z)),r=e.y.redMul(d.redMul(this.z)),b=t.redSub(a),i=c.redSub(r);if(b.cmpn(0)===0)return i.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var n=b.redSqr(),o=n.redMul(b),s=t.redMul(n),h=i.redSqr().redIAdd(o).redISub(s).redISub(s),p=i.redMul(s.redISub(h)).redISub(c.redMul(o)),y=this.z.redMul(e.z).redMul(b);return this.curve.jpoint(h,p,y)},I.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var f=this.z.redSqr(),d=this.x,t=e.x.redMul(f),a=this.y,c=e.y.redMul(f).redMul(this.z),r=d.redSub(t),b=a.redSub(c);if(r.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var i=r.redSqr(),n=i.redMul(r),o=d.redMul(i),s=b.redSqr().redIAdd(n).redISub(o).redISub(o),h=b.redMul(o.redISub(s)).redISub(a.redMul(n)),p=this.z.redMul(r);return this.curve.jpoint(s,h,p)},I.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var f=this,d=0;d=0)return!1;if(d.redIAdd(a),this.x.cmp(d)===0)return!0}},I.prototype.inspect=function(){return this.isInfinity()?"":""},I.prototype.isInfinity=function(){return this.z.cmpn(0)===0},T(K,x);var Pe=K;function g(e,f,d){x.BasePoint.call(this,e,"projective"),f===null&&d===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new u(f,16),this.z=new u(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}K.prototype.validate=function(e){var f=e.normalize().x,d=f.redSqr(),t=d.redMul(f).redAdd(d.redMul(this.a)).redAdd(f);return t.redSqrt().redSqr().cmp(t)===0},T(g,x.BasePoint),K.prototype.decodePoint=function(e,f){if((e=v.toArray(e,f)).length===33&&e[0]===64&&(e=e.slice(1,33).reverse()),e.length!==32)throw Error("Unknown point compression format");return this.point(e,1)},K.prototype.point=function(e,f){return new g(this,e,f)},K.prototype.pointFromJSON=function(e){return g.fromJSON(this,e)},g.prototype.precompute=function(){},g.prototype._encode=function(e){var f=this.curve.p.byteLength();return e?[64].concat(this.getX().toArray("le",f)):this.getX().toArray("be",f)},g.fromJSON=function(e,f){return new g(e,f[0],f[1]||e.one)},g.prototype.inspect=function(){return this.isInfinity()?"":""},g.prototype.isInfinity=function(){return this.z.cmpn(0)===0},g.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),f=this.x.redSub(this.z).redSqr(),d=e.redSub(f),t=e.redMul(f),a=d.redMul(f.redAdd(this.curve.a24.redMul(d)));return this.curve.point(t,a)},g.prototype.add=function(){throw Error("Not supported on Montgomery curve")},g.prototype.diffAdd=function(e,f){var d=this.x.redAdd(this.z),t=this.x.redSub(this.z),a=e.x.redAdd(e.z),c=e.x.redSub(e.z).redMul(d),r=a.redMul(t),b=f.z.redMul(c.redAdd(r).redSqr()),i=f.x.redMul(c.redISub(r).redSqr());return this.curve.point(b,i)},g.prototype.mul=function(e){for(var f=(e=new u(e,16)).clone(),d=this,t=this.curve.point(null,null),a=[];f.cmpn(0)!==0;f.iushrn(1))a.push(f.andln(1));for(var c=a.length-1;c>=0;c--)a[c]===0?(d=d.diffAdd(t,this),t=t.dbl()):(t=d.diffAdd(t,this),d=d.dbl());return t},g.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},g.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},g.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},g.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},g.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Ne=v.assert;function z(e){this.twisted=(0|e.a)!=1,this.mOneA=this.twisted&&(0|e.a)==-1,this.extended=this.mOneA,x.call(this,"edwards",e),this.a=new u(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new u(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new u(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Ne(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(0|e.c)==1}T(z,x);var ke=z;function m(e,f,d,t,a){x.BasePoint.call(this,e,"projective"),f===null&&d===null&&t===null?(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 u(f,16),this.y=new u(d,16),this.z=t?new u(t,16):this.curve.one,this.t=a&&new u(a,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()))))}z.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},z.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},z.prototype.jpoint=function(e,f,d,t){return this.point(e,f,d,t)},z.prototype.pointFromX=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),t=this.c2.redSub(this.a.redMul(d)),a=this.one.redSub(this.c2.redMul(this.d).redMul(d)),c=t.redMul(a.redInvm()),r=c.redSqrt();if(r.redSqr().redSub(c).cmp(this.zero)!==0)throw Error("invalid point");var b=r.fromRed().isOdd();return(f&&!b||!f&&b)&&(r=r.redNeg()),this.point(e,r)},z.prototype.pointFromY=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),t=d.redSub(this.c2),a=d.redMul(this.d).redMul(this.c2).redSub(this.a),c=t.redMul(a.redInvm());if(c.cmp(this.zero)===0){if(f)throw Error("invalid point");return this.point(this.zero,e)}var r=c.redSqrt();if(r.redSqr().redSub(c).cmp(this.zero)!==0)throw Error("invalid point");return r.fromRed().isOdd()!==f&&(r=r.redNeg()),this.point(r,e)},z.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var f=e.x.redSqr(),d=e.y.redSqr(),t=f.redMul(this.a).redAdd(d),a=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(d)));return t.cmp(a)===0},T(m,x.BasePoint),z.prototype.pointFromJSON=function(e){return m.fromJSON(this,e)},z.prototype.point=function(e,f,d,t){return new m(this,e,f,d,t)},m.fromJSON=function(e,f){return new m(e,f[0],f[1],f[2])},m.prototype.inspect=function(){return this.isInfinity()?"":""},m.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},m.prototype._extDbl=function(){var e=this.x.redSqr(),f=this.y.redSqr(),d=this.z.redSqr();d=d.redIAdd(d);var t=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(f),c=t.redAdd(f),r=c.redSub(d),b=t.redSub(f),i=a.redMul(r),n=c.redMul(b),o=a.redMul(b),s=r.redMul(c);return this.curve.point(i,n,s,o)},m.prototype._projDbl=function(){var e,f,d,t=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var r=(n=this.curve._mulA(a)).redAdd(c);if(this.zOne)e=t.redSub(a).redSub(c).redMul(r.redSub(this.curve.two)),f=r.redMul(n.redSub(c)),d=r.redSqr().redSub(r).redSub(r);else{var b=this.z.redSqr(),i=r.redSub(b).redISub(b);e=t.redSub(a).redISub(c).redMul(i),f=r.redMul(n.redSub(c)),d=r.redMul(i)}}else{var n=a.redAdd(c);b=this.curve._mulC(this.z).redSqr(),i=n.redSub(b).redSub(b),e=this.curve._mulC(t.redISub(n)).redMul(i),f=this.curve._mulC(n).redMul(a.redISub(c)),d=n.redMul(i)}return this.curve.point(e,f,d)},m.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},m.prototype._extAdd=function(e){var f=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),d=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),t=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),c=d.redSub(f),r=a.redSub(t),b=a.redAdd(t),i=d.redAdd(f),n=c.redMul(r),o=b.redMul(i),s=c.redMul(i),h=r.redMul(b);return this.curve.point(n,o,h,s)},m.prototype._projAdd=function(e){var f,d,t=this.z.redMul(e.z),a=t.redSqr(),c=this.x.redMul(e.x),r=this.y.redMul(e.y),b=this.curve.d.redMul(c).redMul(r),i=a.redSub(b),n=a.redAdd(b),o=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(c).redISub(r),s=t.redMul(i).redMul(o);return this.curve.twisted?(f=t.redMul(n).redMul(r.redSub(this.curve._mulA(c))),d=i.redMul(n)):(f=t.redMul(n).redMul(r.redSub(c)),d=this.curve._mulC(i).redMul(n)),this.curve.point(s,f,d)},m.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},m.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},m.prototype.mulAdd=function(e,f,d){return this.curve._wnafMulAdd(1,[this,f],[e,d],2,!1)},m.prototype.jmulAdd=function(e,f,d){return this.curve._wnafMulAdd(1,[this,f],[e,d],2,!0)},m.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},m.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},m.prototype.getX=function(){return this.normalize(),this.x.fromRed()},m.prototype.getY=function(){return this.normalize(),this.y.fromRed()},m.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},m.prototype.eqXToP=function(e){var f=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(f)===0)return!0;for(var d=e.clone(),t=this.curve.redN.redMul(this.z);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(t),this.x.cmp(f)===0)return!0}},m.prototype.toP=m.prototype.normalize,m.prototype.mixedAdd=m.prototype.add;var de=Y(function(e,f){var d=f;d.base=x,d.short=Re,d.mont=Pe,d.edwards=ke}),ie=j.rotl32,G=j.sum32,Oe=j.sum32_5,je=xe.ft_1,we=Ie.BlockHash,Le=[1518500249,1859775393,2400959708,3395469782];function q(){if(!(this instanceof q))return new q;we.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}j.inherits(q,we);var Je=q;q.blockSize=512,q.outSize=160,q.hmacStrength=80,q.padLength=64,q.prototype._update=function(e,f){for(var d=this.W,t=0;t<16;t++)d[t]=e[f+t];for(;tthis.blockSize&&(e=new this.Hash().update(e).digest()),ae(e.length<=this.blockSize);for(var f=e.length;f=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(f,d,t)}var ue=O;O.prototype._init=function(e,f,d){var t=e.concat(f).concat(d);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(d||[])),this._reseed=1},O.prototype.generate=function(e,f,d,t){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");typeof f!="string"&&(t=d,d=f,f=null),d&&(d=F.toArray(d,t||"hex"),this._update(d));for(var a=[];a.length"};var Ke=v.assert;function te(e,f){if(e instanceof te)return e;this._importDER(e,f)||(Ke(e.r&&e.s,"Signature without r or s"),this.r=new u(e.r,16),this.s=new u(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var ee=te;function Ue(){this.place=0}function se(e,f){var d=e[f.place++];if(!(128&d))return d;for(var t=15&d,a=0,c=0,r=f.place;c>>3);for(e.push(128|d);--d;)e.push(f>>>(d<<3)&255);e.push(f)}}te.prototype._importDER=function(e,f){e=v.toArray(e,f);var d=new Ue;if(e[d.place++]!==48||se(e,d)+d.place!==e.length||e[d.place++]!==2)return!1;var t=se(e,d),a=e.slice(d.place,t+d.place);if(d.place+=t,e[d.place++]!==2)return!1;var c=se(e,d);if(e.length!==c+d.place)return!1;var r=e.slice(d.place,c+d.place);return a[0]===0&&128&a[1]&&(a=a.slice(1)),r[0]===0&&128&r[1]&&(r=r.slice(1)),this.r=new u(a),this.s=new u(r),this.recoveryParam=null,!0},te.prototype.toDER=function(e){var f=this.r.toArray(),d=this.s.toArray();for(128&f[0]&&(f=[0].concat(f)),128&d[0]&&(d=[0].concat(d)),f=ye(f),d=ye(d);!(d[0]||128&d[1]);)d=d.slice(1);var t=[2];oe(t,f.length),(t=t.concat(f)).push(2),oe(t,d.length);var a=t.concat(d),c=[48];return oe(c,a.length),c=c.concat(a),v.encode(c,e)};var Ee=v.assert;function B(e){if(!(this instanceof B))return new B(e);typeof e=="string"&&(Ee(Q.hasOwnProperty(e),"Unknown curve "+e),e=Q[e]),e instanceof Q.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Ye=B;B.prototype.keyPair=function(e){return new ne(this,e)},B.prototype.keyFromPrivate=function(e,f){return ne.fromPrivate(this,e,f)},B.prototype.keyFromPublic=function(e,f){return ne.fromPublic(this,e,f)},B.prototype.genKeyPair=function(e){e||(e={});var f=new ue({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||ce(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});if(this.curve.type==="mont"){var d=new u(f.generate(32));return this.keyFromPrivate(d)}for(var t=this.n.byteLength(),a=this.n.sub(new u(2));;)if(!((d=new u(f.generate(t))).cmp(a)>0))return d.iaddn(1),this.keyFromPrivate(d)},B.prototype._truncateToN=function(e,f,d){var t=(d=d||8*e.byteLength())-this.n.bitLength();return t>0&&(e=e.ushrn(t)),!f&&e.cmp(this.n)>=0?e.sub(this.n):e},B.prototype.truncateMsg=function(e){var f;return e instanceof Uint8Array?(f=8*e.byteLength,e=this._truncateToN(new u(e,16),!1,f)):typeof e=="string"?(f=4*e.length,e=this._truncateToN(new u(e,16),!1,f)):e=this._truncateToN(new u(e,16)),e},B.prototype.sign=function(e,f,d,t){typeof d=="object"&&(t=d,d=null),t||(t={}),f=this.keyFromPrivate(f,d),e=this.truncateMsg(e);for(var a=this.n.byteLength(),c=f.getPrivate().toArray("be",a),r=e.toArray("be",a),b=new ue({hash:this.hash,entropy:c,nonce:r,pers:t.pers,persEnc:t.persEnc||"utf8"}),i=this.n.sub(new u(1)),n=0;;n++){var o=t.k?t.k(n):new u(b.generate(this.n.byteLength()));if(!((o=this._truncateToN(o,!0)).cmpn(1)<=0||o.cmp(i)>=0)){var s=this.g.mul(o);if(!s.isInfinity()){var h=s.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var y=o.invm(this.n).mul(p.mul(f.getPrivate()).iadd(e));if((y=y.umod(this.n)).cmpn(0)!==0){var w=(s.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return t.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),w^=1),new ee({r:p,s:y,recoveryParam:w})}}}}}},B.prototype.verify=function(e,f,d,t){return d=this.keyFromPublic(d,t),f=new ee(f,"hex"),this._verify(this.truncateMsg(e),f,d)||this._verify(this._truncateToN(new u(e,16)),f,d)},B.prototype._verify=function(e,f,d){var t=f.r,a=f.s;if(t.cmpn(1)<0||t.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c,r=a.invm(this.n),b=r.mul(e).umod(this.n),i=r.mul(t).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(b,d.getPublic(),i)).isInfinity()&&c.eqXToP(t):!(c=this.g.mulAdd(b,d.getPublic(),i)).isInfinity()&&c.getX().umod(this.n).cmp(t)===0},B.prototype.recoverPubKey=function(e,f,d,t){Ee((3&d)===d,"The recovery param is more than two bits"),f=new ee(f,t);var a=this.n,c=new u(e),r=f.r,b=f.s,i=1&d,n=d>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&n)throw Error("Unable to find sencond key candinate");r=n?this.curve.pointFromX(r.add(this.curve.n),i):this.curve.pointFromX(r,i);var o=f.r.invm(a),s=a.sub(c).mul(o).umod(a),h=b.mul(o).umod(a);return this.g.mulAdd(s,r,h)},B.prototype.getKeyRecoveryParam=function(e,f,d,t){if((f=new ee(f,t)).recoveryParam!==null)return f.recoveryParam;for(var a=0;a<4;a++){var c;try{c=this.recoverPubKey(e,f,a)}catch{continue}if(c.eq(d))return a}throw Error("Unable to find valid recovery factor")};var me=v.assert,Ae=v.parseBytes,V=v.cachedProperty;function S(e,f){if(this.eddsa=e,f.hasOwnProperty("secret")&&(this._secret=Ae(f.secret)),e.isPoint(f.pub))this._pub=f.pub;else if(this._pubBytes=Ae(f.pub),this._pubBytes&&this._pubBytes.length===33&&this._pubBytes[0]===64&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&this._pubBytes.length!==32)throw Error("Unknown point compression format")}S.fromPublic=function(e,f){return f instanceof S?f:new S(e,{pub:f})},S.fromSecret=function(e,f){return f instanceof S?f:new S(e,{secret:f})},S.prototype.secret=function(){return this._secret},V(S,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),V(S,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),V(S,"privBytes",function(){var e=this.eddsa,f=this.hash(),d=e.encodingLength-1,t=f.slice(0,e.encodingLength);return t[0]&=248,t[d]&=127,t[d]|=64,t}),V(S,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),V(S,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),V(S,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),S.prototype.sign=function(e){return me(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},S.prototype.verify=function(e,f){return this.eddsa.verify(e,f,this)},S.prototype.getSecret=function(e){return me(this._secret,"KeyPair is public only"),v.encode(this.secret(),e)},S.prototype.getPublic=function(e,f){return v.encode((f?[64]:[]).concat(this.pubBytes()),e)};var he=S,He=v.assert,fe=v.cachedProperty,We=v.parseBytes;function J(e,f){this.eddsa=e,typeof f!="object"&&(f=We(f)),Array.isArray(f)&&(f={R:f.slice(0,e.encodingLength),S:f.slice(e.encodingLength)}),He(f.R&&f.S,"Signature without R or S"),e.isPoint(f.R)&&(this._R=f.R),f.S instanceof u&&(this._S=f.S),this._Rencoded=Array.isArray(f.R)?f.R:f.Rencoded,this._Sencoded=Array.isArray(f.S)?f.S:f.Sencoded}fe(J,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),fe(J,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),fe(J,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),fe(J,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),J.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},J.prototype.toHex=function(){return v.encode(this.toBytes(),"hex").toUpperCase()};var ge=J,Ge=v.assert,Se=v.parseBytes;function M(e){if(Ge(e==="ed25519","only tested with ed25519 so far"),!(this instanceof M))return new M(e);e=Q[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=C.sha512}var Qe=M;M.prototype.sign=function(e,f){e=Se(e);var d=this.keyFromSecret(f),t=this.hashInt(d.messagePrefix(),e),a=this.g.mul(t),c=this.encodePoint(a),r=this.hashInt(c,d.pubBytes(),e).mul(d.priv()),b=t.add(r).umod(this.curve.n);return this.makeSignature({R:a,S:b,Rencoded:c})},M.prototype.verify=function(e,f,d){e=Se(e),f=this.makeSignature(f);var t=this.keyFromPublic(d),a=this.hashInt(f.Rencoded(),t.pubBytes(),e),c=this.g.mul(f.S());return f.R().add(t.pub().mul(a)).eq(c)},M.prototype.hashInt=function(){for(var e=this.hash(),f=0;fi.map(i=>d[i]); -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=t(i);fetch(i.href,a)}})();var fc=Object.defineProperty,dc=(r,e,t)=>e in r?fc(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Hr=(r,e,t)=>(dc(r,typeof e!="symbol"?e+"":e,t),t);function yc(r,e){const t=Object.create(null),n=r.split(",");for(let i=0;i!!t[i]}function vo(r){if(he(r)){const e={};for(let t=0;t{if(t){const n=t.split(gc);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function Ao(r){let e="";if(Kn(r))e=r;else if(he(r))for(let t=0;tEn(t,e))}const bc=Object.assign,kc=(r,e)=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)},vc=Object.prototype.hasOwnProperty,Hs=(r,e)=>vc.call(r,e),he=Array.isArray,ja=r=>_o(r)==="[object Map]",p1=r=>r instanceof Date,Kn=r=>typeof r=="string",$s=r=>typeof r=="symbol",Or=r=>r!==null&&typeof r=="object",Ac=Object.prototype.toString,_o=r=>Ac.call(r),_c=r=>_o(r).slice(8,-1),qs=r=>Kn(r)&&r!=="NaN"&&r[0]!=="-"&&""+parseInt(r,10)===r,Eo=r=>{const e=Object.create(null);return t=>e[t]||(e[t]=r(t))},Ec=/-(\w)/g,Sc=Eo(r=>r.replace(Ec,(e,t)=>t?t.toUpperCase():"")),Pc=/\B([A-Z])/g,So=Eo(r=>r.replace(Pc,"-$1").toLowerCase()),Uc=(r,e)=>!Object.is(r,e),g1=r=>{const e=parseFloat(r);return isNaN(e)?r:e};let Kc;function Po(r,e){e=e||Kc,e&&e.active&&e.effects.push(r)}const Uo=r=>{const e=new Set(r);return e.w=0,e.n=0,e},Ko=r=>(r.w&Mr)>0,Co=r=>(r.n&Mr)>0,Cc=({deps:r})=>{if(r.length)for(let e=0;e{const{deps:e}=r;if(e.length){let t=0;for(let n=0;n0?Nn[e-1]:void 0}}stop(){this.active&&(w1(this),this.onStop&&this.onStop(),this.active=!1)}};function w1(r){const{deps:e}=r;if(e.length){for(let t=0;t{(c==="length"||c>=n)&&o.push(u)});else switch(t!==void 0&&o.push(s.get(t)),e){case"add":he(r)?qs(t)&&o.push(s.get("length")):(o.push(s.get(Wi)),ja(r)&&o.push(s.get(m1)));break;case"delete":he(r)||(o.push(s.get(Wi)),ja(r)&&o.push(s.get(m1)));break;case"set":ja(r)&&o.push(s.get(Wi));break}if(o.length===1)o[0]&&b1(o[0]);else{const u=[];for(const c of o)c&&u.push(...c);b1(Uo(u))}}function b1(r,e){for(const t of he(r)?r:[...r])(t!==en||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}const Oc=yc("__proto__,__v_isRef,__isVue"),xo=new Set(Object.getOwnPropertyNames(Symbol).map(r=>Symbol[r]).filter($s)),Mc=Io(),Nc=Io(!0),k1=Fc();function Fc(){const r={};return["includes","indexOf","lastIndexOf"].forEach(e=>{r[e]=function(...t){const n=rn(this);for(let a=0,s=this.length;a{r[e]=function(...t){Tc();const n=rn(this)[e].apply(this,t);return Do(),n}}),r}function Io(r=!1,e=!1){return function(t,n,i){if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_raw"&&i===(r?e?Qc:To:e?Zc:Bo).get(t))return t;const a=he(t);if(!r&&a&&Hs(k1,n))return Reflect.get(k1,n,i);const s=Reflect.get(t,n,i);return($s(n)?xo.has(n):Oc(n))||(r||_a(t,"get",n),e)?s:_s(s)?!a||!qs(n)?s.value:s:Or(s)?r?Jc(s):Ea(s):s}}const Hc=$c();function $c(r=!1){return function(e,t,n,i){let a=e[t];if(!r&&!t5(n)&&(n=rn(n),a=rn(a),!he(e)&&_s(a)&&!_s(n)))return a.value=n,!0;const s=he(e)&&qs(t)?Number(t)e5.then(r),v1=r=>{ea.includes(r)||ea.push(r),Es||(Es=!0,Sa(r5))},r5=()=>{for(const r of ea)r();ea.length=0,Es=!1},n5=/^(spellcheck|draggable|form|list|type)$/,Ss=({el:r,get:e,effect:t,arg:n,modifiers:i})=>{let a;n==="class"&&(r._class=r.className),t(()=>{let s=e();if(n)i?.camel&&(n=Sc(n)),Ga(r,n,s,a);else{for(const o in s)Ga(r,o,s[o],a&&a[o]);for(const o in a)(!s||!(o in s))&&Ga(r,o,null)}a=s})},Ga=(r,e,t,n)=>{if(e==="class")r.setAttribute("class",Ao(r._class?[r._class,t]:t)||"");else if(e==="style"){t=vo(t);const{style:i}=r;if(!t)r.removeAttribute("style");else if(Kn(t))t!==n&&(i.cssText=t);else{for(const a in t)Ps(i,a,t[a]);if(n&&!Kn(n))for(const a in n)t[a]==null&&Ps(i,a,"")}}else!(r instanceof SVGElement)&&e in r&&!n5.test(e)?(r[e]=t,e==="value"&&(r._value=t)):e==="true-value"?r._trueValue=t:e==="false-value"?r._falseValue=t:t!=null?r.setAttribute(e,t):r.removeAttribute(e)},A1=/\s*!important$/,Ps=(r,e,t)=>{he(t)?t.forEach(n=>Ps(r,e,n)):e.startsWith("--")?r.setProperty(e,t):A1.test(t)?r.setProperty(So(e),t.replace(A1,""),"important"):r[e]=t},xr=(r,e)=>{const t=r.getAttribute(e);return t!=null&&r.removeAttribute(e),t},Sr=(r,e,t,n)=>{r.addEventListener(e,t,n)},i5=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,a5=["ctrl","shift","alt","meta"],s5={stop:r=>r.stopPropagation(),prevent:r=>r.preventDefault(),self:r=>r.target!==r.currentTarget,ctrl:r=>!r.ctrlKey,shift:r=>!r.shiftKey,alt:r=>!r.altKey,meta:r=>!r.metaKey,left:r=>"button"in r&&r.button!==0,middle:r=>"button"in r&&r.button!==1,right:r=>"button"in r&&r.button!==2,exact:(r,e)=>a5.some(t=>r[`${t}Key`]&&!e[t])},zo=({el:r,get:e,exp:t,arg:n,modifiers:i})=>{if(!n)return;let a=i5.test(t)?e(`(e => ${t}(e))`):e(`($event => { ${t} })`);if(n==="vue:mounted"){Sa(a);return}else if(n==="vue:unmounted")return()=>a();if(i){n==="click"&&(i.right&&(n="contextmenu"),i.middle&&(n="mouseup"));const s=a;a=o=>{if(!("key"in o&&!(So(o.key)in i))){for(const u in i){const c=s5[u];if(c&&c(o,i))return}return s(o)}}}Sr(r,n,a,i)},o5=({el:r,get:e,effect:t})=>{const n=r.style.display;t(()=>{r.style.display=e()?n:"none"})},Lo=({el:r,get:e,effect:t})=>{t(()=>{r.textContent=Oo(e())})},Oo=r=>r==null?"":Or(r)?JSON.stringify(r,null,2):String(r),c5=({el:r,get:e,effect:t})=>{t(()=>{r.innerHTML=e()})},u5=({el:r,exp:e,get:t,effect:n,modifiers:i})=>{const a=r.type,s=t(`(val) => { ${e} = val }`),{trim:o,number:u=a==="number"}=i||{};if(r.tagName==="SELECT"){const c=r;Sr(r,"change",()=>{const h=Array.prototype.filter.call(c.options,l=>l.selected).map(l=>u?g1(Ar(l)):Ar(l));s(c.multiple?h:h[0])}),n(()=>{const h=t(),l=c.multiple;for(let w=0,y=c.options.length;w-1:K.selected=h.has(C);else if(En(Ar(K),h)){c.selectedIndex!==w&&(c.selectedIndex=w);return}}!l&&c.selectedIndex!==-1&&(c.selectedIndex=-1)})}else if(a==="checkbox"){Sr(r,"change",()=>{const h=t(),l=r.checked;if(he(h)){const w=Ar(r),y=qa(h,w),K=y!==-1;if(l&&!K)s(h.concat(w));else if(!l&&K){const C=[...h];C.splice(y,1),s(C)}}else s(_1(r,l))});let c;n(()=>{const h=t();he(h)?r.checked=qa(h,Ar(r))>-1:h!==c&&(r.checked=En(h,_1(r,!0))),c=h})}else if(a==="radio"){Sr(r,"change",()=>{s(Ar(r))});let c;n(()=>{const h=t();h!==c&&(r.checked=En(h,Ar(r)))})}else{const c=h=>o?h.trim():u?g1(h):h;Sr(r,"compositionstart",h5),Sr(r,"compositionend",l5),Sr(r,i?.lazy?"change":"input",()=>{r.composing||s(c(r.value))}),o&&Sr(r,"change",()=>{r.value=r.value.trim()}),n(()=>{if(r.composing)return;const h=r.value,l=t();document.activeElement===r&&c(h)===l||h!==l&&(r.value=l)})}},Ar=r=>"_value"in r?r._value:r.value,_1=(r,e)=>{const t=e?"_trueValue":"_falseValue";return t in r?r[t]:e},h5=r=>{r.target.composing=!0},l5=r=>{const e=r.target;e.composing&&(e.composing=!1,f5(e,"input"))},f5=(r,e)=>{const t=document.createEvent("HTMLEvents");t.initEvent(e,!0,!0),r.dispatchEvent(t)},E1=Object.create(null),yi=(r,e,t)=>Mo(r,`return(${e})`,t),Mo=(r,e,t)=>{const n=E1[e]||(E1[e]=d5(e));try{return n(r,t)}catch(i){console.error(i)}},d5=r=>{try{return new Function("$data","$el",`with($data){${r}}`)}catch(e){return console.error(`${e.message} in expression: ${r}`),()=>{}}},y5=({el:r,ctx:e,exp:t,effect:n})=>{Sa(()=>n(()=>Mo(e.scope,t,r)))},p5={bind:Ss,on:zo,show:o5,text:Lo,html:c5,model:u5,effect:y5},g5=(r,e,t)=>{const n=r.parentElement,i=new Comment("v-if");n.insertBefore(i,r);const a=[{exp:e,el:r}];let s,o;for(;(s=r.nextElementSibling)&&(o=null,xr(s,"v-else")===""||(o=xr(s,"v-else-if")));)n.removeChild(s),a.push({exp:o,el:s});const u=r.nextSibling;n.removeChild(r);let c,h=-1;const l=()=>{c&&(n.insertBefore(i,c.el),c.remove(),c=void 0)};return t.effect(()=>{for(let w=0;w{const n=e.match(m5);if(!n)return;const i=r.nextSibling,a=r.parentElement,s=new Text("");a.insertBefore(s,r),a.removeChild(r);const o=n[2].trim();let u=n[1].trim().replace(w5,"").trim(),c,h=!1,l,w,y="key",K=r.getAttribute(y)||r.getAttribute(y=":key")||r.getAttribute(y="v-bind:key");K&&(r.removeAttribute(y),y==="key"&&(K=JSON.stringify(K)));let C;(C=u.match(S1))&&(u=u.replace(S1,"").trim(),l=C[1].trim(),C[2]&&(w=C[2].trim())),(C=u.match(b5))&&(c=C[1].split(",").map(j=>j.trim()),h=u[0]==="[");let M=!1,H,Q,F;const E=j=>{const G=new Map,Z=[];if(he(j))for(let tt=0;tt{const rt={};c?c.forEach((O,ft)=>rt[O]=G[h?ft:O]):rt[u]=G,tt?(l&&(rt[l]=tt),w&&(rt[w]=Z)):l&&(rt[l]=Z);const dt=$o(t,rt),it=K?yi(dt.scope,K):Z;return j.set(it,Z),dt.key=it,dt},q=(j,G)=>{const Z=new Gs(r,j);return Z.key=j.key,Z.insert(a,G),Z};return t.effect(()=>{const j=yi(t.scope,o),G=F;if([Q,F]=E(j),!M)H=Q.map(Z=>q(Z,s)),M=!0;else{for(let it=0;it{let i;return n(()=>{const a=t();e[a]=r,i&&a!==i&&delete e[i],i=a}),()=>{i&&delete e[i]}},v5=/^(?:v-|:|@)/,A5=/\.([\w-]+)/g;let Us=!1;const Fo=(r,e)=>{const t=r.nodeType;if(t===1){const n=r;if(n.hasAttribute("v-pre"))return;xr(n,"v-cloak");let i;if(i=xr(n,"v-if"))return g5(n,i,e);if(i=xr(n,"v-for"))return k5(n,i,e);if((i=xr(n,"v-scope"))||i===""){const o=i?yi(e.scope,i):{};e=$o(e,o),o.$template&&_5(n,o.$template)}const a=xr(n,"v-once")!=null;a&&(Us=!0),(i=xr(n,"ref"))&&Ks(n,No,`"${i}"`,e),P1(n,e);const s=[];for(const{name:o,value:u}of[...n.attributes])v5.test(o)&&o!=="v-cloak"&&(o==="v-model"?s.unshift([o,u]):o[0]==="@"||/^v-on\b/.test(o)?s.push([o,u]):U1(n,o,u,e));for(const[o,u]of s)U1(n,o,u,e);a&&(Us=!1)}else if(t===3){const n=r.data;if(n.includes(e.delimiters[0])){let i=[],a=0,s;for(;s=e.delimitersRE.exec(n);){const o=n.slice(a,s.index);o&&i.push(JSON.stringify(o)),i.push(`$s(${s[1]})`),a=s.index+s[0].length}a{let t=r.firstChild;for(;t;)t=Fo(t,e)||t.nextSibling},U1=(r,e,t,n)=>{let i,a,s;if(e=e.replace(A5,(o,u)=>((s||(s={}))[u]=!0,"")),e[0]===":")i=Ss,a=e.slice(1);else if(e[0]==="@")i=zo,a=e.slice(1);else{const o=e.indexOf(":"),u=o>0?e.slice(2,o):e.slice(2);i=p5[u]||n.dirs[u],a=o>0?e.slice(o+1):void 0}i&&(i===Ss&&a==="ref"&&(i=No),Ks(r,i,t,n,a,s),r.removeAttribute(e))},Ks=(r,e,t,n,i,a)=>{const s=e({el:r,get:(o=t)=>yi(n.scope,o,r),effect:n.effect,ctx:n,exp:t,arg:i,modifiers:a});s&&n.cleanups.push(s)},_5=(r,e)=>{if(e[0]==="#"){const t=document.querySelector(e);r.appendChild(t.content.cloneNode(!0));return}r.innerHTML=e},Ho=r=>{const e={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...r,scope:r?r.scope:Ea({}),dirs:r?r.dirs:{},effects:[],blocks:[],cleanups:[],effect:t=>{if(Us)return v1(t),t;const n=Ic(t,{scheduler:()=>v1(n)});return e.effects.push(n),n}};return e},$o=(r,e={})=>{const t=r.scope,n=Object.create(t);Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),n.$refs=Object.create(t.$refs);const i=Ea(new Proxy(n,{set(a,s,o,u){return u===i&&!a.hasOwnProperty(s)?Reflect.set(t,s,o):Reflect.set(a,s,o,u)}}));return qo(i),{...r,scope:i}},qo=r=>{for(const e of Object.keys(r))typeof r[e]=="function"&&(r[e]=r[e].bind(r))};let Gs=class{constructor(e,t,n=!1){Hr(this,"template"),Hr(this,"ctx"),Hr(this,"key"),Hr(this,"parentCtx"),Hr(this,"isFragment"),Hr(this,"start"),Hr(this,"end"),this.isFragment=e instanceof HTMLTemplateElement,n?this.template=e:this.isFragment?this.template=e.content.cloneNode(!0):this.template=e.cloneNode(!0),n?this.ctx=t:(this.parentCtx=t,t.blocks.push(this),this.ctx=Ho(t)),Fo(this.template,this.ctx)}get el(){return this.start||this.template}insert(e,t=null){if(this.isFragment)if(this.start){let n=this.start,i;for(;n&&(i=n.nextSibling,e.insertBefore(n,t),n!==this.end);)n=i}else this.start=new Text(""),this.end=new Text(""),e.insertBefore(this.end,t),e.insertBefore(this.start,this.end),e.insertBefore(this.template,this.end);else e.insertBefore(this.template,t)}remove(){if(this.parentCtx&&kc(this.parentCtx.blocks,this),this.start){const e=this.start.parentNode;let t=this.start,n;for(;t&&(n=t.nextSibling,e.removeChild(t),t!==this.end);)t=n}else this.template.parentNode.removeChild(this.template);this.teardown()}teardown(){this.ctx.blocks.forEach(e=>{e.teardown()}),this.ctx.effects.forEach(Bc),this.ctx.cleanups.forEach(e=>e())}};const K1=r=>r.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),jo=r=>{const e=Ho();if(r&&(e.scope=Ea(r),qo(e.scope),r.$delimiters)){const[n,i]=e.delimiters=r.$delimiters;e.delimitersRE=new RegExp(K1(n)+"([^]+?)"+K1(i),"g")}e.scope.$s=Oo,e.scope.$nextTick=Sa,e.scope.$refs=Object.create(null);let t;return{directive(n,i){return i?(e.dirs[n]=i,this):e.dirs[n]},mount(n){if(typeof n=="string"&&(n=document.querySelector(n),!n))return;n=n||document.documentElement;let i;return n.hasAttribute("v-scope")?i=[n]:i=[...n.querySelectorAll("[v-scope]")].filter(a=>!a.matches("[v-scope] [v-scope]")),i.length||(i=[n]),t=i.map(a=>new Gs(a,e,!0)),this},unmount(){t.forEach(n=>n.teardown())}}},C1=document.currentScript;C1&&C1.hasAttribute("init")&&jo().mount();const E5="modulepreload",S5=function(r,e){return new URL(r,e).href},D1={},Vr=function(e,t,n){let i=Promise.resolve();if(t&&t.length>0){const a=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");i=Promise.all(t.map(u=>{if(u=S5(u,n),u in D1)return;D1[u]=!0;const c=u.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(!!n)for(let y=a.length-1;y>=0;y--){const K=a[y];if(K.href===u&&(!c||K.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const w=document.createElement("link");if(w.rel=c?"stylesheet":E5,c||(w.as="script",w.crossOrigin=""),w.href=u,o&&w.setAttribute("nonce",o),document.head.appendChild(w),c)return new Promise((y,K)=>{w.addEventListener("load",y),w.addEventListener("error",()=>K(new Error(`Unable to preload CSS for ${u}`)))})}))}return i.then(()=>e()).catch(a=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a})},Je=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vn=Symbol("doneWritingPromise"),Go=Symbol("doneWritingResolve"),Wo=Symbol("doneWritingReject"),Fn=Symbol("readingIndex");class Qe extends Array{constructor(){super(),this[vn]=new Promise((e,t)=>{this[Go]=e,this[Wo]=t}),this[vn].catch(()=>{})}}function le(r){return r&&r.getReader&&Array.isArray(r)}function Vn(r){if(!le(r)){const e=r.getWriter(),t=e.releaseLock;return e.releaseLock=()=>{e.closed.catch(function(){}),t.call(e)},e}this.stream=r}Qe.prototype.getReader=function(){return this[Fn]===void 0&&(this[Fn]=0),{read:async()=>(await this[vn],this[Fn]===this.length?{value:void 0,done:!0}:{value:this[this[Fn]++],done:!1})}},Qe.prototype.readToEnd=async function(r){await this[vn];const e=r(this.slice(this[Fn]));return this.length=0,e},Qe.prototype.clone=function(){const r=new Qe;return r[vn]=this[vn].then(()=>{r.push(...this)}),r},Vn.prototype.write=async function(r){this.stream.push(r)},Vn.prototype.close=async function(){this.stream[Go]()},Vn.prototype.abort=async function(r){return this.stream[Wo](r),r},Vn.prototype.releaseLock=function(){};const Pa=typeof Je.process=="object"&&typeof Je.process.versions=="object",x1=Pa&&void 0;function ve(r){return le(r)?"array":Je.ReadableStream&&Je.ReadableStream.prototype.isPrototypeOf(r)?"web":Dn&&Dn.prototype.isPrototypeOf(r)?"ponyfill":x1&&x1.prototype.isPrototypeOf(r)?"node":!(!r||!r.getReader)&&"web-like"}function Ua(r){return Uint8Array.prototype.isPrototypeOf(r)}function Vo(r){if(r.length===1)return r[0];let e=0;for(let i=0;i{t||(P5.isBuffer(i)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),n.enqueue(i),e.pause())}),e.on("end",()=>{t||n.close()}),e.on("error",i=>n.error(i))},pull(){e.resume()},cancel(n){t=!0,e.destroy(n)}})};class r extends I1{constructor(t,n){super(n),this._reader=on(t)}async _read(t){try{for(;;){const{done:n,value:i}=await this._reader.read();if(n){this.push(null);break}if(!this.push(i))break}}catch(n){this.destroy(n)}}async _destroy(t,n){this._reader.cancel(t).then(n,n)}}Zo=function(e,t){return new r(e,t)}}const B1=new WeakSet,Gt=Symbol("externalBuffer");function qe(r){if(this.stream=r,r[Gt]&&(this[Gt]=r[Gt].slice()),le(r)){const n=r.getReader();return this._read=n.read.bind(n),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let e=ve(r);if(e==="node"&&(r=Ka(r)),e){const n=r.getReader();return this._read=n.read.bind(n),this._releaseLock=()=>{n.closed.catch(function(){}),n.releaseLock()},void(this._cancel=n.cancel.bind(n))}let t=!1;this._read=async()=>t||B1.has(r)?{value:void 0,done:!0}:(t=!0,{value:r,done:!1}),this._releaseLock=()=>{if(t)try{B1.add(r)}catch{}}}qe.prototype.read=async function(){return this[Gt]&&this[Gt].length?{done:!1,value:this[Gt].shift()}:this._read()},qe.prototype.releaseLock=function(){this[Gt]&&(this.stream[Gt]=this[Gt]),this._releaseLock()},qe.prototype.cancel=function(r){return this._cancel(r)},qe.prototype.readLine=async function(){let r,e=[];for(;!r;){let{done:t,value:n}=await this.read();if(n+="",t)return e.length?Ue(e):void 0;const i=n.indexOf(` -`)+1;i&&(r=Ue(e.concat(n.substr(0,i))),e=[]),i!==n.length&&e.push(n.substr(i))}return this.unshift(...e),r},qe.prototype.readByte=async function(){const{done:r,value:e}=await this.read();if(r)return;const t=e[0];return this.unshift(_e(e,1)),t},qe.prototype.readBytes=async function(r){const e=[];let t=0;for(;;){const{done:n,value:i}=await this.read();if(n)return e.length?Ue(e):void 0;if(e.push(i),t+=i.length,t>=r){const a=Ue(e);return this.unshift(_e(a,r)),_e(a,0,r)}}},qe.prototype.peekBytes=async function(r){const e=await this.readBytes(r);return this.unshift(e),e},qe.prototype.unshift=function(...r){this[Gt]||(this[Gt]=[]),r.length===1&&Ua(r[0])&&this[Gt].length&&r[0].length&&this[Gt][0].byteOffset>=r[0].length?this[Gt][0]=new Uint8Array(this[Gt][0].buffer,this[Gt][0].byteOffset-r[0].length,this[Gt][0].byteLength+r[0].length):this[Gt].unshift(...r.filter(e=>e&&e.length))},qe.prototype.readToEnd=async function(r=Ue){const e=[];for(;;){const{done:t,value:n}=await this.read();if(t)break;e.push(n)}return r(e)};let T1,{ReadableStream:Dn,WritableStream:U5,TransformStream:Ws}=Je;const ai=Pa&&void 0;function Vs(r){let e=ve(r);return e==="node"?Ka(r):e==="web"&&T1?T1(r):e?r:new Dn({start(t){t.enqueue(r),t.close()}})}function Qo(r){if(ve(r))return r;const e=new Qe;return(async()=>{const t=Oe(e);await t.write(r),await t.close()})(),e}function Ue(r){return r.some(e=>ve(e)&&!le(e))?function(e){e=e.map(Vs);const t=Yo(async function(a){await Promise.all(i.map(s=>K5(s,a)))});let n=Promise.resolve();const i=e.map((a,s)=>gi(a,(o,u)=>(n=n.then(()=>pi(o,t.writable,{preventClose:s!==e.length-1})),n)));return t.readable}(r):r.some(e=>le(e))?function(e){const t=new Qe;let n=Promise.resolve();return e.forEach((i,a)=>(n=n.then(()=>pi(i,t,{preventClose:a!==e.length-1})),n)),t}(r):typeof r[0]=="string"?r.join(""):ai&&ai.isBuffer(r[0])?ai.concat(r):Vo(r)}function on(r){return new qe(r)}function Oe(r){return new Vn(r)}async function pi(r,e,{preventClose:t=!1,preventAbort:n=!1,preventCancel:i=!1}={}){if(ve(r)&&!le(r)){r=Vs(r);try{if(r[Gt]){const o=Oe(e);for(let u=0;u{e=o,t=u}),e=null,t=null)},close:n.close.bind(n),abort:n.error.bind(n)})}}function Yt(r,e=()=>{},t=()=>{}){if(le(r)){const a=new Qe;return(async()=>{const s=Oe(a);try{const o=await sr(r),u=e(o),c=t();let h;h=u!==void 0&&c!==void 0?Ue([u,c]):u!==void 0?u:c,await s.write(h),await s.close()}catch(o){await s.abort(o)}})(),a}if(ve(r))return Xo(r,{async transform(a,s){try{const o=await e(a);o!==void 0&&s.enqueue(o)}catch(o){s.error(o)}},async flush(a){try{const s=await t();s!==void 0&&a.enqueue(s)}catch(s){a.error(s)}}});const n=e(r),i=t();return n!==void 0&&i!==void 0?Ue([n,i]):n!==void 0?n:i}function gi(r,e){if(ve(r)&&!le(r)){let n;const i=new Ws({start(o){n=o}}),a=pi(r,i.writable),s=Yo(async function(o){n.error(o),await a,await new Promise(setTimeout)});return e(i.readable,s.writable),s.readable}r=Qo(r);const t=new Qe;return e(r,t),t}function ra(r){if(le(r))return r.clone();if(ve(r)){const e=function(t){if(le(t))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(ve(t)){const n=Vs(t).tee();return n[0][Gt]=n[1][Gt]=t[Gt],n}return[_e(t),_e(t)]}(r);return t2(r,e[0]),e[1]}return _e(r)}function Jo(r){return le(r)?ra(r):ve(r)?new Dn({start(e){const t=gi(r,async(n,i)=>{const a=on(n),s=Oe(i);try{for(;;){await s.ready;const{done:o,value:u}=await a.read();if(o){try{e.close()}catch{}return void await s.close()}try{e.enqueue(u)}catch{}await s.write(u)}}catch(o){e.error(o),await s.abort(o)}});t2(r,t)}}):_e(r)}function t2(r,e){Object.entries(Object.getOwnPropertyDescriptors(r.constructor.prototype)).forEach(([t,n])=>{t!=="constructor"&&(n.value?n.value=n.value.bind(e):n.get=n.get.bind(e),Object.defineProperty(r,t,n))})}function _e(r,e=0,t=1/0){if(le(r))throw Error("Not implemented");if(ve(r)){if(e>=0&&t>=0){let n=0;return Xo(r,{transform(i,a){n=e&&a.enqueue(_e(i,Math.max(e-n,0),t-n)),n+=i.length):a.terminate()}})}if(e<0&&(t<0||t===1/0)){let n=[];return Yt(r,i=>{i.length>=-e?n=[i]:n.push(i)},()=>_e(Ue(n),e,t))}if(e===0&&t<0){let n;return Yt(r,i=>{const a=n?Ue([n,i]):i;if(a.length>=-t)return n=_e(a,t),_e(a,e,t);n=a})}return console.warn(`stream.slice(input, ${e}, ${t}) not implemented efficiently.`),Ei(async()=>_e(await sr(r),e,t))}return r[Gt]&&(r=Ue(r[Gt].concat([r]))),!Ua(r)||ai&&ai.isBuffer(r)?r.slice(e,t):(t===1/0&&(t=r.length),r.subarray(e,t))}async function sr(r,e=Ue){return le(r)?r.readToEnd(e):ve(r)?on(r).readToEnd(e):r}async function K5(r,e){if(ve(r)){if(r.cancel)return r.cancel(e);if(r.destroy)return r.destroy(e),await new Promise(setTimeout),e}}function Ei(r){const e=new Qe;return(async()=>{const t=Oe(e);try{await t.write(await r()),await t.close()}catch(n){await t.abort(n)}})(),e}class me{constructor(e){if(e===void 0)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const t=e,n=Array(t.length);for(let i=0;iBigInt(0);){const s=n&BigInt(1);n>>=BigInt(1);const o=a*i%t.value;a=s?o:a,i=i*i%t.value}return new me(a)}modInv(e){const{gcd:t,x:n}=this._egcd(e);if(!t.isOne())throw Error("Inverse does not exist");return n.add(e).mod(e)}_egcd(e){let t=BigInt(0),n=BigInt(1),i=BigInt(1),a=BigInt(0),s=this.value;for(e=e.value;e!==BigInt(0);){const o=s/e;let u=t;t=i-o*t,i=u,u=n,n=a-o*n,a=u,u=e,e=s%e,s=u}return{x:new me(i),y:new me(a),gcd:new me(s)}}gcd(e){let t=this.value;for(e=e.value;e!==BigInt(0);){const n=e;e=t%e,t=n}return new me(t)}ileftShift(e){return this.value<<=e.value,this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value>>=e.value,this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value===e.value}lt(e){return this.valuee.value}gte(e){return this.value>=e.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.valueNumber.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}getBit(e){return(this.value>>BigInt(e)&BigInt(1))===BigInt(0)?0:1}bitLength(){const e=new me(0),t=new me(1),n=new me(-1),i=this.isNegative()?n:e;let a=1;const s=this.clone();for(;!s.irightShift(t).equal(i);)a++;return a}byteLength(){const e=new me(0),t=new me(-1),n=this.isNegative()?t:e,i=new me(8);let a=1;const s=this.clone();for(;!s.irightShift(i).equal(n);)a++;return a}toUint8Array(e="be",t){let n=this.value.toString(16);n.length%2==1&&(n="0"+n);const i=n.length/2,a=new Uint8Array(t||i),s=t?t-i:0;let o=0;for(;otypeof BigInt<"u",Hn=Symbol("byValue");var p={curve:{p256:"p256","P-256":"p256",secp256r1:"p256",prime256v1:"p256","1.2.840.10045.3.1.7":"p256","2a8648ce3d030107":"p256","2A8648CE3D030107":"p256",p384:"p384","P-384":"p384",secp384r1:"p384","1.3.132.0.34":"p384","2b81040022":"p384","2B81040022":"p384",p521:"p521","P-521":"p521",secp521r1:"p521","1.3.132.0.35":"p521","2b81040023":"p521","2B81040023":"p521",secp256k1:"secp256k1","1.3.132.0.10":"secp256k1","2b8104000a":"secp256k1","2B8104000A":"secp256k1",ed25519Legacy:"ed25519",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",curve25519Legacy:"curve25519",X25519:"curve25519",cv25519:"curve25519",curve25519:"curve25519",Curve25519:"curve25519","1.3.6.1.4.1.3029.1.5.1":"curve25519","2b060104019755010501":"curve25519","2B060104019755010501":"curve25519",brainpoolP256r1:"brainpoolP256r1","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1","2b2403030208010107":"brainpoolP256r1","2B2403030208010107":"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1","2b240303020801010b":"brainpoolP384r1","2B240303020801010B":"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1","2b240303020801010d":"brainpoolP512r1","2B240303020801010D":"brainpoolP512r1"},s2k:{simple:0,salted:1,iterated:3,gnu:101},publicKey:{rsaEncryptSign:1,rsaEncrypt:2,rsaSign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsaLegacy:22,ed25519Legacy:22,eddsa:22,aedh:23,aedsa:24,x25519:25,x448:26,ed25519:27,ed448:28},symmetric:{plaintext:0,idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,experimentalGCM:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressedData:8,symmetricallyEncryptedData:9,marker:10,literalData:11,trust:12,userID:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtectedData:18,modificationDetectionCode:19,aeadEncryptedData:20},literal:{binary:98,text:116,utf8:117,mime:109},signature:{binary:0,text:1,standalone:2,certGeneric:16,certPersona:17,certCasual:18,certPositive:19,certRevocation:48,subkeyBinding:24,keyBinding:25,key:31,keyRevocation:32,subkeyRevocation:40,timestamp:64,thirdParty:80},signatureSubpacket:{signatureCreationTime:2,signatureExpirationTime:3,exportableCertification:4,trustSignature:5,regularExpression:6,revocable:7,keyExpirationTime:9,placeholderBackwardsCompatibility:10,preferredSymmetricAlgorithms:11,revocationKey:12,issuer:16,notationData:20,preferredHashAlgorithms:21,preferredCompressionAlgorithms:22,keyServerPreferences:23,preferredKeyServer:24,primaryUserID:25,policyURI:26,keyFlags:27,signersUserID:28,reasonForRevocation:29,features:30,signatureTarget:31,embeddedSignature:32,issuerFingerprint:33,preferredAEADAlgorithms:34},keyFlags:{certifyKeys:1,signData:2,encryptCommunication:4,encryptStorage:8,splitPrivateKey:16,authentication:32,sharedPrivateKey:128},armor:{multipartSection:0,multipartLast:1,signed:2,message:3,publicKey:4,privateKey:5,signature:6},reasonForRevocation:{noReason:0,keySuperseded:1,keyCompromised:2,keyRetired:3,userIDInvalid:32},features:{modificationDetection:1,aead:2,v5Keys:4},write:function(r,e){if(typeof e=="number"&&(e=this.read(r,e)),r[e]!==void 0)return r[e];throw Error("Invalid enum value.")},read:function(r,e){if(r[Hn]||(r[Hn]=[],Object.entries(r).forEach(([t,n])=>{r[Hn][n]=t})),r[Hn][e]!==void 0)return r[Hn][e];throw Error("Invalid enum value.")}};const R1=(()=>{try{return!1}catch{}return!1})(),_={isString:function(r){return typeof r=="string"||r instanceof String},isArray:function(r){return r instanceof Array},isUint8Array:Ua,isStream:ve,readNumber:function(r){let e=0;for(let t=0;t>8*(e-n-1)&255;return t},readDate:function(r){const e=_.readNumber(r);return new Date(1e3*e)},writeDate:function(r){const e=Math.floor(r.getTime()/1e3);return _.writeNumber(e,4)},normalizeDate:function(r=Date.now()){return r===null||r===1/0?r:new Date(1e3*Math.floor(+r/1e3))},readMPI:function(r){const e=(r[0]<<8|r[1])+7>>>3;return r.subarray(2,2+e)},leftPad(r,e){const t=new Uint8Array(e),n=e-r.length;return t.set(r,n),t},uint8ArrayToMPI:function(r){const e=_.uint8ArrayBitLength(r);if(e===0)throw Error("Zero MPI");const t=r.subarray(r.length-Math.ceil(e/8)),n=new Uint8Array([(65280&e)>>8,255&e]);return _.concatUint8Array([n,t])},uint8ArrayBitLength:function(r){let e;for(e=0;e>1);for(let t=0;t>1;t++)e[t]=parseInt(r.substr(t<<1,2),16);return e},uint8ArrayToHex:function(r){const e=[],t=r.length;let n,i=0;for(;i{if(!_.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let n=0;nt("",!0))},decodeUTF8:function(r){const e=new TextDecoder("utf-8");function t(n,i=!1){return e.decode(n,{stream:!i})}return Yt(r,t,()=>t(new Uint8Array,!0))},concat:Ue,concatUint8Array:Vo,equalsUint8Array:function(r,e){if(!_.isUint8Array(r)||!_.isUint8Array(e))throw Error("Data must be in the form of a Uint8Array");if(r.length!==e.length)return!1;for(let t=0;t>>16;return t!==0&&(r=t,e+=16),t=r>>8,t!==0&&(r=t,e+=8),t=r>>4,t!==0&&(r=t,e+=4),t=r>>2,t!==0&&(r=t,e+=2),t=r>>1,t!==0&&(r=t,e+=1),e},double:function(r){const e=new Uint8Array(r.length),t=r.length-1;for(let n=0;n>7;return e[t]=r[t]<<1^135*(r[0]>>7),e},shiftRight:function(r,e){if(e)for(let t=r.length-1;t>=0;t--)r[t]>>=e,t>0&&(r[t]|=r[t-1]<<8-e);return r},getWebCrypto:function(){return Je!==void 0&&Je.crypto&&Je.crypto.subtle},getBigInteger:async function(){if(C5())return me;{const{default:r}=await Vr(async()=>{const{default:e}=await import("./bn.interface.min-BwMVBxJQ.js");return{default:e}},__vite__mapDeps([0,1]),import.meta.url);return r}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){return typeof navigator<"u"?navigator.hardwareConcurrency||1:(void 0).cpus().length},isEmailAddress:function(r){return _.isString(r)?/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(r):!1},canonicalizeEOL:function(r){let e=!1;return Yt(r,t=>{let n;e&&(t=_.concatUint8Array([new Uint8Array([13]),t])),t[t.length-1]===13?(e=!0,t=t.subarray(0,-1)):e=!1;const i=[];for(let o=0;n=t.indexOf(10,o)+1,n;o=n)t[n-2]!==13&&i.push(n);if(!i.length)return t;const a=new Uint8Array(t.length+i.length);let s=0;for(let o=0;oe?new Uint8Array([13]):void 0)},nativeEOL:function(r){let e=!1;return Yt(r,t=>{let n;(t=e&&t[0]!==10?_.concatUint8Array([new Uint8Array([13]),t]):new Uint8Array(t))[t.length-1]===13?(e=!0,t=t.subarray(0,-1)):e=!1;let i=0;for(let a=0;a!==t.length;a=n){n=t.indexOf(13,a)+1,n||(n=t.length);const s=n-(t[n]===10?1:0);a&&t.copyWithin(i,a,s),i+=s-a}return t.subarray(0,i)},()=>e?new Uint8Array([13]):void 0)},removeTrailingSpaces:function(r){return r.split(` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./bn.interface.min-BM1yc8Pi.js","./bn.min-S9Cz8dhG.js","./elliptic.min-ClIauaBs.js"])))=>i.map(i=>d[i]); +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=t(i);fetch(i.href,a)}})();var dc=Object.defineProperty,yc=(r,e,t)=>e in r?dc(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Hr=(r,e,t)=>(yc(r,typeof e!="symbol"?e+"":e,t),t);function pc(r,e){const t=Object.create(null),n=r.split(",");for(let i=0;i!!t[i]}function Ao(r){if(he(r)){const e={};for(let t=0;t{if(t){const n=t.split(mc);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function _o(r){let e="";if(Kn(r))e=r;else if(he(r))for(let t=0;tEn(t,e))}const kc=Object.assign,vc=(r,e)=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)},Ac=Object.prototype.hasOwnProperty,Hs=(r,e)=>Ac.call(r,e),he=Array.isArray,ja=r=>Eo(r)==="[object Map]",p1=r=>r instanceof Date,Kn=r=>typeof r=="string",$s=r=>typeof r=="symbol",Or=r=>r!==null&&typeof r=="object",_c=Object.prototype.toString,Eo=r=>_c.call(r),Ec=r=>Eo(r).slice(8,-1),qs=r=>Kn(r)&&r!=="NaN"&&r[0]!=="-"&&""+parseInt(r,10)===r,So=r=>{const e=Object.create(null);return t=>e[t]||(e[t]=r(t))},Sc=/-(\w)/g,Pc=So(r=>r.replace(Sc,(e,t)=>t?t.toUpperCase():"")),Uc=/\B([A-Z])/g,Po=So(r=>r.replace(Uc,"-$1").toLowerCase()),Kc=(r,e)=>!Object.is(r,e),g1=r=>{const e=parseFloat(r);return isNaN(e)?r:e};let Cc;function Uo(r,e){e=e||Cc,e&&e.active&&e.effects.push(r)}const Ko=r=>{const e=new Set(r);return e.w=0,e.n=0,e},Co=r=>(r.w&Mr)>0,Do=r=>(r.n&Mr)>0,Dc=({deps:r})=>{if(r.length)for(let e=0;e{const{deps:e}=r;if(e.length){let t=0;for(let n=0;n0?Nn[e-1]:void 0}}stop(){this.active&&(w1(this),this.onStop&&this.onStop(),this.active=!1)}};function w1(r){const{deps:e}=r;if(e.length){for(let t=0;t{(c==="length"||c>=n)&&o.push(u)});else switch(t!==void 0&&o.push(s.get(t)),e){case"add":he(r)?qs(t)&&o.push(s.get("length")):(o.push(s.get(Wi)),ja(r)&&o.push(s.get(m1)));break;case"delete":he(r)||(o.push(s.get(Wi)),ja(r)&&o.push(s.get(m1)));break;case"set":ja(r)&&o.push(s.get(Wi));break}if(o.length===1)o[0]&&b1(o[0]);else{const u=[];for(const c of o)c&&u.push(...c);b1(Ko(u))}}function b1(r,e){for(const t of he(r)?r:[...r])(t!==en||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}const Mc=pc("__proto__,__v_isRef,__isVue"),Io=new Set(Object.getOwnPropertyNames(Symbol).map(r=>Symbol[r]).filter($s)),Nc=Bo(),Fc=Bo(!0),k1=Hc();function Hc(){const r={};return["includes","indexOf","lastIndexOf"].forEach(e=>{r[e]=function(...t){const n=rn(this);for(let a=0,s=this.length;a{r[e]=function(...t){Rc();const n=rn(this)[e].apply(this,t);return xo(),n}}),r}function Bo(r=!1,e=!1){return function(t,n,i){if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_raw"&&i===(r?e?Xc:Ro:e?Qc:To).get(t))return t;const a=he(t);if(!r&&a&&Hs(k1,n))return Reflect.get(k1,n,i);const s=Reflect.get(t,n,i);return($s(n)?Io.has(n):Mc(n))||(r||_a(t,"get",n),e)?s:_s(s)?!a||!qs(n)?s.value:s:Or(s)?r?t5(s):Ea(s):s}}const $c=qc();function qc(r=!1){return function(e,t,n,i){let a=e[t];if(!r&&!e5(n)&&(n=rn(n),a=rn(a),!he(e)&&_s(a)&&!_s(n)))return a.value=n,!0;const s=he(e)&&qs(t)?Number(t)r5.then(r),v1=r=>{ea.includes(r)||ea.push(r),Es||(Es=!0,Sa(n5))},n5=()=>{for(const r of ea)r();ea.length=0,Es=!1},i5=/^(spellcheck|draggable|form|list|type)$/,Ss=({el:r,get:e,effect:t,arg:n,modifiers:i})=>{let a;n==="class"&&(r._class=r.className),t(()=>{let s=e();if(n)i?.camel&&(n=Pc(n)),Ga(r,n,s,a);else{for(const o in s)Ga(r,o,s[o],a&&a[o]);for(const o in a)(!s||!(o in s))&&Ga(r,o,null)}a=s})},Ga=(r,e,t,n)=>{if(e==="class")r.setAttribute("class",_o(r._class?[r._class,t]:t)||"");else if(e==="style"){t=Ao(t);const{style:i}=r;if(!t)r.removeAttribute("style");else if(Kn(t))t!==n&&(i.cssText=t);else{for(const a in t)Ps(i,a,t[a]);if(n&&!Kn(n))for(const a in n)t[a]==null&&Ps(i,a,"")}}else!(r instanceof SVGElement)&&e in r&&!i5.test(e)?(r[e]=t,e==="value"&&(r._value=t)):e==="true-value"?r._trueValue=t:e==="false-value"?r._falseValue=t:t!=null?r.setAttribute(e,t):r.removeAttribute(e)},A1=/\s*!important$/,Ps=(r,e,t)=>{he(t)?t.forEach(n=>Ps(r,e,n)):e.startsWith("--")?r.setProperty(e,t):A1.test(t)?r.setProperty(Po(e),t.replace(A1,""),"important"):r[e]=t},xr=(r,e)=>{const t=r.getAttribute(e);return t!=null&&r.removeAttribute(e),t},Sr=(r,e,t,n)=>{r.addEventListener(e,t,n)},a5=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,s5=["ctrl","shift","alt","meta"],o5={stop:r=>r.stopPropagation(),prevent:r=>r.preventDefault(),self:r=>r.target!==r.currentTarget,ctrl:r=>!r.ctrlKey,shift:r=>!r.shiftKey,alt:r=>!r.altKey,meta:r=>!r.metaKey,left:r=>"button"in r&&r.button!==0,middle:r=>"button"in r&&r.button!==1,right:r=>"button"in r&&r.button!==2,exact:(r,e)=>s5.some(t=>r[`${t}Key`]&&!e[t])},Lo=({el:r,get:e,exp:t,arg:n,modifiers:i})=>{if(!n)return;let a=a5.test(t)?e(`(e => ${t}(e))`):e(`($event => { ${t} })`);if(n==="vue:mounted"){Sa(a);return}else if(n==="vue:unmounted")return()=>a();if(i){n==="click"&&(i.right&&(n="contextmenu"),i.middle&&(n="mouseup"));const s=a;a=o=>{if(!("key"in o&&!(Po(o.key)in i))){for(const u in i){const c=o5[u];if(c&&c(o,i))return}return s(o)}}}Sr(r,n,a,i)},c5=({el:r,get:e,effect:t})=>{const n=r.style.display;t(()=>{r.style.display=e()?n:"none"})},Oo=({el:r,get:e,effect:t})=>{t(()=>{r.textContent=Mo(e())})},Mo=r=>r==null?"":Or(r)?JSON.stringify(r,null,2):String(r),u5=({el:r,get:e,effect:t})=>{t(()=>{r.innerHTML=e()})},h5=({el:r,exp:e,get:t,effect:n,modifiers:i})=>{const a=r.type,s=t(`(val) => { ${e} = val }`),{trim:o,number:u=a==="number"}=i||{};if(r.tagName==="SELECT"){const c=r;Sr(r,"change",()=>{const h=Array.prototype.filter.call(c.options,l=>l.selected).map(l=>u?g1(Ar(l)):Ar(l));s(c.multiple?h:h[0])}),n(()=>{const h=t(),l=c.multiple;for(let k=0,y=c.options.length;k-1:P.selected=h.has(C);else if(En(Ar(P),h)){c.selectedIndex!==k&&(c.selectedIndex=k);return}}!l&&c.selectedIndex!==-1&&(c.selectedIndex=-1)})}else if(a==="checkbox"){Sr(r,"change",()=>{const h=t(),l=r.checked;if(he(h)){const k=Ar(r),y=qa(h,k),P=y!==-1;if(l&&!P)s(h.concat(k));else if(!l&&P){const C=[...h];C.splice(y,1),s(C)}}else s(_1(r,l))});let c;n(()=>{const h=t();he(h)?r.checked=qa(h,Ar(r))>-1:h!==c&&(r.checked=En(h,_1(r,!0))),c=h})}else if(a==="radio"){Sr(r,"change",()=>{s(Ar(r))});let c;n(()=>{const h=t();h!==c&&(r.checked=En(h,Ar(r)))})}else{const c=h=>o?h.trim():u?g1(h):h;Sr(r,"compositionstart",l5),Sr(r,"compositionend",f5),Sr(r,i?.lazy?"change":"input",()=>{r.composing||s(c(r.value))}),o&&Sr(r,"change",()=>{r.value=r.value.trim()}),n(()=>{if(r.composing)return;const h=r.value,l=t();document.activeElement===r&&c(h)===l||h!==l&&(r.value=l)})}},Ar=r=>"_value"in r?r._value:r.value,_1=(r,e)=>{const t=e?"_trueValue":"_falseValue";return t in r?r[t]:e},l5=r=>{r.target.composing=!0},f5=r=>{const e=r.target;e.composing&&(e.composing=!1,d5(e,"input"))},d5=(r,e)=>{const t=document.createEvent("HTMLEvents");t.initEvent(e,!0,!0),r.dispatchEvent(t)},E1=Object.create(null),yi=(r,e,t)=>No(r,`return(${e})`,t),No=(r,e,t)=>{const n=E1[e]||(E1[e]=y5(e));try{return n(r,t)}catch(i){console.error(i)}},y5=r=>{try{return new Function("$data","$el",`with($data){${r}}`)}catch(e){return console.error(`${e.message} in expression: ${r}`),()=>{}}},p5=({el:r,ctx:e,exp:t,effect:n})=>{Sa(()=>n(()=>No(e.scope,t,r)))},g5={bind:Ss,on:Lo,show:c5,text:Oo,html:u5,model:h5,effect:p5},m5=(r,e,t)=>{const n=r.parentElement,i=new Comment("v-if");n.insertBefore(i,r);const a=[{exp:e,el:r}];let s,o;for(;(s=r.nextElementSibling)&&(o=null,xr(s,"v-else")===""||(o=xr(s,"v-else-if")));)n.removeChild(s),a.push({exp:o,el:s});const u=r.nextSibling;n.removeChild(r);let c,h=-1;const l=()=>{c&&(n.insertBefore(i,c.el),c.remove(),c=void 0)};return t.effect(()=>{for(let k=0;k{const n=e.match(w5);if(!n)return;const i=r.nextSibling,a=r.parentElement,s=new Text("");a.insertBefore(s,r),a.removeChild(r);const o=n[2].trim();let u=n[1].trim().replace(b5,"").trim(),c,h=!1,l,k,y="key",P=r.getAttribute(y)||r.getAttribute(y=":key")||r.getAttribute(y="v-bind:key");P&&(r.removeAttribute(y),y==="key"&&(P=JSON.stringify(P)));let C;(C=u.match(S1))&&(u=u.replace(S1,"").trim(),l=C[1].trim(),C[2]&&(k=C[2].trim())),(C=u.match(k5))&&(c=C[1].split(",").map($=>$.trim()),h=u[0]==="[");let O=!1,H,X,F;const E=$=>{const V=new Map,Q=[];if(he($))for(let et=0;et<$.length;et++)Q.push(G(V,$[et],et));else if(typeof $=="number")for(let et=0;et<$;et++)Q.push(G(V,et+1,et));else if(Or($)){let et=0;for(const nt in $)Q.push(G(V,$[nt],et++,nt))}return[Q,V]},G=($,V,Q,et)=>{const nt={};c?c.forEach((M,dt)=>nt[M]=V[h?dt:M]):nt[u]=V,et?(l&&(nt[l]=et),k&&(nt[k]=Q)):l&&(nt[l]=Q);const ft=qo(t,nt),lt=P?yi(ft.scope,P):Q;return $.set(lt,Q),ft.key=lt,ft},q=($,V)=>{const Q=new Gs(r,$);return Q.key=$.key,Q.insert(a,V),Q};return t.effect(()=>{const $=yi(t.scope,o),V=F;if([X,F]=E($),!O)H=X.map(Q=>q(Q,s)),O=!0;else{for(let lt=0;lt{let i;return n(()=>{const a=t();e[a]=r,i&&a!==i&&delete e[i],i=a}),()=>{i&&delete e[i]}},A5=/^(?:v-|:|@)/,_5=/\.([\w-]+)/g;let Us=!1;const Ho=(r,e)=>{const t=r.nodeType;if(t===1){const n=r;if(n.hasAttribute("v-pre"))return;xr(n,"v-cloak");let i;if(i=xr(n,"v-if"))return m5(n,i,e);if(i=xr(n,"v-for"))return v5(n,i,e);if((i=xr(n,"v-scope"))||i===""){const o=i?yi(e.scope,i):{};e=qo(e,o),o.$template&&E5(n,o.$template)}const a=xr(n,"v-once")!=null;a&&(Us=!0),(i=xr(n,"ref"))&&Ks(n,Fo,`"${i}"`,e),P1(n,e);const s=[];for(const{name:o,value:u}of[...n.attributes])A5.test(o)&&o!=="v-cloak"&&(o==="v-model"?s.unshift([o,u]):o[0]==="@"||/^v-on\b/.test(o)?s.push([o,u]):U1(n,o,u,e));for(const[o,u]of s)U1(n,o,u,e);a&&(Us=!1)}else if(t===3){const n=r.data;if(n.includes(e.delimiters[0])){let i=[],a=0,s;for(;s=e.delimitersRE.exec(n);){const o=n.slice(a,s.index);o&&i.push(JSON.stringify(o)),i.push(`$s(${s[1]})`),a=s.index+s[0].length}a{let t=r.firstChild;for(;t;)t=Ho(t,e)||t.nextSibling},U1=(r,e,t,n)=>{let i,a,s;if(e=e.replace(_5,(o,u)=>((s||(s={}))[u]=!0,"")),e[0]===":")i=Ss,a=e.slice(1);else if(e[0]==="@")i=Lo,a=e.slice(1);else{const o=e.indexOf(":"),u=o>0?e.slice(2,o):e.slice(2);i=g5[u]||n.dirs[u],a=o>0?e.slice(o+1):void 0}i&&(i===Ss&&a==="ref"&&(i=Fo),Ks(r,i,t,n,a,s),r.removeAttribute(e))},Ks=(r,e,t,n,i,a)=>{const s=e({el:r,get:(o=t)=>yi(n.scope,o,r),effect:n.effect,ctx:n,exp:t,arg:i,modifiers:a});s&&n.cleanups.push(s)},E5=(r,e)=>{if(e[0]==="#"){const t=document.querySelector(e);r.appendChild(t.content.cloneNode(!0));return}r.innerHTML=e},$o=r=>{const e={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...r,scope:r?r.scope:Ea({}),dirs:r?r.dirs:{},effects:[],blocks:[],cleanups:[],effect:t=>{if(Us)return v1(t),t;const n=Bc(t,{scheduler:()=>v1(n)});return e.effects.push(n),n}};return e},qo=(r,e={})=>{const t=r.scope,n=Object.create(t);Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),n.$refs=Object.create(t.$refs);const i=Ea(new Proxy(n,{set(a,s,o,u){return u===i&&!a.hasOwnProperty(s)?Reflect.set(t,s,o):Reflect.set(a,s,o,u)}}));return jo(i),{...r,scope:i}},jo=r=>{for(const e of Object.keys(r))typeof r[e]=="function"&&(r[e]=r[e].bind(r))};let Gs=class{constructor(e,t,n=!1){Hr(this,"template"),Hr(this,"ctx"),Hr(this,"key"),Hr(this,"parentCtx"),Hr(this,"isFragment"),Hr(this,"start"),Hr(this,"end"),this.isFragment=e instanceof HTMLTemplateElement,n?this.template=e:this.isFragment?this.template=e.content.cloneNode(!0):this.template=e.cloneNode(!0),n?this.ctx=t:(this.parentCtx=t,t.blocks.push(this),this.ctx=$o(t)),Ho(this.template,this.ctx)}get el(){return this.start||this.template}insert(e,t=null){if(this.isFragment)if(this.start){let n=this.start,i;for(;n&&(i=n.nextSibling,e.insertBefore(n,t),n!==this.end);)n=i}else this.start=new Text(""),this.end=new Text(""),e.insertBefore(this.end,t),e.insertBefore(this.start,this.end),e.insertBefore(this.template,this.end);else e.insertBefore(this.template,t)}remove(){if(this.parentCtx&&vc(this.parentCtx.blocks,this),this.start){const e=this.start.parentNode;let t=this.start,n;for(;t&&(n=t.nextSibling,e.removeChild(t),t!==this.end);)t=n}else this.template.parentNode.removeChild(this.template);this.teardown()}teardown(){this.ctx.blocks.forEach(e=>{e.teardown()}),this.ctx.effects.forEach(Tc),this.ctx.cleanups.forEach(e=>e())}};const K1=r=>r.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),Go=r=>{const e=$o();if(r&&(e.scope=Ea(r),jo(e.scope),r.$delimiters)){const[n,i]=e.delimiters=r.$delimiters;e.delimitersRE=new RegExp(K1(n)+"([^]+?)"+K1(i),"g")}e.scope.$s=Mo,e.scope.$nextTick=Sa,e.scope.$refs=Object.create(null);let t;return{directive(n,i){return i?(e.dirs[n]=i,this):e.dirs[n]},mount(n){if(typeof n=="string"&&(n=document.querySelector(n),!n))return;n=n||document.documentElement;let i;return n.hasAttribute("v-scope")?i=[n]:i=[...n.querySelectorAll("[v-scope]")].filter(a=>!a.matches("[v-scope] [v-scope]")),i.length||(i=[n]),t=i.map(a=>new Gs(a,e,!0)),this},unmount(){t.forEach(n=>n.teardown())}}},C1=document.currentScript;C1&&C1.hasAttribute("init")&&Go().mount();const S5="modulepreload",P5=function(r,e){return new URL(r,e).href},D1={},Vr=function(e,t,n){let i=Promise.resolve();if(t&&t.length>0){const s=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),u=o?.nonce||o?.getAttribute("nonce");i=Promise.allSettled(t.map(c=>{if(c=P5(c,n),c in D1)return;D1[c]=!0;const h=c.endsWith(".css"),l=h?'[rel="stylesheet"]':"";if(!!n)for(let P=s.length-1;P>=0;P--){const C=s[P];if(C.href===c&&(!h||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${l}`))return;const y=document.createElement("link");if(y.rel=h?"stylesheet":S5,h||(y.as="script"),y.crossOrigin="",y.href=c,u&&y.setAttribute("nonce",u),document.head.appendChild(y),h)return new Promise((P,C)=>{y.addEventListener("load",P),y.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})},Je=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vn=Symbol("doneWritingPromise"),Wo=Symbol("doneWritingResolve"),Vo=Symbol("doneWritingReject"),Fn=Symbol("readingIndex");class Qe extends Array{constructor(){super(),this[vn]=new Promise((e,t)=>{this[Wo]=e,this[Vo]=t}),this[vn].catch(()=>{})}}function le(r){return r&&r.getReader&&Array.isArray(r)}function Vn(r){if(!le(r)){const e=r.getWriter(),t=e.releaseLock;return e.releaseLock=()=>{e.closed.catch(function(){}),t.call(e)},e}this.stream=r}Qe.prototype.getReader=function(){return this[Fn]===void 0&&(this[Fn]=0),{read:async()=>(await this[vn],this[Fn]===this.length?{value:void 0,done:!0}:{value:this[this[Fn]++],done:!1})}},Qe.prototype.readToEnd=async function(r){await this[vn];const e=r(this.slice(this[Fn]));return this.length=0,e},Qe.prototype.clone=function(){const r=new Qe;return r[vn]=this[vn].then(()=>{r.push(...this)}),r},Vn.prototype.write=async function(r){this.stream.push(r)},Vn.prototype.close=async function(){this.stream[Wo]()},Vn.prototype.abort=async function(r){return this.stream[Vo](r),r},Vn.prototype.releaseLock=function(){};const Pa=typeof Je.process=="object"&&typeof Je.process.versions=="object",x1=Pa&&void 0;function ve(r){return le(r)?"array":Je.ReadableStream&&Je.ReadableStream.prototype.isPrototypeOf(r)?"web":Dn&&Dn.prototype.isPrototypeOf(r)?"ponyfill":x1&&x1.prototype.isPrototypeOf(r)?"node":!(!r||!r.getReader)&&"web-like"}function Ua(r){return Uint8Array.prototype.isPrototypeOf(r)}function Zo(r){if(r.length===1)return r[0];let e=0;for(let i=0;i{t||(U5.isBuffer(i)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),n.enqueue(i),e.pause())}),e.on("end",()=>{t||n.close()}),e.on("error",i=>n.error(i))},pull(){e.resume()},cancel(n){t=!0,e.destroy(n)}})};class r extends I1{constructor(t,n){super(n),this._reader=on(t)}async _read(t){try{for(;;){const{done:n,value:i}=await this._reader.read();if(n){this.push(null);break}if(!this.push(i))break}}catch(n){this.destroy(n)}}async _destroy(t,n){this._reader.cancel(t).then(n,n)}}Qo=function(e,t){return new r(e,t)}}const B1=new WeakSet,Gt=Symbol("externalBuffer");function qe(r){if(this.stream=r,r[Gt]&&(this[Gt]=r[Gt].slice()),le(r)){const n=r.getReader();return this._read=n.read.bind(n),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let e=ve(r);if(e==="node"&&(r=Ka(r)),e){const n=r.getReader();return this._read=n.read.bind(n),this._releaseLock=()=>{n.closed.catch(function(){}),n.releaseLock()},void(this._cancel=n.cancel.bind(n))}let t=!1;this._read=async()=>t||B1.has(r)?{value:void 0,done:!0}:(t=!0,{value:r,done:!1}),this._releaseLock=()=>{if(t)try{B1.add(r)}catch{}}}qe.prototype.read=async function(){return this[Gt]&&this[Gt].length?{done:!1,value:this[Gt].shift()}:this._read()},qe.prototype.releaseLock=function(){this[Gt]&&(this.stream[Gt]=this[Gt]),this._releaseLock()},qe.prototype.cancel=function(r){return this._cancel(r)},qe.prototype.readLine=async function(){let r,e=[];for(;!r;){let{done:t,value:n}=await this.read();if(n+="",t)return e.length?Ue(e):void 0;const i=n.indexOf(` +`)+1;i&&(r=Ue(e.concat(n.substr(0,i))),e=[]),i!==n.length&&e.push(n.substr(i))}return this.unshift(...e),r},qe.prototype.readByte=async function(){const{done:r,value:e}=await this.read();if(r)return;const t=e[0];return this.unshift(_e(e,1)),t},qe.prototype.readBytes=async function(r){const e=[];let t=0;for(;;){const{done:n,value:i}=await this.read();if(n)return e.length?Ue(e):void 0;if(e.push(i),t+=i.length,t>=r){const a=Ue(e);return this.unshift(_e(a,r)),_e(a,0,r)}}},qe.prototype.peekBytes=async function(r){const e=await this.readBytes(r);return this.unshift(e),e},qe.prototype.unshift=function(...r){this[Gt]||(this[Gt]=[]),r.length===1&&Ua(r[0])&&this[Gt].length&&r[0].length&&this[Gt][0].byteOffset>=r[0].length?this[Gt][0]=new Uint8Array(this[Gt][0].buffer,this[Gt][0].byteOffset-r[0].length,this[Gt][0].byteLength+r[0].length):this[Gt].unshift(...r.filter(e=>e&&e.length))},qe.prototype.readToEnd=async function(r=Ue){const e=[];for(;;){const{done:t,value:n}=await this.read();if(t)break;e.push(n)}return r(e)};let T1,{ReadableStream:Dn,WritableStream:K5,TransformStream:Ws}=Je;const ai=Pa&&void 0;function Vs(r){let e=ve(r);return e==="node"?Ka(r):e==="web"&&T1?T1(r):e?r:new Dn({start(t){t.enqueue(r),t.close()}})}function Xo(r){if(ve(r))return r;const e=new Qe;return(async()=>{const t=Oe(e);await t.write(r),await t.close()})(),e}function Ue(r){return r.some(e=>ve(e)&&!le(e))?function(e){e=e.map(Vs);const t=Jo(async function(a){await Promise.all(i.map(s=>C5(s,a)))});let n=Promise.resolve();const i=e.map((a,s)=>gi(a,(o,u)=>(n=n.then(()=>pi(o,t.writable,{preventClose:s!==e.length-1})),n)));return t.readable}(r):r.some(e=>le(e))?function(e){const t=new Qe;let n=Promise.resolve();return e.forEach((i,a)=>(n=n.then(()=>pi(i,t,{preventClose:a!==e.length-1})),n)),t}(r):typeof r[0]=="string"?r.join(""):ai&&ai.isBuffer(r[0])?ai.concat(r):Zo(r)}function on(r){return new qe(r)}function Oe(r){return new Vn(r)}async function pi(r,e,{preventClose:t=!1,preventAbort:n=!1,preventCancel:i=!1}={}){if(ve(r)&&!le(r)){r=Vs(r);try{if(r[Gt]){const o=Oe(e);for(let u=0;u{e=o,t=u}),e=null,t=null)},close:n.close.bind(n),abort:n.error.bind(n)})}}function Yt(r,e=()=>{},t=()=>{}){if(le(r)){const a=new Qe;return(async()=>{const s=Oe(a);try{const o=await sr(r),u=e(o),c=t();let h;h=u!==void 0&&c!==void 0?Ue([u,c]):u!==void 0?u:c,await s.write(h),await s.close()}catch(o){await s.abort(o)}})(),a}if(ve(r))return Yo(r,{async transform(a,s){try{const o=await e(a);o!==void 0&&s.enqueue(o)}catch(o){s.error(o)}},async flush(a){try{const s=await t();s!==void 0&&a.enqueue(s)}catch(s){a.error(s)}}});const n=e(r),i=t();return n!==void 0&&i!==void 0?Ue([n,i]):n!==void 0?n:i}function gi(r,e){if(ve(r)&&!le(r)){let n;const i=new Ws({start(o){n=o}}),a=pi(r,i.writable),s=Jo(async function(o){n.error(o),await a,await new Promise(setTimeout)});return e(i.readable,s.writable),s.readable}r=Xo(r);const t=new Qe;return e(r,t),t}function ra(r){if(le(r))return r.clone();if(ve(r)){const e=function(t){if(le(t))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(ve(t)){const n=Vs(t).tee();return n[0][Gt]=n[1][Gt]=t[Gt],n}return[_e(t),_e(t)]}(r);return e2(r,e[0]),e[1]}return _e(r)}function t2(r){return le(r)?ra(r):ve(r)?new Dn({start(e){const t=gi(r,async(n,i)=>{const a=on(n),s=Oe(i);try{for(;;){await s.ready;const{done:o,value:u}=await a.read();if(o){try{e.close()}catch{}return void await s.close()}try{e.enqueue(u)}catch{}await s.write(u)}}catch(o){e.error(o),await s.abort(o)}});e2(r,t)}}):_e(r)}function e2(r,e){Object.entries(Object.getOwnPropertyDescriptors(r.constructor.prototype)).forEach(([t,n])=>{t!=="constructor"&&(n.value?n.value=n.value.bind(e):n.get=n.get.bind(e),Object.defineProperty(r,t,n))})}function _e(r,e=0,t=1/0){if(le(r))throw Error("Not implemented");if(ve(r)){if(e>=0&&t>=0){let n=0;return Yo(r,{transform(i,a){n=e&&a.enqueue(_e(i,Math.max(e-n,0),t-n)),n+=i.length):a.terminate()}})}if(e<0&&(t<0||t===1/0)){let n=[];return Yt(r,i=>{i.length>=-e?n=[i]:n.push(i)},()=>_e(Ue(n),e,t))}if(e===0&&t<0){let n;return Yt(r,i=>{const a=n?Ue([n,i]):i;if(a.length>=-t)return n=_e(a,t),_e(a,e,t);n=a})}return console.warn(`stream.slice(input, ${e}, ${t}) not implemented efficiently.`),Ei(async()=>_e(await sr(r),e,t))}return r[Gt]&&(r=Ue(r[Gt].concat([r]))),!Ua(r)||ai&&ai.isBuffer(r)?r.slice(e,t):(t===1/0&&(t=r.length),r.subarray(e,t))}async function sr(r,e=Ue){return le(r)?r.readToEnd(e):ve(r)?on(r).readToEnd(e):r}async function C5(r,e){if(ve(r)){if(r.cancel)return r.cancel(e);if(r.destroy)return r.destroy(e),await new Promise(setTimeout),e}}function Ei(r){const e=new Qe;return(async()=>{const t=Oe(e);try{await t.write(await r()),await t.close()}catch(n){await t.abort(n)}})(),e}class me{constructor(e){if(e===void 0)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const t=e,n=Array(t.length);for(let i=0;iBigInt(0);){const s=n&BigInt(1);n>>=BigInt(1);const o=a*i%t.value;a=s?o:a,i=i*i%t.value}return new me(a)}modInv(e){const{gcd:t,x:n}=this._egcd(e);if(!t.isOne())throw Error("Inverse does not exist");return n.add(e).mod(e)}_egcd(e){let t=BigInt(0),n=BigInt(1),i=BigInt(1),a=BigInt(0),s=this.value;for(e=e.value;e!==BigInt(0);){const o=s/e;let u=t;t=i-o*t,i=u,u=n,n=a-o*n,a=u,u=e,e=s%e,s=u}return{x:new me(i),y:new me(a),gcd:new me(s)}}gcd(e){let t=this.value;for(e=e.value;e!==BigInt(0);){const n=e;e=t%e,t=n}return new me(t)}ileftShift(e){return this.value<<=e.value,this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value>>=e.value,this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value===e.value}lt(e){return this.valuee.value}gte(e){return this.value>=e.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.valueNumber.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}getBit(e){return(this.value>>BigInt(e)&BigInt(1))===BigInt(0)?0:1}bitLength(){const e=new me(0),t=new me(1),n=new me(-1),i=this.isNegative()?n:e;let a=1;const s=this.clone();for(;!s.irightShift(t).equal(i);)a++;return a}byteLength(){const e=new me(0),t=new me(-1),n=this.isNegative()?t:e,i=new me(8);let a=1;const s=this.clone();for(;!s.irightShift(i).equal(n);)a++;return a}toUint8Array(e="be",t){let n=this.value.toString(16);n.length%2==1&&(n="0"+n);const i=n.length/2,a=new Uint8Array(t||i),s=t?t-i:0;let o=0;for(;otypeof BigInt<"u",Hn=Symbol("byValue");var p={curve:{p256:"p256","P-256":"p256",secp256r1:"p256",prime256v1:"p256","1.2.840.10045.3.1.7":"p256","2a8648ce3d030107":"p256","2A8648CE3D030107":"p256",p384:"p384","P-384":"p384",secp384r1:"p384","1.3.132.0.34":"p384","2b81040022":"p384","2B81040022":"p384",p521:"p521","P-521":"p521",secp521r1:"p521","1.3.132.0.35":"p521","2b81040023":"p521","2B81040023":"p521",secp256k1:"secp256k1","1.3.132.0.10":"secp256k1","2b8104000a":"secp256k1","2B8104000A":"secp256k1",ed25519Legacy:"ed25519",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",curve25519Legacy:"curve25519",X25519:"curve25519",cv25519:"curve25519",curve25519:"curve25519",Curve25519:"curve25519","1.3.6.1.4.1.3029.1.5.1":"curve25519","2b060104019755010501":"curve25519","2B060104019755010501":"curve25519",brainpoolP256r1:"brainpoolP256r1","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1","2b2403030208010107":"brainpoolP256r1","2B2403030208010107":"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1","2b240303020801010b":"brainpoolP384r1","2B240303020801010B":"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1","2b240303020801010d":"brainpoolP512r1","2B240303020801010D":"brainpoolP512r1"},s2k:{simple:0,salted:1,iterated:3,gnu:101},publicKey:{rsaEncryptSign:1,rsaEncrypt:2,rsaSign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsaLegacy:22,ed25519Legacy:22,eddsa:22,aedh:23,aedsa:24,x25519:25,x448:26,ed25519:27,ed448:28},symmetric:{plaintext:0,idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,experimentalGCM:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressedData:8,symmetricallyEncryptedData:9,marker:10,literalData:11,trust:12,userID:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtectedData:18,modificationDetectionCode:19,aeadEncryptedData:20},literal:{binary:98,text:116,utf8:117,mime:109},signature:{binary:0,text:1,standalone:2,certGeneric:16,certPersona:17,certCasual:18,certPositive:19,certRevocation:48,subkeyBinding:24,keyBinding:25,key:31,keyRevocation:32,subkeyRevocation:40,timestamp:64,thirdParty:80},signatureSubpacket:{signatureCreationTime:2,signatureExpirationTime:3,exportableCertification:4,trustSignature:5,regularExpression:6,revocable:7,keyExpirationTime:9,placeholderBackwardsCompatibility:10,preferredSymmetricAlgorithms:11,revocationKey:12,issuer:16,notationData:20,preferredHashAlgorithms:21,preferredCompressionAlgorithms:22,keyServerPreferences:23,preferredKeyServer:24,primaryUserID:25,policyURI:26,keyFlags:27,signersUserID:28,reasonForRevocation:29,features:30,signatureTarget:31,embeddedSignature:32,issuerFingerprint:33,preferredAEADAlgorithms:34},keyFlags:{certifyKeys:1,signData:2,encryptCommunication:4,encryptStorage:8,splitPrivateKey:16,authentication:32,sharedPrivateKey:128},armor:{multipartSection:0,multipartLast:1,signed:2,message:3,publicKey:4,privateKey:5,signature:6},reasonForRevocation:{noReason:0,keySuperseded:1,keyCompromised:2,keyRetired:3,userIDInvalid:32},features:{modificationDetection:1,aead:2,v5Keys:4},write:function(r,e){if(typeof e=="number"&&(e=this.read(r,e)),r[e]!==void 0)return r[e];throw Error("Invalid enum value.")},read:function(r,e){if(r[Hn]||(r[Hn]=[],Object.entries(r).forEach(([t,n])=>{r[Hn][n]=t})),r[Hn][e]!==void 0)return r[Hn][e];throw Error("Invalid enum value.")}};const R1=(()=>{try{return!1}catch{}return!1})(),_={isString:function(r){return typeof r=="string"||r instanceof String},isArray:function(r){return r instanceof Array},isUint8Array:Ua,isStream:ve,readNumber:function(r){let e=0;for(let t=0;t>8*(e-n-1)&255;return t},readDate:function(r){const e=_.readNumber(r);return new Date(1e3*e)},writeDate:function(r){const e=Math.floor(r.getTime()/1e3);return _.writeNumber(e,4)},normalizeDate:function(r=Date.now()){return r===null||r===1/0?r:new Date(1e3*Math.floor(+r/1e3))},readMPI:function(r){const e=(r[0]<<8|r[1])+7>>>3;return r.subarray(2,2+e)},leftPad(r,e){const t=new Uint8Array(e),n=e-r.length;return t.set(r,n),t},uint8ArrayToMPI:function(r){const e=_.uint8ArrayBitLength(r);if(e===0)throw Error("Zero MPI");const t=r.subarray(r.length-Math.ceil(e/8)),n=new Uint8Array([(65280&e)>>8,255&e]);return _.concatUint8Array([n,t])},uint8ArrayBitLength:function(r){let e;for(e=0;e>1);for(let t=0;t>1;t++)e[t]=parseInt(r.substr(t<<1,2),16);return e},uint8ArrayToHex:function(r){const e=[],t=r.length;let n,i=0;for(;i{if(!_.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let n=0;nt("",!0))},decodeUTF8:function(r){const e=new TextDecoder("utf-8");function t(n,i=!1){return e.decode(n,{stream:!i})}return Yt(r,t,()=>t(new Uint8Array,!0))},concat:Ue,concatUint8Array:Zo,equalsUint8Array:function(r,e){if(!_.isUint8Array(r)||!_.isUint8Array(e))throw Error("Data must be in the form of a Uint8Array");if(r.length!==e.length)return!1;for(let t=0;t>>16;return t!==0&&(r=t,e+=16),t=r>>8,t!==0&&(r=t,e+=8),t=r>>4,t!==0&&(r=t,e+=4),t=r>>2,t!==0&&(r=t,e+=2),t=r>>1,t!==0&&(r=t,e+=1),e},double:function(r){const e=new Uint8Array(r.length),t=r.length-1;for(let n=0;n>7;return e[t]=r[t]<<1^135*(r[0]>>7),e},shiftRight:function(r,e){if(e)for(let t=r.length-1;t>=0;t--)r[t]>>=e,t>0&&(r[t]|=r[t-1]<<8-e);return r},getWebCrypto:function(){return Je!==void 0&&Je.crypto&&Je.crypto.subtle},getBigInteger:async function(){if(D5())return me;{const{default:r}=await Vr(async()=>{const{default:e}=await import("./bn.interface.min-BM1yc8Pi.js");return{default:e}},__vite__mapDeps([0,1]),import.meta.url);return r}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){return typeof navigator<"u"?navigator.hardwareConcurrency||1:(void 0).cpus().length},isEmailAddress:function(r){return _.isString(r)?/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(r):!1},canonicalizeEOL:function(r){let e=!1;return Yt(r,t=>{let n;e&&(t=_.concatUint8Array([new Uint8Array([13]),t])),t[t.length-1]===13?(e=!0,t=t.subarray(0,-1)):e=!1;const i=[];for(let o=0;n=t.indexOf(10,o)+1,n;o=n)t[n-2]!==13&&i.push(n);if(!i.length)return t;const a=new Uint8Array(t.length+i.length);let s=0;for(let o=0;oe?new Uint8Array([13]):void 0)},nativeEOL:function(r){let e=!1;return Yt(r,t=>{let n;(t=e&&t[0]!==10?_.concatUint8Array([new Uint8Array([13]),t]):new Uint8Array(t))[t.length-1]===13?(e=!0,t=t.subarray(0,-1)):e=!1;let i=0;for(let a=0;a!==t.length;a=n){n=t.indexOf(13,a)+1,n||(n=t.length);const s=n-(t[n]===10?1:0);a&&t.copyWithin(i,a,s),i+=s-a}return t.subarray(0,i)},()=>e?new Uint8Array([13]):void 0)},removeTrailingSpaces:function(r){return r.split(` `).map(e=>{let t=e.length-1;for(;t>=0&&(e[t]===" "||e[t]===" "||e[t]==="\r");t--);return e.substr(0,t+1)}).join(` `)},wrapError:function(r,e){if(!e)return Error(r);try{e.message=r+": "+e.message}catch{}return e},constructAllowedPackets:function(r){const e={};return r.forEach(t=>{if(!t.tag)throw Error("Invalid input: expected a packet class");e[t.tag]=t}),e},anyPromise:function(r){return new Promise(async(e,t)=>{let n;await Promise.all(r.map(async i=>{try{e(await i)}catch(a){n=a}})),t(n)})},selectUint8Array:function(r,e,t){const n=Math.max(e.length,t.length),i=new Uint8Array(n);let a=0;for(let s=0;s{e=_.concatUint8Array([e,t]);const n=[],i=Math.floor(e.length/45),a=45*i,s=na(e.subarray(0,a));for(let o=0;oe.length?na(e)+` -`:"")}function e2(r){let e="";return Yt(r,t=>{e+=t;let n=0;const i=[" "," ","\r",` -`];for(let o=0;o0&&(a-n)%4!=0;a--)i.includes(e[a])&&n--;const s=ia(e.substr(0,a));return e=e.substr(a),s},()=>ia(e))}function dr(r){return e2(r.replace(/-/g,"+").replace(/_/g,"/"))}function Ae(r,e){let t=hr(r).replace(/[\r\n]/g,"");return t=t.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,""),t}Wa?(na=r=>Wa.from(r).toString("base64"),ia=r=>{const e=Wa.from(r,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}):(na=r=>btoa(_.uint8ArrayToString(r)),ia=r=>_.stringToUint8Array(atob(r)));var vt={preferredHashAlgorithm:p.hash.sha256,preferredSymmetricAlgorithm:p.symmetric.aes256,preferredCompressionAlgorithm:p.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:p.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kIterationCountByte:224,allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([p.symmetric.aes128,p.symmetric.aes192,p.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.2",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([p.hash.md5,p.hash.ripemd]),rejectMessageHashAlgorithms:new Set([p.hash.md5,p.hash.ripemd,p.hash.sha1]),rejectPublicKeyAlgorithms:new Set([p.publicKey.elgamal,p.publicKey.dsa]),rejectCurves:new Set([p.curve.secp256k1])};function D5(r){const e=r.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!e)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(e[1])?p.armor.multipartSection:/MESSAGE, PART \d+/.test(e[1])?p.armor.multipartLast:/SIGNED MESSAGE/.test(e[1])?p.armor.signed:/MESSAGE/.test(e[1])?p.armor.message:/PUBLIC KEY BLOCK/.test(e[1])?p.armor.publicKey:/PRIVATE KEY BLOCK/.test(e[1])?p.armor.privateKey:/SIGNATURE/.test(e[1])?p.armor.signature:void 0}function $r(r,e){let t="";return e.showVersion&&(t+="Version: "+e.versionString+` +`:"")}function r2(r){let e="";return Yt(r,t=>{e+=t;let n=0;const i=[" "," ","\r",` +`];for(let o=0;o0&&(a-n)%4!=0;a--)i.includes(e[a])&&n--;const s=ia(e.substr(0,a));return e=e.substr(a),s},()=>ia(e))}function dr(r){return r2(r.replace(/-/g,"+").replace(/_/g,"/"))}function Ae(r,e){let t=hr(r).replace(/[\r\n]/g,"");return t=t.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,""),t}Wa?(na=r=>Wa.from(r).toString("base64"),ia=r=>{const e=Wa.from(r,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}):(na=r=>btoa(_.uint8ArrayToString(r)),ia=r=>_.stringToUint8Array(atob(r)));var vt={preferredHashAlgorithm:p.hash.sha256,preferredSymmetricAlgorithm:p.symmetric.aes256,preferredCompressionAlgorithm:p.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:p.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kIterationCountByte:224,allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([p.symmetric.aes128,p.symmetric.aes192,p.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.2",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([p.hash.md5,p.hash.ripemd]),rejectMessageHashAlgorithms:new Set([p.hash.md5,p.hash.ripemd,p.hash.sha1]),rejectPublicKeyAlgorithms:new Set([p.publicKey.elgamal,p.publicKey.dsa]),rejectCurves:new Set([p.curve.secp256k1])};function x5(r){const e=r.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!e)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(e[1])?p.armor.multipartSection:/MESSAGE, PART \d+/.test(e[1])?p.armor.multipartLast:/SIGNED MESSAGE/.test(e[1])?p.armor.signed:/MESSAGE/.test(e[1])?p.armor.message:/PUBLIC KEY BLOCK/.test(e[1])?p.armor.publicKey:/PRIVATE KEY BLOCK/.test(e[1])?p.armor.privateKey:/SIGNATURE/.test(e[1])?p.armor.signature:void 0}function $r(r,e){let t="";return e.showVersion&&(t+="Version: "+e.versionString+` `),e.showComment&&(t+="Comment: "+e.commentString+` `),r&&(t+="Comment: "+r+` `),t+=` -`,t}function Pr(r){return hr(function(e){let t=13501623;return Yt(e,n=>{const i=x5?Math.floor(n.length/4):0,a=new Uint32Array(n.buffer,n.byteOffset,i);for(let s=0;s>24&255]^se[1][t>>16&255]^se[2][t>>8&255]^se[3][t>>0&255];for(let s=4*i;s>8^se[0][255&t^n[s]]},()=>new Uint8Array([t,t>>8,t>>16]))}(r))}const se=[Array(255),Array(255),Array(255),Array(255)];for(let r=0;r<=255;r++){let e=r<<16;for(let t=0;t<8;t++)e=e<<1^(8388608&e?8801531:0);se[0][r]=(16711680&e)>>16|65280&e|(255&e)<<16}for(let r=0;r<=255;r++)se[1][r]=se[0][r]>>8^se[0][255&se[0][r]];for(let r=0;r<=255;r++)se[2][r]=se[1][r]>>8^se[0][255&se[1][r]];for(let r=0;r<=255;r++)se[3][r]=se[2][r]>>8^se[0][255&se[2][r]];const x5=function(){const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,255,!0),new Int16Array(r)[0]===255}();function z1(r){for(let e=0;e=0&&n!==r.length-1&&(e=r.slice(0,n),t=r.slice(n+1).substr(0,4)),{body:e,checksum:t}}function r2(r,e=vt){return new Promise(async(t,n)=>{try{const i=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let s;const o=[];let u,c,h,l=o,w=[],y=e2(gi(r,async(K,C)=>{const M=on(K);try{for(;;){let Q=await M.readLine();if(Q===void 0)throw Error("Misformed armored text");if(Q=_.removeTrailingSpaces(Q.replace(/[\r\n]/g,"")),s)if(u)c||s!==2||(i.test(Q)?(w=w.join(`\r -`),c=!0,z1(l),l=[],u=!1):w.push(Q.replace(/^- /,"")));else if(i.test(Q)&&n(Error("Mandatory blank line missing between armor headers and armor data")),a.test(Q)){if(z1(l),u=!0,c||s!==2){t({text:w,data:y,headers:o,type:s});break}}else l.push(Q);else i.test(Q)&&(s=D5(Q))}}catch(Q){return void n(Q)}const H=Oe(C);try{for(;;){await H.ready;const{done:Q,value:F}=await M.read();if(Q)throw Error("Misformed armored text");const E=F+"";if(E.indexOf("=")!==-1||E.indexOf("-")!==-1){let W=await M.readToEnd();W.length||(W=""),W=E+W,W=_.removeTrailingSpaces(W.replace(/\r/g,""));const q=W.split(i);if(q.length===1)throw Error("Misformed armored text");const j=I5(q[0].slice(0,-1));h=j.checksum,await H.write(j.body);break}await H.write(E)}await H.ready,await H.close()}catch(Q){await H.abort(Q)}}));y=gi(y,async(K,C)=>{const M=sr(Pr(Jo(K)));M.catch(()=>{}),await pi(K,C,{preventClose:!0});const H=Oe(C);try{const Q=(await M).replace(` -`,"");if(h!==Q&&(h||e.checksumRequired))throw Error("Ascii armor integrity check failed");await H.ready,await H.close()}catch(Q){await H.abort(Q)}})}catch(i){n(i)}}).then(async t=>(le(t.data)&&(t.data=await sr(t.data)),t))}function Zs(r,e,t,n,i,a=vt){let s,o;r===p.armor.signed&&(s=e.text,o=e.hash,e=e.data);const u=Jo(e),c=[];switch(r){case p.armor.multipartSection:c.push("-----BEGIN PGP MESSAGE, PART "+t+"/"+n+`----- +`,t}function Pr(r){return hr(function(e){let t=13501623;return Yt(e,n=>{const i=I5?Math.floor(n.length/4):0,a=new Uint32Array(n.buffer,n.byteOffset,i);for(let s=0;s>24&255]^se[1][t>>16&255]^se[2][t>>8&255]^se[3][t>>0&255];for(let s=4*i;s>8^se[0][255&t^n[s]]},()=>new Uint8Array([t,t>>8,t>>16]))}(r))}const se=[Array(255),Array(255),Array(255),Array(255)];for(let r=0;r<=255;r++){let e=r<<16;for(let t=0;t<8;t++)e=e<<1^(8388608&e?8801531:0);se[0][r]=(16711680&e)>>16|65280&e|(255&e)<<16}for(let r=0;r<=255;r++)se[1][r]=se[0][r]>>8^se[0][255&se[0][r]];for(let r=0;r<=255;r++)se[2][r]=se[1][r]>>8^se[0][255&se[1][r]];for(let r=0;r<=255;r++)se[3][r]=se[2][r]>>8^se[0][255&se[2][r]];const I5=function(){const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,255,!0),new Int16Array(r)[0]===255}();function z1(r){for(let e=0;e=0&&n!==r.length-1&&(e=r.slice(0,n),t=r.slice(n+1).substr(0,4)),{body:e,checksum:t}}function n2(r,e=vt){return new Promise(async(t,n)=>{try{const i=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let s;const o=[];let u,c,h,l=o,k=[],y=r2(gi(r,async(P,C)=>{const O=on(P);try{for(;;){let X=await O.readLine();if(X===void 0)throw Error("Misformed armored text");if(X=_.removeTrailingSpaces(X.replace(/[\r\n]/g,"")),s)if(u)c||s!==2||(i.test(X)?(k=k.join(`\r +`),c=!0,z1(l),l=[],u=!1):k.push(X.replace(/^- /,"")));else if(i.test(X)&&n(Error("Mandatory blank line missing between armor headers and armor data")),a.test(X)){if(z1(l),u=!0,c||s!==2){t({text:k,data:y,headers:o,type:s});break}}else l.push(X);else i.test(X)&&(s=x5(X))}}catch(X){return void n(X)}const H=Oe(C);try{for(;;){await H.ready;const{done:X,value:F}=await O.read();if(X)throw Error("Misformed armored text");const E=F+"";if(E.indexOf("=")!==-1||E.indexOf("-")!==-1){let G=await O.readToEnd();G.length||(G=""),G=E+G,G=_.removeTrailingSpaces(G.replace(/\r/g,""));const q=G.split(i);if(q.length===1)throw Error("Misformed armored text");const $=B5(q[0].slice(0,-1));h=$.checksum,await H.write($.body);break}await H.write(E)}await H.ready,await H.close()}catch(X){await H.abort(X)}}));y=gi(y,async(P,C)=>{const O=sr(Pr(t2(P)));O.catch(()=>{}),await pi(P,C,{preventClose:!0});const H=Oe(C);try{const X=(await O).replace(` +`,"");if(h!==X&&(h||e.checksumRequired))throw Error("Ascii armor integrity check failed");await H.ready,await H.close()}catch(X){await H.abort(X)}})}catch(i){n(i)}}).then(async t=>(le(t.data)&&(t.data=await sr(t.data)),t))}function Zs(r,e,t,n,i,a=vt){let s,o;r===p.armor.signed&&(s=e.text,o=e.hash,e=e.data);const u=t2(e),c=[];switch(r){case p.armor.multipartSection:c.push("-----BEGIN PGP MESSAGE, PART "+t+"/"+n+`----- `),c.push($r(i,a)),c.push(hr(e)),c.push("=",Pr(u)),c.push("-----END PGP MESSAGE, PART "+t+"/"+n+`----- `);break;case p.armor.multipartLast:c.push("-----BEGIN PGP MESSAGE, PART "+t+`----- `),c.push($r(i,a)),c.push(hr(e)),c.push("=",Pr(u)),c.push("-----END PGP MESSAGE, PART "+t+`----- @@ -29,9 +29,9 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./bn.interface.min-BwM `),c.push($r(i,a)),c.push(hr(e)),c.push("=",Pr(u)),c.push(`-----END PGP PRIVATE KEY BLOCK----- `);break;case p.armor.signature:c.push(`-----BEGIN PGP SIGNATURE----- `),c.push($r(i,a)),c.push(hr(e)),c.push("=",Pr(u)),c.push(`-----END PGP SIGNATURE----- -`)}return _.concat(c)}class xn{constructor(){this.bytes=""}read(e){return this.bytes=_.uint8ArrayToString(e.subarray(0,8)),this.bytes.length}write(){return _.stringToUint8Array(this.bytes)}toHex(){return _.uint8ArrayToHex(_.stringToUint8Array(this.bytes))}equals(e,t=!1){return t&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes}isNull(){return this.bytes===""}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(e){return e.toHex()}static fromID(e){const t=new xn;return t.read(_.hexToUint8Array(e)),t}static wildcard(){const e=new xn;return e.read(new Uint8Array(8)),e}}var Kt=function(){var r,e,t=!1;function n(l,w){var y=r[(e[l]+e[w])%255];return l!==0&&w!==0||(y=0),y}var i,a,s,o,u=!1;function c(){function l(C){var M,H,Q;for(H=Q=function(F){var E=r[255-e[F]];return F===0&&(E=0),E}(C),M=0;M<4;M++)Q^=H=255&(H<<1|H>>>7);return Q^=99}t||function(){r=[],e=[];var C,M,H=1;for(C=0;C<255;C++)r[C]=H,M=128&H,H<<=1,H&=255,M===128&&(H^=27),H^=r[C],e[r[C]]=C;r[255]=r[0],e[0]=0,t=!0}(),i=[],a=[],s=[[],[],[],[]],o=[[],[],[],[]];for(var w=0;w<256;w++){var y=l(w);i[w]=y,a[y]=w,s[0][w]=n(2,y)<<24|y<<16|y<<8|n(3,y),o[0][y]=n(14,w)<<24|n(9,w)<<16|n(13,w)<<8|n(11,w);for(var K=1;K<4;K++)s[K][w]=s[K-1][w]>>>8|s[K-1][w]<<24,o[K][y]=o[K-1][y]>>>8|o[K-1][y]<<24}u=!0}var h=function(l,w){u||c();var y=new Uint32Array(w);y.set(i,512),y.set(a,768);for(var K=0;K<4;K++)y.set(s[K],4096+1024*K>>2),y.set(o[K],8192+1024*K>>2);var C=function(M,H,Q){var F=0,E=0,W=0,q=0,j=0,G=0,Z=0,tt=0,rt=0,dt=0,it=0,O=0,ft=0,Pt=0,$=0,at=0,mt=0,bt=0,yt=0,pt=0,gt=0,ct=new M.Uint32Array(Q),S=new M.Uint8Array(Q);function N(v,k,nt,st,St,It,zt,Dt){v=v|0,k=k|0,nt=nt|0,st=st|0,St=St|0,It=It|0,zt=zt|0,Dt=Dt|0;var Wt=0,Xt=0,Jt=0,ne=0,Ct=0,Mt=0,Lt=0,Et=0;for(Wt=nt|1024,Xt=nt|2048,Jt=nt|3072,St=St^ct[(v|0)>>2],It=It^ct[(v|4)>>2],zt=zt^ct[(v|8)>>2],Dt=Dt^ct[(v|12)>>2],Et=16;(Et|0)<=st<<4;Et=Et+16|0)ne=ct[(nt|St>>22&1020)>>2]^ct[(Wt|It>>14&1020)>>2]^ct[(Xt|zt>>6&1020)>>2]^ct[(Jt|Dt<<2&1020)>>2]^ct[(v|Et|0)>>2],Ct=ct[(nt|It>>22&1020)>>2]^ct[(Wt|zt>>14&1020)>>2]^ct[(Xt|Dt>>6&1020)>>2]^ct[(Jt|St<<2&1020)>>2]^ct[(v|Et|4)>>2],Mt=ct[(nt|zt>>22&1020)>>2]^ct[(Wt|Dt>>14&1020)>>2]^ct[(Xt|St>>6&1020)>>2]^ct[(Jt|It<<2&1020)>>2]^ct[(v|Et|8)>>2],Lt=ct[(nt|Dt>>22&1020)>>2]^ct[(Wt|St>>14&1020)>>2]^ct[(Xt|It>>6&1020)>>2]^ct[(Jt|zt<<2&1020)>>2]^ct[(v|Et|12)>>2],St=ne,It=Ct,zt=Mt,Dt=Lt;F=ct[(k|St>>22&1020)>>2]<<24^ct[(k|It>>14&1020)>>2]<<16^ct[(k|zt>>6&1020)>>2]<<8^ct[(k|Dt<<2&1020)>>2]^ct[(v|Et|0)>>2],E=ct[(k|It>>22&1020)>>2]<<24^ct[(k|zt>>14&1020)>>2]<<16^ct[(k|Dt>>6&1020)>>2]<<8^ct[(k|St<<2&1020)>>2]^ct[(v|Et|4)>>2],W=ct[(k|zt>>22&1020)>>2]<<24^ct[(k|Dt>>14&1020)>>2]<<16^ct[(k|St>>6&1020)>>2]<<8^ct[(k|It<<2&1020)>>2]^ct[(v|Et|8)>>2],q=ct[(k|Dt>>22&1020)>>2]<<24^ct[(k|St>>14&1020)>>2]<<16^ct[(k|It>>6&1020)>>2]<<8^ct[(k|zt<<2&1020)>>2]^ct[(v|Et|12)>>2]}function b(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,v,k,nt,st)}function f(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0;var St=0;N(1024,3072,8192,gt,v,st,nt,k),St=E,E=q,q=St}function U(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,j^v,G^k,Z^nt,tt^st),j=F,G=E,Z=W,tt=q}function V(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0;var St=0;N(1024,3072,8192,gt,v,st,nt,k),St=E,E=q,q=St,F=F^j,E=E^G,W=W^Z,q=q^tt,j=v,G=k,Z=nt,tt=st}function X(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,j,G,Z,tt),j=F=F^v,G=E=E^k,Z=W=W^nt,tt=q=q^st}function Y(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,j,G,Z,tt),F=F^v,E=E^k,W=W^nt,q=q^st,j=v,G=k,Z=nt,tt=st}function g(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,j,G,Z,tt),j=F,G=E,Z=W,tt=q,F=F^v,E=E^k,W=W^nt,q=q^st}function d(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,rt,dt,it,O),O=~at&O|at&O+1,it=~$&it|$&it+((O|0)==0),dt=~Pt&dt|Pt&dt+((it|0)==0),rt=~ft&rt|ft&rt+((dt|0)==0),F=F^v,E=E^k,W=W^nt,q=q^st}function m(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0;var St=0,It=0,zt=0,Dt=0,Wt=0,Xt=0,Jt=0,ne=0,Ct=0,Mt=0;for(v=v^j,k=k^G,nt=nt^Z,st=st^tt,St=mt|0,It=bt|0,zt=yt|0,Dt=pt|0;(Ct|0)<128;Ct=Ct+1|0)St>>>31&&(Wt=Wt^v,Xt=Xt^k,Jt=Jt^nt,ne=ne^st),St=St<<1|It>>>31,It=It<<1|zt>>>31,zt=zt<<1|Dt>>>31,Dt=Dt<<1,Mt=st&1,st=st>>>1|nt<<31,nt=nt>>>1|k<<31,k=k>>>1|v<<31,v=v>>>1,Mt&&(v=v^3774873600);j=Wt,G=Xt,Z=Jt,tt=ne}function A(v){v=v|0,gt=v}function B(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,F=v,E=k,W=nt,q=st}function P(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,j=v,G=k,Z=nt,tt=st}function z(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,rt=v,dt=k,it=nt,O=st}function ht(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,ft=v,Pt=k,$=nt,at=st}function ot(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,O=~at&O|at&st,it=~$&it|$&nt,dt=~Pt&dt|Pt&k,rt=~ft&rt|ft&v}function lt(v){return v=v|0,v&15?-1:(S[v|0]=F>>>24,S[v|1]=F>>>16&255,S[v|2]=F>>>8&255,S[v|3]=F&255,S[v|4]=E>>>24,S[v|5]=E>>>16&255,S[v|6]=E>>>8&255,S[v|7]=E&255,S[v|8]=W>>>24,S[v|9]=W>>>16&255,S[v|10]=W>>>8&255,S[v|11]=W&255,S[v|12]=q>>>24,S[v|13]=q>>>16&255,S[v|14]=q>>>8&255,S[v|15]=q&255,16)}function I(v){return v=v|0,v&15?-1:(S[v|0]=j>>>24,S[v|1]=j>>>16&255,S[v|2]=j>>>8&255,S[v|3]=j&255,S[v|4]=G>>>24,S[v|5]=G>>>16&255,S[v|6]=G>>>8&255,S[v|7]=G&255,S[v|8]=Z>>>24,S[v|9]=Z>>>16&255,S[v|10]=Z>>>8&255,S[v|11]=Z&255,S[v|12]=tt>>>24,S[v|13]=tt>>>16&255,S[v|14]=tt>>>8&255,S[v|15]=tt&255,16)}function D(){b(0,0,0,0),mt=F,bt=E,yt=W,pt=q}function x(v,k,nt){v=v|0,k=k|0,nt=nt|0;var st=0;if(k&15)return-1;for(;(nt|0)>=16;)R[v&7](S[k|0]<<24|S[k|1]<<16|S[k|2]<<8|S[k|3],S[k|4]<<24|S[k|5]<<16|S[k|6]<<8|S[k|7],S[k|8]<<24|S[k|9]<<16|S[k|10]<<8|S[k|11],S[k|12]<<24|S[k|13]<<16|S[k|14]<<8|S[k|15]),S[k|0]=F>>>24,S[k|1]=F>>>16&255,S[k|2]=F>>>8&255,S[k|3]=F&255,S[k|4]=E>>>24,S[k|5]=E>>>16&255,S[k|6]=E>>>8&255,S[k|7]=E&255,S[k|8]=W>>>24,S[k|9]=W>>>16&255,S[k|10]=W>>>8&255,S[k|11]=W&255,S[k|12]=q>>>24,S[k|13]=q>>>16&255,S[k|14]=q>>>8&255,S[k|15]=q&255,st=st+16|0,k=k+16|0,nt=nt-16|0;return st|0}function T(v,k,nt){v=v|0,k=k|0,nt=nt|0;var st=0;if(k&15)return-1;for(;(nt|0)>=16;)L[v&1](S[k|0]<<24|S[k|1]<<16|S[k|2]<<8|S[k|3],S[k|4]<<24|S[k|5]<<16|S[k|6]<<8|S[k|7],S[k|8]<<24|S[k|9]<<16|S[k|10]<<8|S[k|11],S[k|12]<<24|S[k|13]<<16|S[k|14]<<8|S[k|15]),st=st+16|0,k=k+16|0,nt=nt-16|0;return st|0}var R=[b,f,U,V,X,Y,g,d],L=[U,m];return{set_rounds:A,set_state:B,set_iv:P,set_nonce:z,set_mask:ht,set_counter:ot,get_state:lt,get_iv:I,gcm_init:D,cipher:x,mac:T}}({Uint8Array,Uint32Array},l,w);return C.set_key=function(M,H,Q,F,E,W,q,j,G){var Z=y.subarray(0,60),tt=y.subarray(256,316);Z.set([H,Q,F,E,W,q,j,G]);for(var rt=M,dt=1;rt<4*M+28;rt++){var it=Z[rt-1];(rt%M==0||M===8&&rt%M==4)&&(it=i[it>>>24]<<24^i[it>>>16&255]<<16^i[it>>>8&255]<<8^i[255&it]),rt%M==0&&(it=it<<8^it>>>24^dt<<24,dt=dt<<1^(128&dt?27:0)),Z[rt]=Z[rt-M]^it}for(var O=0;O=rt-4?it:o[0][i[it>>>24]]^o[1][i[it>>>16&255]]^o[2][i[it>>>8&255]]^o[3][i[255&it]];C.set_rounds(M+5)},C};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function L1(r){return r instanceof Uint8Array}function Qs(r,e){const t=r?r.byteLength:65536;if(4095&t||t<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return r=r||new Uint8Array(new ArrayBuffer(t))}function Zr(r,e,t,n,i){const a=r.length-e,s=ai+a.length,0),t=new Uint8Array(e);let n=0;for(let i=0;i>2,a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12),i>16?a.getUint32(16):0,i>16?a.getUint32(20):0,i>24?a.getUint32(24):0,i>24?a.getUint32(28):0),t!==void 0){if(t.length!==16)throw new gr("illegal iv size");let s=new DataView(t.buffer,t.byteOffset,t.byteLength);n.set_iv(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}else n.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!L1(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:n}=this.acquire_asm(),i=Kt.ENC[this.mode],a=Kt.HEAP_DATA,s=this.pos,o=this.len,u=0,c=e.length||0,h=0,l=0,w=new Uint8Array(o+c&-16);for(;c>0;)l=Zr(t,s+o,e,u,c),o+=l,u+=l,c-=l,l=n.cipher(i,a+s,o),l&&w.set(t.subarray(s,s+l),h),h+=l,l0;)y=Zr(t,s+o,e,u,c),o+=y,u+=y,c-=y,y=n.cipher(i,a+s,o-(c?0:w)),y&&K.set(t.subarray(s,s+y),h),h+=y,y0){if(s%16){if(this.hasOwnProperty("padding"))throw new gr("data length must be a multiple of the block size");s+=16-s%16}if(t.cipher(n,i+a,s),this.hasOwnProperty("padding")&&this.padding){let c=e[a+o-1];if(c<1||c>16||c>o)throw new Ds("bad padding");let h=0;for(let l=c;l>1;l--)h|=c^e[a+o-l];if(h)throw new Ds("bad padding");o-=c}}const u=new Uint8Array(o);return o>0&&u.set(e.subarray(a,a+o)),this.pos=0,this.len=0,this.release_asm(),u}}class aa{static encrypt(e,t,n=!1){return new aa(t,n).encrypt(e)}static decrypt(e,t,n=!1){return new aa(t,n).decrypt(e)}constructor(e,t=!1,n){this.aes=n||new Si(e,void 0,t,"ECB")}encrypt(e){return Nr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Nr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Xs(r){const e=function(t){const n=new aa(t);this.encrypt=function(i){return n.encrypt(i)},this.decrypt=function(i){return n.decrypt(i)}};return e.blockSize=e.prototype.blockSize=16,e.keySize=e.prototype.keySize=r/8,e}function si(r,e,t,n,i,a){const s=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],u=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],h=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],w=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],y=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let K,C,M,H,Q,F,E,W,q,j,G=0,Z=e.length;const tt=r.length===32?3:9;W=tt===3?t?[0,32,2]:[30,-2,-2]:t?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],t&&(e=function(it,O){const ft=8-it.length%8;let Pt;if(O===2&&ft<8)Pt=32;else if(O===1)Pt=ft;else{if(O||!(ft<8)){if(ft===8)return it;throw Error("des: invalid padding")}Pt=0}const $=new Uint8Array(it.length+ft);for(let at=0;at>>4^E),E^=M,F^=M<<4,M=65535&(F>>>16^E),E^=M,F^=M<<16,M=858993459&(E>>>2^F),F^=M,E^=M<<2,M=16711935&(E>>>8^F),F^=M,E^=M<<8,M=1431655765&(F>>>1^E),E^=M,F^=M<<1,F=F<<1|F>>>31,E=E<<1|E>>>31,C=0;C>>4|E<<28)^r[K+1],M=F,F=E,E=M^(o[H>>>24&63]|c[H>>>16&63]|l[H>>>8&63]|y[63&H]|s[Q>>>24&63]|u[Q>>>16&63]|h[Q>>>8&63]|w[63&Q]);M=F,F=E,E=M}F=F>>>1|F<<31,E=E>>>1|E<<31,M=1431655765&(F>>>1^E),E^=M,F^=M<<1,M=16711935&(E>>>8^F),F^=M,E^=M<<8,M=858993459&(E>>>2^F),F^=M,E^=M<<2,M=65535&(F>>>16^E),E^=M,F^=M<<16,M=252645135&(F>>>4^E),E^=M,F^=M<<4,rt[dt++]=F>>>24,rt[dt++]=F>>>16&255,rt[dt++]=F>>>8&255,rt[dt++]=255&F,rt[dt++]=E>>>24,rt[dt++]=E>>>16&255,rt[dt++]=E>>>8&255,rt[dt++]=255&E}return t||(rt=function(it,O){let ft,Pt=null;if(O===2)ft=32;else if(O===1)Pt=it[it.length-1];else{if(O)throw Error("des: invalid padding");ft=0}if(!Pt){for(Pt=1;it[it.length-Pt]===ft;)Pt++;Pt--}return it.subarray(0,it.length-Pt)}(rt,a)),rt}function oi(r){const e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],t=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],w=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],y=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],K=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],C=r.length>8?3:1,M=Array(32*C),H=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let Q,F,E,W=0,q=0;for(let j=0;j>>4^Z),Z^=E,G^=E<<4,E=65535&(Z>>>-16^G),G^=E,Z^=E<<-16,E=858993459&(G>>>2^Z),Z^=E,G^=E<<2,E=65535&(Z>>>-16^G),G^=E,Z^=E<<-16,E=1431655765&(G>>>1^Z),Z^=E,G^=E<<1,E=16711935&(Z>>>8^G),G^=E,Z^=E<<8,E=1431655765&(G>>>1^Z),Z^=E,G^=E<<1,E=G<<8|Z>>>20&240,G=Z<<24|Z<<8&16711680|Z>>>8&65280|Z>>>24&240,Z=E;for(let tt=0;tt<16;tt++)H[tt]?(G=G<<2|G>>>26,Z=Z<<2|Z>>>26):(G=G<<1|G>>>27,Z=Z<<1|Z>>>27),G&=-15,Z&=-15,Q=e[G>>>28]|t[G>>>24&15]|n[G>>>20&15]|i[G>>>16&15]|a[G>>>12&15]|s[G>>>8&15]|o[G>>>4&15],F=u[Z>>>28]|c[Z>>>24&15]|h[Z>>>20&15]|l[Z>>>16&15]|w[Z>>>12&15]|y[Z>>>8&15]|K[Z>>>4&15],E=65535&(F>>>16^Q),M[q++]=Q^E,M[q++]=F^E<<16}return M}function Zn(r){this.key=[];for(let e=0;e<3;e++)this.key.push(new Uint8Array(r.subarray(8*e,8*e+8)));this.encrypt=function(e){return si(oi(this.key[2]),si(oi(this.key[1]),si(oi(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function B5(){this.BlockSize=8,this.KeySize=16,this.setKey=function(s){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),s.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(s),!0},this.reset=function(){for(let s=0;s<16;s++)this.masking[s]=0,this.rotate[s]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(s){const o=Array(s.length);for(let u=0;u>>24&255,o[u+1]=l>>>16&255,o[u+2]=l>>>8&255,o[u+3]=255&l,o[u+4]=h>>>24&255,o[u+5]=h>>>16&255,o[u+6]=h>>>8&255,o[u+7]=255&h}return o},this.decrypt=function(s){const o=Array(s.length);for(let u=0;u>>24&255,o[u+1]=l>>>16&255,o[u+2]=l>>>8&255,o[u+3]=255&l,o[u+4]=h>>>24&255,o[u+5]=h>>16&255,o[u+6]=h>>8&255,o[u+7]=255&h}return o};const r=[,,,,];r[0]=[,,,,],r[0][0]=[4,0,13,15,12,14,8],r[0][1]=[5,2,16,18,17,19,10],r[0][2]=[6,3,23,22,21,20,9],r[0][3]=[7,1,26,25,27,24,11],r[1]=[,,,,],r[1][0]=[0,6,21,23,20,22,16],r[1][1]=[1,4,0,2,1,3,18],r[1][2]=[2,5,7,6,5,4,17],r[1][3]=[3,7,10,9,11,8,19],r[2]=[,,,,],r[2][0]=[4,0,13,15,12,14,8],r[2][1]=[5,2,16,18,17,19,10],r[2][2]=[6,3,23,22,21,20,9],r[2][3]=[7,1,26,25,27,24,11],r[3]=[,,,,],r[3][0]=[0,6,21,23,20,22,16],r[3][1]=[1,4,0,2,1,3,18],r[3][2]=[2,5,7,6,5,4,17],r[3][3]=[3,7,10,9,11,8,19];const e=[,,,,];function t(s,o,u){const c=o+s,h=c<>>32-u;return(a[0][h>>>24]^a[1][h>>>16&255])-a[2][h>>>8&255]+a[3][255&h]}function n(s,o,u){const c=o^s,h=c<>>32-u;return a[0][h>>>24]-a[1][h>>>16&255]+a[2][h>>>8&255]^a[3][255&h]}function i(s,o,u){const c=o-s,h=c<>>32-u;return(a[0][h>>>24]+a[1][h>>>16&255]^a[2][h>>>8&255])-a[3][255&h]}e[0]=[,,,,],e[0][0]=[24,25,23,22,18],e[0][1]=[26,27,21,20,22],e[0][2]=[28,29,19,18,25],e[0][3]=[30,31,17,16,28],e[1]=[,,,,],e[1][0]=[3,2,12,13,8],e[1][1]=[1,0,14,15,13],e[1][2]=[7,6,8,9,3],e[1][3]=[5,4,10,11,7],e[2]=[,,,,],e[2][0]=[19,18,28,29,25],e[2][1]=[17,16,30,31,28],e[2][2]=[23,22,24,25,18],e[2][3]=[21,20,26,27,22],e[3]=[,,,,],e[3][0]=[8,9,7,6,3],e[3][1]=[10,11,5,4,7],e[3][2]=[12,13,3,2,8],e[3][3]=[14,15,1,0,13],this.keySchedule=function(s){const o=[,,,,,,,,],u=Array(32);let c;for(let y=0;y<4;y++)c=4*y,o[y]=s[c]<<24|s[c+1]<<16|s[c+2]<<8|s[c+3];const h=[6,7,4,5];let l,w=0;for(let y=0;y<2;y++)for(let K=0;K<4;K++){for(c=0;c<4;c++){const C=r[K][c];l=o[C[1]],l^=a[4][o[C[2]>>>2]>>>24-8*(3&C[2])&255],l^=a[5][o[C[3]>>>2]>>>24-8*(3&C[3])&255],l^=a[6][o[C[4]>>>2]>>>24-8*(3&C[4])&255],l^=a[7][o[C[5]>>>2]>>>24-8*(3&C[5])&255],l^=a[h[c]][o[C[6]>>>2]>>>24-8*(3&C[6])&255],o[C[0]]=l}for(c=0;c<4;c++){const C=e[K][c];l=a[4][o[C[0]>>>2]>>>24-8*(3&C[0])&255],l^=a[5][o[C[1]>>>2]>>>24-8*(3&C[1])&255],l^=a[6][o[C[2]>>>2]>>>24-8*(3&C[2])&255],l^=a[7][o[C[3]>>>2]>>>24-8*(3&C[3])&255],l^=a[4+c][o[C[4]>>>2]>>>24-8*(3&C[4])&255],u[w]=l,w++}}for(let y=0;y<16;y++)this.masking[y]=u[y],this.rotate[y]=31&u[16+y]};const a=[,,,,,,,,];a[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],a[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],a[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],a[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],a[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],a[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],a[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],a[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function Qn(r){this.cast5=new B5,this.cast5.setKey(r),this.encrypt=function(e){return this.cast5.encrypt(e)}}Zn.keySize=Zn.prototype.keySize=24,Zn.blockSize=Zn.prototype.blockSize=8,Qn.blockSize=Qn.prototype.blockSize=8,Qn.keySize=Qn.prototype.keySize=16;const Se=4294967295;function Fe(r,e){return(r<>>32-e)&Se}function or(r,e){return r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24}function _r(r,e,t){r.splice(e,4,255&t,t>>>8&255,t>>>16&255,t>>>24&255)}function _t(r,e){return r>>>8*e&255}function Xn(r){this.tf=function(){let e=null,t=null,n=-1,i=[],a=[[],[],[],[]];function s(h){return a[0][_t(h,0)]^a[1][_t(h,1)]^a[2][_t(h,2)]^a[3][_t(h,3)]}function o(h){return a[0][_t(h,3)]^a[1][_t(h,0)]^a[2][_t(h,1)]^a[3][_t(h,2)]}function u(h,l){let w=s(l[0]),y=o(l[1]);l[2]=Fe(l[2]^w+y+i[4*h+8]&Se,31),l[3]=Fe(l[3],1)^w+2*y+i[4*h+9]&Se,w=s(l[2]),y=o(l[3]),l[0]=Fe(l[0]^w+y+i[4*h+10]&Se,31),l[1]=Fe(l[1],1)^w+2*y+i[4*h+11]&Se}function c(h,l){let w=s(l[0]),y=o(l[1]);l[2]=Fe(l[2],1)^w+y+i[4*h+10]&Se,l[3]=Fe(l[3]^w+2*y+i[4*h+11]&Se,31),w=s(l[2]),y=o(l[3]),l[0]=Fe(l[0],1)^w+y+i[4*h+8]&Se,l[1]=Fe(l[1]^w+2*y+i[4*h+9]&Se,31)}return{name:"twofish",blocksize:16,open:function(h){let l,w,y,K,C;e=h;const M=[],H=[],Q=[];let F;const E=[];let W,q,j;const G=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],Z=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],tt=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],rt=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],dt=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],it=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],O=[[],[]],ft=[[],[],[],[]];function Pt(yt){return yt^yt>>2^[0,90,180,238][3&yt]}function $(yt){return yt^yt>>1^yt>>2^[0,238,180,90][3&yt]}function at(yt,pt){let gt,ct,S;for(gt=0;gt<8;gt++)ct=pt>>>24,pt=pt<<8&Se|yt>>>24,yt=yt<<8&Se,S=ct<<1,128&ct&&(S^=333),pt^=ct^S<<16,S^=ct>>>1,1&ct&&(S^=166),pt^=S<<24|S<<8;return pt}function mt(yt,pt){const gt=pt>>4,ct=15&pt,S=G[yt][gt^ct],N=Z[yt][dt[ct]^it[gt]];return rt[yt][dt[N]^it[S]]<<4|tt[yt][S^N]}function bt(yt,pt){let gt=_t(yt,0),ct=_t(yt,1),S=_t(yt,2),N=_t(yt,3);switch(F){case 4:gt=O[1][gt]^_t(pt[3],0),ct=O[0][ct]^_t(pt[3],1),S=O[0][S]^_t(pt[3],2),N=O[1][N]^_t(pt[3],3);case 3:gt=O[1][gt]^_t(pt[2],0),ct=O[1][ct]^_t(pt[2],1),S=O[0][S]^_t(pt[2],2),N=O[0][N]^_t(pt[2],3);case 2:gt=O[0][O[0][gt]^_t(pt[1],0)]^_t(pt[0],0),ct=O[0][O[1][ct]^_t(pt[1],1)]^_t(pt[0],1),S=O[1][O[0][S]^_t(pt[1],2)]^_t(pt[0],2),N=O[1][O[1][N]^_t(pt[1],3)]^_t(pt[0],3)}return ft[0][gt]^ft[1][ct]^ft[2][S]^ft[3][N]}for(e=e.slice(0,32),l=e.length;l!==16&&l!==24&&l!==32;)e[l++]=0;for(l=0;l>2]=or(e,l);for(l=0;l<256;l++)O[0][l]=mt(0,l),O[1][l]=mt(1,l);for(l=0;l<256;l++)W=O[1][l],q=Pt(W),j=$(W),ft[0][l]=W+(q<<8)+(j<<16)+(j<<24),ft[2][l]=q+(j<<8)+(W<<16)+(j<<24),W=O[0][l],q=Pt(W),j=$(W),ft[1][l]=j+(j<<8)+(q<<16)+(W<<24),ft[3][l]=q+(W<<8)+(j<<16)+(q<<24);for(F=Q.length/2,l=0;l=0;y--)c(y,w);_r(t,n,w[2]^i[0]),_r(t,n+4,w[3]^i[1]),_r(t,n+8,w[0]^i[2]),_r(t,n+12,w[1]^i[3]),n+=16},finalize:function(){return t}}}(),this.tf.open(Array.from(r),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function Te(){}function Yn(r){this.bf=new Te,this.bf.init(r),this.encrypt=function(e){return this.bf.encryptBlock(e)}}Xn.keySize=Xn.prototype.keySize=32,Xn.blockSize=Xn.prototype.blockSize=16,Te.prototype.BLOCKSIZE=8,Te.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],Te.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Te.prototype.NN=16,Te.prototype._clean=function(r){return r<0&&(r=(2147483647&r)+2147483648),r},Te.prototype._F=function(r){let e;const t=255&r,n=255&(r>>>=8),i=255&(r>>>=8),a=255&(r>>>=8);return e=this.sboxes[0][a]+this.sboxes[1][i],e^=this.sboxes[2][n],e+=this.sboxes[3][t],e},Te.prototype._encryptBlock=function(r){let e,t=r[0],n=r[1];for(e=0;e>>24-8*e&255,i[e+n]=t[1]>>>24-8*e&255;return i},Te.prototype._decryptBlock=function(r){let e,t=r[0],n=r[1];for(e=this.NN+1;e>1;--e){t^=this.parray[e],n=this._F(t)^n;const i=t;t=n,n=i}t^=this.parray[1],n^=this.parray[0],r[0]=this._clean(n),r[1]=this._clean(t)},Te.prototype.init=function(r){let e,t=0;for(this.parray=[],e=0;e=r.length&&(t=0);this.parray[e]=this.PARRAY[e]^i}for(this.sboxes=[],e=0;e<4;++e)for(this.sboxes[e]=[],t=0;t<256;++t)this.sboxes[e][t]=this.SBOXES[e][t];const n=[0,0];for(e=0;e>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=at+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=mt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=bt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=yt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=pt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=gt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=ct+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=S+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=N+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=b+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=f+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=U+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=V+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=X+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=Y+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=V^S^mt^$,ht=P<<1|P>>>31,z=ht+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=X^N^bt^at,ot=P<<1|P>>>31,z=ot+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Y^b^yt^mt,lt=P<<1|P>>>31,z=lt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=ht^f^pt^bt,I=P<<1|P>>>31,z=I+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=ot^U^gt^yt,D=P<<1|P>>>31,z=D+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=lt^V^ct^pt,x=P<<1|P>>>31,z=x+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=I^X^S^gt,T=P<<1|P>>>31,z=T+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=D^Y^N^ct,R=P<<1|P>>>31,z=R+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=x^ht^b^S,L=P<<1|P>>>31,z=L+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=T^ot^f^N,v=P<<1|P>>>31,z=v+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=R^lt^U^b,k=P<<1|P>>>31,z=k+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=L^I^V^f,nt=P<<1|P>>>31,z=nt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=v^D^X^U,st=P<<1|P>>>31,z=st+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=k^x^Y^V,St=P<<1|P>>>31,z=St+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=nt^T^ht^X,It=P<<1|P>>>31,z=It+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=st^R^ot^Y,zt=P<<1|P>>>31,z=zt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=St^L^lt^ht,Dt=P<<1|P>>>31,z=Dt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=It^v^I^ot,Wt=P<<1|P>>>31,z=Wt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=zt^k^D^lt,Xt=P<<1|P>>>31,z=Xt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Dt^nt^x^I,Jt=P<<1|P>>>31,z=Jt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Wt^st^T^D,ne=P<<1|P>>>31,z=ne+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Xt^St^R^x,Ct=P<<1|P>>>31,z=Ct+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Jt^It^L^T,Mt=P<<1|P>>>31,z=Mt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=ne^zt^v^R,Lt=P<<1|P>>>31,z=Lt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ct^Dt^k^L,Et=P<<1|P>>>31,z=Et+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Mt^Wt^nt^v,qt=P<<1|P>>>31,z=qt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Lt^Xt^st^k,Ft=P<<1|P>>>31,z=Ft+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Et^Jt^St^nt,$t=P<<1|P>>>31,z=$t+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=qt^ne^It^st,J=P<<1|P>>>31,z=J+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ft^Ct^zt^St,et=P<<1|P>>>31,z=et+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=$t^Mt^Dt^It,ut=P<<1|P>>>31,z=ut+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=J^Lt^Wt^zt,wt=P<<1|P>>>31,z=wt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=et^Et^Xt^Dt,kt=P<<1|P>>>31,z=kt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=ut^qt^Jt^Wt,Ut=P<<1|P>>>31,z=Ut+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=wt^Ft^ne^Xt,At=P<<1|P>>>31,z=At+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=kt^$t^Ct^Jt,Nt=P<<1|P>>>31,z=Nt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ut^J^Mt^ne,jt=P<<1|P>>>31,z=jt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=At^et^Lt^Ct,De=P<<1|P>>>31,z=De+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Nt^ut^Et^Mt,xe=P<<1|P>>>31,z=xe+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=jt^wt^qt^Lt,Ie=P<<1|P>>>31,z=Ie+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=De^kt^Ft^Et,Ne=P<<1|P>>>31,z=Ne+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=xe^Ut^$t^qt,cn=P<<1|P>>>31,z=cn+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ie^At^J^Ft,un=P<<1|P>>>31,z=un+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ne^Nt^et^$t,hn=P<<1|P>>>31,z=hn+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=cn^jt^ut^J,ln=P<<1|P>>>31,z=ln+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=un^De^wt^et,fn=P<<1|P>>>31,z=fn+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=hn^xe^kt^ut,dn=P<<1|P>>>31,z=dn+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=ln^Ie^Ut^wt,yn=P<<1|P>>>31,z=yn+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=fn^Ne^At^kt,On=P<<1|P>>>31,z=On+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=dn^cn^Nt^Ut,Mn=P<<1|P>>>31,z=Mn+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=yn^un^jt^At,xi=P<<1|P>>>31,z=xi+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=On^hn^De^Nt,Ii=P<<1|P>>>31,z=Ii+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Mn^ln^xe^jt,Bi=P<<1|P>>>31,z=Bi+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=xi^fn^Ie^De,Ti=P<<1|P>>>31,z=Ti+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ii^dn^Ne^xe,Ri=P<<1|P>>>31,z=Ri+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Bi^yn^cn^Ie,zi=P<<1|P>>>31,z=zi+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ti^On^un^Ne,Ma=P<<1|P>>>31,z=Ma+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ri^Mn^hn^cn,Na=P<<1|P>>>31,z=Na+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=zi^xi^ln^un,Fa=P<<1|P>>>31,z=Fa+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ma^Ii^fn^hn,Ha=P<<1|P>>>31,z=Ha+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Na^Bi^dn^ln,$a=P<<1|P>>>31,z=$a+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Fa^Ti^yn^fn,f1=P<<1|P>>>31,z=f1+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ha^Ri^On^dn,d1=P<<1|P>>>31,z=d1+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=$a^zi^Mn^yn,y1=P<<1|P>>>31,z=y1+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,n=n+g|0,i=i+d|0,a=a+m|0,s=s+A|0,o=o+B|0}function q($){$=$|0,W(E[$|0]<<24|E[$|1]<<16|E[$|2]<<8|E[$|3],E[$|4]<<24|E[$|5]<<16|E[$|6]<<8|E[$|7],E[$|8]<<24|E[$|9]<<16|E[$|10]<<8|E[$|11],E[$|12]<<24|E[$|13]<<16|E[$|14]<<8|E[$|15],E[$|16]<<24|E[$|17]<<16|E[$|18]<<8|E[$|19],E[$|20]<<24|E[$|21]<<16|E[$|22]<<8|E[$|23],E[$|24]<<24|E[$|25]<<16|E[$|26]<<8|E[$|27],E[$|28]<<24|E[$|29]<<16|E[$|30]<<8|E[$|31],E[$|32]<<24|E[$|33]<<16|E[$|34]<<8|E[$|35],E[$|36]<<24|E[$|37]<<16|E[$|38]<<8|E[$|39],E[$|40]<<24|E[$|41]<<16|E[$|42]<<8|E[$|43],E[$|44]<<24|E[$|45]<<16|E[$|46]<<8|E[$|47],E[$|48]<<24|E[$|49]<<16|E[$|50]<<8|E[$|51],E[$|52]<<24|E[$|53]<<16|E[$|54]<<8|E[$|55],E[$|56]<<24|E[$|57]<<16|E[$|58]<<8|E[$|59],E[$|60]<<24|E[$|61]<<16|E[$|62]<<8|E[$|63])}function j($){$=$|0,E[$|0]=n>>>24,E[$|1]=n>>>16&255,E[$|2]=n>>>8&255,E[$|3]=n&255,E[$|4]=i>>>24,E[$|5]=i>>>16&255,E[$|6]=i>>>8&255,E[$|7]=i&255,E[$|8]=a>>>24,E[$|9]=a>>>16&255,E[$|10]=a>>>8&255,E[$|11]=a&255,E[$|12]=s>>>24,E[$|13]=s>>>16&255,E[$|14]=s>>>8&255,E[$|15]=s&255,E[$|16]=o>>>24,E[$|17]=o>>>16&255,E[$|18]=o>>>8&255,E[$|19]=o&255}function G(){n=1732584193,i=4023233417,a=2562383102,s=271733878,o=3285377520,u=c=0}function Z($,at,mt,bt,yt,pt,gt){$=$|0,at=at|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,n=$,i=at,a=mt,s=bt,o=yt,u=pt,c=gt}function tt($,at){$=$|0,at=at|0;var mt=0;if($&63)return-1;for(;(at|0)>=64;)q($),$=$+64|0,at=at-64|0,mt=mt+64|0;return u=u+mt|0,u>>>0>>0&&(c=c+1|0),mt|0}function rt($,at,mt){$=$|0,at=at|0,mt=mt|0;var bt=0,yt=0;if($&63||~mt&&mt&31)return-1;if((at|0)>=64){if(bt=tt($,at)|0,(bt|0)==-1)return-1;$=$+bt|0,at=at-bt|0}if(bt=bt+at|0,u=u+at|0,u>>>0>>0&&(c=c+1|0),E[$|at]=128,(at|0)>=56){for(yt=at+1|0;(yt|0)<64;yt=yt+1|0)E[$|yt]=0;q($),at=0,E[$|0]=0}for(yt=at+1|0;(yt|0)<59;yt=yt+1|0)E[$|yt]=0;return E[$|56]=c>>>21&255,E[$|57]=c>>>13&255,E[$|58]=c>>>5&255,E[$|59]=c<<3&255|u>>>29,E[$|60]=u>>>21&255,E[$|61]=u>>>13&255,E[$|62]=u>>>5&255,E[$|63]=u<<3&255,q($),~mt&&j(mt),bt|0}function dt(){n=h,i=l,a=w,s=y,o=K,u=64,c=0}function it(){n=C,i=M,a=H,s=Q,o=F,u=64,c=0}function O($,at,mt,bt,yt,pt,gt,ct,S,N,b,f,U,V,X,Y){$=$|0,at=at|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,ct=ct|0,S=S|0,N=N|0,b=b|0,f=f|0,U=U|0,V=V|0,X=X|0,Y=Y|0,G(),W($^1549556828,at^1549556828,mt^1549556828,bt^1549556828,yt^1549556828,pt^1549556828,gt^1549556828,ct^1549556828,S^1549556828,N^1549556828,b^1549556828,f^1549556828,U^1549556828,V^1549556828,X^1549556828,Y^1549556828),C=n,M=i,H=a,Q=s,F=o,G(),W($^909522486,at^909522486,mt^909522486,bt^909522486,yt^909522486,pt^909522486,gt^909522486,ct^909522486,S^909522486,N^909522486,b^909522486,f^909522486,U^909522486,V^909522486,X^909522486,Y^909522486),h=n,l=i,w=a,y=s,K=o,u=64,c=0}function ft($,at,mt){$=$|0,at=at|0,mt=mt|0;var bt=0,yt=0,pt=0,gt=0,ct=0,S=0;return $&63||~mt&&mt&31?-1:(S=rt($,at,-1)|0,bt=n,yt=i,pt=a,gt=s,ct=o,it(),W(bt,yt,pt,gt,ct,2147483648,0,0,0,0,0,0,0,0,0,672),~mt&&j(mt),S|0)}function Pt($,at,mt,bt,yt){$=$|0,at=at|0,mt=mt|0,bt=bt|0,yt=yt|0;var pt=0,gt=0,ct=0,S=0,N=0,b=0,f=0,U=0,V=0,X=0;if($&63||~yt&&yt&31)return-1;for(E[$+at|0]=mt>>>24,E[$+at+1|0]=mt>>>16&255,E[$+at+2|0]=mt>>>8&255,E[$+at+3|0]=mt&255,ft($,at+4|0,-1)|0,pt=b=n,gt=f=i,ct=U=a,S=V=s,N=X=o,bt=bt-1|0;(bt|0)>0;)dt(),W(b,f,U,V,X,2147483648,0,0,0,0,0,0,0,0,0,672),b=n,f=i,U=a,V=s,X=o,it(),W(b,f,U,V,X,2147483648,0,0,0,0,0,0,0,0,0,672),b=n,f=i,U=a,V=s,X=o,pt=pt^n,gt=gt^i,ct=ct^a,S=S^s,N=N^o,bt=bt-1|0;return n=pt,i=gt,a=ct,s=S,o=N,~yt&&j(yt),0}return{reset:G,init:Z,process:tt,finish:rt,hmac_reset:dt,hmac_init:O,hmac_finish:ft,pbkdf2_generate_block:Pt}};class i2{constructor(){this.pos=0,this.len=0}reset(){const{asm:e}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,e.reset(),this}process(e){if(this.result!==null)throw new Cs("state must be reset before processing new data");const{asm:t,heap:n}=this.acquire_asm();let i=this.pos,a=this.len,s=0,o=e.length,u=0;for(;o>0;)u=Zr(n,i+a,e,s,o),a+=u,s+=u,o-=u,u=t.process(i,a),i+=u,a-=u,a||(i=0);return this.pos=i,this.len=a,this}finish(){if(this.result!==null)throw new Cs("state must be reset before processing new data");const{asm:e,heap:t}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(t.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const N1=[],F1=[];class Qr extends i2{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return this.heap!==void 0&&this.asm!==void 0||(this.heap=N1.pop()||Qs(),this.asm=F1.pop()||n2({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(N1.push(this.heap),F1.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new Qr().process(e).finish().result}}Qr.NAME="sha1",Qr.heap_pool=[],Qr.asm_pool=[],Qr.asm_function=n2;const H1=[],$1=[];class Ca extends i2{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return this.heap!==void 0&&this.asm!==void 0||(this.heap=H1.pop()||Qs(),this.asm=$1.pop()||function(e,t,n){var i=0,a=0,s=0,o=0,u=0,c=0,h=0,l=0,w=0,y=0,K=0,C=0,M=0,H=0,Q=0,F=0,E=0,W=0,q=0,j=0,G=0,Z=0,tt=0,rt=0,dt=0,it=0,O=new e.Uint8Array(n);function ft(b,f,U,V,X,Y,g,d,m,A,B,P,z,ht,ot,lt){b=b|0,f=f|0,U=U|0,V=V|0,X=X|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,B=B|0,P=P|0,z=z|0,ht=ht|0,ot=ot|0,lt=lt|0;var I=0,D=0,x=0,T=0,R=0,L=0,v=0,k=0;I=i,D=a,x=s,T=o,R=u,L=c,v=h,k=l,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+1116352408|0,T=T+k|0,k=k+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,v=f+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+1899447441|0,x=x+v|0,v=v+(k&I^D&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,L=U+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+3049323471|0,D=D+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,R=V+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+3921009573|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,T=X+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+961987163|0,k=k+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,x=Y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(D^k&(I^D))+1508970993|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,D=g+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2453635748|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+2870763221|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+3624381080|0,T=T+k|0,k=k+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,v=A+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+310598401|0,x=x+v|0,v=v+(k&I^D&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,L=B+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+607225278|0,D=D+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,R=P+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+1426881987|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,T=z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+1925078388|0,k=k+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,x=ht+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(D^k&(I^D))+2162078206|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,D=ot+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2614888103|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,I=lt+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+3248222580|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(ot>>>17^ot>>>19^ot>>>10^ot<<15^ot<<13)+b+A|0,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+3835390401|0,T=T+k|0,k=k+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(lt>>>17^lt>>>19^lt>>>10^lt<<15^lt<<13)+f+B|0,v=f+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+4022224774|0,x=x+v|0,v=v+(k&I^D&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(V>>>7^V>>>18^V>>>3^V<<25^V<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+U+P|0,L=U+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+264347078|0,D=D+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,V=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+V+z|0,R=V+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+604807628|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,X=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ht|0,T=X+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+770255983|0,k=k+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(V>>>17^V>>>19^V>>>10^V<<15^V<<13)+Y+ot|0,x=Y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(D^k&(I^D))+1249150122|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(X>>>17^X>>>19^X>>>10^X<<15^X<<13)+g+lt|0,D=g+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+1555081692|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<13)+d+b|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+1996064986|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,m=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+2554220882|0,T=T+k|0,k=k+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,A=(B>>>7^B>>>18^B>>>3^B<<25^B<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+A+U|0,v=A+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+2821834349|0,x=x+v|0,v=v+(k&I^D&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,B=(P>>>7^P>>>18^P>>>3^P<<25^P<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+B+V|0,L=B+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+2952996808|0,D=D+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,P=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+P+X|0,R=P+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+3210313671|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(B>>>17^B>>>19^B>>>10^B<<15^B<<13)+z+Y|0,T=z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+3336571891|0,k=k+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ht=(ot>>>7^ot>>>18^ot>>>3^ot<<25^ot<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ht+g|0,x=ht+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(D^k&(I^D))+3584528711|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,ot=(lt>>>7^lt>>>18^lt>>>3^lt<<25^lt<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+ot+d|0,D=ot+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+113926993|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,lt=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+lt+m|0,I=lt+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+338241895|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(ot>>>17^ot>>>19^ot>>>10^ot<<15^ot<<13)+b+A|0,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+666307205|0,T=T+k|0,k=k+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(lt>>>17^lt>>>19^lt>>>10^lt<<15^lt<<13)+f+B|0,v=f+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+773529912|0,x=x+v|0,v=v+(k&I^D&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(V>>>7^V>>>18^V>>>3^V<<25^V<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+U+P|0,L=U+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+1294757372|0,D=D+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,V=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+V+z|0,R=V+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+1396182291|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,X=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ht|0,T=X+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+1695183700|0,k=k+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(V>>>17^V>>>19^V>>>10^V<<15^V<<13)+Y+ot|0,x=Y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(D^k&(I^D))+1986661051|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(X>>>17^X>>>19^X>>>10^X<<15^X<<13)+g+lt|0,D=g+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2177026350|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<13)+d+b|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+2456956037|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,m=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+2730485921|0,T=T+k|0,k=k+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,A=(B>>>7^B>>>18^B>>>3^B<<25^B<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+A+U|0,v=A+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+2820302411|0,x=x+v|0,v=v+(k&I^D&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,B=(P>>>7^P>>>18^P>>>3^P<<25^P<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+B+V|0,L=B+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+3259730800|0,D=D+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,P=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+P+X|0,R=P+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+3345764771|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(B>>>17^B>>>19^B>>>10^B<<15^B<<13)+z+Y|0,T=z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+3516065817|0,k=k+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ht=(ot>>>7^ot>>>18^ot>>>3^ot<<25^ot<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ht+g|0,x=ht+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(D^k&(I^D))+3600352804|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,ot=(lt>>>7^lt>>>18^lt>>>3^lt<<25^lt<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+ot+d|0,D=ot+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+4094571909|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,lt=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+lt+m|0,I=lt+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+275423344|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(ot>>>17^ot>>>19^ot>>>10^ot<<15^ot<<13)+b+A|0,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+430227734|0,T=T+k|0,k=k+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(lt>>>17^lt>>>19^lt>>>10^lt<<15^lt<<13)+f+B|0,v=f+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+506948616|0,x=x+v|0,v=v+(k&I^D&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(V>>>7^V>>>18^V>>>3^V<<25^V<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+U+P|0,L=U+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+659060556|0,D=D+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,V=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+V+z|0,R=V+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+883997877|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,X=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ht|0,T=X+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+958139571|0,k=k+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(V>>>17^V>>>19^V>>>10^V<<15^V<<13)+Y+ot|0,x=Y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(D^k&(I^D))+1322822218|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(X>>>17^X>>>19^X>>>10^X<<15^X<<13)+g+lt|0,D=g+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+1537002063|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<13)+d+b|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+1747873779|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,m=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+1955562222|0,T=T+k|0,k=k+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,A=(B>>>7^B>>>18^B>>>3^B<<25^B<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+A+U|0,v=A+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+2024104815|0,x=x+v|0,v=v+(k&I^D&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,B=(P>>>7^P>>>18^P>>>3^P<<25^P<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+B+V|0,L=B+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+2227730452|0,D=D+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,P=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+P+X|0,R=P+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+2361852424|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(B>>>17^B>>>19^B>>>10^B<<15^B<<13)+z+Y|0,T=z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+2428436474|0,k=k+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ht=(ot>>>7^ot>>>18^ot>>>3^ot<<25^ot<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ht+g|0,x=ht+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(D^k&(I^D))+2756734187|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,ot=(lt>>>7^lt>>>18^lt>>>3^lt<<25^lt<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+ot+d|0,D=ot+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+3204031479|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,lt=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+lt+m|0,I=lt+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+3329325298|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,i=i+I|0,a=a+D|0,s=s+x|0,o=o+T|0,u=u+R|0,c=c+L|0,h=h+v|0,l=l+k|0}function Pt(b){b=b|0,ft(O[b|0]<<24|O[b|1]<<16|O[b|2]<<8|O[b|3],O[b|4]<<24|O[b|5]<<16|O[b|6]<<8|O[b|7],O[b|8]<<24|O[b|9]<<16|O[b|10]<<8|O[b|11],O[b|12]<<24|O[b|13]<<16|O[b|14]<<8|O[b|15],O[b|16]<<24|O[b|17]<<16|O[b|18]<<8|O[b|19],O[b|20]<<24|O[b|21]<<16|O[b|22]<<8|O[b|23],O[b|24]<<24|O[b|25]<<16|O[b|26]<<8|O[b|27],O[b|28]<<24|O[b|29]<<16|O[b|30]<<8|O[b|31],O[b|32]<<24|O[b|33]<<16|O[b|34]<<8|O[b|35],O[b|36]<<24|O[b|37]<<16|O[b|38]<<8|O[b|39],O[b|40]<<24|O[b|41]<<16|O[b|42]<<8|O[b|43],O[b|44]<<24|O[b|45]<<16|O[b|46]<<8|O[b|47],O[b|48]<<24|O[b|49]<<16|O[b|50]<<8|O[b|51],O[b|52]<<24|O[b|53]<<16|O[b|54]<<8|O[b|55],O[b|56]<<24|O[b|57]<<16|O[b|58]<<8|O[b|59],O[b|60]<<24|O[b|61]<<16|O[b|62]<<8|O[b|63])}function $(b){b=b|0,O[b|0]=i>>>24,O[b|1]=i>>>16&255,O[b|2]=i>>>8&255,O[b|3]=i&255,O[b|4]=a>>>24,O[b|5]=a>>>16&255,O[b|6]=a>>>8&255,O[b|7]=a&255,O[b|8]=s>>>24,O[b|9]=s>>>16&255,O[b|10]=s>>>8&255,O[b|11]=s&255,O[b|12]=o>>>24,O[b|13]=o>>>16&255,O[b|14]=o>>>8&255,O[b|15]=o&255,O[b|16]=u>>>24,O[b|17]=u>>>16&255,O[b|18]=u>>>8&255,O[b|19]=u&255,O[b|20]=c>>>24,O[b|21]=c>>>16&255,O[b|22]=c>>>8&255,O[b|23]=c&255,O[b|24]=h>>>24,O[b|25]=h>>>16&255,O[b|26]=h>>>8&255,O[b|27]=h&255,O[b|28]=l>>>24,O[b|29]=l>>>16&255,O[b|30]=l>>>8&255,O[b|31]=l&255}function at(){i=1779033703,a=3144134277,s=1013904242,o=2773480762,u=1359893119,c=2600822924,h=528734635,l=1541459225,w=y=0}function mt(b,f,U,V,X,Y,g,d,m,A){b=b|0,f=f|0,U=U|0,V=V|0,X=X|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,i=b,a=f,s=U,o=V,u=X,c=Y,h=g,l=d,w=m,y=A}function bt(b,f){b=b|0,f=f|0;var U=0;if(b&63)return-1;for(;(f|0)>=64;)Pt(b),b=b+64|0,f=f-64|0,U=U+64|0;return w=w+U|0,w>>>0>>0&&(y=y+1|0),U|0}function yt(b,f,U){b=b|0,f=f|0,U=U|0;var V=0,X=0;if(b&63||~U&&U&31)return-1;if((f|0)>=64){if(V=bt(b,f)|0,(V|0)==-1)return-1;b=b+V|0,f=f-V|0}if(V=V+f|0,w=w+f|0,w>>>0>>0&&(y=y+1|0),O[b|f]=128,(f|0)>=56){for(X=f+1|0;(X|0)<64;X=X+1|0)O[b|X]=0;Pt(b),f=0,O[b|0]=0}for(X=f+1|0;(X|0)<59;X=X+1|0)O[b|X]=0;return O[b|56]=y>>>21&255,O[b|57]=y>>>13&255,O[b|58]=y>>>5&255,O[b|59]=y<<3&255|w>>>29,O[b|60]=w>>>21&255,O[b|61]=w>>>13&255,O[b|62]=w>>>5&255,O[b|63]=w<<3&255,Pt(b),~U&&$(U),V|0}function pt(){i=K,a=C,s=M,o=H,u=Q,c=F,h=E,l=W,w=64,y=0}function gt(){i=q,a=j,s=G,o=Z,u=tt,c=rt,h=dt,l=it,w=64,y=0}function ct(b,f,U,V,X,Y,g,d,m,A,B,P,z,ht,ot,lt){b=b|0,f=f|0,U=U|0,V=V|0,X=X|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,B=B|0,P=P|0,z=z|0,ht=ht|0,ot=ot|0,lt=lt|0,at(),ft(b^1549556828,f^1549556828,U^1549556828,V^1549556828,X^1549556828,Y^1549556828,g^1549556828,d^1549556828,m^1549556828,A^1549556828,B^1549556828,P^1549556828,z^1549556828,ht^1549556828,ot^1549556828,lt^1549556828),q=i,j=a,G=s,Z=o,tt=u,rt=c,dt=h,it=l,at(),ft(b^909522486,f^909522486,U^909522486,V^909522486,X^909522486,Y^909522486,g^909522486,d^909522486,m^909522486,A^909522486,B^909522486,P^909522486,z^909522486,ht^909522486,ot^909522486,lt^909522486),K=i,C=a,M=s,H=o,Q=u,F=c,E=h,W=l,w=64,y=0}function S(b,f,U){b=b|0,f=f|0,U=U|0;var V=0,X=0,Y=0,g=0,d=0,m=0,A=0,B=0,P=0;return b&63||~U&&U&31?-1:(P=yt(b,f,-1)|0,V=i,X=a,Y=s,g=o,d=u,m=c,A=h,B=l,gt(),ft(V,X,Y,g,d,m,A,B,2147483648,0,0,0,0,0,0,768),~U&&$(U),P|0)}function N(b,f,U,V,X){b=b|0,f=f|0,U=U|0,V=V|0,X=X|0;var Y=0,g=0,d=0,m=0,A=0,B=0,P=0,z=0,ht=0,ot=0,lt=0,I=0,D=0,x=0,T=0,R=0;if(b&63||~X&&X&31)return-1;for(O[b+f|0]=U>>>24,O[b+f+1|0]=U>>>16&255,O[b+f+2|0]=U>>>8&255,O[b+f+3|0]=U&255,S(b,f+4|0,-1)|0,Y=ht=i,g=ot=a,d=lt=s,m=I=o,A=D=u,B=x=c,P=T=h,z=R=l,V=V-1|0;(V|0)>0;)pt(),ft(ht,ot,lt,I,D,x,T,R,2147483648,0,0,0,0,0,0,768),ht=i,ot=a,lt=s,I=o,D=u,x=c,T=h,R=l,gt(),ft(ht,ot,lt,I,D,x,T,R,2147483648,0,0,0,0,0,0,768),ht=i,ot=a,lt=s,I=o,D=u,x=c,T=h,R=l,Y=Y^i,g=g^a,d=d^s,m=m^o,A=A^u,B=B^c,P=P^h,z=z^l,V=V-1|0;return i=Y,a=g,s=d,o=m,u=A,c=B,h=P,l=z,~X&&$(X),0}return{reset:at,init:mt,process:bt,finish:yt,hmac_reset:pt,hmac_init:ct,hmac_finish:S,pbkdf2_generate_block:N}}({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(H1.push(this.heap),$1.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new Ca().process(e).finish().result}}Ca.NAME="sha256";var Da=a2;function a2(r,e){if(!r)throw Error(e||"Assertion failed")}a2.equal=function(r,e,t){if(r!=e)throw Error(t||"Assertion failed: "+r+" != "+e)};var P6=Je!==void 0?Je:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ys(r,e){return r(e={exports:{}},e.exports),e.exports}function L5(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var O5=Ys(function(r){r.exports=typeof Object.create=="function"?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),M5=function(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for((r=r.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(r="0"+r),n=0;n>8,s=255&i;a?t.push(a,s):t.push(s)}else for(n=0;n>>24|r>>>8&65280|r<<8&16711680|(255&r)<<24)>>>0}var F5=function(r,e){for(var t="",n=0;n>>0}return a},$5=function(r,e){for(var t=Array(4*r.length),n=0,i=0;n>>24,t[i+1]=a>>>16&255,t[i+2]=a>>>8&255,t[i+3]=255&a):(t[i+3]=a>>>24,t[i+2]=a>>>16&255,t[i+1]=a>>>8&255,t[i]=255&a)}return t},xt={inherits:O5,toArray:M5,toHex:N5,htonl:s2,toHex32:F5,zero2:o2,zero8:c2,join32:H5,split32:$5,rotr32:function(r,e){return r>>>e|r<<32-e},rotl32:function(r,e){return r<>>32-e},sum32:function(r,e){return r+e>>>0},sum32_3:function(r,e,t){return r+e+t>>>0},sum32_4:function(r,e,t,n){return r+e+t+n>>>0},sum32_5:function(r,e,t,n,i){return r+e+t+n+i>>>0},sum64:function(r,e,t,n){var i=r[e],a=n+r[e+1]>>>0,s=(a>>0,r[e+1]=a},sum64_hi:function(r,e,t,n){return(e+n>>>0>>0},sum64_lo:function(r,e,t,n){return e+n>>>0},sum64_4_hi:function(r,e,t,n,i,a,s,o){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(r,e,t,n,i,a,s,o){return e+n+a+o>>>0},sum64_5_hi:function(r,e,t,n,i,a,s,o,u,c){var h=0,l=e;return h+=(l=l+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(r,e,t,n,i,a,s,o,u,c){return e+n+a+o+c>>>0},rotr64_hi:function(r,e,t){return(e<<32-t|r>>>t)>>>0},rotr64_lo:function(r,e,t){return(r<<32-t|e>>>t)>>>0},shr64_hi:function(r,e,t){return r>>>t},shr64_lo:function(r,e,t){return(r<<32-t|e>>>t)>>>0}};function Vi(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var q5=Vi;Vi.prototype.update=function(r,e){if(r=xt.toArray(r,e),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){var t=(r=this.pending).length%this._delta8;this.pending=r.slice(r.length-t,r.length),this.pending.length===0&&(this.pending=null),r=xt.join32(r,0,r.length-t,this.endian);for(var n=0;n>>24&255,n[i++]=r>>>16&255,n[i++]=r>>>8&255,n[i++]=255&r}else for(n[i++]=255&r,n[i++]=r>>>8&255,n[i++]=r>>>16&255,n[i++]=r>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3},g1_256:function(r){return He(r,17)^He(r,19)^r>>>10}},Be=xt.sum32,G5=xt.sum32_4,W5=xt.sum32_5,V5=Tn.ch32,Z5=Tn.maj32,Q5=Tn.s0_256,X5=Tn.s1_256,Y5=Tn.g0_256,J5=Tn.g1_256,f2=Js.BlockHash,tu=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Ge(){if(!(this instanceof Ge))return new Ge;f2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=tu,this.W=Array(64)}xt.inherits(Ge,f2);var d2=Ge;function yr(){if(!(this instanceof yr))return new yr;d2.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Ge.blockSize=512,Ge.outSize=256,Ge.hmacStrength=192,Ge.padLength=64,Ge.prototype._update=function(r,e){for(var t=this.W,n=0;n<16;n++)t[n]=r[e+n];for(;n>>32-i,t)}function fe(r,e,t,n,i,a,s){return xa(e&t|~e&n,r,e,i,a,s)}function de(r,e,t,n,i,a,s){return xa(e&n|t&~n,r,e,i,a,s)}function ye(r,e,t,n,i,a,s){return xa(e^t^n,r,e,i,a,s)}function pe(r,e,t,n,i,a,s){return xa(t^(e|~n),r,e,i,a,s)}function Pu(r){const e=[];let t;for(t=0;t<64;t+=4)e[t>>2]=r.charCodeAt(t)+(r.charCodeAt(t+1)<<8)+(r.charCodeAt(t+2)<<16)+(r.charCodeAt(t+3)<<24);return e}const W1="0123456789abcdef".split("");function Uu(r){let e="",t=0;for(;t<4;t++)e+=W1[r>>8*t+4&15]+W1[r>>8*t&15];return e}function Br(r,e){return r+e&4294967295}const sa=_.getWebCrypto(),oa=_.getNodeCrypto(),Ku=oa&&oa.getHashes();function qr(r){if(oa&&Ku.includes(r))return async function(e){const t=oa.createHash(r);return Yt(e,n=>{t.update(n)},()=>new Uint8Array(t.digest()))}}function Oi(r,e){return async function(t,n=vt){if(le(t)&&(t=await sr(t)),!_.isStream(t)&&sa&&e&&t.length>=n.minBytesForWebCrypto)return new Uint8Array(await sa.digest(e,t));const i=r();return Yt(t,a=>{i.update(a)},()=>new Uint8Array(i.digest()))}}function V1(r,e){return async function(t,n=vt){if(le(t)&&(t=await sr(t)),_.isStream(t)){const i=new r;return Yt(t,a=>{i.process(a)},()=>i.finish().result)}return sa&&e&&t.length>=n.minBytesForWebCrypto?new Uint8Array(await sa.digest(e,t)):r.bytes(t)}}const jr={md5:qr("md5")||async function(r){const e=function(t){const n=t.length,i=[1732584193,-271733879,-1732584194,271733878];let a;for(a=64;a<=t.length;a+=64)Qa(i,Pu(t.substring(a-64,a)));t=t.substring(a-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(a=0;a>2]|=t.charCodeAt(a)<<(a%4<<3);if(s[a>>2]|=128<<(a%4<<3),a>55)for(Qa(i,s),a=0;a<16;a++)s[a]=0;return s[14]=8*n,Qa(i,s),i}(_.uint8ArrayToString(r));return _.hexToUint8Array(function(t){for(let n=0;nnew Uint8Array(M.update(H)))}(r,e,t,n);if(_.isAES(r))return function(l,w,y,K,C){if(_.getWebCrypto()&&w.length!==24&&!_.isStream(y)&&y.length>=3e3*C.minBytesForWebCrypto)return async function(H,Q,F,E){const W="AES-CBC",q=await Z1.importKey("raw",Q,{name:W},!1,["encrypt"]),{blockSize:j}=rr(H),G=_.concatUint8Array([new Uint8Array(j),F]),Z=new Uint8Array(await Z1.encrypt({name:W,iv:E},q,G)).subarray(0,F.length);return function(tt,rt){for(let dt=0;dtM.aes.AES_Encrypt_process(H),()=>M.aes.AES_Encrypt_finish())}(r,e,t,n,i);const s=new(rr(r))(e),o=s.blockSize,u=n.slice();let c=new Uint8Array;const h=l=>{l&&(c=_.concatUint8Array([c,l]));const w=new Uint8Array(c.length);let y,K=0;for(;l?c.length>=o:c.length;){const C=s.encrypt(u);for(y=0;ynew Uint8Array(C.update(M)))}(r,e,t,n);if(_.isAES(r))return function(h,l,w,y){if(_.isStream(w)){const K=new Sn(l,y);return Yt(w,C=>K.aes.AES_Decrypt_process(C),()=>K.aes.AES_Decrypt_finish())}return Sn.decrypt(w,l,y)}(0,e,t,n);const a=new(rr(r))(e),s=a.blockSize;let o=n,u=new Uint8Array;const c=h=>{h&&(u=_.concatUint8Array([u,h]));const l=new Uint8Array(u.length);let w,y=0;for(;h?u.length>=s:u.length;){const K=a.encrypt(o);for(o=u.subarray(0,s),w=0;w48)throw new gr("illegal counter size");let a=Math.pow(2,n)-1;i.set_mask(0,0,a/4294967296|0,0|a)}else n=48,i.set_mask(0,0,65535,4294967295);if(e===void 0)throw Error("nonce is required");{let a=e.length;if(!a||a>16)throw new gr("illegal nonce size");let s=new DataView(new ArrayBuffer(16));new Uint8Array(s.buffer).set(e),i.set_nonce(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}if(t!==void 0){if(t<0||t>=Math.pow(2,n))throw new gr("illegal counter value");i.set_counter(0,0,t/4294967296|0,0|t)}}}class ha{static encrypt(e,t,n=!0,i){return new ha(t,i,n).encrypt(e)}static decrypt(e,t,n=!0,i){return new ha(t,i,n).decrypt(e)}constructor(e,t,n=!0,i){this.aes=i||new Si(e,t,n,"CBC")}encrypt(e){return Nr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Nr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const Q1=_.getWebCrypto(),Du=_.getNodeCrypto(),lr=16;function X1(r,e){const t=r.length-lr;for(let n=0;n>3),17+(y>>3)),8-(7&y)).subarray(1),H=new Uint8Array(we),Q=new Uint8Array(u.length+Ur);let F,E=0;for(F=0;F16)throw new gr("illegal tagSize value");const u=t.length||0,c=new Uint8Array(16);u!==12?(this._gcm_mac_process(t),o[0]=0,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=0,o[11]=u>>>29,o[12]=u>>>21&255,o[13]=u>>>13&255,o[14]=u>>>5&255,o[15]=u<<3&255,s.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),s.get_iv(Kt.HEAP_DATA),s.set_iv(0,0,0,0),c.set(o.subarray(0,16))):(c.set(t),c[15]=1);const h=new DataView(c.buffer);if(this.gamma0=h.getUint32(12),s.set_nonce(h.getUint32(0),h.getUint32(4),h.getUint32(8),0),s.set_mask(0,0,0,4294967295),n!==void 0){if(n.length>Ya)throw new gr("illegal adata length");n.length?(this.adata=n,this._gcm_mac_process(n)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");s.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,t,n,i,a){return new Xr(t,n,i,a).encrypt(e)}static decrypt(e,t,n,i,a){return new Xr(t,n,i,a).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let t=0,n=e.length||0,{asm:i,heap:a}=this.aes.acquire_asm(),s=this.counter,o=this.aes.pos,u=this.aes.len,c=0,h=u+n&-16,l=0;if((s-1<<4)+u+n>Ya)throw new RangeError("counter overflow");const w=new Uint8Array(h);for(;n>0;)l=Zr(a,o+u,e,t,n),u+=l,t+=l,n-=l,l=i.cipher(Kt.ENC.CTR,Kt.HEAP_DATA+o,u),l=i.mac(Kt.MAC.GCM,Kt.HEAP_DATA+o,l),l&&w.set(a.subarray(o,o+l),c),s+=l>>>4,c+=l,l>>29,t[4]=h>>>21,t[5]=h>>>13&255,t[6]=h>>>5&255,t[7]=h<<3&255,t[8]=t[9]=t[10]=0,t[11]=l>>>29,t[12]=l>>>21&255,t[13]=l>>>13&255,t[14]=l>>>5&255,t[15]=l<<3&255,e.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),e.get_iv(Kt.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(Kt.ENC.CTR,Kt.HEAP_DATA,16),u.set(t.subarray(0,i),o),this.counter=1,this.aes.pos=0,this.aes.len=0,u}AES_GCM_Decrypt_process(e){let t=0,n=e.length||0,{asm:i,heap:a}=this.aes.acquire_asm(),s=this.counter,o=this.tagSize,u=this.aes.pos,c=this.aes.len,h=0,l=c+n>o?c+n-o&-16:0,w=c+n-l,y=0;if((s-1<<4)+c+n>Ya)throw new RangeError("counter overflow");const K=new Uint8Array(l);for(;n>w;)y=Zr(a,u+c,e,t,n-w),c+=y,t+=y,n-=y,y=i.mac(Kt.MAC.GCM,Kt.HEAP_DATA+u,y),y=i.cipher(Kt.DEC.CTR,Kt.HEAP_DATA+u,y),y&&K.set(a.subarray(u,u+y),h),s+=y>>>4,h+=y,u=0,c=0;return n>0&&(c+=Zr(a,0,e,t,n)),this.counter=s,this.aes.pos=u,this.aes.len=c,K}AES_GCM_Decrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),n=this.tagSize,i=this.adata,a=this.counter,s=this.aes.pos,o=this.aes.len,u=o-n;if(o>>29,t[4]=w>>>21,t[5]=w>>>13&255,t[6]=w>>>5&255,t[7]=w<<3&255,t[8]=t[9]=t[10]=0,t[11]=y>>>29,t[12]=y>>>21&255,t[13]=y>>>13&255,t[14]=y>>>5&255,t[15]=y<<3&255,e.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),e.get_iv(Kt.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(Kt.ENC.CTR,Kt.HEAP_DATA,16);let K=0;for(let C=0;C0;){for(s=Zr(n,0,e,i,a),i+=s,a-=s;15&s;)n[s++]=0;t.mac(Kt.MAC.GCM,Kt.HEAP_DATA,s)}}}const Ja=_.getWebCrypto(),e0=_.getNodeCrypto(),r0=_.getNodeBuffer(),kn=16,ts="AES-GCM";async function An(r,e){if(r!==p.symmetric.aes128&&r!==p.symmetric.aes192&&r!==p.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(_.getNodeCrypto())return{encrypt:async function(t,n,i=new Uint8Array){const a=new e0.createCipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i);const s=r0.concat([a.update(t),a.final(),a.getAuthTag()]);return new Uint8Array(s)},decrypt:async function(t,n,i=new Uint8Array){const a=new e0.createDecipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i),a.setAuthTag(t.slice(t.length-kn,t.length));const s=r0.concat([a.update(t.slice(0,t.length-kn)),a.final()]);return new Uint8Array(s)}};if(_.getWebCrypto()&&e.length!==24){const t=await Ja.importKey("raw",e,{name:ts},!1,["encrypt","decrypt"]);return{encrypt:async function(n,i,a=new Uint8Array){if(!n.length)return Xr.encrypt(n,e,i,a);const s=await Ja.encrypt({name:ts,iv:i,additionalData:a,tagLength:8*kn},t,n);return new Uint8Array(s)},decrypt:async function(n,i,a=new Uint8Array){if(n.length===kn)return Xr.decrypt(n,e,i,a);const s=await Ja.decrypt({name:ts,iv:i,additionalData:a,tagLength:8*kn},t,n);return new Uint8Array(s)}}}return{encrypt:async function(t,n,i){return Xr.encrypt(t,e,n,i)},decrypt:async function(t,n,i){return Xr.decrypt(t,e,n,i)}}}An.getNonce=function(r,e){const t=r.slice();for(let n=0;n>>8)-1}(S,N,b,f,32)}function K(S,N){var b;for(b=0;b<16;b++)S[b]=0|N[b]}function C(S){var N,b,f=1;for(N=0;N<16;N++)b=S[N]+f+65535,f=Math.floor(b/65536),S[N]=b-65536*f;S[0]+=f-1+37*(f-1)}function M(S,N,b){for(var f,U=~(b-1),V=0;V<16;V++)f=U&(S[V]^N[V]),S[V]^=f,N[V]^=f}function H(S,N){var b,f,U,V=t(),X=t();for(b=0;b<16;b++)X[b]=N[b];for(C(X),C(X),C(X),f=0;f<2;f++){for(V[0]=X[0]-65517,b=1;b<15;b++)V[b]=X[b]-65535-(V[b-1]>>16&1),V[b-1]&=65535;V[15]=X[15]-32767-(V[14]>>16&1),U=V[15]>>16&1,V[14]&=65535,M(X,V,1-U)}for(b=0;b<16;b++)S[2*b]=255&X[b],S[2*b+1]=X[b]>>8}function Q(S,N){var b=new Uint8Array(32),f=new Uint8Array(32);return H(b,S),H(f,N),y(b,0,f,0)}function F(S){var N=new Uint8Array(32);return H(N,S),1&N[0]}function E(S,N){var b;for(b=0;b<16;b++)S[b]=N[2*b]+(N[2*b+1]<<8);S[15]&=32767}function W(S,N,b){for(var f=0;f<16;f++)S[f]=N[f]+b[f]}function q(S,N,b){for(var f=0;f<16;f++)S[f]=N[f]-b[f]}function j(S,N,b){var f,U,V=0,X=0,Y=0,g=0,d=0,m=0,A=0,B=0,P=0,z=0,ht=0,ot=0,lt=0,I=0,D=0,x=0,T=0,R=0,L=0,v=0,k=0,nt=0,st=0,St=0,It=0,zt=0,Dt=0,Wt=0,Xt=0,Jt=0,ne=0,Ct=b[0],Mt=b[1],Lt=b[2],Et=b[3],qt=b[4],Ft=b[5],$t=b[6],J=b[7],et=b[8],ut=b[9],wt=b[10],kt=b[11],Ut=b[12],At=b[13],Nt=b[14],jt=b[15];V+=(f=N[0])*Ct,X+=f*Mt,Y+=f*Lt,g+=f*Et,d+=f*qt,m+=f*Ft,A+=f*$t,B+=f*J,P+=f*et,z+=f*ut,ht+=f*wt,ot+=f*kt,lt+=f*Ut,I+=f*At,D+=f*Nt,x+=f*jt,X+=(f=N[1])*Ct,Y+=f*Mt,g+=f*Lt,d+=f*Et,m+=f*qt,A+=f*Ft,B+=f*$t,P+=f*J,z+=f*et,ht+=f*ut,ot+=f*wt,lt+=f*kt,I+=f*Ut,D+=f*At,x+=f*Nt,T+=f*jt,Y+=(f=N[2])*Ct,g+=f*Mt,d+=f*Lt,m+=f*Et,A+=f*qt,B+=f*Ft,P+=f*$t,z+=f*J,ht+=f*et,ot+=f*ut,lt+=f*wt,I+=f*kt,D+=f*Ut,x+=f*At,T+=f*Nt,R+=f*jt,g+=(f=N[3])*Ct,d+=f*Mt,m+=f*Lt,A+=f*Et,B+=f*qt,P+=f*Ft,z+=f*$t,ht+=f*J,ot+=f*et,lt+=f*ut,I+=f*wt,D+=f*kt,x+=f*Ut,T+=f*At,R+=f*Nt,L+=f*jt,d+=(f=N[4])*Ct,m+=f*Mt,A+=f*Lt,B+=f*Et,P+=f*qt,z+=f*Ft,ht+=f*$t,ot+=f*J,lt+=f*et,I+=f*ut,D+=f*wt,x+=f*kt,T+=f*Ut,R+=f*At,L+=f*Nt,v+=f*jt,m+=(f=N[5])*Ct,A+=f*Mt,B+=f*Lt,P+=f*Et,z+=f*qt,ht+=f*Ft,ot+=f*$t,lt+=f*J,I+=f*et,D+=f*ut,x+=f*wt,T+=f*kt,R+=f*Ut,L+=f*At,v+=f*Nt,k+=f*jt,A+=(f=N[6])*Ct,B+=f*Mt,P+=f*Lt,z+=f*Et,ht+=f*qt,ot+=f*Ft,lt+=f*$t,I+=f*J,D+=f*et,x+=f*ut,T+=f*wt,R+=f*kt,L+=f*Ut,v+=f*At,k+=f*Nt,nt+=f*jt,B+=(f=N[7])*Ct,P+=f*Mt,z+=f*Lt,ht+=f*Et,ot+=f*qt,lt+=f*Ft,I+=f*$t,D+=f*J,x+=f*et,T+=f*ut,R+=f*wt,L+=f*kt,v+=f*Ut,k+=f*At,nt+=f*Nt,st+=f*jt,P+=(f=N[8])*Ct,z+=f*Mt,ht+=f*Lt,ot+=f*Et,lt+=f*qt,I+=f*Ft,D+=f*$t,x+=f*J,T+=f*et,R+=f*ut,L+=f*wt,v+=f*kt,k+=f*Ut,nt+=f*At,st+=f*Nt,St+=f*jt,z+=(f=N[9])*Ct,ht+=f*Mt,ot+=f*Lt,lt+=f*Et,I+=f*qt,D+=f*Ft,x+=f*$t,T+=f*J,R+=f*et,L+=f*ut,v+=f*wt,k+=f*kt,nt+=f*Ut,st+=f*At,St+=f*Nt,It+=f*jt,ht+=(f=N[10])*Ct,ot+=f*Mt,lt+=f*Lt,I+=f*Et,D+=f*qt,x+=f*Ft,T+=f*$t,R+=f*J,L+=f*et,v+=f*ut,k+=f*wt,nt+=f*kt,st+=f*Ut,St+=f*At,It+=f*Nt,zt+=f*jt,ot+=(f=N[11])*Ct,lt+=f*Mt,I+=f*Lt,D+=f*Et,x+=f*qt,T+=f*Ft,R+=f*$t,L+=f*J,v+=f*et,k+=f*ut,nt+=f*wt,st+=f*kt,St+=f*Ut,It+=f*At,zt+=f*Nt,Dt+=f*jt,lt+=(f=N[12])*Ct,I+=f*Mt,D+=f*Lt,x+=f*Et,T+=f*qt,R+=f*Ft,L+=f*$t,v+=f*J,k+=f*et,nt+=f*ut,st+=f*wt,St+=f*kt,It+=f*Ut,zt+=f*At,Dt+=f*Nt,Wt+=f*jt,I+=(f=N[13])*Ct,D+=f*Mt,x+=f*Lt,T+=f*Et,R+=f*qt,L+=f*Ft,v+=f*$t,k+=f*J,nt+=f*et,st+=f*ut,St+=f*wt,It+=f*kt,zt+=f*Ut,Dt+=f*At,Wt+=f*Nt,Xt+=f*jt,D+=(f=N[14])*Ct,x+=f*Mt,T+=f*Lt,R+=f*Et,L+=f*qt,v+=f*Ft,k+=f*$t,nt+=f*J,st+=f*et,St+=f*ut,It+=f*wt,zt+=f*kt,Dt+=f*Ut,Wt+=f*At,Xt+=f*Nt,Jt+=f*jt,x+=(f=N[15])*Ct,X+=38*(R+=f*Lt),Y+=38*(L+=f*Et),g+=38*(v+=f*qt),d+=38*(k+=f*Ft),m+=38*(nt+=f*$t),A+=38*(st+=f*J),B+=38*(St+=f*et),P+=38*(It+=f*ut),z+=38*(zt+=f*wt),ht+=38*(Dt+=f*kt),ot+=38*(Wt+=f*Ut),lt+=38*(Xt+=f*At),I+=38*(Jt+=f*Nt),D+=38*(ne+=f*jt),V=(f=(V+=38*(T+=f*Mt))+(U=1)+65535)-65536*(U=Math.floor(f/65536)),X=(f=X+U+65535)-65536*(U=Math.floor(f/65536)),Y=(f=Y+U+65535)-65536*(U=Math.floor(f/65536)),g=(f=g+U+65535)-65536*(U=Math.floor(f/65536)),d=(f=d+U+65535)-65536*(U=Math.floor(f/65536)),m=(f=m+U+65535)-65536*(U=Math.floor(f/65536)),A=(f=A+U+65535)-65536*(U=Math.floor(f/65536)),B=(f=B+U+65535)-65536*(U=Math.floor(f/65536)),P=(f=P+U+65535)-65536*(U=Math.floor(f/65536)),z=(f=z+U+65535)-65536*(U=Math.floor(f/65536)),ht=(f=ht+U+65535)-65536*(U=Math.floor(f/65536)),ot=(f=ot+U+65535)-65536*(U=Math.floor(f/65536)),lt=(f=lt+U+65535)-65536*(U=Math.floor(f/65536)),I=(f=I+U+65535)-65536*(U=Math.floor(f/65536)),D=(f=D+U+65535)-65536*(U=Math.floor(f/65536)),x=(f=x+U+65535)-65536*(U=Math.floor(f/65536)),V=(f=(V+=U-1+37*(U-1))+(U=1)+65535)-65536*(U=Math.floor(f/65536)),X=(f=X+U+65535)-65536*(U=Math.floor(f/65536)),Y=(f=Y+U+65535)-65536*(U=Math.floor(f/65536)),g=(f=g+U+65535)-65536*(U=Math.floor(f/65536)),d=(f=d+U+65535)-65536*(U=Math.floor(f/65536)),m=(f=m+U+65535)-65536*(U=Math.floor(f/65536)),A=(f=A+U+65535)-65536*(U=Math.floor(f/65536)),B=(f=B+U+65535)-65536*(U=Math.floor(f/65536)),P=(f=P+U+65535)-65536*(U=Math.floor(f/65536)),z=(f=z+U+65535)-65536*(U=Math.floor(f/65536)),ht=(f=ht+U+65535)-65536*(U=Math.floor(f/65536)),ot=(f=ot+U+65535)-65536*(U=Math.floor(f/65536)),lt=(f=lt+U+65535)-65536*(U=Math.floor(f/65536)),I=(f=I+U+65535)-65536*(U=Math.floor(f/65536)),D=(f=D+U+65535)-65536*(U=Math.floor(f/65536)),x=(f=x+U+65535)-65536*(U=Math.floor(f/65536)),V+=U-1+37*(U-1),S[0]=V,S[1]=X,S[2]=Y,S[3]=g,S[4]=d,S[5]=m,S[6]=A,S[7]=B,S[8]=P,S[9]=z,S[10]=ht,S[11]=ot,S[12]=lt,S[13]=I,S[14]=D,S[15]=x}function G(S,N){j(S,N,N)}function Z(S,N){var b,f=t();for(b=0;b<16;b++)f[b]=N[b];for(b=253;b>=0;b--)G(f,f),b!==2&&b!==4&&j(f,f,N);for(b=0;b<16;b++)S[b]=f[b]}function tt(S,N,b){var f,U,V=new Uint8Array(32),X=new Float64Array(80),Y=t(),g=t(),d=t(),m=t(),A=t(),B=t();for(U=0;U<31;U++)V[U]=N[U];for(V[31]=127&N[31]|64,V[0]&=248,E(X,b),U=0;U<16;U++)g[U]=X[U],m[U]=Y[U]=d[U]=0;for(Y[0]=m[0]=1,U=254;U>=0;--U)M(Y,g,f=V[U>>>3]>>>(7&U)&1),M(d,m,f),W(A,Y,d),q(Y,Y,d),W(d,g,m),q(g,g,m),G(m,A),G(B,Y),j(Y,d,Y),j(d,g,A),W(A,Y,d),q(Y,Y,d),G(g,Y),q(d,m,B),j(Y,d,o),W(Y,Y,m),j(d,d,Y),j(Y,m,B),j(m,g,X),G(g,A),M(Y,g,f),M(d,m,f);for(U=0;U<16;U++)X[U+16]=Y[U],X[U+32]=d[U],X[U+48]=g[U],X[U+64]=m[U];var P=X.subarray(32),z=X.subarray(16);return Z(P,P),j(z,z,P),H(S,z),0}function rt(S,N){return tt(S,N,i)}function dt(S,N){var b=t(),f=t(),U=t(),V=t(),X=t(),Y=t(),g=t(),d=t(),m=t();q(b,S[1],S[0]),q(m,N[1],N[0]),j(b,b,m),W(f,S[0],S[1]),W(m,N[0],N[1]),j(f,f,m),j(U,S[3],N[3]),j(U,U,c),j(V,S[2],N[2]),W(V,V,V),q(X,f,b),q(Y,V,U),W(g,V,U),W(d,f,b),j(S[0],X,Y),j(S[1],d,g),j(S[2],g,Y),j(S[3],X,d)}function it(S,N,b){var f;for(f=0;f<4;f++)M(S[f],N[f],b)}function O(S,N){var b=t(),f=t(),U=t();Z(U,N[2]),j(b,N[0],U),j(f,N[1],U),H(S,f),S[31]^=F(b)<<7}function ft(S,N,b){var f,U;for(K(S[0],a),K(S[1],s),K(S[2],s),K(S[3],a),U=255;U>=0;--U)it(S,N,f=b[U/8|0]>>(7&U)&1),dt(N,S),dt(S,S),it(S,N,f)}function Pt(S,N){var b=[t(),t(),t(),t()];K(b[0],h),K(b[1],l),K(b[2],s),j(b[3],h,l),ft(S,b,N)}function $(S,N,b){var f,U,V=[t(),t(),t(),t()];for(b||n(N,32),(f=e.hash(N.subarray(0,32)))[0]&=248,f[31]&=127,f[31]|=64,Pt(V,f),O(S,V),U=0;U<32;U++)N[U+32]=S[U];return 0}var at=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function mt(S,N){var b,f,U,V;for(f=63;f>=32;--f){for(b=0,U=f-32,V=f-12;U>4)*at[U],b=N[U]>>8,N[U]&=255;for(U=0;U<32;U++)N[U]-=b*at[U];for(f=0;f<32;f++)N[f+1]+=N[f]>>8,S[f]=255&N[f]}function bt(S){var N,b=new Float64Array(64);for(N=0;N<64;N++)b[N]=S[N];for(N=0;N<64;N++)S[N]=0;mt(S,b)}function yt(S,N){var b=t(),f=t(),U=t(),V=t(),X=t(),Y=t(),g=t();return K(S[2],s),E(S[1],N),G(U,S[1]),j(V,U,u),q(U,U,S[2]),W(V,S[2],V),G(X,V),G(Y,X),j(g,Y,X),j(b,g,U),j(b,b,V),function(d,m){var A,B=t();for(A=0;A<16;A++)B[A]=m[A];for(A=250;A>=0;A--)G(B,B),A!==1&&j(B,B,m);for(A=0;A<16;A++)d[A]=B[A]}(b,b),j(b,b,U),j(b,b,V),j(b,b,V),j(S[0],b,V),G(f,S[0]),j(f,f,V),Q(f,U)&&j(S[0],S[0],w),G(f,S[0]),j(f,f,V),Q(f,U)?-1:(F(S[0])===N[31]>>7&&q(S[0],a,S[0]),j(S[3],S[0],S[1]),0)}var pt=64;function gt(){for(var S=0;S=0},e.sign.keyPair=function(){var S=new Uint8Array(32),N=new Uint8Array(64);return $(S,N),{publicKey:S,secretKey:N}},e.sign.keyPair.fromSecretKey=function(S){if(gt(S),S.length!==64)throw Error("bad secret key size");for(var N=new Uint8Array(32),b=0;b"u"||!crypto.getRandomValues)throw Error("No secure random number generator available.");crypto.getRandomValues(e)}return e}async function kr(r,e){const t=await _.getBigInteger();if(e.lt(r))throw Error("Illegal parameter value: max <= min");const n=e.sub(r),i=n.byteLength();return new t(await Ee(i+8)).mod(n).add(r)}var Ou=Object.freeze({__proto__:null,getRandomBytes:Ee,getRandomBigInteger:kr});async function i0(r,e,t){const n=await _.getBigInteger(),i=new n(1),a=i.leftShift(new n(r-1)),s=new n(30),o=[1,6,5,4,3,2,1,4,3,2,1,2,1,4,3,2,1,2,1,4,3,2,1,6,5,4,3,2,1,2],u=await kr(a,a.leftShift(i));let c=u.mod(s).toNumber();do u.iadd(new n(o[c])),c=(c+o[c])%o.length,u.bitLength()>r&&(u.imod(a.leftShift(i)).iadd(a),c=u.mod(s).toNumber());while(!await v2(u,e,t));return u}async function v2(r,e,t){return!(e&&!r.dec().gcd(e).isOne())&&!!await async function(n){const i=await _.getBigInteger();return Mu.every(a=>n.mod(new i(a))!==0)}(r)&&!!await async function(n,i){const a=await _.getBigInteger();return i=i||new a(2),i.modExp(n.dec(),n).isOne()}(r)&&!!await async function(n,i,a){const s=await _.getBigInteger(),o=n.bitLength();i||(i=Math.max(1,o/48|0));const u=n.dec();let c=0;for(;!u.getBit(c);)c++;const h=n.rightShift(new s(c));for(;i>0;i--){let l,w=(await kr(new s(2),u)).modExp(h,n);if(!w.isOne()&&!w.equal(u)){for(l=1;le-11)throw Error("Message too long");const n=function(a){const s=new Uint8Array(a);let o=0;for(;o=8&!n;if(e)return _.selectUint8Array(s,a,e);if(s)return a;throw Error("Decryption error")}async function Bs(r,e,t){let n;if(e.length!==Ke.getHashByteLength(r))throw Error("Invalid hash length");const i=new Uint8Array(je[r].length);for(n=0;n{const{default:tt}=await import("./bn.min-BPUEMPhn.js");return{default:tt}},[],import.meta.url),Q=new H(K),F=new H(C),E=new H(y),W=E.mod(F.subn(1)),q=E.mod(Q.subn(1)),j=ge.createSign(p.read(p.hash,c));j.write(h),j.end();const G={version:0,modulus:new H(l),publicExponent:new H(w),privateExponent:new H(y),prime1:new H(C),prime2:new H(K),exponent1:W,exponent2:q,coefficient:new H(M)};if(ge.createPrivateKey!==void 0){const tt=gn.encode(G,"der");return new Uint8Array(j.sign({key:tt,format:"der",type:"pkcs1"}))}const Z=gn.encode(G,"pem",{label:"RSA PRIVATE KEY"});return new Uint8Array(j.sign(Z))}(r,e,t,n,i,a,s,o)}return async function(c,h,l,w){const y=await _.getBigInteger();h=new y(h);const K=new y(await Bs(c,w,h.byteLength()));if(l=new y(l),K.gte(h))throw Error("Message size cannot exceed modulus size");return K.modExp(l,h).toUint8Array("be",h.byteLength())}(r,t,i,u)},verify:async function(r,e,t,n,i,a){if(e&&!_.isStream(e)){if(_.getWebCrypto())try{return await async function(s,o,u,c,h){const l=function(y,K){return{kty:"RSA",n:Ae(y,!0),e:Ae(K,!0),ext:!0}}(c,h),w=await pn.importKey("jwk",l,{name:"RSASSA-PKCS1-v1_5",hash:{name:s}},!1,["verify"]);return pn.verify("RSASSA-PKCS1-v1_5",w,u,o)}(p.read(p.webHash,r),e,t,n,i)}catch(s){_.printDebugError(s)}else if(_.getNodeCrypto())return async function(s,o,u,c,h){const{default:l}=await Vr(async()=>{const{default:C}=await import("./bn.min-BPUEMPhn.js");return{default:C}},[],import.meta.url),w=ge.createVerify(p.read(p.hash,s));w.write(o),w.end();const y={modulus:new l(c),publicExponent:new l(h)};let K;ge.createPrivateKey!==void 0?K={key:Hi.encode(y,"der"),format:"der",type:"pkcs1"}:K=Hi.encode(y,"pem",{label:"RSA PUBLIC KEY"});try{return await w.verify(K,u)}catch{return!1}}(r,e,t,n,i)}return async function(s,o,u,c,h){const l=await _.getBigInteger();if(u=new l(u),o=new l(o),c=new l(c),o.gte(u))throw Error("Signature size cannot exceed modulus size");const w=o.modExp(c,u).toUint8Array("be",u.byteLength()),y=await Bs(s,h,u.byteLength());return _.equalsUint8Array(w,y)}(r,t,n,i,a)},encrypt:async function(r,e,t){return _.getNodeCrypto()?async function(n,i,a){const{default:s}=await Vr(async()=>{const{default:c}=await import("./bn.min-BPUEMPhn.js");return{default:c}},[],import.meta.url),o={modulus:new s(i),publicExponent:new s(a)};let u;return ge.createPrivateKey!==void 0?u={key:Hi.encode(o,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:u={key:Hi.encode(o,"pem",{label:"RSA PUBLIC KEY"}),padding:ge.constants.RSA_PKCS1_PADDING},new Uint8Array(ge.publicEncrypt(u,n))}(r,e,t):async function(n,i,a){const s=await _.getBigInteger();if(i=new s(i),n=new s(t1(n,i.byteLength())),a=new s(a),n.gte(i))throw Error("Message size cannot exceed modulus size");return n.modExp(a,i).toUint8Array("be",i.byteLength())}(r,e,t)},decrypt:async function(r,e,t,n,i,a,s,o){if(_.getNodeCrypto()&&!o)try{return await async function(u,c,h,l,w,y,K){const{default:C}=await Vr(async()=>{const{default:j}=await import("./bn.min-BPUEMPhn.js");return{default:j}},[],import.meta.url),M=new C(w),H=new C(y),Q=new C(l),F=Q.mod(H.subn(1)),E=Q.mod(M.subn(1)),W={version:0,modulus:new C(c),publicExponent:new C(h),privateExponent:new C(l),prime1:new C(y),prime2:new C(w),exponent1:F,exponent2:E,coefficient:new C(K)};let q;ge.createPrivateKey!==void 0?q={key:gn.encode(W,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:q={key:gn.encode(W,"pem",{label:"RSA PRIVATE KEY"}),padding:ge.constants.RSA_PKCS1_PADDING};try{return new Uint8Array(ge.privateDecrypt(q,u))}catch{throw Error("Decryption error")}}(r,e,t,n,i,a,s)}catch(u){_.printDebugError(u)}return async function(u,c,h,l,w,y,K,C){const M=await _.getBigInteger();if(u=new M(u),c=new M(c),h=new M(h),l=new M(l),w=new M(w),y=new M(y),K=new M(K),u.gte(c))throw Error("Data too large.");const H=l.mod(y.dec()),Q=l.mod(w.dec()),F=(await kr(new M(2),c)).mod(c),E=F.modInv(c).modExp(h,c);u=u.mul(E).mod(c);const W=u.modExp(Q,w),q=u.modExp(H,y);let G=K.mul(q.sub(W)).mod(y).mul(w).add(W);return G=G.mul(F).mod(c),e1(G.toUint8Array("be",c.byteLength()),C)}(r,e,t,n,i,a,s,o)},generate:async function(r,e){if(e=new(await _.getBigInteger())(e),_.getWebCrypto()){const s={name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:e.toUint8Array(),hash:{name:"SHA-1"}},o=await pn.generateKey(s,!0,["sign","verify"]),u=await pn.exportKey("jwk",o.privateKey);return{n:dr(u.n),e:e.toUint8Array(),d:dr(u.d),p:dr(u.q),q:dr(u.p),u:dr(u.qi)}}if(_.getNodeCrypto()&&ge.generateKeyPair&&gn){const s={modulusLength:r,publicExponent:e.toNumber(),publicKeyEncoding:{type:"pkcs1",format:"der"},privateKeyEncoding:{type:"pkcs1",format:"der"}},o=await new Promise((u,c)=>{ge.generateKeyPair("rsa",s,(h,l,w)=>{h?c(h):u(gn.decode(w,"der"))})});return{n:o.modulus.toArrayLike(Uint8Array),e:o.publicExponent.toArrayLike(Uint8Array),d:o.privateExponent.toArrayLike(Uint8Array),p:o.prime2.toArrayLike(Uint8Array),q:o.prime1.toArrayLike(Uint8Array),u:o.coefficient.toArrayLike(Uint8Array)}}let t,n,i;do n=await i0(r-(r>>1),e,40),t=await i0(r>>1,e,40),i=t.mul(n);while(i.bitLength()!==r);const a=t.dec().imul(n.dec());return n.lt(t)&&([t,n]=[n,t]),{n:i.toUint8Array(),e:e.toUint8Array(),d:e.modInv(a).toUint8Array(),p:t.toUint8Array(),q:n.toUint8Array(),u:t.modInv(n).toUint8Array()}},validateParams:async function(r,e,t,n,i,a){const s=await _.getBigInteger();if(r=new s(r),n=new s(n),i=new s(i),!n.mul(i).equal(r))return!1;const o=new s(2);if(a=new s(a),!n.mul(a).mod(i).isOne())return!1;e=new s(e),t=new s(t);const u=new s(Math.floor(r.bitLength()/3)),c=await kr(o,o.leftShift(u)),h=c.mul(t).mul(e);return!(!h.mod(n.dec()).equal(c)||!h.mod(i.dec()).equal(c))}}),Hu=Object.freeze({__proto__:null,encrypt:async function(r,e,t,n){const i=await _.getBigInteger();e=new i(e),t=new i(t),n=new i(n);const a=new i(t1(r,e.byteLength())),s=await kr(new i(1),e.dec());return{c1:t.modExp(s,e).toUint8Array(),c2:n.modExp(s,e).imul(a).imod(e).toUint8Array()}},decrypt:async function(r,e,t,n,i){const a=await _.getBigInteger();return r=new a(r),e=new a(e),t=new a(t),n=new a(n),e1(r.modExp(n,t).modInv(t).imul(e).imod(t).toUint8Array("be",t.byteLength()),i)},validateParams:async function(r,e,t,n){const i=await _.getBigInteger();r=new i(r),e=new i(e),t=new i(t);const a=new i(1);if(e.lte(a)||e.gte(r))return!1;const s=new i(r.bitLength()),o=new i(1023);if(s.lt(o)||!e.modExp(r.dec(),r).isOne())return!1;let u=e;const c=new i(1),h=new i(2).leftShift(new i(17));for(;c.lt(h);){if(u=u.mul(e).imod(r),u.isOne())return!1;c.iinc()}n=new i(n);const l=new i(2),w=await kr(l.leftShift(s.dec()),l.leftShift(s)),y=r.dec().imul(w).iadd(n);return!!t.equal(e.modExp(y,r))}});class Ve{constructor(e){if(e instanceof Ve)this.oid=e.oid;else if(_.isArray(e)||_.isUint8Array(e)){if((e=new Uint8Array(e))[0]===6){if(e[1]!==e.length-2)throw Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw Error("Invalid oid")}write(){return _.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return _.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(p.curve[e])return p.write(p.curve,e);throw Error("Unknown curve object identifier.")}}function Ia(r,e){return r.keyPair({priv:e})}function Ba(r,e){const t=r.keyPair({pub:e});if(t.validate().result!==!0)throw Error("Invalid elliptic public key");return t}async function Rn(r){if(!vt.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:e}=await Vr(async()=>{const{default:t}=await import("./elliptic.min-BeOSrg7m.js");return{default:t}},__vite__mapDeps([2,1]),import.meta.url);return new e.ec(r)}function _2(r){let e,t=0;const n=r[0];return n<192?([t]=r,e=1):n<255?(t=(r[0]-192<<8)+r[1]+192,e=2):n===255&&(t=_.readNumber(r.subarray(1,5)),e=5),{len:t,offset:e}}function Ki(r){return r<192?new Uint8Array([r]):r>191&&r<8384?new Uint8Array([192+(r-192>>8),r-192&255]):_.concatUint8Array([new Uint8Array([255]),_.writeNumber(r,4)])}function $u(r){if(r<0||r>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+r])}function E2(r){return new Uint8Array([192|r])}function a0(r,e){return _.concatUint8Array([E2(r),Ki(e)])}function Zi(r){return[p.packet.literalData,p.packet.compressedData,p.packet.symmetricallyEncryptedData,p.packet.symEncryptedIntegrityProtectedData,p.packet.aeadEncryptedData].includes(r)}async function qu(r,e){const t=on(r);let n,i;try{const a=await t.peekBytes(2);if(!a||a.length<2||!(128&a[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const s=await t.readByte();let o,u,c=-1,h=-1;h=0,64&s&&(h=1),h?c=63&s:(c=(63&s)>>2,u=3&s);const l=Zi(c);let w,y=null;if(l){if(_.isStream(r)==="array"){const C=new Qe;n=Oe(C),y=C}else{const C=new Ws;n=Oe(C.writable),y=C.readable}i=e({tag:c,packet:y})}else y=[];do{if(h){const C=await t.readByte();if(w=!1,C<192)o=C;else if(C>=192&&C<224)o=(C-192<<8)+await t.readByte()+192;else if(C>223&&C<255){if(o=1<<(31&C),w=!0,!l)throw new TypeError("This packet type does not support partial lengths.")}else o=await t.readByte()<<24|await t.readByte()<<16|await t.readByte()<<8|await t.readByte()}else switch(u){case 0:o=await t.readByte();break;case 1:o=await t.readByte()<<8|await t.readByte();break;case 2:o=await t.readByte()<<24|await t.readByte()<<16|await t.readByte()<<8|await t.readByte();break;default:o=1/0}if(o>0){let C=0;for(;;){n&&await n.ready;const{done:M,value:H}=await t.read();if(M){if(o===1/0)break;throw Error("Unexpected end of packet")}const Q=o===1/0?H:H.subarray(0,o-C);if(n?await n.write(Q):y.push(Q),C+=H.length,C>=o){t.unshift(H.subarray(o-C+H.length));break}}}}while(w);const K=await t.peekBytes(l?1/0:2);return n?(await n.ready,await n.close()):(y=_.concatUint8Array(y),await e({tag:c,packet:y})),!K||!K.length}catch(a){if(n)return await n.abort(a),!0;throw a}finally{n&&await i,t.releaseLock()}}class re extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,re),this.name="UnsupportedError"}}class Ts{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const es=_.getWebCrypto(),la=_.getNodeCrypto(),nr={p256:"P-256",p384:"P-384",p521:"P-521"},cr=la?la.getCurves():[],Kr=la?{secp256k1:cr.includes("secp256k1")?"secp256k1":void 0,p256:cr.includes("prime256v1")?"prime256v1":void 0,p384:cr.includes("secp384r1")?"secp384r1":void 0,p521:cr.includes("secp521r1")?"secp521r1":void 0,ed25519:cr.includes("ED25519")?"ED25519":void 0,curve25519:cr.includes("X25519")?"X25519":void 0,brainpoolP256r1:cr.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:cr.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:cr.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Qi={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Kr.p256,web:nr.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:p.publicKey.ecdsa,hash:p.hash.sha384,cipher:p.symmetric.aes192,node:Kr.p384,web:nr.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:p.publicKey.ecdsa,hash:p.hash.sha512,cipher:p.symmetric.aes256,node:Kr.p521,web:nr.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Kr.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:p.publicKey.eddsaLegacy,hash:p.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:p.publicKey.ecdh,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Kr.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:p.publicKey.ecdsa,hash:p.hash.sha384,cipher:p.symmetric.aes192,node:Kr.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:p.publicKey.ecdsa,hash:p.hash.sha512,cipher:p.symmetric.aes256,node:Kr.brainpoolP512r1,payloadSize:64}};class vr{constructor(e,t){try{(_.isArray(e)||_.isUint8Array(e))&&(e=new Ve(e)),e instanceof Ve&&(e=e.getName()),this.name=p.write(p.curve,e)}catch{throw new re("Unknown curve")}t=t||Qi[this.name],this.keyType=t.keyType,this.oid=t.oid,this.hash=t.hash,this.cipher=t.cipher,this.node=t.node&&Qi[this.name],this.web=t.web&&Qi[this.name],this.payloadSize=t.payloadSize,this.web&&_.getWebCrypto()?this.type="web":this.node&&_.getNodeCrypto()?this.type="node":this.name==="curve25519"?this.type="curve25519":this.name==="ed25519"&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(n){const i=await es.generateKey({name:"ECDSA",namedCurve:nr[n]},!0,["sign","verify"]),a=await es.exportKey("jwk",i.privateKey),s=await es.exportKey("jwk",i.publicKey);return{publicKey:P2(s),privateKey:dr(a.d)}}(this.name)}catch(n){_.printDebugError("Browser did not support generating ec key "+n.message);break}case"node":return async function(n){const i=la.createECDH(Kr[n]);return await i.generateKeys(),{publicKey:new Uint8Array(i.getPublicKey()),privateKey:new Uint8Array(i.getPrivateKey())}}(this.name);case"curve25519":{const n=Ee(32);n[0]=127&n[0]|64,n[31]&=248;const i=n.slice().reverse();return e=ee.box.keyPair.fromSecretKey(i),{publicKey:_.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:n}}case"ed25519":{const n=Ee(32),i=ee.sign.keyPair.fromSeed(n);return{publicKey:_.concatUint8Array([new Uint8Array([64]),i.publicKey]),privateKey:n}}}return e=await(await Rn(this.name)).genKeyPair({entropy:_.uint8ArrayToString(Ee(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function S2(r,e,t,n){const i={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:r===p.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=e.getName();if(!i[a])return!1;if(a==="curve25519"){n=n.slice().reverse();const{publicKey:o}=ee.box.keyPair.fromSecretKey(n);t=new Uint8Array(t);const u=new Uint8Array([64,...o]);return!!_.equalsUint8Array(u,t)}const s=await Rn(a);try{t=Ba(s,t).getPublic()}catch{return!1}return!!Ia(s,n).getPublic().eq(t)}function P2(r){const e=dr(r.x),t=dr(r.y),n=new Uint8Array(e.length+t.length+1);return n[0]=4,n.set(e,1),n.set(t,e.length+1),n}function Ta(r,e,t){const n=r,i=t.slice(1,n+1),a=t.slice(n+1,2*n+1);return{kty:"EC",crv:e,x:Ae(i),y:Ae(a),ext:!0}}function U2(r,e,t,n){const i=Ta(r,e,t);return i.d=Ae(n),i}const fa=_.getWebCrypto(),zn=_.getNodeCrypto();async function s0(r,e,t,n,i,a){const s=new vr(r);if(t&&!_.isStream(t)){const o={publicKey:n,privateKey:i};switch(s.type){case"web":try{return await async function(u,c,h,l){const w=u.payloadSize,y=U2(u.payloadSize,nr[u.name],l.publicKey,l.privateKey),K=await fa.importKey("jwk",y,{name:"ECDSA",namedCurve:nr[u.name],hash:{name:p.read(p.webHash,u.hash)}},!1,["sign"]),C=new Uint8Array(await fa.sign({name:"ECDSA",namedCurve:nr[u.name],hash:{name:p.read(p.webHash,c)}},K,h));return{r:C.slice(0,w),s:C.slice(w,w<<1)}}(s,e,t,o)}catch(u){if(s.name!=="p521"&&(u.name==="DataError"||u.name==="OperationError"))throw u;_.printDebugError("Browser did not support signing: "+u.message)}break;case"node":{const u=await async function(c,h,l,w){const y=zn.createSign(p.read(p.hash,h));y.write(l),y.end();const K=ju.encode({version:1,parameters:c.oid,privateKey:Array.from(w.privateKey),publicKey:{unused:0,data:Array.from(w.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return K2.decode(y.sign(K),"der")}(s,e,t,o);return{r:u.r.toArrayLike(Uint8Array),s:u.s.toArrayLike(Uint8Array)}}}}return async function(o,u,c){const h=await Rn(o.name),l=Ia(h,c),w=l.sign(u);return{r:w.r.toArrayLike(Uint8Array),s:w.s.toArrayLike(Uint8Array)}}(s,a,i)}async function o0(r,e,t,n,i,a){const s=new vr(r);if(n&&!_.isStream(n))switch(s.type){case"web":try{return await async function(o,u,{r:c,s:h},l,w){const y=Ta(o.payloadSize,nr[o.name],w),K=await fa.importKey("jwk",y,{name:"ECDSA",namedCurve:nr[o.name],hash:{name:p.read(p.webHash,o.hash)}},!1,["verify"]),C=_.concatUint8Array([c,h]).buffer;return fa.verify({name:"ECDSA",namedCurve:nr[o.name],hash:{name:p.read(p.webHash,u)}},K,C,l)}(s,e,t,n,i)}catch(o){if(s.name!=="p521"&&(o.name==="DataError"||o.name==="OperationError"))throw o;_.printDebugError("Browser did not support verifying: "+o.message)}break;case"node":return async function(o,u,{r:c,s:h},l,w){const{default:y}=await Vr(async()=>{const{default:H}=await import("./bn.min-BPUEMPhn.js");return{default:H}},[],import.meta.url),K=zn.createVerify(p.read(p.hash,u));K.write(l),K.end();const C=Wu.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:o.oid},subjectPublicKey:{unused:0,data:Array.from(w)}},"pem",{label:"PUBLIC KEY"}),M=K2.encode({r:new y(c),s:new y(h)},"der");try{return K.verify(C,M)}catch{return!1}}(s,e,t,n,i)}return async function(o,u,c,h){const l=await Rn(o.name);return Ba(l,h).verify(c,u)}(s,t,e===void 0?n:a,i)}const Ra=void 0,K2=zn?Ra.define("ECDSASignature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}):void 0,ju=zn?Ra.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())}):void 0,Gu=zn?Ra.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())}):void 0,Wu=zn?Ra.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Gu),this.key("subjectPublicKey").bitstr())}):void 0;var Vu=Object.freeze({__proto__:null,sign:s0,verify:o0,validateParams:async function(r,e,t){const n=new vr(r);if(n.keyType!==p.publicKey.ecdsa)return!1;switch(n.type){case"web":case"node":{const i=Ee(8),a=p.hash.sha256,s=await Ke.digest(a,i);try{const o=await s0(r,a,i,e,t,s);return await o0(r,a,o,i,e,s)}catch{return!1}}default:return S2(p.publicKey.ecdsa,r,e,t)}}});ee.hash=r=>new Uint8Array(Ui().update(r).digest());var Zu=Object.freeze({__proto__:null,sign:async function(r,e,t,n,i,a){if(Ke.getHashByteLength(e)new Uint8Array(Ui().update(r).digest());var Qu=Object.freeze({__proto__:null,generate:async function(r){if(r===p.publicKey.ed25519){const e=Ee(32),{publicKey:t}=ee.sign.keyPair.fromSeed(e);return{A:t,seed:e}}throw Error("Unsupported EdDSA algorithm")},sign:async function(r,e,t,n,i,a){if(Ke.getHashByteLength(e)=0;--h)for(let l=o-1;l>=0;--l)u[1]=o*h+(l+1),c[0]=a[0]^u[0],c[1]=a[1]^u[1],c[2]=s[2*l],c[3]=s[2*l+1],c=da(t.decrypt(ya(c))),a=c.subarray(0,2),s[2*l]=c[2],s[2*l+1]=c[3];if(a[0]===n[0]&&a[1]===n[1])return ya(s);throw Error("Key Data Integrity failed")}function da(r){const{length:e}=r,t=function(a){if(_.isString(a)){const{length:s}=a,o=new ArrayBuffer(s),u=new Uint8Array(o);for(let c=0;c0){const t=r[e-1];if(t>=1){const n=r.subarray(e-t),i=new Uint8Array(t).fill(t);if(_.equalsUint8Array(n,i))return r.subarray(0,e-t)}}throw Error("Invalid padding")}var Yu=Object.freeze({__proto__:null,encode:C2,decode:D2});const Tr=_.getWebCrypto(),x2=_.getNodeCrypto();function c0(r,e,t,n){return _.concatUint8Array([e.write(),new Uint8Array([r]),t.write(),_.stringToUint8Array("Anonymous Sender "),n.subarray(0,20)])}async function u0(r,e,t,n,i=!1,a=!1){let s;if(i){for(s=0;s=0&&e[s]===0;s--);e=e.subarray(0,s+1)}return(await Ke.digest(r,_.concatUint8Array([new Uint8Array([0,0,0,1]),e,n]))).subarray(0,t)}async function Ju(r,e){switch(r.type){case"curve25519":{const t=Ee(32),{secretKey:n,sharedKey:i}=await I2(r,e,null,t);let{publicKey:a}=ee.box.keyPair.fromSecretKey(n);return a=_.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:i}}case"web":if(r.web&&_.getWebCrypto())try{return await async function(t,n){const i=Ta(t.payloadSize,t.web.web,n);let a=Tr.generateKey({name:"ECDH",namedCurve:t.web.web},!0,["deriveKey","deriveBits"]),s=Tr.importKey("jwk",i,{name:"ECDH",namedCurve:t.web.web},!1,[]);[a,s]=await Promise.all([a,s]);let o=Tr.deriveBits({name:"ECDH",namedCurve:t.web.web,public:s},a.privateKey,t.web.sharedSize),u=Tr.exportKey("jwk",a.publicKey);[o,u]=await Promise.all([o,u]);const c=new Uint8Array(o);return{publicKey:new Uint8Array(P2(u)),sharedKey:c}}(r,e)}catch(t){_.printDebugError(t)}break;case"node":return async function(t,n){const i=x2.createECDH(t.node.node);i.generateKeys();const a=new Uint8Array(i.computeSecret(n));return{publicKey:new Uint8Array(i.getPublicKey()),sharedKey:a}}(r,e)}return async function(t,n){const i=await Rn(t.name),a=await t.genKeyPair();n=Ba(i,n);const s=Ia(i,a.privateKey),o=a.publicKey,u=s.derive(n.getPublic()),c=i.curve.p.byteLength(),h=u.toArrayLike(Uint8Array,"be",c);return{publicKey:o,sharedKey:h}}(r,e)}async function I2(r,e,t,n){if(n.length!==r.payloadSize){const i=new Uint8Array(r.payloadSize);i.set(n,r.payloadSize-n.length),n=i}switch(r.type){case"curve25519":{const i=n.slice().reverse();return{secretKey:i,sharedKey:ee.scalarMult(i,e.subarray(1))}}case"web":if(r.web&&_.getWebCrypto())try{return await async function(i,a,s,o){const u=U2(i.payloadSize,i.web.web,s,o);let c=Tr.importKey("jwk",u,{name:"ECDH",namedCurve:i.web.web},!0,["deriveKey","deriveBits"]);const h=Ta(i.payloadSize,i.web.web,a);let l=Tr.importKey("jwk",h,{name:"ECDH",namedCurve:i.web.web},!0,[]);[c,l]=await Promise.all([c,l]);let w=Tr.deriveBits({name:"ECDH",namedCurve:i.web.web,public:l},c,i.web.sharedSize),y=Tr.exportKey("jwk",c);[w,y]=await Promise.all([w,y]);const K=new Uint8Array(w);return{secretKey:dr(y.d),sharedKey:K}}(r,e,t,n)}catch(i){_.printDebugError(i)}break;case"node":return async function(i,a,s){const o=x2.createECDH(i.node.node);o.setPrivateKey(s);const u=new Uint8Array(o.computeSecret(a));return{secretKey:new Uint8Array(o.getPrivateKey()),sharedKey:u}}(r,e,n)}return async function(i,a,s){const o=await Rn(i.name);a=Ba(o,a),s=Ia(o,s);const u=new Uint8Array(s.getPrivate()),c=s.derive(a.getPublic()),h=o.curve.p.byteLength(),l=c.toArrayLike(Uint8Array,"be",h);return{secretKey:u,sharedKey:l}}(r,e,n)}var t3=Object.freeze({__proto__:null,validateParams:async function(r,e,t){return S2(p.publicKey.ecdh,r,e,t)},encrypt:async function(r,e,t,n,i){const a=C2(t),s=new vr(r),{publicKey:o,sharedKey:u}=await Ju(s,n),c=c0(p.publicKey.ecdh,r,e,i),{keySize:h}=rr(e.cipher);return{publicKey:o,wrappedKey:r1(await u0(e.hash,u,h,c),a)}},decrypt:async function(r,e,t,n,i,a,s){const o=new vr(r),{sharedKey:u}=await I2(o,t,i,a),c=c0(p.publicKey.ecdh,r,e,s),{keySize:h}=rr(e.cipher);let l;for(let w=0;w<3;w++)try{return D2(n1(await u0(e.hash,u,h,c,w===1,w===2),n))}catch(y){l=y}throw l}});const h0=_.getWebCrypto(),ci=_.getNodeCrypto(),l0=ci&&ci.webcrypto&&ci.webcrypto.subtle;async function f0(r,e,t,n,i){const a=p.read(p.webHash,r);if(!a)throw Error("Hash algo not supported with HKDF");if(h0||l0){const s=h0||l0,o=await s.importKey("raw",e,"HKDF",!1,["deriveBits"]),u=await s.deriveBits({name:"HKDF",hash:a,salt:t,info:n},o,8*i);return new Uint8Array(u)}if(ci){const s=p.read(p.hash,r),o=(y,K)=>ci.createHmac(s,y).update(K).digest(),u=o(t,e),c=u.length,h=Math.ceil(i/c),l=new Uint8Array(h*c),w=new Uint8Array(c+n.length+1);w.set(n,c);for(let y=0;y0?w:w.subarray(c));w.set(K,0),l.set(K,y*c)}return l.subarray(0,i)}throw Error("No HKDF implementation available")}const d0={x25519:_.encodeUTF8("OpenPGP X25519")};var e3=Object.freeze({__proto__:null,generate:async function(r){if(r===p.publicKey.x25519){const e=Ee(32),{publicKey:t}=ee.box.keyPair.fromSecretKey(e);return{A:t,k:e}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(r,e,t){if(r===p.publicKey.x25519){const{publicKey:n}=ee.box.keyPair.fromSecretKey(t);return _.equalsUint8Array(e,n)}return!1},encrypt:async function(r,e,t){if(r===p.publicKey.x25519){const n=Ee(32),i=ee.scalarMult(n,t),{publicKey:a}=ee.box.keyPair.fromSecretKey(n),s=_.concatUint8Array([a,t,i]),{keySize:o}=rr(p.symmetric.aes128);return{ephemeralPublicKey:a,wrappedKey:r1(await f0(p.hash.sha256,s,new Uint8Array,d0.x25519,o),e)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(r,e,t,n,i){if(r===p.publicKey.x25519){const a=ee.scalarMult(i,e),s=_.concatUint8Array([e,n,a]),{keySize:o}=rr(p.symmetric.aes128);return n1(await f0(p.hash.sha256,s,new Uint8Array,d0.x25519,o),t)}throw Error("Unsupported ECDH algorithm")}}),r3=Object.freeze({__proto__:null,CurveWithOID:vr,ecdh:t3,ecdhX:e3,ecdsa:Vu,eddsaLegacy:Zu,eddsa:Qu,generate:async function(r){const e=await _.getBigInteger();r=new vr(r);const t=await r.genKeyPair(),n=new e(t.publicKey).toUint8Array(),i=new e(t.privateKey).toUint8Array("be",r.payloadSize);return{oid:r.oid,Q:n,secret:i,hash:r.hash,cipher:r.cipher}},getPreferredHashAlgo:function(r){return Qi[p.write(p.curve,r.toHex())].hash}}),n3=Object.freeze({__proto__:null,sign:async function(r,e,t,n,i,a){const s=await _.getBigInteger(),o=new s(1);let u,c,h,l;n=new s(n),i=new s(i),t=new s(t),a=new s(a),t=t.mod(n),a=a.mod(i);const w=new s(e.subarray(0,i.byteLength())).mod(i);for(;;){if(u=await kr(o,i),c=t.modExp(u,n).imod(i),c.isZero())continue;const y=a.mul(c).imod(i);if(l=w.add(y).imod(i),h=u.modInv(i).imul(l).imod(i),!h.isZero())break}return{r:c.toUint8Array("be",i.byteLength()),s:h.toUint8Array("be",i.byteLength())}},verify:async function(r,e,t,n,i,a,s,o){const u=await _.getBigInteger(),c=new u(0);if(e=new u(e),t=new u(t),a=new u(a),s=new u(s),i=new u(i),o=new u(o),e.lte(c)||e.gte(s)||t.lte(c)||t.gte(s))return _.printDebug("invalid DSA Signature"),!1;const h=new u(n.subarray(0,s.byteLength())).imod(s),l=t.modInv(s);if(l.isZero())return _.printDebug("invalid DSA Signature"),!1;i=i.mod(a),o=o.mod(a);const w=h.mul(l).imod(s),y=e.mul(l).imod(s),K=i.modExp(w,a),C=o.modExp(y,a);return K.mul(C).imod(a).imod(s).equal(e)},validateParams:async function(r,e,t,n,i){const a=await _.getBigInteger();r=new a(r),e=new a(e),t=new a(t),n=new a(n);const s=new a(1);if(t.lte(s)||t.gte(r)||!r.dec().mod(e).isZero()||!t.modExp(e,r).isOne())return!1;const o=new a(e.bitLength()),u=new a(150);if(o.lt(u)||!await v2(e,null,32))return!1;i=new a(i);const c=new a(2),h=await kr(c.leftShift(o.dec()),c.leftShift(o)),l=e.mul(h).add(i);return!!n.equal(t.modExp(l,r))}}),Bt={rsa:Fu,elgamal:Hu,elliptic:r3,dsa:n3,nacl:ee},i3=Object.freeze({__proto__:null,parseSignatureParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:return{s:_.readMPI(e.subarray(t))};case p.publicKey.dsa:case p.publicKey.ecdsa:{const n=_.readMPI(e.subarray(t));return t+=n.length+2,{r:n,s:_.readMPI(e.subarray(t))}}case p.publicKey.eddsaLegacy:{let n=_.readMPI(e.subarray(t));t+=n.length+2,n=_.leftPad(n,32);let i=_.readMPI(e.subarray(t));return i=_.leftPad(i,32),{r:n,s:i}}case p.publicKey.ed25519:{const n=e.subarray(t,t+64);return t+=n.length,{RS:n}}default:throw new re("Unknown signature algorithm.")}},verify:async function(r,e,t,n,i,a){switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:{const{n:s,e:o}=n,u=_.leftPad(t.s,s.length);return Bt.rsa.verify(e,i,u,s,o,a)}case p.publicKey.dsa:{const{g:s,p:o,q:u,y:c}=n,{r:h,s:l}=t;return Bt.dsa.verify(e,h,l,a,s,o,u,c)}case p.publicKey.ecdsa:{const{oid:s,Q:o}=n,u=new Bt.elliptic.CurveWithOID(s).payloadSize,c=_.leftPad(t.r,u),h=_.leftPad(t.s,u);return Bt.elliptic.ecdsa.verify(s,e,{r:c,s:h},i,o,a)}case p.publicKey.eddsaLegacy:{const{oid:s,Q:o}=n;return Bt.elliptic.eddsaLegacy.verify(s,e,t,i,o,a)}case p.publicKey.ed25519:{const{A:s}=n;return Bt.elliptic.eddsa.verify(r,e,t,i,s,a)}default:throw Error("Unknown signature algorithm.")}},sign:async function(r,e,t,n,i,a){if(!t||!n)throw Error("Missing key parameters");switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:{const{n:s,e:o}=t,{d:u,p:c,q:h,u:l}=n;return{s:await Bt.rsa.sign(e,i,s,o,u,c,h,l,a)}}case p.publicKey.dsa:{const{g:s,p:o,q:u}=t,{x:c}=n;return Bt.dsa.sign(e,a,s,o,u,c)}case p.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case p.publicKey.ecdsa:{const{oid:s,Q:o}=t,{d:u}=n;return Bt.elliptic.ecdsa.sign(s,e,i,o,u,a)}case p.publicKey.eddsaLegacy:{const{oid:s,Q:o}=t,{seed:u}=n;return Bt.elliptic.eddsaLegacy.sign(s,e,i,o,u,a)}case p.publicKey.ed25519:{const{A:s}=t,{seed:o}=n;return Bt.elliptic.eddsa.sign(r,e,i,s,o,a)}default:throw Error("Unknown signature algorithm.")}}});class y0{constructor(e){e&&(this.data=e)}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw Error("Invalid symmetric key")}write(){return _.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class p0{constructor(e){if(e){const{hash:t,cipher:n}=e;this.hash=t,this.cipher=n}else this.hash=null,this.cipher=null}read(e){if(e.length<4||e[0]!==3||e[1]!==1)throw new re("Cannot read KDFParams");return this.hash=e[2],this.cipher=e[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}class pa{static fromObject({wrappedKey:e,algorithm:t}){const n=new pa;return n.wrappedKey=e,n.algorithm=t,n}read(e){let t=0,n=e[t++];this.algorithm=n%2?e[t++]:null,n-=n%2,this.wrappedKey=e.subarray(t,t+n),t+=n}write(){return _.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}function ns(r){try{r.getName()}catch{throw new re("Unknown curve OID")}}var a3=Object.freeze({__proto__:null,publicKeyEncrypt:async function(r,e,t,n,i){switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:{const{n:a,e:s}=t;return{c:await Bt.rsa.encrypt(n,a,s)}}case p.publicKey.elgamal:{const{p:a,g:s,y:o}=t;return Bt.elgamal.encrypt(n,a,s,o)}case p.publicKey.ecdh:{const{oid:a,Q:s,kdfParams:o}=t,{publicKey:u,wrappedKey:c}=await Bt.elliptic.ecdh.encrypt(a,o,n,s,i);return{V:u,C:new y0(c)}}case p.publicKey.x25519:{if(!_.isAES(e))throw Error("X25519 keys can only encrypt AES session keys");const{A:a}=t,{ephemeralPublicKey:s,wrappedKey:o}=await Bt.elliptic.ecdhX.encrypt(r,n,a);return{ephemeralPublicKey:s,C:pa.fromObject({algorithm:e,wrappedKey:o})}}default:return[]}},publicKeyDecrypt:async function(r,e,t,n,i,a){switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:{const{c:s}=n,{n:o,e:u}=e,{d:c,p:h,q:l,u:w}=t;return Bt.rsa.decrypt(s,o,u,c,h,l,w,a)}case p.publicKey.elgamal:{const{c1:s,c2:o}=n,u=e.p,c=t.x;return Bt.elgamal.decrypt(s,o,u,c,a)}case p.publicKey.ecdh:{const{oid:s,Q:o,kdfParams:u}=e,{d:c}=t,{V:h,C:l}=n;return Bt.elliptic.ecdh.decrypt(s,u,h,l.data,o,c,i)}case p.publicKey.x25519:{const{A:s}=e,{k:o}=t,{ephemeralPublicKey:u,C:c}=n;if(!_.isAES(c.algorithm))throw Error("AES session key expected");return Bt.elliptic.ecdhX.decrypt(r,u,c.wrappedKey,s,o)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=_.readMPI(e.subarray(t));return t+=i.length+2,{read:t,publicParams:{n,e:i}}}case p.publicKey.dsa:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=_.readMPI(e.subarray(t));t+=a.length+2;const s=_.readMPI(e.subarray(t));return t+=s.length+2,{read:t,publicParams:{p:n,q:i,g:a,y:s}}}case p.publicKey.elgamal:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=_.readMPI(e.subarray(t));return t+=a.length+2,{read:t,publicParams:{p:n,g:i,y:a}}}case p.publicKey.ecdsa:{const n=new Ve;t+=n.read(e),ns(n);const i=_.readMPI(e.subarray(t));return t+=i.length+2,{read:t,publicParams:{oid:n,Q:i}}}case p.publicKey.eddsaLegacy:{const n=new Ve;t+=n.read(e),ns(n);let i=_.readMPI(e.subarray(t));return t+=i.length+2,i=_.leftPad(i,33),{read:t,publicParams:{oid:n,Q:i}}}case p.publicKey.ecdh:{const n=new Ve;t+=n.read(e),ns(n);const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=new p0;return t+=a.read(e.subarray(t)),{read:t,publicParams:{oid:n,Q:i,kdfParams:a}}}case p.publicKey.ed25519:case p.publicKey.x25519:{const n=e.subarray(t,t+32);return t+=n.length,{read:t,publicParams:{A:n}}}default:throw new re("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(r,e,t){let n=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const i=_.readMPI(e.subarray(n));n+=i.length+2;const a=_.readMPI(e.subarray(n));n+=a.length+2;const s=_.readMPI(e.subarray(n));n+=s.length+2;const o=_.readMPI(e.subarray(n));return n+=o.length+2,{read:n,privateParams:{d:i,p:a,q:s,u:o}}}case p.publicKey.dsa:case p.publicKey.elgamal:{const i=_.readMPI(e.subarray(n));return n+=i.length+2,{read:n,privateParams:{x:i}}}case p.publicKey.ecdsa:case p.publicKey.ecdh:{const i=new vr(t.oid);let a=_.readMPI(e.subarray(n));return n+=a.length+2,a=_.leftPad(a,i.payloadSize),{read:n,privateParams:{d:a}}}case p.publicKey.eddsaLegacy:{const i=new vr(t.oid);let a=_.readMPI(e.subarray(n));return n+=a.length+2,a=_.leftPad(a,i.payloadSize),{read:n,privateParams:{seed:a}}}case p.publicKey.ed25519:{const i=e.subarray(n,n+32);return n+=i.length,{read:n,privateParams:{seed:i}}}case p.publicKey.x25519:{const i=e.subarray(n,n+32);return n+=i.length,{read:n,privateParams:{k:i}}}default:throw new re("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:return{c:_.readMPI(e.subarray(t))};case p.publicKey.elgamal:{const n=_.readMPI(e.subarray(t));return t+=n.length+2,{c1:n,c2:_.readMPI(e.subarray(t))}}case p.publicKey.ecdh:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=new y0;return i.read(e.subarray(t)),{V:n,C:i}}case p.publicKey.x25519:{const n=e.subarray(t,t+32);t+=n.length;const i=new pa;return i.read(e.subarray(t)),{ephemeralPublicKey:n,C:i}}default:throw new re("Unknown public key encryption algorithm.")}},serializeParams:function(r,e){const t=new Set([p.publicKey.ed25519,p.publicKey.x25519]),n=Object.keys(e).map(i=>{const a=e[i];return _.isUint8Array(a)?t.has(r)?a:_.uint8ArrayToMPI(a):a.write()});return _.concatUint8Array(n)},generateParams:function(r,e,t){switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:return Bt.rsa.generate(e,65537).then(({n,e:i,d:a,p:s,q:o,u})=>({privateParams:{d:a,p:s,q:o,u},publicParams:{n,e:i}}));case p.publicKey.ecdsa:return Bt.elliptic.generate(t).then(({oid:n,Q:i,secret:a})=>({privateParams:{d:a},publicParams:{oid:new Ve(n),Q:i}}));case p.publicKey.eddsaLegacy:return Bt.elliptic.generate(t).then(({oid:n,Q:i,secret:a})=>({privateParams:{seed:a},publicParams:{oid:new Ve(n),Q:i}}));case p.publicKey.ecdh:return Bt.elliptic.generate(t).then(({oid:n,Q:i,secret:a,hash:s,cipher:o})=>({privateParams:{d:a},publicParams:{oid:new Ve(n),Q:i,kdfParams:new p0({hash:s,cipher:o})}}));case p.publicKey.ed25519:return Bt.elliptic.eddsa.generate(r).then(({A:n,seed:i})=>({privateParams:{seed:i},publicParams:{A:n}}));case p.publicKey.x25519:return Bt.elliptic.ecdhX.generate(r).then(({A:n,k:i})=>({privateParams:{k:i},publicParams:{A:n}}));case p.publicKey.dsa:case p.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(r,e,t){if(!e||!t)throw Error("Missing key parameters");switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const{n,e:i}=e,{d:a,p:s,q:o,u}=t;return Bt.rsa.validateParams(n,i,a,s,o,u)}case p.publicKey.dsa:{const{p:n,q:i,g:a,y:s}=e,{x:o}=t;return Bt.dsa.validateParams(n,i,a,s,o)}case p.publicKey.elgamal:{const{p:n,g:i,y:a}=e,{x:s}=t;return Bt.elgamal.validateParams(n,i,a,s)}case p.publicKey.ecdsa:case p.publicKey.ecdh:{const n=Bt.elliptic[p.read(p.publicKey,r)],{oid:i,Q:a}=e,{d:s}=t;return n.validateParams(i,a,s)}case p.publicKey.eddsaLegacy:{const{Q:n,oid:i}=e,{seed:a}=t;return Bt.elliptic.eddsaLegacy.validateParams(i,n,a)}case p.publicKey.ed25519:{const{A:n}=e,{seed:i}=t;return Bt.elliptic.eddsa.validateParams(r,n,i)}case p.publicKey.x25519:{const{A:n}=e,{k:i}=t;return Bt.elliptic.ecdhX.validateParams(r,n,i)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(r){const{blockSize:e}=rr(r),t=await Ee(e),n=new Uint8Array([t[t.length-2],t[t.length-1]]);return _.concat([t,n])},generateSessionKey:function(r){const{keySize:e}=rr(r);return Ee(e)},getAEADMode:function(r){const e=p.read(p.aead,r);return k2[e]},getCipher:rr,getPreferredCurveHashAlgo:function(r,e){switch(r){case p.publicKey.ecdsa:case p.publicKey.eddsaLegacy:return Bt.elliptic.getPreferredHashAlgo(e);case p.publicKey.ed25519:return Bt.elliptic.eddsa.getPreferredHashAlgo(r);default:throw Error("Unknown elliptic signing algo")}}});const Tt={cipher:Pi,hash:Ke,mode:k2,publicKey:Bt,signature:i3,random:Ou,pkcs1:Nu,pkcs5:Yu,aesKW:Xu};Object.assign(Tt,a3);var Ci=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function B2(r,e){return r.length===e?r:r.subarray?r.subarray(0,e):(r.length=e,r)}const T2={arraySet:function(r,e,t,n,i){if(e.subarray&&r.subarray)r.set(e.subarray(t,t+n),i);else for(let a=0;a=0;)r[e]=0}const h3=0,N2=1,l3=2,a1=29,Di=256,wi=Di+1+a1,Pn=30,s1=19,k0=2*wi+1,Yr=15,as=16,f3=7,o1=256,F2=16,H2=17,$2=18,Rs=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Xi=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],d3=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],v0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fr=Array(2*(wi+2));Ln(fr);const hi=Array(2*Pn);Ln(hi);const bi=Array(512);Ln(bi);const ki=Array(256);Ln(ki);const c1=Array(a1);Ln(c1);const ma=Array(Pn);function ss(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}let A0,_0,E0;function os(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}function q2(r){return r<256?bi[r]:bi[256+(r>>>7)]}function vi(r,e){r.pending_buf[r.pending++]=255&e,r.pending_buf[r.pending++]=e>>>8&255}function ke(r,e,t){r.bi_valid>as-t?(r.bi_buf|=e<>as-r.bi_valid,r.bi_valid+=t-as):(r.bi_buf|=e<>>=1,t<<=1;while(--e>0);return t>>>1}function G2(r,e,t){const n=Array(Yr+1);let i,a,s=0;for(i=1;i<=Yr;i++)n[i]=s=s+t[i-1]<<1;for(a=0;a<=e;a++){const o=r[2*a+1];o!==0&&(r[2*a]=j2(n[o]++,o))}}function W2(r){let e;for(e=0;e8?vi(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0}function S0(r,e,t,n){const i=2*e,a=2*t;return r[i]>1;s>=1;s--)cs(r,t,s);u=a;do s=r.heap[1],r.heap[1]=r.heap[r.heap_len--],cs(r,t,1),o=r.heap[1],r.heap[--r.heap_max]=s,r.heap[--r.heap_max]=o,t[2*u]=t[2*s]+t[2*o],r.depth[u]=(r.depth[s]>=r.depth[o]?r.depth[s]:r.depth[o])+1,t[2*s+1]=t[2*o+1]=u,r.heap[1]=u++,cs(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],function(h,l){const w=l.dyn_tree,y=l.max_code,K=l.stat_desc.static_tree,C=l.stat_desc.has_stree,M=l.stat_desc.extra_bits,H=l.stat_desc.extra_base,Q=l.stat_desc.max_length;let F,E,W,q,j,G,Z=0;for(q=0;q<=Yr;q++)h.bl_count[q]=0;for(w[2*h.heap[h.heap_max]+1]=0,F=h.heap_max+1;FQ&&(q=Q,Z++),w[2*E+1]=q,E>y||(h.bl_count[q]++,j=0,E>=H&&(j=M[E-H]),G=w[2*E],h.opt_len+=G*(q+j),C&&(h.static_len+=G*(K[2*E+1]+j)));if(Z!==0){do{for(q=Q-1;h.bl_count[q]===0;)q--;h.bl_count[q]--,h.bl_count[q+1]+=2,h.bl_count[Q]--,Z-=2}while(Z>0);for(q=Q;q!==0;q--)for(E=h.bl_count[q];E!==0;)W=h.heap[--F],W>y||(w[2*W+1]!==q&&(h.opt_len+=(q-w[2*W+1])*w[2*W],w[2*W+1]=q),E--)}}(r,e),G2(t,c,r.bl_count)}function U0(r,e,t){let n,i,a=-1,s=e[1],o=0,u=7,c=4;for(s===0&&(u=138,c=3),e[2*(t+1)+1]=65535,n=0;n<=t;n++)i=s,s=e[2*(n+1)+1],++o>=7;i=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(r)}function g3(r,e,t,n){let i,a,s=0;r.level>0?(r.strm.data_type===M2&&(r.strm.data_type=function(o){let u,c=4093624447;for(u=0;u<=31;u++,c>>>=1)if(1&c&&o.dyn_ltree[2*u]!==0)return w0;if(o.dyn_ltree[18]!==0||o.dyn_ltree[20]!==0||o.dyn_ltree[26]!==0)return b0;for(u=32;u=3&&o.bl_tree[2*v0[u]+1]===0;u--);return o.opt_len+=3*(u+1)+5+5+4,u}(r),i=r.opt_len+3+7>>>3,a=r.static_len+3+7>>>3,a<=i&&(i=a)):i=a=t+5,t+4<=i&&e!==-1?Z2(r,e,t,n):r.strategy===O2||a===i?(ke(r,(N2<<1)+(n?1:0),3),P0(r,fr,hi)):(ke(r,(l3<<1)+(n?1:0),3),function(o,u,c,h){let l;for(ke(o,u-257,5),ke(o,c-1,5),ke(o,h-4,4),l=0;l>>8&255,r.pending_buf[r.d_buf+2*r.last_lit+1]=255&e,r.pending_buf[r.l_buf+r.last_lit]=255&t,r.last_lit++,e===0?r.dyn_ltree[2*t]++:(r.matches++,e--,r.dyn_ltree[2*(ki[t]+Di+1)]++,r.dyn_dtree[2*q2(e)]++),r.last_lit===r.lit_bufsize-1}function Ai(r,e,t,n){let i=65535&r|0,a=r>>>16&65535|0,s=0;for(;t!==0;){s=t>2e3?2e3:t,t-=s;do i=i+e[n++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0}const m3=function(){let r;const e=[];for(let t=0;t<256;t++){r=t;for(let n=0;n<8;n++)r=1&r?3988292384^r>>>1:r>>>1;e[t]=r}return e}();function ie(r,e,t,n){const i=m3,a=n+t;r^=-1;for(let s=n;s>>8^i[255&(r^e[s])];return-1^r}var _i={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};const w3=9,Rt=3,Rr=258,Le=Rr+Rt+1,b3=32,wa=42,zs=69,Yi=73,Ji=91,ta=103,Jr=113,ei=666,ae=1,li=2,tn=3,Un=4,k3=3;function zr(r,e){return r.msg=_i[e],e}function D0(r){return(r<<1)-(r>4?9:0)}function Ir(r){let e=r.length;for(;--e>=0;)r[e]=0}function Cr(r){const e=r.state;let t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(ir(r.output,e.pending_buf,e.pending_out,t,r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))}function ue(r,e){g3(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,Cr(r.strm)}function Ot(r,e){r.pending_buf[r.pending++]=e}function qn(r,e){r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=255&e}function v3(r,e,t,n){let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,ir(e,r.input,r.next_in,i,t),r.state.wrap===1?r.adler=Ai(r.adler,e,i,t):r.state.wrap===2&&(r.adler=ie(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)}function Q2(r,e){let t,n,i=r.max_chain_length,a=r.strstart,s=r.prev_length,o=r.nice_match;const u=r.strstart>r.w_size-Le?r.strstart-(r.w_size-Le):0,c=r.window,h=r.w_mask,l=r.prev,w=r.strstart+Rr;let y=c[a+s-1],K=c[a+s];r.prev_length>=r.good_match&&(i>>=2),o>r.lookahead&&(o=r.lookahead);do if(t=e,c[t+s]===K&&c[t+s-1]===y&&c[t]===c[a]&&c[++t]===c[a+1]){a+=2,t++;do;while(c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&as){if(r.match_start=e,s=n,n>=o)break;y=c[a+s-1],K=c[a+s]}}while((e=l[e&h])>u&&--i!=0);return s<=r.lookahead?s:r.lookahead}function an(r){const e=r.w_size;let t,n,i,a,s;do{if(a=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-Le)){ir(r.window,r.window,e,e,0),r.match_start-=e,r.strstart-=e,r.block_start-=e,n=r.hash_size,t=n;do i=r.head[--t],r.head[t]=i>=e?i-e:0;while(--n);n=e,t=n;do i=r.prev[--t],r.prev[t]=i>=e?i-e:0;while(--n);a+=e}if(r.strm.avail_in===0)break;if(n=v3(r.strm,r.window,r.strstart+r.lookahead,a),r.lookahead+=n,r.lookahead+r.insert>=Rt)for(s=r.strstart-r.insert,r.ins_h=r.window[s],r.ins_h=(r.ins_h<=Rt&&(r.ins_h=(r.ins_h<=Rt)if(n=Lr(r,r.strstart-r.match_start,r.match_length-Rt),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=Rt){r.match_length--;do r.strstart++,r.ins_h=(r.ins_h<=Rt&&(r.ins_h=(r.ins_h<4096)&&(r.match_length=Rt-1)),r.prev_length>=Rt&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-Rt,n=Lr(r,r.strstart-1-r.prev_match,r.prev_length-Rt),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=(r.ins_h<r.pending_buf_size-5&&(t=r.pending_buf_size-5);;){if(r.lookahead<=1){if(an(r),r.lookahead===0&&e===ar)return ae;if(r.lookahead===0)break}r.strstart+=r.lookahead,r.lookahead=0;const n=r.block_start+t;if((r.strstart===0||r.strstart>=n)&&(r.lookahead=r.strstart-n,r.strstart=n,ue(r,!1),r.strm.avail_out===0)||r.strstart-r.block_start>=r.w_size-Le&&(ue(r,!1),r.strm.avail_out===0))return ae}return r.insert=0,e===oe?(ue(r,!0),r.strm.avail_out===0?tn:Un):(r.strstart>r.block_start&&(ue(r,!1),r.strm.avail_out),ae)}),new $e(4,4,8,4,hs),new $e(4,5,16,8,hs),new $e(4,6,32,32,hs),new $e(4,4,16,16,mn),new $e(8,16,32,32,mn),new $e(8,16,128,128,mn),new $e(8,32,128,256,mn),new $e(32,128,258,1024,mn),new $e(32,258,258,4096,mn)];class A3{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=In,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Pe(1146),this.dyn_dtree=new Pe(122),this.bl_tree=new Pe(78),Ir(this.dyn_ltree),Ir(this.dyn_dtree),Ir(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Pe(16),this.heap=new Pe(573),Ir(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Pe(573),Ir(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}}function _3(r){const e=function(t){let n;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=M2,n=t.state,n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap?wa:Jr,t.adler=n.wrap===2?0:1,n.last_flush=ar,y3(n),Ht):zr(t,te)}(r);return e===Ht&&function(t){t.window_size=2*t.w_size,Ir(t.head),t.max_lazy_match=ri[t.level].max_lazy,t.good_match=ri[t.level].good_length,t.nice_match=ri[t.level].nice_length,t.max_chain_length=ri[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Rt-1,t.match_available=0,t.ins_h=0}(r.state),e}function E3(r,e){let t,n,i,a;if(!r||!r.state||e>g0||e<0)return r?zr(r,te):te;if(n=r.state,!r.output||!r.input&&r.avail_in!==0||n.status===ei&&e!==oe)return zr(r,r.avail_out===0?ui:te);if(n.strm=r,t=n.last_flush,n.last_flush=e,n.status===wa)if(n.wrap===2)r.adler=0,Ot(n,31),Ot(n,139),Ot(n,8),n.gzhead?(Ot(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ot(n,255&n.gzhead.time),Ot(n,n.gzhead.time>>8&255),Ot(n,n.gzhead.time>>16&255),Ot(n,n.gzhead.time>>24&255),Ot(n,n.level===9?2:n.strategy>=$i||n.level<2?4:0),Ot(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Ot(n,255&n.gzhead.extra.length),Ot(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(r.adler=ie(r.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=zs):(Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,n.level===9?2:n.strategy>=$i||n.level<2?4:0),Ot(n,k3),n.status=Jr);else{let o=In+(n.w_bits-8<<4)<<8,u=-1;u=n.strategy>=$i||n.level<2?0:n.level<6?1:n.level===6?2:3,o|=u<<6,n.strstart!==0&&(o|=b3),o+=31-o%31,n.status=Jr,qn(n,o),n.strstart!==0&&(qn(n,r.adler>>>16),qn(n,65535&r.adler)),r.adler=1}if(n.status===zs)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Cr(r),i=n.pending,n.pending!==n.pending_buf_size));)Ot(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Yi)}else n.status=Yi;if(n.status===Yi)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Cr(r),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.gzindex=0,n.status=Ji)}else n.status=Ji;if(n.status===Ji)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Cr(r),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.status=ta)}else n.status=ta;if(n.status===ta&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Cr(r),n.pending+2<=n.pending_buf_size&&(Ot(n,255&r.adler),Ot(n,r.adler>>8&255),r.adler=0,n.status=Jr)):n.status=Jr),n.pending!==0){if(Cr(r),r.avail_out===0)return n.last_flush=-1,Ht}else if(r.avail_in===0&&D0(e)<=D0(t)&&e!==oe)return zr(r,ui);if(n.status===ei&&r.avail_in!==0)return zr(r,ui);if(r.avail_in!==0||n.lookahead!==0||e!==ar&&n.status!==ei){var s=n.strategy===$i?function(o,u){let c;for(;;){if(o.lookahead===0&&(an(o),o.lookahead===0)){if(u===ar)return ae;break}if(o.match_length=0,c=Lr(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++,c&&(ue(o,!1),o.strm.avail_out===0))return ae}return o.insert=0,u===oe?(ue(o,!0),o.strm.avail_out===0?tn:Un):o.last_lit&&(ue(o,!1),o.strm.avail_out===0)?ae:li}(n,e):n.strategy===u3?function(o,u){let c,h,l,w;const y=o.window;for(;;){if(o.lookahead<=Rr){if(an(o),o.lookahead<=Rr&&u===ar)return ae;if(o.lookahead===0)break}if(o.match_length=0,o.lookahead>=Rt&&o.strstart>0&&(l=o.strstart-1,h=y[l],h===y[++l]&&h===y[++l]&&h===y[++l])){w=o.strstart+Rr;do;while(h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&lo.lookahead&&(o.match_length=o.lookahead)}if(o.match_length>=Rt?(c=Lr(o,1,o.match_length-Rt),o.lookahead-=o.match_length,o.strstart+=o.match_length,o.match_length=0):(c=Lr(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++),c&&(ue(o,!1),o.strm.avail_out===0))return ae}return o.insert=0,u===oe?(ue(o,!0),o.strm.avail_out===0?tn:Un):o.last_lit&&(ue(o,!1),o.strm.avail_out===0)?ae:li}(n,e):ri[n.level].func(n,e);if(s!==tn&&s!==Un||(n.status=ei),s===ae||s===tn)return r.avail_out===0&&(n.last_flush=-1),Ht;if(s===li&&(e===s3?p3(n):e!==g0&&(Z2(n,0,0,!1),e===o3&&(Ir(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Cr(r),r.avail_out===0))return n.last_flush=-1,Ht}return e!==oe?Ht:n.wrap<=0?mr:(n.wrap===2?(Ot(n,255&r.adler),Ot(n,r.adler>>8&255),Ot(n,r.adler>>16&255),Ot(n,r.adler>>24&255),Ot(n,255&r.total_in),Ot(n,r.total_in>>8&255),Ot(n,r.total_in>>16&255),Ot(n,r.total_in>>24&255)):(qn(n,r.adler>>>16),qn(n,65535&r.adler)),Cr(r),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ht:mr)}try{String.fromCharCode.call(null,0)}catch{}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{}const Ls=new Xe(256);for(let r=0;r<256;r++)Ls[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;function Os(r){let e,t,n,i,a=0;const s=r.length;for(n=0;n>>6,o[i++]=128|63&e):e<65536?(o[i++]=224|e>>>12,o[i++]=128|e>>>6&63,o[i++]=128|63&e):(o[i++]=240|e>>>18,o[i++]=128|e>>>12&63,o[i++]=128|e>>>6&63,o[i++]=128|63&e);return o}Ls[254]=Ls[254]=1;class X2{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}}class S3{constructor(e){this.options={level:m0,method:In,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,...e||{}};const t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new X2,this.strm.avail_out=0;var n,i,a=function(s,o,u,c,h,l){if(!s)return te;let w=1;if(o===m0&&(o=6),c<0?(w=0,c=-c):c>15&&(w=2,c-=16),h<1||h>w3||u!==In||c<8||c>15||o<0||o>9||l<0||l>O2)return zr(s,te);c===8&&(c=9);const y=new A3;return s.state=y,y.strm=s,y.wrap=w,y.gzhead=null,y.w_bits=c,y.w_size=1<=c.w_size&&(w===0&&(Ir(c.head),c.strstart=0,c.block_start=0,c.insert=0),M=new Xe(c.w_size),ir(M,u,H-c.w_size,c.w_size,0),u=M,H=c.w_size),y=o.avail_in,K=o.next_in,C=o.input,o.avail_in=H,o.next_in=0,o.input=u,an(c);c.lookahead>=Rt;){h=c.strstart,l=c.lookahead-(Rt-1);do c.ins_h=(c.ins_h<0||n.avail_out===0)&&a!==mr);return s===oe?(a=function(o){let u;return o&&o.state?(u=o.state.status,u!==wa&&u!==zs&&u!==Yi&&u!==Ji&&u!==ta&&u!==Jr&&u!==ei?zr(o,te):(o.state=null,u===Jr?zr(o,i1):Ht)):te}(this.strm),this.onEnd(a),this.ended=!0,a===Ht):s!==mi||(this.onEnd(Ht),n.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===Ht&&(this.result=z2(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}const qi=30,P3=12;function U3(r,e){let t,n,i,a,s,o,u,c,h,l;const w=r.state;t=r.next_in;const y=r.input,K=t+(r.avail_in-5);n=r.next_out;const C=r.output,M=n-(e-r.avail_out),H=n+(r.avail_out-257),Q=w.dmax,F=w.wsize,E=w.whave,W=w.wnext,q=w.window;i=w.hold,a=w.bits;const j=w.lencode,G=w.distcode,Z=(1<>>24,i>>>=o,a-=o,o=s>>>16&255,o===0)C[n++]=65535&s;else{if(!(16&o)){if(!(64&o)){s=j[(65535&s)+(i&(1<>>=o,a-=o),a<15&&(i+=y[t++]<>>24,i>>>=o,a-=o,o=s>>>16&255,!(16&o)){if(!(64&o)){s=G[(65535&s)+(i&(1<Q){r.msg="invalid distance too far back",w.mode=qi;break t}if(i>>>=o,a-=o,o=n-M,c>o){if(o=c-o,o>E&&w.sane){r.msg="invalid distance too far back",w.mode=qi;break t}if(h=0,l=q,W===0){if(h+=F-o,o2;)C[n++]=l[h++],C[n++]=l[h++],C[n++]=l[h++],u-=3;u&&(C[n++]=l[h++],u>1&&(C[n++]=l[h++]))}else{h=n-c;do C[n++]=C[h++],C[n++]=C[h++],C[n++]=C[h++],u-=3;while(u>2);u&&(C[n++]=C[h++],u>1&&(C[n++]=C[h++]))}break}}break}}while(t>3,t-=u,a-=u<<3,i&=(1<=1&&tt[H]===0;H--);if(Q>H&&(Q=H),H===0)return i[a++]=20971520,i[a++]=20971520,o.bits=1,0;for(M=1;M0&&(r===B0||H!==1))return-1;for(rt[1]=0,K=1;Kx0||r===T0&&q>I0)return 1;for(;;){dt=K-E,s[C]y?(it=ft[Pt+s[C]],O=G[Z+s[C]]):(it=96,O=0),c=1<>E)+h]=dt<<24|it<<16|O|0;while(h!==0);for(c=1<>=1;if(c!==0?(j&=c-1,j+=c):j=0,C++,--tt[K]==0){if(K===H)break;K=e[t+s[C]]}if(K>Q&&(j&$)!==l){for(E===0&&(E=Q),w+=M,F=K-E,W=1<x0||r===T0&&q>I0)return 1;l=j&$,i[l]=Q<<24|F<<16|w-a|0}}return j!==0&&(i[w+j]=K-E<<24|64<<16|0),o.bits=Q,0}const I3=0,Y2=1,J2=2,tc=1,R0=2,z0=3,L0=4,O0=5,M0=6,N0=7,F0=8,H0=9,$0=10,ba=11,ur=12,fs=13,q0=14,ds=15,j0=16,G0=17,W0=18,V0=19,ji=20,Gi=21,Z0=22,Q0=23,X0=24,Y0=25,J0=26,ys=27,to=28,eo=29,Zt=30,B3=852,T3=592;function ro(r){return(r>>>24&255)+(r>>>8&65280)+((65280&r)<<8)+((255&r)<<24)}class R3{constructor(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Pe(320),this.work=new Pe(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}}function z3(r){let e;return r&&r.state?(e=r.state,e.wsize=0,e.whave=0,e.wnext=0,function(t){let n;return t&&t.state?(n=t.state,t.total_in=t.total_out=n.total=0,t.msg="",n.wrap&&(t.adler=1&n.wrap),n.mode=tc,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new ga(B3),n.distcode=n.distdyn=new ga(T3),n.sane=1,n.back=-1,Ht):te}(r)):te}function L3(r,e){let t,n;return r?(n=new R3,r.state=n,n.window=null,t=function(i,a){let s,o;return i&&i.state?(o=i.state,a<0?(s=0,a=-a):(s=1+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?te:(o.window!==null&&o.wbits!==a&&(o.window=null),o.wrap=s,o.wbits=a,z3(i))):te}(r,e),t!==Ht&&(r.state=null),t):te}let ps,gs,no=!0;function O3(r){if(no){let e;for(ps=new ga(512),gs=new ga(32),e=0;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(fi(Y2,r.lens,0,288,ps,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;fi(J2,r.lens,0,32,gs,0,r.work,{bits:5}),no=!1}r.lencode=ps,r.lenbits=9,r.distcode=gs,r.distbits=5}function ec(r,e,t,n){let i;const a=r.state;return a.window===null&&(a.wsize=1<=a.wsize?(ir(a.window,e,t-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),ir(a.window,e,t-n,i,a.wnext),(n-=i)?(ir(a.window,e,t-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,t.check=ie(t.check,rt,2,0),c=0,h=0,t.mode=R0;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&c)<<8)+(c>>8))%31){r.msg="incorrect header check",t.mode=Zt;break}if((15&c)!==In){r.msg="unknown compression method",t.mode=Zt;break}if(c>>>=4,h-=4,q=8+(15&c),t.wbits===0)t.wbits=q;else if(q>t.wbits){r.msg="invalid window size",t.mode=Zt;break}t.dmax=1<>8&1),512&t.flags&&(rt[0]=255&c,rt[1]=c>>>8&255,t.check=ie(t.check,rt,2,0)),c=0,h=0,t.mode=z0;case z0:for(;h<32;){if(o===0)break t;o--,c+=n[a++]<>>8&255,rt[2]=c>>>16&255,rt[3]=c>>>24&255,t.check=ie(t.check,rt,4,0)),c=0,h=0,t.mode=L0;case L0:for(;h<16;){if(o===0)break t;o--,c+=n[a++]<>8),512&t.flags&&(rt[0]=255&c,rt[1]=c>>>8&255,t.check=ie(t.check,rt,2,0)),c=0,h=0,t.mode=O0;case O0:if(1024&t.flags){for(;h<16;){if(o===0)break t;o--,c+=n[a++]<>>8&255,t.check=ie(t.check,rt,2,0)),c=0,h=0}else t.head&&(t.head.extra=null);t.mode=M0;case M0:if(1024&t.flags&&(y=t.length,y>o&&(y=o),y&&(t.head&&(q=t.head.extra_len-t.length,t.head.extra||(t.head.extra=Array(t.head.extra_len)),ir(t.head.extra,n,a,y,q)),512&t.flags&&(t.check=ie(t.check,n,y,a)),o-=y,a+=y,t.length-=y),t.length))break t;t.length=0,t.mode=N0;case N0:if(2048&t.flags){if(o===0)break t;y=0;do q=n[a+y++],t.head&&q&&t.length<65536&&(t.head.name+=String.fromCharCode(q));while(q&&y>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=ur;break;case $0:for(;h<32;){if(o===0)break t;o--,c+=n[a++]<>>=7&h,h-=7&h,t.mode=ys;break}for(;h<3;){if(o===0)break t;o--,c+=n[a++]<>>=1,h-=1,3&c){case 0:t.mode=q0;break;case 1:O3(t),t.mode=ji;break;case 2:t.mode=G0;break;case 3:r.msg="invalid block type",t.mode=Zt}c>>>=2,h-=2;break;case q0:for(c>>>=7&h,h-=7&h;h<32;){if(o===0)break t;o--,c+=n[a++]<>>16^65535)){r.msg="invalid stored block lengths",t.mode=Zt;break}t.length=65535&c,c=0,h=0,t.mode=ds;case ds:t.mode=j0;case j0:if(y=t.length,y){if(y>o&&(y=o),y>u&&(y=u),y===0)break t;ir(i,n,a,y,s),o-=y,a+=y,u-=y,s+=y,t.length-=y;break}t.mode=ur;break;case G0:for(;h<14;){if(o===0)break t;o--,c+=n[a++]<>>=5,h-=5,t.ndist=1+(31&c),c>>>=5,h-=5,t.ncode=4+(15&c),c>>>=4,h-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=Zt;break}t.have=0,t.mode=W0;case W0:for(;t.have>>=3,h-=3}for(;t.have<19;)t.lens[dt[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,G={bits:t.lenbits},j=fi(I3,t.lens,0,19,t.lencode,0,t.work,G),t.lenbits=G.bits,j){r.msg="invalid code lengths set",t.mode=Zt;break}t.have=0,t.mode=V0;case V0:for(;t.have>>24,H=tt>>>16&255,Q=65535&tt,!(M<=h);){if(o===0)break t;o--,c+=n[a++]<>>=M,h-=M,t.lens[t.have++]=Q;else{if(Q===16){for(Z=M+2;h>>=M,h-=M,t.have===0){r.msg="invalid bit length repeat",t.mode=Zt;break}q=t.lens[t.have-1],y=3+(3&c),c>>>=2,h-=2}else if(Q===17){for(Z=M+3;h>>=M,h-=M,q=0,y=3+(7&c),c>>>=3,h-=3}else{for(Z=M+7;h>>=M,h-=M,q=0,y=11+(127&c),c>>>=7,h-=7}if(t.have+y>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=Zt;break}for(;y--;)t.lens[t.have++]=q}}if(t.mode===Zt)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=Zt;break}if(t.lenbits=9,G={bits:t.lenbits},j=fi(Y2,t.lens,0,t.nlen,t.lencode,0,t.work,G),t.lenbits=G.bits,j){r.msg="invalid literal/lengths set",t.mode=Zt;break}if(t.distbits=6,t.distcode=t.distdyn,G={bits:t.distbits},j=fi(J2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,G),t.distbits=G.bits,j){r.msg="invalid distances set",t.mode=Zt;break}t.mode=ji;case ji:t.mode=Gi;case Gi:if(o>=6&&u>=258){r.next_out=s,r.avail_out=u,r.next_in=a,r.avail_in=o,t.hold=c,t.bits=h,U3(r,w),s=r.next_out,i=r.output,u=r.avail_out,a=r.next_in,n=r.input,o=r.avail_in,c=t.hold,h=t.bits,t.mode===ur&&(t.back=-1);break}for(t.back=0;tt=t.lencode[c&(1<>>24,H=tt>>>16&255,Q=65535&tt,!(M<=h);){if(o===0)break t;o--,c+=n[a++]<>F)],M=tt>>>24,H=tt>>>16&255,Q=65535&tt,!(F+M<=h);){if(o===0)break t;o--,c+=n[a++]<>>=F,h-=F,t.back+=F}if(c>>>=M,h-=M,t.back+=M,t.length=Q,H===0){t.mode=J0;break}if(32&H){t.back=-1,t.mode=ur;break}if(64&H){r.msg="invalid literal/length code",t.mode=Zt;break}t.extra=15&H,t.mode=Z0;case Z0:if(t.extra){for(Z=t.extra;h>>=t.extra,h-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Q0;case Q0:for(;tt=t.distcode[c&(1<>>24,H=tt>>>16&255,Q=65535&tt,!(M<=h);){if(o===0)break t;o--,c+=n[a++]<>F)],M=tt>>>24,H=tt>>>16&255,Q=65535&tt,!(F+M<=h);){if(o===0)break t;o--,c+=n[a++]<>>=F,h-=F,t.back+=F}if(c>>>=M,h-=M,t.back+=M,64&H){r.msg="invalid distance code",t.mode=Zt;break}t.offset=Q,t.extra=15&H,t.mode=X0;case X0:if(t.extra){for(Z=t.extra;h>>=t.extra,h-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=Zt;break}t.mode=Y0;case Y0:if(u===0)break t;if(y=w-u,t.offset>y){if(y=t.offset-y,y>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=Zt;break}y>t.wnext?(y-=t.wnext,K=t.wsize-y):K=t.wnext-y,y>t.length&&(y=t.length),C=t.window}else C=i,K=s-t.offset,y=t.length;y>u&&(y=u),u-=y,t.length-=y;do i[s++]=C[K++];while(--y);t.length===0&&(t.mode=Gi);break;case J0:if(u===0)break t;i[s++]=t.length,u--,t.mode=Gi;break;case ys:if(t.wrap){for(;h<32;){if(o===0)break t;o--,c|=n[a++]<=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new X2,this.strm.avail_out=0;let n=L3(this.strm,t.windowBits);if(n!==Ht||(this.header=new N3,function(i,a){let s;i&&i.state&&(s=i.state,!(2&s.wrap)||(s.head=a,a.done=!1))}(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Os(t.dictionary):t.dictionary instanceof ArrayBuffer&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=io(this.strm,t.dictionary),n!==Ht))))throw Error(_i[n])}push(e,t){const{strm:n,options:{chunkSize:i,dictionary:a}}=this;let s,o,u=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?oe:ar,typeof e=="string"?n.input=function(c){const h=new Xe(c.length);for(let l=0,w=h.length;l0||n.avail_out===0)&&s!==mr);return s===mr&&(o=oe),o===oe?(s=function(c){if(!c||!c.state)return te;const h=c.state;return h.window&&(h.window=null),c.state=null,Ht}(this.strm),this.onEnd(s),this.ended=!0,s===Ht):o!==mi||(this.onEnd(Ht),n.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===Ht&&(this.result=z2(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}var so=[0,1,3,7,15,31,63,127,255],ni=function(r){this.stream=r,this.bitOffset=0,this.curByte=0,this.hasByte=!1};ni.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},ni.prototype.read=function(r){for(var e=0;r>0;){this._ensureByte();var t=8-this.bitOffset;if(r>=t)e<<=t,e|=so[t]&this.curByte,this.hasByte=!1,this.bitOffset=0,r-=t;else{e<<=r;var n=t-r;e|=(this.curByte&so[r]<>n,this.bitOffset+=r,r=0}}return e},ni.prototype.seek=function(r){var e=r%8,t=(r-e)/8;this.bitOffset=e,this.stream.seek(t),this.hasByte=!1},ni.prototype.pi=function(){var r,e=new Uint8Array(6);for(r=0;r("00"+n.toString(16)).slice(-2)).join("")}(e)};var F3=ni,Wr=function(){};Wr.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},Wr.prototype.read=function(r,e,t){for(var n=0;n>>0},this.updateCRC=function(e){r=r<<8^ms[255&(r>>>24^e)]},this.updateCRCRun=function(e,t){for(;t-- >0;)r=r<<8^ms[255&(r>>>24^e)]}}),oo=function(r,e){var t,n=r[e];for(t=e;t>0;t--)r[t]=r[t-1];return r[0]=n,n},Qt={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},Dr={};Dr[Qt.LAST_BLOCK]="Bad file checksum",Dr[Qt.NOT_BZIP_DATA]="Not bzip data",Dr[Qt.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",Dr[Qt.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",Dr[Qt.DATA_ERROR]="Data error",Dr[Qt.OUT_OF_MEMORY]="Out of memory",Dr[Qt.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var ce=function(r,e){var t=Dr[r]||"unknown error";e&&(t+=": "+e);var n=new TypeError(t);throw n.errorCode=r,n},ii=function(r,e){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(r,e)};ii.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new H3,!0):(this.writeCount=-1,!1)},ii.prototype._start_bunzip=function(r,e){var t=new Uint8Array(4);r.read(t,0,4)===4&&String.fromCharCode(t[0],t[1],t[2])==="BZh"||ce(Qt.NOT_BZIP_DATA,"bad magic");var n=t[3]-48;(n<1||n>9)&&ce(Qt.NOT_BZIP_DATA,"level out of range"),this.reader=new F3(r),this.dbufSize=1e5*n,this.nextoutput=0,this.outputStream=e,this.streamCRC=0},ii.prototype._get_next_block=function(){var r,e,t,n=this.reader,i=n.pi();if(i==="177245385090")return!1;i!=="314159265359"&&ce(Qt.NOT_BZIP_DATA),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&ce(Qt.OBSOLETE_INPUT);var a=n.read(24);a>this.dbufSize&&ce(Qt.DATA_ERROR,"initial position out of bounds");var s=n.read(16),o=new Uint8Array(256),u=0;for(r=0;r<16;r++)if(s&1<<15-r){var c=16*r;for(t=n.read(16),e=0;e<16;e++)t&1<<15-e&&(o[u++]=c+e)}var h=n.read(3);(h<2||h>6)&&ce(Qt.DATA_ERROR);var l=n.read(15);l===0&&ce(Qt.DATA_ERROR);var w=new Uint8Array(256);for(r=0;r=h&&ce(Qt.DATA_ERROR);y[r]=oo(w,e)}var K,C=u+2,M=[];for(e=0;e20)&&ce(Qt.DATA_ERROR),n.read(1);)n.read(1)?s--:s++;F[r]=s}for(H=Q=F[0],r=1;rQ?Q=F[r]:F[r]=l&&ce(Qt.DATA_ERROR),K=M[y[tt++]]),r=K.minLen,e=n.read(r);r>K.maxLen&&ce(Qt.DATA_ERROR),!(e<=K.limit[r]);r++)e=e<<1|n.read(1);((e-=K.base[r])<0||e>=258)&&ce(Qt.DATA_ERROR);var dt=K.permute[e];if(dt!==0&&dt!==1){if(G)for(G=0,Z+s>this.dbufSize&&ce(Qt.DATA_ERROR),q[j=o[w[0]]]+=s;s--;)rt[Z++]=j;if(dt>u)break;Z>=this.dbufSize&&ce(Qt.DATA_ERROR),q[j=o[j=oo(w,r=dt-1)]]++,rt[Z++]=j}else G||(G=1,s=0),s+=dt===0?G:2*G,G<<=1}for((a<0||a>=Z)&&ce(Qt.DATA_ERROR),e=0,r=0;r<256;r++)t=e+q[r],q[r]=e,e=t;for(r=0;r>=8,ft=-1),this.writePos=it,this.writeCurrent=O,this.writeCount=Z,this.writeRun=ft,!0},ii.prototype._read_bunzip=function(r,e){var t,n,i;if(this.writeCount<0)return 0;var a=this.dbuf,s=this.writePos,o=this.writeCurrent,u=this.writeCount;this.outputsize;for(var c=this.writeRun;u;){for(u--,n=o,o=255&(s=a[s]),s>>=8,c++==3?(t=o,i=n,o=-1):(t=1,i=o),this.blockCRC.updateCRCRun(i,t);t--;)this.outputStream.writeByte(i),this.nextoutput++;o!=n&&(c=0)}return this.writeCount=u,this.blockCRC.getCRC()!==this.targetBlockCRC&&ce(Qt.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var $3=function(r){if("readByte"in r)return r;var e=new rc;return e.pos=0,e.readByte=function(){return r[this.pos++]},e.seek=function(t){this.pos=t},e.eof=function(){return this.pos>=r.length},e},q3=function(r){var e=new rc,t=!0;if(r)if(typeof r=="number")e.buffer=new Uint8Array(r),t=!1;else{if("writeByte"in r)return r;e.buffer=r,t=!1}else e.buffer=new Uint8Array(16384);return e.pos=0,e.writeByte=function(n){if(t&&this.pos>=this.buffer.length){var i=new Uint8Array(2*this.buffer.length);i.set(this.buffer),this.buffer=i}this.buffer[this.pos++]=n},e.getBuffer=function(){if(this.pos!==this.buffer.length){if(!t)throw new TypeError("outputsize does not match decoded input");var n=new Uint8Array(this.pos);n.set(this.buffer.subarray(0,this.pos)),this.buffer=n}return this.buffer},e._coerced=!0,e},co=function(r,e,t){for(var n=$3(r),i=q3(e),a=new ii(n,i);!("eof"in n)||!n.eof();)if(a._init_block())a._read_bunzip();else{var s=a.reader.read(32)>>>0;if(s!==a.streamCRC&&ce(Qt.DATA_ERROR,"Bad stream CRC (got "+a.streamCRC.toString(16)+" expected "+s.toString(16)+")"),!t||!("eof"in n)||n.eof())break;a._start_bunzip(n,i)}if("getBuffer"in i)return i.getBuffer()};const jn=Symbol("verified"),j3=new Set([p.signatureSubpacket.issuer,p.signatureSubpacket.issuerFingerprint,p.signatureSubpacket.embeddedSignature]);class wr{static get tag(){return p.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new xn,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[jn]=null}read(e){let t=0;if(this.version=e[t++],this.version!==4&&this.version!==5)throw new re(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[t++],this.publicKeyAlgorithm=e[t++],this.hashAlgorithm=e[t++],t+=this.readSubPackets(e.subarray(t,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,t),t+=this.readSubPackets(e.subarray(t,e.length),!1),this.signedHashValue=e.subarray(t,t+2),t+=2,this.params=Tt.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(t,e.length))}writeParams(){return this.params instanceof Promise?Ei(async()=>Tt.serializeParams(this.publicKeyAlgorithm,await this.params)):Tt.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),e.push(this.writeParams()),_.concat(e)}async sign(e,t,n=new Date,i=!1){e.version===5?this.version=5:this.version=4;const a=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=_.normalizeDate(n),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),a.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=_.concat(a);const s=this.toHash(this.signatureType,t,i),o=await this.hash(this.signatureType,t,s,i);this.signedHashValue=_e(ra(o),0,2);const u=async()=>Tt.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,s,await sr(o));_.isStream(o)?this.params=u():(this.params=await u(),this[jn]=!0)}writeHashedSubPackets(){const e=p.signatureSubpacket,t=[];let n;if(this.created===null)throw Error("Missing signature creation time");t.push(Vt(e.signatureCreationTime,!0,_.writeDate(this.created))),this.signatureExpirationTime!==null&&t.push(Vt(e.signatureExpirationTime,!0,_.writeNumber(this.signatureExpirationTime,4))),this.exportable!==null&&t.push(Vt(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),this.trustLevel!==null&&(n=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Vt(e.trustSignature,!0,n))),this.regularExpression!==null&&t.push(Vt(e.regularExpression,!0,this.regularExpression)),this.revocable!==null&&t.push(Vt(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),this.keyExpirationTime!==null&&t.push(Vt(e.keyExpirationTime,!0,_.writeNumber(this.keyExpirationTime,4))),this.preferredSymmetricAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Vt(e.preferredSymmetricAlgorithms,!1,n))),this.revocationKeyClass!==null&&(n=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),n=_.concat([n,this.revocationKeyFingerprint]),t.push(Vt(e.revocationKey,!1,n))),this.issuerKeyID.isNull()||this.issuerKeyVersion===5||t.push(Vt(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach(({name:s,value:o,humanReadable:u,critical:c})=>{n=[new Uint8Array([u?128:0,0,0,0])];const h=_.encodeUTF8(s);n.push(_.writeNumber(h.length,2)),n.push(_.writeNumber(o.length,2)),n.push(h),n.push(o),n=_.concat(n),t.push(Vt(e.notationData,c,n))}),this.preferredHashAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Vt(e.preferredHashAlgorithms,!1,n))),this.preferredCompressionAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Vt(e.preferredCompressionAlgorithms,!1,n))),this.keyServerPreferences!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.keyServerPreferences)),t.push(Vt(e.keyServerPreferences,!1,n))),this.preferredKeyServer!==null&&t.push(Vt(e.preferredKeyServer,!1,_.encodeUTF8(this.preferredKeyServer))),this.isPrimaryUserID!==null&&t.push(Vt(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),this.policyURI!==null&&t.push(Vt(e.policyURI,!1,_.encodeUTF8(this.policyURI))),this.keyFlags!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.keyFlags)),t.push(Vt(e.keyFlags,!0,n))),this.signersUserID!==null&&t.push(Vt(e.signersUserID,!1,_.encodeUTF8(this.signersUserID))),this.reasonForRevocationFlag!==null&&(n=_.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Vt(e.reasonForRevocation,!0,n))),this.features!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.features)),t.push(Vt(e.features,!1,n))),this.signatureTargetPublicKeyAlgorithm!==null&&(n=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],n.push(_.stringToUint8Array(this.signatureTargetHash)),n=_.concat(n),t.push(Vt(e.signatureTarget,!0,n))),this.embeddedSignature!==null&&t.push(Vt(e.embeddedSignature,!0,this.embeddedSignature.write())),this.issuerFingerprint!==null&&(n=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],n=_.concat(n),t.push(Vt(e.issuerFingerprint,this.version===5,n))),this.preferredAEADAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Vt(e.preferredAEADAlgorithms,!1,n)));const i=_.concat(t),a=_.writeNumber(i.length,2);return _.concat([a,i])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach(i=>{e.push(Ki(i.length)),e.push(i)});const t=_.concat(e),n=_.writeNumber(t.length,2);return _.concat([n,t])}readSubPacket(e,t=!0){let n=0;const i=!!(128&e[n]),a=127&e[n];if(t||(this.unhashedSubpackets.push(e.subarray(n,e.length)),j3.has(a)))switch(n++,a){case p.signatureSubpacket.signatureCreationTime:this.created=_.readDate(e.subarray(n,e.length));break;case p.signatureSubpacket.signatureExpirationTime:{const s=_.readNumber(e.subarray(n,e.length));this.signatureNeverExpires=s===0,this.signatureExpirationTime=s;break}case p.signatureSubpacket.exportableCertification:this.exportable=e[n++]===1;break;case p.signatureSubpacket.trustSignature:this.trustLevel=e[n++],this.trustAmount=e[n++];break;case p.signatureSubpacket.regularExpression:this.regularExpression=e[n];break;case p.signatureSubpacket.revocable:this.revocable=e[n++]===1;break;case p.signatureSubpacket.keyExpirationTime:{const s=_.readNumber(e.subarray(n,e.length));this.keyExpirationTime=s,this.keyNeverExpires=s===0;break}case p.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.revocationKey:this.revocationKeyClass=e[n++],this.revocationKeyAlgorithm=e[n++],this.revocationKeyFingerprint=e.subarray(n,n+20);break;case p.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(n,e.length));break;case p.signatureSubpacket.notationData:{const s=!!(128&e[n]);n+=4;const o=_.readNumber(e.subarray(n,n+2));n+=2;const u=_.readNumber(e.subarray(n,n+2));n+=2;const c=_.decodeUTF8(e.subarray(n,n+o)),h=e.subarray(n+o,n+o+u);this.rawNotations.push({name:c,humanReadable:s,value:h,critical:i}),s&&(this.notations[c]=_.decodeUTF8(h));break}case p.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.primaryUserID:this.isPrimaryUserID=e[n++]!==0;break;case p.signatureSubpacket.policyURI:this.policyURI=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.signersUserID:this.signersUserID=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[n++],this.reasonForRevocationString=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.features:this.features=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[n++],this.signatureTargetHashAlgorithm=e[n++];const s=Tt.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=_.uint8ArrayToString(e.subarray(n,n+s));break}case p.signatureSubpacket.embeddedSignature:this.embeddedSignature=new wr,this.embeddedSignature.read(e.subarray(n,e.length));break;case p.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[n++],this.issuerFingerprint=e.subarray(n,e.length),this.issuerKeyVersion===5?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case p.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(n,e.length)];break;default:{const s=Error("Unknown signature subpacket type "+a);if(i)throw s;_.printDebug(s)}}}readSubPackets(e,t=!0,n){const i=_.readNumber(e.subarray(0,2));let a=2;for(;a<2+i;){const s=_2(e.subarray(a,e.length));a+=s.offset,this.readSubPacket(e.subarray(a,a+s.len),t,n),a+=s.len}return a}toSign(e,t){const n=p.signature;switch(e){case n.binary:return t.text!==null?_.encodeUTF8(t.getText(!0)):t.getBytes(!0);case n.text:{const i=t.getBytes(!0);return _.canonicalizeEOL(i)}case n.standalone:return new Uint8Array(0);case n.certGeneric:case n.certPersona:case n.certCasual:case n.certPositive:case n.certRevocation:{let i,a;if(t.userID)a=180,i=t.userID;else{if(!t.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");a=209,i=t.userAttribute}const s=i.write();return _.concat([this.toSign(n.key,t),new Uint8Array([a]),_.writeNumber(s.length,4),s])}case n.subkeyBinding:case n.subkeyRevocation:case n.keyBinding:return _.concat([this.toSign(n.key,t),this.toSign(n.key,{key:t.bind})]);case n.key:if(t.key===void 0)throw Error("Key packet is required for this signature.");return t.key.writeForHash(this.version);case n.keyRevocation:return this.toSign(n.key,t);case n.timestamp:return new Uint8Array(0);case n.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,t){let n=0;return Yt(ra(this.signatureData),i=>{n+=i.length},()=>{const i=[];return this.version!==5||this.signatureType!==p.signature.binary&&this.signatureType!==p.signature.text||(t?i.push(new Uint8Array(6)):i.push(e.writeHeader())),i.push(new Uint8Array([this.version,255])),this.version===5&&i.push(new Uint8Array(4)),i.push(_.writeNumber(n,4)),_.concat(i)})}toHash(e,t,n=!1){const i=this.toSign(e,t);return _.concat([i,this.signatureData,this.calculateTrailer(t,n)])}async hash(e,t,n,i=!1){return n||(n=this.toHash(e,t,i)),Tt.hash.digest(this.hashAlgorithm,n)}async verify(e,t,n,i=new Date,a=!1,s=vt){if(!this.issuerKeyID.equals(e.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const o=t===p.signature.binary||t===p.signature.text;if(!(this[jn]&&!o)){let c,h;if(this.hashed?h=await this.hashed:(c=this.toHash(t,n,a),h=await this.hash(t,n,c)),h=await sr(h),this.signedHashValue[0]!==h[0]||this.signedHashValue[1]!==h[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[jn]=await Tt.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,c,h),!this[jn])throw Error("Signature verification failed")}const u=_.normalizeDate(i);if(u&&this.created>u)throw Error("Signature creation time is in the future");if(u&&u>=this.getExpirationTime())throw Error("Signature is expired");if(s.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+p.read(p.hash,this.hashAlgorithm).toUpperCase());if(s.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[p.signature.binary,p.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+p.read(p.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach(({name:c,critical:h})=>{if(h&&s.knownNotations.indexOf(c)<0)throw Error("Unknown critical notation: "+c)}),this.revocationKeyClass!==null)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const t=_.normalizeDate(e);return t!==null&&!(this.created<=t&&twr.prototype.calculateTrailer.apply(await this.correspondingSig,e))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==p.packet.signature)throw Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}}function G3(r,e){if(!e[r]){let t;try{t=p.read(p.packet,r)}catch{throw new re("Unknown packet type with tag: "+r)}throw Error("Packet not allowed in this context: "+t)}return new e[r]}ws.prototype.hash=wr.prototype.hash,ws.prototype.toHash=wr.prototype.toHash,ws.prototype.toSign=wr.prototype.toSign;class Ce extends Array{static async fromBinary(e,t,n=vt){const i=new Ce;return await i.read(e,t,n),i}async read(e,t,n=vt){n.additionalAllowedPackets.length&&(t={...t,..._.constructAllowedPackets(n.additionalAllowedPackets)}),this.stream=gi(e,async(a,s)=>{const o=Oe(s);try{for(;;)if(await o.ready,await qu(a,async u=>{try{if(u.tag===p.packet.marker||u.tag===p.packet.trust)return;const c=G3(u.tag,t);c.packets=new Ce,c.fromStream=_.isStream(u.packet),await c.read(u.packet,n),await o.write(c)}catch(c){const h=!n.ignoreUnsupportedPackets&&c instanceof re,l=!(n.ignoreMalformedPackets||c instanceof re);if(h||l||Zi(u.tag))await o.abort(c);else{const w=new Ts(u.tag,u.packet);await o.write(w)}_.printDebugError(c)}}))return await o.ready,void await o.close()}catch(u){await o.abort(u)}});const i=on(this.stream);for(;;){const{done:a,value:s}=await i.read();if(a?this.stream=null:this.push(s),a||Zi(s.constructor.tag))break}i.releaseLock()}write(){const e=[];for(let t=0;t{if(a.push(u),s+=u.length,s>=o){const c=Math.min(Math.log(s)/Math.LN2|0,30),h=2**c,l=_.concat([$u(c)].concat(a));return a=[l.subarray(1+h)],s=a[0].length,l.subarray(0,1+h)}},()=>_.concat([Ki(s)].concat(a))))}else{if(_.isStream(i)){let a=0;e.push(Yt(ra(i),s=>{a+=s.length},()=>a0(n,a)))}else e.push(a0(n,i.length));e.push(i)}}return _.concat(e)}filterByTag(...e){const t=new Ce,n=i=>a=>i===a;for(let i=0;it.constructor.tag===e)}indexOfTag(...e){const t=[],n=this,i=a=>s=>a===s;for(let a=0;asr(n).then(i=>new Promise((a,s)=>{r(i,t,(o,u)=>{if(o)return s(o);a(u)})}))):Ka(Zo(n).pipe(e(t)))}}function lo(r,e={}){return function(t){const n=new r(e);return Yt(t,i=>{if(i.length)return n.push(i,mi),n.result},()=>{if(r===S3)return n.push([],oe),n.result})}}function fo(r){return function(e){return Ei(async()=>r(await sr(e)))}}Gn&&(Gn.inflateRaw,Gn.createInflateRaw,Gn.inflate,Gn.createInflate);class bs{constructor(e=vt){this.algorithm=p.hash.sha256,this.type="iterated",this.c=e.s2kIterationCountByte,this.salt=null}getCount(){return 16+(15&this.c)<<6+(this.c>>4)}read(e){let t=0;try{this.type=p.read(p.s2k,e[t++])}catch{throw new re("Unknown S2K type.")}switch(this.algorithm=e[t++],this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if(_.uint8ArrayToString(e.subarray(t,t+3))!=="GNU")throw new re("Unknown s2k type.");if(t+=3,1e3+e[t++]!==1001)throw new re("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new re("Unknown s2k type.")}return t}write(){if(this.type==="gnu-dummy")return new Uint8Array([101,0,..._.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([p.write(p.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return _.concatUint8Array(e)}async produceKey(e,t){e=_.encodeUTF8(e);const n=[];let i=0,a=0;for(;i{this.privateParams[e].fill(0),delete this.privateParams[e]}),this.privateParams=null,this.isEncrypted=!0)}}async function yo(r,e,t){const{keySize:n}=Tt.getCipher(t);return r.produceKey(e,n)}var W3=Ys(function(r){(function(e){function t(i){function a(){return Et0&&(et.semantic=" "),et}}function F(J,et){return function(){var ut,wt,kt,Ut,At;for(Ut=s(),ut=c("star"),kt=0,At=et===void 0?0:et;(wt=J())!==null;)kt+=1,l(ut,wt);return kt>=At?ut:(o(Ut),null)}}function E(J){return J.charCodeAt(0)>=128}function W(){return h("cr",y("\r")())}function q(){return h("crlf",K(W,Z)())}function j(){return h("dquote",y('"')())}function G(){return h("htab",y(" ")())}function Z(){return h("lf",y(` -`)())}function tt(){return h("sp",y(" ")())}function rt(){return h("vchar",w(function(J){var et=J.charCodeAt(0),ut=33<=et&&et<=126;return i.rfc6532&&(ut=ut||E(J)),ut}))}function dt(){return h("wsp",C(tt,G)())}function it(){var J=h("quoted-pair",C(K(y("\\"),C(rt,dt)),D)());return J===null?null:(J.semantic=J.semantic[1],J)}function O(){return h("fws",C(T,K(M(K(F(dt),H(q))),F(dt,1)))())}function ft(){return h("ctext",C(function(){return w(function(J){var et=J.charCodeAt(0),ut=33<=et&&et<=39||42<=et&&et<=91||93<=et&&et<=126;return i.rfc6532&&(ut=ut||E(J)),ut})},lt)())}function Pt(){return h("ccontent",C(ft,it,$)())}function $(){return h("comment",K(y("("),F(K(M(O),Pt)),M(O),y(")"))())}function at(){return h("cfws",C(K(F(K(M(O),$),1),M(O)),O)())}function mt(){return h("atext",w(function(J){var et="a"<=J&&J<="z"||"A"<=J&&J<="Z"||"0"<=J&&J<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(J)>=0;return i.rfc6532&&(et=et||E(J)),et}))}function bt(){return h("atom",K(Q(M(at)),F(mt,1),Q(M(at)))())}function yt(){var J,et;return(J=h("dot-atom-text",F(mt,1)()))===null||(et=F(K(y("."),F(mt,1)))())!==null&&l(J,et),J}function pt(){return h("dot-atom",K(H(M(at)),yt,H(M(at)))())}function gt(){return h("qtext",C(function(){return w(function(J){var et=J.charCodeAt(0),ut=et===33||35<=et&&et<=91||93<=et&&et<=126;return i.rfc6532&&(ut=ut||E(J)),ut})},I)())}function ct(){return h("qcontent",C(gt,it)())}function S(){return h("quoted-string",K(H(M(at)),H(j),F(K(M(Q(O)),ct)),M(H(O)),H(j),H(M(at)))())}function N(){return h("word",C(bt,S)())}function b(){return h("address",C(f,X)())}function f(){return h("mailbox",C(U,ht)())}function U(){return h("name-addr",K(M(Y),V)())}function V(){return h("angle-addr",C(K(H(M(at)),y("<"),ht,y(">"),H(M(at))),R)())}function X(){return h("group",K(Y,y(":"),M(m),y(";"),H(M(at)))())}function Y(){return h("display-name",((J=h("phrase",C(x,F(N,1))()))!==null&&(J.semantic=function(et){return et.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(J.semantic)),J));var J}function g(){return h("mailbox-list",C(K(f,F(K(y(","),f))),k)())}function d(){return h("address-list",C(K(b,F(K(y(","),b))),nt)())}function m(){return h("group-list",C(g,H(at),st)())}function A(){return h("local-part",C(St,pt,S)())}function B(){return h("dtext",C(function(){return w(function(J){var et=J.charCodeAt(0),ut=33<=et&&et<=90||94<=et&&et<=126;return i.rfc6532&&(ut=ut||E(J)),ut})},zt)())}function P(){return h("domain-literal",K(H(M(at)),y("["),F(K(M(O),B)),M(O),y("]"),H(M(at)))())}function z(){return h("domain",(J=C(It,pt,P)(),i.rejectTLD&&J&&J.semantic&&J.semantic.indexOf(".")<0?null:(J&&(J.semantic=J.semantic.replace(/\s+/g,"")),J)));var J}function ht(){return h("addr-spec",K(A,y("@"),z)())}function ot(){return i.strict?null:h("obs-NO-WS-CTL",w(function(J){var et=J.charCodeAt(0);return 1<=et&&et<=8||et===11||et===12||14<=et&&et<=31||et===127}))}function lt(){return i.strict?null:h("obs-ctext",ot())}function I(){return i.strict?null:h("obs-qtext",ot())}function D(){return i.strict?null:h("obs-qp",K(y("\\"),C(y("\0"),ot,Z,W))())}function x(){return i.strict?null:i.atInDisplayName?h("obs-phrase",K(N,F(C(N,y("."),y("@"),Q(at))))()):h("obs-phrase",K(N,F(C(N,y("."),Q(at))))())}function T(){return i.strict?null:h("obs-FWS",F(K(H(M(q)),dt),1)())}function R(){return i.strict?null:h("obs-angle-addr",K(H(M(at)),y("<"),L,ht,y(">"),H(M(at)))())}function L(){return i.strict?null:h("obs-route",K(v,y(":"))())}function v(){return i.strict?null:h("obs-domain-list",K(F(C(H(at),y(","))),y("@"),z,F(K(y(","),H(M(at)),M(K(y("@"),z)))))())}function k(){return i.strict?null:h("obs-mbox-list",K(F(K(H(M(at)),y(","))),f,F(K(y(","),M(K(f,H(at))))))())}function nt(){return i.strict?null:h("obs-addr-list",K(F(K(H(M(at)),y(","))),b,F(K(y(","),M(K(b,H(at))))))())}function st(){return i.strict?null:h("obs-group-list",K(F(K(H(M(at)),y(",")),1),H(M(at)))())}function St(){return i.strict?null:h("obs-local-part",K(N,F(K(y("."),N)))())}function It(){return i.strict?null:h("obs-domain",K(bt,F(K(y("."),bt)))())}function zt(){return i.strict?null:h("obs-dtext",C(ot,it)())}function Dt(J,et){var ut,wt,kt;if(et==null)return null;for(wt=[et];wt.length>0;){if((kt=wt.pop()).name===J)return kt;for(ut=kt.children.length-1;ut>=0;ut-=1)wt.push(kt.children[ut])}return null}function Wt(J,et){var ut,wt,kt,Ut,At;if(et==null)return null;for(wt=[et],Ut=[],At={},ut=0;ut0;)if((kt=wt.pop()).name in At)Ut.push(kt);else for(ut=kt.children.length-1;ut>=0;ut-=1)wt.push(kt.children[ut]);return Ut}function Xt(J){var et,ut,wt,kt,Ut;if(J===null)return null;for(et=[],ut=Wt(["group","mailbox"],J),wt=0;wt1?null:At.addresses&&At.addresses[0]}(Ut):i.simple?Ut&&Ut.addresses:Ut}function Jt(J){var et,ut=Dt("display-name",J),wt=[],kt=Wt(["mailbox"],J);for(et=0;et0;)for((Ie=xe.pop()).name===Nt&&Ne.push(Ie),De=Ie.children.length-1;De>=0;De-=1)xe.push(Ie.children[De]);return Ne}("cfws",J),kt=Wt(["comment"],J),Ut=Dt("local-part",ut),At=Dt("domain",ut);return{node:J,parts:{name:et,address:ut,local:Ut,domain:At,comments:wt},type:J.name,name:Ct(et),address:Ct(ut),local:Ct(Ut),domain:Ct(At),comments:Mt(kt),groupName:Ct(J.groupName)}}function Ct(J){return J!=null?J.semantic:null}function Mt(J){var et="";if(J)for(var ut=0;ut`),t.userID=n.join(" "),t}read(e,t=vt){const n=_.decodeUTF8(e);if(n.length>t.maxUserIDLength)throw Error("User ID string is too long");try{const{name:i,address:a,comments:s}=W3.parseOneAddress({input:n,atInDisplayName:!0});this.comment=s.replace(/^\(|\)$/g,""),this.name=i,this.email=a}catch{}this.userID=n}write(){return _.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class l1 extends h1{static get tag(){return p.packet.secretSubkey}constructor(e=new Date,t=vt){super(e,t)}}async function nc(r,e){const t=new l1(r.date,e);return t.packets=null,t.algorithm=p.write(p.publicKey,r.algorithm),await t.generate(r.rsaBits,r.curve),await t.computeFingerprintAndKeyID(),t}async function V3(r,e){const t=new h1(r.date,e);return t.packets=null,t.algorithm=p.write(p.publicKey,r.algorithm),await t.generate(r.rsaBits,r.curve,r.config),await t.computeFingerprintAndKeyID(),t}async function ze(r,e,t,n,i=new Date,a){let s,o;for(let u=r.length-1;u>=0;u--)try{(!s||r[u].created>=s.created)&&(await r[u].verify(e,t,n,i,void 0,a),s=r[u])}catch(c){o=c}if(!s)throw _.wrapError(`Could not find valid ${p.read(p.signature,t)} signature in key ${e.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,(u,c,h)=>c+" "+h.toLowerCase()),o);return s}function Ms(r,e,t=new Date){const n=_.normalizeDate(t);if(n!==null){const i=ka(r,e);return!(r.created<=n&&n0&&(a.keyExpirationTime=t.keyExpirationTime,a.keyNeverExpires=!1),await Fr(i,null,e,a,t.date,void 0,void 0,void 0,n)}async function Z3(r,e,t=new Date,n={},i){let a=i.preferredHashAlgorithm,s=a;if(r){const o=await r.getPrimaryUser(t,n,i);o.selfCertification.preferredHashAlgorithms&&([s]=o.selfCertification.preferredHashAlgorithms,a=Tt.hash.getHashByteLength(a)<=Tt.hash.getHashByteLength(s)?s:a)}switch(e.algorithm){case p.publicKey.ecdsa:case p.publicKey.eddsaLegacy:case p.publicKey.ed25519:s=Tt.getPreferredCurveHashAlgo(e.algorithm,e.publicParams.oid)}return Tt.hash.getHashByteLength(a)<=Tt.hash.getHashByteLength(s)?s:a}async function Fr(r,e,t,n,i,a,s=[],o=!1,u){if(t.isDummy())throw Error("Cannot sign with a gnu-dummy key.");if(!t.isDecrypted())throw Error("Signing key is not decrypted.");const c=new wr;return Object.assign(c,n),c.publicKeyAlgorithm=t.algorithm,c.hashAlgorithm=await Z3(e,t,i,a,u),c.rawNotations=s,await c.sign(t,r,i,o),c}async function nn(r,e,t,n=new Date,i){(r=r[t])&&(e[t].length?await Promise.all(r.map(async function(a){a.isExpired(n)||i&&!await i(a)||e[t].some(function(s){return _.equalsUint8Array(s.writeParams(),a.writeParams())})||e[t].push(a)})):e[t]=r)}async function Bn(r,e,t,n,i,a,s=new Date,o){a=a||r;const u=[];return await Promise.all(n.map(async function(c){try{i&&!c.issuerKeyID.equals(i.issuerKeyID)||(await c.verify(a,e,t,o.revocationsExpire?s:null,!1,o),u.push(c.issuerKeyID))}catch{}})),i?(i.revoked=!!u.some(c=>c.equals(i.issuerKeyID))||i.revoked||!1,i.revoked):u.length>0}function ka(r,e){let t;return e.keyNeverExpires===!1&&(t=r.created.getTime()+1e3*e.keyExpirationTime),t?new Date(t):1/0}function Ns(r,e={}){switch(r.type=r.type||e.type,r.curve=r.curve||e.curve,r.rsaBits=r.rsaBits||e.rsaBits,r.keyExpirationTime=r.keyExpirationTime!==void 0?r.keyExpirationTime:e.keyExpirationTime,r.passphrase=_.isString(r.passphrase)?r.passphrase:e.passphrase,r.date=r.date||e.date,r.sign=r.sign||!1,r.type){case"ecc":try{r.curve=p.write(p.curve,r.curve)}catch{throw Error("Unknown curve")}r.curve!==p.curve.ed25519Legacy&&r.curve!==p.curve.curve25519Legacy||(r.curve=r.sign?p.curve.ed25519Legacy:p.curve.curve25519Legacy),r.sign?r.algorithm=r.curve===p.curve.ed25519Legacy?p.publicKey.eddsaLegacy:p.publicKey.ecdsa:r.algorithm=p.publicKey.ecdh;break;case"rsa":r.algorithm=p.publicKey.rsaEncryptSign;break;default:throw Error("Unsupported key type "+r.type)}return r}function po(r,e){const t=r.algorithm;return t!==p.publicKey.rsaEncrypt&&t!==p.publicKey.elgamal&&t!==p.publicKey.ecdh&&t!==p.publicKey.x25519&&(!e.keyFlags||(e.keyFlags[0]&p.keyFlags.signData)!=0)}function go(r,e){const t=r.algorithm;return t!==p.publicKey.dsa&&t!==p.publicKey.rsaSign&&t!==p.publicKey.ecdsa&&t!==p.publicKey.eddsaLegacy&&t!==p.publicKey.ed25519&&(!e.keyFlags||(e.keyFlags[0]&p.keyFlags.encryptCommunication)!=0||(e.keyFlags[0]&p.keyFlags.encryptStorage)!=0)}function mo(r,e){return!!e.allowInsecureDecryptionWithSigningKeys||!r.keyFlags||(r.keyFlags[0]&p.keyFlags.encryptCommunication)!=0||(r.keyFlags[0]&p.keyFlags.encryptStorage)!=0}function _n(r,e){const t=p.write(p.publicKey,r.algorithm),n=r.getAlgorithmInfo();if(e.rejectPublicKeyAlgorithms.has(t))throw Error(n.algorithm+" keys are considered too weak.");switch(t){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:case p.publicKey.rsaEncrypt:if(n.bitsh.getKeys(u).length>0);return c.length===0?null:(await Promise.all(c.map(async h=>{const l=await h.getSigningKey(u,e.created,void 0,i);if(e.revoked||await a.isRevoked(e,l.keyPacket,n,i))throw Error("User certificate is revoked");try{await e.verify(l.keyPacket,p.signature.certGeneric,o,n,void 0,i)}catch(w){throw _.wrapError("User certificate is invalid",w)}})),!0)}async verifyAllCertifications(e,t=new Date,n){const i=this,a=this.selfCertifications.concat(this.otherCertifications);return Promise.all(a.map(async s=>({keyID:s.issuerKeyID,valid:await i.verifyCertificate(s,e,t,n).catch(()=>!1)})))}async verify(e=new Date,t){if(!this.selfCertifications.length)throw Error("No self-certifications found");const n=this,i=this.mainKey.keyPacket,a={userID:this.userID,userAttribute:this.userAttribute,key:i};let s;for(let o=this.selfCertifications.length-1;o>=0;o--)try{const u=this.selfCertifications[o];if(u.revoked||await n.isRevoked(u,void 0,e,t))throw Error("Self-certification is revoked");try{await u.verify(i,p.signature.certGeneric,a,e,void 0,t)}catch(c){throw _.wrapError("Self-certification is invalid",c)}return!0}catch(u){s=u}throw s}async update(e,t,n){const i=this.mainKey.keyPacket,a={userID:this.userID,userAttribute:this.userAttribute,key:i};await nn(e,this,"selfCertifications",t,async function(s){try{return await s.verify(i,p.signature.certGeneric,a,t,!1,n),!0}catch{return!1}}),await nn(e,this,"otherCertifications",t),await nn(e,this,"revocationSignatures",t,function(s){return Bn(i,p.signature.certRevocation,a,[s],void 0,void 0,t,n)})}async revoke(e,{flag:t=p.reasonForRevocation.noReason,string:n=""}={},i=new Date,a=vt){const s={userID:this.userID,userAttribute:this.userAttribute,key:e},o=new di(s.userID||s.userAttribute,this.mainKey);return o.revocationSignatures.push(await Fr(s,null,e,{signatureType:p.signature.certRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,t),reasonForRevocationString:n},i,void 0,void 0,!1,a)),await o.update(this),o}}class sn{constructor(e,t){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new Ce;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new sn(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,t,n=new Date,i=vt){const a=this.mainKey.keyPacket;return Bn(a,p.signature.subkeyRevocation,{key:a,bind:this.keyPacket},this.revocationSignatures,e,t,n,i)}async verify(e=new Date,t=vt){const n=this.mainKey.keyPacket,i={key:n,bind:this.keyPacket},a=await ze(this.bindingSignatures,n,p.signature.subkeyBinding,i,e,t);if(a.revoked||await this.isRevoked(a,null,e,t))throw Error("Subkey is revoked");if(Ms(this.keyPacket,a,e))throw Error("Subkey is expired");return a}async getExpirationTime(e=new Date,t=vt){const n=this.mainKey.keyPacket,i={key:n,bind:this.keyPacket};let a;try{a=await ze(this.bindingSignatures,n,p.signature.subkeyBinding,i,e,t)}catch{return null}const s=ka(this.keyPacket,a),o=a.getExpirationTime();return sa.bindingSignatures[u].created&&(a.bindingSignatures[u]=o),!1;try{return await o.verify(i,p.signature.subkeyBinding,s,t,void 0,n),!0}catch{return!1}}),await nn(e,this,"revocationSignatures",t,function(o){return Bn(i,p.signature.subkeyRevocation,s,[o],void 0,void 0,t,n)})}async revoke(e,{flag:t=p.reasonForRevocation.noReason,string:n=""}={},i=new Date,a=vt){const s={key:e,bind:this.keyPacket},o=new sn(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await Fr(s,null,e,{signatureType:p.signature.subkeyRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,t),reasonForRevocationString:n},i,void 0,void 0,!1,a)),await o.update(this),o}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach(r=>{sn.prototype[r]=function(){return this.keyPacket[r]()}});const Q3=_.constructAllowedPackets([wr]),wo=new Set([p.packet.publicKey,p.packet.privateKey]),bo=new Set([p.packet.publicKey,p.packet.privateKey,p.packet.publicSubkey,p.packet.privateSubkey]);class ac{packetListToStructure(e,t=new Set){let n,i,a,s;for(const o of e){if(o instanceof Ts){bo.has(o.tag)&&!s&&(s=wo.has(o.tag)?wo:bo);continue}const u=o.constructor.tag;if(s){if(!s.has(u))continue;s=null}if(t.has(u))throw Error("Unexpected packet type: "+u);switch(u){case p.packet.publicKey:case p.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=o,i=this.getKeyID(),!i)throw Error("Missing Key ID");break;case p.packet.userID:case p.packet.userAttribute:n=new di(o,this),this.users.push(n);break;case p.packet.publicSubkey:case p.packet.secretSubkey:n=null,a=new sn(o,this),this.subkeys.push(a);break;case p.packet.signature:switch(o.signatureType){case p.signature.certGeneric:case p.signature.certPersona:case p.signature.certCasual:case p.signature.certPositive:if(!n){_.printDebug("Dropping certification signatures without preceding user packet");continue}o.issuerKeyID.equals(i)?n.selfCertifications.push(o):n.otherCertifications.push(o);break;case p.signature.certRevocation:n?n.revocationSignatures.push(o):this.directSignatures.push(o);break;case p.signature.key:this.directSignatures.push(o);break;case p.signature.subkeyBinding:if(!a){_.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}a.bindingSignatures.push(o);break;case p.signature.keyRevocation:this.revocationSignatures.push(o);break;case p.signature.subkeyRevocation:if(!a){_.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}a.revocationSignatures.push(o)}}}}toPacketList(){const e=new Ce;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map(t=>e.push(...t.toPacketList())),this.subkeys.map(t=>e.push(...t.toPacketList())),e}clone(e=!1){const t=new this.constructor(this.toPacketList());return e&&t.getKeys().forEach(n=>{if(n.keyPacket=Object.create(Object.getPrototypeOf(n.keyPacket),Object.getOwnPropertyDescriptors(n.keyPacket)),!n.keyPacket.isDecrypted())return;const i={};Object.keys(n.keyPacket.privateParams).forEach(a=>{i[a]=new Uint8Array(n.keyPacket.privateParams[a])}),n.keyPacket.privateParams=i}),t}getSubkeys(e=null){return this.subkeys.filter(t=>!e||t.getKeyID().equals(e,!0))}getKeys(e=null){const t=[];return e&&!this.getKeyID().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))}getKeyIDs(){return this.getKeys().map(e=>e.getKeyID())}getUserIDs(){return this.users.map(e=>e.userID?e.userID.userID:null).filter(e=>e!==null)}write(){return this.toPacketList().write()}async getSigningKey(e=null,t=new Date,n={},i=vt){await this.verifyPrimaryKey(t,n,i);const a=this.keyPacket,s=this.subkeys.slice().sort((u,c)=>c.keyPacket.created-u.keyPacket.created);let o;for(const u of s)if(!e||u.getKeyID().equals(e))try{await u.verify(t,i);const c={key:a,bind:u.keyPacket},h=await ze(u.bindingSignatures,a,p.signature.subkeyBinding,c,t,i);if(!po(u.keyPacket,h))continue;if(!h.embeddedSignature)throw Error("Missing embedded signature");return await ze([h.embeddedSignature],u.keyPacket,p.signature.keyBinding,c,t,i),_n(u.keyPacket,i),u}catch(c){o=c}try{const u=await this.getPrimaryUser(t,n,i);if((!e||a.getKeyID().equals(e))&&po(a,u.selfCertification))return _n(a,i),this}catch(u){o=u}throw _.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),o)}async getEncryptionKey(e,t=new Date,n={},i=vt){await this.verifyPrimaryKey(t,n,i);const a=this.keyPacket,s=this.subkeys.slice().sort((u,c)=>c.keyPacket.created-u.keyPacket.created);let o;for(const u of s)if(!e||u.getKeyID().equals(e))try{await u.verify(t,i);const c={key:a,bind:u.keyPacket},h=await ze(u.bindingSignatures,a,p.signature.subkeyBinding,c,t,i);if(go(u.keyPacket,h))return _n(u.keyPacket,i),u}catch(c){o=c}try{const u=await this.getPrimaryUser(t,n,i);if((!e||a.getKeyID().equals(e))&&go(a,u.selfCertification))return _n(a,i),this}catch(u){o=u}throw _.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),o)}async isRevoked(e,t,n=new Date,i=vt){return Bn(this.keyPacket,p.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,t,n,i)}async verifyPrimaryKey(e=new Date,t={},n=vt){const i=this.keyPacket;if(await this.isRevoked(null,null,e,n))throw Error("Primary key is revoked");const{selfCertification:a}=await this.getPrimaryUser(e,t,n);if(Ms(i,a,e))throw Error("Primary key is expired");const s=await ze(this.directSignatures,i,p.signature.key,{key:i},e,n).catch(()=>{});if(s&&Ms(i,s,e))throw Error("Primary key is expired")}async getExpirationTime(e,t=vt){let n;try{const{selfCertification:i}=await this.getPrimaryUser(null,e,t),a=ka(this.keyPacket,i),s=i.getExpirationTime(),o=await ze(this.directSignatures,this.keyPacket,p.signature.key,{key:this.keyPacket},null,t).catch(()=>{});if(o){const u=ka(this.keyPacket,o);n=Math.min(a,s,u)}else n=ae.subkeys.some(s=>a.hasSameFingerprintAs(s)))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,n)}const i=this.clone();return await nn(e,i,"revocationSignatures",t,a=>Bn(i.keyPacket,p.signature.keyRevocation,i,[a],null,e.keyPacket,t,n)),await nn(e,i,"directSignatures",t),await Promise.all(e.users.map(async a=>{const s=i.users.filter(o=>a.userID&&a.userID.equals(o.userID)||a.userAttribute&&a.userAttribute.equals(o.userAttribute));if(s.length>0)await Promise.all(s.map(o=>o.update(a,t,n)));else{const o=a.clone();o.mainKey=i,i.users.push(o)}})),await Promise.all(e.subkeys.map(async a=>{const s=i.subkeys.filter(o=>o.hasSameFingerprintAs(a));if(s.length>0)await Promise.all(s.map(o=>o.update(a,t,n)));else{const o=a.clone();o.mainKey=i,i.subkeys.push(o)}})),i}async getRevocationCertificate(e=new Date,t=vt){const n={key:this.keyPacket},i=await ze(this.revocationSignatures,this.keyPacket,p.signature.keyRevocation,n,e,t),a=new Ce;return a.push(i),Zs(p.armor.publicKey,a.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,n=vt){const i=await r2(e,n),a=(await Ce.fromBinary(i.data,Q3,n)).findPacket(p.packet.signature);if(!a||a.signatureType!==p.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!a.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await a.verify(this.keyPacket,p.signature.keyRevocation,{key:this.keyPacket},t,void 0,n)}catch(o){throw _.wrapError("Could not verify revocation signature",o)}const s=this.clone();return s.revocationSignatures.push(a),s}async signPrimaryUser(e,t,n,i=vt){const{index:a,user:s}=await this.getPrimaryUser(t,n,i),o=await s.certify(e,t,i),u=this.clone();return u.users[a]=o,u}async signAllUsers(e,t=new Date,n=vt){const i=this.clone();return i.users=await Promise.all(this.users.map(function(a){return a.certify(e,t,n)})),i}async verifyPrimaryUser(e,t=new Date,n,i=vt){const a=this.keyPacket,{user:s}=await this.getPrimaryUser(t,n,i);return e?await s.verifyAllCertifications(e,t,i):[{keyID:a.getKeyID(),valid:await s.verify(t,i).catch(()=>!1)}]}async verifyAllUsers(e,t=new Date,n=vt){const i=this.keyPacket,a=[];return await Promise.all(this.users.map(async s=>{const o=e?await s.verifyAllCertifications(e,t,n):[{keyID:i.getKeyID(),valid:await s.verify(t,n).catch(()=>!1)}];a.push(...o.map(u=>({userID:s.userID?s.userID.userID:null,userAttribute:s.userAttribute,keyID:u.keyID,valid:u.valid})))})),a}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach(r=>{ac.prototype[r]=sn.prototype[r]});class ko extends ac{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([p.packet.secretKey,p.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=vt){return Zs(p.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class Oa extends ko{constructor(e){if(super(),this.packetListToStructure(e,new Set([p.packet.publicKey,p.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new Ce,t=this.toPacketList();for(const n of t)switch(n.constructor.tag){case p.packet.secretKey:{const i=Ye.fromSecretKeyPacket(n);e.push(i);break}case p.packet.secretSubkey:{const i=za.fromSecretSubkeyPacket(n);e.push(i);break}default:e.push(n)}return new ko(e)}armor(e=vt){return Zs(p.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,t=new Date,n={},i=vt){const a=this.keyPacket,s=[];for(let u=0;ue.isDecrypted())}async validate(e=vt){if(!this.isPrivate())throw Error("Cannot validate a public key");let t;if(this.keyPacket.isDummy()){const n=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});n&&!n.keyPacket.isDummy()&&(t=n.keyPacket)}else t=this.keyPacket;if(t)return t.validate();{const n=this.getKeys();if(n.map(i=>i.keyPacket.isDummy()).every(Boolean))throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(n.map(async i=>i.keyPacket.validate()))}}clearPrivateParams(){this.getKeys().forEach(({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()})}async revoke({flag:e=p.reasonForRevocation.noReason,string:t=""}={},n=new Date,i=vt){if(!this.isPrivate())throw Error("Need private key for revoking");const a={key:this.keyPacket},s=this.clone();return s.revocationSignatures.push(await Fr(a,null,this.keyPacket,{signatureType:p.signature.keyRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,e),reasonForRevocationString:t},n,void 0,void 0,void 0,i)),s}async addSubkey(e={}){const t={...vt,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBitsK!==y)]}const c=La.fromObject(s),h={};h.userID=c,h.key=r;const l={};return l.signatureType=p.signature.certGeneric,l.keyFlags=[p.keyFlags.certifyKeys|p.keyFlags.signData],l.preferredSymmetricAlgorithms=u([p.symmetric.aes256,p.symmetric.aes128,p.symmetric.aes192],n.preferredSymmetricAlgorithm),n.aeadProtect&&(l.preferredAEADAlgorithms=u([p.aead.eax,p.aead.ocb],n.preferredAEADAlgorithm)),l.preferredHashAlgorithms=u([p.hash.sha256,p.hash.sha512],n.preferredHashAlgorithm),l.preferredCompressionAlgorithms=u([p.compression.zlib,p.compression.zip,p.compression.uncompressed],n.preferredCompressionAlgorithm),o===0&&(l.isPrimaryUserID=!0),l.features=[0],l.features[0]|=p.features.modificationDetection,n.aeadProtect&&(l.features[0]|=p.features.aead),n.v5Keys&&(l.features[0]|=p.features.v5Keys),t.keyExpirationTime>0&&(l.keyExpirationTime=t.keyExpirationTime,l.keyNeverExpires=!1),{userIDPacket:c,signaturePacket:await Fr(h,null,r,l,t.date,void 0,void 0,void 0,n)}})).then(s=>{s.forEach(({userIDPacket:o,signaturePacket:u})=>{i.push(o),i.push(u)})}),await Promise.all(e.map(async function(s,o){const u=t.subkeys[o];return{secretSubkeyPacket:s,subkeySignaturePacket:await ic(s,r,u,n)}})).then(s=>{s.forEach(({secretSubkeyPacket:o,subkeySignaturePacket:u})=>{i.push(o),i.push(u)})});const a={key:r};return i.push(await Fr(a,null,r,{signatureType:p.signature.keyRevocation,reasonForRevocationFlag:p.reasonForRevocation.noReason,reasonForRevocationString:""},t.date,void 0,void 0,void 0,n)),t.passphrase&&r.clearPrivateParams(),await Promise.all(e.map(async function(s,o){t.subkeys[o].passphrase&&s.clearPrivateParams()})),new Oa(i)}async function oc({armoredKey:r,binaryKey:e,config:t,...n}){if(t={...vt,...t},!r&&!e)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(r&&!_.isString(r))throw Error("readPrivateKey: options.armoredKey must be a string");if(e&&!_.isUint8Array(e))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const i=Object.keys(n);if(i.length>0)throw Error("Unknown option: "+i.join(", "));let a;if(r){const{type:o,data:u}=await r2(r,t);if(o!==p.armor.privateKey)throw Error("Armored text not of type private key");a=u}else a=e;const s=await Ce.fromBinary(a,X3,t);return new Oa(s)}async function Y3({userIDs:r=[],passphrase:e,type:t="ecc",rsaBits:n=4096,curve:i="curve25519",keyExpirationTime:a=0,date:s=new Date,subkeys:o=[{}],format:u="armored",config:c,...h}){uc(c={...vt,...c}),r=hc(r);const l=Object.keys(h);if(l.length>0)throw Error("Unknown option: "+l.join(", "));if(r.length===0)throw Error("UserIDs are required for key generation");if(t==="rsa"&&nNs(C.subkeys[q],C));let H=[V3(C,M)];H=H.concat(C.subkeys.map(W=>nc(W,M)));const Q=await Promise.all(H),F=await sc(Q[0],Q.slice(1),C,M),E=await F.getRevocationCertificate(C.date,M);return F.revocationSignatures=[],{key:F,revocationCertificate:E}}(w,c);return y.getKeys().forEach(({keyPacket:C})=>_n(C,c)),{privateKey:va(y,u,c),publicKey:va(y.toPublic(),u,c),revocationCertificate:K}}catch(y){throw _.wrapError("Error generating keypair",y)}}async function cc({privateKey:r,userIDs:e=[],passphrase:t,keyExpirationTime:n=0,date:i,format:a="armored",config:s,...o}){uc(s={...vt,...s}),e=hc(e);const u=Object.keys(o);if(u.length>0)throw Error("Unknown option: "+u.join(", "));if(e.length===0)throw Error("UserIDs are required for key reformat");const c={privateKey:r,userIDs:e,passphrase:t,keyExpirationTime:n,date:i};try{const{key:h,revocationCertificate:l}=await async function(w,y){w=F(w);const{privateKey:K}=w;if(!K.isPrivate())throw Error("Cannot reformat a public key");if(K.keyPacket.isDummy())throw Error("Cannot reformat a gnu-dummy primary key");if(!K.getKeys().every(({keyPacket:E})=>E.isDecrypted()))throw Error("Key is not decrypted");const C=K.keyPacket;w.subkeys||(w.subkeys=await Promise.all(K.subkeys.map(async E=>{const W=E.keyPacket,q={key:C,bind:W},j=await ze(E.bindingSignatures,C,p.signature.subkeyBinding,q,null,y).catch(()=>({}));return{sign:j.keyFlags&&j.keyFlags[0]&p.keyFlags.signData}})));const M=K.subkeys.map(E=>E.keyPacket);if(w.subkeys.length!==M.length)throw Error("Number of subkey options does not match number of subkeys");w.subkeys=w.subkeys.map(E=>F(E,w));const H=await sc(C,M,w,y),Q=await H.getRevocationCertificate(w.date,y);return H.revocationSignatures=[],{key:H,revocationCertificate:Q};function F(E,W={}){return E.keyExpirationTime=E.keyExpirationTime||W.keyExpirationTime,E.passphrase=_.isString(E.passphrase)?E.passphrase:W.passphrase,E.date=E.date||W.date,E}}(c,s);return{privateKey:va(h,a,s),publicKey:va(h.toPublic(),a,s),revocationCertificate:l}}catch(h){throw _.wrapError("Error reformatting keypair",h)}}const J3=Object.keys(vt).length;function uc(r){const e=Object.keys(r);if(e.length!==J3){for(const t of e)if(vt[t]===void 0)throw Error("Unknown config property: "+t)}}function hc(r){return r&&!_.isArray(r)&&(r=[r]),r}function va(r,e,t){switch(e){case"object":return r;case"armored":return r.armor(t);case"binary":return r.write();default:throw Error("Unsupported format "+e)}}/*! @gera2ld/tarjs v0.3.1 | MIT License */const t6=new TextEncoder,lc=r=>t6.encode(r);new TextDecoder;function e6(r){return typeof r=="string"?lc(r).buffer:r instanceof ArrayBuffer?r:ArrayBuffer.isView(r)?new Uint8Array(r).buffer:r.arrayBuffer()}let Fs=function(r){return r[r.File=0]="File",r[r.Dir=53]="Dir",r}({});class r6{#t;constructor(){this.#t=[]}addFile(e,t,n){const i=e6(t),a=i.byteLength??t.size,s={name:e,type:Fs.File,data:i,size:a,opts:n};this.#t.push(s)}addFolder(e,t){this.#t.push({name:e,type:Fs.Dir,data:null,size:0,opts:t})}async write(){const e=n6(this.#t),t=new Uint8Array(e);let n=0;for(const i of this.#t){i6(e,i.name,n),a6(e,i.type,n),s6(e,i.size,n),y6(e,n,i.opts,i.type),d6(e,n);const a=await i.data;if(a){const s=new Uint8Array(a);t.set(s,n+512)}n+=512+512*Math.floor((i.size+511)/512)}return new Blob([e],{type:"application/x-tar"})}}function n6(r){const e=r.reduce((n,i)=>n+512+512*Math.floor((i.size+511)/512),0),t=10240*Math.floor((e+10240-1)/10240);return new ArrayBuffer(t)}function Me(r,e,t,n){const i=lc(e),a=new Uint8Array(r,t,n);for(let s=0;s>>7);return X^=99}t||function(){r=[],e=[];var C,O,H=1;for(C=0;C<255;C++)r[C]=H,O=128&H,H<<=1,H&=255,O===128&&(H^=27),H^=r[C],e[r[C]]=C;r[255]=r[0],e[0]=0,t=!0}(),i=[],a=[],s=[[],[],[],[]],o=[[],[],[],[]];for(var k=0;k<256;k++){var y=l(k);i[k]=y,a[y]=k,s[0][k]=n(2,y)<<24|y<<16|y<<8|n(3,y),o[0][y]=n(14,k)<<24|n(9,k)<<16|n(13,k)<<8|n(11,k);for(var P=1;P<4;P++)s[P][k]=s[P-1][k]>>>8|s[P-1][k]<<24,o[P][y]=o[P-1][y]>>>8|o[P-1][y]<<24}u=!0}var h=function(l,k){u||c();var y=new Uint32Array(k);y.set(i,512),y.set(a,768);for(var P=0;P<4;P++)y.set(s[P],4096+1024*P>>2),y.set(o[P],8192+1024*P>>2);var C=function(O,H,X){var F=0,E=0,G=0,q=0,$=0,V=0,Q=0,et=0,nt=0,ft=0,lt=0,M=0,dt=0,Pt=0,j=0,it=0,mt=0,bt=0,yt=0,pt=0,gt=0,ot=new O.Uint32Array(X),S=new O.Uint8Array(X);function N(v,b,rt,at,St,It,zt,Dt){v=v|0,b=b|0,rt=rt|0,at=at|0,St=St|0,It=It|0,zt=zt|0,Dt=Dt|0;var Wt=0,Xt=0,Jt=0,ne=0,Ct=0,Mt=0,Lt=0,Et=0;for(Wt=rt|1024,Xt=rt|2048,Jt=rt|3072,St=St^ot[(v|0)>>2],It=It^ot[(v|4)>>2],zt=zt^ot[(v|8)>>2],Dt=Dt^ot[(v|12)>>2],Et=16;(Et|0)<=at<<4;Et=Et+16|0)ne=ot[(rt|St>>22&1020)>>2]^ot[(Wt|It>>14&1020)>>2]^ot[(Xt|zt>>6&1020)>>2]^ot[(Jt|Dt<<2&1020)>>2]^ot[(v|Et|0)>>2],Ct=ot[(rt|It>>22&1020)>>2]^ot[(Wt|zt>>14&1020)>>2]^ot[(Xt|Dt>>6&1020)>>2]^ot[(Jt|St<<2&1020)>>2]^ot[(v|Et|4)>>2],Mt=ot[(rt|zt>>22&1020)>>2]^ot[(Wt|Dt>>14&1020)>>2]^ot[(Xt|St>>6&1020)>>2]^ot[(Jt|It<<2&1020)>>2]^ot[(v|Et|8)>>2],Lt=ot[(rt|Dt>>22&1020)>>2]^ot[(Wt|St>>14&1020)>>2]^ot[(Xt|It>>6&1020)>>2]^ot[(Jt|zt<<2&1020)>>2]^ot[(v|Et|12)>>2],St=ne,It=Ct,zt=Mt,Dt=Lt;F=ot[(b|St>>22&1020)>>2]<<24^ot[(b|It>>14&1020)>>2]<<16^ot[(b|zt>>6&1020)>>2]<<8^ot[(b|Dt<<2&1020)>>2]^ot[(v|Et|0)>>2],E=ot[(b|It>>22&1020)>>2]<<24^ot[(b|zt>>14&1020)>>2]<<16^ot[(b|Dt>>6&1020)>>2]<<8^ot[(b|St<<2&1020)>>2]^ot[(v|Et|4)>>2],G=ot[(b|zt>>22&1020)>>2]<<24^ot[(b|Dt>>14&1020)>>2]<<16^ot[(b|St>>6&1020)>>2]<<8^ot[(b|It<<2&1020)>>2]^ot[(v|Et|8)>>2],q=ot[(b|Dt>>22&1020)>>2]<<24^ot[(b|St>>14&1020)>>2]<<16^ot[(b|It>>6&1020)>>2]<<8^ot[(b|zt<<2&1020)>>2]^ot[(v|Et|12)>>2]}function w(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,N(0,2048,4096,gt,v,b,rt,at)}function f(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0;var St=0;N(1024,3072,8192,gt,v,at,rt,b),St=E,E=q,q=St}function K(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,N(0,2048,4096,gt,$^v,V^b,Q^rt,et^at),$=F,V=E,Q=G,et=q}function W(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0;var St=0;N(1024,3072,8192,gt,v,at,rt,b),St=E,E=q,q=St,F=F^$,E=E^V,G=G^Q,q=q^et,$=v,V=b,Q=rt,et=at}function Z(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,N(0,2048,4096,gt,$,V,Q,et),$=F=F^v,V=E=E^b,Q=G=G^rt,et=q=q^at}function Y(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,N(0,2048,4096,gt,$,V,Q,et),F=F^v,E=E^b,G=G^rt,q=q^at,$=v,V=b,Q=rt,et=at}function g(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,N(0,2048,4096,gt,$,V,Q,et),$=F,V=E,Q=G,et=q,F=F^v,E=E^b,G=G^rt,q=q^at}function d(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,N(0,2048,4096,gt,nt,ft,lt,M),M=~it&M|it&M+1,lt=~j<|j<+((M|0)==0),ft=~Pt&ft|Pt&ft+((lt|0)==0),nt=~dt&nt|dt&nt+((ft|0)==0),F=F^v,E=E^b,G=G^rt,q=q^at}function m(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0;var St=0,It=0,zt=0,Dt=0,Wt=0,Xt=0,Jt=0,ne=0,Ct=0,Mt=0;for(v=v^$,b=b^V,rt=rt^Q,at=at^et,St=mt|0,It=bt|0,zt=yt|0,Dt=pt|0;(Ct|0)<128;Ct=Ct+1|0)St>>>31&&(Wt=Wt^v,Xt=Xt^b,Jt=Jt^rt,ne=ne^at),St=St<<1|It>>>31,It=It<<1|zt>>>31,zt=zt<<1|Dt>>>31,Dt=Dt<<1,Mt=at&1,at=at>>>1|rt<<31,rt=rt>>>1|b<<31,b=b>>>1|v<<31,v=v>>>1,Mt&&(v=v^3774873600);$=Wt,V=Xt,Q=Jt,et=ne}function A(v){v=v|0,gt=v}function B(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,F=v,E=b,G=rt,q=at}function U(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,$=v,V=b,Q=rt,et=at}function z(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,nt=v,ft=b,lt=rt,M=at}function ut(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,dt=v,Pt=b,j=rt,it=at}function st(v,b,rt,at){v=v|0,b=b|0,rt=rt|0,at=at|0,M=~it&M|it&at,lt=~j<|j&rt,ft=~Pt&ft|Pt&b,nt=~dt&nt|dt&v}function ht(v){return v=v|0,v&15?-1:(S[v|0]=F>>>24,S[v|1]=F>>>16&255,S[v|2]=F>>>8&255,S[v|3]=F&255,S[v|4]=E>>>24,S[v|5]=E>>>16&255,S[v|6]=E>>>8&255,S[v|7]=E&255,S[v|8]=G>>>24,S[v|9]=G>>>16&255,S[v|10]=G>>>8&255,S[v|11]=G&255,S[v|12]=q>>>24,S[v|13]=q>>>16&255,S[v|14]=q>>>8&255,S[v|15]=q&255,16)}function I(v){return v=v|0,v&15?-1:(S[v|0]=$>>>24,S[v|1]=$>>>16&255,S[v|2]=$>>>8&255,S[v|3]=$&255,S[v|4]=V>>>24,S[v|5]=V>>>16&255,S[v|6]=V>>>8&255,S[v|7]=V&255,S[v|8]=Q>>>24,S[v|9]=Q>>>16&255,S[v|10]=Q>>>8&255,S[v|11]=Q&255,S[v|12]=et>>>24,S[v|13]=et>>>16&255,S[v|14]=et>>>8&255,S[v|15]=et&255,16)}function D(){w(0,0,0,0),mt=F,bt=E,yt=G,pt=q}function x(v,b,rt){v=v|0,b=b|0,rt=rt|0;var at=0;if(b&15)return-1;for(;(rt|0)>=16;)R[v&7](S[b|0]<<24|S[b|1]<<16|S[b|2]<<8|S[b|3],S[b|4]<<24|S[b|5]<<16|S[b|6]<<8|S[b|7],S[b|8]<<24|S[b|9]<<16|S[b|10]<<8|S[b|11],S[b|12]<<24|S[b|13]<<16|S[b|14]<<8|S[b|15]),S[b|0]=F>>>24,S[b|1]=F>>>16&255,S[b|2]=F>>>8&255,S[b|3]=F&255,S[b|4]=E>>>24,S[b|5]=E>>>16&255,S[b|6]=E>>>8&255,S[b|7]=E&255,S[b|8]=G>>>24,S[b|9]=G>>>16&255,S[b|10]=G>>>8&255,S[b|11]=G&255,S[b|12]=q>>>24,S[b|13]=q>>>16&255,S[b|14]=q>>>8&255,S[b|15]=q&255,at=at+16|0,b=b+16|0,rt=rt-16|0;return at|0}function T(v,b,rt){v=v|0,b=b|0,rt=rt|0;var at=0;if(b&15)return-1;for(;(rt|0)>=16;)L[v&1](S[b|0]<<24|S[b|1]<<16|S[b|2]<<8|S[b|3],S[b|4]<<24|S[b|5]<<16|S[b|6]<<8|S[b|7],S[b|8]<<24|S[b|9]<<16|S[b|10]<<8|S[b|11],S[b|12]<<24|S[b|13]<<16|S[b|14]<<8|S[b|15]),at=at+16|0,b=b+16|0,rt=rt-16|0;return at|0}var R=[w,f,K,W,Z,Y,g,d],L=[K,m];return{set_rounds:A,set_state:B,set_iv:U,set_nonce:z,set_mask:ut,set_counter:st,get_state:ht,get_iv:I,gcm_init:D,cipher:x,mac:T}}({Uint8Array,Uint32Array},l,k);return C.set_key=function(O,H,X,F,E,G,q,$,V){var Q=y.subarray(0,60),et=y.subarray(256,316);Q.set([H,X,F,E,G,q,$,V]);for(var nt=O,ft=1;nt<4*O+28;nt++){var lt=Q[nt-1];(nt%O==0||O===8&&nt%O==4)&&(lt=i[lt>>>24]<<24^i[lt>>>16&255]<<16^i[lt>>>8&255]<<8^i[255<]),nt%O==0&&(lt=lt<<8^lt>>>24^ft<<24,ft=ft<<1^(128&ft?27:0)),Q[nt]=Q[nt-O]^lt}for(var M=0;M=nt-4?lt:o[0][i[lt>>>24]]^o[1][i[lt>>>16&255]]^o[2][i[lt>>>8&255]]^o[3][i[255<]];C.set_rounds(O+5)},C};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function L1(r){return r instanceof Uint8Array}function Qs(r,e){const t=r?r.byteLength:65536;if(4095&t||t<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return r=r||new Uint8Array(new ArrayBuffer(t))}function Zr(r,e,t,n,i){const a=r.length-e,s=ai+a.length,0),t=new Uint8Array(e);let n=0;for(let i=0;i>2,a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12),i>16?a.getUint32(16):0,i>16?a.getUint32(20):0,i>24?a.getUint32(24):0,i>24?a.getUint32(28):0),t!==void 0){if(t.length!==16)throw new gr("illegal iv size");let s=new DataView(t.buffer,t.byteOffset,t.byteLength);n.set_iv(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}else n.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!L1(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:n}=this.acquire_asm(),i=Kt.ENC[this.mode],a=Kt.HEAP_DATA,s=this.pos,o=this.len,u=0,c=e.length||0,h=0,l=0,k=new Uint8Array(o+c&-16);for(;c>0;)l=Zr(t,s+o,e,u,c),o+=l,u+=l,c-=l,l=n.cipher(i,a+s,o),l&&k.set(t.subarray(s,s+l),h),h+=l,l0;)y=Zr(t,s+o,e,u,c),o+=y,u+=y,c-=y,y=n.cipher(i,a+s,o-(c?0:k)),y&&P.set(t.subarray(s,s+y),h),h+=y,y0){if(s%16){if(this.hasOwnProperty("padding"))throw new gr("data length must be a multiple of the block size");s+=16-s%16}if(t.cipher(n,i+a,s),this.hasOwnProperty("padding")&&this.padding){let c=e[a+o-1];if(c<1||c>16||c>o)throw new Ds("bad padding");let h=0;for(let l=c;l>1;l--)h|=c^e[a+o-l];if(h)throw new Ds("bad padding");o-=c}}const u=new Uint8Array(o);return o>0&&u.set(e.subarray(a,a+o)),this.pos=0,this.len=0,this.release_asm(),u}}class aa{static encrypt(e,t,n=!1){return new aa(t,n).encrypt(e)}static decrypt(e,t,n=!1){return new aa(t,n).decrypt(e)}constructor(e,t=!1,n){this.aes=n||new Si(e,void 0,t,"ECB")}encrypt(e){return Nr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Nr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Xs(r){const e=function(t){const n=new aa(t);this.encrypt=function(i){return n.encrypt(i)},this.decrypt=function(i){return n.decrypt(i)}};return e.blockSize=e.prototype.blockSize=16,e.keySize=e.prototype.keySize=r/8,e}function si(r,e,t,n,i,a){const s=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],u=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],h=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],k=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],y=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let P,C,O,H,X,F,E,G,q,$,V=0,Q=e.length;const et=r.length===32?3:9;G=et===3?t?[0,32,2]:[30,-2,-2]:t?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],t&&(e=function(lt,M){const dt=8-lt.length%8;let Pt;if(M===2&&dt<8)Pt=32;else if(M===1)Pt=dt;else{if(M||!(dt<8)){if(dt===8)return lt;throw Error("des: invalid padding")}Pt=0}const j=new Uint8Array(lt.length+dt);for(let it=0;it>>4^E),E^=O,F^=O<<4,O=65535&(F>>>16^E),E^=O,F^=O<<16,O=858993459&(E>>>2^F),F^=O,E^=O<<2,O=16711935&(E>>>8^F),F^=O,E^=O<<8,O=1431655765&(F>>>1^E),E^=O,F^=O<<1,F=F<<1|F>>>31,E=E<<1|E>>>31,C=0;C>>4|E<<28)^r[P+1],O=F,F=E,E=O^(o[H>>>24&63]|c[H>>>16&63]|l[H>>>8&63]|y[63&H]|s[X>>>24&63]|u[X>>>16&63]|h[X>>>8&63]|k[63&X]);O=F,F=E,E=O}F=F>>>1|F<<31,E=E>>>1|E<<31,O=1431655765&(F>>>1^E),E^=O,F^=O<<1,O=16711935&(E>>>8^F),F^=O,E^=O<<8,O=858993459&(E>>>2^F),F^=O,E^=O<<2,O=65535&(F>>>16^E),E^=O,F^=O<<16,O=252645135&(F>>>4^E),E^=O,F^=O<<4,nt[ft++]=F>>>24,nt[ft++]=F>>>16&255,nt[ft++]=F>>>8&255,nt[ft++]=255&F,nt[ft++]=E>>>24,nt[ft++]=E>>>16&255,nt[ft++]=E>>>8&255,nt[ft++]=255&E}return t||(nt=function(lt,M){let dt,Pt=null;if(M===2)dt=32;else if(M===1)Pt=lt[lt.length-1];else{if(M)throw Error("des: invalid padding");dt=0}if(!Pt){for(Pt=1;lt[lt.length-Pt]===dt;)Pt++;Pt--}return lt.subarray(0,lt.length-Pt)}(nt,a)),nt}function oi(r){const e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],t=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],k=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],y=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],P=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],C=r.length>8?3:1,O=Array(32*C),H=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let X,F,E,G=0,q=0;for(let $=0;$>>4^Q),Q^=E,V^=E<<4,E=65535&(Q>>>-16^V),V^=E,Q^=E<<-16,E=858993459&(V>>>2^Q),Q^=E,V^=E<<2,E=65535&(Q>>>-16^V),V^=E,Q^=E<<-16,E=1431655765&(V>>>1^Q),Q^=E,V^=E<<1,E=16711935&(Q>>>8^V),V^=E,Q^=E<<8,E=1431655765&(V>>>1^Q),Q^=E,V^=E<<1,E=V<<8|Q>>>20&240,V=Q<<24|Q<<8&16711680|Q>>>8&65280|Q>>>24&240,Q=E;for(let et=0;et<16;et++)H[et]?(V=V<<2|V>>>26,Q=Q<<2|Q>>>26):(V=V<<1|V>>>27,Q=Q<<1|Q>>>27),V&=-15,Q&=-15,X=e[V>>>28]|t[V>>>24&15]|n[V>>>20&15]|i[V>>>16&15]|a[V>>>12&15]|s[V>>>8&15]|o[V>>>4&15],F=u[Q>>>28]|c[Q>>>24&15]|h[Q>>>20&15]|l[Q>>>16&15]|k[Q>>>12&15]|y[Q>>>8&15]|P[Q>>>4&15],E=65535&(F>>>16^X),O[q++]=X^E,O[q++]=F^E<<16}return O}function Zn(r){this.key=[];for(let e=0;e<3;e++)this.key.push(new Uint8Array(r.subarray(8*e,8*e+8)));this.encrypt=function(e){return si(oi(this.key[2]),si(oi(this.key[1]),si(oi(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function T5(){this.BlockSize=8,this.KeySize=16,this.setKey=function(s){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),s.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(s),!0},this.reset=function(){for(let s=0;s<16;s++)this.masking[s]=0,this.rotate[s]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(s){const o=Array(s.length);for(let u=0;u>>24&255,o[u+1]=l>>>16&255,o[u+2]=l>>>8&255,o[u+3]=255&l,o[u+4]=h>>>24&255,o[u+5]=h>>>16&255,o[u+6]=h>>>8&255,o[u+7]=255&h}return o},this.decrypt=function(s){const o=Array(s.length);for(let u=0;u>>24&255,o[u+1]=l>>>16&255,o[u+2]=l>>>8&255,o[u+3]=255&l,o[u+4]=h>>>24&255,o[u+5]=h>>16&255,o[u+6]=h>>8&255,o[u+7]=255&h}return o};const r=[,,,,];r[0]=[,,,,],r[0][0]=[4,0,13,15,12,14,8],r[0][1]=[5,2,16,18,17,19,10],r[0][2]=[6,3,23,22,21,20,9],r[0][3]=[7,1,26,25,27,24,11],r[1]=[,,,,],r[1][0]=[0,6,21,23,20,22,16],r[1][1]=[1,4,0,2,1,3,18],r[1][2]=[2,5,7,6,5,4,17],r[1][3]=[3,7,10,9,11,8,19],r[2]=[,,,,],r[2][0]=[4,0,13,15,12,14,8],r[2][1]=[5,2,16,18,17,19,10],r[2][2]=[6,3,23,22,21,20,9],r[2][3]=[7,1,26,25,27,24,11],r[3]=[,,,,],r[3][0]=[0,6,21,23,20,22,16],r[3][1]=[1,4,0,2,1,3,18],r[3][2]=[2,5,7,6,5,4,17],r[3][3]=[3,7,10,9,11,8,19];const e=[,,,,];function t(s,o,u){const c=o+s,h=c<>>32-u;return(a[0][h>>>24]^a[1][h>>>16&255])-a[2][h>>>8&255]+a[3][255&h]}function n(s,o,u){const c=o^s,h=c<>>32-u;return a[0][h>>>24]-a[1][h>>>16&255]+a[2][h>>>8&255]^a[3][255&h]}function i(s,o,u){const c=o-s,h=c<>>32-u;return(a[0][h>>>24]+a[1][h>>>16&255]^a[2][h>>>8&255])-a[3][255&h]}e[0]=[,,,,],e[0][0]=[24,25,23,22,18],e[0][1]=[26,27,21,20,22],e[0][2]=[28,29,19,18,25],e[0][3]=[30,31,17,16,28],e[1]=[,,,,],e[1][0]=[3,2,12,13,8],e[1][1]=[1,0,14,15,13],e[1][2]=[7,6,8,9,3],e[1][3]=[5,4,10,11,7],e[2]=[,,,,],e[2][0]=[19,18,28,29,25],e[2][1]=[17,16,30,31,28],e[2][2]=[23,22,24,25,18],e[2][3]=[21,20,26,27,22],e[3]=[,,,,],e[3][0]=[8,9,7,6,3],e[3][1]=[10,11,5,4,7],e[3][2]=[12,13,3,2,8],e[3][3]=[14,15,1,0,13],this.keySchedule=function(s){const o=[,,,,,,,,],u=Array(32);let c;for(let y=0;y<4;y++)c=4*y,o[y]=s[c]<<24|s[c+1]<<16|s[c+2]<<8|s[c+3];const h=[6,7,4,5];let l,k=0;for(let y=0;y<2;y++)for(let P=0;P<4;P++){for(c=0;c<4;c++){const C=r[P][c];l=o[C[1]],l^=a[4][o[C[2]>>>2]>>>24-8*(3&C[2])&255],l^=a[5][o[C[3]>>>2]>>>24-8*(3&C[3])&255],l^=a[6][o[C[4]>>>2]>>>24-8*(3&C[4])&255],l^=a[7][o[C[5]>>>2]>>>24-8*(3&C[5])&255],l^=a[h[c]][o[C[6]>>>2]>>>24-8*(3&C[6])&255],o[C[0]]=l}for(c=0;c<4;c++){const C=e[P][c];l=a[4][o[C[0]>>>2]>>>24-8*(3&C[0])&255],l^=a[5][o[C[1]>>>2]>>>24-8*(3&C[1])&255],l^=a[6][o[C[2]>>>2]>>>24-8*(3&C[2])&255],l^=a[7][o[C[3]>>>2]>>>24-8*(3&C[3])&255],l^=a[4+c][o[C[4]>>>2]>>>24-8*(3&C[4])&255],u[k]=l,k++}}for(let y=0;y<16;y++)this.masking[y]=u[y],this.rotate[y]=31&u[16+y]};const a=[,,,,,,,,];a[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],a[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],a[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],a[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],a[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],a[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],a[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],a[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function Qn(r){this.cast5=new T5,this.cast5.setKey(r),this.encrypt=function(e){return this.cast5.encrypt(e)}}Zn.keySize=Zn.prototype.keySize=24,Zn.blockSize=Zn.prototype.blockSize=8,Qn.blockSize=Qn.prototype.blockSize=8,Qn.keySize=Qn.prototype.keySize=16;const Se=4294967295;function Fe(r,e){return(r<>>32-e)&Se}function or(r,e){return r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24}function _r(r,e,t){r.splice(e,4,255&t,t>>>8&255,t>>>16&255,t>>>24&255)}function _t(r,e){return r>>>8*e&255}function Xn(r){this.tf=function(){let e=null,t=null,n=-1,i=[],a=[[],[],[],[]];function s(h){return a[0][_t(h,0)]^a[1][_t(h,1)]^a[2][_t(h,2)]^a[3][_t(h,3)]}function o(h){return a[0][_t(h,3)]^a[1][_t(h,0)]^a[2][_t(h,1)]^a[3][_t(h,2)]}function u(h,l){let k=s(l[0]),y=o(l[1]);l[2]=Fe(l[2]^k+y+i[4*h+8]&Se,31),l[3]=Fe(l[3],1)^k+2*y+i[4*h+9]&Se,k=s(l[2]),y=o(l[3]),l[0]=Fe(l[0]^k+y+i[4*h+10]&Se,31),l[1]=Fe(l[1],1)^k+2*y+i[4*h+11]&Se}function c(h,l){let k=s(l[0]),y=o(l[1]);l[2]=Fe(l[2],1)^k+y+i[4*h+10]&Se,l[3]=Fe(l[3]^k+2*y+i[4*h+11]&Se,31),k=s(l[2]),y=o(l[3]),l[0]=Fe(l[0],1)^k+y+i[4*h+8]&Se,l[1]=Fe(l[1]^k+2*y+i[4*h+9]&Se,31)}return{name:"twofish",blocksize:16,open:function(h){let l,k,y,P,C;e=h;const O=[],H=[],X=[];let F;const E=[];let G,q,$;const V=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],Q=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],et=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],nt=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],ft=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],lt=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],M=[[],[]],dt=[[],[],[],[]];function Pt(yt){return yt^yt>>2^[0,90,180,238][3&yt]}function j(yt){return yt^yt>>1^yt>>2^[0,238,180,90][3&yt]}function it(yt,pt){let gt,ot,S;for(gt=0;gt<8;gt++)ot=pt>>>24,pt=pt<<8&Se|yt>>>24,yt=yt<<8&Se,S=ot<<1,128&ot&&(S^=333),pt^=ot^S<<16,S^=ot>>>1,1&ot&&(S^=166),pt^=S<<24|S<<8;return pt}function mt(yt,pt){const gt=pt>>4,ot=15&pt,S=V[yt][gt^ot],N=Q[yt][ft[ot]^lt[gt]];return nt[yt][ft[N]^lt[S]]<<4|et[yt][S^N]}function bt(yt,pt){let gt=_t(yt,0),ot=_t(yt,1),S=_t(yt,2),N=_t(yt,3);switch(F){case 4:gt=M[1][gt]^_t(pt[3],0),ot=M[0][ot]^_t(pt[3],1),S=M[0][S]^_t(pt[3],2),N=M[1][N]^_t(pt[3],3);case 3:gt=M[1][gt]^_t(pt[2],0),ot=M[1][ot]^_t(pt[2],1),S=M[0][S]^_t(pt[2],2),N=M[0][N]^_t(pt[2],3);case 2:gt=M[0][M[0][gt]^_t(pt[1],0)]^_t(pt[0],0),ot=M[0][M[1][ot]^_t(pt[1],1)]^_t(pt[0],1),S=M[1][M[0][S]^_t(pt[1],2)]^_t(pt[0],2),N=M[1][M[1][N]^_t(pt[1],3)]^_t(pt[0],3)}return dt[0][gt]^dt[1][ot]^dt[2][S]^dt[3][N]}for(e=e.slice(0,32),l=e.length;l!==16&&l!==24&&l!==32;)e[l++]=0;for(l=0;l>2]=or(e,l);for(l=0;l<256;l++)M[0][l]=mt(0,l),M[1][l]=mt(1,l);for(l=0;l<256;l++)G=M[1][l],q=Pt(G),$=j(G),dt[0][l]=G+(q<<8)+($<<16)+($<<24),dt[2][l]=q+($<<8)+(G<<16)+($<<24),G=M[0][l],q=Pt(G),$=j(G),dt[1][l]=$+($<<8)+(q<<16)+(G<<24),dt[3][l]=q+(G<<8)+($<<16)+(q<<24);for(F=X.length/2,l=0;l=0;y--)c(y,k);_r(t,n,k[2]^i[0]),_r(t,n+4,k[3]^i[1]),_r(t,n+8,k[0]^i[2]),_r(t,n+12,k[1]^i[3]),n+=16},finalize:function(){return t}}}(),this.tf.open(Array.from(r),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function Te(){}function Yn(r){this.bf=new Te,this.bf.init(r),this.encrypt=function(e){return this.bf.encryptBlock(e)}}Xn.keySize=Xn.prototype.keySize=32,Xn.blockSize=Xn.prototype.blockSize=16,Te.prototype.BLOCKSIZE=8,Te.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],Te.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Te.prototype.NN=16,Te.prototype._clean=function(r){return r<0&&(r=(2147483647&r)+2147483648),r},Te.prototype._F=function(r){let e;const t=255&r,n=255&(r>>>=8),i=255&(r>>>=8),a=255&(r>>>=8);return e=this.sboxes[0][a]+this.sboxes[1][i],e^=this.sboxes[2][n],e+=this.sboxes[3][t],e},Te.prototype._encryptBlock=function(r){let e,t=r[0],n=r[1];for(e=0;e>>24-8*e&255,i[e+n]=t[1]>>>24-8*e&255;return i},Te.prototype._decryptBlock=function(r){let e,t=r[0],n=r[1];for(e=this.NN+1;e>1;--e){t^=this.parray[e],n=this._F(t)^n;const i=t;t=n,n=i}t^=this.parray[1],n^=this.parray[0],r[0]=this._clean(n),r[1]=this._clean(t)},Te.prototype.init=function(r){let e,t=0;for(this.parray=[],e=0;e=r.length&&(t=0);this.parray[e]=this.PARRAY[e]^i}for(this.sboxes=[],e=0;e<4;++e)for(this.sboxes[e]=[],t=0;t<256;++t)this.sboxes[e][t]=this.SBOXES[e][t];const n=[0,0];for(e=0;e>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=it+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=mt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=bt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=yt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=pt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=gt+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=ot+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=S+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=N+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=w+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=f+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=K+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=W+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=Z+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=Y+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=W^S^mt^j,ut=U<<1|U>>>31,z=ut+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Z^N^bt^it,st=U<<1|U>>>31,z=st+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Y^w^yt^mt,ht=U<<1|U>>>31,z=ht+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=ut^f^pt^bt,I=U<<1|U>>>31,z=I+(g<<5|g>>>27)+B+(d&m|~d&A)+1518500249|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=st^K^gt^yt,D=U<<1|U>>>31,z=D+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=ht^W^ot^pt,x=U<<1|U>>>31,z=x+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=I^Z^S^gt,T=U<<1|U>>>31,z=T+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=D^Y^N^ot,R=U<<1|U>>>31,z=R+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=x^ut^w^S,L=U<<1|U>>>31,z=L+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=T^st^f^N,v=U<<1|U>>>31,z=v+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=R^ht^K^w,b=U<<1|U>>>31,z=b+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=L^I^W^f,rt=U<<1|U>>>31,z=rt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=v^D^Z^K,at=U<<1|U>>>31,z=at+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=b^x^Y^W,St=U<<1|U>>>31,z=St+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=rt^T^ut^Z,It=U<<1|U>>>31,z=It+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=at^R^st^Y,zt=U<<1|U>>>31,z=zt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=St^L^ht^ut,Dt=U<<1|U>>>31,z=Dt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=It^v^I^st,Wt=U<<1|U>>>31,z=Wt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=zt^b^D^ht,Xt=U<<1|U>>>31,z=Xt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Dt^rt^x^I,Jt=U<<1|U>>>31,z=Jt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Wt^at^T^D,ne=U<<1|U>>>31,z=ne+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Xt^St^R^x,Ct=U<<1|U>>>31,z=Ct+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Jt^It^L^T,Mt=U<<1|U>>>31,z=Mt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=ne^zt^v^R,Lt=U<<1|U>>>31,z=Lt+(g<<5|g>>>27)+B+(d^m^A)+1859775393|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Ct^Dt^b^L,Et=U<<1|U>>>31,z=Et+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Mt^Wt^rt^v,qt=U<<1|U>>>31,z=qt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Lt^Xt^at^b,Ft=U<<1|U>>>31,z=Ft+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Et^Jt^St^rt,$t=U<<1|U>>>31,z=$t+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=qt^ne^It^at,J=U<<1|U>>>31,z=J+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Ft^Ct^zt^St,tt=U<<1|U>>>31,z=tt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=$t^Mt^Dt^It,ct=U<<1|U>>>31,z=ct+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=J^Lt^Wt^zt,wt=U<<1|U>>>31,z=wt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=tt^Et^Xt^Dt,kt=U<<1|U>>>31,z=kt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=ct^qt^Jt^Wt,Ut=U<<1|U>>>31,z=Ut+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=wt^Ft^ne^Xt,At=U<<1|U>>>31,z=At+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=kt^$t^Ct^Jt,Nt=U<<1|U>>>31,z=Nt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Ut^J^Mt^ne,jt=U<<1|U>>>31,z=jt+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=At^tt^Lt^Ct,De=U<<1|U>>>31,z=De+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Nt^ct^Et^Mt,xe=U<<1|U>>>31,z=xe+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=jt^wt^qt^Lt,Ie=U<<1|U>>>31,z=Ie+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=De^kt^Ft^Et,Ne=U<<1|U>>>31,z=Ne+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=xe^Ut^$t^qt,cn=U<<1|U>>>31,z=cn+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Ie^At^J^Ft,un=U<<1|U>>>31,z=un+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Ne^Nt^tt^$t,hn=U<<1|U>>>31,z=hn+(g<<5|g>>>27)+B+(d&m|d&A|m&A)-1894007588|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=cn^jt^ct^J,ln=U<<1|U>>>31,z=ln+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=un^De^wt^tt,fn=U<<1|U>>>31,z=fn+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=hn^xe^kt^ct,dn=U<<1|U>>>31,z=dn+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=ln^Ie^Ut^wt,yn=U<<1|U>>>31,z=yn+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=fn^Ne^At^kt,On=U<<1|U>>>31,z=On+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=dn^cn^Nt^Ut,Mn=U<<1|U>>>31,z=Mn+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=yn^un^jt^At,xi=U<<1|U>>>31,z=xi+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=On^hn^De^Nt,Ii=U<<1|U>>>31,z=Ii+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Mn^ln^xe^jt,Bi=U<<1|U>>>31,z=Bi+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=xi^fn^Ie^De,Ti=U<<1|U>>>31,z=Ti+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Ii^dn^Ne^xe,Ri=U<<1|U>>>31,z=Ri+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Bi^yn^cn^Ie,zi=U<<1|U>>>31,z=zi+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Ti^On^un^Ne,Ma=U<<1|U>>>31,z=Ma+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Ri^Mn^hn^cn,Na=U<<1|U>>>31,z=Na+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=zi^xi^ln^un,Fa=U<<1|U>>>31,z=Fa+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Ma^Ii^fn^hn,Ha=U<<1|U>>>31,z=Ha+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Na^Bi^dn^ln,$a=U<<1|U>>>31,z=$a+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Fa^Ti^yn^fn,f1=U<<1|U>>>31,z=f1+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=Ha^Ri^On^dn,d1=U<<1|U>>>31,z=d1+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,U=$a^zi^Mn^yn,y1=U<<1|U>>>31,z=y1+(g<<5|g>>>27)+B+(d^m^A)-899497514|0,B=A,A=m,m=d<<30|d>>>2,d=g,g=z,n=n+g|0,i=i+d|0,a=a+m|0,s=s+A|0,o=o+B|0}function q(j){j=j|0,G(E[j|0]<<24|E[j|1]<<16|E[j|2]<<8|E[j|3],E[j|4]<<24|E[j|5]<<16|E[j|6]<<8|E[j|7],E[j|8]<<24|E[j|9]<<16|E[j|10]<<8|E[j|11],E[j|12]<<24|E[j|13]<<16|E[j|14]<<8|E[j|15],E[j|16]<<24|E[j|17]<<16|E[j|18]<<8|E[j|19],E[j|20]<<24|E[j|21]<<16|E[j|22]<<8|E[j|23],E[j|24]<<24|E[j|25]<<16|E[j|26]<<8|E[j|27],E[j|28]<<24|E[j|29]<<16|E[j|30]<<8|E[j|31],E[j|32]<<24|E[j|33]<<16|E[j|34]<<8|E[j|35],E[j|36]<<24|E[j|37]<<16|E[j|38]<<8|E[j|39],E[j|40]<<24|E[j|41]<<16|E[j|42]<<8|E[j|43],E[j|44]<<24|E[j|45]<<16|E[j|46]<<8|E[j|47],E[j|48]<<24|E[j|49]<<16|E[j|50]<<8|E[j|51],E[j|52]<<24|E[j|53]<<16|E[j|54]<<8|E[j|55],E[j|56]<<24|E[j|57]<<16|E[j|58]<<8|E[j|59],E[j|60]<<24|E[j|61]<<16|E[j|62]<<8|E[j|63])}function $(j){j=j|0,E[j|0]=n>>>24,E[j|1]=n>>>16&255,E[j|2]=n>>>8&255,E[j|3]=n&255,E[j|4]=i>>>24,E[j|5]=i>>>16&255,E[j|6]=i>>>8&255,E[j|7]=i&255,E[j|8]=a>>>24,E[j|9]=a>>>16&255,E[j|10]=a>>>8&255,E[j|11]=a&255,E[j|12]=s>>>24,E[j|13]=s>>>16&255,E[j|14]=s>>>8&255,E[j|15]=s&255,E[j|16]=o>>>24,E[j|17]=o>>>16&255,E[j|18]=o>>>8&255,E[j|19]=o&255}function V(){n=1732584193,i=4023233417,a=2562383102,s=271733878,o=3285377520,u=c=0}function Q(j,it,mt,bt,yt,pt,gt){j=j|0,it=it|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,n=j,i=it,a=mt,s=bt,o=yt,u=pt,c=gt}function et(j,it){j=j|0,it=it|0;var mt=0;if(j&63)return-1;for(;(it|0)>=64;)q(j),j=j+64|0,it=it-64|0,mt=mt+64|0;return u=u+mt|0,u>>>0>>0&&(c=c+1|0),mt|0}function nt(j,it,mt){j=j|0,it=it|0,mt=mt|0;var bt=0,yt=0;if(j&63||~mt&&mt&31)return-1;if((it|0)>=64){if(bt=et(j,it)|0,(bt|0)==-1)return-1;j=j+bt|0,it=it-bt|0}if(bt=bt+it|0,u=u+it|0,u>>>0>>0&&(c=c+1|0),E[j|it]=128,(it|0)>=56){for(yt=it+1|0;(yt|0)<64;yt=yt+1|0)E[j|yt]=0;q(j),it=0,E[j|0]=0}for(yt=it+1|0;(yt|0)<59;yt=yt+1|0)E[j|yt]=0;return E[j|56]=c>>>21&255,E[j|57]=c>>>13&255,E[j|58]=c>>>5&255,E[j|59]=c<<3&255|u>>>29,E[j|60]=u>>>21&255,E[j|61]=u>>>13&255,E[j|62]=u>>>5&255,E[j|63]=u<<3&255,q(j),~mt&&$(mt),bt|0}function ft(){n=h,i=l,a=k,s=y,o=P,u=64,c=0}function lt(){n=C,i=O,a=H,s=X,o=F,u=64,c=0}function M(j,it,mt,bt,yt,pt,gt,ot,S,N,w,f,K,W,Z,Y){j=j|0,it=it|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,ot=ot|0,S=S|0,N=N|0,w=w|0,f=f|0,K=K|0,W=W|0,Z=Z|0,Y=Y|0,V(),G(j^1549556828,it^1549556828,mt^1549556828,bt^1549556828,yt^1549556828,pt^1549556828,gt^1549556828,ot^1549556828,S^1549556828,N^1549556828,w^1549556828,f^1549556828,K^1549556828,W^1549556828,Z^1549556828,Y^1549556828),C=n,O=i,H=a,X=s,F=o,V(),G(j^909522486,it^909522486,mt^909522486,bt^909522486,yt^909522486,pt^909522486,gt^909522486,ot^909522486,S^909522486,N^909522486,w^909522486,f^909522486,K^909522486,W^909522486,Z^909522486,Y^909522486),h=n,l=i,k=a,y=s,P=o,u=64,c=0}function dt(j,it,mt){j=j|0,it=it|0,mt=mt|0;var bt=0,yt=0,pt=0,gt=0,ot=0,S=0;return j&63||~mt&&mt&31?-1:(S=nt(j,it,-1)|0,bt=n,yt=i,pt=a,gt=s,ot=o,lt(),G(bt,yt,pt,gt,ot,2147483648,0,0,0,0,0,0,0,0,0,672),~mt&&$(mt),S|0)}function Pt(j,it,mt,bt,yt){j=j|0,it=it|0,mt=mt|0,bt=bt|0,yt=yt|0;var pt=0,gt=0,ot=0,S=0,N=0,w=0,f=0,K=0,W=0,Z=0;if(j&63||~yt&&yt&31)return-1;for(E[j+it|0]=mt>>>24,E[j+it+1|0]=mt>>>16&255,E[j+it+2|0]=mt>>>8&255,E[j+it+3|0]=mt&255,dt(j,it+4|0,-1)|0,pt=w=n,gt=f=i,ot=K=a,S=W=s,N=Z=o,bt=bt-1|0;(bt|0)>0;)ft(),G(w,f,K,W,Z,2147483648,0,0,0,0,0,0,0,0,0,672),w=n,f=i,K=a,W=s,Z=o,lt(),G(w,f,K,W,Z,2147483648,0,0,0,0,0,0,0,0,0,672),w=n,f=i,K=a,W=s,Z=o,pt=pt^n,gt=gt^i,ot=ot^a,S=S^s,N=N^o,bt=bt-1|0;return n=pt,i=gt,a=ot,s=S,o=N,~yt&&$(yt),0}return{reset:V,init:Q,process:et,finish:nt,hmac_reset:ft,hmac_init:M,hmac_finish:dt,pbkdf2_generate_block:Pt}};class a2{constructor(){this.pos=0,this.len=0}reset(){const{asm:e}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,e.reset(),this}process(e){if(this.result!==null)throw new Cs("state must be reset before processing new data");const{asm:t,heap:n}=this.acquire_asm();let i=this.pos,a=this.len,s=0,o=e.length,u=0;for(;o>0;)u=Zr(n,i+a,e,s,o),a+=u,s+=u,o-=u,u=t.process(i,a),i+=u,a-=u,a||(i=0);return this.pos=i,this.len=a,this}finish(){if(this.result!==null)throw new Cs("state must be reset before processing new data");const{asm:e,heap:t}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(t.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const N1=[],F1=[];class Qr extends a2{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return this.heap!==void 0&&this.asm!==void 0||(this.heap=N1.pop()||Qs(),this.asm=F1.pop()||i2({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(N1.push(this.heap),F1.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new Qr().process(e).finish().result}}Qr.NAME="sha1",Qr.heap_pool=[],Qr.asm_pool=[],Qr.asm_function=i2;const H1=[],$1=[];class Ca extends a2{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return this.heap!==void 0&&this.asm!==void 0||(this.heap=H1.pop()||Qs(),this.asm=$1.pop()||function(e,t,n){var i=0,a=0,s=0,o=0,u=0,c=0,h=0,l=0,k=0,y=0,P=0,C=0,O=0,H=0,X=0,F=0,E=0,G=0,q=0,$=0,V=0,Q=0,et=0,nt=0,ft=0,lt=0,M=new e.Uint8Array(n);function dt(w,f,K,W,Z,Y,g,d,m,A,B,U,z,ut,st,ht){w=w|0,f=f|0,K=K|0,W=W|0,Z=Z|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,B=B|0,U=U|0,z=z|0,ut=ut|0,st=st|0,ht=ht|0;var I=0,D=0,x=0,T=0,R=0,L=0,v=0,b=0;I=i,D=a,x=s,T=o,R=u,L=c,v=h,b=l,b=w+b+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+1116352408|0,T=T+b|0,b=b+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,v=f+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+1899447441|0,x=x+v|0,v=v+(b&I^D&(b^I))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0,L=K+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+3049323471|0,D=D+L|0,L=L+(v&b^I&(v^b))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,R=W+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+3921009573|0,I=I+R|0,R=R+(L&v^b&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,T=Z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+961987163|0,b=b+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,x=Y+x+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(D^b&(I^D))+1508970993|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,D=g+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(b^I))+2453635748|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(b^L&(v^b))+2870763221|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,b=m+b+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+3624381080|0,T=T+b|0,b=b+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,v=A+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+310598401|0,x=x+v|0,v=v+(b&I^D&(b^I))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0,L=B+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+607225278|0,D=D+L|0,L=L+(v&b^I&(v^b))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,R=U+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+1426881987|0,I=I+R|0,R=R+(L&v^b&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,T=z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+1925078388|0,b=b+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,x=ut+x+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(D^b&(I^D))+2162078206|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,D=st+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(b^I))+2614888103|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(b^L&(v^b))+3248222580|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,w=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(st>>>17^st>>>19^st>>>10^st<<15^st<<13)+w+A|0,b=w+b+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+3835390401|0,T=T+b|0,b=b+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(K>>>7^K>>>18^K>>>3^K<<25^K<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+f+B|0,v=f+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+4022224774|0,x=x+v|0,v=v+(b&I^D&(b^I))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0,K=(W>>>7^W>>>18^W>>>3^W<<25^W<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+K+U|0,L=K+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+264347078|0,D=D+L|0,L=L+(v&b^I&(v^b))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,W=(Z>>>7^Z>>>18^Z>>>3^Z<<25^Z<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+W+z|0,R=W+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+604807628|0,I=I+R|0,R=R+(L&v^b&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,Z=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(K>>>17^K>>>19^K>>>10^K<<15^K<<13)+Z+ut|0,T=Z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+770255983|0,b=b+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+Y+st|0,x=Y+x+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(D^b&(I^D))+1249150122|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(Z>>>17^Z>>>19^Z>>>10^Z<<15^Z<<13)+g+ht|0,D=g+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(b^I))+1555081692|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<13)+d+w|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(b^L&(v^b))+1996064986|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,m=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,b=m+b+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+2554220882|0,T=T+b|0,b=b+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,A=(B>>>7^B>>>18^B>>>3^B<<25^B<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+A+K|0,v=A+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+2821834349|0,x=x+v|0,v=v+(b&I^D&(b^I))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0,B=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+B+W|0,L=B+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+2952996808|0,D=D+L|0,L=L+(v&b^I&(v^b))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,U=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+U+Z|0,R=U+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+3210313671|0,I=I+R|0,R=R+(L&v^b&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ut>>>7^ut>>>18^ut>>>3^ut<<25^ut<<14)+(B>>>17^B>>>19^B>>>10^B<<15^B<<13)+z+Y|0,T=z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+3336571891|0,b=b+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ut=(st>>>7^st>>>18^st>>>3^st<<25^st<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+ut+g|0,x=ut+x+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(D^b&(I^D))+3584528711|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,st=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+st+d|0,D=st+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(b^I))+113926993|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,ht=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(ut>>>17^ut>>>19^ut>>>10^ut<<15^ut<<13)+ht+m|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(b^L&(v^b))+338241895|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,w=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(st>>>17^st>>>19^st>>>10^st<<15^st<<13)+w+A|0,b=w+b+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+666307205|0,T=T+b|0,b=b+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(K>>>7^K>>>18^K>>>3^K<<25^K<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+f+B|0,v=f+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+773529912|0,x=x+v|0,v=v+(b&I^D&(b^I))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0,K=(W>>>7^W>>>18^W>>>3^W<<25^W<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+K+U|0,L=K+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+1294757372|0,D=D+L|0,L=L+(v&b^I&(v^b))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,W=(Z>>>7^Z>>>18^Z>>>3^Z<<25^Z<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+W+z|0,R=W+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+1396182291|0,I=I+R|0,R=R+(L&v^b&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,Z=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(K>>>17^K>>>19^K>>>10^K<<15^K<<13)+Z+ut|0,T=Z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+1695183700|0,b=b+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+Y+st|0,x=Y+x+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(D^b&(I^D))+1986661051|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(Z>>>17^Z>>>19^Z>>>10^Z<<15^Z<<13)+g+ht|0,D=g+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(b^I))+2177026350|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<13)+d+w|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(b^L&(v^b))+2456956037|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,m=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,b=m+b+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+2730485921|0,T=T+b|0,b=b+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,A=(B>>>7^B>>>18^B>>>3^B<<25^B<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+A+K|0,v=A+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+2820302411|0,x=x+v|0,v=v+(b&I^D&(b^I))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0,B=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+B+W|0,L=B+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+3259730800|0,D=D+L|0,L=L+(v&b^I&(v^b))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,U=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+U+Z|0,R=U+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+3345764771|0,I=I+R|0,R=R+(L&v^b&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ut>>>7^ut>>>18^ut>>>3^ut<<25^ut<<14)+(B>>>17^B>>>19^B>>>10^B<<15^B<<13)+z+Y|0,T=z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+3516065817|0,b=b+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ut=(st>>>7^st>>>18^st>>>3^st<<25^st<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+ut+g|0,x=ut+x+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(D^b&(I^D))+3600352804|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,st=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+st+d|0,D=st+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(b^I))+4094571909|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,ht=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(ut>>>17^ut>>>19^ut>>>10^ut<<15^ut<<13)+ht+m|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(b^L&(v^b))+275423344|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,w=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(st>>>17^st>>>19^st>>>10^st<<15^st<<13)+w+A|0,b=w+b+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+430227734|0,T=T+b|0,b=b+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(K>>>7^K>>>18^K>>>3^K<<25^K<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+f+B|0,v=f+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+506948616|0,x=x+v|0,v=v+(b&I^D&(b^I))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0,K=(W>>>7^W>>>18^W>>>3^W<<25^W<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+K+U|0,L=K+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+659060556|0,D=D+L|0,L=L+(v&b^I&(v^b))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,W=(Z>>>7^Z>>>18^Z>>>3^Z<<25^Z<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+W+z|0,R=W+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+883997877|0,I=I+R|0,R=R+(L&v^b&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,Z=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(K>>>17^K>>>19^K>>>10^K<<15^K<<13)+Z+ut|0,T=Z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+958139571|0,b=b+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+Y+st|0,x=Y+x+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(D^b&(I^D))+1322822218|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(Z>>>17^Z>>>19^Z>>>10^Z<<15^Z<<13)+g+ht|0,D=g+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(b^I))+1537002063|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<13)+d+w|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(b^L&(v^b))+1747873779|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,m=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,b=m+b+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+1955562222|0,T=T+b|0,b=b+(I&D^x&(I^D))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,A=(B>>>7^B>>>18^B>>>3^B<<25^B<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+A+K|0,v=A+v+(T>>>6^T>>>11^T>>>25^T<<26^T<<21^T<<7)+(L^T&(R^L))+2024104815|0,x=x+v|0,v=v+(b&I^D&(b^I))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0,B=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+B+W|0,L=B+L+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(R^x&(T^R))+2227730452|0,D=D+L|0,L=L+(v&b^I&(v^b))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,U=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+U+Z|0,R=U+R+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(T^D&(x^T))+2361852424|0,I=I+R|0,R=R+(L&v^b&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ut>>>7^ut>>>18^ut>>>3^ut<<25^ut<<14)+(B>>>17^B>>>19^B>>>10^B<<15^B<<13)+z+Y|0,T=z+T+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(x^I&(D^x))+2428436474|0,b=b+T|0,T=T+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ut=(st>>>7^st>>>18^st>>>3^st<<25^st<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+ut+g|0,x=ut+x+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(D^b&(I^D))+2756734187|0,v=v+x|0,x=x+(T&R^L&(T^R))+(T>>>2^T>>>13^T>>>22^T<<30^T<<19^T<<10)|0,st=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+st+d|0,D=st+D+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(b^I))+3204031479|0,L=L+D|0,D=D+(x&T^R&(x^T))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,ht=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(ut>>>17^ut>>>19^ut>>>10^ut<<15^ut<<13)+ht+m|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(b^L&(v^b))+3329325298|0,R=R+I|0,I=I+(D&x^T&(D^x))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,i=i+I|0,a=a+D|0,s=s+x|0,o=o+T|0,u=u+R|0,c=c+L|0,h=h+v|0,l=l+b|0}function Pt(w){w=w|0,dt(M[w|0]<<24|M[w|1]<<16|M[w|2]<<8|M[w|3],M[w|4]<<24|M[w|5]<<16|M[w|6]<<8|M[w|7],M[w|8]<<24|M[w|9]<<16|M[w|10]<<8|M[w|11],M[w|12]<<24|M[w|13]<<16|M[w|14]<<8|M[w|15],M[w|16]<<24|M[w|17]<<16|M[w|18]<<8|M[w|19],M[w|20]<<24|M[w|21]<<16|M[w|22]<<8|M[w|23],M[w|24]<<24|M[w|25]<<16|M[w|26]<<8|M[w|27],M[w|28]<<24|M[w|29]<<16|M[w|30]<<8|M[w|31],M[w|32]<<24|M[w|33]<<16|M[w|34]<<8|M[w|35],M[w|36]<<24|M[w|37]<<16|M[w|38]<<8|M[w|39],M[w|40]<<24|M[w|41]<<16|M[w|42]<<8|M[w|43],M[w|44]<<24|M[w|45]<<16|M[w|46]<<8|M[w|47],M[w|48]<<24|M[w|49]<<16|M[w|50]<<8|M[w|51],M[w|52]<<24|M[w|53]<<16|M[w|54]<<8|M[w|55],M[w|56]<<24|M[w|57]<<16|M[w|58]<<8|M[w|59],M[w|60]<<24|M[w|61]<<16|M[w|62]<<8|M[w|63])}function j(w){w=w|0,M[w|0]=i>>>24,M[w|1]=i>>>16&255,M[w|2]=i>>>8&255,M[w|3]=i&255,M[w|4]=a>>>24,M[w|5]=a>>>16&255,M[w|6]=a>>>8&255,M[w|7]=a&255,M[w|8]=s>>>24,M[w|9]=s>>>16&255,M[w|10]=s>>>8&255,M[w|11]=s&255,M[w|12]=o>>>24,M[w|13]=o>>>16&255,M[w|14]=o>>>8&255,M[w|15]=o&255,M[w|16]=u>>>24,M[w|17]=u>>>16&255,M[w|18]=u>>>8&255,M[w|19]=u&255,M[w|20]=c>>>24,M[w|21]=c>>>16&255,M[w|22]=c>>>8&255,M[w|23]=c&255,M[w|24]=h>>>24,M[w|25]=h>>>16&255,M[w|26]=h>>>8&255,M[w|27]=h&255,M[w|28]=l>>>24,M[w|29]=l>>>16&255,M[w|30]=l>>>8&255,M[w|31]=l&255}function it(){i=1779033703,a=3144134277,s=1013904242,o=2773480762,u=1359893119,c=2600822924,h=528734635,l=1541459225,k=y=0}function mt(w,f,K,W,Z,Y,g,d,m,A){w=w|0,f=f|0,K=K|0,W=W|0,Z=Z|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,i=w,a=f,s=K,o=W,u=Z,c=Y,h=g,l=d,k=m,y=A}function bt(w,f){w=w|0,f=f|0;var K=0;if(w&63)return-1;for(;(f|0)>=64;)Pt(w),w=w+64|0,f=f-64|0,K=K+64|0;return k=k+K|0,k>>>0>>0&&(y=y+1|0),K|0}function yt(w,f,K){w=w|0,f=f|0,K=K|0;var W=0,Z=0;if(w&63||~K&&K&31)return-1;if((f|0)>=64){if(W=bt(w,f)|0,(W|0)==-1)return-1;w=w+W|0,f=f-W|0}if(W=W+f|0,k=k+f|0,k>>>0>>0&&(y=y+1|0),M[w|f]=128,(f|0)>=56){for(Z=f+1|0;(Z|0)<64;Z=Z+1|0)M[w|Z]=0;Pt(w),f=0,M[w|0]=0}for(Z=f+1|0;(Z|0)<59;Z=Z+1|0)M[w|Z]=0;return M[w|56]=y>>>21&255,M[w|57]=y>>>13&255,M[w|58]=y>>>5&255,M[w|59]=y<<3&255|k>>>29,M[w|60]=k>>>21&255,M[w|61]=k>>>13&255,M[w|62]=k>>>5&255,M[w|63]=k<<3&255,Pt(w),~K&&j(K),W|0}function pt(){i=P,a=C,s=O,o=H,u=X,c=F,h=E,l=G,k=64,y=0}function gt(){i=q,a=$,s=V,o=Q,u=et,c=nt,h=ft,l=lt,k=64,y=0}function ot(w,f,K,W,Z,Y,g,d,m,A,B,U,z,ut,st,ht){w=w|0,f=f|0,K=K|0,W=W|0,Z=Z|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,B=B|0,U=U|0,z=z|0,ut=ut|0,st=st|0,ht=ht|0,it(),dt(w^1549556828,f^1549556828,K^1549556828,W^1549556828,Z^1549556828,Y^1549556828,g^1549556828,d^1549556828,m^1549556828,A^1549556828,B^1549556828,U^1549556828,z^1549556828,ut^1549556828,st^1549556828,ht^1549556828),q=i,$=a,V=s,Q=o,et=u,nt=c,ft=h,lt=l,it(),dt(w^909522486,f^909522486,K^909522486,W^909522486,Z^909522486,Y^909522486,g^909522486,d^909522486,m^909522486,A^909522486,B^909522486,U^909522486,z^909522486,ut^909522486,st^909522486,ht^909522486),P=i,C=a,O=s,H=o,X=u,F=c,E=h,G=l,k=64,y=0}function S(w,f,K){w=w|0,f=f|0,K=K|0;var W=0,Z=0,Y=0,g=0,d=0,m=0,A=0,B=0,U=0;return w&63||~K&&K&31?-1:(U=yt(w,f,-1)|0,W=i,Z=a,Y=s,g=o,d=u,m=c,A=h,B=l,gt(),dt(W,Z,Y,g,d,m,A,B,2147483648,0,0,0,0,0,0,768),~K&&j(K),U|0)}function N(w,f,K,W,Z){w=w|0,f=f|0,K=K|0,W=W|0,Z=Z|0;var Y=0,g=0,d=0,m=0,A=0,B=0,U=0,z=0,ut=0,st=0,ht=0,I=0,D=0,x=0,T=0,R=0;if(w&63||~Z&&Z&31)return-1;for(M[w+f|0]=K>>>24,M[w+f+1|0]=K>>>16&255,M[w+f+2|0]=K>>>8&255,M[w+f+3|0]=K&255,S(w,f+4|0,-1)|0,Y=ut=i,g=st=a,d=ht=s,m=I=o,A=D=u,B=x=c,U=T=h,z=R=l,W=W-1|0;(W|0)>0;)pt(),dt(ut,st,ht,I,D,x,T,R,2147483648,0,0,0,0,0,0,768),ut=i,st=a,ht=s,I=o,D=u,x=c,T=h,R=l,gt(),dt(ut,st,ht,I,D,x,T,R,2147483648,0,0,0,0,0,0,768),ut=i,st=a,ht=s,I=o,D=u,x=c,T=h,R=l,Y=Y^i,g=g^a,d=d^s,m=m^o,A=A^u,B=B^c,U=U^h,z=z^l,W=W-1|0;return i=Y,a=g,s=d,o=m,u=A,c=B,h=U,l=z,~Z&&j(Z),0}return{reset:it,init:mt,process:bt,finish:yt,hmac_reset:pt,hmac_init:ot,hmac_finish:S,pbkdf2_generate_block:N}}({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(H1.push(this.heap),$1.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new Ca().process(e).finish().result}}Ca.NAME="sha256";var Da=s2;function s2(r,e){if(!r)throw Error(e||"Assertion failed")}s2.equal=function(r,e,t){if(r!=e)throw Error(t||"Assertion failed: "+r+" != "+e)};var U6=Je!==void 0?Je:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ys(r,e){return r(e={exports:{}},e.exports),e.exports}function O5(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var M5=Ys(function(r){r.exports=typeof Object.create=="function"?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),N5=function(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for((r=r.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(r="0"+r),n=0;n>8,s=255&i;a?t.push(a,s):t.push(s)}else for(n=0;n>>24|r>>>8&65280|r<<8&16711680|(255&r)<<24)>>>0}var H5=function(r,e){for(var t="",n=0;n>>0}return a},q5=function(r,e){for(var t=Array(4*r.length),n=0,i=0;n>>24,t[i+1]=a>>>16&255,t[i+2]=a>>>8&255,t[i+3]=255&a):(t[i+3]=a>>>24,t[i+2]=a>>>16&255,t[i+1]=a>>>8&255,t[i]=255&a)}return t},xt={inherits:M5,toArray:N5,toHex:F5,htonl:o2,toHex32:H5,zero2:c2,zero8:u2,join32:$5,split32:q5,rotr32:function(r,e){return r>>>e|r<<32-e},rotl32:function(r,e){return r<>>32-e},sum32:function(r,e){return r+e>>>0},sum32_3:function(r,e,t){return r+e+t>>>0},sum32_4:function(r,e,t,n){return r+e+t+n>>>0},sum32_5:function(r,e,t,n,i){return r+e+t+n+i>>>0},sum64:function(r,e,t,n){var i=r[e],a=n+r[e+1]>>>0,s=(a>>0,r[e+1]=a},sum64_hi:function(r,e,t,n){return(e+n>>>0>>0},sum64_lo:function(r,e,t,n){return e+n>>>0},sum64_4_hi:function(r,e,t,n,i,a,s,o){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(r,e,t,n,i,a,s,o){return e+n+a+o>>>0},sum64_5_hi:function(r,e,t,n,i,a,s,o,u,c){var h=0,l=e;return h+=(l=l+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(r,e,t,n,i,a,s,o,u,c){return e+n+a+o+c>>>0},rotr64_hi:function(r,e,t){return(e<<32-t|r>>>t)>>>0},rotr64_lo:function(r,e,t){return(r<<32-t|e>>>t)>>>0},shr64_hi:function(r,e,t){return r>>>t},shr64_lo:function(r,e,t){return(r<<32-t|e>>>t)>>>0}};function Vi(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var j5=Vi;Vi.prototype.update=function(r,e){if(r=xt.toArray(r,e),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){var t=(r=this.pending).length%this._delta8;this.pending=r.slice(r.length-t,r.length),this.pending.length===0&&(this.pending=null),r=xt.join32(r,0,r.length-t,this.endian);for(var n=0;n>>24&255,n[i++]=r>>>16&255,n[i++]=r>>>8&255,n[i++]=255&r}else for(n[i++]=255&r,n[i++]=r>>>8&255,n[i++]=r>>>16&255,n[i++]=r>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3},g1_256:function(r){return He(r,17)^He(r,19)^r>>>10}},Be=xt.sum32,W5=xt.sum32_4,V5=xt.sum32_5,Z5=Tn.ch32,Q5=Tn.maj32,X5=Tn.s0_256,Y5=Tn.s1_256,J5=Tn.g0_256,tu=Tn.g1_256,d2=Js.BlockHash,eu=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Ge(){if(!(this instanceof Ge))return new Ge;d2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=eu,this.W=Array(64)}xt.inherits(Ge,d2);var y2=Ge;function yr(){if(!(this instanceof yr))return new yr;y2.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Ge.blockSize=512,Ge.outSize=256,Ge.hmacStrength=192,Ge.padLength=64,Ge.prototype._update=function(r,e){for(var t=this.W,n=0;n<16;n++)t[n]=r[e+n];for(;n>>32-i,t)}function fe(r,e,t,n,i,a,s){return xa(e&t|~e&n,r,e,i,a,s)}function de(r,e,t,n,i,a,s){return xa(e&n|t&~n,r,e,i,a,s)}function ye(r,e,t,n,i,a,s){return xa(e^t^n,r,e,i,a,s)}function pe(r,e,t,n,i,a,s){return xa(t^(e|~n),r,e,i,a,s)}function Uu(r){const e=[];let t;for(t=0;t<64;t+=4)e[t>>2]=r.charCodeAt(t)+(r.charCodeAt(t+1)<<8)+(r.charCodeAt(t+2)<<16)+(r.charCodeAt(t+3)<<24);return e}const W1="0123456789abcdef".split("");function Ku(r){let e="",t=0;for(;t<4;t++)e+=W1[r>>8*t+4&15]+W1[r>>8*t&15];return e}function Br(r,e){return r+e&4294967295}const sa=_.getWebCrypto(),oa=_.getNodeCrypto(),Cu=oa&&oa.getHashes();function qr(r){if(oa&&Cu.includes(r))return async function(e){const t=oa.createHash(r);return Yt(e,n=>{t.update(n)},()=>new Uint8Array(t.digest()))}}function Oi(r,e){return async function(t,n=vt){if(le(t)&&(t=await sr(t)),!_.isStream(t)&&sa&&e&&t.length>=n.minBytesForWebCrypto)return new Uint8Array(await sa.digest(e,t));const i=r();return Yt(t,a=>{i.update(a)},()=>new Uint8Array(i.digest()))}}function V1(r,e){return async function(t,n=vt){if(le(t)&&(t=await sr(t)),_.isStream(t)){const i=new r;return Yt(t,a=>{i.process(a)},()=>i.finish().result)}return sa&&e&&t.length>=n.minBytesForWebCrypto?new Uint8Array(await sa.digest(e,t)):r.bytes(t)}}const jr={md5:qr("md5")||async function(r){const e=function(t){const n=t.length,i=[1732584193,-271733879,-1732584194,271733878];let a;for(a=64;a<=t.length;a+=64)Qa(i,Uu(t.substring(a-64,a)));t=t.substring(a-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(a=0;a>2]|=t.charCodeAt(a)<<(a%4<<3);if(s[a>>2]|=128<<(a%4<<3),a>55)for(Qa(i,s),a=0;a<16;a++)s[a]=0;return s[14]=8*n,Qa(i,s),i}(_.uint8ArrayToString(r));return _.hexToUint8Array(function(t){for(let n=0;nnew Uint8Array(O.update(H)))}(r,e,t,n);if(_.isAES(r))return function(l,k,y,P,C){if(_.getWebCrypto()&&k.length!==24&&!_.isStream(y)&&y.length>=3e3*C.minBytesForWebCrypto)return async function(H,X,F,E){const G="AES-CBC",q=await Z1.importKey("raw",X,{name:G},!1,["encrypt"]),{blockSize:$}=rr(H),V=_.concatUint8Array([new Uint8Array($),F]),Q=new Uint8Array(await Z1.encrypt({name:G,iv:E},q,V)).subarray(0,F.length);return function(et,nt){for(let ft=0;ftO.aes.AES_Encrypt_process(H),()=>O.aes.AES_Encrypt_finish())}(r,e,t,n,i);const s=new(rr(r))(e),o=s.blockSize,u=n.slice();let c=new Uint8Array;const h=l=>{l&&(c=_.concatUint8Array([c,l]));const k=new Uint8Array(c.length);let y,P=0;for(;l?c.length>=o:c.length;){const C=s.encrypt(u);for(y=0;ynew Uint8Array(C.update(O)))}(r,e,t,n);if(_.isAES(r))return function(h,l,k,y){if(_.isStream(k)){const P=new Sn(l,y);return Yt(k,C=>P.aes.AES_Decrypt_process(C),()=>P.aes.AES_Decrypt_finish())}return Sn.decrypt(k,l,y)}(0,e,t,n);const a=new(rr(r))(e),s=a.blockSize;let o=n,u=new Uint8Array;const c=h=>{h&&(u=_.concatUint8Array([u,h]));const l=new Uint8Array(u.length);let k,y=0;for(;h?u.length>=s:u.length;){const P=a.encrypt(o);for(o=u.subarray(0,s),k=0;k48)throw new gr("illegal counter size");let a=Math.pow(2,n)-1;i.set_mask(0,0,a/4294967296|0,0|a)}else n=48,i.set_mask(0,0,65535,4294967295);if(e===void 0)throw Error("nonce is required");{let a=e.length;if(!a||a>16)throw new gr("illegal nonce size");let s=new DataView(new ArrayBuffer(16));new Uint8Array(s.buffer).set(e),i.set_nonce(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}if(t!==void 0){if(t<0||t>=Math.pow(2,n))throw new gr("illegal counter value");i.set_counter(0,0,t/4294967296|0,0|t)}}}class ha{static encrypt(e,t,n=!0,i){return new ha(t,i,n).encrypt(e)}static decrypt(e,t,n=!0,i){return new ha(t,i,n).decrypt(e)}constructor(e,t,n=!0,i){this.aes=i||new Si(e,t,n,"CBC")}encrypt(e){return Nr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Nr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const Q1=_.getWebCrypto(),xu=_.getNodeCrypto(),lr=16;function X1(r,e){const t=r.length-lr;for(let n=0;n>3),17+(y>>3)),8-(7&y)).subarray(1),H=new Uint8Array(we),X=new Uint8Array(u.length+Ur);let F,E=0;for(F=0;F16)throw new gr("illegal tagSize value");const u=t.length||0,c=new Uint8Array(16);u!==12?(this._gcm_mac_process(t),o[0]=0,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=0,o[11]=u>>>29,o[12]=u>>>21&255,o[13]=u>>>13&255,o[14]=u>>>5&255,o[15]=u<<3&255,s.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),s.get_iv(Kt.HEAP_DATA),s.set_iv(0,0,0,0),c.set(o.subarray(0,16))):(c.set(t),c[15]=1);const h=new DataView(c.buffer);if(this.gamma0=h.getUint32(12),s.set_nonce(h.getUint32(0),h.getUint32(4),h.getUint32(8),0),s.set_mask(0,0,0,4294967295),n!==void 0){if(n.length>Ya)throw new gr("illegal adata length");n.length?(this.adata=n,this._gcm_mac_process(n)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");s.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,t,n,i,a){return new Xr(t,n,i,a).encrypt(e)}static decrypt(e,t,n,i,a){return new Xr(t,n,i,a).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let t=0,n=e.length||0,{asm:i,heap:a}=this.aes.acquire_asm(),s=this.counter,o=this.aes.pos,u=this.aes.len,c=0,h=u+n&-16,l=0;if((s-1<<4)+u+n>Ya)throw new RangeError("counter overflow");const k=new Uint8Array(h);for(;n>0;)l=Zr(a,o+u,e,t,n),u+=l,t+=l,n-=l,l=i.cipher(Kt.ENC.CTR,Kt.HEAP_DATA+o,u),l=i.mac(Kt.MAC.GCM,Kt.HEAP_DATA+o,l),l&&k.set(a.subarray(o,o+l),c),s+=l>>>4,c+=l,l>>29,t[4]=h>>>21,t[5]=h>>>13&255,t[6]=h>>>5&255,t[7]=h<<3&255,t[8]=t[9]=t[10]=0,t[11]=l>>>29,t[12]=l>>>21&255,t[13]=l>>>13&255,t[14]=l>>>5&255,t[15]=l<<3&255,e.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),e.get_iv(Kt.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(Kt.ENC.CTR,Kt.HEAP_DATA,16),u.set(t.subarray(0,i),o),this.counter=1,this.aes.pos=0,this.aes.len=0,u}AES_GCM_Decrypt_process(e){let t=0,n=e.length||0,{asm:i,heap:a}=this.aes.acquire_asm(),s=this.counter,o=this.tagSize,u=this.aes.pos,c=this.aes.len,h=0,l=c+n>o?c+n-o&-16:0,k=c+n-l,y=0;if((s-1<<4)+c+n>Ya)throw new RangeError("counter overflow");const P=new Uint8Array(l);for(;n>k;)y=Zr(a,u+c,e,t,n-k),c+=y,t+=y,n-=y,y=i.mac(Kt.MAC.GCM,Kt.HEAP_DATA+u,y),y=i.cipher(Kt.DEC.CTR,Kt.HEAP_DATA+u,y),y&&P.set(a.subarray(u,u+y),h),s+=y>>>4,h+=y,u=0,c=0;return n>0&&(c+=Zr(a,0,e,t,n)),this.counter=s,this.aes.pos=u,this.aes.len=c,P}AES_GCM_Decrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),n=this.tagSize,i=this.adata,a=this.counter,s=this.aes.pos,o=this.aes.len,u=o-n;if(o>>29,t[4]=k>>>21,t[5]=k>>>13&255,t[6]=k>>>5&255,t[7]=k<<3&255,t[8]=t[9]=t[10]=0,t[11]=y>>>29,t[12]=y>>>21&255,t[13]=y>>>13&255,t[14]=y>>>5&255,t[15]=y<<3&255,e.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),e.get_iv(Kt.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(Kt.ENC.CTR,Kt.HEAP_DATA,16);let P=0;for(let C=0;C0;){for(s=Zr(n,0,e,i,a),i+=s,a-=s;15&s;)n[s++]=0;t.mac(Kt.MAC.GCM,Kt.HEAP_DATA,s)}}}const Ja=_.getWebCrypto(),e0=_.getNodeCrypto(),r0=_.getNodeBuffer(),kn=16,ts="AES-GCM";async function An(r,e){if(r!==p.symmetric.aes128&&r!==p.symmetric.aes192&&r!==p.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(_.getNodeCrypto())return{encrypt:async function(t,n,i=new Uint8Array){const a=new e0.createCipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i);const s=r0.concat([a.update(t),a.final(),a.getAuthTag()]);return new Uint8Array(s)},decrypt:async function(t,n,i=new Uint8Array){const a=new e0.createDecipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i),a.setAuthTag(t.slice(t.length-kn,t.length));const s=r0.concat([a.update(t.slice(0,t.length-kn)),a.final()]);return new Uint8Array(s)}};if(_.getWebCrypto()&&e.length!==24){const t=await Ja.importKey("raw",e,{name:ts},!1,["encrypt","decrypt"]);return{encrypt:async function(n,i,a=new Uint8Array){if(!n.length)return Xr.encrypt(n,e,i,a);const s=await Ja.encrypt({name:ts,iv:i,additionalData:a,tagLength:8*kn},t,n);return new Uint8Array(s)},decrypt:async function(n,i,a=new Uint8Array){if(n.length===kn)return Xr.decrypt(n,e,i,a);const s=await Ja.decrypt({name:ts,iv:i,additionalData:a,tagLength:8*kn},t,n);return new Uint8Array(s)}}}return{encrypt:async function(t,n,i){return Xr.encrypt(t,e,n,i)},decrypt:async function(t,n,i){return Xr.decrypt(t,e,n,i)}}}An.getNonce=function(r,e){const t=r.slice();for(let n=0;n>>8)-1}(S,N,w,f,32)}function P(S,N){var w;for(w=0;w<16;w++)S[w]=0|N[w]}function C(S){var N,w,f=1;for(N=0;N<16;N++)w=S[N]+f+65535,f=Math.floor(w/65536),S[N]=w-65536*f;S[0]+=f-1+37*(f-1)}function O(S,N,w){for(var f,K=~(w-1),W=0;W<16;W++)f=K&(S[W]^N[W]),S[W]^=f,N[W]^=f}function H(S,N){var w,f,K,W=t(),Z=t();for(w=0;w<16;w++)Z[w]=N[w];for(C(Z),C(Z),C(Z),f=0;f<2;f++){for(W[0]=Z[0]-65517,w=1;w<15;w++)W[w]=Z[w]-65535-(W[w-1]>>16&1),W[w-1]&=65535;W[15]=Z[15]-32767-(W[14]>>16&1),K=W[15]>>16&1,W[14]&=65535,O(Z,W,1-K)}for(w=0;w<16;w++)S[2*w]=255&Z[w],S[2*w+1]=Z[w]>>8}function X(S,N){var w=new Uint8Array(32),f=new Uint8Array(32);return H(w,S),H(f,N),y(w,0,f,0)}function F(S){var N=new Uint8Array(32);return H(N,S),1&N[0]}function E(S,N){var w;for(w=0;w<16;w++)S[w]=N[2*w]+(N[2*w+1]<<8);S[15]&=32767}function G(S,N,w){for(var f=0;f<16;f++)S[f]=N[f]+w[f]}function q(S,N,w){for(var f=0;f<16;f++)S[f]=N[f]-w[f]}function $(S,N,w){var f,K,W=0,Z=0,Y=0,g=0,d=0,m=0,A=0,B=0,U=0,z=0,ut=0,st=0,ht=0,I=0,D=0,x=0,T=0,R=0,L=0,v=0,b=0,rt=0,at=0,St=0,It=0,zt=0,Dt=0,Wt=0,Xt=0,Jt=0,ne=0,Ct=w[0],Mt=w[1],Lt=w[2],Et=w[3],qt=w[4],Ft=w[5],$t=w[6],J=w[7],tt=w[8],ct=w[9],wt=w[10],kt=w[11],Ut=w[12],At=w[13],Nt=w[14],jt=w[15];W+=(f=N[0])*Ct,Z+=f*Mt,Y+=f*Lt,g+=f*Et,d+=f*qt,m+=f*Ft,A+=f*$t,B+=f*J,U+=f*tt,z+=f*ct,ut+=f*wt,st+=f*kt,ht+=f*Ut,I+=f*At,D+=f*Nt,x+=f*jt,Z+=(f=N[1])*Ct,Y+=f*Mt,g+=f*Lt,d+=f*Et,m+=f*qt,A+=f*Ft,B+=f*$t,U+=f*J,z+=f*tt,ut+=f*ct,st+=f*wt,ht+=f*kt,I+=f*Ut,D+=f*At,x+=f*Nt,T+=f*jt,Y+=(f=N[2])*Ct,g+=f*Mt,d+=f*Lt,m+=f*Et,A+=f*qt,B+=f*Ft,U+=f*$t,z+=f*J,ut+=f*tt,st+=f*ct,ht+=f*wt,I+=f*kt,D+=f*Ut,x+=f*At,T+=f*Nt,R+=f*jt,g+=(f=N[3])*Ct,d+=f*Mt,m+=f*Lt,A+=f*Et,B+=f*qt,U+=f*Ft,z+=f*$t,ut+=f*J,st+=f*tt,ht+=f*ct,I+=f*wt,D+=f*kt,x+=f*Ut,T+=f*At,R+=f*Nt,L+=f*jt,d+=(f=N[4])*Ct,m+=f*Mt,A+=f*Lt,B+=f*Et,U+=f*qt,z+=f*Ft,ut+=f*$t,st+=f*J,ht+=f*tt,I+=f*ct,D+=f*wt,x+=f*kt,T+=f*Ut,R+=f*At,L+=f*Nt,v+=f*jt,m+=(f=N[5])*Ct,A+=f*Mt,B+=f*Lt,U+=f*Et,z+=f*qt,ut+=f*Ft,st+=f*$t,ht+=f*J,I+=f*tt,D+=f*ct,x+=f*wt,T+=f*kt,R+=f*Ut,L+=f*At,v+=f*Nt,b+=f*jt,A+=(f=N[6])*Ct,B+=f*Mt,U+=f*Lt,z+=f*Et,ut+=f*qt,st+=f*Ft,ht+=f*$t,I+=f*J,D+=f*tt,x+=f*ct,T+=f*wt,R+=f*kt,L+=f*Ut,v+=f*At,b+=f*Nt,rt+=f*jt,B+=(f=N[7])*Ct,U+=f*Mt,z+=f*Lt,ut+=f*Et,st+=f*qt,ht+=f*Ft,I+=f*$t,D+=f*J,x+=f*tt,T+=f*ct,R+=f*wt,L+=f*kt,v+=f*Ut,b+=f*At,rt+=f*Nt,at+=f*jt,U+=(f=N[8])*Ct,z+=f*Mt,ut+=f*Lt,st+=f*Et,ht+=f*qt,I+=f*Ft,D+=f*$t,x+=f*J,T+=f*tt,R+=f*ct,L+=f*wt,v+=f*kt,b+=f*Ut,rt+=f*At,at+=f*Nt,St+=f*jt,z+=(f=N[9])*Ct,ut+=f*Mt,st+=f*Lt,ht+=f*Et,I+=f*qt,D+=f*Ft,x+=f*$t,T+=f*J,R+=f*tt,L+=f*ct,v+=f*wt,b+=f*kt,rt+=f*Ut,at+=f*At,St+=f*Nt,It+=f*jt,ut+=(f=N[10])*Ct,st+=f*Mt,ht+=f*Lt,I+=f*Et,D+=f*qt,x+=f*Ft,T+=f*$t,R+=f*J,L+=f*tt,v+=f*ct,b+=f*wt,rt+=f*kt,at+=f*Ut,St+=f*At,It+=f*Nt,zt+=f*jt,st+=(f=N[11])*Ct,ht+=f*Mt,I+=f*Lt,D+=f*Et,x+=f*qt,T+=f*Ft,R+=f*$t,L+=f*J,v+=f*tt,b+=f*ct,rt+=f*wt,at+=f*kt,St+=f*Ut,It+=f*At,zt+=f*Nt,Dt+=f*jt,ht+=(f=N[12])*Ct,I+=f*Mt,D+=f*Lt,x+=f*Et,T+=f*qt,R+=f*Ft,L+=f*$t,v+=f*J,b+=f*tt,rt+=f*ct,at+=f*wt,St+=f*kt,It+=f*Ut,zt+=f*At,Dt+=f*Nt,Wt+=f*jt,I+=(f=N[13])*Ct,D+=f*Mt,x+=f*Lt,T+=f*Et,R+=f*qt,L+=f*Ft,v+=f*$t,b+=f*J,rt+=f*tt,at+=f*ct,St+=f*wt,It+=f*kt,zt+=f*Ut,Dt+=f*At,Wt+=f*Nt,Xt+=f*jt,D+=(f=N[14])*Ct,x+=f*Mt,T+=f*Lt,R+=f*Et,L+=f*qt,v+=f*Ft,b+=f*$t,rt+=f*J,at+=f*tt,St+=f*ct,It+=f*wt,zt+=f*kt,Dt+=f*Ut,Wt+=f*At,Xt+=f*Nt,Jt+=f*jt,x+=(f=N[15])*Ct,Z+=38*(R+=f*Lt),Y+=38*(L+=f*Et),g+=38*(v+=f*qt),d+=38*(b+=f*Ft),m+=38*(rt+=f*$t),A+=38*(at+=f*J),B+=38*(St+=f*tt),U+=38*(It+=f*ct),z+=38*(zt+=f*wt),ut+=38*(Dt+=f*kt),st+=38*(Wt+=f*Ut),ht+=38*(Xt+=f*At),I+=38*(Jt+=f*Nt),D+=38*(ne+=f*jt),W=(f=(W+=38*(T+=f*Mt))+(K=1)+65535)-65536*(K=Math.floor(f/65536)),Z=(f=Z+K+65535)-65536*(K=Math.floor(f/65536)),Y=(f=Y+K+65535)-65536*(K=Math.floor(f/65536)),g=(f=g+K+65535)-65536*(K=Math.floor(f/65536)),d=(f=d+K+65535)-65536*(K=Math.floor(f/65536)),m=(f=m+K+65535)-65536*(K=Math.floor(f/65536)),A=(f=A+K+65535)-65536*(K=Math.floor(f/65536)),B=(f=B+K+65535)-65536*(K=Math.floor(f/65536)),U=(f=U+K+65535)-65536*(K=Math.floor(f/65536)),z=(f=z+K+65535)-65536*(K=Math.floor(f/65536)),ut=(f=ut+K+65535)-65536*(K=Math.floor(f/65536)),st=(f=st+K+65535)-65536*(K=Math.floor(f/65536)),ht=(f=ht+K+65535)-65536*(K=Math.floor(f/65536)),I=(f=I+K+65535)-65536*(K=Math.floor(f/65536)),D=(f=D+K+65535)-65536*(K=Math.floor(f/65536)),x=(f=x+K+65535)-65536*(K=Math.floor(f/65536)),W=(f=(W+=K-1+37*(K-1))+(K=1)+65535)-65536*(K=Math.floor(f/65536)),Z=(f=Z+K+65535)-65536*(K=Math.floor(f/65536)),Y=(f=Y+K+65535)-65536*(K=Math.floor(f/65536)),g=(f=g+K+65535)-65536*(K=Math.floor(f/65536)),d=(f=d+K+65535)-65536*(K=Math.floor(f/65536)),m=(f=m+K+65535)-65536*(K=Math.floor(f/65536)),A=(f=A+K+65535)-65536*(K=Math.floor(f/65536)),B=(f=B+K+65535)-65536*(K=Math.floor(f/65536)),U=(f=U+K+65535)-65536*(K=Math.floor(f/65536)),z=(f=z+K+65535)-65536*(K=Math.floor(f/65536)),ut=(f=ut+K+65535)-65536*(K=Math.floor(f/65536)),st=(f=st+K+65535)-65536*(K=Math.floor(f/65536)),ht=(f=ht+K+65535)-65536*(K=Math.floor(f/65536)),I=(f=I+K+65535)-65536*(K=Math.floor(f/65536)),D=(f=D+K+65535)-65536*(K=Math.floor(f/65536)),x=(f=x+K+65535)-65536*(K=Math.floor(f/65536)),W+=K-1+37*(K-1),S[0]=W,S[1]=Z,S[2]=Y,S[3]=g,S[4]=d,S[5]=m,S[6]=A,S[7]=B,S[8]=U,S[9]=z,S[10]=ut,S[11]=st,S[12]=ht,S[13]=I,S[14]=D,S[15]=x}function V(S,N){$(S,N,N)}function Q(S,N){var w,f=t();for(w=0;w<16;w++)f[w]=N[w];for(w=253;w>=0;w--)V(f,f),w!==2&&w!==4&&$(f,f,N);for(w=0;w<16;w++)S[w]=f[w]}function et(S,N,w){var f,K,W=new Uint8Array(32),Z=new Float64Array(80),Y=t(),g=t(),d=t(),m=t(),A=t(),B=t();for(K=0;K<31;K++)W[K]=N[K];for(W[31]=127&N[31]|64,W[0]&=248,E(Z,w),K=0;K<16;K++)g[K]=Z[K],m[K]=Y[K]=d[K]=0;for(Y[0]=m[0]=1,K=254;K>=0;--K)O(Y,g,f=W[K>>>3]>>>(7&K)&1),O(d,m,f),G(A,Y,d),q(Y,Y,d),G(d,g,m),q(g,g,m),V(m,A),V(B,Y),$(Y,d,Y),$(d,g,A),G(A,Y,d),q(Y,Y,d),V(g,Y),q(d,m,B),$(Y,d,o),G(Y,Y,m),$(d,d,Y),$(Y,m,B),$(m,g,Z),V(g,A),O(Y,g,f),O(d,m,f);for(K=0;K<16;K++)Z[K+16]=Y[K],Z[K+32]=d[K],Z[K+48]=g[K],Z[K+64]=m[K];var U=Z.subarray(32),z=Z.subarray(16);return Q(U,U),$(z,z,U),H(S,z),0}function nt(S,N){return et(S,N,i)}function ft(S,N){var w=t(),f=t(),K=t(),W=t(),Z=t(),Y=t(),g=t(),d=t(),m=t();q(w,S[1],S[0]),q(m,N[1],N[0]),$(w,w,m),G(f,S[0],S[1]),G(m,N[0],N[1]),$(f,f,m),$(K,S[3],N[3]),$(K,K,c),$(W,S[2],N[2]),G(W,W,W),q(Z,f,w),q(Y,W,K),G(g,W,K),G(d,f,w),$(S[0],Z,Y),$(S[1],d,g),$(S[2],g,Y),$(S[3],Z,d)}function lt(S,N,w){var f;for(f=0;f<4;f++)O(S[f],N[f],w)}function M(S,N){var w=t(),f=t(),K=t();Q(K,N[2]),$(w,N[0],K),$(f,N[1],K),H(S,f),S[31]^=F(w)<<7}function dt(S,N,w){var f,K;for(P(S[0],a),P(S[1],s),P(S[2],s),P(S[3],a),K=255;K>=0;--K)lt(S,N,f=w[K/8|0]>>(7&K)&1),ft(N,S),ft(S,S),lt(S,N,f)}function Pt(S,N){var w=[t(),t(),t(),t()];P(w[0],h),P(w[1],l),P(w[2],s),$(w[3],h,l),dt(S,w,N)}function j(S,N,w){var f,K,W=[t(),t(),t(),t()];for(w||n(N,32),(f=e.hash(N.subarray(0,32)))[0]&=248,f[31]&=127,f[31]|=64,Pt(W,f),M(S,W),K=0;K<32;K++)N[K+32]=S[K];return 0}var it=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function mt(S,N){var w,f,K,W;for(f=63;f>=32;--f){for(w=0,K=f-32,W=f-12;K>4)*it[K],w=N[K]>>8,N[K]&=255;for(K=0;K<32;K++)N[K]-=w*it[K];for(f=0;f<32;f++)N[f+1]+=N[f]>>8,S[f]=255&N[f]}function bt(S){var N,w=new Float64Array(64);for(N=0;N<64;N++)w[N]=S[N];for(N=0;N<64;N++)S[N]=0;mt(S,w)}function yt(S,N){var w=t(),f=t(),K=t(),W=t(),Z=t(),Y=t(),g=t();return P(S[2],s),E(S[1],N),V(K,S[1]),$(W,K,u),q(K,K,S[2]),G(W,S[2],W),V(Z,W),V(Y,Z),$(g,Y,Z),$(w,g,K),$(w,w,W),function(d,m){var A,B=t();for(A=0;A<16;A++)B[A]=m[A];for(A=250;A>=0;A--)V(B,B),A!==1&&$(B,B,m);for(A=0;A<16;A++)d[A]=B[A]}(w,w),$(w,w,K),$(w,w,W),$(w,w,W),$(S[0],w,W),V(f,S[0]),$(f,f,W),X(f,K)&&$(S[0],S[0],k),V(f,S[0]),$(f,f,W),X(f,K)?-1:(F(S[0])===N[31]>>7&&q(S[0],a,S[0]),$(S[3],S[0],S[1]),0)}var pt=64;function gt(){for(var S=0;S=0},e.sign.keyPair=function(){var S=new Uint8Array(32),N=new Uint8Array(64);return j(S,N),{publicKey:S,secretKey:N}},e.sign.keyPair.fromSecretKey=function(S){if(gt(S),S.length!==64)throw Error("bad secret key size");for(var N=new Uint8Array(32),w=0;w"u"||!crypto.getRandomValues)throw Error("No secure random number generator available.");crypto.getRandomValues(e)}return e}async function kr(r,e){const t=await _.getBigInteger();if(e.lt(r))throw Error("Illegal parameter value: max <= min");const n=e.sub(r),i=n.byteLength();return new t(await Ee(i+8)).mod(n).add(r)}var Mu=Object.freeze({__proto__:null,getRandomBytes:Ee,getRandomBigInteger:kr});async function i0(r,e,t){const n=await _.getBigInteger(),i=new n(1),a=i.leftShift(new n(r-1)),s=new n(30),o=[1,6,5,4,3,2,1,4,3,2,1,2,1,4,3,2,1,2,1,4,3,2,1,6,5,4,3,2,1,2],u=await kr(a,a.leftShift(i));let c=u.mod(s).toNumber();do u.iadd(new n(o[c])),c=(c+o[c])%o.length,u.bitLength()>r&&(u.imod(a.leftShift(i)).iadd(a),c=u.mod(s).toNumber());while(!await A2(u,e,t));return u}async function A2(r,e,t){return!(e&&!r.dec().gcd(e).isOne())&&!!await async function(n){const i=await _.getBigInteger();return Nu.every(a=>n.mod(new i(a))!==0)}(r)&&!!await async function(n,i){const a=await _.getBigInteger();return i=i||new a(2),i.modExp(n.dec(),n).isOne()}(r)&&!!await async function(n,i,a){const s=await _.getBigInteger(),o=n.bitLength();i||(i=Math.max(1,o/48|0));const u=n.dec();let c=0;for(;!u.getBit(c);)c++;const h=n.rightShift(new s(c));for(;i>0;i--){let l,k=(await kr(new s(2),u)).modExp(h,n);if(!k.isOne()&&!k.equal(u)){for(l=1;le-11)throw Error("Message too long");const n=function(a){const s=new Uint8Array(a);let o=0;for(;o=8&!n;if(e)return _.selectUint8Array(s,a,e);if(s)return a;throw Error("Decryption error")}async function Bs(r,e,t){let n;if(e.length!==Ke.getHashByteLength(r))throw Error("Invalid hash length");const i=new Uint8Array(je[r].length);for(n=0;n{const{default:et}=await import("./bn.min-S9Cz8dhG.js");return{default:et}},[],import.meta.url),X=new H(P),F=new H(C),E=new H(y),G=E.mod(F.subn(1)),q=E.mod(X.subn(1)),$=ge.createSign(p.read(p.hash,c));$.write(h),$.end();const V={version:0,modulus:new H(l),publicExponent:new H(k),privateExponent:new H(y),prime1:new H(C),prime2:new H(P),exponent1:G,exponent2:q,coefficient:new H(O)};if(ge.createPrivateKey!==void 0){const et=gn.encode(V,"der");return new Uint8Array($.sign({key:et,format:"der",type:"pkcs1"}))}const Q=gn.encode(V,"pem",{label:"RSA PRIVATE KEY"});return new Uint8Array($.sign(Q))}(r,e,t,n,i,a,s,o)}return async function(c,h,l,k){const y=await _.getBigInteger();h=new y(h);const P=new y(await Bs(c,k,h.byteLength()));if(l=new y(l),P.gte(h))throw Error("Message size cannot exceed modulus size");return P.modExp(l,h).toUint8Array("be",h.byteLength())}(r,t,i,u)},verify:async function(r,e,t,n,i,a){if(e&&!_.isStream(e)){if(_.getWebCrypto())try{return await async function(s,o,u,c,h){const l=function(y,P){return{kty:"RSA",n:Ae(y,!0),e:Ae(P,!0),ext:!0}}(c,h),k=await pn.importKey("jwk",l,{name:"RSASSA-PKCS1-v1_5",hash:{name:s}},!1,["verify"]);return pn.verify("RSASSA-PKCS1-v1_5",k,u,o)}(p.read(p.webHash,r),e,t,n,i)}catch(s){_.printDebugError(s)}else if(_.getNodeCrypto())return async function(s,o,u,c,h){const{default:l}=await Vr(async()=>{const{default:C}=await import("./bn.min-S9Cz8dhG.js");return{default:C}},[],import.meta.url),k=ge.createVerify(p.read(p.hash,s));k.write(o),k.end();const y={modulus:new l(c),publicExponent:new l(h)};let P;ge.createPrivateKey!==void 0?P={key:Hi.encode(y,"der"),format:"der",type:"pkcs1"}:P=Hi.encode(y,"pem",{label:"RSA PUBLIC KEY"});try{return await k.verify(P,u)}catch{return!1}}(r,e,t,n,i)}return async function(s,o,u,c,h){const l=await _.getBigInteger();if(u=new l(u),o=new l(o),c=new l(c),o.gte(u))throw Error("Signature size cannot exceed modulus size");const k=o.modExp(c,u).toUint8Array("be",u.byteLength()),y=await Bs(s,h,u.byteLength());return _.equalsUint8Array(k,y)}(r,t,n,i,a)},encrypt:async function(r,e,t){return _.getNodeCrypto()?async function(n,i,a){const{default:s}=await Vr(async()=>{const{default:c}=await import("./bn.min-S9Cz8dhG.js");return{default:c}},[],import.meta.url),o={modulus:new s(i),publicExponent:new s(a)};let u;return ge.createPrivateKey!==void 0?u={key:Hi.encode(o,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:u={key:Hi.encode(o,"pem",{label:"RSA PUBLIC KEY"}),padding:ge.constants.RSA_PKCS1_PADDING},new Uint8Array(ge.publicEncrypt(u,n))}(r,e,t):async function(n,i,a){const s=await _.getBigInteger();if(i=new s(i),n=new s(t1(n,i.byteLength())),a=new s(a),n.gte(i))throw Error("Message size cannot exceed modulus size");return n.modExp(a,i).toUint8Array("be",i.byteLength())}(r,e,t)},decrypt:async function(r,e,t,n,i,a,s,o){if(_.getNodeCrypto()&&!o)try{return await async function(u,c,h,l,k,y,P){const{default:C}=await Vr(async()=>{const{default:$}=await import("./bn.min-S9Cz8dhG.js");return{default:$}},[],import.meta.url),O=new C(k),H=new C(y),X=new C(l),F=X.mod(H.subn(1)),E=X.mod(O.subn(1)),G={version:0,modulus:new C(c),publicExponent:new C(h),privateExponent:new C(l),prime1:new C(y),prime2:new C(k),exponent1:F,exponent2:E,coefficient:new C(P)};let q;ge.createPrivateKey!==void 0?q={key:gn.encode(G,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:q={key:gn.encode(G,"pem",{label:"RSA PRIVATE KEY"}),padding:ge.constants.RSA_PKCS1_PADDING};try{return new Uint8Array(ge.privateDecrypt(q,u))}catch{throw Error("Decryption error")}}(r,e,t,n,i,a,s)}catch(u){_.printDebugError(u)}return async function(u,c,h,l,k,y,P,C){const O=await _.getBigInteger();if(u=new O(u),c=new O(c),h=new O(h),l=new O(l),k=new O(k),y=new O(y),P=new O(P),u.gte(c))throw Error("Data too large.");const H=l.mod(y.dec()),X=l.mod(k.dec()),F=(await kr(new O(2),c)).mod(c),E=F.modInv(c).modExp(h,c);u=u.mul(E).mod(c);const G=u.modExp(X,k),q=u.modExp(H,y);let V=P.mul(q.sub(G)).mod(y).mul(k).add(G);return V=V.mul(F).mod(c),e1(V.toUint8Array("be",c.byteLength()),C)}(r,e,t,n,i,a,s,o)},generate:async function(r,e){if(e=new(await _.getBigInteger())(e),_.getWebCrypto()){const s={name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:e.toUint8Array(),hash:{name:"SHA-1"}},o=await pn.generateKey(s,!0,["sign","verify"]),u=await pn.exportKey("jwk",o.privateKey);return{n:dr(u.n),e:e.toUint8Array(),d:dr(u.d),p:dr(u.q),q:dr(u.p),u:dr(u.qi)}}if(_.getNodeCrypto()&&ge.generateKeyPair&&gn){const s={modulusLength:r,publicExponent:e.toNumber(),publicKeyEncoding:{type:"pkcs1",format:"der"},privateKeyEncoding:{type:"pkcs1",format:"der"}},o=await new Promise((u,c)=>{ge.generateKeyPair("rsa",s,(h,l,k)=>{h?c(h):u(gn.decode(k,"der"))})});return{n:o.modulus.toArrayLike(Uint8Array),e:o.publicExponent.toArrayLike(Uint8Array),d:o.privateExponent.toArrayLike(Uint8Array),p:o.prime2.toArrayLike(Uint8Array),q:o.prime1.toArrayLike(Uint8Array),u:o.coefficient.toArrayLike(Uint8Array)}}let t,n,i;do n=await i0(r-(r>>1),e,40),t=await i0(r>>1,e,40),i=t.mul(n);while(i.bitLength()!==r);const a=t.dec().imul(n.dec());return n.lt(t)&&([t,n]=[n,t]),{n:i.toUint8Array(),e:e.toUint8Array(),d:e.modInv(a).toUint8Array(),p:t.toUint8Array(),q:n.toUint8Array(),u:t.modInv(n).toUint8Array()}},validateParams:async function(r,e,t,n,i,a){const s=await _.getBigInteger();if(r=new s(r),n=new s(n),i=new s(i),!n.mul(i).equal(r))return!1;const o=new s(2);if(a=new s(a),!n.mul(a).mod(i).isOne())return!1;e=new s(e),t=new s(t);const u=new s(Math.floor(r.bitLength()/3)),c=await kr(o,o.leftShift(u)),h=c.mul(t).mul(e);return!(!h.mod(n.dec()).equal(c)||!h.mod(i.dec()).equal(c))}}),$u=Object.freeze({__proto__:null,encrypt:async function(r,e,t,n){const i=await _.getBigInteger();e=new i(e),t=new i(t),n=new i(n);const a=new i(t1(r,e.byteLength())),s=await kr(new i(1),e.dec());return{c1:t.modExp(s,e).toUint8Array(),c2:n.modExp(s,e).imul(a).imod(e).toUint8Array()}},decrypt:async function(r,e,t,n,i){const a=await _.getBigInteger();return r=new a(r),e=new a(e),t=new a(t),n=new a(n),e1(r.modExp(n,t).modInv(t).imul(e).imod(t).toUint8Array("be",t.byteLength()),i)},validateParams:async function(r,e,t,n){const i=await _.getBigInteger();r=new i(r),e=new i(e),t=new i(t);const a=new i(1);if(e.lte(a)||e.gte(r))return!1;const s=new i(r.bitLength()),o=new i(1023);if(s.lt(o)||!e.modExp(r.dec(),r).isOne())return!1;let u=e;const c=new i(1),h=new i(2).leftShift(new i(17));for(;c.lt(h);){if(u=u.mul(e).imod(r),u.isOne())return!1;c.iinc()}n=new i(n);const l=new i(2),k=await kr(l.leftShift(s.dec()),l.leftShift(s)),y=r.dec().imul(k).iadd(n);return!!t.equal(e.modExp(y,r))}});class Ve{constructor(e){if(e instanceof Ve)this.oid=e.oid;else if(_.isArray(e)||_.isUint8Array(e)){if((e=new Uint8Array(e))[0]===6){if(e[1]!==e.length-2)throw Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw Error("Invalid oid")}write(){return _.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return _.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(p.curve[e])return p.write(p.curve,e);throw Error("Unknown curve object identifier.")}}function Ia(r,e){return r.keyPair({priv:e})}function Ba(r,e){const t=r.keyPair({pub:e});if(t.validate().result!==!0)throw Error("Invalid elliptic public key");return t}async function Rn(r){if(!vt.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:e}=await Vr(async()=>{const{default:t}=await import("./elliptic.min-ClIauaBs.js");return{default:t}},__vite__mapDeps([2,1]),import.meta.url);return new e.ec(r)}function E2(r){let e,t=0;const n=r[0];return n<192?([t]=r,e=1):n<255?(t=(r[0]-192<<8)+r[1]+192,e=2):n===255&&(t=_.readNumber(r.subarray(1,5)),e=5),{len:t,offset:e}}function Ki(r){return r<192?new Uint8Array([r]):r>191&&r<8384?new Uint8Array([192+(r-192>>8),r-192&255]):_.concatUint8Array([new Uint8Array([255]),_.writeNumber(r,4)])}function qu(r){if(r<0||r>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+r])}function S2(r){return new Uint8Array([192|r])}function a0(r,e){return _.concatUint8Array([S2(r),Ki(e)])}function Zi(r){return[p.packet.literalData,p.packet.compressedData,p.packet.symmetricallyEncryptedData,p.packet.symEncryptedIntegrityProtectedData,p.packet.aeadEncryptedData].includes(r)}async function ju(r,e){const t=on(r);let n,i;try{const a=await t.peekBytes(2);if(!a||a.length<2||!(128&a[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const s=await t.readByte();let o,u,c=-1,h=-1;h=0,64&s&&(h=1),h?c=63&s:(c=(63&s)>>2,u=3&s);const l=Zi(c);let k,y=null;if(l){if(_.isStream(r)==="array"){const C=new Qe;n=Oe(C),y=C}else{const C=new Ws;n=Oe(C.writable),y=C.readable}i=e({tag:c,packet:y})}else y=[];do{if(h){const C=await t.readByte();if(k=!1,C<192)o=C;else if(C>=192&&C<224)o=(C-192<<8)+await t.readByte()+192;else if(C>223&&C<255){if(o=1<<(31&C),k=!0,!l)throw new TypeError("This packet type does not support partial lengths.")}else o=await t.readByte()<<24|await t.readByte()<<16|await t.readByte()<<8|await t.readByte()}else switch(u){case 0:o=await t.readByte();break;case 1:o=await t.readByte()<<8|await t.readByte();break;case 2:o=await t.readByte()<<24|await t.readByte()<<16|await t.readByte()<<8|await t.readByte();break;default:o=1/0}if(o>0){let C=0;for(;;){n&&await n.ready;const{done:O,value:H}=await t.read();if(O){if(o===1/0)break;throw Error("Unexpected end of packet")}const X=o===1/0?H:H.subarray(0,o-C);if(n?await n.write(X):y.push(X),C+=H.length,C>=o){t.unshift(H.subarray(o-C+H.length));break}}}}while(k);const P=await t.peekBytes(l?1/0:2);return n?(await n.ready,await n.close()):(y=_.concatUint8Array(y),await e({tag:c,packet:y})),!P||!P.length}catch(a){if(n)return await n.abort(a),!0;throw a}finally{n&&await i,t.releaseLock()}}class re extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,re),this.name="UnsupportedError"}}class Ts{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const es=_.getWebCrypto(),la=_.getNodeCrypto(),nr={p256:"P-256",p384:"P-384",p521:"P-521"},cr=la?la.getCurves():[],Kr=la?{secp256k1:cr.includes("secp256k1")?"secp256k1":void 0,p256:cr.includes("prime256v1")?"prime256v1":void 0,p384:cr.includes("secp384r1")?"secp384r1":void 0,p521:cr.includes("secp521r1")?"secp521r1":void 0,ed25519:cr.includes("ED25519")?"ED25519":void 0,curve25519:cr.includes("X25519")?"X25519":void 0,brainpoolP256r1:cr.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:cr.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:cr.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Qi={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Kr.p256,web:nr.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:p.publicKey.ecdsa,hash:p.hash.sha384,cipher:p.symmetric.aes192,node:Kr.p384,web:nr.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:p.publicKey.ecdsa,hash:p.hash.sha512,cipher:p.symmetric.aes256,node:Kr.p521,web:nr.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Kr.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:p.publicKey.eddsaLegacy,hash:p.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:p.publicKey.ecdh,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Kr.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:p.publicKey.ecdsa,hash:p.hash.sha384,cipher:p.symmetric.aes192,node:Kr.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:p.publicKey.ecdsa,hash:p.hash.sha512,cipher:p.symmetric.aes256,node:Kr.brainpoolP512r1,payloadSize:64}};class vr{constructor(e,t){try{(_.isArray(e)||_.isUint8Array(e))&&(e=new Ve(e)),e instanceof Ve&&(e=e.getName()),this.name=p.write(p.curve,e)}catch{throw new re("Unknown curve")}t=t||Qi[this.name],this.keyType=t.keyType,this.oid=t.oid,this.hash=t.hash,this.cipher=t.cipher,this.node=t.node&&Qi[this.name],this.web=t.web&&Qi[this.name],this.payloadSize=t.payloadSize,this.web&&_.getWebCrypto()?this.type="web":this.node&&_.getNodeCrypto()?this.type="node":this.name==="curve25519"?this.type="curve25519":this.name==="ed25519"&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(n){const i=await es.generateKey({name:"ECDSA",namedCurve:nr[n]},!0,["sign","verify"]),a=await es.exportKey("jwk",i.privateKey),s=await es.exportKey("jwk",i.publicKey);return{publicKey:U2(s),privateKey:dr(a.d)}}(this.name)}catch(n){_.printDebugError("Browser did not support generating ec key "+n.message);break}case"node":return async function(n){const i=la.createECDH(Kr[n]);return await i.generateKeys(),{publicKey:new Uint8Array(i.getPublicKey()),privateKey:new Uint8Array(i.getPrivateKey())}}(this.name);case"curve25519":{const n=Ee(32);n[0]=127&n[0]|64,n[31]&=248;const i=n.slice().reverse();return e=ee.box.keyPair.fromSecretKey(i),{publicKey:_.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:n}}case"ed25519":{const n=Ee(32),i=ee.sign.keyPair.fromSeed(n);return{publicKey:_.concatUint8Array([new Uint8Array([64]),i.publicKey]),privateKey:n}}}return e=await(await Rn(this.name)).genKeyPair({entropy:_.uint8ArrayToString(Ee(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function P2(r,e,t,n){const i={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:r===p.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=e.getName();if(!i[a])return!1;if(a==="curve25519"){n=n.slice().reverse();const{publicKey:o}=ee.box.keyPair.fromSecretKey(n);t=new Uint8Array(t);const u=new Uint8Array([64,...o]);return!!_.equalsUint8Array(u,t)}const s=await Rn(a);try{t=Ba(s,t).getPublic()}catch{return!1}return!!Ia(s,n).getPublic().eq(t)}function U2(r){const e=dr(r.x),t=dr(r.y),n=new Uint8Array(e.length+t.length+1);return n[0]=4,n.set(e,1),n.set(t,e.length+1),n}function Ta(r,e,t){const n=r,i=t.slice(1,n+1),a=t.slice(n+1,2*n+1);return{kty:"EC",crv:e,x:Ae(i),y:Ae(a),ext:!0}}function K2(r,e,t,n){const i=Ta(r,e,t);return i.d=Ae(n),i}const fa=_.getWebCrypto(),zn=_.getNodeCrypto();async function s0(r,e,t,n,i,a){const s=new vr(r);if(t&&!_.isStream(t)){const o={publicKey:n,privateKey:i};switch(s.type){case"web":try{return await async function(u,c,h,l){const k=u.payloadSize,y=K2(u.payloadSize,nr[u.name],l.publicKey,l.privateKey),P=await fa.importKey("jwk",y,{name:"ECDSA",namedCurve:nr[u.name],hash:{name:p.read(p.webHash,u.hash)}},!1,["sign"]),C=new Uint8Array(await fa.sign({name:"ECDSA",namedCurve:nr[u.name],hash:{name:p.read(p.webHash,c)}},P,h));return{r:C.slice(0,k),s:C.slice(k,k<<1)}}(s,e,t,o)}catch(u){if(s.name!=="p521"&&(u.name==="DataError"||u.name==="OperationError"))throw u;_.printDebugError("Browser did not support signing: "+u.message)}break;case"node":{const u=await async function(c,h,l,k){const y=zn.createSign(p.read(p.hash,h));y.write(l),y.end();const P=Gu.encode({version:1,parameters:c.oid,privateKey:Array.from(k.privateKey),publicKey:{unused:0,data:Array.from(k.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return C2.decode(y.sign(P),"der")}(s,e,t,o);return{r:u.r.toArrayLike(Uint8Array),s:u.s.toArrayLike(Uint8Array)}}}}return async function(o,u,c){const h=await Rn(o.name),l=Ia(h,c),k=l.sign(u);return{r:k.r.toArrayLike(Uint8Array),s:k.s.toArrayLike(Uint8Array)}}(s,a,i)}async function o0(r,e,t,n,i,a){const s=new vr(r);if(n&&!_.isStream(n))switch(s.type){case"web":try{return await async function(o,u,{r:c,s:h},l,k){const y=Ta(o.payloadSize,nr[o.name],k),P=await fa.importKey("jwk",y,{name:"ECDSA",namedCurve:nr[o.name],hash:{name:p.read(p.webHash,o.hash)}},!1,["verify"]),C=_.concatUint8Array([c,h]).buffer;return fa.verify({name:"ECDSA",namedCurve:nr[o.name],hash:{name:p.read(p.webHash,u)}},P,C,l)}(s,e,t,n,i)}catch(o){if(s.name!=="p521"&&(o.name==="DataError"||o.name==="OperationError"))throw o;_.printDebugError("Browser did not support verifying: "+o.message)}break;case"node":return async function(o,u,{r:c,s:h},l,k){const{default:y}=await Vr(async()=>{const{default:H}=await import("./bn.min-S9Cz8dhG.js");return{default:H}},[],import.meta.url),P=zn.createVerify(p.read(p.hash,u));P.write(l),P.end();const C=Vu.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:o.oid},subjectPublicKey:{unused:0,data:Array.from(k)}},"pem",{label:"PUBLIC KEY"}),O=C2.encode({r:new y(c),s:new y(h)},"der");try{return P.verify(C,O)}catch{return!1}}(s,e,t,n,i)}return async function(o,u,c,h){const l=await Rn(o.name);return Ba(l,h).verify(c,u)}(s,t,e===void 0?n:a,i)}const Ra=void 0,C2=zn?Ra.define("ECDSASignature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}):void 0,Gu=zn?Ra.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())}):void 0,Wu=zn?Ra.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())}):void 0,Vu=zn?Ra.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Wu),this.key("subjectPublicKey").bitstr())}):void 0;var Zu=Object.freeze({__proto__:null,sign:s0,verify:o0,validateParams:async function(r,e,t){const n=new vr(r);if(n.keyType!==p.publicKey.ecdsa)return!1;switch(n.type){case"web":case"node":{const i=Ee(8),a=p.hash.sha256,s=await Ke.digest(a,i);try{const o=await s0(r,a,i,e,t,s);return await o0(r,a,o,i,e,s)}catch{return!1}}default:return P2(p.publicKey.ecdsa,r,e,t)}}});ee.hash=r=>new Uint8Array(Ui().update(r).digest());var Qu=Object.freeze({__proto__:null,sign:async function(r,e,t,n,i,a){if(Ke.getHashByteLength(e)new Uint8Array(Ui().update(r).digest());var Xu=Object.freeze({__proto__:null,generate:async function(r){if(r===p.publicKey.ed25519){const e=Ee(32),{publicKey:t}=ee.sign.keyPair.fromSeed(e);return{A:t,seed:e}}throw Error("Unsupported EdDSA algorithm")},sign:async function(r,e,t,n,i,a){if(Ke.getHashByteLength(e)=0;--h)for(let l=o-1;l>=0;--l)u[1]=o*h+(l+1),c[0]=a[0]^u[0],c[1]=a[1]^u[1],c[2]=s[2*l],c[3]=s[2*l+1],c=da(t.decrypt(ya(c))),a=c.subarray(0,2),s[2*l]=c[2],s[2*l+1]=c[3];if(a[0]===n[0]&&a[1]===n[1])return ya(s);throw Error("Key Data Integrity failed")}function da(r){const{length:e}=r,t=function(a){if(_.isString(a)){const{length:s}=a,o=new ArrayBuffer(s),u=new Uint8Array(o);for(let c=0;c0){const t=r[e-1];if(t>=1){const n=r.subarray(e-t),i=new Uint8Array(t).fill(t);if(_.equalsUint8Array(n,i))return r.subarray(0,e-t)}}throw Error("Invalid padding")}var Ju=Object.freeze({__proto__:null,encode:D2,decode:x2});const Tr=_.getWebCrypto(),I2=_.getNodeCrypto();function c0(r,e,t,n){return _.concatUint8Array([e.write(),new Uint8Array([r]),t.write(),_.stringToUint8Array("Anonymous Sender "),n.subarray(0,20)])}async function u0(r,e,t,n,i=!1,a=!1){let s;if(i){for(s=0;s=0&&e[s]===0;s--);e=e.subarray(0,s+1)}return(await Ke.digest(r,_.concatUint8Array([new Uint8Array([0,0,0,1]),e,n]))).subarray(0,t)}async function t3(r,e){switch(r.type){case"curve25519":{const t=Ee(32),{secretKey:n,sharedKey:i}=await B2(r,e,null,t);let{publicKey:a}=ee.box.keyPair.fromSecretKey(n);return a=_.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:i}}case"web":if(r.web&&_.getWebCrypto())try{return await async function(t,n){const i=Ta(t.payloadSize,t.web.web,n);let a=Tr.generateKey({name:"ECDH",namedCurve:t.web.web},!0,["deriveKey","deriveBits"]),s=Tr.importKey("jwk",i,{name:"ECDH",namedCurve:t.web.web},!1,[]);[a,s]=await Promise.all([a,s]);let o=Tr.deriveBits({name:"ECDH",namedCurve:t.web.web,public:s},a.privateKey,t.web.sharedSize),u=Tr.exportKey("jwk",a.publicKey);[o,u]=await Promise.all([o,u]);const c=new Uint8Array(o);return{publicKey:new Uint8Array(U2(u)),sharedKey:c}}(r,e)}catch(t){_.printDebugError(t)}break;case"node":return async function(t,n){const i=I2.createECDH(t.node.node);i.generateKeys();const a=new Uint8Array(i.computeSecret(n));return{publicKey:new Uint8Array(i.getPublicKey()),sharedKey:a}}(r,e)}return async function(t,n){const i=await Rn(t.name),a=await t.genKeyPair();n=Ba(i,n);const s=Ia(i,a.privateKey),o=a.publicKey,u=s.derive(n.getPublic()),c=i.curve.p.byteLength(),h=u.toArrayLike(Uint8Array,"be",c);return{publicKey:o,sharedKey:h}}(r,e)}async function B2(r,e,t,n){if(n.length!==r.payloadSize){const i=new Uint8Array(r.payloadSize);i.set(n,r.payloadSize-n.length),n=i}switch(r.type){case"curve25519":{const i=n.slice().reverse();return{secretKey:i,sharedKey:ee.scalarMult(i,e.subarray(1))}}case"web":if(r.web&&_.getWebCrypto())try{return await async function(i,a,s,o){const u=K2(i.payloadSize,i.web.web,s,o);let c=Tr.importKey("jwk",u,{name:"ECDH",namedCurve:i.web.web},!0,["deriveKey","deriveBits"]);const h=Ta(i.payloadSize,i.web.web,a);let l=Tr.importKey("jwk",h,{name:"ECDH",namedCurve:i.web.web},!0,[]);[c,l]=await Promise.all([c,l]);let k=Tr.deriveBits({name:"ECDH",namedCurve:i.web.web,public:l},c,i.web.sharedSize),y=Tr.exportKey("jwk",c);[k,y]=await Promise.all([k,y]);const P=new Uint8Array(k);return{secretKey:dr(y.d),sharedKey:P}}(r,e,t,n)}catch(i){_.printDebugError(i)}break;case"node":return async function(i,a,s){const o=I2.createECDH(i.node.node);o.setPrivateKey(s);const u=new Uint8Array(o.computeSecret(a));return{secretKey:new Uint8Array(o.getPrivateKey()),sharedKey:u}}(r,e,n)}return async function(i,a,s){const o=await Rn(i.name);a=Ba(o,a),s=Ia(o,s);const u=new Uint8Array(s.getPrivate()),c=s.derive(a.getPublic()),h=o.curve.p.byteLength(),l=c.toArrayLike(Uint8Array,"be",h);return{secretKey:u,sharedKey:l}}(r,e,n)}var e3=Object.freeze({__proto__:null,validateParams:async function(r,e,t){return P2(p.publicKey.ecdh,r,e,t)},encrypt:async function(r,e,t,n,i){const a=D2(t),s=new vr(r),{publicKey:o,sharedKey:u}=await t3(s,n),c=c0(p.publicKey.ecdh,r,e,i),{keySize:h}=rr(e.cipher);return{publicKey:o,wrappedKey:r1(await u0(e.hash,u,h,c),a)}},decrypt:async function(r,e,t,n,i,a,s){const o=new vr(r),{sharedKey:u}=await B2(o,t,i,a),c=c0(p.publicKey.ecdh,r,e,s),{keySize:h}=rr(e.cipher);let l;for(let k=0;k<3;k++)try{return x2(n1(await u0(e.hash,u,h,c,k===1,k===2),n))}catch(y){l=y}throw l}});const h0=_.getWebCrypto(),ci=_.getNodeCrypto(),l0=ci&&ci.webcrypto&&ci.webcrypto.subtle;async function f0(r,e,t,n,i){const a=p.read(p.webHash,r);if(!a)throw Error("Hash algo not supported with HKDF");if(h0||l0){const s=h0||l0,o=await s.importKey("raw",e,"HKDF",!1,["deriveBits"]),u=await s.deriveBits({name:"HKDF",hash:a,salt:t,info:n},o,8*i);return new Uint8Array(u)}if(ci){const s=p.read(p.hash,r),o=(y,P)=>ci.createHmac(s,y).update(P).digest(),u=o(t,e),c=u.length,h=Math.ceil(i/c),l=new Uint8Array(h*c),k=new Uint8Array(c+n.length+1);k.set(n,c);for(let y=0;y0?k:k.subarray(c));k.set(P,0),l.set(P,y*c)}return l.subarray(0,i)}throw Error("No HKDF implementation available")}const d0={x25519:_.encodeUTF8("OpenPGP X25519")};var r3=Object.freeze({__proto__:null,generate:async function(r){if(r===p.publicKey.x25519){const e=Ee(32),{publicKey:t}=ee.box.keyPair.fromSecretKey(e);return{A:t,k:e}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(r,e,t){if(r===p.publicKey.x25519){const{publicKey:n}=ee.box.keyPair.fromSecretKey(t);return _.equalsUint8Array(e,n)}return!1},encrypt:async function(r,e,t){if(r===p.publicKey.x25519){const n=Ee(32),i=ee.scalarMult(n,t),{publicKey:a}=ee.box.keyPair.fromSecretKey(n),s=_.concatUint8Array([a,t,i]),{keySize:o}=rr(p.symmetric.aes128);return{ephemeralPublicKey:a,wrappedKey:r1(await f0(p.hash.sha256,s,new Uint8Array,d0.x25519,o),e)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(r,e,t,n,i){if(r===p.publicKey.x25519){const a=ee.scalarMult(i,e),s=_.concatUint8Array([e,n,a]),{keySize:o}=rr(p.symmetric.aes128);return n1(await f0(p.hash.sha256,s,new Uint8Array,d0.x25519,o),t)}throw Error("Unsupported ECDH algorithm")}}),n3=Object.freeze({__proto__:null,CurveWithOID:vr,ecdh:e3,ecdhX:r3,ecdsa:Zu,eddsaLegacy:Qu,eddsa:Xu,generate:async function(r){const e=await _.getBigInteger();r=new vr(r);const t=await r.genKeyPair(),n=new e(t.publicKey).toUint8Array(),i=new e(t.privateKey).toUint8Array("be",r.payloadSize);return{oid:r.oid,Q:n,secret:i,hash:r.hash,cipher:r.cipher}},getPreferredHashAlgo:function(r){return Qi[p.write(p.curve,r.toHex())].hash}}),i3=Object.freeze({__proto__:null,sign:async function(r,e,t,n,i,a){const s=await _.getBigInteger(),o=new s(1);let u,c,h,l;n=new s(n),i=new s(i),t=new s(t),a=new s(a),t=t.mod(n),a=a.mod(i);const k=new s(e.subarray(0,i.byteLength())).mod(i);for(;;){if(u=await kr(o,i),c=t.modExp(u,n).imod(i),c.isZero())continue;const y=a.mul(c).imod(i);if(l=k.add(y).imod(i),h=u.modInv(i).imul(l).imod(i),!h.isZero())break}return{r:c.toUint8Array("be",i.byteLength()),s:h.toUint8Array("be",i.byteLength())}},verify:async function(r,e,t,n,i,a,s,o){const u=await _.getBigInteger(),c=new u(0);if(e=new u(e),t=new u(t),a=new u(a),s=new u(s),i=new u(i),o=new u(o),e.lte(c)||e.gte(s)||t.lte(c)||t.gte(s))return _.printDebug("invalid DSA Signature"),!1;const h=new u(n.subarray(0,s.byteLength())).imod(s),l=t.modInv(s);if(l.isZero())return _.printDebug("invalid DSA Signature"),!1;i=i.mod(a),o=o.mod(a);const k=h.mul(l).imod(s),y=e.mul(l).imod(s),P=i.modExp(k,a),C=o.modExp(y,a);return P.mul(C).imod(a).imod(s).equal(e)},validateParams:async function(r,e,t,n,i){const a=await _.getBigInteger();r=new a(r),e=new a(e),t=new a(t),n=new a(n);const s=new a(1);if(t.lte(s)||t.gte(r)||!r.dec().mod(e).isZero()||!t.modExp(e,r).isOne())return!1;const o=new a(e.bitLength()),u=new a(150);if(o.lt(u)||!await A2(e,null,32))return!1;i=new a(i);const c=new a(2),h=await kr(c.leftShift(o.dec()),c.leftShift(o)),l=e.mul(h).add(i);return!!n.equal(t.modExp(l,r))}}),Bt={rsa:Hu,elgamal:$u,elliptic:n3,dsa:i3,nacl:ee},a3=Object.freeze({__proto__:null,parseSignatureParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:return{s:_.readMPI(e.subarray(t))};case p.publicKey.dsa:case p.publicKey.ecdsa:{const n=_.readMPI(e.subarray(t));return t+=n.length+2,{r:n,s:_.readMPI(e.subarray(t))}}case p.publicKey.eddsaLegacy:{let n=_.readMPI(e.subarray(t));t+=n.length+2,n=_.leftPad(n,32);let i=_.readMPI(e.subarray(t));return i=_.leftPad(i,32),{r:n,s:i}}case p.publicKey.ed25519:{const n=e.subarray(t,t+64);return t+=n.length,{RS:n}}default:throw new re("Unknown signature algorithm.")}},verify:async function(r,e,t,n,i,a){switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:{const{n:s,e:o}=n,u=_.leftPad(t.s,s.length);return Bt.rsa.verify(e,i,u,s,o,a)}case p.publicKey.dsa:{const{g:s,p:o,q:u,y:c}=n,{r:h,s:l}=t;return Bt.dsa.verify(e,h,l,a,s,o,u,c)}case p.publicKey.ecdsa:{const{oid:s,Q:o}=n,u=new Bt.elliptic.CurveWithOID(s).payloadSize,c=_.leftPad(t.r,u),h=_.leftPad(t.s,u);return Bt.elliptic.ecdsa.verify(s,e,{r:c,s:h},i,o,a)}case p.publicKey.eddsaLegacy:{const{oid:s,Q:o}=n;return Bt.elliptic.eddsaLegacy.verify(s,e,t,i,o,a)}case p.publicKey.ed25519:{const{A:s}=n;return Bt.elliptic.eddsa.verify(r,e,t,i,s,a)}default:throw Error("Unknown signature algorithm.")}},sign:async function(r,e,t,n,i,a){if(!t||!n)throw Error("Missing key parameters");switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:{const{n:s,e:o}=t,{d:u,p:c,q:h,u:l}=n;return{s:await Bt.rsa.sign(e,i,s,o,u,c,h,l,a)}}case p.publicKey.dsa:{const{g:s,p:o,q:u}=t,{x:c}=n;return Bt.dsa.sign(e,a,s,o,u,c)}case p.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case p.publicKey.ecdsa:{const{oid:s,Q:o}=t,{d:u}=n;return Bt.elliptic.ecdsa.sign(s,e,i,o,u,a)}case p.publicKey.eddsaLegacy:{const{oid:s,Q:o}=t,{seed:u}=n;return Bt.elliptic.eddsaLegacy.sign(s,e,i,o,u,a)}case p.publicKey.ed25519:{const{A:s}=t,{seed:o}=n;return Bt.elliptic.eddsa.sign(r,e,i,s,o,a)}default:throw Error("Unknown signature algorithm.")}}});class y0{constructor(e){e&&(this.data=e)}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw Error("Invalid symmetric key")}write(){return _.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class p0{constructor(e){if(e){const{hash:t,cipher:n}=e;this.hash=t,this.cipher=n}else this.hash=null,this.cipher=null}read(e){if(e.length<4||e[0]!==3||e[1]!==1)throw new re("Cannot read KDFParams");return this.hash=e[2],this.cipher=e[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}class pa{static fromObject({wrappedKey:e,algorithm:t}){const n=new pa;return n.wrappedKey=e,n.algorithm=t,n}read(e){let t=0,n=e[t++];this.algorithm=n%2?e[t++]:null,n-=n%2,this.wrappedKey=e.subarray(t,t+n),t+=n}write(){return _.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}function ns(r){try{r.getName()}catch{throw new re("Unknown curve OID")}}var s3=Object.freeze({__proto__:null,publicKeyEncrypt:async function(r,e,t,n,i){switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:{const{n:a,e:s}=t;return{c:await Bt.rsa.encrypt(n,a,s)}}case p.publicKey.elgamal:{const{p:a,g:s,y:o}=t;return Bt.elgamal.encrypt(n,a,s,o)}case p.publicKey.ecdh:{const{oid:a,Q:s,kdfParams:o}=t,{publicKey:u,wrappedKey:c}=await Bt.elliptic.ecdh.encrypt(a,o,n,s,i);return{V:u,C:new y0(c)}}case p.publicKey.x25519:{if(!_.isAES(e))throw Error("X25519 keys can only encrypt AES session keys");const{A:a}=t,{ephemeralPublicKey:s,wrappedKey:o}=await Bt.elliptic.ecdhX.encrypt(r,n,a);return{ephemeralPublicKey:s,C:pa.fromObject({algorithm:e,wrappedKey:o})}}default:return[]}},publicKeyDecrypt:async function(r,e,t,n,i,a){switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:{const{c:s}=n,{n:o,e:u}=e,{d:c,p:h,q:l,u:k}=t;return Bt.rsa.decrypt(s,o,u,c,h,l,k,a)}case p.publicKey.elgamal:{const{c1:s,c2:o}=n,u=e.p,c=t.x;return Bt.elgamal.decrypt(s,o,u,c,a)}case p.publicKey.ecdh:{const{oid:s,Q:o,kdfParams:u}=e,{d:c}=t,{V:h,C:l}=n;return Bt.elliptic.ecdh.decrypt(s,u,h,l.data,o,c,i)}case p.publicKey.x25519:{const{A:s}=e,{k:o}=t,{ephemeralPublicKey:u,C:c}=n;if(!_.isAES(c.algorithm))throw Error("AES session key expected");return Bt.elliptic.ecdhX.decrypt(r,u,c.wrappedKey,s,o)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=_.readMPI(e.subarray(t));return t+=i.length+2,{read:t,publicParams:{n,e:i}}}case p.publicKey.dsa:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=_.readMPI(e.subarray(t));t+=a.length+2;const s=_.readMPI(e.subarray(t));return t+=s.length+2,{read:t,publicParams:{p:n,q:i,g:a,y:s}}}case p.publicKey.elgamal:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=_.readMPI(e.subarray(t));return t+=a.length+2,{read:t,publicParams:{p:n,g:i,y:a}}}case p.publicKey.ecdsa:{const n=new Ve;t+=n.read(e),ns(n);const i=_.readMPI(e.subarray(t));return t+=i.length+2,{read:t,publicParams:{oid:n,Q:i}}}case p.publicKey.eddsaLegacy:{const n=new Ve;t+=n.read(e),ns(n);let i=_.readMPI(e.subarray(t));return t+=i.length+2,i=_.leftPad(i,33),{read:t,publicParams:{oid:n,Q:i}}}case p.publicKey.ecdh:{const n=new Ve;t+=n.read(e),ns(n);const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=new p0;return t+=a.read(e.subarray(t)),{read:t,publicParams:{oid:n,Q:i,kdfParams:a}}}case p.publicKey.ed25519:case p.publicKey.x25519:{const n=e.subarray(t,t+32);return t+=n.length,{read:t,publicParams:{A:n}}}default:throw new re("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(r,e,t){let n=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const i=_.readMPI(e.subarray(n));n+=i.length+2;const a=_.readMPI(e.subarray(n));n+=a.length+2;const s=_.readMPI(e.subarray(n));n+=s.length+2;const o=_.readMPI(e.subarray(n));return n+=o.length+2,{read:n,privateParams:{d:i,p:a,q:s,u:o}}}case p.publicKey.dsa:case p.publicKey.elgamal:{const i=_.readMPI(e.subarray(n));return n+=i.length+2,{read:n,privateParams:{x:i}}}case p.publicKey.ecdsa:case p.publicKey.ecdh:{const i=new vr(t.oid);let a=_.readMPI(e.subarray(n));return n+=a.length+2,a=_.leftPad(a,i.payloadSize),{read:n,privateParams:{d:a}}}case p.publicKey.eddsaLegacy:{const i=new vr(t.oid);let a=_.readMPI(e.subarray(n));return n+=a.length+2,a=_.leftPad(a,i.payloadSize),{read:n,privateParams:{seed:a}}}case p.publicKey.ed25519:{const i=e.subarray(n,n+32);return n+=i.length,{read:n,privateParams:{seed:i}}}case p.publicKey.x25519:{const i=e.subarray(n,n+32);return n+=i.length,{read:n,privateParams:{k:i}}}default:throw new re("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:return{c:_.readMPI(e.subarray(t))};case p.publicKey.elgamal:{const n=_.readMPI(e.subarray(t));return t+=n.length+2,{c1:n,c2:_.readMPI(e.subarray(t))}}case p.publicKey.ecdh:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=new y0;return i.read(e.subarray(t)),{V:n,C:i}}case p.publicKey.x25519:{const n=e.subarray(t,t+32);t+=n.length;const i=new pa;return i.read(e.subarray(t)),{ephemeralPublicKey:n,C:i}}default:throw new re("Unknown public key encryption algorithm.")}},serializeParams:function(r,e){const t=new Set([p.publicKey.ed25519,p.publicKey.x25519]),n=Object.keys(e).map(i=>{const a=e[i];return _.isUint8Array(a)?t.has(r)?a:_.uint8ArrayToMPI(a):a.write()});return _.concatUint8Array(n)},generateParams:function(r,e,t){switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:return Bt.rsa.generate(e,65537).then(({n,e:i,d:a,p:s,q:o,u})=>({privateParams:{d:a,p:s,q:o,u},publicParams:{n,e:i}}));case p.publicKey.ecdsa:return Bt.elliptic.generate(t).then(({oid:n,Q:i,secret:a})=>({privateParams:{d:a},publicParams:{oid:new Ve(n),Q:i}}));case p.publicKey.eddsaLegacy:return Bt.elliptic.generate(t).then(({oid:n,Q:i,secret:a})=>({privateParams:{seed:a},publicParams:{oid:new Ve(n),Q:i}}));case p.publicKey.ecdh:return Bt.elliptic.generate(t).then(({oid:n,Q:i,secret:a,hash:s,cipher:o})=>({privateParams:{d:a},publicParams:{oid:new Ve(n),Q:i,kdfParams:new p0({hash:s,cipher:o})}}));case p.publicKey.ed25519:return Bt.elliptic.eddsa.generate(r).then(({A:n,seed:i})=>({privateParams:{seed:i},publicParams:{A:n}}));case p.publicKey.x25519:return Bt.elliptic.ecdhX.generate(r).then(({A:n,k:i})=>({privateParams:{k:i},publicParams:{A:n}}));case p.publicKey.dsa:case p.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(r,e,t){if(!e||!t)throw Error("Missing key parameters");switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const{n,e:i}=e,{d:a,p:s,q:o,u}=t;return Bt.rsa.validateParams(n,i,a,s,o,u)}case p.publicKey.dsa:{const{p:n,q:i,g:a,y:s}=e,{x:o}=t;return Bt.dsa.validateParams(n,i,a,s,o)}case p.publicKey.elgamal:{const{p:n,g:i,y:a}=e,{x:s}=t;return Bt.elgamal.validateParams(n,i,a,s)}case p.publicKey.ecdsa:case p.publicKey.ecdh:{const n=Bt.elliptic[p.read(p.publicKey,r)],{oid:i,Q:a}=e,{d:s}=t;return n.validateParams(i,a,s)}case p.publicKey.eddsaLegacy:{const{Q:n,oid:i}=e,{seed:a}=t;return Bt.elliptic.eddsaLegacy.validateParams(i,n,a)}case p.publicKey.ed25519:{const{A:n}=e,{seed:i}=t;return Bt.elliptic.eddsa.validateParams(r,n,i)}case p.publicKey.x25519:{const{A:n}=e,{k:i}=t;return Bt.elliptic.ecdhX.validateParams(r,n,i)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(r){const{blockSize:e}=rr(r),t=await Ee(e),n=new Uint8Array([t[t.length-2],t[t.length-1]]);return _.concat([t,n])},generateSessionKey:function(r){const{keySize:e}=rr(r);return Ee(e)},getAEADMode:function(r){const e=p.read(p.aead,r);return v2[e]},getCipher:rr,getPreferredCurveHashAlgo:function(r,e){switch(r){case p.publicKey.ecdsa:case p.publicKey.eddsaLegacy:return Bt.elliptic.getPreferredHashAlgo(e);case p.publicKey.ed25519:return Bt.elliptic.eddsa.getPreferredHashAlgo(r);default:throw Error("Unknown elliptic signing algo")}}});const Tt={cipher:Pi,hash:Ke,mode:v2,publicKey:Bt,signature:a3,random:Mu,pkcs1:Fu,pkcs5:Ju,aesKW:Yu};Object.assign(Tt,s3);var Ci=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function T2(r,e){return r.length===e?r:r.subarray?r.subarray(0,e):(r.length=e,r)}const R2={arraySet:function(r,e,t,n,i){if(e.subarray&&r.subarray)r.set(e.subarray(t,t+n),i);else for(let a=0;a=0;)r[e]=0}const l3=0,F2=1,f3=2,a1=29,Di=256,wi=Di+1+a1,Pn=30,s1=19,k0=2*wi+1,Yr=15,as=16,d3=7,o1=256,H2=16,$2=17,q2=18,Rs=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Xi=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],y3=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],v0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fr=Array(2*(wi+2));Ln(fr);const hi=Array(2*Pn);Ln(hi);const bi=Array(512);Ln(bi);const ki=Array(256);Ln(ki);const c1=Array(a1);Ln(c1);const ma=Array(Pn);function ss(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}let A0,_0,E0;function os(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}function j2(r){return r<256?bi[r]:bi[256+(r>>>7)]}function vi(r,e){r.pending_buf[r.pending++]=255&e,r.pending_buf[r.pending++]=e>>>8&255}function ke(r,e,t){r.bi_valid>as-t?(r.bi_buf|=e<>as-r.bi_valid,r.bi_valid+=t-as):(r.bi_buf|=e<>>=1,t<<=1;while(--e>0);return t>>>1}function W2(r,e,t){const n=Array(Yr+1);let i,a,s=0;for(i=1;i<=Yr;i++)n[i]=s=s+t[i-1]<<1;for(a=0;a<=e;a++){const o=r[2*a+1];o!==0&&(r[2*a]=G2(n[o]++,o))}}function V2(r){let e;for(e=0;e8?vi(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0}function S0(r,e,t,n){const i=2*e,a=2*t;return r[i]>1;s>=1;s--)cs(r,t,s);u=a;do s=r.heap[1],r.heap[1]=r.heap[r.heap_len--],cs(r,t,1),o=r.heap[1],r.heap[--r.heap_max]=s,r.heap[--r.heap_max]=o,t[2*u]=t[2*s]+t[2*o],r.depth[u]=(r.depth[s]>=r.depth[o]?r.depth[s]:r.depth[o])+1,t[2*s+1]=t[2*o+1]=u,r.heap[1]=u++,cs(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],function(h,l){const k=l.dyn_tree,y=l.max_code,P=l.stat_desc.static_tree,C=l.stat_desc.has_stree,O=l.stat_desc.extra_bits,H=l.stat_desc.extra_base,X=l.stat_desc.max_length;let F,E,G,q,$,V,Q=0;for(q=0;q<=Yr;q++)h.bl_count[q]=0;for(k[2*h.heap[h.heap_max]+1]=0,F=h.heap_max+1;FX&&(q=X,Q++),k[2*E+1]=q,E>y||(h.bl_count[q]++,$=0,E>=H&&($=O[E-H]),V=k[2*E],h.opt_len+=V*(q+$),C&&(h.static_len+=V*(P[2*E+1]+$)));if(Q!==0){do{for(q=X-1;h.bl_count[q]===0;)q--;h.bl_count[q]--,h.bl_count[q+1]+=2,h.bl_count[X]--,Q-=2}while(Q>0);for(q=X;q!==0;q--)for(E=h.bl_count[q];E!==0;)G=h.heap[--F],G>y||(k[2*G+1]!==q&&(h.opt_len+=(q-k[2*G+1])*k[2*G],k[2*G+1]=q),E--)}}(r,e),W2(t,c,r.bl_count)}function U0(r,e,t){let n,i,a=-1,s=e[1],o=0,u=7,c=4;for(s===0&&(u=138,c=3),e[2*(t+1)+1]=65535,n=0;n<=t;n++)i=s,s=e[2*(n+1)+1],++o>=7;i=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(r)}function m3(r,e,t,n){let i,a,s=0;r.level>0?(r.strm.data_type===N2&&(r.strm.data_type=function(o){let u,c=4093624447;for(u=0;u<=31;u++,c>>>=1)if(1&c&&o.dyn_ltree[2*u]!==0)return w0;if(o.dyn_ltree[18]!==0||o.dyn_ltree[20]!==0||o.dyn_ltree[26]!==0)return b0;for(u=32;u=3&&o.bl_tree[2*v0[u]+1]===0;u--);return o.opt_len+=3*(u+1)+5+5+4,u}(r),i=r.opt_len+3+7>>>3,a=r.static_len+3+7>>>3,a<=i&&(i=a)):i=a=t+5,t+4<=i&&e!==-1?Q2(r,e,t,n):r.strategy===M2||a===i?(ke(r,(F2<<1)+(n?1:0),3),P0(r,fr,hi)):(ke(r,(f3<<1)+(n?1:0),3),function(o,u,c,h){let l;for(ke(o,u-257,5),ke(o,c-1,5),ke(o,h-4,4),l=0;l>>8&255,r.pending_buf[r.d_buf+2*r.last_lit+1]=255&e,r.pending_buf[r.l_buf+r.last_lit]=255&t,r.last_lit++,e===0?r.dyn_ltree[2*t]++:(r.matches++,e--,r.dyn_ltree[2*(ki[t]+Di+1)]++,r.dyn_dtree[2*j2(e)]++),r.last_lit===r.lit_bufsize-1}function Ai(r,e,t,n){let i=65535&r|0,a=r>>>16&65535|0,s=0;for(;t!==0;){s=t>2e3?2e3:t,t-=s;do i=i+e[n++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0}const w3=function(){let r;const e=[];for(let t=0;t<256;t++){r=t;for(let n=0;n<8;n++)r=1&r?3988292384^r>>>1:r>>>1;e[t]=r}return e}();function ie(r,e,t,n){const i=w3,a=n+t;r^=-1;for(let s=n;s>>8^i[255&(r^e[s])];return-1^r}var _i={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};const b3=9,Rt=3,Rr=258,Le=Rr+Rt+1,k3=32,wa=42,zs=69,Yi=73,Ji=91,ta=103,Jr=113,ei=666,ae=1,li=2,tn=3,Un=4,v3=3;function zr(r,e){return r.msg=_i[e],e}function D0(r){return(r<<1)-(r>4?9:0)}function Ir(r){let e=r.length;for(;--e>=0;)r[e]=0}function Cr(r){const e=r.state;let t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(ir(r.output,e.pending_buf,e.pending_out,t,r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))}function ue(r,e){m3(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,Cr(r.strm)}function Ot(r,e){r.pending_buf[r.pending++]=e}function qn(r,e){r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=255&e}function A3(r,e,t,n){let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,ir(e,r.input,r.next_in,i,t),r.state.wrap===1?r.adler=Ai(r.adler,e,i,t):r.state.wrap===2&&(r.adler=ie(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)}function X2(r,e){let t,n,i=r.max_chain_length,a=r.strstart,s=r.prev_length,o=r.nice_match;const u=r.strstart>r.w_size-Le?r.strstart-(r.w_size-Le):0,c=r.window,h=r.w_mask,l=r.prev,k=r.strstart+Rr;let y=c[a+s-1],P=c[a+s];r.prev_length>=r.good_match&&(i>>=2),o>r.lookahead&&(o=r.lookahead);do if(t=e,c[t+s]===P&&c[t+s-1]===y&&c[t]===c[a]&&c[++t]===c[a+1]){a+=2,t++;do;while(c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&as){if(r.match_start=e,s=n,n>=o)break;y=c[a+s-1],P=c[a+s]}}while((e=l[e&h])>u&&--i!=0);return s<=r.lookahead?s:r.lookahead}function an(r){const e=r.w_size;let t,n,i,a,s;do{if(a=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-Le)){ir(r.window,r.window,e,e,0),r.match_start-=e,r.strstart-=e,r.block_start-=e,n=r.hash_size,t=n;do i=r.head[--t],r.head[t]=i>=e?i-e:0;while(--n);n=e,t=n;do i=r.prev[--t],r.prev[t]=i>=e?i-e:0;while(--n);a+=e}if(r.strm.avail_in===0)break;if(n=A3(r.strm,r.window,r.strstart+r.lookahead,a),r.lookahead+=n,r.lookahead+r.insert>=Rt)for(s=r.strstart-r.insert,r.ins_h=r.window[s],r.ins_h=(r.ins_h<=Rt&&(r.ins_h=(r.ins_h<=Rt)if(n=Lr(r,r.strstart-r.match_start,r.match_length-Rt),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=Rt){r.match_length--;do r.strstart++,r.ins_h=(r.ins_h<=Rt&&(r.ins_h=(r.ins_h<4096)&&(r.match_length=Rt-1)),r.prev_length>=Rt&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-Rt,n=Lr(r,r.strstart-1-r.prev_match,r.prev_length-Rt),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=(r.ins_h<r.pending_buf_size-5&&(t=r.pending_buf_size-5);;){if(r.lookahead<=1){if(an(r),r.lookahead===0&&e===ar)return ae;if(r.lookahead===0)break}r.strstart+=r.lookahead,r.lookahead=0;const n=r.block_start+t;if((r.strstart===0||r.strstart>=n)&&(r.lookahead=r.strstart-n,r.strstart=n,ue(r,!1),r.strm.avail_out===0)||r.strstart-r.block_start>=r.w_size-Le&&(ue(r,!1),r.strm.avail_out===0))return ae}return r.insert=0,e===oe?(ue(r,!0),r.strm.avail_out===0?tn:Un):(r.strstart>r.block_start&&(ue(r,!1),r.strm.avail_out),ae)}),new $e(4,4,8,4,hs),new $e(4,5,16,8,hs),new $e(4,6,32,32,hs),new $e(4,4,16,16,mn),new $e(8,16,32,32,mn),new $e(8,16,128,128,mn),new $e(8,32,128,256,mn),new $e(32,128,258,1024,mn),new $e(32,258,258,4096,mn)];class _3{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=In,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Pe(1146),this.dyn_dtree=new Pe(122),this.bl_tree=new Pe(78),Ir(this.dyn_ltree),Ir(this.dyn_dtree),Ir(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Pe(16),this.heap=new Pe(573),Ir(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Pe(573),Ir(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}}function E3(r){const e=function(t){let n;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=N2,n=t.state,n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap?wa:Jr,t.adler=n.wrap===2?0:1,n.last_flush=ar,p3(n),Ht):zr(t,te)}(r);return e===Ht&&function(t){t.window_size=2*t.w_size,Ir(t.head),t.max_lazy_match=ri[t.level].max_lazy,t.good_match=ri[t.level].good_length,t.nice_match=ri[t.level].nice_length,t.max_chain_length=ri[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Rt-1,t.match_available=0,t.ins_h=0}(r.state),e}function S3(r,e){let t,n,i,a;if(!r||!r.state||e>g0||e<0)return r?zr(r,te):te;if(n=r.state,!r.output||!r.input&&r.avail_in!==0||n.status===ei&&e!==oe)return zr(r,r.avail_out===0?ui:te);if(n.strm=r,t=n.last_flush,n.last_flush=e,n.status===wa)if(n.wrap===2)r.adler=0,Ot(n,31),Ot(n,139),Ot(n,8),n.gzhead?(Ot(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ot(n,255&n.gzhead.time),Ot(n,n.gzhead.time>>8&255),Ot(n,n.gzhead.time>>16&255),Ot(n,n.gzhead.time>>24&255),Ot(n,n.level===9?2:n.strategy>=$i||n.level<2?4:0),Ot(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Ot(n,255&n.gzhead.extra.length),Ot(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(r.adler=ie(r.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=zs):(Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,n.level===9?2:n.strategy>=$i||n.level<2?4:0),Ot(n,v3),n.status=Jr);else{let o=In+(n.w_bits-8<<4)<<8,u=-1;u=n.strategy>=$i||n.level<2?0:n.level<6?1:n.level===6?2:3,o|=u<<6,n.strstart!==0&&(o|=k3),o+=31-o%31,n.status=Jr,qn(n,o),n.strstart!==0&&(qn(n,r.adler>>>16),qn(n,65535&r.adler)),r.adler=1}if(n.status===zs)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Cr(r),i=n.pending,n.pending!==n.pending_buf_size));)Ot(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Yi)}else n.status=Yi;if(n.status===Yi)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Cr(r),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.gzindex=0,n.status=Ji)}else n.status=Ji;if(n.status===Ji)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Cr(r),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.status=ta)}else n.status=ta;if(n.status===ta&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Cr(r),n.pending+2<=n.pending_buf_size&&(Ot(n,255&r.adler),Ot(n,r.adler>>8&255),r.adler=0,n.status=Jr)):n.status=Jr),n.pending!==0){if(Cr(r),r.avail_out===0)return n.last_flush=-1,Ht}else if(r.avail_in===0&&D0(e)<=D0(t)&&e!==oe)return zr(r,ui);if(n.status===ei&&r.avail_in!==0)return zr(r,ui);if(r.avail_in!==0||n.lookahead!==0||e!==ar&&n.status!==ei){var s=n.strategy===$i?function(o,u){let c;for(;;){if(o.lookahead===0&&(an(o),o.lookahead===0)){if(u===ar)return ae;break}if(o.match_length=0,c=Lr(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++,c&&(ue(o,!1),o.strm.avail_out===0))return ae}return o.insert=0,u===oe?(ue(o,!0),o.strm.avail_out===0?tn:Un):o.last_lit&&(ue(o,!1),o.strm.avail_out===0)?ae:li}(n,e):n.strategy===h3?function(o,u){let c,h,l,k;const y=o.window;for(;;){if(o.lookahead<=Rr){if(an(o),o.lookahead<=Rr&&u===ar)return ae;if(o.lookahead===0)break}if(o.match_length=0,o.lookahead>=Rt&&o.strstart>0&&(l=o.strstart-1,h=y[l],h===y[++l]&&h===y[++l]&&h===y[++l])){k=o.strstart+Rr;do;while(h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&lo.lookahead&&(o.match_length=o.lookahead)}if(o.match_length>=Rt?(c=Lr(o,1,o.match_length-Rt),o.lookahead-=o.match_length,o.strstart+=o.match_length,o.match_length=0):(c=Lr(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++),c&&(ue(o,!1),o.strm.avail_out===0))return ae}return o.insert=0,u===oe?(ue(o,!0),o.strm.avail_out===0?tn:Un):o.last_lit&&(ue(o,!1),o.strm.avail_out===0)?ae:li}(n,e):ri[n.level].func(n,e);if(s!==tn&&s!==Un||(n.status=ei),s===ae||s===tn)return r.avail_out===0&&(n.last_flush=-1),Ht;if(s===li&&(e===o3?g3(n):e!==g0&&(Q2(n,0,0,!1),e===c3&&(Ir(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Cr(r),r.avail_out===0))return n.last_flush=-1,Ht}return e!==oe?Ht:n.wrap<=0?mr:(n.wrap===2?(Ot(n,255&r.adler),Ot(n,r.adler>>8&255),Ot(n,r.adler>>16&255),Ot(n,r.adler>>24&255),Ot(n,255&r.total_in),Ot(n,r.total_in>>8&255),Ot(n,r.total_in>>16&255),Ot(n,r.total_in>>24&255)):(qn(n,r.adler>>>16),qn(n,65535&r.adler)),Cr(r),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ht:mr)}try{String.fromCharCode.call(null,0)}catch{}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{}const Ls=new Xe(256);for(let r=0;r<256;r++)Ls[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;function Os(r){let e,t,n,i,a=0;const s=r.length;for(n=0;n>>6,o[i++]=128|63&e):e<65536?(o[i++]=224|e>>>12,o[i++]=128|e>>>6&63,o[i++]=128|63&e):(o[i++]=240|e>>>18,o[i++]=128|e>>>12&63,o[i++]=128|e>>>6&63,o[i++]=128|63&e);return o}Ls[254]=Ls[254]=1;class Y2{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}}class P3{constructor(e){this.options={level:m0,method:In,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,...e||{}};const t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Y2,this.strm.avail_out=0;var n,i,a=function(s,o,u,c,h,l){if(!s)return te;let k=1;if(o===m0&&(o=6),c<0?(k=0,c=-c):c>15&&(k=2,c-=16),h<1||h>b3||u!==In||c<8||c>15||o<0||o>9||l<0||l>M2)return zr(s,te);c===8&&(c=9);const y=new _3;return s.state=y,y.strm=s,y.wrap=k,y.gzhead=null,y.w_bits=c,y.w_size=1<=c.w_size&&(k===0&&(Ir(c.head),c.strstart=0,c.block_start=0,c.insert=0),O=new Xe(c.w_size),ir(O,u,H-c.w_size,c.w_size,0),u=O,H=c.w_size),y=o.avail_in,P=o.next_in,C=o.input,o.avail_in=H,o.next_in=0,o.input=u,an(c);c.lookahead>=Rt;){h=c.strstart,l=c.lookahead-(Rt-1);do c.ins_h=(c.ins_h<0||n.avail_out===0)&&a!==mr);return s===oe?(a=function(o){let u;return o&&o.state?(u=o.state.status,u!==wa&&u!==zs&&u!==Yi&&u!==Ji&&u!==ta&&u!==Jr&&u!==ei?zr(o,te):(o.state=null,u===Jr?zr(o,i1):Ht)):te}(this.strm),this.onEnd(a),this.ended=!0,a===Ht):s!==mi||(this.onEnd(Ht),n.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===Ht&&(this.result=L2(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}const qi=30,U3=12;function K3(r,e){let t,n,i,a,s,o,u,c,h,l;const k=r.state;t=r.next_in;const y=r.input,P=t+(r.avail_in-5);n=r.next_out;const C=r.output,O=n-(e-r.avail_out),H=n+(r.avail_out-257),X=k.dmax,F=k.wsize,E=k.whave,G=k.wnext,q=k.window;i=k.hold,a=k.bits;const $=k.lencode,V=k.distcode,Q=(1<>>24,i>>>=o,a-=o,o=s>>>16&255,o===0)C[n++]=65535&s;else{if(!(16&o)){if(!(64&o)){s=$[(65535&s)+(i&(1<>>=o,a-=o),a<15&&(i+=y[t++]<>>24,i>>>=o,a-=o,o=s>>>16&255,!(16&o)){if(!(64&o)){s=V[(65535&s)+(i&(1<X){r.msg="invalid distance too far back",k.mode=qi;break t}if(i>>>=o,a-=o,o=n-O,c>o){if(o=c-o,o>E&&k.sane){r.msg="invalid distance too far back",k.mode=qi;break t}if(h=0,l=q,G===0){if(h+=F-o,o2;)C[n++]=l[h++],C[n++]=l[h++],C[n++]=l[h++],u-=3;u&&(C[n++]=l[h++],u>1&&(C[n++]=l[h++]))}else{h=n-c;do C[n++]=C[h++],C[n++]=C[h++],C[n++]=C[h++],u-=3;while(u>2);u&&(C[n++]=C[h++],u>1&&(C[n++]=C[h++]))}break}}break}}while(t>3,t-=u,a-=u<<3,i&=(1<=1&&et[H]===0;H--);if(X>H&&(X=H),H===0)return i[a++]=20971520,i[a++]=20971520,o.bits=1,0;for(O=1;O0&&(r===B0||H!==1))return-1;for(nt[1]=0,P=1;Px0||r===T0&&q>I0)return 1;for(;;){ft=P-E,s[C]y?(lt=dt[Pt+s[C]],M=V[Q+s[C]]):(lt=96,M=0),c=1<>E)+h]=ft<<24|lt<<16|M|0;while(h!==0);for(c=1<>=1;if(c!==0?($&=c-1,$+=c):$=0,C++,--et[P]==0){if(P===H)break;P=e[t+s[C]]}if(P>X&&($&j)!==l){for(E===0&&(E=X),k+=O,F=P-E,G=1<x0||r===T0&&q>I0)return 1;l=$&j,i[l]=X<<24|F<<16|k-a|0}}return $!==0&&(i[k+$]=P-E<<24|64<<16|0),o.bits=X,0}const B3=0,J2=1,tc=2,ec=1,R0=2,z0=3,L0=4,O0=5,M0=6,N0=7,F0=8,H0=9,$0=10,ba=11,ur=12,fs=13,q0=14,ds=15,j0=16,G0=17,W0=18,V0=19,ji=20,Gi=21,Z0=22,Q0=23,X0=24,Y0=25,J0=26,ys=27,to=28,eo=29,Zt=30,T3=852,R3=592;function ro(r){return(r>>>24&255)+(r>>>8&65280)+((65280&r)<<8)+((255&r)<<24)}class z3{constructor(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Pe(320),this.work=new Pe(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}}function L3(r){let e;return r&&r.state?(e=r.state,e.wsize=0,e.whave=0,e.wnext=0,function(t){let n;return t&&t.state?(n=t.state,t.total_in=t.total_out=n.total=0,t.msg="",n.wrap&&(t.adler=1&n.wrap),n.mode=ec,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new ga(T3),n.distcode=n.distdyn=new ga(R3),n.sane=1,n.back=-1,Ht):te}(r)):te}function O3(r,e){let t,n;return r?(n=new z3,r.state=n,n.window=null,t=function(i,a){let s,o;return i&&i.state?(o=i.state,a<0?(s=0,a=-a):(s=1+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?te:(o.window!==null&&o.wbits!==a&&(o.window=null),o.wrap=s,o.wbits=a,L3(i))):te}(r,e),t!==Ht&&(r.state=null),t):te}let ps,gs,no=!0;function M3(r){if(no){let e;for(ps=new ga(512),gs=new ga(32),e=0;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(fi(J2,r.lens,0,288,ps,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;fi(tc,r.lens,0,32,gs,0,r.work,{bits:5}),no=!1}r.lencode=ps,r.lenbits=9,r.distcode=gs,r.distbits=5}function rc(r,e,t,n){let i;const a=r.state;return a.window===null&&(a.wsize=1<=a.wsize?(ir(a.window,e,t-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),ir(a.window,e,t-n,i,a.wnext),(n-=i)?(ir(a.window,e,t-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,t.check=ie(t.check,nt,2,0),c=0,h=0,t.mode=R0;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&c)<<8)+(c>>8))%31){r.msg="incorrect header check",t.mode=Zt;break}if((15&c)!==In){r.msg="unknown compression method",t.mode=Zt;break}if(c>>>=4,h-=4,q=8+(15&c),t.wbits===0)t.wbits=q;else if(q>t.wbits){r.msg="invalid window size",t.mode=Zt;break}t.dmax=1<>8&1),512&t.flags&&(nt[0]=255&c,nt[1]=c>>>8&255,t.check=ie(t.check,nt,2,0)),c=0,h=0,t.mode=z0;case z0:for(;h<32;){if(o===0)break t;o--,c+=n[a++]<>>8&255,nt[2]=c>>>16&255,nt[3]=c>>>24&255,t.check=ie(t.check,nt,4,0)),c=0,h=0,t.mode=L0;case L0:for(;h<16;){if(o===0)break t;o--,c+=n[a++]<>8),512&t.flags&&(nt[0]=255&c,nt[1]=c>>>8&255,t.check=ie(t.check,nt,2,0)),c=0,h=0,t.mode=O0;case O0:if(1024&t.flags){for(;h<16;){if(o===0)break t;o--,c+=n[a++]<>>8&255,t.check=ie(t.check,nt,2,0)),c=0,h=0}else t.head&&(t.head.extra=null);t.mode=M0;case M0:if(1024&t.flags&&(y=t.length,y>o&&(y=o),y&&(t.head&&(q=t.head.extra_len-t.length,t.head.extra||(t.head.extra=Array(t.head.extra_len)),ir(t.head.extra,n,a,y,q)),512&t.flags&&(t.check=ie(t.check,n,y,a)),o-=y,a+=y,t.length-=y),t.length))break t;t.length=0,t.mode=N0;case N0:if(2048&t.flags){if(o===0)break t;y=0;do q=n[a+y++],t.head&&q&&t.length<65536&&(t.head.name+=String.fromCharCode(q));while(q&&y>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=ur;break;case $0:for(;h<32;){if(o===0)break t;o--,c+=n[a++]<>>=7&h,h-=7&h,t.mode=ys;break}for(;h<3;){if(o===0)break t;o--,c+=n[a++]<>>=1,h-=1,3&c){case 0:t.mode=q0;break;case 1:M3(t),t.mode=ji;break;case 2:t.mode=G0;break;case 3:r.msg="invalid block type",t.mode=Zt}c>>>=2,h-=2;break;case q0:for(c>>>=7&h,h-=7&h;h<32;){if(o===0)break t;o--,c+=n[a++]<>>16^65535)){r.msg="invalid stored block lengths",t.mode=Zt;break}t.length=65535&c,c=0,h=0,t.mode=ds;case ds:t.mode=j0;case j0:if(y=t.length,y){if(y>o&&(y=o),y>u&&(y=u),y===0)break t;ir(i,n,a,y,s),o-=y,a+=y,u-=y,s+=y,t.length-=y;break}t.mode=ur;break;case G0:for(;h<14;){if(o===0)break t;o--,c+=n[a++]<>>=5,h-=5,t.ndist=1+(31&c),c>>>=5,h-=5,t.ncode=4+(15&c),c>>>=4,h-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=Zt;break}t.have=0,t.mode=W0;case W0:for(;t.have>>=3,h-=3}for(;t.have<19;)t.lens[ft[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,V={bits:t.lenbits},$=fi(B3,t.lens,0,19,t.lencode,0,t.work,V),t.lenbits=V.bits,$){r.msg="invalid code lengths set",t.mode=Zt;break}t.have=0,t.mode=V0;case V0:for(;t.have>>24,H=et>>>16&255,X=65535&et,!(O<=h);){if(o===0)break t;o--,c+=n[a++]<>>=O,h-=O,t.lens[t.have++]=X;else{if(X===16){for(Q=O+2;h>>=O,h-=O,t.have===0){r.msg="invalid bit length repeat",t.mode=Zt;break}q=t.lens[t.have-1],y=3+(3&c),c>>>=2,h-=2}else if(X===17){for(Q=O+3;h>>=O,h-=O,q=0,y=3+(7&c),c>>>=3,h-=3}else{for(Q=O+7;h>>=O,h-=O,q=0,y=11+(127&c),c>>>=7,h-=7}if(t.have+y>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=Zt;break}for(;y--;)t.lens[t.have++]=q}}if(t.mode===Zt)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=Zt;break}if(t.lenbits=9,V={bits:t.lenbits},$=fi(J2,t.lens,0,t.nlen,t.lencode,0,t.work,V),t.lenbits=V.bits,$){r.msg="invalid literal/lengths set",t.mode=Zt;break}if(t.distbits=6,t.distcode=t.distdyn,V={bits:t.distbits},$=fi(tc,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,V),t.distbits=V.bits,$){r.msg="invalid distances set",t.mode=Zt;break}t.mode=ji;case ji:t.mode=Gi;case Gi:if(o>=6&&u>=258){r.next_out=s,r.avail_out=u,r.next_in=a,r.avail_in=o,t.hold=c,t.bits=h,K3(r,k),s=r.next_out,i=r.output,u=r.avail_out,a=r.next_in,n=r.input,o=r.avail_in,c=t.hold,h=t.bits,t.mode===ur&&(t.back=-1);break}for(t.back=0;et=t.lencode[c&(1<>>24,H=et>>>16&255,X=65535&et,!(O<=h);){if(o===0)break t;o--,c+=n[a++]<>F)],O=et>>>24,H=et>>>16&255,X=65535&et,!(F+O<=h);){if(o===0)break t;o--,c+=n[a++]<>>=F,h-=F,t.back+=F}if(c>>>=O,h-=O,t.back+=O,t.length=X,H===0){t.mode=J0;break}if(32&H){t.back=-1,t.mode=ur;break}if(64&H){r.msg="invalid literal/length code",t.mode=Zt;break}t.extra=15&H,t.mode=Z0;case Z0:if(t.extra){for(Q=t.extra;h>>=t.extra,h-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Q0;case Q0:for(;et=t.distcode[c&(1<>>24,H=et>>>16&255,X=65535&et,!(O<=h);){if(o===0)break t;o--,c+=n[a++]<>F)],O=et>>>24,H=et>>>16&255,X=65535&et,!(F+O<=h);){if(o===0)break t;o--,c+=n[a++]<>>=F,h-=F,t.back+=F}if(c>>>=O,h-=O,t.back+=O,64&H){r.msg="invalid distance code",t.mode=Zt;break}t.offset=X,t.extra=15&H,t.mode=X0;case X0:if(t.extra){for(Q=t.extra;h>>=t.extra,h-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=Zt;break}t.mode=Y0;case Y0:if(u===0)break t;if(y=k-u,t.offset>y){if(y=t.offset-y,y>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=Zt;break}y>t.wnext?(y-=t.wnext,P=t.wsize-y):P=t.wnext-y,y>t.length&&(y=t.length),C=t.window}else C=i,P=s-t.offset,y=t.length;y>u&&(y=u),u-=y,t.length-=y;do i[s++]=C[P++];while(--y);t.length===0&&(t.mode=Gi);break;case J0:if(u===0)break t;i[s++]=t.length,u--,t.mode=Gi;break;case ys:if(t.wrap){for(;h<32;){if(o===0)break t;o--,c|=n[a++]<=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Y2,this.strm.avail_out=0;let n=O3(this.strm,t.windowBits);if(n!==Ht||(this.header=new F3,function(i,a){let s;i&&i.state&&(s=i.state,!(2&s.wrap)||(s.head=a,a.done=!1))}(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Os(t.dictionary):t.dictionary instanceof ArrayBuffer&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=io(this.strm,t.dictionary),n!==Ht))))throw Error(_i[n])}push(e,t){const{strm:n,options:{chunkSize:i,dictionary:a}}=this;let s,o,u=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?oe:ar,typeof e=="string"?n.input=function(c){const h=new Xe(c.length);for(let l=0,k=h.length;l0||n.avail_out===0)&&s!==mr);return s===mr&&(o=oe),o===oe?(s=function(c){if(!c||!c.state)return te;const h=c.state;return h.window&&(h.window=null),c.state=null,Ht}(this.strm),this.onEnd(s),this.ended=!0,s===Ht):o!==mi||(this.onEnd(Ht),n.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===Ht&&(this.result=L2(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}var so=[0,1,3,7,15,31,63,127,255],ni=function(r){this.stream=r,this.bitOffset=0,this.curByte=0,this.hasByte=!1};ni.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},ni.prototype.read=function(r){for(var e=0;r>0;){this._ensureByte();var t=8-this.bitOffset;if(r>=t)e<<=t,e|=so[t]&this.curByte,this.hasByte=!1,this.bitOffset=0,r-=t;else{e<<=r;var n=t-r;e|=(this.curByte&so[r]<>n,this.bitOffset+=r,r=0}}return e},ni.prototype.seek=function(r){var e=r%8,t=(r-e)/8;this.bitOffset=e,this.stream.seek(t),this.hasByte=!1},ni.prototype.pi=function(){var r,e=new Uint8Array(6);for(r=0;r("00"+n.toString(16)).slice(-2)).join("")}(e)};var H3=ni,Wr=function(){};Wr.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},Wr.prototype.read=function(r,e,t){for(var n=0;n>>0},this.updateCRC=function(e){r=r<<8^ms[255&(r>>>24^e)]},this.updateCRCRun=function(e,t){for(;t-- >0;)r=r<<8^ms[255&(r>>>24^e)]}}),oo=function(r,e){var t,n=r[e];for(t=e;t>0;t--)r[t]=r[t-1];return r[0]=n,n},Qt={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},Dr={};Dr[Qt.LAST_BLOCK]="Bad file checksum",Dr[Qt.NOT_BZIP_DATA]="Not bzip data",Dr[Qt.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",Dr[Qt.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",Dr[Qt.DATA_ERROR]="Data error",Dr[Qt.OUT_OF_MEMORY]="Out of memory",Dr[Qt.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var ce=function(r,e){var t=Dr[r]||"unknown error";e&&(t+=": "+e);var n=new TypeError(t);throw n.errorCode=r,n},ii=function(r,e){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(r,e)};ii.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new $3,!0):(this.writeCount=-1,!1)},ii.prototype._start_bunzip=function(r,e){var t=new Uint8Array(4);r.read(t,0,4)===4&&String.fromCharCode(t[0],t[1],t[2])==="BZh"||ce(Qt.NOT_BZIP_DATA,"bad magic");var n=t[3]-48;(n<1||n>9)&&ce(Qt.NOT_BZIP_DATA,"level out of range"),this.reader=new H3(r),this.dbufSize=1e5*n,this.nextoutput=0,this.outputStream=e,this.streamCRC=0},ii.prototype._get_next_block=function(){var r,e,t,n=this.reader,i=n.pi();if(i==="177245385090")return!1;i!=="314159265359"&&ce(Qt.NOT_BZIP_DATA),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&ce(Qt.OBSOLETE_INPUT);var a=n.read(24);a>this.dbufSize&&ce(Qt.DATA_ERROR,"initial position out of bounds");var s=n.read(16),o=new Uint8Array(256),u=0;for(r=0;r<16;r++)if(s&1<<15-r){var c=16*r;for(t=n.read(16),e=0;e<16;e++)t&1<<15-e&&(o[u++]=c+e)}var h=n.read(3);(h<2||h>6)&&ce(Qt.DATA_ERROR);var l=n.read(15);l===0&&ce(Qt.DATA_ERROR);var k=new Uint8Array(256);for(r=0;r=h&&ce(Qt.DATA_ERROR);y[r]=oo(k,e)}var P,C=u+2,O=[];for(e=0;e20)&&ce(Qt.DATA_ERROR),n.read(1);)n.read(1)?s--:s++;F[r]=s}for(H=X=F[0],r=1;rX?X=F[r]:F[r]=l&&ce(Qt.DATA_ERROR),P=O[y[et++]]),r=P.minLen,e=n.read(r);r>P.maxLen&&ce(Qt.DATA_ERROR),!(e<=P.limit[r]);r++)e=e<<1|n.read(1);((e-=P.base[r])<0||e>=258)&&ce(Qt.DATA_ERROR);var ft=P.permute[e];if(ft!==0&&ft!==1){if(V)for(V=0,Q+s>this.dbufSize&&ce(Qt.DATA_ERROR),q[$=o[k[0]]]+=s;s--;)nt[Q++]=$;if(ft>u)break;Q>=this.dbufSize&&ce(Qt.DATA_ERROR),q[$=o[$=oo(k,r=ft-1)]]++,nt[Q++]=$}else V||(V=1,s=0),s+=ft===0?V:2*V,V<<=1}for((a<0||a>=Q)&&ce(Qt.DATA_ERROR),e=0,r=0;r<256;r++)t=e+q[r],q[r]=e,e=t;for(r=0;r>=8,dt=-1),this.writePos=lt,this.writeCurrent=M,this.writeCount=Q,this.writeRun=dt,!0},ii.prototype._read_bunzip=function(r,e){var t,n,i;if(this.writeCount<0)return 0;var a=this.dbuf,s=this.writePos,o=this.writeCurrent,u=this.writeCount;this.outputsize;for(var c=this.writeRun;u;){for(u--,n=o,o=255&(s=a[s]),s>>=8,c++==3?(t=o,i=n,o=-1):(t=1,i=o),this.blockCRC.updateCRCRun(i,t);t--;)this.outputStream.writeByte(i),this.nextoutput++;o!=n&&(c=0)}return this.writeCount=u,this.blockCRC.getCRC()!==this.targetBlockCRC&&ce(Qt.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var q3=function(r){if("readByte"in r)return r;var e=new nc;return e.pos=0,e.readByte=function(){return r[this.pos++]},e.seek=function(t){this.pos=t},e.eof=function(){return this.pos>=r.length},e},j3=function(r){var e=new nc,t=!0;if(r)if(typeof r=="number")e.buffer=new Uint8Array(r),t=!1;else{if("writeByte"in r)return r;e.buffer=r,t=!1}else e.buffer=new Uint8Array(16384);return e.pos=0,e.writeByte=function(n){if(t&&this.pos>=this.buffer.length){var i=new Uint8Array(2*this.buffer.length);i.set(this.buffer),this.buffer=i}this.buffer[this.pos++]=n},e.getBuffer=function(){if(this.pos!==this.buffer.length){if(!t)throw new TypeError("outputsize does not match decoded input");var n=new Uint8Array(this.pos);n.set(this.buffer.subarray(0,this.pos)),this.buffer=n}return this.buffer},e._coerced=!0,e},co=function(r,e,t){for(var n=q3(r),i=j3(e),a=new ii(n,i);!("eof"in n)||!n.eof();)if(a._init_block())a._read_bunzip();else{var s=a.reader.read(32)>>>0;if(s!==a.streamCRC&&ce(Qt.DATA_ERROR,"Bad stream CRC (got "+a.streamCRC.toString(16)+" expected "+s.toString(16)+")"),!t||!("eof"in n)||n.eof())break;a._start_bunzip(n,i)}if("getBuffer"in i)return i.getBuffer()};const jn=Symbol("verified"),G3=new Set([p.signatureSubpacket.issuer,p.signatureSubpacket.issuerFingerprint,p.signatureSubpacket.embeddedSignature]);class wr{static get tag(){return p.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new xn,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[jn]=null}read(e){let t=0;if(this.version=e[t++],this.version!==4&&this.version!==5)throw new re(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[t++],this.publicKeyAlgorithm=e[t++],this.hashAlgorithm=e[t++],t+=this.readSubPackets(e.subarray(t,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,t),t+=this.readSubPackets(e.subarray(t,e.length),!1),this.signedHashValue=e.subarray(t,t+2),t+=2,this.params=Tt.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(t,e.length))}writeParams(){return this.params instanceof Promise?Ei(async()=>Tt.serializeParams(this.publicKeyAlgorithm,await this.params)):Tt.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),e.push(this.writeParams()),_.concat(e)}async sign(e,t,n=new Date,i=!1){e.version===5?this.version=5:this.version=4;const a=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=_.normalizeDate(n),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),a.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=_.concat(a);const s=this.toHash(this.signatureType,t,i),o=await this.hash(this.signatureType,t,s,i);this.signedHashValue=_e(ra(o),0,2);const u=async()=>Tt.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,s,await sr(o));_.isStream(o)?this.params=u():(this.params=await u(),this[jn]=!0)}writeHashedSubPackets(){const e=p.signatureSubpacket,t=[];let n;if(this.created===null)throw Error("Missing signature creation time");t.push(Vt(e.signatureCreationTime,!0,_.writeDate(this.created))),this.signatureExpirationTime!==null&&t.push(Vt(e.signatureExpirationTime,!0,_.writeNumber(this.signatureExpirationTime,4))),this.exportable!==null&&t.push(Vt(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),this.trustLevel!==null&&(n=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Vt(e.trustSignature,!0,n))),this.regularExpression!==null&&t.push(Vt(e.regularExpression,!0,this.regularExpression)),this.revocable!==null&&t.push(Vt(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),this.keyExpirationTime!==null&&t.push(Vt(e.keyExpirationTime,!0,_.writeNumber(this.keyExpirationTime,4))),this.preferredSymmetricAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Vt(e.preferredSymmetricAlgorithms,!1,n))),this.revocationKeyClass!==null&&(n=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),n=_.concat([n,this.revocationKeyFingerprint]),t.push(Vt(e.revocationKey,!1,n))),this.issuerKeyID.isNull()||this.issuerKeyVersion===5||t.push(Vt(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach(({name:s,value:o,humanReadable:u,critical:c})=>{n=[new Uint8Array([u?128:0,0,0,0])];const h=_.encodeUTF8(s);n.push(_.writeNumber(h.length,2)),n.push(_.writeNumber(o.length,2)),n.push(h),n.push(o),n=_.concat(n),t.push(Vt(e.notationData,c,n))}),this.preferredHashAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Vt(e.preferredHashAlgorithms,!1,n))),this.preferredCompressionAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Vt(e.preferredCompressionAlgorithms,!1,n))),this.keyServerPreferences!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.keyServerPreferences)),t.push(Vt(e.keyServerPreferences,!1,n))),this.preferredKeyServer!==null&&t.push(Vt(e.preferredKeyServer,!1,_.encodeUTF8(this.preferredKeyServer))),this.isPrimaryUserID!==null&&t.push(Vt(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),this.policyURI!==null&&t.push(Vt(e.policyURI,!1,_.encodeUTF8(this.policyURI))),this.keyFlags!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.keyFlags)),t.push(Vt(e.keyFlags,!0,n))),this.signersUserID!==null&&t.push(Vt(e.signersUserID,!1,_.encodeUTF8(this.signersUserID))),this.reasonForRevocationFlag!==null&&(n=_.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Vt(e.reasonForRevocation,!0,n))),this.features!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.features)),t.push(Vt(e.features,!1,n))),this.signatureTargetPublicKeyAlgorithm!==null&&(n=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],n.push(_.stringToUint8Array(this.signatureTargetHash)),n=_.concat(n),t.push(Vt(e.signatureTarget,!0,n))),this.embeddedSignature!==null&&t.push(Vt(e.embeddedSignature,!0,this.embeddedSignature.write())),this.issuerFingerprint!==null&&(n=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],n=_.concat(n),t.push(Vt(e.issuerFingerprint,this.version===5,n))),this.preferredAEADAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Vt(e.preferredAEADAlgorithms,!1,n)));const i=_.concat(t),a=_.writeNumber(i.length,2);return _.concat([a,i])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach(i=>{e.push(Ki(i.length)),e.push(i)});const t=_.concat(e),n=_.writeNumber(t.length,2);return _.concat([n,t])}readSubPacket(e,t=!0){let n=0;const i=!!(128&e[n]),a=127&e[n];if(t||(this.unhashedSubpackets.push(e.subarray(n,e.length)),G3.has(a)))switch(n++,a){case p.signatureSubpacket.signatureCreationTime:this.created=_.readDate(e.subarray(n,e.length));break;case p.signatureSubpacket.signatureExpirationTime:{const s=_.readNumber(e.subarray(n,e.length));this.signatureNeverExpires=s===0,this.signatureExpirationTime=s;break}case p.signatureSubpacket.exportableCertification:this.exportable=e[n++]===1;break;case p.signatureSubpacket.trustSignature:this.trustLevel=e[n++],this.trustAmount=e[n++];break;case p.signatureSubpacket.regularExpression:this.regularExpression=e[n];break;case p.signatureSubpacket.revocable:this.revocable=e[n++]===1;break;case p.signatureSubpacket.keyExpirationTime:{const s=_.readNumber(e.subarray(n,e.length));this.keyExpirationTime=s,this.keyNeverExpires=s===0;break}case p.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.revocationKey:this.revocationKeyClass=e[n++],this.revocationKeyAlgorithm=e[n++],this.revocationKeyFingerprint=e.subarray(n,n+20);break;case p.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(n,e.length));break;case p.signatureSubpacket.notationData:{const s=!!(128&e[n]);n+=4;const o=_.readNumber(e.subarray(n,n+2));n+=2;const u=_.readNumber(e.subarray(n,n+2));n+=2;const c=_.decodeUTF8(e.subarray(n,n+o)),h=e.subarray(n+o,n+o+u);this.rawNotations.push({name:c,humanReadable:s,value:h,critical:i}),s&&(this.notations[c]=_.decodeUTF8(h));break}case p.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.primaryUserID:this.isPrimaryUserID=e[n++]!==0;break;case p.signatureSubpacket.policyURI:this.policyURI=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.signersUserID:this.signersUserID=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[n++],this.reasonForRevocationString=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.features:this.features=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[n++],this.signatureTargetHashAlgorithm=e[n++];const s=Tt.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=_.uint8ArrayToString(e.subarray(n,n+s));break}case p.signatureSubpacket.embeddedSignature:this.embeddedSignature=new wr,this.embeddedSignature.read(e.subarray(n,e.length));break;case p.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[n++],this.issuerFingerprint=e.subarray(n,e.length),this.issuerKeyVersion===5?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case p.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(n,e.length)];break;default:{const s=Error("Unknown signature subpacket type "+a);if(i)throw s;_.printDebug(s)}}}readSubPackets(e,t=!0,n){const i=_.readNumber(e.subarray(0,2));let a=2;for(;a<2+i;){const s=E2(e.subarray(a,e.length));a+=s.offset,this.readSubPacket(e.subarray(a,a+s.len),t,n),a+=s.len}return a}toSign(e,t){const n=p.signature;switch(e){case n.binary:return t.text!==null?_.encodeUTF8(t.getText(!0)):t.getBytes(!0);case n.text:{const i=t.getBytes(!0);return _.canonicalizeEOL(i)}case n.standalone:return new Uint8Array(0);case n.certGeneric:case n.certPersona:case n.certCasual:case n.certPositive:case n.certRevocation:{let i,a;if(t.userID)a=180,i=t.userID;else{if(!t.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");a=209,i=t.userAttribute}const s=i.write();return _.concat([this.toSign(n.key,t),new Uint8Array([a]),_.writeNumber(s.length,4),s])}case n.subkeyBinding:case n.subkeyRevocation:case n.keyBinding:return _.concat([this.toSign(n.key,t),this.toSign(n.key,{key:t.bind})]);case n.key:if(t.key===void 0)throw Error("Key packet is required for this signature.");return t.key.writeForHash(this.version);case n.keyRevocation:return this.toSign(n.key,t);case n.timestamp:return new Uint8Array(0);case n.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,t){let n=0;return Yt(ra(this.signatureData),i=>{n+=i.length},()=>{const i=[];return this.version!==5||this.signatureType!==p.signature.binary&&this.signatureType!==p.signature.text||(t?i.push(new Uint8Array(6)):i.push(e.writeHeader())),i.push(new Uint8Array([this.version,255])),this.version===5&&i.push(new Uint8Array(4)),i.push(_.writeNumber(n,4)),_.concat(i)})}toHash(e,t,n=!1){const i=this.toSign(e,t);return _.concat([i,this.signatureData,this.calculateTrailer(t,n)])}async hash(e,t,n,i=!1){return n||(n=this.toHash(e,t,i)),Tt.hash.digest(this.hashAlgorithm,n)}async verify(e,t,n,i=new Date,a=!1,s=vt){if(!this.issuerKeyID.equals(e.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const o=t===p.signature.binary||t===p.signature.text;if(!(this[jn]&&!o)){let c,h;if(this.hashed?h=await this.hashed:(c=this.toHash(t,n,a),h=await this.hash(t,n,c)),h=await sr(h),this.signedHashValue[0]!==h[0]||this.signedHashValue[1]!==h[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[jn]=await Tt.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,c,h),!this[jn])throw Error("Signature verification failed")}const u=_.normalizeDate(i);if(u&&this.created>u)throw Error("Signature creation time is in the future");if(u&&u>=this.getExpirationTime())throw Error("Signature is expired");if(s.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+p.read(p.hash,this.hashAlgorithm).toUpperCase());if(s.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[p.signature.binary,p.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+p.read(p.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach(({name:c,critical:h})=>{if(h&&s.knownNotations.indexOf(c)<0)throw Error("Unknown critical notation: "+c)}),this.revocationKeyClass!==null)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const t=_.normalizeDate(e);return t!==null&&!(this.created<=t&&twr.prototype.calculateTrailer.apply(await this.correspondingSig,e))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==p.packet.signature)throw Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}}function W3(r,e){if(!e[r]){let t;try{t=p.read(p.packet,r)}catch{throw new re("Unknown packet type with tag: "+r)}throw Error("Packet not allowed in this context: "+t)}return new e[r]}ws.prototype.hash=wr.prototype.hash,ws.prototype.toHash=wr.prototype.toHash,ws.prototype.toSign=wr.prototype.toSign;class Ce extends Array{static async fromBinary(e,t,n=vt){const i=new Ce;return await i.read(e,t,n),i}async read(e,t,n=vt){n.additionalAllowedPackets.length&&(t={...t,..._.constructAllowedPackets(n.additionalAllowedPackets)}),this.stream=gi(e,async(a,s)=>{const o=Oe(s);try{for(;;)if(await o.ready,await ju(a,async u=>{try{if(u.tag===p.packet.marker||u.tag===p.packet.trust)return;const c=W3(u.tag,t);c.packets=new Ce,c.fromStream=_.isStream(u.packet),await c.read(u.packet,n),await o.write(c)}catch(c){const h=!n.ignoreUnsupportedPackets&&c instanceof re,l=!(n.ignoreMalformedPackets||c instanceof re);if(h||l||Zi(u.tag))await o.abort(c);else{const k=new Ts(u.tag,u.packet);await o.write(k)}_.printDebugError(c)}}))return await o.ready,void await o.close()}catch(u){await o.abort(u)}});const i=on(this.stream);for(;;){const{done:a,value:s}=await i.read();if(a?this.stream=null:this.push(s),a||Zi(s.constructor.tag))break}i.releaseLock()}write(){const e=[];for(let t=0;t{if(a.push(u),s+=u.length,s>=o){const c=Math.min(Math.log(s)/Math.LN2|0,30),h=2**c,l=_.concat([qu(c)].concat(a));return a=[l.subarray(1+h)],s=a[0].length,l.subarray(0,1+h)}},()=>_.concat([Ki(s)].concat(a))))}else{if(_.isStream(i)){let a=0;e.push(Yt(ra(i),s=>{a+=s.length},()=>a0(n,a)))}else e.push(a0(n,i.length));e.push(i)}}return _.concat(e)}filterByTag(...e){const t=new Ce,n=i=>a=>i===a;for(let i=0;it.constructor.tag===e)}indexOfTag(...e){const t=[],n=this,i=a=>s=>a===s;for(let a=0;asr(n).then(i=>new Promise((a,s)=>{r(i,t,(o,u)=>{if(o)return s(o);a(u)})}))):Ka(Qo(n).pipe(e(t)))}}function lo(r,e={}){return function(t){const n=new r(e);return Yt(t,i=>{if(i.length)return n.push(i,mi),n.result},()=>{if(r===P3)return n.push([],oe),n.result})}}function fo(r){return function(e){return Ei(async()=>r(await sr(e)))}}Gn&&(Gn.inflateRaw,Gn.createInflateRaw,Gn.inflate,Gn.createInflate);class bs{constructor(e=vt){this.algorithm=p.hash.sha256,this.type="iterated",this.c=e.s2kIterationCountByte,this.salt=null}getCount(){return 16+(15&this.c)<<6+(this.c>>4)}read(e){let t=0;try{this.type=p.read(p.s2k,e[t++])}catch{throw new re("Unknown S2K type.")}switch(this.algorithm=e[t++],this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if(_.uint8ArrayToString(e.subarray(t,t+3))!=="GNU")throw new re("Unknown s2k type.");if(t+=3,1e3+e[t++]!==1001)throw new re("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new re("Unknown s2k type.")}return t}write(){if(this.type==="gnu-dummy")return new Uint8Array([101,0,..._.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([p.write(p.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return _.concatUint8Array(e)}async produceKey(e,t){e=_.encodeUTF8(e);const n=[];let i=0,a=0;for(;i{this.privateParams[e].fill(0),delete this.privateParams[e]}),this.privateParams=null,this.isEncrypted=!0)}}async function yo(r,e,t){const{keySize:n}=Tt.getCipher(t);return r.produceKey(e,n)}var V3=Ys(function(r){(function(e){function t(i){function a(){return Et0&&(tt.semantic=" "),tt}}function F(J,tt){return function(){var ct,wt,kt,Ut,At;for(Ut=s(),ct=c("star"),kt=0,At=tt===void 0?0:tt;(wt=J())!==null;)kt+=1,l(ct,wt);return kt>=At?ct:(o(Ut),null)}}function E(J){return J.charCodeAt(0)>=128}function G(){return h("cr",y("\r")())}function q(){return h("crlf",P(G,Q)())}function $(){return h("dquote",y('"')())}function V(){return h("htab",y(" ")())}function Q(){return h("lf",y(` +`)())}function et(){return h("sp",y(" ")())}function nt(){return h("vchar",k(function(J){var tt=J.charCodeAt(0),ct=33<=tt&&tt<=126;return i.rfc6532&&(ct=ct||E(J)),ct}))}function ft(){return h("wsp",C(et,V)())}function lt(){var J=h("quoted-pair",C(P(y("\\"),C(nt,ft)),D)());return J===null?null:(J.semantic=J.semantic[1],J)}function M(){return h("fws",C(T,P(O(P(F(ft),H(q))),F(ft,1)))())}function dt(){return h("ctext",C(function(){return k(function(J){var tt=J.charCodeAt(0),ct=33<=tt&&tt<=39||42<=tt&&tt<=91||93<=tt&&tt<=126;return i.rfc6532&&(ct=ct||E(J)),ct})},ht)())}function Pt(){return h("ccontent",C(dt,lt,j)())}function j(){return h("comment",P(y("("),F(P(O(M),Pt)),O(M),y(")"))())}function it(){return h("cfws",C(P(F(P(O(M),j),1),O(M)),M)())}function mt(){return h("atext",k(function(J){var tt="a"<=J&&J<="z"||"A"<=J&&J<="Z"||"0"<=J&&J<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(J)>=0;return i.rfc6532&&(tt=tt||E(J)),tt}))}function bt(){return h("atom",P(X(O(it)),F(mt,1),X(O(it)))())}function yt(){var J,tt;return(J=h("dot-atom-text",F(mt,1)()))===null||(tt=F(P(y("."),F(mt,1)))())!==null&&l(J,tt),J}function pt(){return h("dot-atom",P(H(O(it)),yt,H(O(it)))())}function gt(){return h("qtext",C(function(){return k(function(J){var tt=J.charCodeAt(0),ct=tt===33||35<=tt&&tt<=91||93<=tt&&tt<=126;return i.rfc6532&&(ct=ct||E(J)),ct})},I)())}function ot(){return h("qcontent",C(gt,lt)())}function S(){return h("quoted-string",P(H(O(it)),H($),F(P(O(X(M)),ot)),O(H(M)),H($),H(O(it)))())}function N(){return h("word",C(bt,S)())}function w(){return h("address",C(f,Z)())}function f(){return h("mailbox",C(K,ut)())}function K(){return h("name-addr",P(O(Y),W)())}function W(){return h("angle-addr",C(P(H(O(it)),y("<"),ut,y(">"),H(O(it))),R)())}function Z(){return h("group",P(Y,y(":"),O(m),y(";"),H(O(it)))())}function Y(){return h("display-name",((J=h("phrase",C(x,F(N,1))()))!==null&&(J.semantic=function(tt){return tt.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(J.semantic)),J));var J}function g(){return h("mailbox-list",C(P(f,F(P(y(","),f))),b)())}function d(){return h("address-list",C(P(w,F(P(y(","),w))),rt)())}function m(){return h("group-list",C(g,H(it),at)())}function A(){return h("local-part",C(St,pt,S)())}function B(){return h("dtext",C(function(){return k(function(J){var tt=J.charCodeAt(0),ct=33<=tt&&tt<=90||94<=tt&&tt<=126;return i.rfc6532&&(ct=ct||E(J)),ct})},zt)())}function U(){return h("domain-literal",P(H(O(it)),y("["),F(P(O(M),B)),O(M),y("]"),H(O(it)))())}function z(){return h("domain",(J=C(It,pt,U)(),i.rejectTLD&&J&&J.semantic&&J.semantic.indexOf(".")<0?null:(J&&(J.semantic=J.semantic.replace(/\s+/g,"")),J)));var J}function ut(){return h("addr-spec",P(A,y("@"),z)())}function st(){return i.strict?null:h("obs-NO-WS-CTL",k(function(J){var tt=J.charCodeAt(0);return 1<=tt&&tt<=8||tt===11||tt===12||14<=tt&&tt<=31||tt===127}))}function ht(){return i.strict?null:h("obs-ctext",st())}function I(){return i.strict?null:h("obs-qtext",st())}function D(){return i.strict?null:h("obs-qp",P(y("\\"),C(y("\0"),st,Q,G))())}function x(){return i.strict?null:i.atInDisplayName?h("obs-phrase",P(N,F(C(N,y("."),y("@"),X(it))))()):h("obs-phrase",P(N,F(C(N,y("."),X(it))))())}function T(){return i.strict?null:h("obs-FWS",F(P(H(O(q)),ft),1)())}function R(){return i.strict?null:h("obs-angle-addr",P(H(O(it)),y("<"),L,ut,y(">"),H(O(it)))())}function L(){return i.strict?null:h("obs-route",P(v,y(":"))())}function v(){return i.strict?null:h("obs-domain-list",P(F(C(H(it),y(","))),y("@"),z,F(P(y(","),H(O(it)),O(P(y("@"),z)))))())}function b(){return i.strict?null:h("obs-mbox-list",P(F(P(H(O(it)),y(","))),f,F(P(y(","),O(P(f,H(it))))))())}function rt(){return i.strict?null:h("obs-addr-list",P(F(P(H(O(it)),y(","))),w,F(P(y(","),O(P(w,H(it))))))())}function at(){return i.strict?null:h("obs-group-list",P(F(P(H(O(it)),y(",")),1),H(O(it)))())}function St(){return i.strict?null:h("obs-local-part",P(N,F(P(y("."),N)))())}function It(){return i.strict?null:h("obs-domain",P(bt,F(P(y("."),bt)))())}function zt(){return i.strict?null:h("obs-dtext",C(st,lt)())}function Dt(J,tt){var ct,wt,kt;if(tt==null)return null;for(wt=[tt];wt.length>0;){if((kt=wt.pop()).name===J)return kt;for(ct=kt.children.length-1;ct>=0;ct-=1)wt.push(kt.children[ct])}return null}function Wt(J,tt){var ct,wt,kt,Ut,At;if(tt==null)return null;for(wt=[tt],Ut=[],At={},ct=0;ct0;)if((kt=wt.pop()).name in At)Ut.push(kt);else for(ct=kt.children.length-1;ct>=0;ct-=1)wt.push(kt.children[ct]);return Ut}function Xt(J){var tt,ct,wt,kt,Ut;if(J===null)return null;for(tt=[],ct=Wt(["group","mailbox"],J),wt=0;wt1?null:At.addresses&&At.addresses[0]}(Ut):i.simple?Ut&&Ut.addresses:Ut}function Jt(J){var tt,ct=Dt("display-name",J),wt=[],kt=Wt(["mailbox"],J);for(tt=0;tt0;)for((Ie=xe.pop()).name===Nt&&Ne.push(Ie),De=Ie.children.length-1;De>=0;De-=1)xe.push(Ie.children[De]);return Ne}("cfws",J),kt=Wt(["comment"],J),Ut=Dt("local-part",ct),At=Dt("domain",ct);return{node:J,parts:{name:tt,address:ct,local:Ut,domain:At,comments:wt},type:J.name,name:Ct(tt),address:Ct(ct),local:Ct(Ut),domain:Ct(At),comments:Mt(kt),groupName:Ct(J.groupName)}}function Ct(J){return J!=null?J.semantic:null}function Mt(J){var tt="";if(J)for(var ct=0;ct`),t.userID=n.join(" "),t}read(e,t=vt){const n=_.decodeUTF8(e);if(n.length>t.maxUserIDLength)throw Error("User ID string is too long");try{const{name:i,address:a,comments:s}=V3.parseOneAddress({input:n,atInDisplayName:!0});this.comment=s.replace(/^\(|\)$/g,""),this.name=i,this.email=a}catch{}this.userID=n}write(){return _.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class l1 extends h1{static get tag(){return p.packet.secretSubkey}constructor(e=new Date,t=vt){super(e,t)}}async function ic(r,e){const t=new l1(r.date,e);return t.packets=null,t.algorithm=p.write(p.publicKey,r.algorithm),await t.generate(r.rsaBits,r.curve),await t.computeFingerprintAndKeyID(),t}async function Z3(r,e){const t=new h1(r.date,e);return t.packets=null,t.algorithm=p.write(p.publicKey,r.algorithm),await t.generate(r.rsaBits,r.curve,r.config),await t.computeFingerprintAndKeyID(),t}async function ze(r,e,t,n,i=new Date,a){let s,o;for(let u=r.length-1;u>=0;u--)try{(!s||r[u].created>=s.created)&&(await r[u].verify(e,t,n,i,void 0,a),s=r[u])}catch(c){o=c}if(!s)throw _.wrapError(`Could not find valid ${p.read(p.signature,t)} signature in key ${e.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,(u,c,h)=>c+" "+h.toLowerCase()),o);return s}function Ms(r,e,t=new Date){const n=_.normalizeDate(t);if(n!==null){const i=ka(r,e);return!(r.created<=n&&n0&&(a.keyExpirationTime=t.keyExpirationTime,a.keyNeverExpires=!1),await Fr(i,null,e,a,t.date,void 0,void 0,void 0,n)}async function Q3(r,e,t=new Date,n={},i){let a=i.preferredHashAlgorithm,s=a;if(r){const o=await r.getPrimaryUser(t,n,i);o.selfCertification.preferredHashAlgorithms&&([s]=o.selfCertification.preferredHashAlgorithms,a=Tt.hash.getHashByteLength(a)<=Tt.hash.getHashByteLength(s)?s:a)}switch(e.algorithm){case p.publicKey.ecdsa:case p.publicKey.eddsaLegacy:case p.publicKey.ed25519:s=Tt.getPreferredCurveHashAlgo(e.algorithm,e.publicParams.oid)}return Tt.hash.getHashByteLength(a)<=Tt.hash.getHashByteLength(s)?s:a}async function Fr(r,e,t,n,i,a,s=[],o=!1,u){if(t.isDummy())throw Error("Cannot sign with a gnu-dummy key.");if(!t.isDecrypted())throw Error("Signing key is not decrypted.");const c=new wr;return Object.assign(c,n),c.publicKeyAlgorithm=t.algorithm,c.hashAlgorithm=await Q3(e,t,i,a,u),c.rawNotations=s,await c.sign(t,r,i,o),c}async function nn(r,e,t,n=new Date,i){(r=r[t])&&(e[t].length?await Promise.all(r.map(async function(a){a.isExpired(n)||i&&!await i(a)||e[t].some(function(s){return _.equalsUint8Array(s.writeParams(),a.writeParams())})||e[t].push(a)})):e[t]=r)}async function Bn(r,e,t,n,i,a,s=new Date,o){a=a||r;const u=[];return await Promise.all(n.map(async function(c){try{i&&!c.issuerKeyID.equals(i.issuerKeyID)||(await c.verify(a,e,t,o.revocationsExpire?s:null,!1,o),u.push(c.issuerKeyID))}catch{}})),i?(i.revoked=!!u.some(c=>c.equals(i.issuerKeyID))||i.revoked||!1,i.revoked):u.length>0}function ka(r,e){let t;return e.keyNeverExpires===!1&&(t=r.created.getTime()+1e3*e.keyExpirationTime),t?new Date(t):1/0}function Ns(r,e={}){switch(r.type=r.type||e.type,r.curve=r.curve||e.curve,r.rsaBits=r.rsaBits||e.rsaBits,r.keyExpirationTime=r.keyExpirationTime!==void 0?r.keyExpirationTime:e.keyExpirationTime,r.passphrase=_.isString(r.passphrase)?r.passphrase:e.passphrase,r.date=r.date||e.date,r.sign=r.sign||!1,r.type){case"ecc":try{r.curve=p.write(p.curve,r.curve)}catch{throw Error("Unknown curve")}r.curve!==p.curve.ed25519Legacy&&r.curve!==p.curve.curve25519Legacy||(r.curve=r.sign?p.curve.ed25519Legacy:p.curve.curve25519Legacy),r.sign?r.algorithm=r.curve===p.curve.ed25519Legacy?p.publicKey.eddsaLegacy:p.publicKey.ecdsa:r.algorithm=p.publicKey.ecdh;break;case"rsa":r.algorithm=p.publicKey.rsaEncryptSign;break;default:throw Error("Unsupported key type "+r.type)}return r}function po(r,e){const t=r.algorithm;return t!==p.publicKey.rsaEncrypt&&t!==p.publicKey.elgamal&&t!==p.publicKey.ecdh&&t!==p.publicKey.x25519&&(!e.keyFlags||(e.keyFlags[0]&p.keyFlags.signData)!=0)}function go(r,e){const t=r.algorithm;return t!==p.publicKey.dsa&&t!==p.publicKey.rsaSign&&t!==p.publicKey.ecdsa&&t!==p.publicKey.eddsaLegacy&&t!==p.publicKey.ed25519&&(!e.keyFlags||(e.keyFlags[0]&p.keyFlags.encryptCommunication)!=0||(e.keyFlags[0]&p.keyFlags.encryptStorage)!=0)}function mo(r,e){return!!e.allowInsecureDecryptionWithSigningKeys||!r.keyFlags||(r.keyFlags[0]&p.keyFlags.encryptCommunication)!=0||(r.keyFlags[0]&p.keyFlags.encryptStorage)!=0}function _n(r,e){const t=p.write(p.publicKey,r.algorithm),n=r.getAlgorithmInfo();if(e.rejectPublicKeyAlgorithms.has(t))throw Error(n.algorithm+" keys are considered too weak.");switch(t){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:case p.publicKey.rsaEncrypt:if(n.bitsh.getKeys(u).length>0);return c.length===0?null:(await Promise.all(c.map(async h=>{const l=await h.getSigningKey(u,e.created,void 0,i);if(e.revoked||await a.isRevoked(e,l.keyPacket,n,i))throw Error("User certificate is revoked");try{await e.verify(l.keyPacket,p.signature.certGeneric,o,n,void 0,i)}catch(k){throw _.wrapError("User certificate is invalid",k)}})),!0)}async verifyAllCertifications(e,t=new Date,n){const i=this,a=this.selfCertifications.concat(this.otherCertifications);return Promise.all(a.map(async s=>({keyID:s.issuerKeyID,valid:await i.verifyCertificate(s,e,t,n).catch(()=>!1)})))}async verify(e=new Date,t){if(!this.selfCertifications.length)throw Error("No self-certifications found");const n=this,i=this.mainKey.keyPacket,a={userID:this.userID,userAttribute:this.userAttribute,key:i};let s;for(let o=this.selfCertifications.length-1;o>=0;o--)try{const u=this.selfCertifications[o];if(u.revoked||await n.isRevoked(u,void 0,e,t))throw Error("Self-certification is revoked");try{await u.verify(i,p.signature.certGeneric,a,e,void 0,t)}catch(c){throw _.wrapError("Self-certification is invalid",c)}return!0}catch(u){s=u}throw s}async update(e,t,n){const i=this.mainKey.keyPacket,a={userID:this.userID,userAttribute:this.userAttribute,key:i};await nn(e,this,"selfCertifications",t,async function(s){try{return await s.verify(i,p.signature.certGeneric,a,t,!1,n),!0}catch{return!1}}),await nn(e,this,"otherCertifications",t),await nn(e,this,"revocationSignatures",t,function(s){return Bn(i,p.signature.certRevocation,a,[s],void 0,void 0,t,n)})}async revoke(e,{flag:t=p.reasonForRevocation.noReason,string:n=""}={},i=new Date,a=vt){const s={userID:this.userID,userAttribute:this.userAttribute,key:e},o=new di(s.userID||s.userAttribute,this.mainKey);return o.revocationSignatures.push(await Fr(s,null,e,{signatureType:p.signature.certRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,t),reasonForRevocationString:n},i,void 0,void 0,!1,a)),await o.update(this),o}}class sn{constructor(e,t){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new Ce;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new sn(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,t,n=new Date,i=vt){const a=this.mainKey.keyPacket;return Bn(a,p.signature.subkeyRevocation,{key:a,bind:this.keyPacket},this.revocationSignatures,e,t,n,i)}async verify(e=new Date,t=vt){const n=this.mainKey.keyPacket,i={key:n,bind:this.keyPacket},a=await ze(this.bindingSignatures,n,p.signature.subkeyBinding,i,e,t);if(a.revoked||await this.isRevoked(a,null,e,t))throw Error("Subkey is revoked");if(Ms(this.keyPacket,a,e))throw Error("Subkey is expired");return a}async getExpirationTime(e=new Date,t=vt){const n=this.mainKey.keyPacket,i={key:n,bind:this.keyPacket};let a;try{a=await ze(this.bindingSignatures,n,p.signature.subkeyBinding,i,e,t)}catch{return null}const s=ka(this.keyPacket,a),o=a.getExpirationTime();return sa.bindingSignatures[u].created&&(a.bindingSignatures[u]=o),!1;try{return await o.verify(i,p.signature.subkeyBinding,s,t,void 0,n),!0}catch{return!1}}),await nn(e,this,"revocationSignatures",t,function(o){return Bn(i,p.signature.subkeyRevocation,s,[o],void 0,void 0,t,n)})}async revoke(e,{flag:t=p.reasonForRevocation.noReason,string:n=""}={},i=new Date,a=vt){const s={key:e,bind:this.keyPacket},o=new sn(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await Fr(s,null,e,{signatureType:p.signature.subkeyRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,t),reasonForRevocationString:n},i,void 0,void 0,!1,a)),await o.update(this),o}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach(r=>{sn.prototype[r]=function(){return this.keyPacket[r]()}});const X3=_.constructAllowedPackets([wr]),wo=new Set([p.packet.publicKey,p.packet.privateKey]),bo=new Set([p.packet.publicKey,p.packet.privateKey,p.packet.publicSubkey,p.packet.privateSubkey]);class sc{packetListToStructure(e,t=new Set){let n,i,a,s;for(const o of e){if(o instanceof Ts){bo.has(o.tag)&&!s&&(s=wo.has(o.tag)?wo:bo);continue}const u=o.constructor.tag;if(s){if(!s.has(u))continue;s=null}if(t.has(u))throw Error("Unexpected packet type: "+u);switch(u){case p.packet.publicKey:case p.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=o,i=this.getKeyID(),!i)throw Error("Missing Key ID");break;case p.packet.userID:case p.packet.userAttribute:n=new di(o,this),this.users.push(n);break;case p.packet.publicSubkey:case p.packet.secretSubkey:n=null,a=new sn(o,this),this.subkeys.push(a);break;case p.packet.signature:switch(o.signatureType){case p.signature.certGeneric:case p.signature.certPersona:case p.signature.certCasual:case p.signature.certPositive:if(!n){_.printDebug("Dropping certification signatures without preceding user packet");continue}o.issuerKeyID.equals(i)?n.selfCertifications.push(o):n.otherCertifications.push(o);break;case p.signature.certRevocation:n?n.revocationSignatures.push(o):this.directSignatures.push(o);break;case p.signature.key:this.directSignatures.push(o);break;case p.signature.subkeyBinding:if(!a){_.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}a.bindingSignatures.push(o);break;case p.signature.keyRevocation:this.revocationSignatures.push(o);break;case p.signature.subkeyRevocation:if(!a){_.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}a.revocationSignatures.push(o)}}}}toPacketList(){const e=new Ce;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map(t=>e.push(...t.toPacketList())),this.subkeys.map(t=>e.push(...t.toPacketList())),e}clone(e=!1){const t=new this.constructor(this.toPacketList());return e&&t.getKeys().forEach(n=>{if(n.keyPacket=Object.create(Object.getPrototypeOf(n.keyPacket),Object.getOwnPropertyDescriptors(n.keyPacket)),!n.keyPacket.isDecrypted())return;const i={};Object.keys(n.keyPacket.privateParams).forEach(a=>{i[a]=new Uint8Array(n.keyPacket.privateParams[a])}),n.keyPacket.privateParams=i}),t}getSubkeys(e=null){return this.subkeys.filter(t=>!e||t.getKeyID().equals(e,!0))}getKeys(e=null){const t=[];return e&&!this.getKeyID().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))}getKeyIDs(){return this.getKeys().map(e=>e.getKeyID())}getUserIDs(){return this.users.map(e=>e.userID?e.userID.userID:null).filter(e=>e!==null)}write(){return this.toPacketList().write()}async getSigningKey(e=null,t=new Date,n={},i=vt){await this.verifyPrimaryKey(t,n,i);const a=this.keyPacket,s=this.subkeys.slice().sort((u,c)=>c.keyPacket.created-u.keyPacket.created);let o;for(const u of s)if(!e||u.getKeyID().equals(e))try{await u.verify(t,i);const c={key:a,bind:u.keyPacket},h=await ze(u.bindingSignatures,a,p.signature.subkeyBinding,c,t,i);if(!po(u.keyPacket,h))continue;if(!h.embeddedSignature)throw Error("Missing embedded signature");return await ze([h.embeddedSignature],u.keyPacket,p.signature.keyBinding,c,t,i),_n(u.keyPacket,i),u}catch(c){o=c}try{const u=await this.getPrimaryUser(t,n,i);if((!e||a.getKeyID().equals(e))&&po(a,u.selfCertification))return _n(a,i),this}catch(u){o=u}throw _.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),o)}async getEncryptionKey(e,t=new Date,n={},i=vt){await this.verifyPrimaryKey(t,n,i);const a=this.keyPacket,s=this.subkeys.slice().sort((u,c)=>c.keyPacket.created-u.keyPacket.created);let o;for(const u of s)if(!e||u.getKeyID().equals(e))try{await u.verify(t,i);const c={key:a,bind:u.keyPacket},h=await ze(u.bindingSignatures,a,p.signature.subkeyBinding,c,t,i);if(go(u.keyPacket,h))return _n(u.keyPacket,i),u}catch(c){o=c}try{const u=await this.getPrimaryUser(t,n,i);if((!e||a.getKeyID().equals(e))&&go(a,u.selfCertification))return _n(a,i),this}catch(u){o=u}throw _.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),o)}async isRevoked(e,t,n=new Date,i=vt){return Bn(this.keyPacket,p.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,t,n,i)}async verifyPrimaryKey(e=new Date,t={},n=vt){const i=this.keyPacket;if(await this.isRevoked(null,null,e,n))throw Error("Primary key is revoked");const{selfCertification:a}=await this.getPrimaryUser(e,t,n);if(Ms(i,a,e))throw Error("Primary key is expired");const s=await ze(this.directSignatures,i,p.signature.key,{key:i},e,n).catch(()=>{});if(s&&Ms(i,s,e))throw Error("Primary key is expired")}async getExpirationTime(e,t=vt){let n;try{const{selfCertification:i}=await this.getPrimaryUser(null,e,t),a=ka(this.keyPacket,i),s=i.getExpirationTime(),o=await ze(this.directSignatures,this.keyPacket,p.signature.key,{key:this.keyPacket},null,t).catch(()=>{});if(o){const u=ka(this.keyPacket,o);n=Math.min(a,s,u)}else n=ae.subkeys.some(s=>a.hasSameFingerprintAs(s)))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,n)}const i=this.clone();return await nn(e,i,"revocationSignatures",t,a=>Bn(i.keyPacket,p.signature.keyRevocation,i,[a],null,e.keyPacket,t,n)),await nn(e,i,"directSignatures",t),await Promise.all(e.users.map(async a=>{const s=i.users.filter(o=>a.userID&&a.userID.equals(o.userID)||a.userAttribute&&a.userAttribute.equals(o.userAttribute));if(s.length>0)await Promise.all(s.map(o=>o.update(a,t,n)));else{const o=a.clone();o.mainKey=i,i.users.push(o)}})),await Promise.all(e.subkeys.map(async a=>{const s=i.subkeys.filter(o=>o.hasSameFingerprintAs(a));if(s.length>0)await Promise.all(s.map(o=>o.update(a,t,n)));else{const o=a.clone();o.mainKey=i,i.subkeys.push(o)}})),i}async getRevocationCertificate(e=new Date,t=vt){const n={key:this.keyPacket},i=await ze(this.revocationSignatures,this.keyPacket,p.signature.keyRevocation,n,e,t),a=new Ce;return a.push(i),Zs(p.armor.publicKey,a.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,n=vt){const i=await n2(e,n),a=(await Ce.fromBinary(i.data,X3,n)).findPacket(p.packet.signature);if(!a||a.signatureType!==p.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!a.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await a.verify(this.keyPacket,p.signature.keyRevocation,{key:this.keyPacket},t,void 0,n)}catch(o){throw _.wrapError("Could not verify revocation signature",o)}const s=this.clone();return s.revocationSignatures.push(a),s}async signPrimaryUser(e,t,n,i=vt){const{index:a,user:s}=await this.getPrimaryUser(t,n,i),o=await s.certify(e,t,i),u=this.clone();return u.users[a]=o,u}async signAllUsers(e,t=new Date,n=vt){const i=this.clone();return i.users=await Promise.all(this.users.map(function(a){return a.certify(e,t,n)})),i}async verifyPrimaryUser(e,t=new Date,n,i=vt){const a=this.keyPacket,{user:s}=await this.getPrimaryUser(t,n,i);return e?await s.verifyAllCertifications(e,t,i):[{keyID:a.getKeyID(),valid:await s.verify(t,i).catch(()=>!1)}]}async verifyAllUsers(e,t=new Date,n=vt){const i=this.keyPacket,a=[];return await Promise.all(this.users.map(async s=>{const o=e?await s.verifyAllCertifications(e,t,n):[{keyID:i.getKeyID(),valid:await s.verify(t,n).catch(()=>!1)}];a.push(...o.map(u=>({userID:s.userID?s.userID.userID:null,userAttribute:s.userAttribute,keyID:u.keyID,valid:u.valid})))})),a}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach(r=>{sc.prototype[r]=sn.prototype[r]});class ko extends sc{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([p.packet.secretKey,p.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=vt){return Zs(p.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class Oa extends ko{constructor(e){if(super(),this.packetListToStructure(e,new Set([p.packet.publicKey,p.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new Ce,t=this.toPacketList();for(const n of t)switch(n.constructor.tag){case p.packet.secretKey:{const i=Ye.fromSecretKeyPacket(n);e.push(i);break}case p.packet.secretSubkey:{const i=za.fromSecretSubkeyPacket(n);e.push(i);break}default:e.push(n)}return new ko(e)}armor(e=vt){return Zs(p.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,t=new Date,n={},i=vt){const a=this.keyPacket,s=[];for(let u=0;ue.isDecrypted())}async validate(e=vt){if(!this.isPrivate())throw Error("Cannot validate a public key");let t;if(this.keyPacket.isDummy()){const n=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});n&&!n.keyPacket.isDummy()&&(t=n.keyPacket)}else t=this.keyPacket;if(t)return t.validate();{const n=this.getKeys();if(n.map(i=>i.keyPacket.isDummy()).every(Boolean))throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(n.map(async i=>i.keyPacket.validate()))}}clearPrivateParams(){this.getKeys().forEach(({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()})}async revoke({flag:e=p.reasonForRevocation.noReason,string:t=""}={},n=new Date,i=vt){if(!this.isPrivate())throw Error("Need private key for revoking");const a={key:this.keyPacket},s=this.clone();return s.revocationSignatures.push(await Fr(a,null,this.keyPacket,{signatureType:p.signature.keyRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,e),reasonForRevocationString:t},n,void 0,void 0,void 0,i)),s}async addSubkey(e={}){const t={...vt,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBitsP!==y)]}const c=La.fromObject(s),h={};h.userID=c,h.key=r;const l={};return l.signatureType=p.signature.certGeneric,l.keyFlags=[p.keyFlags.certifyKeys|p.keyFlags.signData],l.preferredSymmetricAlgorithms=u([p.symmetric.aes256,p.symmetric.aes128,p.symmetric.aes192],n.preferredSymmetricAlgorithm),n.aeadProtect&&(l.preferredAEADAlgorithms=u([p.aead.eax,p.aead.ocb],n.preferredAEADAlgorithm)),l.preferredHashAlgorithms=u([p.hash.sha256,p.hash.sha512],n.preferredHashAlgorithm),l.preferredCompressionAlgorithms=u([p.compression.zlib,p.compression.zip,p.compression.uncompressed],n.preferredCompressionAlgorithm),o===0&&(l.isPrimaryUserID=!0),l.features=[0],l.features[0]|=p.features.modificationDetection,n.aeadProtect&&(l.features[0]|=p.features.aead),n.v5Keys&&(l.features[0]|=p.features.v5Keys),t.keyExpirationTime>0&&(l.keyExpirationTime=t.keyExpirationTime,l.keyNeverExpires=!1),{userIDPacket:c,signaturePacket:await Fr(h,null,r,l,t.date,void 0,void 0,void 0,n)}})).then(s=>{s.forEach(({userIDPacket:o,signaturePacket:u})=>{i.push(o),i.push(u)})}),await Promise.all(e.map(async function(s,o){const u=t.subkeys[o];return{secretSubkeyPacket:s,subkeySignaturePacket:await ac(s,r,u,n)}})).then(s=>{s.forEach(({secretSubkeyPacket:o,subkeySignaturePacket:u})=>{i.push(o),i.push(u)})});const a={key:r};return i.push(await Fr(a,null,r,{signatureType:p.signature.keyRevocation,reasonForRevocationFlag:p.reasonForRevocation.noReason,reasonForRevocationString:""},t.date,void 0,void 0,void 0,n)),t.passphrase&&r.clearPrivateParams(),await Promise.all(e.map(async function(s,o){t.subkeys[o].passphrase&&s.clearPrivateParams()})),new Oa(i)}async function cc({armoredKey:r,binaryKey:e,config:t,...n}){if(t={...vt,...t},!r&&!e)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(r&&!_.isString(r))throw Error("readPrivateKey: options.armoredKey must be a string");if(e&&!_.isUint8Array(e))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const i=Object.keys(n);if(i.length>0)throw Error("Unknown option: "+i.join(", "));let a;if(r){const{type:o,data:u}=await n2(r,t);if(o!==p.armor.privateKey)throw Error("Armored text not of type private key");a=u}else a=e;const s=await Ce.fromBinary(a,Y3,t);return new Oa(s)}async function J3({userIDs:r=[],passphrase:e,type:t="ecc",rsaBits:n=4096,curve:i="curve25519",keyExpirationTime:a=0,date:s=new Date,subkeys:o=[{}],format:u="armored",config:c,...h}){hc(c={...vt,...c}),r=lc(r);const l=Object.keys(h);if(l.length>0)throw Error("Unknown option: "+l.join(", "));if(r.length===0)throw Error("UserIDs are required for key generation");if(t==="rsa"&&nNs(C.subkeys[q],C));let H=[Z3(C,O)];H=H.concat(C.subkeys.map(G=>ic(G,O)));const X=await Promise.all(H),F=await oc(X[0],X.slice(1),C,O),E=await F.getRevocationCertificate(C.date,O);return F.revocationSignatures=[],{key:F,revocationCertificate:E}}(k,c);return y.getKeys().forEach(({keyPacket:C})=>_n(C,c)),{privateKey:va(y,u,c),publicKey:va(y.toPublic(),u,c),revocationCertificate:P}}catch(y){throw _.wrapError("Error generating keypair",y)}}async function uc({privateKey:r,userIDs:e=[],passphrase:t,keyExpirationTime:n=0,date:i,format:a="armored",config:s,...o}){hc(s={...vt,...s}),e=lc(e);const u=Object.keys(o);if(u.length>0)throw Error("Unknown option: "+u.join(", "));if(e.length===0)throw Error("UserIDs are required for key reformat");const c={privateKey:r,userIDs:e,passphrase:t,keyExpirationTime:n,date:i};try{const{key:h,revocationCertificate:l}=await async function(k,y){k=F(k);const{privateKey:P}=k;if(!P.isPrivate())throw Error("Cannot reformat a public key");if(P.keyPacket.isDummy())throw Error("Cannot reformat a gnu-dummy primary key");if(!P.getKeys().every(({keyPacket:E})=>E.isDecrypted()))throw Error("Key is not decrypted");const C=P.keyPacket;k.subkeys||(k.subkeys=await Promise.all(P.subkeys.map(async E=>{const G=E.keyPacket,q={key:C,bind:G},$=await ze(E.bindingSignatures,C,p.signature.subkeyBinding,q,null,y).catch(()=>({}));return{sign:$.keyFlags&&$.keyFlags[0]&p.keyFlags.signData}})));const O=P.subkeys.map(E=>E.keyPacket);if(k.subkeys.length!==O.length)throw Error("Number of subkey options does not match number of subkeys");k.subkeys=k.subkeys.map(E=>F(E,k));const H=await oc(C,O,k,y),X=await H.getRevocationCertificate(k.date,y);return H.revocationSignatures=[],{key:H,revocationCertificate:X};function F(E,G={}){return E.keyExpirationTime=E.keyExpirationTime||G.keyExpirationTime,E.passphrase=_.isString(E.passphrase)?E.passphrase:G.passphrase,E.date=E.date||G.date,E}}(c,s);return{privateKey:va(h,a,s),publicKey:va(h.toPublic(),a,s),revocationCertificate:l}}catch(h){throw _.wrapError("Error reformatting keypair",h)}}const t6=Object.keys(vt).length;function hc(r){const e=Object.keys(r);if(e.length!==t6){for(const t of e)if(vt[t]===void 0)throw Error("Unknown config property: "+t)}}function lc(r){return r&&!_.isArray(r)&&(r=[r]),r}function va(r,e,t){switch(e){case"object":return r;case"armored":return r.armor(t);case"binary":return r.write();default:throw Error("Unsupported format "+e)}}/*! @gera2ld/tarjs v0.3.1 | MIT License */const e6=new TextEncoder,fc=r=>e6.encode(r);new TextDecoder;function r6(r){return typeof r=="string"?fc(r).buffer:r instanceof ArrayBuffer?r:ArrayBuffer.isView(r)?new Uint8Array(r).buffer:r.arrayBuffer()}let Fs=function(r){return r[r.File=0]="File",r[r.Dir=53]="Dir",r}({});class n6{#t;constructor(){this.#t=[]}addFile(e,t,n){const i=r6(t),a=i.byteLength??t.size,s={name:e,type:Fs.File,data:i,size:a,opts:n};this.#t.push(s)}addFolder(e,t){this.#t.push({name:e,type:Fs.Dir,data:null,size:0,opts:t})}async write(){const e=i6(this.#t),t=new Uint8Array(e);let n=0;for(const i of this.#t){a6(e,i.name,n),s6(e,i.type,n),o6(e,i.size,n),p6(e,n,i.opts,i.type),y6(e,n);const a=await i.data;if(a){const s=new Uint8Array(a);t.set(s,n+512)}n+=512+512*Math.floor((i.size+511)/512)}return new Blob([e],{type:"application/x-tar"})}}function i6(r){const e=r.reduce((n,i)=>n+512+512*Math.floor((i.size+511)/512),0),t=10240*Math.floor((e+10240-1)/10240);return new ArrayBuffer(t)}function Me(r,e,t,n){const i=fc(e),a=new Uint8Array(r,t,n);for(let s=0;s>(32-(n)))) #define __INJECTS__ @@ -39,9 +39,10 @@ precision highp float;precision highp int; #define LENGTH (0) #define FILTER(h)(false) #endif -uniform uint width,height,iteration,hashData[LENGTH];out vec4 outColor;void main(){uint i[LENGTH];for(int f=0;fu)break;uint n[]=uint[](1732584193u,4023233417u,2562383102u,271733878u,3285377520u);for(int f=0;f>0&255u)/255.,float(i[1]>>8&255u)/255.,float(i[1]>>16&255u)/255.,float(i[1]>>24&255u)/255.);return;}}outColor=vec4(0);}`,m6=async(r,e)=>(r=await oc({armoredKey:r.armor()}),await Promise.all([r.keyPacket,...r.subkeys.map(t=>t.keyPacket)].map(t=>(t.created=e,t.computeFingerprintAndKeyID()))),await cc({privateKey:r,userIDs:r.users.map(t=>t.userID),date:e,format:"object"})),w6=r=>((r&255)<<24|(r&65280)<<8|r>>8&65280|r>>24&255)>>>0,b6=async(r,e,t,n,i=()=>{},a=()=>!1,s=!1)=>{if(e=e.replaceAll(" ",""),e.length!=40)throw new Error("Invalid pattern");const o=[...[0,8,16,24,32].map((G,Z)=>{const tt=e.substring(G,G+8);let rt="",dt="",it=!1;for(let O=0;O<8;O++)tt[O].match(/[\da-f]/gi)?(rt+="F",dt+=tt[O].toUpperCase(),it=!0):(rt+="0",dt+="0");return it?`(h[${Z}] & 0x${rt}u) == 0x${dt}u`:""}),...e.split("").map((G,Z)=>G.toUpperCase()==="X"?Z:null).filter(Boolean).reduce((G,Z,tt,rt)=>{const dt=Math.floor(rt[tt-1]/8),it=Math.floor(Z/8),O=7-rt[tt-1]%8,ft=7-Z%8;return tt&&G.push(`((h[${dt}] ${ft>O?"<<":">>"} ${Math.abs(ft-O)*4}) & 0xF${"0".repeat(ft)}u) == (h[${it}] & 0xF${"0".repeat(ft)}u)`),G},[])].filter(Boolean).join(" && ")||"true",u=Math.round(Math.sqrt(t)),c=new OffscreenCanvas(u,u),h=c.getContext("webgl2");let l=!1,w,y,K=new Uint8Array,C=new Uint8Array,M=new ArrayBuffer(0),H=new Uint8Array,Q=new Uint32Array;const F=new ArrayBuffer(c.width*c.height*4),E=new Uint8Array(F),W=new Uint32Array(F);let q=0;const j=performance.now();return await new Promise((G,Z)=>{const tt=async()=>{try{if(h.isContextLost())throw new Error("WebGL context lost");const rt=await Y3({...r,format:"object"});if(K=(s?rt.publicKey.subkeys[0]:rt.publicKey).keyPacket.write(),!l){C=new Uint8Array(K.length+3),C[0]=153,M=new ArrayBuffer(Math.ceil((C.length+1+8)/64)*64),H=new Uint8Array(M),Q=new Uint32Array(M);const it=h.createShader(h.VERTEX_SHADER),O=h.createShader(h.FRAGMENT_SHADER);h.shaderSource(it,p6),h.shaderSource(O,g6.replaceAll("#define __INJECTS__",Object.entries({"FILTER(h)":o,LENGTH:Q.length}).map(([Pt,$])=>`#define ${Pt} (${$})`).join(` -`))),h.compileShader(it),h.compileShader(O),w=h.createProgram(),h.attachShader(w,it),h.attachShader(w,O),h.linkProgram(w),h.useProgram(w),h.uniform1ui(h.getUniformLocation(w,"width"),c.width),h.uniform1ui(h.getUniformLocation(w,"height"),c.height),h.uniform1ui(h.getUniformLocation(w,"iteration"),n),y=h.getUniformLocation(w,"hashData");const ft=h.getAttribLocation(w,"pos");h.enableVertexAttribArray(ft),h.bindBuffer(h.ARRAY_BUFFER,h.createBuffer()),h.bufferData(h.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),h.STATIC_DRAW),h.vertexAttribPointer(ft,2,h.FLOAT,!1,0,0),h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),l=!0}C.set([K.length>>8&255,K.length&255],1),C.set(K,3),Q[C.length>>2]=0,H.set(C),H[C.length]=128;for(let it=0;itr.addFile(`${t.privateKey.getFingerprint().toUpperCase()}-sec.asc`,t.privateKey.armor()));const e=document.createElement("a");e.href=URL.createObjectURL(await r.write()),e.download="vanity-keys.tar",e.click(),URL.revokeObjectURL(e.href)},async toggleKeygen(){if(this.running){this.running=!1;return}this.userID.length||(!this.userIDInput.name&&!this.userIDInput.email&&(this.userIDInput.name="Dummy",this.userIDInput.email="dummy@example.com"),this.addUserID()),this.hashCount=0,this.runningTime=0,this.running=!0,Aa.play();try{const r={userIDs:this.userID};switch(this.keyType){case"curve25519":case"p256":case"p384":case"p521":case"brainpoolP256r1":case"brainpoolP384r1":case"brainpoolP512r1":r.type="ecc",r.curve=this.keyType;break;case"2048":case"3072":case"4096":r.type="rsa",r.rsaBits=parseInt(this.keyType);break}do{const e=await b6(r,this.pattern,this.thread,this.iteration,(t,n)=>{this.hashCount=t,this.runningTime=n},()=>!this.running,this.vanitySubkey);e&&(this.generatedKey=e,this.generatedKeyHistory.push(e),this.notification.sfx&&A6.play(),this.notification.ntfy&&this.notification.ntfyTopic&&fetch("https://ntfy.sh/",{method:"POST",body:JSON.stringify({topic:this.notification.ntfyTopic,markdown:!0,title:"webgl-vanity-gpg 计算出了新的密钥!",message:"Fingerprint: `"+this.formatFingerprint(e.publicKey.getFingerprint())+`\` +uniform uint width,height,iteration,hashData[LENGTH];out vec4 outColor;void main(){uint i[LENGTH];for(int f=0;fu)break;uint n[]=uint[](1732584193u,4023233417u,2562383102u,271733878u,3285377520u);for(int f=0;f>0&255u)/255.,float(i[1]>>8&255u)/255.,float(i[1]>>16&255u)/255.,float(i[1]>>24&255u)/255.);return;}}outColor=vec4(0);}`,w6=async(r,e)=>(r=await cc({armoredKey:r.armor()}),await Promise.all([r.keyPacket,...r.subkeys.map(t=>t.keyPacket)].map(t=>(t.created=e,t.computeFingerprintAndKeyID()))),await uc({privateKey:r,userIDs:r.users.map(t=>t.userID),date:e,format:"object"})),b6=r=>((r&255)<<24|(r&65280)<<8|r>>8&65280|r>>24&255)>>>0,vo=r=>{if(r=r.replaceAll(" ",""),r.length!=40)throw new Error("Invalid pattern");return[...[0,8,16,24,32].map((e,t)=>{const n=r.substring(e,e+8);let i="",a="",s=!1;for(let o=0;o<8;o++)n[o].match(/[\da-f]/gi)?(i+="F",a+=n[o].toUpperCase(),s=!0):(i+="0",a+="0");return s?`(h[${t}] & 0x${i}u) == 0x${a}u`:""}),...r.split("").map((e,t)=>e.toUpperCase()==="X"?t:null).filter(Boolean).reduce((e,t,n,i)=>{const a=Math.floor(i[n-1]/8),s=Math.floor(t/8),o=7-i[n-1]%8,u=7-t%8;return n&&e.push(`((h[${a}] ${u>o?"<<":">>"} ${Math.abs(u-o)*4}) & 0xF${"0".repeat(u)}u) == (h[${s}] & 0xF${"0".repeat(u)}u)`),e},[])].filter(Boolean).join(" && ")||"true"},k6=async(r,e,t,n,i=()=>{},a=()=>!1,s=!1)=>{const o=Math.round(Math.sqrt(t)),u=new OffscreenCanvas(o,o),c=u.getContext("webgl2");let h=!1,l,k,y=new Uint8Array,P=new Uint8Array,C=new ArrayBuffer(0),O=new Uint8Array,H=new Uint32Array;const X=new ArrayBuffer(u.width*u.height*4),F=new Uint8Array(X),E=new Uint32Array(X);let G=0;const q=performance.now();return await new Promise(($,V)=>{const Q=async()=>{try{if(c.isContextLost())throw new Error("WebGL context lost");const et=await J3({...r,format:"object"});if(y=(s?et.publicKey.subkeys[0]:et.publicKey).keyPacket.write(),!h){P=new Uint8Array(y.length+3),P[0]=153,C=new ArrayBuffer(Math.ceil((P.length+1+8)/64)*64),O=new Uint8Array(C),H=new Uint32Array(C);const ft=c.createShader(c.VERTEX_SHADER),lt=c.createShader(c.FRAGMENT_SHADER);c.shaderSource(ft,g6),c.shaderSource(lt,m6.replaceAll("#define __INJECTS__",Object.entries({"FILTER(h)":e,LENGTH:H.length}).map(([dt,Pt])=>`#define ${dt} (${Pt})`).join(` +`))),c.compileShader(ft),c.compileShader(lt),l=c.createProgram(),c.attachShader(l,ft),c.attachShader(l,lt),c.linkProgram(l),c.useProgram(l),c.uniform1ui(c.getUniformLocation(l,"width"),u.width),c.uniform1ui(c.getUniformLocation(l,"height"),u.height),c.uniform1ui(c.getUniformLocation(l,"iteration"),n),k=c.getUniformLocation(l,"hashData");const M=c.getAttribLocation(l,"pos");c.enableVertexAttribArray(M),c.bindBuffer(c.ARRAY_BUFFER,c.createBuffer()),c.bufferData(c.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),c.STATIC_DRAW),c.vertexAttribPointer(M,2,c.FLOAT,!1,0,0),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),h=!0}P.set([y.length>>8&255,y.length&255],1),P.set(y,3),H[P.length>>2]=0,O.set(P),O[P.length]=128;for(let ft=0;ftr.addFile(`${t.privateKey.getFingerprint().toUpperCase()}-sec.asc`,t.privateKey.armor()));const e=document.createElement("a");e.href=URL.createObjectURL(await r.write()),e.download="vanity-keys.tar",e.click(),URL.revokeObjectURL(e.href)},async toggleKeygen(){if(this.running){this.running=!1;return}this.userID.length||(!this.userIDInput.name&&!this.userIDInput.email&&(this.userIDInput.name="Dummy",this.userIDInput.email="dummy@example.com"),this.addUserID()),this.hashCount=0,this.runningTime=0,this.running=!0,Aa.play();try{const r={userIDs:this.userID};switch(this.keyType){case"curve25519":case"p256":case"p384":case"p521":case"brainpoolP256r1":case"brainpoolP384r1":case"brainpoolP512r1":r.type="ecc",r.curve=this.keyType;break;case"2048":case"3072":case"4096":r.type="rsa",r.rsaBits=parseInt(this.keyType);break}do{const e=await k6(r,this.filter.replaceAll(` +`," ")||vo(this.pattern),this.thread,this.iteration,(t,n)=>{this.hashCount=t,this.runningTime=n},()=>!this.running,this.vanitySubkey);e&&(this.generatedKey=e,this.generatedKeyHistory.push(e),this.notification.sfx&&_6.play(),this.notification.ntfy&&this.notification.ntfyTopic&&fetch("https://ntfy.sh/",{method:"POST",body:JSON.stringify({topic:this.notification.ntfyTopic,markdown:!0,title:"webgl-vanity-gpg 计算出了新的密钥!",message:"Fingerprint: `"+this.formatFingerprint(e.publicKey.getFingerprint())+`\` Created: `+e.publicKey.getCreationTime().toISOString()+` -请回到打开的 webgl-vanity-gpg 页面,在页面上/控制台中查看生成的密钥。`})}))}while(this.running&&this.nonstopMode)}catch(r){alert(r)}finally{this.running=!1,Aa.pause()}},async subkeyCombine(){try{const[r,e]=await Promise.all([this.subkeyCombinerArmoredA,this.subkeyCombinerArmoredB].map(i=>oc({armoredKey:i})));r.subkeys.push(new sn(Object.assign(new l1,e.keyPacket),r.toPublic()),...e.subkeys);const t=await cc({privateKey:r,userIDs:r.users.map(i=>i.userID),date:r.keyPacket.created,format:"object"}),n=document.createElement("a");n.href=`data:text/plain;charset=utf-8,${encodeURIComponent(t.privateKey.armor())}`,n.download=`${t.privateKey.getFingerprint().toUpperCase()}-sec.asc`,n.click()}catch(r){alert(r)}}};jo(_6).mount();export{Tn as A,Da as J,eu as M,Ui as Y,xt as d,Js as g,O5 as i,Ys as r,P6 as t,U6 as x,bu as y,d2 as z}; +请回到打开的 webgl-vanity-gpg 页面,在页面上/控制台中查看生成的密钥。`})}))}while(this.running&&this.nonstopMode)}catch(r){alert(r)}finally{this.running=!1,Aa.pause()}},async subkeyCombine(){try{const[r,e]=await Promise.all([this.subkeyCombinerArmoredA,this.subkeyCombinerArmoredB].map(i=>cc({armoredKey:i})));r.subkeys.push(new sn(Object.assign(new l1,e.keyPacket),r.toPublic()),...e.subkeys);const t=await uc({privateKey:r,userIDs:r.users.map(i=>i.userID),date:r.keyPacket.created,format:"object"}),n=document.createElement("a");n.href=`data:text/plain;charset=utf-8,${encodeURIComponent(t.privateKey.armor())}`,n.download=`${t.privateKey.getFingerprint().toUpperCase()}-sec.asc`,n.click()}catch(r){alert(r)}}};Go(E6).mount();export{Tn as A,Da as J,ru as M,Ui as Y,xt as d,Js as g,M5 as i,Ys as r,U6 as t,K6 as x,ku as y,y2 as z}; diff --git a/index.html b/index.html index 0865f57..e667586 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -webgl-vanity-gpg

使用 GPU(WebGL)快速生成带有“靓号”的 PGP 密钥!

“靓号”指的是带有连号等特定格式的密钥指纹或 ID(例如以 77777777 结尾),具体介绍和生成原理请参见:

密钥使用 OpenPGP.js 在浏览器中生成,不会发送到其他地方。如果仍然担心这一点,可以检查源代码、查看浏览器开发者工具的“网络”部分、或在页面加载完成后断网使用。


可以按 Enter 添加更多的用户 ID。

  • {{ e.name }} <{{ e.email }}> [x]

根据 GPU 性能和占用率调节这两个值。

你会得到一个生效时间距离现在 {{ (backTime > 2592000) ? `${Math.ceil(backTime / 2592000)} 个月` : `${Math.ceil(backTime / 86400)} 天` }}之内(最早为 {{ (new Date(Date.now() - backTime * 1000)).toISOString() }})的密钥。

将格式应用到子密钥而不是主密钥上

40 个十六进制数字,不区分大小写。空格会被忽略,X 表示只要这些位相同即可,其他 [\dA-FX] 以外的字符表示对该位数字没有要求。

最后 个数字为 快速设置

预计需要计算 {{ estimatedHashCount }} 次 hash,实际的计算次数可能是这个值的几分之一或几倍,也许需要一点运气……

把不同密钥的“靓号”合并到一起!
私钥 A
私钥 B

如果你希望生成主密钥和子密钥都是“靓号”的密钥,可以先分别生成两个不同的密钥,然后在这里合并。

私钥 B 的主密钥和子密钥将作为子密钥被附加到私钥 A 上。

然后,请自行使用 gpg --edit-key 编辑私钥,例如删除不需要的子密钥 delkey、修改密钥用途 change-usage 和有效期 expire 等,再输入 save 保存更改。

算号成功后播放提示音
算号成功后使用 ntfy 发送通知
不间断算号

已计算 hash:{{ hashCount }} {{ `(${Number(BigInt(hashCount) * 100n / estimatedHashCount) / 100}x estimated)` }}
耗时:{{ Math.round(runningTime / 1000 * 100) / 100 }}s
速度:{{ Math.round(hashCount / runningTime * 1000 * 100) / 100 || 0 }} hash/s

生成的密钥(已生成 {{ generatedKeyHistory.length }} 个)

[批量保存私钥] [清除生成记录]

私钥
公钥

生效时间:{{ generatedKey?.publicKey.getCreationTime().toISOString() || '****-**-**T**:**:**.***Z' }}

指纹(主密钥和子密钥):

  • {{ formatFingerprint(e) }}

\ No newline at end of file +webgl-vanity-gpg

使用 GPU(WebGL)快速生成带有“靓号”的 PGP 密钥!

“靓号”指的是带有连号等特定格式的密钥指纹或 ID(例如以 77777777 结尾),具体介绍和生成原理请参见:

密钥使用 OpenPGP.js 在浏览器中生成,不会发送到其他地方。如果仍然担心这一点,可以检查源代码、查看浏览器开发者工具的“网络”部分、或在页面加载完成后断网使用。


可以按 Enter 添加更多的用户 ID。

  • {{ e.name }} <{{ e.email }}> [x]

根据 GPU 性能和占用率调节这两个值。

你会得到一个生效时间距离现在 {{ (backTime > 2592000) ? `${Math.ceil(backTime / 2592000)} 个月` : `${Math.ceil(backTime / 86400)} 天` }}之内(最早为 {{ (new Date(Date.now() - backTime * 1000)).toISOString() }})的密钥。

将格式应用到子密钥而不是主密钥上

40 个十六进制数字,不区分大小写。空格会被忽略,X 表示只要这些位相同即可,其他 [\dA-FX] 以外的字符表示对该位数字没有要求。

最后 个数字为 快速设置

预计需要计算 {{ estimatedHashCount }} 次 hash,实际的计算次数可能是这个值的几分之一或几倍,也许需要一点运气……

直接使用 GLSL 代码!

你可以自行编写更复杂的判断密钥指纹是否符合格式的 GLSL 代码,这些代码将以 `#define FILTER(h) (code)` 的形式出现在算号使用的着色器中。

换行会被替换成空格,留空则会使用“密钥指纹格式”的设定,输入错误的代码将无法得到任何密钥。

在着色器中,计算的密钥指纹(实际上是 80 bytes 的 SHA-1 hash)以大端序保存为 `uint[5]`,并使用上面的 `FILTER` 来检查是否符合格式。

把不同密钥的“靓号”合并到一起!
私钥 A
私钥 B

如果你希望生成主密钥和子密钥都是“靓号”的密钥,可以先分别生成两个不同的密钥,然后在这里合并。

私钥 B 的主密钥和子密钥将作为子密钥被附加到私钥 A 上。

然后,请自行使用 gpg --edit-key 编辑私钥,例如删除不需要的子密钥 delkey、修改密钥用途 change-usage 和有效期 expire 等,再输入 save 保存更改。

算号成功后播放提示音
算号成功后使用 ntfy 发送通知
不间断算号

已计算 hash:{{ hashCount }} {{ `(${Number(BigInt(hashCount) * 100n / estimatedHashCount) / 100}x estimated)` }}
耗时:{{ Math.round(runningTime / 1000 * 100) / 100 }}s
速度:{{ Math.round(hashCount / runningTime * 1000 * 100) / 100 || 0 }} hash/s

生成的密钥(已生成 {{ generatedKeyHistory.length }} 个)

[批量保存私钥] [清除生成记录]

私钥
公钥

生效时间:{{ generatedKey?.publicKey.getCreationTime().toISOString() || '****-**-**T**:**:**.***Z' }}

指纹(主密钥和子密钥):

  • {{ formatFingerprint(e) }}

\ No newline at end of file