@ai-ecoverse/slicc-jsh 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";var Wi=Object.defineProperty;var h=(e,t)=>Wi(e,"name",{value:t,configurable:!0});var m=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Hr=m(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.crypto=void 0;be.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var at=m(g=>{"use strict";/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(g,"__esModule",{value:!0});g.wrapXOFConstructorWithOpts=g.wrapConstructorWithOpts=g.wrapConstructor=g.Hash=g.nextTick=g.swap32IfBE=g.byteSwapIfBE=g.swap8IfBE=g.isLE=void 0;g.isBytes=Ur;g.anumber=Ne;g.abytes=Rt;g.ahash=Ji;g.aexists=Yi;g.aoutput=Zi;g.u8=Qi;g.u32=$i;g.clean=tn;g.createView=en;g.rotr=rn;g.rotl=sn;g.byteSwap=We;g.byteSwap32=Cr;g.bytesToHex=on;g.hexToBytes=an;g.asyncLoop=hn;g.utf8ToBytes=Je;g.bytesToUtf8=fn;g.toBytes=xe;g.kdfInputToBytes=un;g.concatBytes=ln;g.checkOpts=pn;g.createHasher=Dr;g.createOptHasher=Vr;g.createXOFer=Tr;g.randomBytes=dn;var Pt=Hr();function Ur(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}h(Ur,"isBytes");function Ne(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}h(Ne,"anumber");function Rt(e,...t){if(!Ur(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}h(Rt,"abytes");function Ji(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Ne(e.outputLen),Ne(e.blockLen)}h(Ji,"ahash");function Yi(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}h(Yi,"aexists");function Zi(e,t){Rt(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}h(Zi,"aoutput");function Qi(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}h(Qi,"u8");function $i(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}h($i,"u32");function tn(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}h(tn,"clean");function en(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}h(en,"createView");function rn(e,t){return e<<32-t|e>>>t}h(rn,"rotr");function sn(e,t){return e<<t|e>>>32-t>>>0}h(sn,"rotl");g.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function We(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}h(We,"byteSwap");g.swap8IfBE=g.isLE?e=>e:e=>We(e);g.byteSwapIfBE=g.swap8IfBE;function Cr(e){for(let t=0;t<e.length;t++)e[t]=We(e[t]);return e}h(Cr,"byteSwap32");g.swap32IfBE=g.isLE?e=>e:Cr;var qr=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",nn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function on(e){if(Rt(e),qr)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=nn[e[r]];return t}h(on,"bytesToHex");var _t={_0:48,_9:57,A:65,F:70,a:97,f:102};function Lr(e){if(e>=_t._0&&e<=_t._9)return e-_t._0;if(e>=_t.A&&e<=_t.F)return e-(_t.A-10);if(e>=_t.a&&e<=_t.f)return e-(_t.a-10)}h(Lr,"asciiToBase16");function an(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(qr)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let s=new Uint8Array(r);for(let i=0,n=0;i<r;i++,n+=2){let o=Lr(e.charCodeAt(n)),a=Lr(e.charCodeAt(n+1));if(o===void 0||a===void 0){let c=e[n]+e[n+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+n)}s[i]=o*16+a}return s}h(an,"hexToBytes");var cn=h(async()=>{},"nextTick");g.nextTick=cn;async function hn(e,t,r){let s=Date.now();for(let i=0;i<e;i++){r(i);let n=Date.now()-s;n>=0&&n<t||(await(0,g.nextTick)(),s+=n)}}h(hn,"asyncLoop");function Je(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}h(Je,"utf8ToBytes");function fn(e){return new TextDecoder().decode(e)}h(fn,"bytesToUtf8");function xe(e){return typeof e=="string"&&(e=Je(e)),Rt(e),e}h(xe,"toBytes");function un(e){return typeof e=="string"&&(e=Je(e)),Rt(e),e}h(un,"kdfInputToBytes");function ln(...e){let t=0;for(let s=0;s<e.length;s++){let i=e[s];Rt(i),t+=i.length}let r=new Uint8Array(t);for(let s=0,i=0;s<e.length;s++){let n=e[s];r.set(n,i),i+=n.length}return r}h(ln,"concatBytes");function pn(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,t)}h(pn,"checkOpts");var ze=class{static{h(this,"Hash")}};g.Hash=ze;function Dr(e){let t=h(s=>e().update(xe(s)).digest(),"hashC"),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}h(Dr,"createHasher");function Vr(e){let t=h((s,i)=>e(i).update(xe(s)).digest(),"hashC"),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=s=>e(s),t}h(Vr,"createOptHasher");function Tr(e){let t=h((s,i)=>e(i).update(xe(s)).digest(),"hashC"),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=s=>e(s),t}h(Tr,"createXOFer");g.wrapConstructor=Dr;g.wrapConstructorWithOpts=Vr;g.wrapXOFConstructorWithOpts=Tr;function dn(e=32){if(Pt.crypto&&typeof Pt.crypto.getRandomValues=="function")return Pt.crypto.getRandomValues(new Uint8Array(e));if(Pt.crypto&&typeof Pt.crypto.randomBytes=="function")return Uint8Array.from(Pt.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}h(dn,"randomBytes")});var re=m(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.SHA512_IV=z.SHA384_IV=z.SHA224_IV=z.SHA256_IV=z.HashMD=void 0;z.setBigUint64=Or;z.Chi=yn;z.Maj=_n;var lt=at();function Or(e,t,r,s){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,s);let i=BigInt(32),n=BigInt(4294967295),o=Number(r>>i&n),a=Number(r&n),c=s?4:0,f=s?0:4;e.setUint32(t+c,o,s),e.setUint32(t+f,a,s)}h(Or,"setBigUint64");function yn(e,t,r){return e&t^~e&r}h(yn,"Chi");function _n(e,t,r){return e&t^e&r^t&r}h(_n,"Maj");var Ye=class extends lt.Hash{static{h(this,"HashMD")}constructor(t,r,s,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=r,this.padOffset=s,this.isLE=i,this.buffer=new Uint8Array(t),this.view=(0,lt.createView)(this.buffer)}update(t){(0,lt.aexists)(this),t=(0,lt.toBytes)(t),(0,lt.abytes)(t);let{view:r,buffer:s,blockLen:i}=this,n=t.length;for(let o=0;o<n;){let a=Math.min(i-this.pos,n-o);if(a===i){let c=(0,lt.createView)(t);for(;i<=n-o;o+=i)this.process(c,o);continue}s.set(t.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,lt.aexists)(this),(0,lt.aoutput)(t,this),this.finished=!0;let{buffer:r,view:s,blockLen:i,isLE:n}=this,{pos:o}=this;r[o++]=128,(0,lt.clean)(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(s,0),o=0);for(let l=o;l<i;l++)r[l]=0;Or(s,i-8,BigInt(this.length*8),n),this.process(s,0);let a=(0,lt.createView)(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let f=c/4,u=this.get();if(f>u.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<f;l++)a.setUint32(4*l,u[l],n)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let s=t.slice(0,r);return this.destroy(),s}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:s,length:i,finished:n,destroyed:o,pos:a}=this;return t.destroyed=o,t.finished=n,t.length=i,t.pos=a,i%r&&t.buffer.set(s),t}clone(){return this._cloneInto()}};z.HashMD=Ye;z.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);z.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]);z.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]);z.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])});var Kr=m(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.ripemd160=W.RIPEMD160=W.md5=W.MD5=W.sha1=W.SHA1=void 0;var qt=re(),P=at(),jt=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),vt=new Uint32Array(80),ge=class extends qt.HashMD{static{h(this,"SHA1")}constructor(){super(64,20,8,!1),this.A=jt[0]|0,this.B=jt[1]|0,this.C=jt[2]|0,this.D=jt[3]|0,this.E=jt[4]|0}get(){let{A:t,B:r,C:s,D:i,E:n}=this;return[t,r,s,i,n]}set(t,r,s,i,n){this.A=t|0,this.B=r|0,this.C=s|0,this.D=i|0,this.E=n|0}process(t,r){for(let c=0;c<16;c++,r+=4)vt[c]=t.getUint32(r,!1);for(let c=16;c<80;c++)vt[c]=(0,P.rotl)(vt[c-3]^vt[c-8]^vt[c-14]^vt[c-16],1);let{A:s,B:i,C:n,D:o,E:a}=this;for(let c=0;c<80;c++){let f,u;c<20?(f=(0,qt.Chi)(i,n,o),u=1518500249):c<40?(f=i^n^o,u=1859775393):c<60?(f=(0,qt.Maj)(i,n,o),u=2400959708):(f=i^n^o,u=3395469782);let l=(0,P.rotl)(s,5)+f+a+u+vt[c]|0;a=o,o=n,n=(0,P.rotl)(i,30),i=s,s=l}s=s+this.A|0,i=i+this.B|0,n=n+this.C|0,o=o+this.D|0,a=a+this.E|0,this.set(s,i,n,o,a)}roundClean(){(0,P.clean)(vt)}destroy(){this.set(0,0,0,0,0),(0,P.clean)(this.buffer)}};W.SHA1=ge;W.sha1=(0,P.createHasher)(()=>new ge);var bn=Math.pow(2,32),xn=Array.from({length:64},(e,t)=>Math.floor(bn*Math.abs(Math.sin(t+1)))),ve=jt.slice(0,4),Ze=new Uint32Array(16),we=class extends qt.HashMD{static{h(this,"MD5")}constructor(){super(64,16,8,!0),this.A=ve[0]|0,this.B=ve[1]|0,this.C=ve[2]|0,this.D=ve[3]|0}get(){let{A:t,B:r,C:s,D:i}=this;return[t,r,s,i]}set(t,r,s,i){this.A=t|0,this.B=r|0,this.C=s|0,this.D=i|0}process(t,r){for(let a=0;a<16;a++,r+=4)Ze[a]=t.getUint32(r,!0);let{A:s,B:i,C:n,D:o}=this;for(let a=0;a<64;a++){let c,f,u;a<16?(c=(0,qt.Chi)(i,n,o),f=a,u=[7,12,17,22]):a<32?(c=(0,qt.Chi)(o,i,n),f=(5*a+1)%16,u=[5,9,14,20]):a<48?(c=i^n^o,f=(3*a+5)%16,u=[4,11,16,23]):(c=n^(i|~o),f=7*a%16,u=[6,10,15,21]),c=c+s+xn[a]+Ze[f],s=o,o=n,n=i,i=i+(0,P.rotl)(c,u[a%4])}s=s+this.A|0,i=i+this.B|0,n=n+this.C|0,o=o+this.D|0,this.set(s,i,n,o)}roundClean(){(0,P.clean)(Ze)}destroy(){this.set(0,0,0,0),(0,P.clean)(this.buffer)}};W.MD5=we;W.md5=(0,P.createHasher)(()=>new we);var vn=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Gr=Uint8Array.from(new Array(16).fill(0).map((e,t)=>t)),Bn=Gr.map(e=>(9*e+5)%16),Fr=(()=>{let r=[[Gr],[Bn]];for(let s=0;s<4;s++)for(let i of r)i.push(i[s].map(n=>vn[n]));return r})(),Pr=Fr[0],Rr=Fr[1],jr=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),gn=Pr.map((e,t)=>e.map(r=>jr[t][r])),wn=Rr.map((e,t)=>e.map(r=>jr[t][r])),An=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),mn=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function Mr(e,t,r,s){return e===0?t^r^s:e===1?t&r|~t&s:e===2?(t|~r)^s:e===3?t&s|r&~s:t^(r|~s)}h(Mr,"ripemd_f");var Be=new Uint32Array(16),Ae=class extends qt.HashMD{static{h(this,"RIPEMD160")}constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:r,h2:s,h3:i,h4:n}=this;return[t,r,s,i,n]}set(t,r,s,i,n){this.h0=t|0,this.h1=r|0,this.h2=s|0,this.h3=i|0,this.h4=n|0}process(t,r){for(let p=0;p<16;p++,r+=4)Be[p]=t.getUint32(r,!0);let s=this.h0|0,i=s,n=this.h1|0,o=n,a=this.h2|0,c=a,f=this.h3|0,u=f,l=this.h4|0,d=l;for(let p=0;p<5;p++){let _=4-p,y=An[p],x=mn[p],v=Pr[p],H=Rr[p],S=gn[p],E=wn[p];for(let L=0;L<16;L++){let q=(0,P.rotl)(s+Mr(p,n,a,f)+Be[v[L]]+y,S[L])+l|0;s=l,l=f,f=(0,P.rotl)(a,10)|0,a=n,n=q}for(let L=0;L<16;L++){let q=(0,P.rotl)(i+Mr(_,o,c,u)+Be[H[L]]+x,E[L])+d|0;i=d,d=u,u=(0,P.rotl)(c,10)|0,c=o,o=q}}this.set(this.h1+a+u|0,this.h2+f+d|0,this.h3+l+i|0,this.h4+s+o|0,this.h0+n+c|0)}roundClean(){(0,P.clean)(Be)}destroy(){this.destroyed=!0,(0,P.clean)(this.buffer),this.set(0,0,0,0,0)}};W.RIPEMD160=Ae;W.ripemd160=(0,P.createHasher)(()=>new Ae)});var Se=m(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.toBig=k.shrSL=k.shrSH=k.rotrSL=k.rotrSH=k.rotrBL=k.rotrBH=k.rotr32L=k.rotr32H=k.rotlSL=k.rotlSH=k.rotlBL=k.rotlBH=k.add5L=k.add5H=k.add4L=k.add4H=k.add3L=k.add3H=void 0;k.add=ns;k.fromBig=$e;k.split=Xr;var me=BigInt(2**32-1),Qe=BigInt(32);function $e(e,t=!1){return t?{h:Number(e&me),l:Number(e>>Qe&me)}:{h:Number(e>>Qe&me)|0,l:Number(e&me)|0}}h($e,"fromBig");function Xr(e,t=!1){let r=e.length,s=new Uint32Array(r),i=new Uint32Array(r);for(let n=0;n<r;n++){let{h:o,l:a}=$e(e[n],t);[s[n],i[n]]=[o,a]}return[s,i]}h(Xr,"split");var Nr=h((e,t)=>BigInt(e>>>0)<<Qe|BigInt(t>>>0),"toBig");k.toBig=Nr;var zr=h((e,t,r)=>e>>>r,"shrSH");k.shrSH=zr;var Wr=h((e,t,r)=>e<<32-r|t>>>r,"shrSL");k.shrSL=Wr;var Jr=h((e,t,r)=>e>>>r|t<<32-r,"rotrSH");k.rotrSH=Jr;var Yr=h((e,t,r)=>e<<32-r|t>>>r,"rotrSL");k.rotrSL=Yr;var Zr=h((e,t,r)=>e<<64-r|t>>>r-32,"rotrBH");k.rotrBH=Zr;var Qr=h((e,t,r)=>e>>>r-32|t<<64-r,"rotrBL");k.rotrBL=Qr;var $r=h((e,t)=>t,"rotr32H");k.rotr32H=$r;var ts=h((e,t)=>e,"rotr32L");k.rotr32L=ts;var es=h((e,t,r)=>e<<r|t>>>32-r,"rotlSH");k.rotlSH=es;var rs=h((e,t,r)=>t<<r|e>>>32-r,"rotlSL");k.rotlSL=rs;var ss=h((e,t,r)=>t<<r-32|e>>>64-r,"rotlBH");k.rotlBH=ss;var is=h((e,t,r)=>e<<r-32|t>>>64-r,"rotlBL");k.rotlBL=is;function ns(e,t,r,s){let i=(t>>>0)+(s>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}h(ns,"add");var os=h((e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),"add3L");k.add3L=os;var as=h((e,t,r,s)=>t+r+s+(e/2**32|0)|0,"add3H");k.add3H=as;var cs=h((e,t,r,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0),"add4L");k.add4L=cs;var hs=h((e,t,r,s,i)=>t+r+s+i+(e/2**32|0)|0,"add4H");k.add4H=hs;var fs=h((e,t,r,s,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0)+(i>>>0),"add5L");k.add5L=fs;var us=h((e,t,r,s,i,n)=>t+r+s+i+n+(e/2**32|0)|0,"add5H");k.add5H=us;var Sn={fromBig:$e,split:Xr,toBig:Nr,shrSH:zr,shrSL:Wr,rotrSH:Jr,rotrSL:Yr,rotrBH:Zr,rotrBL:Qr,rotr32H:$r,rotr32L:ts,rotlSH:es,rotlSL:rs,rotlBH:ss,rotlBL:is,add:ns,add3L:os,add3H:as,add4L:cs,add4H:hs,add5H:us,add5L:fs};k.default=Sn});var tr=m(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.sha512_224=U.sha512_256=U.sha384=U.sha512=U.sha224=U.sha256=U.SHA512_256=U.SHA512_224=U.SHA384=U.SHA512=U.SHA224=U.SHA256=void 0;var B=re(),I=Se(),D=at(),kn=Uint32Array.from([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]),Bt=new Uint32Array(64),se=class extends B.HashMD{static{h(this,"SHA256")}constructor(t=32){super(64,t,8,!1),this.A=B.SHA256_IV[0]|0,this.B=B.SHA256_IV[1]|0,this.C=B.SHA256_IV[2]|0,this.D=B.SHA256_IV[3]|0,this.E=B.SHA256_IV[4]|0,this.F=B.SHA256_IV[5]|0,this.G=B.SHA256_IV[6]|0,this.H=B.SHA256_IV[7]|0}get(){let{A:t,B:r,C:s,D:i,E:n,F:o,G:a,H:c}=this;return[t,r,s,i,n,o,a,c]}set(t,r,s,i,n,o,a,c){this.A=t|0,this.B=r|0,this.C=s|0,this.D=i|0,this.E=n|0,this.F=o|0,this.G=a|0,this.H=c|0}process(t,r){for(let l=0;l<16;l++,r+=4)Bt[l]=t.getUint32(r,!1);for(let l=16;l<64;l++){let d=Bt[l-15],p=Bt[l-2],_=(0,D.rotr)(d,7)^(0,D.rotr)(d,18)^d>>>3,y=(0,D.rotr)(p,17)^(0,D.rotr)(p,19)^p>>>10;Bt[l]=y+Bt[l-7]+_+Bt[l-16]|0}let{A:s,B:i,C:n,D:o,E:a,F:c,G:f,H:u}=this;for(let l=0;l<64;l++){let d=(0,D.rotr)(a,6)^(0,D.rotr)(a,11)^(0,D.rotr)(a,25),p=u+d+(0,B.Chi)(a,c,f)+kn[l]+Bt[l]|0,y=((0,D.rotr)(s,2)^(0,D.rotr)(s,13)^(0,D.rotr)(s,22))+(0,B.Maj)(s,i,n)|0;u=f,f=c,c=a,a=o+p|0,o=n,n=i,i=s,s=p+y|0}s=s+this.A|0,i=i+this.B|0,n=n+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(s,i,n,o,a,c,f,u)}roundClean(){(0,D.clean)(Bt)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,D.clean)(this.buffer)}};U.SHA256=se;var ke=class extends se{static{h(this,"SHA224")}constructor(){super(28),this.A=B.SHA224_IV[0]|0,this.B=B.SHA224_IV[1]|0,this.C=B.SHA224_IV[2]|0,this.D=B.SHA224_IV[3]|0,this.E=B.SHA224_IV[4]|0,this.F=B.SHA224_IV[5]|0,this.G=B.SHA224_IV[6]|0,this.H=B.SHA224_IV[7]|0}};U.SHA224=ke;var ls=I.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),In=ls[0],En=ls[1],gt=new Uint32Array(80),wt=new Uint32Array(80),Dt=class extends B.HashMD{static{h(this,"SHA512")}constructor(t=64){super(128,t,16,!1),this.Ah=B.SHA512_IV[0]|0,this.Al=B.SHA512_IV[1]|0,this.Bh=B.SHA512_IV[2]|0,this.Bl=B.SHA512_IV[3]|0,this.Ch=B.SHA512_IV[4]|0,this.Cl=B.SHA512_IV[5]|0,this.Dh=B.SHA512_IV[6]|0,this.Dl=B.SHA512_IV[7]|0,this.Eh=B.SHA512_IV[8]|0,this.El=B.SHA512_IV[9]|0,this.Fh=B.SHA512_IV[10]|0,this.Fl=B.SHA512_IV[11]|0,this.Gh=B.SHA512_IV[12]|0,this.Gl=B.SHA512_IV[13]|0,this.Hh=B.SHA512_IV[14]|0,this.Hl=B.SHA512_IV[15]|0}get(){let{Ah:t,Al:r,Bh:s,Bl:i,Ch:n,Cl:o,Dh:a,Dl:c,Eh:f,El:u,Fh:l,Fl:d,Gh:p,Gl:_,Hh:y,Hl:x}=this;return[t,r,s,i,n,o,a,c,f,u,l,d,p,_,y,x]}set(t,r,s,i,n,o,a,c,f,u,l,d,p,_,y,x){this.Ah=t|0,this.Al=r|0,this.Bh=s|0,this.Bl=i|0,this.Ch=n|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=l|0,this.Fl=d|0,this.Gh=p|0,this.Gl=_|0,this.Hh=y|0,this.Hl=x|0}process(t,r){for(let S=0;S<16;S++,r+=4)gt[S]=t.getUint32(r),wt[S]=t.getUint32(r+=4);for(let S=16;S<80;S++){let E=gt[S-15]|0,L=wt[S-15]|0,q=I.rotrSH(E,L,1)^I.rotrSH(E,L,8)^I.shrSH(E,L,7),it=I.rotrSL(E,L,1)^I.rotrSL(E,L,8)^I.shrSL(E,L,7),G=gt[S-2]|0,F=wt[S-2]|0,$=I.rotrSH(G,F,19)^I.rotrBH(G,F,61)^I.shrSH(G,F,6),nt=I.rotrSL(G,F,19)^I.rotrBL(G,F,61)^I.shrSL(G,F,6),tt=I.add4L(it,nt,wt[S-7],wt[S-16]),ot=I.add4H(tt,q,$,gt[S-7],gt[S-16]);gt[S]=ot|0,wt[S]=tt|0}let{Ah:s,Al:i,Bh:n,Bl:o,Ch:a,Cl:c,Dh:f,Dl:u,Eh:l,El:d,Fh:p,Fl:_,Gh:y,Gl:x,Hh:v,Hl:H}=this;for(let S=0;S<80;S++){let E=I.rotrSH(l,d,14)^I.rotrSH(l,d,18)^I.rotrBH(l,d,41),L=I.rotrSL(l,d,14)^I.rotrSL(l,d,18)^I.rotrBL(l,d,41),q=l&p^~l&y,it=d&_^~d&x,G=I.add5L(H,L,it,En[S],wt[S]),F=I.add5H(G,v,E,q,In[S],gt[S]),$=G|0,nt=I.rotrSH(s,i,28)^I.rotrBH(s,i,34)^I.rotrBH(s,i,39),tt=I.rotrSL(s,i,28)^I.rotrBL(s,i,34)^I.rotrBL(s,i,39),ot=s&n^s&a^n&a,yt=i&o^i&c^o&c;v=y|0,H=x|0,y=p|0,x=_|0,p=l|0,_=d|0,{h:l,l:d}=I.add(f|0,u|0,F|0,$|0),f=a|0,u=c|0,a=n|0,c=o|0,n=s|0,o=i|0;let ut=I.add3L($,tt,yt);s=I.add3H(ut,F,nt,ot),i=ut|0}({h:s,l:i}=I.add(this.Ah|0,this.Al|0,s|0,i|0)),{h:n,l:o}=I.add(this.Bh|0,this.Bl|0,n|0,o|0),{h:a,l:c}=I.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l:u}=I.add(this.Dh|0,this.Dl|0,f|0,u|0),{h:l,l:d}=I.add(this.Eh|0,this.El|0,l|0,d|0),{h:p,l:_}=I.add(this.Fh|0,this.Fl|0,p|0,_|0),{h:y,l:x}=I.add(this.Gh|0,this.Gl|0,y|0,x|0),{h:v,l:H}=I.add(this.Hh|0,this.Hl|0,v|0,H|0),this.set(s,i,n,o,a,c,f,u,l,d,p,_,y,x,v,H)}roundClean(){(0,D.clean)(gt,wt)}destroy(){(0,D.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};U.SHA512=Dt;var Ie=class extends Dt{static{h(this,"SHA384")}constructor(){super(48),this.Ah=B.SHA384_IV[0]|0,this.Al=B.SHA384_IV[1]|0,this.Bh=B.SHA384_IV[2]|0,this.Bl=B.SHA384_IV[3]|0,this.Ch=B.SHA384_IV[4]|0,this.Cl=B.SHA384_IV[5]|0,this.Dh=B.SHA384_IV[6]|0,this.Dl=B.SHA384_IV[7]|0,this.Eh=B.SHA384_IV[8]|0,this.El=B.SHA384_IV[9]|0,this.Fh=B.SHA384_IV[10]|0,this.Fl=B.SHA384_IV[11]|0,this.Gh=B.SHA384_IV[12]|0,this.Gl=B.SHA384_IV[13]|0,this.Hh=B.SHA384_IV[14]|0,this.Hl=B.SHA384_IV[15]|0}};U.SHA384=Ie;var j=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),K=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),Ee=class extends Dt{static{h(this,"SHA512_224")}constructor(){super(28),this.Ah=j[0]|0,this.Al=j[1]|0,this.Bh=j[2]|0,this.Bl=j[3]|0,this.Ch=j[4]|0,this.Cl=j[5]|0,this.Dh=j[6]|0,this.Dl=j[7]|0,this.Eh=j[8]|0,this.El=j[9]|0,this.Fh=j[10]|0,this.Fl=j[11]|0,this.Gh=j[12]|0,this.Gl=j[13]|0,this.Hh=j[14]|0,this.Hl=j[15]|0}};U.SHA512_224=Ee;var He=class extends Dt{static{h(this,"SHA512_256")}constructor(){super(32),this.Ah=K[0]|0,this.Al=K[1]|0,this.Bh=K[2]|0,this.Bl=K[3]|0,this.Ch=K[4]|0,this.Cl=K[5]|0,this.Dh=K[6]|0,this.Dl=K[7]|0,this.Eh=K[8]|0,this.El=K[9]|0,this.Fh=K[10]|0,this.Fl=K[11]|0,this.Gh=K[12]|0,this.Gl=K[13]|0,this.Hh=K[14]|0,this.Hl=K[15]|0}};U.SHA512_256=He;U.sha256=(0,D.createHasher)(()=>new se);U.sha224=(0,D.createHasher)(()=>new ke);U.sha512=(0,D.createHasher)(()=>new Dt);U.sha384=(0,D.createHasher)(()=>new Ie);U.sha512_256=(0,D.createHasher)(()=>new He);U.sha512_224=(0,D.createHasher)(()=>new Ee)});var gs=m(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.shake256=C.shake128=C.keccak_512=C.keccak_384=C.keccak_256=C.keccak_224=C.sha3_512=C.sha3_384=C.sha3_256=C.sha3_224=C.Keccak=void 0;C.keccakP=vs;var ne=Se(),X=at(),Hn=BigInt(0),ie=BigInt(1),Ln=BigInt(2),Un=BigInt(7),Cn=BigInt(256),qn=BigInt(113),ys=[],_s=[],bs=[];for(let e=0,t=ie,r=1,s=0;e<24;e++){[r,s]=[s,(2*r+3*s)%5],ys.push(2*(5*s+r)),_s.push((e+1)*(e+2)/2%64);let i=Hn;for(let n=0;n<7;n++)t=(t<<ie^(t>>Un)*qn)%Cn,t&Ln&&(i^=ie<<(ie<<BigInt(n))-ie);bs.push(i)}var xs=(0,ne.split)(bs,!0),Dn=xs[0],Vn=xs[1],ps=h((e,t,r)=>r>32?(0,ne.rotlBH)(e,t,r):(0,ne.rotlSH)(e,t,r),"rotlH"),ds=h((e,t,r)=>r>32?(0,ne.rotlBL)(e,t,r):(0,ne.rotlSL)(e,t,r),"rotlL");function vs(e,t=24){let r=new Uint32Array(10);for(let s=24-t;s<24;s++){for(let o=0;o<10;o++)r[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,c=(o+2)%10,f=r[c],u=r[c+1],l=ps(f,u,1)^r[a],d=ds(f,u,1)^r[a+1];for(let p=0;p<50;p+=10)e[o+p]^=l,e[o+p+1]^=d}let i=e[2],n=e[3];for(let o=0;o<24;o++){let a=_s[o],c=ps(i,n,a),f=ds(i,n,a),u=ys[o];i=e[u],n=e[u+1],e[u]=c,e[u+1]=f}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=Dn[s],e[1]^=Vn[s]}(0,X.clean)(r)}h(vs,"keccakP");var oe=class e extends X.Hash{static{h(this,"Keccak")}constructor(t,r,s,i=!1,n=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=s,this.enableXOF=i,this.rounds=n,(0,X.anumber)(s),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,X.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,X.swap32IfBE)(this.state32),vs(this.state32,this.rounds),(0,X.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(t){(0,X.aexists)(this),t=(0,X.toBytes)(t),(0,X.abytes)(t);let{blockLen:r,state:s}=this,i=t.length;for(let n=0;n<i;){let o=Math.min(r-this.pos,i-n);for(let a=0;a<o;a++)s[this.pos++]^=t[n++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:s,blockLen:i}=this;t[s]^=r,(r&128)!==0&&s===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){(0,X.aexists)(this,!1),(0,X.abytes)(t),this.finish();let r=this.state,{blockLen:s}=this;for(let i=0,n=t.length;i<n;){this.posOut>=s&&this.keccak();let o=Math.min(s-this.posOut,n-i);t.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,X.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,X.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,X.clean)(this.state)}_cloneInto(t){let{blockLen:r,suffix:s,outputLen:i,rounds:n,enableXOF:o}=this;return t||(t=new e(r,s,i,o,n)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=n,t.suffix=s,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}};C.Keccak=oe;var At=h((e,t,r)=>(0,X.createHasher)(()=>new oe(t,e,r)),"gen");C.sha3_224=At(6,144,224/8);C.sha3_256=At(6,136,256/8);C.sha3_384=At(6,104,384/8);C.sha3_512=At(6,72,512/8);C.keccak_224=At(1,144,224/8);C.keccak_256=At(1,136,256/8);C.keccak_384=At(1,104,384/8);C.keccak_512=At(1,72,512/8);var Bs=h((e,t,r)=>(0,X.createXOFer)((s={})=>new oe(t,e,s.dkLen===void 0?r:s.dkLen,!0)),"genShake");C.shake128=Bs(31,168,128/8);C.shake256=Bs(31,136,256/8)});var er=m(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.BSIGMA=void 0;Kt.G1s=Tn;Kt.G2s=On;var Le=at();Kt.BSIGMA=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);function Tn(e,t,r,s,i){return e=e+t+i|0,s=(0,Le.rotr)(s^e,16),r=r+s|0,t=(0,Le.rotr)(t^r,12),{a:e,b:t,c:r,d:s}}h(Tn,"G1s");function On(e,t,r,s,i){return e=e+t+i|0,s=(0,Le.rotr)(s^e,8),r=r+s|0,t=(0,Le.rotr)(t^r,7),{a:e,b:t,c:r,d:s}}h(On,"G2s")});var rr=m(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.blake2s=Q.BLAKE2s=Q.blake2b=Q.BLAKE2b=Q.BLAKE2=void 0;Q.compress=As;var M=er(),Mn=re(),N=Se(),A=at(),T=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),b=new Uint32Array(32);function mt(e,t,r,s,i,n){let o=i[n],a=i[n+1],c=b[2*e],f=b[2*e+1],u=b[2*t],l=b[2*t+1],d=b[2*r],p=b[2*r+1],_=b[2*s],y=b[2*s+1],x=N.add3L(c,u,o);f=N.add3H(x,f,l,a),c=x|0,{Dh:y,Dl:_}={Dh:y^f,Dl:_^c},{Dh:y,Dl:_}={Dh:N.rotr32H(y,_),Dl:N.rotr32L(y,_)},{h:p,l:d}=N.add(p,d,y,_),{Bh:l,Bl:u}={Bh:l^p,Bl:u^d},{Bh:l,Bl:u}={Bh:N.rotrSH(l,u,24),Bl:N.rotrSL(l,u,24)},b[2*e]=c,b[2*e+1]=f,b[2*t]=u,b[2*t+1]=l,b[2*r]=d,b[2*r+1]=p,b[2*s]=_,b[2*s+1]=y}h(mt,"G1b");function St(e,t,r,s,i,n){let o=i[n],a=i[n+1],c=b[2*e],f=b[2*e+1],u=b[2*t],l=b[2*t+1],d=b[2*r],p=b[2*r+1],_=b[2*s],y=b[2*s+1],x=N.add3L(c,u,o);f=N.add3H(x,f,l,a),c=x|0,{Dh:y,Dl:_}={Dh:y^f,Dl:_^c},{Dh:y,Dl:_}={Dh:N.rotrSH(y,_,16),Dl:N.rotrSL(y,_,16)},{h:p,l:d}=N.add(p,d,y,_),{Bh:l,Bl:u}={Bh:l^p,Bl:u^d},{Bh:l,Bl:u}={Bh:N.rotrBH(l,u,63),Bl:N.rotrBL(l,u,63)},b[2*e]=c,b[2*e+1]=f,b[2*t]=u,b[2*t+1]=l,b[2*r]=d,b[2*r+1]=p,b[2*s]=_,b[2*s+1]=y}h(St,"G2b");function ws(e,t={},r,s,i){if((0,A.anumber)(r),e<0||e>r)throw new Error("outputLen bigger than keyLen");let{key:n,salt:o,personalization:a}=t;if(n!==void 0&&(n.length<1||n.length>r))throw new Error("key length must be undefined or 1.."+r);if(o!==void 0&&o.length!==s)throw new Error("salt must be undefined or "+s);if(a!==void 0&&a.length!==i)throw new Error("personalization must be undefined or "+i)}h(ws,"checkBlake2Opts");var ae=class extends A.Hash{static{h(this,"BLAKE2")}constructor(t,r){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,(0,A.anumber)(t),(0,A.anumber)(r),this.blockLen=t,this.outputLen=r,this.buffer=new Uint8Array(t),this.buffer32=(0,A.u32)(this.buffer)}update(t){(0,A.aexists)(this),t=(0,A.toBytes)(t),(0,A.abytes)(t);let{blockLen:r,buffer:s,buffer32:i}=this,n=t.length,o=t.byteOffset,a=t.buffer;for(let c=0;c<n;){this.pos===r&&((0,A.swap32IfBE)(i),this.compress(i,0,!1),(0,A.swap32IfBE)(i),this.pos=0);let f=Math.min(r-this.pos,n-c),u=o+c;if(f===r&&!(u%4)&&c+f<n){let l=new Uint32Array(a,u,Math.floor((n-c)/4));(0,A.swap32IfBE)(l);for(let d=0;c+r<n;d+=i.length,c+=r)this.length+=r,this.compress(l,d,!1);(0,A.swap32IfBE)(l);continue}s.set(t.subarray(c,c+f),this.pos),this.pos+=f,this.length+=f,c+=f}return this}digestInto(t){(0,A.aexists)(this),(0,A.aoutput)(t,this);let{pos:r,buffer32:s}=this;this.finished=!0,(0,A.clean)(this.buffer.subarray(r)),(0,A.swap32IfBE)(s),this.compress(s,0,!0),(0,A.swap32IfBE)(s);let i=(0,A.u32)(t);this.get().forEach((n,o)=>i[o]=(0,A.swap8IfBE)(n))}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let s=t.slice(0,r);return this.destroy(),s}_cloneInto(t){let{buffer:r,length:s,finished:i,destroyed:n,outputLen:o,pos:a}=this;return t||(t=new this.constructor({dkLen:o})),t.set(...this.get()),t.buffer.set(r),t.destroyed=n,t.finished=i,t.length=s,t.pos=a,t.outputLen=o,t}clone(){return this._cloneInto()}};Q.BLAKE2=ae;var Ue=class extends ae{static{h(this,"BLAKE2b")}constructor(t={}){let r=t.dkLen===void 0?64:t.dkLen;super(128,r),this.v0l=T[0]|0,this.v0h=T[1]|0,this.v1l=T[2]|0,this.v1h=T[3]|0,this.v2l=T[4]|0,this.v2h=T[5]|0,this.v3l=T[6]|0,this.v3h=T[7]|0,this.v4l=T[8]|0,this.v4h=T[9]|0,this.v5l=T[10]|0,this.v5h=T[11]|0,this.v6l=T[12]|0,this.v6h=T[13]|0,this.v7l=T[14]|0,this.v7h=T[15]|0,ws(r,t,64,16,16);let{key:s,personalization:i,salt:n}=t,o=0;if(s!==void 0&&(s=(0,A.toBytes)(s),o=s.length),this.v0l^=this.outputLen|o<<8|65536|1<<24,n!==void 0){n=(0,A.toBytes)(n);let a=(0,A.u32)(n);this.v4l^=(0,A.swap8IfBE)(a[0]),this.v4h^=(0,A.swap8IfBE)(a[1]),this.v5l^=(0,A.swap8IfBE)(a[2]),this.v5h^=(0,A.swap8IfBE)(a[3])}if(i!==void 0){i=(0,A.toBytes)(i);let a=(0,A.u32)(i);this.v6l^=(0,A.swap8IfBE)(a[0]),this.v6h^=(0,A.swap8IfBE)(a[1]),this.v7l^=(0,A.swap8IfBE)(a[2]),this.v7h^=(0,A.swap8IfBE)(a[3])}if(s!==void 0){let a=new Uint8Array(this.blockLen);a.set(s),this.update(a)}}get(){let{v0l:t,v0h:r,v1l:s,v1h:i,v2l:n,v2h:o,v3l:a,v3h:c,v4l:f,v4h:u,v5l:l,v5h:d,v6l:p,v6h:_,v7l:y,v7h:x}=this;return[t,r,s,i,n,o,a,c,f,u,l,d,p,_,y,x]}set(t,r,s,i,n,o,a,c,f,u,l,d,p,_,y,x){this.v0l=t|0,this.v0h=r|0,this.v1l=s|0,this.v1h=i|0,this.v2l=n|0,this.v2h=o|0,this.v3l=a|0,this.v3h=c|0,this.v4l=f|0,this.v4h=u|0,this.v5l=l|0,this.v5h=d|0,this.v6l=p|0,this.v6h=_|0,this.v7l=y|0,this.v7h=x|0}compress(t,r,s){this.get().forEach((c,f)=>b[f]=c),b.set(T,16);let{h:i,l:n}=N.fromBig(BigInt(this.length));b[24]=T[8]^n,b[25]=T[9]^i,s&&(b[28]=~b[28],b[29]=~b[29]);let o=0,a=M.BSIGMA;for(let c=0;c<12;c++)mt(0,4,8,12,t,r+2*a[o++]),St(0,4,8,12,t,r+2*a[o++]),mt(1,5,9,13,t,r+2*a[o++]),St(1,5,9,13,t,r+2*a[o++]),mt(2,6,10,14,t,r+2*a[o++]),St(2,6,10,14,t,r+2*a[o++]),mt(3,7,11,15,t,r+2*a[o++]),St(3,7,11,15,t,r+2*a[o++]),mt(0,5,10,15,t,r+2*a[o++]),St(0,5,10,15,t,r+2*a[o++]),mt(1,6,11,12,t,r+2*a[o++]),St(1,6,11,12,t,r+2*a[o++]),mt(2,7,8,13,t,r+2*a[o++]),St(2,7,8,13,t,r+2*a[o++]),mt(3,4,9,14,t,r+2*a[o++]),St(3,4,9,14,t,r+2*a[o++]);this.v0l^=b[0]^b[16],this.v0h^=b[1]^b[17],this.v1l^=b[2]^b[18],this.v1h^=b[3]^b[19],this.v2l^=b[4]^b[20],this.v2h^=b[5]^b[21],this.v3l^=b[6]^b[22],this.v3h^=b[7]^b[23],this.v4l^=b[8]^b[24],this.v4h^=b[9]^b[25],this.v5l^=b[10]^b[26],this.v5h^=b[11]^b[27],this.v6l^=b[12]^b[28],this.v6h^=b[13]^b[29],this.v7l^=b[14]^b[30],this.v7h^=b[15]^b[31],(0,A.clean)(b)}destroy(){this.destroyed=!0,(0,A.clean)(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};Q.BLAKE2b=Ue;Q.blake2b=(0,A.createOptHasher)(e=>new Ue(e));function As(e,t,r,s,i,n,o,a,c,f,u,l,d,p,_,y,x,v,H,S){let E=0;for(let L=0;L<s;L++)({a:i,b:c,c:d,d:x}=(0,M.G1s)(i,c,d,x,r[t+e[E++]])),{a:i,b:c,c:d,d:x}=(0,M.G2s)(i,c,d,x,r[t+e[E++]]),{a:n,b:f,c:p,d:v}=(0,M.G1s)(n,f,p,v,r[t+e[E++]]),{a:n,b:f,c:p,d:v}=(0,M.G2s)(n,f,p,v,r[t+e[E++]]),{a:o,b:u,c:_,d:H}=(0,M.G1s)(o,u,_,H,r[t+e[E++]]),{a:o,b:u,c:_,d:H}=(0,M.G2s)(o,u,_,H,r[t+e[E++]]),{a,b:l,c:y,d:S}=(0,M.G1s)(a,l,y,S,r[t+e[E++]]),{a,b:l,c:y,d:S}=(0,M.G2s)(a,l,y,S,r[t+e[E++]]),{a:i,b:f,c:_,d:S}=(0,M.G1s)(i,f,_,S,r[t+e[E++]]),{a:i,b:f,c:_,d:S}=(0,M.G2s)(i,f,_,S,r[t+e[E++]]),{a:n,b:u,c:y,d:x}=(0,M.G1s)(n,u,y,x,r[t+e[E++]]),{a:n,b:u,c:y,d:x}=(0,M.G2s)(n,u,y,x,r[t+e[E++]]),{a:o,b:l,c:d,d:v}=(0,M.G1s)(o,l,d,v,r[t+e[E++]]),{a:o,b:l,c:d,d:v}=(0,M.G2s)(o,l,d,v,r[t+e[E++]]),{a,b:c,c:p,d:H}=(0,M.G1s)(a,c,p,H,r[t+e[E++]]),{a,b:c,c:p,d:H}=(0,M.G2s)(a,c,p,H,r[t+e[E++]]);return{v0:i,v1:n,v2:o,v3:a,v4:c,v5:f,v6:u,v7:l,v8:d,v9:p,v10:_,v11:y,v12:x,v13:v,v14:H,v15:S}}h(As,"compress");var R=Mn.SHA256_IV,Ce=class extends ae{static{h(this,"BLAKE2s")}constructor(t={}){let r=t.dkLen===void 0?32:t.dkLen;super(64,r),this.v0=R[0]|0,this.v1=R[1]|0,this.v2=R[2]|0,this.v3=R[3]|0,this.v4=R[4]|0,this.v5=R[5]|0,this.v6=R[6]|0,this.v7=R[7]|0,ws(r,t,32,8,8);let{key:s,personalization:i,salt:n}=t,o=0;if(s!==void 0&&(s=(0,A.toBytes)(s),o=s.length),this.v0^=this.outputLen|o<<8|65536|1<<24,n!==void 0){n=(0,A.toBytes)(n);let a=(0,A.u32)(n);this.v4^=(0,A.swap8IfBE)(a[0]),this.v5^=(0,A.swap8IfBE)(a[1])}if(i!==void 0){i=(0,A.toBytes)(i);let a=(0,A.u32)(i);this.v6^=(0,A.swap8IfBE)(a[0]),this.v7^=(0,A.swap8IfBE)(a[1])}if(s!==void 0){(0,A.abytes)(s);let a=new Uint8Array(this.blockLen);a.set(s),this.update(a)}}get(){let{v0:t,v1:r,v2:s,v3:i,v4:n,v5:o,v6:a,v7:c}=this;return[t,r,s,i,n,o,a,c]}set(t,r,s,i,n,o,a,c){this.v0=t|0,this.v1=r|0,this.v2=s|0,this.v3=i|0,this.v4=n|0,this.v5=o|0,this.v6=a|0,this.v7=c|0}compress(t,r,s){let{h:i,l:n}=N.fromBig(BigInt(this.length)),{v0:o,v1:a,v2:c,v3:f,v4:u,v5:l,v6:d,v7:p,v8:_,v9:y,v10:x,v11:v,v12:H,v13:S,v14:E,v15:L}=As(M.BSIGMA,r,t,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,R[0],R[1],R[2],R[3],n^R[4],i^R[5],s?~R[6]:R[6],R[7]);this.v0^=o^_,this.v1^=a^y,this.v2^=c^x,this.v3^=f^v,this.v4^=u^H,this.v5^=l^S,this.v6^=d^E,this.v7^=p^L}destroy(){this.destroyed=!0,(0,A.clean)(this.buffer32),this.set(0,0,0,0,0,0,0,0)}};Q.BLAKE2s=Ce;Q.blake2s=(0,A.createOptHasher)(e=>new Ce(e))});var Ss=m(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.blake2b=Xt.BLAKE2b=void 0;var ms=rr();Xt.BLAKE2b=ms.BLAKE2b;Xt.blake2b=ms.blake2b});var Is=m(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.blake2s=J.BLAKE2s=J.compress=J.G2s=J.G1s=J.B2S_IV=void 0;var ks=er(),Gn=re(),sr=rr();J.B2S_IV=Gn.SHA256_IV;J.G1s=ks.G1s;J.G2s=ks.G2s;J.compress=sr.compress;J.BLAKE2s=sr.BLAKE2s;J.blake2s=sr.blake2s});var qe=m(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.hmac=Tt.HMAC=void 0;var Vt=at(),ce=class extends Vt.Hash{static{h(this,"HMAC")}constructor(t,r){super(),this.finished=!1,this.destroyed=!1,(0,Vt.ahash)(t);let s=(0,Vt.toBytes)(r);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,n=new Uint8Array(i);n.set(s.length>i?t.create().update(s).digest():s);for(let o=0;o<n.length;o++)n[o]^=54;this.iHash.update(n),this.oHash=t.create();for(let o=0;o<n.length;o++)n[o]^=106;this.oHash.update(n),(0,Vt.clean)(n)}update(t){return(0,Vt.aexists)(this),this.iHash.update(t),this}digestInto(t){(0,Vt.aexists)(this),(0,Vt.abytes)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:s,finished:i,destroyed:n,blockLen:o,outputLen:a}=this;return t=t,t.finished=i,t.destroyed=n,t.blockLen=o,t.outputLen=a,t.oHash=r._cloneInto(t.oHash),t.iHash=s._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};Tt.HMAC=ce;var Fn=h((e,t,r)=>new ce(e,t).update(r).digest(),"hmac");Tt.hmac=Fn;Tt.hmac.create=(e,t)=>new ce(e,t)});var ir=m(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.pbkdf2=Rn;De.pbkdf2Async=jn;var Pn=qe(),ct=at();function Es(e,t,r,s){(0,ct.ahash)(e);let i=(0,ct.checkOpts)({dkLen:32,asyncTick:10},s),{c:n,dkLen:o,asyncTick:a}=i;if((0,ct.anumber)(n),(0,ct.anumber)(o),(0,ct.anumber)(a),n<1)throw new Error("iterations (c) should be >= 1");let c=(0,ct.kdfInputToBytes)(t),f=(0,ct.kdfInputToBytes)(r),u=new Uint8Array(o),l=Pn.hmac.create(e,c),d=l._cloneInto().update(f);return{c:n,dkLen:o,asyncTick:a,DK:u,PRF:l,PRFSalt:d}}h(Es,"pbkdf2Init");function Hs(e,t,r,s,i){return e.destroy(),t.destroy(),s&&s.destroy(),(0,ct.clean)(i),r}h(Hs,"pbkdf2Output");function Rn(e,t,r,s){let{c:i,dkLen:n,DK:o,PRF:a,PRFSalt:c}=Es(e,t,r,s),f,u=new Uint8Array(4),l=(0,ct.createView)(u),d=new Uint8Array(a.outputLen);for(let p=1,_=0;_<n;p++,_+=a.outputLen){let y=o.subarray(_,_+a.outputLen);l.setInt32(0,p,!1),(f=c._cloneInto(f)).update(u).digestInto(d),y.set(d.subarray(0,y.length));for(let x=1;x<i;x++){a._cloneInto(f).update(d).digestInto(d);for(let v=0;v<y.length;v++)y[v]^=d[v]}}return Hs(a,c,o,f,d)}h(Rn,"pbkdf2");async function jn(e,t,r,s){let{c:i,dkLen:n,asyncTick:o,DK:a,PRF:c,PRFSalt:f}=Es(e,t,r,s),u,l=new Uint8Array(4),d=(0,ct.createView)(l),p=new Uint8Array(c.outputLen);for(let _=1,y=0;y<n;_++,y+=c.outputLen){let x=a.subarray(y,y+c.outputLen);d.setInt32(0,_,!1),(u=f._cloneInto(u)).update(l).digestInto(p),x.set(p.subarray(0,x.length)),await(0,ct.asyncLoop)(i-1,o,()=>{c._cloneInto(u).update(p).digestInto(p);for(let v=0;v<x.length;v++)x[v]^=p[v]})}return Hs(c,f,a,u,p)}h(jn,"pbkdf2Async")});var Ds=m(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.hkdf=void 0;zt.extract=Cs;zt.expand=qs;var Us=qe(),Nt=at();function Cs(e,t,r){return(0,Nt.ahash)(e),r===void 0&&(r=new Uint8Array(e.outputLen)),(0,Us.hmac)(e,(0,Nt.toBytes)(r),(0,Nt.toBytes)(t))}h(Cs,"extract");var nr=Uint8Array.from([0]),Ls=Uint8Array.of();function qs(e,t,r,s=32){(0,Nt.ahash)(e),(0,Nt.anumber)(s);let i=e.outputLen;if(s>255*i)throw new Error("Length should be <= 255*HashLen");let n=Math.ceil(s/i);r===void 0&&(r=Ls);let o=new Uint8Array(n*i),a=Us.hmac.create(e,t),c=a._cloneInto(),f=new Uint8Array(a.outputLen);for(let u=0;u<n;u++)nr[0]=u+1,c.update(u===0?Ls:f).update(r).update(nr).digestInto(f),o.set(f,i*u),a._cloneInto(c);return a.destroy(),c.destroy(),(0,Nt.clean)(f,nr),o.slice(0,s)}h(qs,"expand");var Kn=h((e,t,r,s,i)=>qs(e,Cs(e,t,r),s,i),"hkdf");zt.hkdf=Kn});var Fs=m(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.scrypt=Xn;Ve.scryptAsync=Nn;var Ts=ir(),Os=tr(),w=at();function Vs(e,t,r,s,i,n){let o=e[t++]^r[s++],a=e[t++]^r[s++],c=e[t++]^r[s++],f=e[t++]^r[s++],u=e[t++]^r[s++],l=e[t++]^r[s++],d=e[t++]^r[s++],p=e[t++]^r[s++],_=e[t++]^r[s++],y=e[t++]^r[s++],x=e[t++]^r[s++],v=e[t++]^r[s++],H=e[t++]^r[s++],S=e[t++]^r[s++],E=e[t++]^r[s++],L=e[t++]^r[s++],q=o,it=a,G=c,F=f,$=u,nt=l,tt=d,ot=p,yt=_,ut=y,It=x,Et=v,Ht=H,Lt=S,Ut=E,Ct=L;for(let Er=0;Er<8;Er+=2)$^=(0,w.rotl)(q+Ht|0,7),yt^=(0,w.rotl)($+q|0,9),Ht^=(0,w.rotl)(yt+$|0,13),q^=(0,w.rotl)(Ht+yt|0,18),ut^=(0,w.rotl)(nt+it|0,7),Lt^=(0,w.rotl)(ut+nt|0,9),it^=(0,w.rotl)(Lt+ut|0,13),nt^=(0,w.rotl)(it+Lt|0,18),Ut^=(0,w.rotl)(It+tt|0,7),G^=(0,w.rotl)(Ut+It|0,9),tt^=(0,w.rotl)(G+Ut|0,13),It^=(0,w.rotl)(tt+G|0,18),F^=(0,w.rotl)(Ct+Et|0,7),ot^=(0,w.rotl)(F+Ct|0,9),Et^=(0,w.rotl)(ot+F|0,13),Ct^=(0,w.rotl)(Et+ot|0,18),it^=(0,w.rotl)(q+F|0,7),G^=(0,w.rotl)(it+q|0,9),F^=(0,w.rotl)(G+it|0,13),q^=(0,w.rotl)(F+G|0,18),tt^=(0,w.rotl)(nt+$|0,7),ot^=(0,w.rotl)(tt+nt|0,9),$^=(0,w.rotl)(ot+tt|0,13),nt^=(0,w.rotl)($+ot|0,18),Et^=(0,w.rotl)(It+ut|0,7),yt^=(0,w.rotl)(Et+It|0,9),ut^=(0,w.rotl)(yt+Et|0,13),It^=(0,w.rotl)(ut+yt|0,18),Ht^=(0,w.rotl)(Ct+Ut|0,7),Lt^=(0,w.rotl)(Ht+Ct|0,9),Ut^=(0,w.rotl)(Lt+Ht|0,13),Ct^=(0,w.rotl)(Ut+Lt|0,18);i[n++]=o+q|0,i[n++]=a+it|0,i[n++]=c+G|0,i[n++]=f+F|0,i[n++]=u+$|0,i[n++]=l+nt|0,i[n++]=d+tt|0,i[n++]=p+ot|0,i[n++]=_+yt|0,i[n++]=y+ut|0,i[n++]=x+It|0,i[n++]=v+Et|0,i[n++]=H+Ht|0,i[n++]=S+Lt|0,i[n++]=E+Ut|0,i[n++]=L+Ct|0}h(Vs,"XorAndSalsa");function Wt(e,t,r,s,i){let n=s+0,o=s+16*i;for(let a=0;a<16;a++)r[o+a]=e[t+(2*i-1)*16+a];for(let a=0;a<i;a++,n+=16,t+=16)Vs(r,o,e,t,r,n),a>0&&(o+=16),Vs(r,n,e,t+=16,r,o)}h(Wt,"BlockMix");function Ms(e,t,r){let s=(0,w.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:n,p:o,dkLen:a,asyncTick:c,maxmem:f,onProgress:u}=s;if((0,w.anumber)(i),(0,w.anumber)(n),(0,w.anumber)(o),(0,w.anumber)(a),(0,w.anumber)(c),(0,w.anumber)(f),u!==void 0&&typeof u!="function")throw new Error("progressCb should be function");let l=128*n,d=l/4,p=Math.pow(2,32);if(i<=1||(i&i-1)!==0||i>p)throw new Error("Scrypt: N must be larger than 1, a power of 2, and less than 2^32");if(o<0||o>(p-1)*32/l)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(p-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");if(l*(i+o)>f)throw new Error("Scrypt: memused is bigger than maxMem. Expected 128 * r * (N + p) > maxmem of "+f);let y=(0,Ts.pbkdf2)(Os.sha256,e,t,{c:1,dkLen:l*o}),x=(0,w.u32)(y),v=(0,w.u32)(new Uint8Array(l*i)),H=(0,w.u32)(new Uint8Array(l)),S=h(()=>{},"blockMixCb");if(u){let E=2*i*o,L=Math.max(Math.floor(E/1e4),1),q=0;S=h(()=>{q++,u&&(!(q%L)||q===E)&&u(q/E)},"blockMixCb")}return{N:i,r:n,p:o,dkLen:a,blockSize32:d,V:v,B32:x,B:y,tmp:H,blockMixCb:S,asyncTick:c}}h(Ms,"scryptInit");function Gs(e,t,r,s,i){let n=(0,Ts.pbkdf2)(Os.sha256,e,r,{c:1,dkLen:t});return(0,w.clean)(r,s,i),n}h(Gs,"scryptOutput");function Xn(e,t,r){let{N:s,r:i,p:n,dkLen:o,blockSize32:a,V:c,B32:f,B:u,tmp:l,blockMixCb:d}=Ms(e,t,r);(0,w.swap32IfBE)(f);for(let p=0;p<n;p++){let _=a*p;for(let y=0;y<a;y++)c[y]=f[_+y];for(let y=0,x=0;y<s-1;y++)Wt(c,x,c,x+=a,i),d();Wt(c,(s-1)*a,f,_,i),d();for(let y=0;y<s;y++){let x=f[_+a-16]%s;for(let v=0;v<a;v++)l[v]=f[_+v]^c[x*a+v];Wt(l,0,f,_,i),d()}}return(0,w.swap32IfBE)(f),Gs(e,o,u,c,l)}h(Xn,"scrypt");async function Nn(e,t,r){let{N:s,r:i,p:n,dkLen:o,blockSize32:a,V:c,B32:f,B:u,tmp:l,blockMixCb:d,asyncTick:p}=Ms(e,t,r);(0,w.swap32IfBE)(f);for(let _=0;_<n;_++){let y=a*_;for(let v=0;v<a;v++)c[v]=f[y+v];let x=0;await(0,w.asyncLoop)(s-1,p,()=>{Wt(c,x,c,x+=a,i),d()}),Wt(c,(s-1)*a,f,y,i),d(),await(0,w.asyncLoop)(s,p,()=>{let v=f[y+a-16]%s;for(let H=0;H<a;H++)l[H]=f[y+H]^c[v*a+H];Wt(l,0,f,y,i),d()})}return(0,w.swap32IfBE)(f),Gs(e,o,u,c,l)}h(Nn,"scryptAsync")});var Ps=m(or=>{or.encrypt=function(e,t){return e._cipher.encryptBlock(t)};or.decrypt=function(e,t){return e._cipher.decryptBlock(t)}});var Jt=m((qo,Rs)=>{Rs.exports=h(function(t,r){for(var s=Math.min(t.length,r.length),i=new Buffer(s),n=0;n<s;++n)i[n]=t[n]^r[n];return i},"xor")});var Ks=m(ar=>{var js=Jt();ar.encrypt=function(e,t){var r=js(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev};ar.decrypt=function(e,t){var r=e._prev;e._prev=t;var s=e._cipher.decryptBlock(t);return js(s,r)}});var Y=m((To,Ot)=>{"use strict";var cr=globalThis.Buffer;Ot.exports=cr;Ot.exports.Buffer=cr;Ot.exports.SlowBuffer=cr;Ot.exports.kMaxLength=2147483647;Ot.exports.INSPECT_MAX_BYTES=50;typeof globalThis.Blob<"u"&&(Ot.exports.Blob=globalThis.Blob)});var zs=m(Ns=>{var he=Y().Buffer,zn=Jt();function Xs(e,t,r){var s=t.length,i=zn(t,e._cache);return e._cache=e._cache.slice(s),e._prev=he.concat([e._prev,r?t:i]),i}h(Xs,"encryptStart");Ns.encrypt=function(e,t,r){for(var s=he.allocUnsafe(0),i;t.length;)if(e._cache.length===0&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=he.allocUnsafe(0)),e._cache.length<=t.length)i=e._cache.length,s=he.concat([s,Xs(e,t.slice(0,i),r)]),t=t.slice(i);else{s=he.concat([s,Xs(e,t,r)]);break}return s}});var Js=m(Ws=>{var hr=Y().Buffer;function Wn(e,t,r){var s=e._cipher.encryptBlock(e._prev),i=s[0]^t;return e._prev=hr.concat([e._prev.slice(1),hr.from([r?t:i])]),i}h(Wn,"encryptByte");Ws.encrypt=function(e,t,r){for(var s=t.length,i=hr.allocUnsafe(s),n=-1;++n<s;)i[n]=Wn(e,t[n],r);return i}});var Zs=m(Ys=>{var Te=Y().Buffer;function Jn(e,t,r){for(var s,i=-1,n=8,o=0,a,c;++i<n;)s=e._cipher.encryptBlock(e._prev),a=t&1<<7-i?128:0,c=s[0]^a,o+=(c&128)>>i%8,e._prev=Yn(e._prev,r?a:c);return o}h(Jn,"encryptByte");function Yn(e,t){var r=e.length,s=-1,i=Te.allocUnsafe(e.length);for(e=Te.concat([e,Te.from([t])]);++s<r;)i[s]=e[s]<<1|e[s+1]>>7;return i}h(Yn,"shiftIn");Ys.encrypt=function(e,t,r){for(var s=t.length,i=Te.allocUnsafe(s),n=-1;++n<s;)i[n]=Jn(e,t[n],r);return i}});var $s=m(Qs=>{var Zn=Jt();function Qn(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}h(Qn,"getBlock");Qs.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=Buffer.concat([e._cache,Qn(e)]);var r=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),Zn(t,r)}});var fr=m((Xo,ti)=>{function $n(e){for(var t=e.length,r;t--;)if(r=e.readUInt8(t),r===255)e.writeUInt8(0,t);else{r++,e.writeUInt8(r,t);break}}h($n,"incr32");ti.exports=$n});var lr=m(ri=>{var t0=Jt(),ei=Y().Buffer,e0=fr();function r0(e){var t=e._cipher.encryptBlockRaw(e._prev);return e0(e._prev),t}h(r0,"getBlock");var ur=16;ri.encrypt=function(e,t){var r=Math.ceil(t.length/ur),s=e._cache.length;e._cache=ei.concat([e._cache,ei.allocUnsafe(r*ur)]);for(var i=0;i<r;i++){var n=r0(e),o=s+i*ur;e._cache.writeUInt32BE(n[0],o+0),e._cache.writeUInt32BE(n[1],o+4),e._cache.writeUInt32BE(n[2],o+8),e._cache.writeUInt32BE(n[3],o+12)}var a=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),t0(t,a)}});var pr=m((Jo,s0)=>{s0.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}});var yr=m((Yo,si)=>{var i0={ECB:Ps(),CBC:Ks(),CFB:zs(),CFB8:Js(),CFB1:Zs(),OFB:$s(),CTR:lr(),GCM:lr()},Oe=pr();for(dr in Oe)Oe[dr].module=i0[Oe[dr].mode];var dr;si.exports=Oe});var fe=m((Zo,ni)=>{var Me=Y().Buffer;function br(e){Me.isBuffer(e)||(e=Me.from(e));for(var t=e.length/4|0,r=new Array(t),s=0;s<t;s++)r[s]=e.readUInt32BE(s*4);return r}h(br,"asUInt32Array");function _r(e){for(var t=0;t<e.length;e++)e[t]=0}h(_r,"scrubVec");function ii(e,t,r,s,i){for(var n=r[0],o=r[1],a=r[2],c=r[3],f=e[0]^t[0],u=e[1]^t[1],l=e[2]^t[2],d=e[3]^t[3],p,_,y,x,v=4,H=1;H<i;H++)p=n[f>>>24]^o[u>>>16&255]^a[l>>>8&255]^c[d&255]^t[v++],_=n[u>>>24]^o[l>>>16&255]^a[d>>>8&255]^c[f&255]^t[v++],y=n[l>>>24]^o[d>>>16&255]^a[f>>>8&255]^c[u&255]^t[v++],x=n[d>>>24]^o[f>>>16&255]^a[u>>>8&255]^c[l&255]^t[v++],f=p,u=_,l=y,d=x;return p=(s[f>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[d&255])^t[v++],_=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[d>>>8&255]<<8|s[f&255])^t[v++],y=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[u&255])^t[v++],x=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[u>>>8&255]<<8|s[l&255])^t[v++],p=p>>>0,_=_>>>0,y=y>>>0,x=x>>>0,[p,_,y,x]}h(ii,"cryptBlock");var n0=[0,1,2,4,8,16,32,64,128,27,54],V=(function(){for(var e=new Array(256),t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var r=[],s=[],i=[[],[],[],[]],n=[[],[],[],[]],o=0,a=0,c=0;c<256;++c){var f=a^a<<1^a<<2^a<<3^a<<4;f=f>>>8^f&255^99,r[o]=f,s[f]=o;var u=e[o],l=e[u],d=e[l],p=e[f]*257^f*16843008;i[0][o]=p<<24|p>>>8,i[1][o]=p<<16|p>>>16,i[2][o]=p<<8|p>>>24,i[3][o]=p,p=d*16843009^l*65537^u*257^o*16843008,n[0][f]=p<<24|p>>>8,n[1][f]=p<<16|p>>>16,n[2][f]=p<<8|p>>>24,n[3][f]=p,o===0?o=a=1:(o=u^e[e[e[d^u]]],a^=e[e[a]])}return{SBOX:r,INV_SBOX:s,SUB_MIX:i,INV_SUB_MIX:n}})();function et(e){this._key=br(e),this._reset()}h(et,"AES");et.blockSize=16;et.keySize=256/8;et.prototype.blockSize=et.blockSize;et.prototype.keySize=et.keySize;et.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,s=(r+1)*4,i=[],n=0;n<t;n++)i[n]=e[n];for(n=t;n<s;n++){var o=i[n-1];n%t===0?(o=o<<8|o>>>24,o=V.SBOX[o>>>24]<<24|V.SBOX[o>>>16&255]<<16|V.SBOX[o>>>8&255]<<8|V.SBOX[o&255],o^=n0[n/t|0]<<24):t>6&&n%t===4&&(o=V.SBOX[o>>>24]<<24|V.SBOX[o>>>16&255]<<16|V.SBOX[o>>>8&255]<<8|V.SBOX[o&255]),i[n]=i[n-t]^o}for(var a=[],c=0;c<s;c++){var f=s-c,u=i[f-(c%4?0:4)];c<4||f<=4?a[c]=u:a[c]=V.INV_SUB_MIX[0][V.SBOX[u>>>24]]^V.INV_SUB_MIX[1][V.SBOX[u>>>16&255]]^V.INV_SUB_MIX[2][V.SBOX[u>>>8&255]]^V.INV_SUB_MIX[3][V.SBOX[u&255]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=a};et.prototype.encryptBlockRaw=function(e){return e=br(e),ii(e,this._keySchedule,V.SUB_MIX,V.SBOX,this._nRounds)};et.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=Me.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r};et.prototype.decryptBlock=function(e){e=br(e);var t=e[1];e[1]=e[3],e[3]=t;var r=ii(e,this._invKeySchedule,V.INV_SUB_MIX,V.INV_SBOX,this._nRounds),s=Me.allocUnsafe(16);return s.writeUInt32BE(r[0],0),s.writeUInt32BE(r[3],4),s.writeUInt32BE(r[2],8),s.writeUInt32BE(r[1],12),s};et.prototype.scrub=function(){_r(this._keySchedule),_r(this._invKeySchedule),_r(this._key)};ni.exports.AES=et});var pt=m(($o,xr)=>{typeof Object.create=="function"?xr.exports=h(function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):xr.exports=h(function(t,r){if(r){t.super_=r;var s=h(function(){},"TempCtor");s.prototype=r.prototype,t.prototype=new s,t.prototype.constructor=t}},"inherits")});var ai=m((ea,oi)=>{"use strict";var{Buffer:ue}=Y();oi.exports=h(function(t,r){if(ue.isBuffer(t))return t;if(typeof t=="string")return ue.from(t,r);if(ArrayBuffer.isView(t))return t.byteLength===0?ue.alloc(0):ue.from(t.buffer,t.byteOffset,t.byteLength);if(Array.isArray(t)){for(let s of t)if(typeof s!="number"||s<0||s>255||~~s!==s)throw new RangeError("Array items must be numbers in the range 0-255.");return ue.from(t)}throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},"toBuffer")});var Yt=m((sa,hi)=>{"use strict";var o0=Y().Buffer,ci=require("stream").Transform,a0=require("string_decoder").StringDecoder,c0=pt(),h0=ai();function ht(e){ci.call(this),this.hashMode=typeof e=="string",this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}h(ht,"CipherBase");c0(ht,ci);ht.prototype.update=function(e,t,r){var s=h0(e,t),i=this._update(s);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)};ht.prototype.setAutoPadding=function(){};ht.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};ht.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};ht.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};ht.prototype._transform=function(e,t,r){var s;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(i){s=i}finally{r(s)}};ht.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)};ht.prototype._finalOrDigest=function(e){var t=this.__final()||o0.alloc(0);return e&&(t=this._toString(t,e,!0)),t};ht.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new a0(t),this._encoding=t),this._encoding!==t)throw new Error("can\u2019t switch encodings");var s=this._decoder.write(e);return r&&(s+=this._decoder.end()),s};hi.exports=ht});var li=m((na,ui)=>{var Zt=Y().Buffer,f0=Zt.alloc(16,0);function u0(e){return[e.readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)]}h(u0,"toArray");function fi(e){var t=Zt.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}h(fi,"fromArray");function le(e){this.h=e,this.state=Zt.alloc(16,0),this.cache=Zt.allocUnsafe(0)}h(le,"GHASH");le.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()};le.prototype._multiply=function(){for(var e=u0(this.h),t=[0,0,0,0],r,s,i,n=-1;++n<128;){for(s=(this.state[~~(n/8)]&1<<7-n%8)!==0,s&&(t[0]^=e[0],t[1]^=e[1],t[2]^=e[2],t[3]^=e[3]),i=(e[3]&1)!==0,r=3;r>0;r--)e[r]=e[r]>>>1|(e[r-1]&1)<<31;e[0]=e[0]>>>1,i&&(e[0]=e[0]^225<<24)}this.state=fi(t)};le.prototype.update=function(e){this.cache=Zt.concat([this.cache,e]);for(var t;this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)};le.prototype.final=function(e,t){return this.cache.length&&this.ghash(Zt.concat([this.cache,f0],16)),this.ghash(fi([0,e,0,t])),this.state};ui.exports=le});var vr=m((aa,yi)=>{var l0=fe(),Z=Y().Buffer,pi=Yt(),p0=pt(),di=li(),d0=Jt(),y0=fr();function _0(e,t){var r=0;e.length!==t.length&&r++;for(var s=Math.min(e.length,t.length),i=0;i<s;++i)r+=e[i]^t[i];return r}h(_0,"xorTest");function b0(e,t,r){if(t.length===12)return e._finID=Z.concat([t,Z.from([0,0,0,1])]),Z.concat([t,Z.from([0,0,0,2])]);var s=new di(r),i=t.length,n=i%16;s.update(t),n&&(n=16-n,s.update(Z.alloc(n,0))),s.update(Z.alloc(8,0));var o=i*8,a=Z.alloc(8);a.writeUIntBE(o,2,6),s.update(a),e._finID=s.state;var c=Z.from(e._finID);return y0(c),c}h(b0,"calcIv");function Mt(e,t,r,s){pi.call(this);var i=Z.alloc(4,0);this._cipher=new l0.AES(t);var n=this._cipher.encryptBlock(i);this._ghash=new di(n),r=b0(this,r,n),this._prev=Z.from(r),this._cache=Z.allocUnsafe(0),this._secCache=Z.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}h(Mt,"StreamCipher");p0(Mt,pi);Mt.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=Z.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r};Mt.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=d0(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&_0(e.slice(0,this._authTag.length),this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()};Mt.prototype.getAuthTag=h(function(){if(this._decrypt||!Z.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},"getAuthTag");Mt.prototype.setAuthTag=h(function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},"setAuthTag");Mt.prototype.setAAD=h(function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},"setAAD");yi.exports=Mt});var gr=m((ha,bi)=>{var x0=fe(),Br=Y().Buffer,_i=Yt(),v0=pt();function Ge(e,t,r,s){_i.call(this),this._cipher=new x0.AES(t),this._prev=Br.from(r),this._cache=Br.allocUnsafe(0),this._secCache=Br.allocUnsafe(0),this._decrypt=s,this._mode=e}h(Ge,"StreamCipher");v0(Ge,_i);Ge.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)};Ge.prototype._final=function(){this._cipher.scrub()};bi.exports=Ge});var wr=m((ua,xi)=>{"use strict";xi.exports=h(function(){throw new Error("EVP_BytesToKey is not available (crypto.createCipher was removed in Node 22)")},"EVP_BytesToKey")});var wi=m(Ar=>{var vi=yr(),B0=vr(),bt=Y().Buffer,g0=gr(),Bi=Yt(),w0=fe(),A0=wr(),m0=pt();function pe(e,t,r){Bi.call(this),this._cache=new Fe,this._cipher=new w0.AES(t),this._prev=bt.from(r),this._mode=e,this._autopadding=!0}h(pe,"Cipher");m0(pe,Bi);pe.prototype._update=function(e){this._cache.add(e);for(var t,r,s=[];t=this._cache.get();)r=this._mode.encrypt(this,t),s.push(r);return bt.concat(s)};var S0=bt.alloc(16,16);pe.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(S0))throw this._cipher.scrub(),new Error("data not multiple of block length")};pe.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this};function Fe(){this.cache=bt.allocUnsafe(0)}h(Fe,"Splitter");Fe.prototype.add=function(e){this.cache=bt.concat([this.cache,e])};Fe.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null};Fe.prototype.flush=function(){for(var e=16-this.cache.length,t=bt.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return bt.concat([this.cache,t])};function gi(e,t,r){var s=vi[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if(typeof t=="string"&&(t=bt.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if(typeof r=="string"&&(r=bt.from(r)),s.mode!=="GCM"&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return s.type==="stream"?new g0(s.module,t,r):s.type==="auth"?new B0(s.module,t,r):new pe(s.module,t,r)}h(gi,"createCipheriv");function k0(e,t){var r=vi[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var s=A0(t,!1,r.key,r.iv);return gi(e,s.key,s.iv)}h(k0,"createCipher");Ar.createCipheriv=gi;Ar.createCipher=k0});var ki=m(mr=>{var I0=vr(),Qt=Y().Buffer,Ai=yr(),E0=gr(),mi=Yt(),H0=fe(),L0=wr(),U0=pt();function de(e,t,r){mi.call(this),this._cache=new Pe,this._last=void 0,this._cipher=new H0.AES(t),this._prev=Qt.from(r),this._mode=e,this._autopadding=!0}h(de,"Decipher");U0(de,mi);de.prototype._update=function(e){this._cache.add(e);for(var t,r,s=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),s.push(r);return Qt.concat(s)};de.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return C0(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")};de.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this};function Pe(){this.cache=Qt.allocUnsafe(0)}h(Pe,"Splitter");Pe.prototype.add=function(e){this.cache=Qt.concat([this.cache,e])};Pe.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null};Pe.prototype.flush=function(){if(this.cache.length)return this.cache};function C0(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var r=-1;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(t!==16)return e.slice(0,16-t)}h(C0,"unpad");function Si(e,t,r){var s=Ai[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if(typeof r=="string"&&(r=Qt.from(r)),s.mode!=="GCM"&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if(typeof t=="string"&&(t=Qt.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return s.type==="stream"?new E0(s.module,t,r,!0):s.type==="auth"?new I0(s.module,t,r,!0):new de(s.module,t,r)}h(Si,"createDecipheriv");function q0(e,t){var r=Ai[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var s=L0(t,!1,r.key,r.iv);return Si(e,s.key,s.iv)}h(q0,"createDecipher");mr.createDecipher=q0;mr.createDecipheriv=Si});var Hi=m(ft=>{var Ii=wi(),Ei=ki(),D0=pr();function V0(){return Object.keys(D0)}h(V0,"getCiphers");ft.createCipher=ft.Cipher=Ii.createCipher;ft.createCipheriv=ft.Cipheriv=Ii.createCipheriv;ft.createDecipher=ft.Decipher=Ei.createDecipher;ft.createDecipheriv=ft.Decipheriv=Ei.createDecipheriv;ft.listCiphers=ft.getCiphers=V0});var Sr=m(rt=>{"use strict";rt.readUInt32BE=h(function(t,r){var s=t[0+r]<<24|t[1+r]<<16|t[2+r]<<8|t[3+r];return s>>>0},"readUInt32BE");rt.writeUInt32BE=h(function(t,r,s){t[0+s]=r>>>24,t[1+s]=r>>>16&255,t[2+s]=r>>>8&255,t[3+s]=r&255},"writeUInt32BE");rt.ip=h(function(t,r,s,i){for(var n=0,o=0,a=6;a>=0;a-=2){for(var c=0;c<=24;c+=8)n<<=1,n|=r>>>c+a&1;for(var c=0;c<=24;c+=8)n<<=1,n|=t>>>c+a&1}for(var a=6;a>=0;a-=2){for(var c=1;c<=25;c+=8)o<<=1,o|=r>>>c+a&1;for(var c=1;c<=25;c+=8)o<<=1,o|=t>>>c+a&1}s[i+0]=n>>>0,s[i+1]=o>>>0},"ip");rt.rip=h(function(t,r,s,i){for(var n=0,o=0,a=0;a<4;a++)for(var c=24;c>=0;c-=8)n<<=1,n|=r>>>c+a&1,n<<=1,n|=t>>>c+a&1;for(var a=4;a<8;a++)for(var c=24;c>=0;c-=8)o<<=1,o|=r>>>c+a&1,o<<=1,o|=t>>>c+a&1;s[i+0]=n>>>0,s[i+1]=o>>>0},"rip");rt.pc1=h(function(t,r,s,i){for(var n=0,o=0,a=7;a>=5;a--){for(var c=0;c<=24;c+=8)n<<=1,n|=r>>c+a&1;for(var c=0;c<=24;c+=8)n<<=1,n|=t>>c+a&1}for(var c=0;c<=24;c+=8)n<<=1,n|=r>>c+a&1;for(var a=1;a<=3;a++){for(var c=0;c<=24;c+=8)o<<=1,o|=r>>c+a&1;for(var c=0;c<=24;c+=8)o<<=1,o|=t>>c+a&1}for(var c=0;c<=24;c+=8)o<<=1,o|=t>>c+a&1;s[i+0]=n>>>0,s[i+1]=o>>>0},"pc1");rt.r28shl=h(function(t,r){return t<<r&268435455|t>>>28-r},"r28shl");var Re=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];rt.pc2=h(function(t,r,s,i){for(var n=0,o=0,a=Re.length>>>1,c=0;c<a;c++)n<<=1,n|=t>>>Re[c]&1;for(var c=a;c<Re.length;c++)o<<=1,o|=r>>>Re[c]&1;s[i+0]=n>>>0,s[i+1]=o>>>0},"pc2");rt.expand=h(function(t,r,s){var i=0,n=0;i=(t&1)<<5|t>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=t>>>o&63;for(var o=11;o>=3;o-=4)n|=t>>>o&63,n<<=6;n|=(t&31)<<1|t>>>31,r[s+0]=i>>>0,r[s+1]=n>>>0},"expand");var Li=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];rt.substitute=h(function(t,r){for(var s=0,i=0;i<4;i++){var n=t>>>18-i*6&63,o=Li[i*64+n];s<<=4,s|=o}for(var i=0;i<4;i++){var n=r>>>18-i*6&63,o=Li[256+i*64+n];s<<=4,s|=o}return s>>>0},"substitute");var Ui=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];rt.permute=h(function(t){for(var r=0,s=0;s<Ui.length;s++)r<<=1,r|=t>>>Ui[s]&1;return r>>>0},"permute");rt.padSplit=h(function(t,r,s){for(var i=t.toString(2);i.length<r;)i="0"+i;for(var n=[],o=0;o<r;o+=s)n.push(i.slice(o,o+s));return n.join(" ")},"padSplit")});var ye=m((ga,qi)=>{qi.exports=Ci;function Ci(e,t){if(!e)throw new Error(t||"Assertion failed")}h(Ci,"assert");Ci.equal=h(function(t,r,s){if(t!=r)throw new Error(s||"Assertion failed: "+t+" != "+r)},"assertEqual")});var je=m((Aa,Di)=>{"use strict";var T0=ye();function st(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=e.padding!==!1}h(st,"Cipher");Di.exports=st;st.prototype._init=h(function(){},"_init");st.prototype.update=h(function(t){return t.length===0?[]:this.type==="decrypt"?this._updateDecrypt(t):this._updateEncrypt(t)},"update");st.prototype._buffer=h(function(t,r){for(var s=Math.min(this.buffer.length-this.bufferOff,t.length-r),i=0;i<s;i++)this.buffer[this.bufferOff+i]=t[r+i];return this.bufferOff+=s,s},"_buffer");st.prototype._flushBuffer=h(function(t,r){return this._update(this.buffer,0,t,r),this.bufferOff=0,this.blockSize},"_flushBuffer");st.prototype._updateEncrypt=h(function(t){var r=0,s=0,i=(this.bufferOff+t.length)/this.blockSize|0,n=new Array(i*this.blockSize);this.bufferOff!==0&&(r+=this._buffer(t,r),this.bufferOff===this.buffer.length&&(s+=this._flushBuffer(n,s)));for(var o=t.length-(t.length-r)%this.blockSize;r<o;r+=this.blockSize)this._update(t,r,n,s),s+=this.blockSize;for(;r<t.length;r++,this.bufferOff++)this.buffer[this.bufferOff]=t[r];return n},"_updateEncrypt");st.prototype._updateDecrypt=h(function(t){for(var r=0,s=0,i=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,n=new Array(i*this.blockSize);i>0;i--)r+=this._buffer(t,r),s+=this._flushBuffer(n,s);return r+=this._buffer(t,r),n},"_updateDecrypt");st.prototype.final=h(function(t){var r;t&&(r=this.update(t));var s;return this.type==="encrypt"?s=this._finalEncrypt():s=this._finalDecrypt(),r?r.concat(s):s},"final");st.prototype._pad=h(function(t,r){if(r===0)return!1;for(;r<t.length;)t[r++]=0;return!0},"_pad");st.prototype._finalEncrypt=h(function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},"_finalEncrypt");st.prototype._unpad=h(function(t){return t},"_unpad");st.prototype._finalDecrypt=h(function(){T0.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)},"_finalDecrypt")});var kr=m((Sa,Oi)=>{"use strict";var Vi=ye(),O0=pt(),O=Sr(),Ti=je();function M0(){this.tmp=new Array(2),this.keys=null}h(M0,"DESState");function dt(e){Ti.call(this,e);var t=new M0;this._desState=t,this.deriveKeys(t,e.key)}h(dt,"DES");O0(dt,Ti);Oi.exports=dt;dt.create=h(function(t){return new dt(t)},"create");var G0=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];dt.prototype.deriveKeys=h(function(t,r){t.keys=new Array(32),Vi.equal(r.length,this.blockSize,"Invalid key length");var s=O.readUInt32BE(r,0),i=O.readUInt32BE(r,4);O.pc1(s,i,t.tmp,0),s=t.tmp[0],i=t.tmp[1];for(var n=0;n<t.keys.length;n+=2){var o=G0[n>>>1];s=O.r28shl(s,o),i=O.r28shl(i,o),O.pc2(s,i,t.keys,n)}},"deriveKeys");dt.prototype._update=h(function(t,r,s,i){var n=this._desState,o=O.readUInt32BE(t,r),a=O.readUInt32BE(t,r+4);O.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],this.type==="encrypt"?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],O.writeUInt32BE(s,o,i),O.writeUInt32BE(s,a,i+4)},"_update");dt.prototype._pad=h(function(t,r){if(this.padding===!1)return!1;for(var s=t.length-r,i=r;i<t.length;i++)t[i]=s;return!0},"_pad");dt.prototype._unpad=h(function(t){if(this.padding===!1)return t;for(var r=t[t.length-1],s=t.length-r;s<t.length;s++)Vi.equal(t[s],r);return t.slice(0,t.length-r)},"_unpad");dt.prototype._encrypt=h(function(t,r,s,i,n){for(var o=r,a=s,c=0;c<t.keys.length;c+=2){var f=t.keys[c],u=t.keys[c+1];O.expand(a,t.tmp,0),f^=t.tmp[0],u^=t.tmp[1];var l=O.substitute(f,u),d=O.permute(l),p=a;a=(o^d)>>>0,o=p}O.rip(a,o,i,n)},"_encrypt");dt.prototype._decrypt=h(function(t,r,s,i,n){for(var o=s,a=r,c=t.keys.length-2;c>=0;c-=2){var f=t.keys[c],u=t.keys[c+1];O.expand(o,t.tmp,0),f^=t.tmp[0],u^=t.tmp[1];var l=O.substitute(f,u),d=O.permute(l),p=o;o=(a^d)>>>0,a=p}O.rip(o,a,i,n)},"_decrypt")});var Gi=m(Mi=>{"use strict";var F0=ye(),P0=pt(),Ke={};function R0(e){F0.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}h(R0,"CBCState");function j0(e){function t(n){e.call(this,n),this._cbcInit()}h(t,"CBC"),P0(t,e);for(var r=Object.keys(Ke),s=0;s<r.length;s++){var i=r[s];t.prototype[i]=Ke[i]}return t.create=h(function(o){return new t(o)},"create"),t}h(j0,"instantiate");Mi.instantiate=j0;Ke._cbcInit=h(function(){var t=new R0(this.options.iv);this._cbcState=t},"_cbcInit");Ke._update=h(function(t,r,s,i){var n=this._cbcState,o=this.constructor.super_.prototype,a=n.iv;if(this.type==="encrypt"){for(var c=0;c<this.blockSize;c++)a[c]^=t[r+c];o._update.call(this,a,0,s,i);for(var c=0;c<this.blockSize;c++)a[c]=s[i+c]}else{o._update.call(this,t,r,s,i);for(var c=0;c<this.blockSize;c++)s[i+c]^=a[c];for(var c=0;c<this.blockSize;c++)a[c]=t[r+c]}},"_update")});var Ri=m((Ha,Pi)=>{"use strict";var K0=ye(),X0=pt(),Fi=je(),kt=kr();function N0(e,t){K0.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),s=t.slice(8,16),i=t.slice(16,24);e==="encrypt"?this.ciphers=[kt.create({type:"encrypt",key:r}),kt.create({type:"decrypt",key:s}),kt.create({type:"encrypt",key:i})]:this.ciphers=[kt.create({type:"decrypt",key:i}),kt.create({type:"encrypt",key:s}),kt.create({type:"decrypt",key:r})]}h(N0,"EDEState");function Gt(e){Fi.call(this,e);var t=new N0(this.type,this.options.key);this._edeState=t}h(Gt,"EDE");X0(Gt,Fi);Pi.exports=Gt;Gt.create=h(function(t){return new Gt(t)},"create");Gt.prototype._update=h(function(t,r,s,i){var n=this._edeState;n.ciphers[0]._update(t,r,s,i),n.ciphers[1]._update(s,i,s,i),n.ciphers[2]._update(s,i,s,i)},"_update");Gt.prototype._pad=kt.prototype._pad;Gt.prototype._unpad=kt.prototype._unpad});var ji=m($t=>{"use strict";$t.utils=Sr();$t.Cipher=je();$t.DES=kr();$t.CBC=Gi();$t.EDE=Ri()});var Ni=m((Ca,Xi)=>{var Ki=Yt(),xt=ji(),z0=pt(),Ft=Y().Buffer,_e={"des-ede3-cbc":xt.CBC.instantiate(xt.EDE),"des-ede3":xt.EDE,"des-ede-cbc":xt.CBC.instantiate(xt.EDE),"des-ede":xt.EDE,"des-cbc":xt.CBC.instantiate(xt.DES),"des-ecb":xt.DES};_e.des=_e["des-cbc"];_e.des3=_e["des-ede3-cbc"];Xi.exports=Xe;z0(Xe,Ki);function Xe(e){Ki.call(this);var t=e.mode.toLowerCase(),r=_e[t],s;e.decrypt?s="decrypt":s="encrypt";var i=e.key;Ft.isBuffer(i)||(i=Ft.from(i)),(t==="des-ede"||t==="des-ede-cbc")&&(i=Ft.concat([i,i.slice(0,8)]));var n=e.iv;Ft.isBuffer(n)||(n=Ft.from(n)),this._des=r.create({key:i,iv:n,type:s})}h(Xe,"DES");Xe.prototype._update=function(e){return Ft.from(this._des.update(e))};Xe.prototype._final=function(){return Ft.from(this._des.final())}});var Ir=Kr(),te=tr(),ee=gs(),{blake2b:W0}=Ss(),{blake2s:J0}=Is(),{hmac:Y0}=qe(),{pbkdf2:Z0,pbkdf2Async:Q0}=ir(),{hkdf:$0}=Ds(),{scrypt:to,scryptAsync:eo}=Fs(),zi=Hi(),ro=Ni();exports.hashes={md5:Ir.md5,sha1:Ir.sha1,ripemd160:Ir.ripemd160,sha224:te.sha224,sha256:te.sha256,sha384:te.sha384,sha512:te.sha512,"sha512-224":te.sha512_224,"sha512-256":te.sha512_256,"sha3-224":ee.sha3_224,"sha3-256":ee.sha3_256,"sha3-384":ee.sha3_384,"sha3-512":ee.sha3_512,shake128:ee.shake128,shake256:ee.shake256,blake2b512:W0,blake2s256:J0};exports.hmac=Y0;exports.pbkdf2=Z0;exports.pbkdf2Async=Q0;exports.hkdf=$0;exports.scrypt=to;exports.scryptAsync=eo;exports.aes={createCipheriv:zi.createCipheriv,createDecipheriv:zi.createDecipheriv};exports.DES=ro;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-jsh",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Node.js-compatible runtime for slicc-kernel: the node and jsh commands (abi: js)",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -70,8 +70,11 @@
70
70
  "devDependencies": {
71
71
  "@ai-ecoverse/slicc-kernel": "1.64.0",
72
72
  "@ai-ecoverse/wasi-pnpm": "12.9.1-8",
73
+ "@noble/hashes": "1.8.0",
73
74
  "abort-controller": "3.0.0",
74
75
  "acorn": "8.19.0",
76
+ "browserify-aes": "1.2.0",
77
+ "browserify-des": "1.0.2",
75
78
  "browserify-zlib": "0.2.0",
76
79
  "esbuild": "0.28.2",
77
80
  "node-inspect-extracted": "3.3.4",