@substrate-system/keys 0.2.17 → 0.2.20
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.
- package/dist/_base.min.js +1 -1
- package/dist/_base.min.js.map +2 -2
- package/dist/aes/index.min.js +2 -2
- package/dist/aes/index.min.js.map +2 -2
- package/dist/browser/index.js +0 -3
- package/dist/browser/index.min.js +2 -2
- package/dist/crypto.cjs +0 -3
- package/dist/crypto.cjs.map +2 -2
- package/dist/crypto.d.ts +1 -1
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +0 -3
- package/dist/crypto.js.map +2 -2
- package/dist/crypto.min.cjs +2 -2
- package/dist/crypto.min.cjs.map +2 -2
- package/dist/crypto.min.js +1 -1
- package/dist/crypto.min.js.map +2 -2
- package/dist/ecc/index.min.js +2 -2
- package/dist/ecc/index.min.js.map +2 -2
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +2 -2
- package/dist/meta.json +4 -4
- package/dist/rsa/index.min.js +2 -2
- package/dist/rsa/index.min.js.map +2 -2
- package/package.json +2 -2
package/dist/aes/index.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Nf=Object.create;var he=Object.defineProperty;var Of=Object.getOwnPropertyDescriptor;var Yf=Object.getOwnPropertyNames;var jf=Object.getPrototypeOf,Hf=Object.prototype.hasOwnProperty;var Ff=(o,f,a)=>f in o?he(o,f,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[f]=a;var c=(o,f)=>he(o,"name",{value:f,configurable:!0}),Wt=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(f,a)=>(typeof require<"u"?require:f)[a]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var Jt=(o,f)=>()=>(f||o((f={exports:{}}).exports,f),f.exports),_r=(o,f)=>{for(var a in f)he(o,a,{get:f[a],enumerable:!0})},Gf=(o,f,a,h)=>{if(f&&typeof f=="object"||typeof f=="function")for(let d of Yf(f))!Hf.call(o,d)&&d!==a&&he(o,d,{get:()=>f[d],enumerable:!(h=Of(f,d))||h.enumerable});return o};var Vf=(o,f,a)=>(a=o!=null?Nf(jf(o)):{},Gf(f||!o||!o.__esModule?he(a,"default",{value:o,enumerable:!0}):a,o));var Q=(o,f,a)=>Ff(o,typeof f!="symbol"?f+"":f,a);var Sf=Jt(()=>{"use strict"});var Bf=Jt((Ca,Re)=>{"use strict";(function(o){"use strict";var f=c(function(e){var n,t=new Float64Array(16);if(e)for(n=0;n<e.length;n++)t[n]=e[n];return t},"gf"),a=c(function(){throw new Error("no PRNG")},"randombytes"),h=new Uint8Array(16),d=new Uint8Array(32);d[0]=9;var v=f(),z=f([1]),er=f([56129,1]),ur=f([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),zr=f([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),lr=f([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Lr=f([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Fr=f([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ae(e,n,t,r){e[n]=t>>24&255,e[n+1]=t>>16&255,e[n+2]=t>>8&255,e[n+3]=t&255,e[n+4]=r>>24&255,e[n+5]=r>>16&255,e[n+6]=r>>8&255,e[n+7]=r&255}c(Ae,"ts64");function k(e,n,t,r,i){var x,u=0;for(x=0;x<i;x++)u|=e[n+x]^t[r+x];return(1&u-1>>>8)-1}c(k,"vn");function hr(e,n,t,r){return k(e,n,t,r,16)}c(hr,"crypto_verify_16");function Sr(e,n,t,r){return k(e,n,t,r,32)}c(Sr,"crypto_verify_32");function wr(e,n,t,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,u=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,l=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,m=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,M=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,U=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,q=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,S=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,D=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,I=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,Y=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,O=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,K=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,N=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,R=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,B=i,P=x,_=u,C=l,T=m,E=M,y=U,p=q,A=S,b=D,g=I,w=Y,L=O,j=K,F=N,H=R,s,V=0;V<20;V+=2)s=B+L|0,T^=s<<7|s>>>25,s=T+B|0,A^=s<<9|s>>>23,s=A+T|0,L^=s<<13|s>>>19,s=L+A|0,B^=s<<18|s>>>14,s=E+P|0,b^=s<<7|s>>>25,s=b+E|0,j^=s<<9|s>>>23,s=j+b|0,P^=s<<13|s>>>19,s=P+j|0,E^=s<<18|s>>>14,s=g+y|0,F^=s<<7|s>>>25,s=F+g|0,_^=s<<9|s>>>23,s=_+F|0,y^=s<<13|s>>>19,s=y+_|0,g^=s<<18|s>>>14,s=H+w|0,C^=s<<7|s>>>25,s=C+H|0,p^=s<<9|s>>>23,s=p+C|0,w^=s<<13|s>>>19,s=w+p|0,H^=s<<18|s>>>14,s=B+C|0,P^=s<<7|s>>>25,s=P+B|0,_^=s<<9|s>>>23,s=_+P|0,C^=s<<13|s>>>19,s=C+_|0,B^=s<<18|s>>>14,s=E+T|0,y^=s<<7|s>>>25,s=y+E|0,p^=s<<9|s>>>23,s=p+y|0,T^=s<<13|s>>>19,s=T+p|0,E^=s<<18|s>>>14,s=g+b|0,w^=s<<7|s>>>25,s=w+g|0,A^=s<<9|s>>>23,s=A+w|0,b^=s<<13|s>>>19,s=b+A|0,g^=s<<18|s>>>14,s=H+F|0,L^=s<<7|s>>>25,s=L+H|0,j^=s<<9|s>>>23,s=j+L|0,F^=s<<13|s>>>19,s=F+j|0,H^=s<<18|s>>>14;B=B+i|0,P=P+x|0,_=_+u|0,C=C+l|0,T=T+m|0,E=E+M|0,y=y+U|0,p=p+q|0,A=A+S|0,b=b+D|0,g=g+I|0,w=w+Y|0,L=L+O|0,j=j+K|0,F=F+N|0,H=H+R|0,e[0]=B>>>0&255,e[1]=B>>>8&255,e[2]=B>>>16&255,e[3]=B>>>24&255,e[4]=P>>>0&255,e[5]=P>>>8&255,e[6]=P>>>16&255,e[7]=P>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=T>>>0&255,e[17]=T>>>8&255,e[18]=T>>>16&255,e[19]=T>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=y>>>0&255,e[25]=y>>>8&255,e[26]=y>>>16&255,e[27]=y>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255,e[32]=A>>>0&255,e[33]=A>>>8&255,e[34]=A>>>16&255,e[35]=A>>>24&255,e[36]=b>>>0&255,e[37]=b>>>8&255,e[38]=b>>>16&255,e[39]=b>>>24&255,e[40]=g>>>0&255,e[41]=g>>>8&255,e[42]=g>>>16&255,e[43]=g>>>24&255,e[44]=w>>>0&255,e[45]=w>>>8&255,e[46]=w>>>16&255,e[47]=w>>>24&255,e[48]=L>>>0&255,e[49]=L>>>8&255,e[50]=L>>>16&255,e[51]=L>>>24&255,e[52]=j>>>0&255,e[53]=j>>>8&255,e[54]=j>>>16&255,e[55]=j>>>24&255,e[56]=F>>>0&255,e[57]=F>>>8&255,e[58]=F>>>16&255,e[59]=F>>>24&255,e[60]=H>>>0&255,e[61]=H>>>8&255,e[62]=H>>>16&255,e[63]=H>>>24&255}c(wr,"core_salsa20");function vr(e,n,t,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,u=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,l=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,m=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,M=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,U=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,q=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,S=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,D=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,I=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,Y=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,O=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,K=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,N=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,R=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,B=i,P=x,_=u,C=l,T=m,E=M,y=U,p=q,A=S,b=D,g=I,w=Y,L=O,j=K,F=N,H=R,s,V=0;V<20;V+=2)s=B+L|0,T^=s<<7|s>>>25,s=T+B|0,A^=s<<9|s>>>23,s=A+T|0,L^=s<<13|s>>>19,s=L+A|0,B^=s<<18|s>>>14,s=E+P|0,b^=s<<7|s>>>25,s=b+E|0,j^=s<<9|s>>>23,s=j+b|0,P^=s<<13|s>>>19,s=P+j|0,E^=s<<18|s>>>14,s=g+y|0,F^=s<<7|s>>>25,s=F+g|0,_^=s<<9|s>>>23,s=_+F|0,y^=s<<13|s>>>19,s=y+_|0,g^=s<<18|s>>>14,s=H+w|0,C^=s<<7|s>>>25,s=C+H|0,p^=s<<9|s>>>23,s=p+C|0,w^=s<<13|s>>>19,s=w+p|0,H^=s<<18|s>>>14,s=B+C|0,P^=s<<7|s>>>25,s=P+B|0,_^=s<<9|s>>>23,s=_+P|0,C^=s<<13|s>>>19,s=C+_|0,B^=s<<18|s>>>14,s=E+T|0,y^=s<<7|s>>>25,s=y+E|0,p^=s<<9|s>>>23,s=p+y|0,T^=s<<13|s>>>19,s=T+p|0,E^=s<<18|s>>>14,s=g+b|0,w^=s<<7|s>>>25,s=w+g|0,A^=s<<9|s>>>23,s=A+w|0,b^=s<<13|s>>>19,s=b+A|0,g^=s<<18|s>>>14,s=H+F|0,L^=s<<7|s>>>25,s=L+H|0,j^=s<<9|s>>>23,s=j+L|0,F^=s<<13|s>>>19,s=F+j|0,H^=s<<18|s>>>14;e[0]=B>>>0&255,e[1]=B>>>8&255,e[2]=B>>>16&255,e[3]=B>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=g>>>0&255,e[9]=g>>>8&255,e[10]=g>>>16&255,e[11]=g>>>24&255,e[12]=H>>>0&255,e[13]=H>>>8&255,e[14]=H>>>16&255,e[15]=H>>>24&255,e[16]=y>>>0&255,e[17]=y>>>8&255,e[18]=y>>>16&255,e[19]=y>>>24&255,e[20]=p>>>0&255,e[21]=p>>>8&255,e[22]=p>>>16&255,e[23]=p>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=b>>>0&255,e[29]=b>>>8&255,e[30]=b>>>16&255,e[31]=b>>>24&255}c(vr,"core_hsalsa20");function gr(e,n,t,r){wr(e,n,t,r)}c(gr,"crypto_core_salsa20");function yr(e,n,t,r){vr(e,n,t,r)}c(yr,"crypto_core_hsalsa20");var xr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Br(e,n,t,r,i,x,u){var l=new Uint8Array(16),m=new Uint8Array(64),M,U;for(U=0;U<16;U++)l[U]=0;for(U=0;U<8;U++)l[U]=x[U];for(;i>=64;){for(gr(m,l,u,xr),U=0;U<64;U++)e[n+U]=t[r+U]^m[U];for(M=1,U=8;U<16;U++)M=M+(l[U]&255)|0,l[U]=M&255,M>>>=8;i-=64,n+=64,r+=64}if(i>0)for(gr(m,l,u,xr),U=0;U<i;U++)e[n+U]=t[r+U]^m[U];return 0}c(Br,"crypto_stream_salsa20_xor");function Ar(e,n,t,r,i){var x=new Uint8Array(16),u=new Uint8Array(64),l,m;for(m=0;m<16;m++)x[m]=0;for(m=0;m<8;m++)x[m]=r[m];for(;t>=64;){for(gr(u,x,i,xr),m=0;m<64;m++)e[n+m]=u[m];for(l=1,m=8;m<16;m++)l=l+(x[m]&255)|0,x[m]=l&255,l>>>=8;t-=64,n+=64}if(t>0)for(gr(u,x,i,xr),m=0;m<t;m++)e[n+m]=u[m];return 0}c(Ar,"crypto_stream_salsa20");function Er(e,n,t,r,i){var x=new Uint8Array(32);yr(x,r,i,xr);for(var u=new Uint8Array(8),l=0;l<8;l++)u[l]=r[l+16];return Ar(e,n,t,u,x)}c(Er,"crypto_stream");function Nr(e,n,t,r,i,x,u){var l=new Uint8Array(32);yr(l,x,u,xr);for(var m=new Uint8Array(8),M=0;M<8;M++)m[M]=x[M+16];return Br(e,n,t,r,i,m,l)}c(Nr,"crypto_stream_xor");var we=c(function(e){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var n,t,r,i,x,u,l,m;n=e[0]&255|(e[1]&255)<<8,this.r[0]=n&8191,t=e[2]&255|(e[3]&255)<<8,this.r[1]=(n>>>13|t<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(t>>>10|r<<6)&7939,i=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|i<<9)&8191,x=e[8]&255|(e[9]&255)<<8,this.r[4]=(i>>>4|x<<12)&255,this.r[5]=x>>>1&8190,u=e[10]&255|(e[11]&255)<<8,this.r[6]=(x>>>14|u<<2)&8191,l=e[12]&255|(e[13]&255)<<8,this.r[7]=(u>>>11|l<<5)&8065,m=e[14]&255|(e[15]&255)<<8,this.r[8]=(l>>>8|m<<8)&8191,this.r[9]=m>>>5&127,this.pad[0]=e[16]&255|(e[17]&255)<<8,this.pad[1]=e[18]&255|(e[19]&255)<<8,this.pad[2]=e[20]&255|(e[21]&255)<<8,this.pad[3]=e[22]&255|(e[23]&255)<<8,this.pad[4]=e[24]&255|(e[25]&255)<<8,this.pad[5]=e[26]&255|(e[27]&255)<<8,this.pad[6]=e[28]&255|(e[29]&255)<<8,this.pad[7]=e[30]&255|(e[31]&255)<<8},"poly1305");we.prototype.blocks=function(e,n,t){for(var r=this.fin?0:2048,i,x,u,l,m,M,U,q,S,D,I,Y,O,K,N,R,B,P,_,C=this.h[0],T=this.h[1],E=this.h[2],y=this.h[3],p=this.h[4],A=this.h[5],b=this.h[6],g=this.h[7],w=this.h[8],L=this.h[9],j=this.r[0],F=this.r[1],H=this.r[2],s=this.r[3],V=this.r[4],W=this.r[5],J=this.r[6],G=this.r[7],$=this.r[8],Z=this.r[9];t>=16;)i=e[n+0]&255|(e[n+1]&255)<<8,C+=i&8191,x=e[n+2]&255|(e[n+3]&255)<<8,T+=(i>>>13|x<<3)&8191,u=e[n+4]&255|(e[n+5]&255)<<8,E+=(x>>>10|u<<6)&8191,l=e[n+6]&255|(e[n+7]&255)<<8,y+=(u>>>7|l<<9)&8191,m=e[n+8]&255|(e[n+9]&255)<<8,p+=(l>>>4|m<<12)&8191,A+=m>>>1&8191,M=e[n+10]&255|(e[n+11]&255)<<8,b+=(m>>>14|M<<2)&8191,U=e[n+12]&255|(e[n+13]&255)<<8,g+=(M>>>11|U<<5)&8191,q=e[n+14]&255|(e[n+15]&255)<<8,w+=(U>>>8|q<<8)&8191,L+=q>>>5|r,S=0,D=S,D+=C*j,D+=T*(5*Z),D+=E*(5*$),D+=y*(5*G),D+=p*(5*J),S=D>>>13,D&=8191,D+=A*(5*W),D+=b*(5*V),D+=g*(5*s),D+=w*(5*H),D+=L*(5*F),S+=D>>>13,D&=8191,I=S,I+=C*F,I+=T*j,I+=E*(5*Z),I+=y*(5*$),I+=p*(5*G),S=I>>>13,I&=8191,I+=A*(5*J),I+=b*(5*W),I+=g*(5*V),I+=w*(5*s),I+=L*(5*H),S+=I>>>13,I&=8191,Y=S,Y+=C*H,Y+=T*F,Y+=E*j,Y+=y*(5*Z),Y+=p*(5*$),S=Y>>>13,Y&=8191,Y+=A*(5*G),Y+=b*(5*J),Y+=g*(5*W),Y+=w*(5*V),Y+=L*(5*s),S+=Y>>>13,Y&=8191,O=S,O+=C*s,O+=T*H,O+=E*F,O+=y*j,O+=p*(5*Z),S=O>>>13,O&=8191,O+=A*(5*$),O+=b*(5*G),O+=g*(5*J),O+=w*(5*W),O+=L*(5*V),S+=O>>>13,O&=8191,K=S,K+=C*V,K+=T*s,K+=E*H,K+=y*F,K+=p*j,S=K>>>13,K&=8191,K+=A*(5*Z),K+=b*(5*$),K+=g*(5*G),K+=w*(5*J),K+=L*(5*W),S+=K>>>13,K&=8191,N=S,N+=C*W,N+=T*V,N+=E*s,N+=y*H,N+=p*F,S=N>>>13,N&=8191,N+=A*j,N+=b*(5*Z),N+=g*(5*$),N+=w*(5*G),N+=L*(5*J),S+=N>>>13,N&=8191,R=S,R+=C*J,R+=T*W,R+=E*V,R+=y*s,R+=p*H,S=R>>>13,R&=8191,R+=A*F,R+=b*j,R+=g*(5*Z),R+=w*(5*$),R+=L*(5*G),S+=R>>>13,R&=8191,B=S,B+=C*G,B+=T*J,B+=E*W,B+=y*V,B+=p*s,S=B>>>13,B&=8191,B+=A*H,B+=b*F,B+=g*j,B+=w*(5*Z),B+=L*(5*$),S+=B>>>13,B&=8191,P=S,P+=C*$,P+=T*G,P+=E*J,P+=y*W,P+=p*V,S=P>>>13,P&=8191,P+=A*s,P+=b*H,P+=g*F,P+=w*j,P+=L*(5*Z),S+=P>>>13,P&=8191,_=S,_+=C*Z,_+=T*$,_+=E*G,_+=y*J,_+=p*W,S=_>>>13,_&=8191,_+=A*V,_+=b*s,_+=g*H,_+=w*F,_+=L*j,S+=_>>>13,_&=8191,S=(S<<2)+S|0,S=S+D|0,D=S&8191,S=S>>>13,I+=S,C=D,T=I,E=Y,y=O,p=K,A=N,b=R,g=B,w=P,L=_,n+=16,t-=16;this.h[0]=C,this.h[1]=T,this.h[2]=E,this.h[3]=y,this.h[4]=p,this.h[5]=A,this.h[6]=b,this.h[7]=g,this.h[8]=w,this.h[9]=L},we.prototype.finish=function(e,n){var t=new Uint16Array(10),r,i,x,u;if(this.leftover){for(u=this.leftover,this.buffer[u++]=1;u<16;u++)this.buffer[u]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,u=2;u<10;u++)this.h[u]+=r,r=this.h[u]>>>13,this.h[u]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,t[0]=this.h[0]+5,r=t[0]>>>13,t[0]&=8191,u=1;u<10;u++)t[u]=this.h[u]+r,r=t[u]>>>13,t[u]&=8191;for(t[9]-=8192,i=(r^1)-1,u=0;u<10;u++)t[u]&=i;for(i=~i,u=0;u<10;u++)this.h[u]=this.h[u]&i|t[u];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,x=this.h[0]+this.pad[0],this.h[0]=x&65535,u=1;u<8;u++)x=(this.h[u]+this.pad[u]|0)+(x>>>16)|0,this.h[u]=x&65535;e[n+0]=this.h[0]>>>0&255,e[n+1]=this.h[0]>>>8&255,e[n+2]=this.h[1]>>>0&255,e[n+3]=this.h[1]>>>8&255,e[n+4]=this.h[2]>>>0&255,e[n+5]=this.h[2]>>>8&255,e[n+6]=this.h[3]>>>0&255,e[n+7]=this.h[3]>>>8&255,e[n+8]=this.h[4]>>>0&255,e[n+9]=this.h[4]>>>8&255,e[n+10]=this.h[5]>>>0&255,e[n+11]=this.h[5]>>>8&255,e[n+12]=this.h[6]>>>0&255,e[n+13]=this.h[6]>>>8&255,e[n+14]=this.h[7]>>>0&255,e[n+15]=this.h[7]>>>8&255},we.prototype.update=function(e,n,t){var r,i;if(this.leftover){for(i=16-this.leftover,i>t&&(i=t),r=0;r<i;r++)this.buffer[this.leftover+r]=e[n+r];if(t-=i,n+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(t>=16&&(i=t-t%16,this.blocks(e,n,i),n+=i,t-=i),t){for(r=0;r<t;r++)this.buffer[this.leftover+r]=e[n+r];this.leftover+=t}};function Ne(e,n,t,r,i,x){var u=new we(x);return u.update(t,r,i),u.finish(e,n),0}c(Ne,"crypto_onetimeauth");function Rt(e,n,t,r,i,x){var u=new Uint8Array(16);return Ne(u,0,t,r,i,x),hr(e,n,u,0)}c(Rt,"crypto_onetimeauth_verify");function Oe(e,n,t,r,i){var x;if(t<32)return-1;for(Nr(e,0,n,0,t,r,i),Ne(e,16,e,32,t-32,e),x=0;x<16;x++)e[x]=0;return 0}c(Oe,"crypto_secretbox");function Ye(e,n,t,r,i){var x,u=new Uint8Array(32);if(t<32||(Er(u,0,32,r,i),Rt(n,16,n,32,t-32,u)!==0))return-1;for(Nr(e,0,n,0,t,r,i),x=0;x<32;x++)e[x]=0;return 0}c(Ye,"crypto_secretbox_open");function Dr(e,n){var t;for(t=0;t<16;t++)e[t]=n[t]|0}c(Dr,"set25519");function je(e){var n,t,r=1;for(n=0;n<16;n++)t=e[n]+r+65535,r=Math.floor(t/65536),e[n]=t-r*65536;e[0]+=r-1+37*(r-1)}c(je,"car25519");function Gr(e,n,t){for(var r,i=~(t-1),x=0;x<16;x++)r=i&(e[x]^n[x]),e[x]^=r,n[x]^=r}c(Gr,"sel25519");function Vr(e,n){var t,r,i,x=f(),u=f();for(t=0;t<16;t++)u[t]=n[t];for(je(u),je(u),je(u),r=0;r<2;r++){for(x[0]=u[0]-65517,t=1;t<15;t++)x[t]=u[t]-65535-(x[t-1]>>16&1),x[t-1]&=65535;x[15]=u[15]-32767-(x[14]>>16&1),i=x[15]>>16&1,x[14]&=65535,Gr(u,x,1-i)}for(t=0;t<16;t++)e[2*t]=u[t]&255,e[2*t+1]=u[t]>>8}c(Vr,"pack25519");function zt(e,n){var t=new Uint8Array(32),r=new Uint8Array(32);return Vr(t,e),Vr(r,n),Sr(t,0,r,0)}c(zt,"neq25519");function Nt(e){var n=new Uint8Array(32);return Vr(n,e),n[0]&1}c(Nt,"par25519");function He(e,n){var t;for(t=0;t<16;t++)e[t]=n[2*t]+(n[2*t+1]<<8);e[15]&=32767}c(He,"unpack25519");function Cr(e,n,t){for(var r=0;r<16;r++)e[r]=n[r]+t[r]}c(Cr,"A");function Tr(e,n,t){for(var r=0;r<16;r++)e[r]=n[r]-t[r]}c(Tr,"Z");function X(e,n,t){var r,i,x=0,u=0,l=0,m=0,M=0,U=0,q=0,S=0,D=0,I=0,Y=0,O=0,K=0,N=0,R=0,B=0,P=0,_=0,C=0,T=0,E=0,y=0,p=0,A=0,b=0,g=0,w=0,L=0,j=0,F=0,H=0,s=t[0],V=t[1],W=t[2],J=t[3],G=t[4],$=t[5],Z=t[6],ir=t[7],rr=t[8],tr=t[9],fr=t[10],nr=t[11],sr=t[12],pr=t[13],dr=t[14],br=t[15];r=n[0],x+=r*s,u+=r*V,l+=r*W,m+=r*J,M+=r*G,U+=r*$,q+=r*Z,S+=r*ir,D+=r*rr,I+=r*tr,Y+=r*fr,O+=r*nr,K+=r*sr,N+=r*pr,R+=r*dr,B+=r*br,r=n[1],u+=r*s,l+=r*V,m+=r*W,M+=r*J,U+=r*G,q+=r*$,S+=r*Z,D+=r*ir,I+=r*rr,Y+=r*tr,O+=r*fr,K+=r*nr,N+=r*sr,R+=r*pr,B+=r*dr,P+=r*br,r=n[2],l+=r*s,m+=r*V,M+=r*W,U+=r*J,q+=r*G,S+=r*$,D+=r*Z,I+=r*ir,Y+=r*rr,O+=r*tr,K+=r*fr,N+=r*nr,R+=r*sr,B+=r*pr,P+=r*dr,_+=r*br,r=n[3],m+=r*s,M+=r*V,U+=r*W,q+=r*J,S+=r*G,D+=r*$,I+=r*Z,Y+=r*ir,O+=r*rr,K+=r*tr,N+=r*fr,R+=r*nr,B+=r*sr,P+=r*pr,_+=r*dr,C+=r*br,r=n[4],M+=r*s,U+=r*V,q+=r*W,S+=r*J,D+=r*G,I+=r*$,Y+=r*Z,O+=r*ir,K+=r*rr,N+=r*tr,R+=r*fr,B+=r*nr,P+=r*sr,_+=r*pr,C+=r*dr,T+=r*br,r=n[5],U+=r*s,q+=r*V,S+=r*W,D+=r*J,I+=r*G,Y+=r*$,O+=r*Z,K+=r*ir,N+=r*rr,R+=r*tr,B+=r*fr,P+=r*nr,_+=r*sr,C+=r*pr,T+=r*dr,E+=r*br,r=n[6],q+=r*s,S+=r*V,D+=r*W,I+=r*J,Y+=r*G,O+=r*$,K+=r*Z,N+=r*ir,R+=r*rr,B+=r*tr,P+=r*fr,_+=r*nr,C+=r*sr,T+=r*pr,E+=r*dr,y+=r*br,r=n[7],S+=r*s,D+=r*V,I+=r*W,Y+=r*J,O+=r*G,K+=r*$,N+=r*Z,R+=r*ir,B+=r*rr,P+=r*tr,_+=r*fr,C+=r*nr,T+=r*sr,E+=r*pr,y+=r*dr,p+=r*br,r=n[8],D+=r*s,I+=r*V,Y+=r*W,O+=r*J,K+=r*G,N+=r*$,R+=r*Z,B+=r*ir,P+=r*rr,_+=r*tr,C+=r*fr,T+=r*nr,E+=r*sr,y+=r*pr,p+=r*dr,A+=r*br,r=n[9],I+=r*s,Y+=r*V,O+=r*W,K+=r*J,N+=r*G,R+=r*$,B+=r*Z,P+=r*ir,_+=r*rr,C+=r*tr,T+=r*fr,E+=r*nr,y+=r*sr,p+=r*pr,A+=r*dr,b+=r*br,r=n[10],Y+=r*s,O+=r*V,K+=r*W,N+=r*J,R+=r*G,B+=r*$,P+=r*Z,_+=r*ir,C+=r*rr,T+=r*tr,E+=r*fr,y+=r*nr,p+=r*sr,A+=r*pr,b+=r*dr,g+=r*br,r=n[11],O+=r*s,K+=r*V,N+=r*W,R+=r*J,B+=r*G,P+=r*$,_+=r*Z,C+=r*ir,T+=r*rr,E+=r*tr,y+=r*fr,p+=r*nr,A+=r*sr,b+=r*pr,g+=r*dr,w+=r*br,r=n[12],K+=r*s,N+=r*V,R+=r*W,B+=r*J,P+=r*G,_+=r*$,C+=r*Z,T+=r*ir,E+=r*rr,y+=r*tr,p+=r*fr,A+=r*nr,b+=r*sr,g+=r*pr,w+=r*dr,L+=r*br,r=n[13],N+=r*s,R+=r*V,B+=r*W,P+=r*J,_+=r*G,C+=r*$,T+=r*Z,E+=r*ir,y+=r*rr,p+=r*tr,A+=r*fr,b+=r*nr,g+=r*sr,w+=r*pr,L+=r*dr,j+=r*br,r=n[14],R+=r*s,B+=r*V,P+=r*W,_+=r*J,C+=r*G,T+=r*$,E+=r*Z,y+=r*ir,p+=r*rr,A+=r*tr,b+=r*fr,g+=r*nr,w+=r*sr,L+=r*pr,j+=r*dr,F+=r*br,r=n[15],B+=r*s,P+=r*V,_+=r*W,C+=r*J,T+=r*G,E+=r*$,y+=r*Z,p+=r*ir,A+=r*rr,b+=r*tr,g+=r*fr,w+=r*nr,L+=r*sr,j+=r*pr,F+=r*dr,H+=r*br,x+=38*P,u+=38*_,l+=38*C,m+=38*T,M+=38*E,U+=38*y,q+=38*p,S+=38*A,D+=38*b,I+=38*g,Y+=38*w,O+=38*L,K+=38*j,N+=38*F,R+=38*H,i=1,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=M+i+65535,i=Math.floor(r/65536),M=r-i*65536,r=U+i+65535,i=Math.floor(r/65536),U=r-i*65536,r=q+i+65535,i=Math.floor(r/65536),q=r-i*65536,r=S+i+65535,i=Math.floor(r/65536),S=r-i*65536,r=D+i+65535,i=Math.floor(r/65536),D=r-i*65536,r=I+i+65535,i=Math.floor(r/65536),I=r-i*65536,r=Y+i+65535,i=Math.floor(r/65536),Y=r-i*65536,r=O+i+65535,i=Math.floor(r/65536),O=r-i*65536,r=K+i+65535,i=Math.floor(r/65536),K=r-i*65536,r=N+i+65535,i=Math.floor(r/65536),N=r-i*65536,r=R+i+65535,i=Math.floor(r/65536),R=r-i*65536,r=B+i+65535,i=Math.floor(r/65536),B=r-i*65536,x+=i-1+37*(i-1),i=1,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=M+i+65535,i=Math.floor(r/65536),M=r-i*65536,r=U+i+65535,i=Math.floor(r/65536),U=r-i*65536,r=q+i+65535,i=Math.floor(r/65536),q=r-i*65536,r=S+i+65535,i=Math.floor(r/65536),S=r-i*65536,r=D+i+65535,i=Math.floor(r/65536),D=r-i*65536,r=I+i+65535,i=Math.floor(r/65536),I=r-i*65536,r=Y+i+65535,i=Math.floor(r/65536),Y=r-i*65536,r=O+i+65535,i=Math.floor(r/65536),O=r-i*65536,r=K+i+65535,i=Math.floor(r/65536),K=r-i*65536,r=N+i+65535,i=Math.floor(r/65536),N=r-i*65536,r=R+i+65535,i=Math.floor(r/65536),R=r-i*65536,r=B+i+65535,i=Math.floor(r/65536),B=r-i*65536,x+=i-1+37*(i-1),e[0]=x,e[1]=u,e[2]=l,e[3]=m,e[4]=M,e[5]=U,e[6]=q,e[7]=S,e[8]=D,e[9]=I,e[10]=Y,e[11]=O,e[12]=K,e[13]=N,e[14]=R,e[15]=B}c(X,"M");function Ur(e,n){X(e,n,n)}c(Ur,"S");function Ot(e,n){var t=f(),r;for(r=0;r<16;r++)t[r]=n[r];for(r=253;r>=0;r--)Ur(t,t),r!==2&&r!==4&&X(t,t,n);for(r=0;r<16;r++)e[r]=t[r]}c(Ot,"inv25519");function Yt(e,n){var t=f(),r;for(r=0;r<16;r++)t[r]=n[r];for(r=250;r>=0;r--)Ur(t,t),r!==1&&X(t,t,n);for(r=0;r<16;r++)e[r]=t[r]}c(Yt,"pow2523");function me(e,n,t){var r=new Uint8Array(32),i=new Float64Array(80),x,u,l=f(),m=f(),M=f(),U=f(),q=f(),S=f();for(u=0;u<31;u++)r[u]=n[u];for(r[31]=n[31]&127|64,r[0]&=248,He(i,t),u=0;u<16;u++)m[u]=i[u],U[u]=l[u]=M[u]=0;for(l[0]=U[0]=1,u=254;u>=0;--u)x=r[u>>>3]>>>(u&7)&1,Gr(l,m,x),Gr(M,U,x),Cr(q,l,M),Tr(l,l,M),Cr(M,m,U),Tr(m,m,U),Ur(U,q),Ur(S,l),X(l,M,l),X(M,m,q),Cr(q,l,M),Tr(l,l,M),Ur(m,l),Tr(M,U,S),X(l,M,er),Cr(l,l,U),X(M,M,l),X(l,U,S),X(U,m,i),Ur(m,q),Gr(l,m,x),Gr(M,U,x);for(u=0;u<16;u++)i[u+16]=l[u],i[u+32]=M[u],i[u+48]=m[u],i[u+64]=U[u];var D=i.subarray(32),I=i.subarray(16);return Ot(D,D),X(I,I,D),Vr(e,I),0}c(me,"crypto_scalarmult");function ve(e,n){return me(e,n,d)}c(ve,"crypto_scalarmult_base");function jt(e,n){return a(n,32),ve(e,n)}c(jt,"crypto_box_keypair");function Ee(e,n,t){var r=new Uint8Array(32);return me(r,t,n),yr(e,h,r,xr)}c(Ee,"crypto_box_beforenm");var Ht=Oe,Pf=Ye;function Lf(e,n,t,r,i,x){var u=new Uint8Array(32);return Ee(u,i,x),Ht(e,n,t,r,u)}c(Lf,"crypto_box");function Df(e,n,t,r,i,x){var u=new Uint8Array(32);return Ee(u,i,x),Pf(e,n,t,r,u)}c(Df,"crypto_box_open");var Ft=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Gt(e,n,t,r){for(var i=new Int32Array(16),x=new Int32Array(16),u,l,m,M,U,q,S,D,I,Y,O,K,N,R,B,P,_,C,T,E,y,p,A,b,g,w,L=e[0],j=e[1],F=e[2],H=e[3],s=e[4],V=e[5],W=e[6],J=e[7],G=n[0],$=n[1],Z=n[2],ir=n[3],rr=n[4],tr=n[5],fr=n[6],nr=n[7],sr=0;r>=128;){for(T=0;T<16;T++)E=8*T+sr,i[T]=t[E+0]<<24|t[E+1]<<16|t[E+2]<<8|t[E+3],x[T]=t[E+4]<<24|t[E+5]<<16|t[E+6]<<8|t[E+7];for(T=0;T<80;T++)if(u=L,l=j,m=F,M=H,U=s,q=V,S=W,D=J,I=G,Y=$,O=Z,K=ir,N=rr,R=tr,B=fr,P=nr,y=J,p=nr,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=(s>>>14|rr<<18)^(s>>>18|rr<<14)^(rr>>>9|s<<23),p=(rr>>>14|s<<18)^(rr>>>18|s<<14)^(s>>>9|rr<<23),A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,y=s&V^~s&W,p=rr&tr^~rr&fr,A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,y=Ft[T*2],p=Ft[T*2+1],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,y=i[T%16],p=x[T%16],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,_=g&65535|w<<16,C=A&65535|b<<16,y=_,p=C,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=(L>>>28|G<<4)^(G>>>2|L<<30)^(G>>>7|L<<25),p=(G>>>28|L<<4)^(L>>>2|G<<30)^(L>>>7|G<<25),A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,y=L&j^L&F^j&F,p=G&$^G&Z^$&Z,A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,D=g&65535|w<<16,P=A&65535|b<<16,y=M,p=K,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=_,p=C,A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,M=g&65535|w<<16,K=A&65535|b<<16,j=u,F=l,H=m,s=M,V=U,W=q,J=S,L=D,$=I,Z=Y,ir=O,rr=K,tr=N,fr=R,nr=B,G=P,T%16===15)for(E=0;E<16;E++)y=i[E],p=x[E],A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=i[(E+9)%16],p=x[(E+9)%16],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,_=i[(E+1)%16],C=x[(E+1)%16],y=(_>>>1|C<<31)^(_>>>8|C<<24)^_>>>7,p=(C>>>1|_<<31)^(C>>>8|_<<24)^(C>>>7|_<<25),A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,_=i[(E+14)%16],C=x[(E+14)%16],y=(_>>>19|C<<13)^(C>>>29|_<<3)^_>>>6,p=(C>>>19|_<<13)^(_>>>29|C<<3)^(C>>>6|_<<26),A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,i[E]=g&65535|w<<16,x[E]=A&65535|b<<16;y=L,p=G,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[0],p=n[0],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[0]=L=g&65535|w<<16,n[0]=G=A&65535|b<<16,y=j,p=$,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[1],p=n[1],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[1]=j=g&65535|w<<16,n[1]=$=A&65535|b<<16,y=F,p=Z,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[2],p=n[2],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[2]=F=g&65535|w<<16,n[2]=Z=A&65535|b<<16,y=H,p=ir,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[3],p=n[3],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[3]=H=g&65535|w<<16,n[3]=ir=A&65535|b<<16,y=s,p=rr,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[4],p=n[4],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[4]=s=g&65535|w<<16,n[4]=rr=A&65535|b<<16,y=V,p=tr,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[5],p=n[5],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[5]=V=g&65535|w<<16,n[5]=tr=A&65535|b<<16,y=W,p=fr,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[6],p=n[6],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[6]=W=g&65535|w<<16,n[6]=fr=A&65535|b<<16,y=J,p=nr,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[7],p=n[7],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[7]=J=g&65535|w<<16,n[7]=nr=A&65535|b<<16,sr+=128,r-=128}return r}c(Gt,"crypto_hashblocks_hl");function Yr(e,n,t){var r=new Int32Array(8),i=new Int32Array(8),x=new Uint8Array(256),u,l=t;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Gt(r,i,n,t),t%=128,u=0;u<t;u++)x[u]=n[l-t+u];for(x[t]=128,t=256-128*(t<112?1:0),x[t-9]=0,Ae(x,t-8,l/536870912|0,l<<3),Gt(r,i,x,t),u=0;u<8;u++)Ae(e,8*u,r[u],i[u]);return 0}c(Yr,"crypto_hash");function Ue(e,n){var t=f(),r=f(),i=f(),x=f(),u=f(),l=f(),m=f(),M=f(),U=f();Tr(t,e[1],e[0]),Tr(U,n[1],n[0]),X(t,t,U),Cr(r,e[0],e[1]),Cr(U,n[0],n[1]),X(r,r,U),X(i,e[3],n[3]),X(i,i,zr),X(x,e[2],n[2]),Cr(x,x,x),Tr(u,r,t),Tr(l,x,i),Cr(m,x,i),Cr(M,r,t),X(e[0],u,l),X(e[1],M,m),X(e[2],m,l),X(e[3],u,M)}c(Ue,"add");function Vt(e,n,t){var r;for(r=0;r<4;r++)Gr(e[r],n[r],t)}c(Vt,"cswap");function Fe(e,n){var t=f(),r=f(),i=f();Ot(i,n[2]),X(t,n[0],i),X(r,n[1],i),Vr(e,r),e[31]^=Nt(t)<<7}c(Fe,"pack");function Ge(e,n,t){var r,i;for(Dr(e[0],v),Dr(e[1],z),Dr(e[2],z),Dr(e[3],v),i=255;i>=0;--i)r=t[i/8|0]>>(i&7)&1,Vt(e,n,r),Ue(n,e),Ue(e,e),Vt(e,n,r)}c(Ge,"scalarmult");function _e(e,n){var t=[f(),f(),f(),f()];Dr(t[0],lr),Dr(t[1],Lr),Dr(t[2],z),X(t[3],lr,Lr),Ge(e,t,n)}c(_e,"scalarbase");function Ve(e,n,t){var r=new Uint8Array(64),i=[f(),f(),f(),f()],x;for(t||a(n,32),Yr(r,n,32),r[0]&=248,r[31]&=127,r[31]|=64,_e(i,r),Fe(e,i),x=0;x<32;x++)n[x+32]=e[x];return 0}c(Ve,"crypto_sign_keypair");var Se=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 Xe(e,n){var t,r,i,x;for(r=63;r>=32;--r){for(t=0,i=r-32,x=r-12;i<x;++i)n[i]+=t-16*n[r]*Se[i-(r-32)],t=Math.floor((n[i]+128)/256),n[i]-=t*256;n[i]+=t,n[r]=0}for(t=0,i=0;i<32;i++)n[i]+=t-(n[31]>>4)*Se[i],t=n[i]>>8,n[i]&=255;for(i=0;i<32;i++)n[i]-=t*Se[i];for(r=0;r<32;r++)n[r+1]+=n[r]>>8,e[r]=n[r]&255}c(Xe,"modL");function $e(e){var n=new Float64Array(64),t;for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;Xe(e,n)}c($e,"reduce");function Xt(e,n,t,r){var i=new Uint8Array(64),x=new Uint8Array(64),u=new Uint8Array(64),l,m,M=new Float64Array(64),U=[f(),f(),f(),f()];Yr(i,r,32),i[0]&=248,i[31]&=127,i[31]|=64;var q=t+64;for(l=0;l<t;l++)e[64+l]=n[l];for(l=0;l<32;l++)e[32+l]=i[32+l];for(Yr(u,e.subarray(32),t+32),$e(u),_e(U,u),Fe(e,U),l=32;l<64;l++)e[l]=r[l];for(Yr(x,e,t+64),$e(x),l=0;l<64;l++)M[l]=0;for(l=0;l<32;l++)M[l]=u[l];for(l=0;l<32;l++)for(m=0;m<32;m++)M[l+m]+=x[l]*i[m];return Xe(e.subarray(32),M),q}c(Xt,"crypto_sign");function If(e,n){var t=f(),r=f(),i=f(),x=f(),u=f(),l=f(),m=f();return Dr(e[2],z),He(e[1],n),Ur(i,e[1]),X(x,i,ur),Tr(i,i,e[2]),Cr(x,e[2],x),Ur(u,x),Ur(l,u),X(m,l,u),X(t,m,i),X(t,t,x),Yt(t,t),X(t,t,i),X(t,t,x),X(t,t,x),X(e[0],t,x),Ur(r,e[0]),X(r,r,x),zt(r,i)&&X(e[0],e[0],Fr),Ur(r,e[0]),X(r,r,x),zt(r,i)?-1:(Nt(e[0])===n[31]>>7&&Tr(e[0],v,e[0]),X(e[3],e[0],e[1]),0)}c(If,"unpackneg");function Ze(e,n,t,r){var i,x=new Uint8Array(32),u=new Uint8Array(64),l=[f(),f(),f(),f()],m=[f(),f(),f(),f()];if(t<64||If(m,r))return-1;for(i=0;i<t;i++)e[i]=n[i];for(i=0;i<32;i++)e[i+32]=r[i];if(Yr(u,e,t),$e(u),Ge(l,m,u),_e(m,n.subarray(32)),Ue(l,m),Fe(x,l),t-=64,Sr(n,0,x,0)){for(i=0;i<t;i++)e[i]=0;return-1}for(i=0;i<t;i++)e[i]=n[i+64];return t}c(Ze,"crypto_sign_open");var qe=32,Be=24,se=32,Xr=16,xe=32,Ce=32,ce=32,ue=32,We=32,$t=Be,Kf=se,Rf=Xr,Ir=64,jr=32,$r=64,Je=32,Qe=64;o.lowlevel={crypto_core_hsalsa20:yr,crypto_stream_xor:Nr,crypto_stream:Er,crypto_stream_salsa20_xor:Br,crypto_stream_salsa20:Ar,crypto_onetimeauth:Ne,crypto_onetimeauth_verify:Rt,crypto_verify_16:hr,crypto_verify_32:Sr,crypto_secretbox:Oe,crypto_secretbox_open:Ye,crypto_scalarmult:me,crypto_scalarmult_base:ve,crypto_box_beforenm:Ee,crypto_box_afternm:Ht,crypto_box:Lf,crypto_box_open:Df,crypto_box_keypair:jt,crypto_hash:Yr,crypto_sign:Xt,crypto_sign_keypair:Ve,crypto_sign_open:Ze,crypto_secretbox_KEYBYTES:qe,crypto_secretbox_NONCEBYTES:Be,crypto_secretbox_ZEROBYTES:se,crypto_secretbox_BOXZEROBYTES:Xr,crypto_scalarmult_BYTES:xe,crypto_scalarmult_SCALARBYTES:Ce,crypto_box_PUBLICKEYBYTES:ce,crypto_box_SECRETKEYBYTES:ue,crypto_box_BEFORENMBYTES:We,crypto_box_NONCEBYTES:$t,crypto_box_ZEROBYTES:Kf,crypto_box_BOXZEROBYTES:Rf,crypto_sign_BYTES:Ir,crypto_sign_PUBLICKEYBYTES:jr,crypto_sign_SECRETKEYBYTES:$r,crypto_sign_SEEDBYTES:Je,crypto_hash_BYTES:Qe,gf:f,D:ur,L:Se,pack25519:Vr,unpack25519:He,M:X,A:Cr,S:Ur,Z:Tr,pow2523:Yt,add:Ue,set25519:Dr,modL:Xe,scalarmult:Ge,scalarbase:_e};function Zt(e,n){if(e.length!==qe)throw new Error("bad key size");if(n.length!==Be)throw new Error("bad nonce size")}c(Zt,"checkLengths");function zf(e,n){if(e.length!==ce)throw new Error("bad public key size");if(n.length!==ue)throw new Error("bad secret key size")}c(zf,"checkBoxLengths");function mr(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}c(mr,"checkArrayTypes");function qt(e){for(var n=0;n<e.length;n++)e[n]=0}c(qt,"cleanup"),o.randomBytes=function(e){var n=new Uint8Array(e);return a(n,e),n},o.secretbox=function(e,n,t){mr(e,n,t),Zt(t,n);for(var r=new Uint8Array(se+e.length),i=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+se]=e[x];return Oe(i,r,r.length,n,t),i.subarray(Xr)},o.secretbox.open=function(e,n,t){mr(e,n,t),Zt(t,n);for(var r=new Uint8Array(Xr+e.length),i=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+Xr]=e[x];return r.length<32||Ye(i,r,r.length,n,t)!==0?null:i.subarray(se)},o.secretbox.keyLength=qe,o.secretbox.nonceLength=Be,o.secretbox.overheadLength=Xr,o.scalarMult=function(e,n){if(mr(e,n),e.length!==Ce)throw new Error("bad n size");if(n.length!==xe)throw new Error("bad p size");var t=new Uint8Array(xe);return me(t,e,n),t},o.scalarMult.base=function(e){if(mr(e),e.length!==Ce)throw new Error("bad n size");var n=new Uint8Array(xe);return ve(n,e),n},o.scalarMult.scalarLength=Ce,o.scalarMult.groupElementLength=xe,o.box=function(e,n,t,r){var i=o.box.before(t,r);return o.secretbox(e,n,i)},o.box.before=function(e,n){mr(e,n),zf(e,n);var t=new Uint8Array(We);return Ee(t,e,n),t},o.box.after=o.secretbox,o.box.open=function(e,n,t,r){var i=o.box.before(t,r);return o.secretbox.open(e,n,i)},o.box.open.after=o.secretbox.open,o.box.keyPair=function(){var e=new Uint8Array(ce),n=new Uint8Array(ue);return jt(e,n),{publicKey:e,secretKey:n}},o.box.keyPair.fromSecretKey=function(e){if(mr(e),e.length!==ue)throw new Error("bad secret key size");var n=new Uint8Array(ce);return ve(n,e),{publicKey:n,secretKey:new Uint8Array(e)}},o.box.publicKeyLength=ce,o.box.secretKeyLength=ue,o.box.sharedKeyLength=We,o.box.nonceLength=$t,o.box.overheadLength=o.secretbox.overheadLength,o.sign=function(e,n){if(mr(e,n),n.length!==$r)throw new Error("bad secret key size");var t=new Uint8Array(Ir+e.length);return Xt(t,e,e.length,n),t},o.sign.open=function(e,n){if(mr(e,n),n.length!==jr)throw new Error("bad public key size");var t=new Uint8Array(e.length),r=Ze(t,e,e.length,n);if(r<0)return null;for(var i=new Uint8Array(r),x=0;x<i.length;x++)i[x]=t[x];return i},o.sign.detached=function(e,n){for(var t=o.sign(e,n),r=new Uint8Array(Ir),i=0;i<r.length;i++)r[i]=t[i];return r},o.sign.detached.verify=function(e,n,t){if(mr(e,n,t),n.length!==Ir)throw new Error("bad signature size");if(t.length!==jr)throw new Error("bad public key size");var r=new Uint8Array(Ir+e.length),i=new Uint8Array(Ir+e.length),x;for(x=0;x<Ir;x++)r[x]=n[x];for(x=0;x<e.length;x++)r[x+Ir]=e[x];return Ze(i,r,r.length,t)>=0},o.sign.keyPair=function(){var e=new Uint8Array(jr),n=new Uint8Array($r);return Ve(e,n),{publicKey:e,secretKey:n}},o.sign.keyPair.fromSecretKey=function(e){if(mr(e),e.length!==$r)throw new Error("bad secret key size");for(var n=new Uint8Array(jr),t=0;t<n.length;t++)n[t]=e[32+t];return{publicKey:n,secretKey:new Uint8Array(e)}},o.sign.keyPair.fromSeed=function(e){if(mr(e),e.length!==Je)throw new Error("bad seed size");for(var n=new Uint8Array(jr),t=new Uint8Array($r),r=0;r<32;r++)t[r]=e[r];return Ve(n,t,!0),{publicKey:n,secretKey:t}},o.sign.publicKeyLength=jr,o.sign.secretKeyLength=$r,o.sign.seedLength=Je,o.sign.signatureLength=Ir,o.hash=function(e){mr(e);var n=new Uint8Array(Qe);return Yr(n,e,e.length),n},o.hash.hashLength=Qe,o.verify=function(e,n){return mr(e,n),e.length===0||n.length===0||e.length!==n.length?!1:k(e,0,n,0,e.length)===0},o.setPRNG=function(e){a=e},function(){var e=typeof self<"u"?self.crypto||self.msCrypto:null;if(e&&e.getRandomValues){var n=65536;o.setPRNG(function(t,r){var i,x=new Uint8Array(r);for(i=0;i<r;i+=n)e.getRandomValues(x.subarray(i,i+Math.min(r-i,n)));for(i=0;i<r;i++)t[i]=x[i];qt(x)})}else typeof Wt<"u"&&(e=Sf(),e&&e.randomBytes&&o.setPRNG(function(t,r){var i,x=e.randomBytes(r);for(i=0;i<r;i++)t[i]=x[i];qt(x)}))}()})(typeof Re<"u"&&Re.exports?Re.exports:self.nacl=self.nacl||{})});var Xf=globalThis||window||self,ar=Xf.crypto;function Te(o=0){return new Uint8Array(o)}c(Te,"allocUnsafe");var at={};_r(at,{base10:()=>kf});var Ho=new Uint8Array(0);function Qt(o,f){if(o===f)return!0;if(o.byteLength!==f.byteLength)return!1;for(let a=0;a<o.byteLength;a++)if(o[a]!==f[a])return!1;return!0}c(Qt,"equals");function Kr(o){if(o instanceof Uint8Array&&o.constructor.name==="Uint8Array")return o;if(o instanceof ArrayBuffer)return new Uint8Array(o);if(ArrayBuffer.isView(o))return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);throw new Error("Unknown type, must be binary type")}c(Kr,"coerce");function kt(o){return new TextEncoder().encode(o)}c(kt,"fromString");function rf(o){return new TextDecoder().decode(o)}c(rf,"toString");function Zf(o,f){if(o.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),h=0;h<a.length;h++)a[h]=255;for(var d=0;d<o.length;d++){var v=o.charAt(d),z=v.charCodeAt(0);if(a[z]!==255)throw new TypeError(v+" is ambiguous");a[z]=d}var er=o.length,ur=o.charAt(0),zr=Math.log(er)/Math.log(256),lr=Math.log(256)/Math.log(er);function Lr(k){if(k instanceof Uint8Array||(ArrayBuffer.isView(k)?k=new Uint8Array(k.buffer,k.byteOffset,k.byteLength):Array.isArray(k)&&(k=Uint8Array.from(k))),!(k instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(k.length===0)return"";for(var hr=0,Sr=0,wr=0,vr=k.length;wr!==vr&&k[wr]===0;)wr++,hr++;for(var gr=(vr-wr)*lr+1>>>0,yr=new Uint8Array(gr);wr!==vr;){for(var xr=k[wr],Br=0,Ar=gr-1;(xr!==0||Br<Sr)&&Ar!==-1;Ar--,Br++)xr+=256*yr[Ar]>>>0,yr[Ar]=xr%er>>>0,xr=xr/er>>>0;if(xr!==0)throw new Error("Non-zero carry");Sr=Br,wr++}for(var Er=gr-Sr;Er!==gr&&yr[Er]===0;)Er++;for(var Nr=ur.repeat(hr);Er<gr;++Er)Nr+=o.charAt(yr[Er]);return Nr}c(Lr,"encode");function Fr(k){if(typeof k!="string")throw new TypeError("Expected String");if(k.length===0)return new Uint8Array;var hr=0;if(k[hr]!==" "){for(var Sr=0,wr=0;k[hr]===ur;)Sr++,hr++;for(var vr=(k.length-hr)*zr+1>>>0,gr=new Uint8Array(vr);k[hr];){var yr=a[k.charCodeAt(hr)];if(yr===255)return;for(var xr=0,Br=vr-1;(yr!==0||xr<wr)&&Br!==-1;Br--,xr++)yr+=er*gr[Br]>>>0,gr[Br]=yr%256>>>0,yr=yr/256>>>0;if(yr!==0)throw new Error("Non-zero carry");wr=xr,hr++}if(k[hr]!==" "){for(var Ar=vr-wr;Ar!==vr&&gr[Ar]===0;)Ar++;for(var Er=new Uint8Array(Sr+(vr-Ar)),Nr=Sr;Ar!==vr;)Er[Nr++]=gr[Ar++];return Er}}}c(Fr,"decodeUnsafe");function Ae(k){var hr=Fr(k);if(hr)return hr;throw new Error(`Non-${f} character`)}return c(Ae,"decode"),{encode:Lr,decodeUnsafe:Fr,decode:Ae}}c(Zf,"base");var qf=Zf,Wf=qf,tf=Wf;var ft=class ft{constructor(f,a,h){Q(this,"name");Q(this,"prefix");Q(this,"baseEncode");this.name=f,this.prefix=a,this.baseEncode=h}encode(f){if(f instanceof Uint8Array)return`${this.prefix}${this.baseEncode(f)}`;throw Error("Unknown type, must be binary type")}};c(ft,"Encoder");var ke=ft,nt=class nt{constructor(f,a,h){Q(this,"name");Q(this,"prefix");Q(this,"baseDecode");Q(this,"prefixCodePoint");this.name=f,this.prefix=a;let d=a.codePointAt(0);if(d===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=d,this.baseDecode=h}decode(f){if(typeof f=="string"){if(f.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(f)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(f.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(f){return ff(this,f)}};c(nt,"Decoder");var rt=nt,ot=class ot{constructor(f){Q(this,"decoders");this.decoders=f}or(f){return ff(this,f)}decode(f){let a=f[0],h=this.decoders[a];if(h!=null)return h.decode(f);throw RangeError(`Unable to decode multibase string ${JSON.stringify(f)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};c(ot,"ComposedDecoder");var et=ot;function ff(o,f){return new et({...o.decoders??{[o.prefix]:o},...f.decoders??{[f.prefix]:f}})}c(ff,"or");var it=class it{constructor(f,a,h,d){Q(this,"name");Q(this,"prefix");Q(this,"baseEncode");Q(this,"baseDecode");Q(this,"encoder");Q(this,"decoder");this.name=f,this.prefix=a,this.baseEncode=h,this.baseDecode=d,this.encoder=new ke(f,a,h),this.decoder=new rt(f,a,d)}encode(f){return this.encoder.encode(f)}decode(f){return this.decoder.decode(f)}};c(it,"Codec");var tt=it;function Zr({name:o,prefix:f,encode:a,decode:h}){return new tt(o,f,a,h)}c(Zr,"from");function Or({name:o,prefix:f,alphabet:a}){let{encode:h,decode:d}=tf(a,o);return Zr({prefix:f,name:o,encode:h,decode:c(v=>Kr(d(v)),"decode")})}c(Or,"baseX");function Jf(o,f,a,h){let d={};for(let lr=0;lr<f.length;++lr)d[f[lr]]=lr;let v=o.length;for(;o[v-1]==="=";)--v;let z=new Uint8Array(v*a/8|0),er=0,ur=0,zr=0;for(let lr=0;lr<v;++lr){let Lr=d[o[lr]];if(Lr===void 0)throw new SyntaxError(`Non-${h} character`);ur=ur<<a|Lr,er+=a,er>=8&&(er-=8,z[zr++]=255&ur>>er)}if(er>=a||(255&ur<<8-er)!==0)throw new SyntaxError("Unexpected end of data");return z}c(Jf,"decode");function Qf(o,f,a){let h=f[f.length-1]==="=",d=(1<<a)-1,v="",z=0,er=0;for(let ur=0;ur<o.length;++ur)for(er=er<<8|o[ur],z+=8;z>a;)z-=a,v+=f[d&er>>z];if(z!==0&&(v+=f[d&er<<a-z]),h)for(;(v.length*a&7)!==0;)v+="=";return v}c(Qf,"encode");function or({name:o,prefix:f,bitsPerChar:a,alphabet:h}){return Zr({prefix:f,name:o,encode(d){return Qf(d,h,a)},decode(d){return Jf(d,h,a,o)}})}c(or,"rfc4648");var kf=Or({prefix:"9",name:"base10",alphabet:"0123456789"});var st={};_r(st,{base16:()=>rn,base16upper:()=>en});var rn=or({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),en=or({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var xt={};_r(xt,{base2:()=>tn});var tn=or({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ct={};_r(ct,{base256emoji:()=>sn});var nf=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),fn=nf.reduce((o,f,a)=>(o[a]=f,o),[]),nn=nf.reduce((o,f,a)=>{let h=f.codePointAt(0);if(h==null)throw new Error(`Invalid character: ${f}`);return o[h]=a,o},[]);function on(o){return o.reduce((f,a)=>(f+=fn[a],f),"")}c(on,"encode");function an(o){let f=[];for(let a of o){let h=a.codePointAt(0);if(h==null)throw new Error(`Invalid character: ${a}`);let d=nn[h];if(d==null)throw new Error(`Non-base256emoji character: ${a}`);f.push(d)}return new Uint8Array(f)}c(an,"decode");var sn=Zr({prefix:"\u{1F680}",name:"base256emoji",encode:on,decode:an});var ut={};_r(ut,{base32:()=>qr,base32hex:()=>hn,base32hexpad:()=>pn,base32hexpadupper:()=>dn,base32hexupper:()=>yn,base32pad:()=>cn,base32padupper:()=>un,base32upper:()=>xn,base32z:()=>bn});var qr=or({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),xn=or({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),cn=or({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),un=or({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),hn=or({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),yn=or({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),pn=or({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),dn=or({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),bn=or({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ht={};_r(ht,{base36:()=>ye,base36upper:()=>ln});var ye=Or({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ln=Or({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var yt={};_r(yt,{base58btc:()=>Mr,base58flickr:()=>gn});var Mr=Or({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),gn=Or({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var pt={};_r(pt,{base64:()=>An,base64pad:()=>wn,base64url:()=>mn,base64urlpad:()=>vn});var An=or({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),wn=or({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),mn=or({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),vn=or({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var dt={};_r(dt,{base8:()=>En});var En=or({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var bt={};_r(bt,{identity:()=>Un});var Un=Zr({prefix:"\0",name:"identity",encode:c(o=>rf(o),"encode"),decode:c(o=>kt(o),"decode")});var xi=new TextEncoder,ci=new TextDecoder;var At={};_r(At,{identity:()=>$n});var Bn=sf,of=128,Cn=127,Tn=~Cn,Mn=Math.pow(2,31);function sf(o,f,a){f=f||[],a=a||0;for(var h=a;o>=Mn;)f[a++]=o&255|of,o/=128;for(;o&Tn;)f[a++]=o&255|of,o>>>=7;return f[a]=o|0,sf.bytes=a-h+1,f}c(sf,"encode");var Pn=lt,Ln=128,af=127;function lt(o,h){var a=0,h=h||0,d=0,v=h,z,er=o.length;do{if(v>=er)throw lt.bytes=0,new RangeError("Could not decode varint");z=o[v++],a+=d<28?(z&af)<<d:(z&af)*Math.pow(2,d),d+=7}while(z>=Ln);return lt.bytes=v-h,a}c(lt,"read");var Dn=Math.pow(2,7),In=Math.pow(2,14),Kn=Math.pow(2,21),Rn=Math.pow(2,28),zn=Math.pow(2,35),Nn=Math.pow(2,42),On=Math.pow(2,49),Yn=Math.pow(2,56),jn=Math.pow(2,63),Hn=c(function(o){return o<Dn?1:o<In?2:o<Kn?3:o<Rn?4:o<zn?5:o<Nn?6:o<On?7:o<Yn?8:o<jn?9:10},"length"),Fn={encode:Bn,decode:Pn,encodingLength:Hn},Gn=Fn,pe=Gn;function de(o,f=0){return[pe.decode(o,f),pe.decode.bytes]}c(de,"decode");function Wr(o,f,a=0){return pe.encode(o,f,a),f}c(Wr,"encodeTo");function Jr(o){return pe.encodingLength(o)}c(Jr,"encodingLength");function Hr(o,f){let a=f.byteLength,h=Jr(o),d=h+Jr(a),v=new Uint8Array(d+a);return Wr(o,v,0),Wr(a,v,h),v.set(f,d),new Qr(o,a,f,v)}c(Hr,"create");function xf(o){let f=Kr(o),[a,h]=de(f),[d,v]=de(f.subarray(h)),z=f.subarray(h+v);if(z.byteLength!==d)throw new Error("Incorrect length");return new Qr(a,d,z,f)}c(xf,"decode");function cf(o,f){if(o===f)return!0;{let a=f;return o.code===a.code&&o.size===a.size&&a.bytes instanceof Uint8Array&&Qt(o.bytes,a.bytes)}}c(cf,"equals");var gt=class gt{constructor(f,a,h,d){Q(this,"code");Q(this,"size");Q(this,"digest");Q(this,"bytes");this.code=f,this.size=a,this.digest=h,this.bytes=d}};c(gt,"Digest");var Qr=gt;var uf=0,Vn="identity",hf=Kr;function Xn(o){return Hr(uf,hf(o))}c(Xn,"digest");var $n={code:uf,name:Vn,encode:hf,digest:Xn};var Et={};_r(Et,{sha256:()=>Zn,sha512:()=>qn});function mt({name:o,code:f,encode:a}){return new wt(o,f,a)}c(mt,"from");var vt=class vt{constructor(f,a,h){Q(this,"name");Q(this,"code");Q(this,"encode");this.name=f,this.code=a,this.encode=h}digest(f){if(f instanceof Uint8Array){let a=this.encode(f);return a instanceof Uint8Array?Hr(this.code,a):a.then(h=>Hr(this.code,h))}else throw Error("Unknown type, must be binary type")}};c(vt,"Hasher");var wt=vt;function pf(o){return async f=>new Uint8Array(await crypto.subtle.digest(o,f))}c(pf,"sha");var Zn=mt({name:"sha2-256",code:18,encode:pf("SHA-256")}),qn=mt({name:"sha2-512",code:19,encode:pf("SHA-512")});function df(o,f){let{bytes:a,version:h}=o;switch(h){case 0:return Jn(a,Ut(o),f??Mr.encoder);default:return Qn(a,Ut(o),f??qr.encoder)}}c(df,"format");var bf=new WeakMap;function Ut(o){let f=bf.get(o);if(f==null){let a=new Map;return bf.set(o,a),a}return f}c(Ut,"baseCache");var gf,cr=class cr{constructor(f,a,h,d){Q(this,"code");Q(this,"version");Q(this,"multihash");Q(this,"bytes");Q(this,"/");Q(this,gf,"CID");this.code=a,this.version=f,this.multihash=h,this.bytes=d,this["/"]=d}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:f,multihash:a}=this;if(f!==le)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(a.code!==kn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return cr.createV0(a)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:f,digest:a}=this.multihash,h=Hr(f,a);return cr.createV1(this.code,h)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(f){return cr.equals(this,f)}static equals(f,a){let h=a;return h!=null&&f.code===h.code&&f.version===h.version&&cf(f.multihash,h.multihash)}toString(f){return df(this,f)}toJSON(){return{"/":df(this)}}link(){return this}[(gf=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(f){if(f==null)return null;let a=f;if(a instanceof cr)return a;if(a["/"]!=null&&a["/"]===a.bytes||a.asCID===a){let{version:h,code:d,multihash:v,bytes:z}=a;return new cr(h,d,v,z??lf(h,d,v.bytes))}else if(a[ro]===!0){let{version:h,multihash:d,code:v}=a,z=xf(d);return cr.create(h,v,z)}else return null}static create(f,a,h){if(typeof a!="number")throw new Error("String codecs are no longer supported");if(!(h.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(f){case 0:{if(a!==le)throw new Error(`Version 0 CID must use dag-pb (code: ${le}) block encoding`);return new cr(f,a,h,h.bytes)}case 1:{let d=lf(f,a,h.bytes);return new cr(f,a,h,d)}default:throw new Error("Invalid version")}}static createV0(f){return cr.create(0,le,f)}static createV1(f,a){return cr.create(1,f,a)}static decode(f){let[a,h]=cr.decodeFirst(f);if(h.length!==0)throw new Error("Incorrect length");return a}static decodeFirst(f){let a=cr.inspectBytes(f),h=a.size-a.multihashSize,d=Kr(f.subarray(h,h+a.multihashSize));if(d.byteLength!==a.multihashSize)throw new Error("Incorrect length");let v=d.subarray(a.multihashSize-a.digestSize),z=new Qr(a.multihashCode,a.digestSize,v,d);return[a.version===0?cr.createV0(z):cr.createV1(a.codec,z),f.subarray(a.size)]}static inspectBytes(f){let a=0,h=c(()=>{let[Lr,Fr]=de(f.subarray(a));return a+=Fr,Lr},"next"),d=h(),v=le;if(d===18?(d=0,a=0):v=h(),d!==0&&d!==1)throw new RangeError(`Invalid CID version ${d}`);let z=a,er=h(),ur=h(),zr=a+ur,lr=zr-z;return{version:d,codec:v,multihashCode:er,digestSize:ur,multihashSize:lr,size:zr}}static parse(f,a){let[h,d]=Wn(f,a),v=cr.decode(d);if(v.version===0&&f[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ut(v).set(h,f),v}};c(cr,"CID");var Pe=cr;function Wn(o,f){switch(o[0]){case"Q":{let a=f??Mr;return[Mr.prefix,a.decode(`${Mr.prefix}${o}`)]}case Mr.prefix:{let a=f??Mr;return[Mr.prefix,a.decode(o)]}case qr.prefix:{let a=f??qr;return[qr.prefix,a.decode(o)]}case ye.prefix:{let a=f??ye;return[ye.prefix,a.decode(o)]}default:{if(f==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],f.decode(o)]}}}c(Wn,"parseCIDtoBytes");function Jn(o,f,a){let{prefix:h}=a;if(h!==Mr.prefix)throw Error(`Cannot string encode V0 in ${a.name} encoding`);let d=f.get(h);if(d==null){let v=a.encode(o).slice(1);return f.set(h,v),v}else return d}c(Jn,"toStringV0");function Qn(o,f,a){let{prefix:h}=a,d=f.get(h);if(d==null){let v=a.encode(o);return f.set(h,v),v}else return d}c(Qn,"toStringV1");var le=112,kn=18;function lf(o,f,a){let h=Jr(o),d=h+Jr(f),v=new Uint8Array(d+a.byteLength);return Wr(o,v,0),Wr(f,v,h),v.set(a,d),v}c(lf,"encodeCID");var ro=Symbol.for("@ipld/js-cid/CID");var _t={...bt,...xt,...dt,...at,...st,...ut,...ht,...yt,...pt,...ct},ji={...Et,...At};function wf(o,f,a,h){return{name:o,prefix:f,encoder:{name:o,prefix:f,encode:a},decoder:{decode:h}}}c(wf,"createCodec");var Af=wf("utf8","u",o=>"u"+new TextDecoder("utf8").decode(o),o=>new TextEncoder().encode(o.substring(1))),St=wf("ascii","a",o=>{let f="a";for(let a=0;a<o.length;a++)f+=String.fromCharCode(o[a]);return f},o=>{o=o.substring(1);let f=Te(o.length);for(let a=0;a<o.length;a++)f[a]=o.charCodeAt(a);return f}),eo={utf8:Af,"utf-8":Af,hex:_t.base16,latin1:St,ascii:St,binary:St,..._t},Le=eo;function Pr(o,f="utf8"){let a=Le[f];if(a==null)throw new Error(`Unsupported encoding "${f}"`);return a.decoder.decode(`${a.prefix}${o}`)}c(Pr,"fromString");function kr(o,f="utf8"){let a=Le[f];if(a==null)throw new Error(`Unsupported encoding "${f}"`);return a.encoder.encode(o).substring(1)}c(kr,"toString");var De="did:key:z";var pa="X25519";var da="X25519";var re="RSA-OAEP",ee="RSASSA-PKCS1-v1_5",Bt="SHA-256",no=new Uint8Array([0,245,2]),ba=2048,Ct="SHA-256",te=8,fe="AES-GCM",ne=fe,ge=256,Ie=12,oo=new Uint8Array([234,1]),io=new Uint8Array([237,1]);var Tt=16;var mf=new Error("Invalid key use. Please use 'encryption' or 'signing"),so=new Error("Max must be less than 256 and greater than 0");function Rr(o){return new Uint8Array(o).buffer}c(Rr,"toArrayBuffer");function oe(o){let f=Pr(o,"base64pad");return Rr(f)}c(oe,"base64ToArrBuf");var Mt=c((o,f)=>{if(typeof o=="string")return f(o);if(typeof o=="object"&&o.byteLength!==void 0)return new Uint8Array(o).buffer;throw new Error("Improper value. Must be a string, ArrayBuffer, Uint8Array")},"normalizeToBuf");function Ke(o){return Mt(o,oe)}c(Ke,"normalizeBase64ToBuf");var xo=c(o=>Mt(o,f=>vf(f,8)),"normalizeUtf8ToBuf");function vf(o,f){let a=f===8?new Uint8Array(o.length):new Uint16Array(o.length);for(let h=0,d=o.length;h<d;h++)a[h]=o.charCodeAt(h);return a.buffer}c(vf,"strToArrBuf");var co=c(o=>Mt(o,f=>vf(f,16)),"normalizeUtf16ToBuf");function ie(o,f){switch(f){case 8:return xo(o);default:return co(o)}}c(ie,"normalizeUnicodeToBuf");var uo={equal:c((o,f)=>{let a=new Uint8Array(o),h=new Uint8Array(f);if(a.length!==h.length)return!1;for(let d=0;d<a.length;d++)if(a[d]!==h[d])return!1;return!0},"equal")};function Ef(o,f){return uo.equal(f,o.slice(0,f.byteLength))}c(Ef,"hasPrefix");function Pt(o){return kr(o instanceof ArrayBuffer?new Uint8Array(o):o,"base64pad")}c(Pt,"toBase64");async function Lt(o,f){let a=typeof o=="string"?oe(o):Rr(o);return ar.subtle.importKey("raw",a,{name:f?.alg||ne,length:f?.length||ge},!0,["encrypt","decrypt"])}c(Lt,"importKey");function Uf(o,{max:f}={max:255}){if(f<1||f>255)throw so;let a=new Uint8Array(o);if(f===255)return ar.getRandomValues(a),a.buffer;let h=0,d=f+1,v=Math.floor(256/d)*d,z=new Uint8Array(1);for(;h<a.length;)ar.getRandomValues(z),z[0]<v&&(a[h]=z[0]%d,h++);return a.buffer}c(Uf,"randomBuf");function _f(o,f){let a=o instanceof ArrayBuffer?new Uint8Array(o):new Uint8Array(Rr(o)),h=f instanceof ArrayBuffer?new Uint8Array(f):new Uint8Array(Rr(f)),d=new Uint8Array(a.length+h.length);return d.set(a),d.set(h,a.length),d.buffer}c(_f,"joinBufs");var Cf=Vf(Bf(),1);var ho={keyTypes:{"bls12-381":{magicBytes:new Uint8Array([234,1]),verify:c(()=>{throw new Error("Not implemented")},"verify")},rsa:{magicBytes:new Uint8Array([0,245,2]),verify:po},ed25519:{magicBytes:new Uint8Array([237,1]),verify:yo}}};async function yo({message:o,publicKey:f,signature:a}){let h=o;typeof o=="string"&&(h=Pr(o,"utf8"));let d=a;typeof a=="string"&&(d=Pr(a,"base64pad"));let v=f;if(typeof f=="string"&&(v=Tf(f).publicKey),console.log("Message length:",h.length),console.log("Signature length:",d.length,"expected: 64"),console.log("Public key length:",v.length,"expected: 32"),v.length!==32)throw new Error(`Invalid Ed25519 public key size: ${v.length} bytes, expected 32`);if(d.length!==64)throw new Error(`Invalid Ed25519 signature size: ${d.length} bytes, expected 64`);return Cf.default.sign.detached.verify(h,d,v)}c(yo,"ed25519Verify");async function po({message:o,publicKey:f,signature:a}){let h=f;return typeof f=="string"&&(h=Tf(f).publicKey),bo.verify(o,a,await ar.subtle.importKey("spki",Rr(h),{name:ee,hash:Bt},!1,["verify"]),8)}c(po,"rsaVerify");var bo={verify:c(async function(f,a,h,d=te,v=Ct){return ar.subtle.verify({name:ee,saltLength:Tt},typeof h=="string"?await Dt(h,v,"signing"):h,Ke(a),ie(f,d))},"rsaVerify"),sign:c(async function(f,a,h=te){return ar.subtle.sign({name:ee,saltLength:Tt},a,ie(f,h))},"sign"),encrypt:c(async function(f,a,h=te,d=Ct){let v;return typeof a=="string"?v=await Dt(a,d,"exchange"):v=a instanceof Uint8Array?await Dt(Rr(a),d,"exchange"):a,ar.subtle.encrypt({name:re},v,ie(f,h))},"rsaEncrypt"),decrypt:c(async function(f,a){let h=ze(a)?a:await wo(a,["decrypt"]),d;typeof f=="string"?d=Pr(f,"base64pad"):d=f;let v=await ar.subtle.decrypt({name:re},h,d instanceof Uint8Array?Rr(d):d);return new Uint8Array(v)},"rsaDecrypt")};async function Dt(o,f,a){lo(a);let h=a==="exchange"?re:ee,d=a==="exchange"?["encrypt"]:["verify"],v=typeof o=="string"?oe(Ao(o)):o;return ar.subtle.importKey("spki",v,{name:h,hash:{name:f}},!0,d)}c(Dt,"importPublicKey");function lo(o){go(o,["signing","exchange"],mf)}c(lo,"checkValidKeyUse");function go(o,f,a){if(!f.some(d=>d===o))throw a}c(go,"checkValid");function Ao(o){return o.replace(`-----BEGIN PUBLIC KEY-----
|
|
1
|
+
var Nf=Object.create;var he=Object.defineProperty;var Of=Object.getOwnPropertyDescriptor;var Yf=Object.getOwnPropertyNames;var jf=Object.getPrototypeOf,Hf=Object.prototype.hasOwnProperty;var Ff=(o,f,a)=>f in o?he(o,f,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[f]=a;var c=(o,f)=>he(o,"name",{value:f,configurable:!0}),Wt=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(f,a)=>(typeof require<"u"?require:f)[a]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var Jt=(o,f)=>()=>(f||o((f={exports:{}}).exports,f),f.exports),_r=(o,f)=>{for(var a in f)he(o,a,{get:f[a],enumerable:!0})},Gf=(o,f,a,h)=>{if(f&&typeof f=="object"||typeof f=="function")for(let d of Yf(f))!Hf.call(o,d)&&d!==a&&he(o,d,{get:()=>f[d],enumerable:!(h=Of(f,d))||h.enumerable});return o};var Vf=(o,f,a)=>(a=o!=null?Nf(jf(o)):{},Gf(f||!o||!o.__esModule?he(a,"default",{value:o,enumerable:!0}):a,o));var Q=(o,f,a)=>Ff(o,typeof f!="symbol"?f+"":f,a);var Sf=Jt(()=>{"use strict"});var Bf=Jt((Ca,Re)=>{"use strict";(function(o){"use strict";var f=c(function(e){var n,t=new Float64Array(16);if(e)for(n=0;n<e.length;n++)t[n]=e[n];return t},"gf"),a=c(function(){throw new Error("no PRNG")},"randombytes"),h=new Uint8Array(16),d=new Uint8Array(32);d[0]=9;var v=f(),z=f([1]),er=f([56129,1]),ur=f([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),zr=f([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),lr=f([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Pr=f([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Fr=f([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ae(e,n,t,r){e[n]=t>>24&255,e[n+1]=t>>16&255,e[n+2]=t>>8&255,e[n+3]=t&255,e[n+4]=r>>24&255,e[n+5]=r>>16&255,e[n+6]=r>>8&255,e[n+7]=r&255}c(Ae,"ts64");function k(e,n,t,r,i){var x,u=0;for(x=0;x<i;x++)u|=e[n+x]^t[r+x];return(1&u-1>>>8)-1}c(k,"vn");function hr(e,n,t,r){return k(e,n,t,r,16)}c(hr,"crypto_verify_16");function Sr(e,n,t,r){return k(e,n,t,r,32)}c(Sr,"crypto_verify_32");function wr(e,n,t,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,u=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,l=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,m=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,M=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,U=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,q=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,S=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,D=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,I=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,Y=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,O=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,K=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,N=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,R=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,B=i,L=x,_=u,C=l,T=m,E=M,y=U,p=q,A=S,b=D,g=I,w=Y,P=O,j=K,F=N,H=R,s,V=0;V<20;V+=2)s=B+P|0,T^=s<<7|s>>>25,s=T+B|0,A^=s<<9|s>>>23,s=A+T|0,P^=s<<13|s>>>19,s=P+A|0,B^=s<<18|s>>>14,s=E+L|0,b^=s<<7|s>>>25,s=b+E|0,j^=s<<9|s>>>23,s=j+b|0,L^=s<<13|s>>>19,s=L+j|0,E^=s<<18|s>>>14,s=g+y|0,F^=s<<7|s>>>25,s=F+g|0,_^=s<<9|s>>>23,s=_+F|0,y^=s<<13|s>>>19,s=y+_|0,g^=s<<18|s>>>14,s=H+w|0,C^=s<<7|s>>>25,s=C+H|0,p^=s<<9|s>>>23,s=p+C|0,w^=s<<13|s>>>19,s=w+p|0,H^=s<<18|s>>>14,s=B+C|0,L^=s<<7|s>>>25,s=L+B|0,_^=s<<9|s>>>23,s=_+L|0,C^=s<<13|s>>>19,s=C+_|0,B^=s<<18|s>>>14,s=E+T|0,y^=s<<7|s>>>25,s=y+E|0,p^=s<<9|s>>>23,s=p+y|0,T^=s<<13|s>>>19,s=T+p|0,E^=s<<18|s>>>14,s=g+b|0,w^=s<<7|s>>>25,s=w+g|0,A^=s<<9|s>>>23,s=A+w|0,b^=s<<13|s>>>19,s=b+A|0,g^=s<<18|s>>>14,s=H+F|0,P^=s<<7|s>>>25,s=P+H|0,j^=s<<9|s>>>23,s=j+P|0,F^=s<<13|s>>>19,s=F+j|0,H^=s<<18|s>>>14;B=B+i|0,L=L+x|0,_=_+u|0,C=C+l|0,T=T+m|0,E=E+M|0,y=y+U|0,p=p+q|0,A=A+S|0,b=b+D|0,g=g+I|0,w=w+Y|0,P=P+O|0,j=j+K|0,F=F+N|0,H=H+R|0,e[0]=B>>>0&255,e[1]=B>>>8&255,e[2]=B>>>16&255,e[3]=B>>>24&255,e[4]=L>>>0&255,e[5]=L>>>8&255,e[6]=L>>>16&255,e[7]=L>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=T>>>0&255,e[17]=T>>>8&255,e[18]=T>>>16&255,e[19]=T>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=y>>>0&255,e[25]=y>>>8&255,e[26]=y>>>16&255,e[27]=y>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255,e[32]=A>>>0&255,e[33]=A>>>8&255,e[34]=A>>>16&255,e[35]=A>>>24&255,e[36]=b>>>0&255,e[37]=b>>>8&255,e[38]=b>>>16&255,e[39]=b>>>24&255,e[40]=g>>>0&255,e[41]=g>>>8&255,e[42]=g>>>16&255,e[43]=g>>>24&255,e[44]=w>>>0&255,e[45]=w>>>8&255,e[46]=w>>>16&255,e[47]=w>>>24&255,e[48]=P>>>0&255,e[49]=P>>>8&255,e[50]=P>>>16&255,e[51]=P>>>24&255,e[52]=j>>>0&255,e[53]=j>>>8&255,e[54]=j>>>16&255,e[55]=j>>>24&255,e[56]=F>>>0&255,e[57]=F>>>8&255,e[58]=F>>>16&255,e[59]=F>>>24&255,e[60]=H>>>0&255,e[61]=H>>>8&255,e[62]=H>>>16&255,e[63]=H>>>24&255}c(wr,"core_salsa20");function vr(e,n,t,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,u=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,l=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,m=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,M=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,U=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,q=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,S=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,D=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,I=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,Y=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,O=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,K=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,N=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,R=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,B=i,L=x,_=u,C=l,T=m,E=M,y=U,p=q,A=S,b=D,g=I,w=Y,P=O,j=K,F=N,H=R,s,V=0;V<20;V+=2)s=B+P|0,T^=s<<7|s>>>25,s=T+B|0,A^=s<<9|s>>>23,s=A+T|0,P^=s<<13|s>>>19,s=P+A|0,B^=s<<18|s>>>14,s=E+L|0,b^=s<<7|s>>>25,s=b+E|0,j^=s<<9|s>>>23,s=j+b|0,L^=s<<13|s>>>19,s=L+j|0,E^=s<<18|s>>>14,s=g+y|0,F^=s<<7|s>>>25,s=F+g|0,_^=s<<9|s>>>23,s=_+F|0,y^=s<<13|s>>>19,s=y+_|0,g^=s<<18|s>>>14,s=H+w|0,C^=s<<7|s>>>25,s=C+H|0,p^=s<<9|s>>>23,s=p+C|0,w^=s<<13|s>>>19,s=w+p|0,H^=s<<18|s>>>14,s=B+C|0,L^=s<<7|s>>>25,s=L+B|0,_^=s<<9|s>>>23,s=_+L|0,C^=s<<13|s>>>19,s=C+_|0,B^=s<<18|s>>>14,s=E+T|0,y^=s<<7|s>>>25,s=y+E|0,p^=s<<9|s>>>23,s=p+y|0,T^=s<<13|s>>>19,s=T+p|0,E^=s<<18|s>>>14,s=g+b|0,w^=s<<7|s>>>25,s=w+g|0,A^=s<<9|s>>>23,s=A+w|0,b^=s<<13|s>>>19,s=b+A|0,g^=s<<18|s>>>14,s=H+F|0,P^=s<<7|s>>>25,s=P+H|0,j^=s<<9|s>>>23,s=j+P|0,F^=s<<13|s>>>19,s=F+j|0,H^=s<<18|s>>>14;e[0]=B>>>0&255,e[1]=B>>>8&255,e[2]=B>>>16&255,e[3]=B>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=g>>>0&255,e[9]=g>>>8&255,e[10]=g>>>16&255,e[11]=g>>>24&255,e[12]=H>>>0&255,e[13]=H>>>8&255,e[14]=H>>>16&255,e[15]=H>>>24&255,e[16]=y>>>0&255,e[17]=y>>>8&255,e[18]=y>>>16&255,e[19]=y>>>24&255,e[20]=p>>>0&255,e[21]=p>>>8&255,e[22]=p>>>16&255,e[23]=p>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=b>>>0&255,e[29]=b>>>8&255,e[30]=b>>>16&255,e[31]=b>>>24&255}c(vr,"core_hsalsa20");function gr(e,n,t,r){wr(e,n,t,r)}c(gr,"crypto_core_salsa20");function yr(e,n,t,r){vr(e,n,t,r)}c(yr,"crypto_core_hsalsa20");var xr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Br(e,n,t,r,i,x,u){var l=new Uint8Array(16),m=new Uint8Array(64),M,U;for(U=0;U<16;U++)l[U]=0;for(U=0;U<8;U++)l[U]=x[U];for(;i>=64;){for(gr(m,l,u,xr),U=0;U<64;U++)e[n+U]=t[r+U]^m[U];for(M=1,U=8;U<16;U++)M=M+(l[U]&255)|0,l[U]=M&255,M>>>=8;i-=64,n+=64,r+=64}if(i>0)for(gr(m,l,u,xr),U=0;U<i;U++)e[n+U]=t[r+U]^m[U];return 0}c(Br,"crypto_stream_salsa20_xor");function Ar(e,n,t,r,i){var x=new Uint8Array(16),u=new Uint8Array(64),l,m;for(m=0;m<16;m++)x[m]=0;for(m=0;m<8;m++)x[m]=r[m];for(;t>=64;){for(gr(u,x,i,xr),m=0;m<64;m++)e[n+m]=u[m];for(l=1,m=8;m<16;m++)l=l+(x[m]&255)|0,x[m]=l&255,l>>>=8;t-=64,n+=64}if(t>0)for(gr(u,x,i,xr),m=0;m<t;m++)e[n+m]=u[m];return 0}c(Ar,"crypto_stream_salsa20");function Er(e,n,t,r,i){var x=new Uint8Array(32);yr(x,r,i,xr);for(var u=new Uint8Array(8),l=0;l<8;l++)u[l]=r[l+16];return Ar(e,n,t,u,x)}c(Er,"crypto_stream");function Nr(e,n,t,r,i,x,u){var l=new Uint8Array(32);yr(l,x,u,xr);for(var m=new Uint8Array(8),M=0;M<8;M++)m[M]=x[M+16];return Br(e,n,t,r,i,m,l)}c(Nr,"crypto_stream_xor");var we=c(function(e){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var n,t,r,i,x,u,l,m;n=e[0]&255|(e[1]&255)<<8,this.r[0]=n&8191,t=e[2]&255|(e[3]&255)<<8,this.r[1]=(n>>>13|t<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(t>>>10|r<<6)&7939,i=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|i<<9)&8191,x=e[8]&255|(e[9]&255)<<8,this.r[4]=(i>>>4|x<<12)&255,this.r[5]=x>>>1&8190,u=e[10]&255|(e[11]&255)<<8,this.r[6]=(x>>>14|u<<2)&8191,l=e[12]&255|(e[13]&255)<<8,this.r[7]=(u>>>11|l<<5)&8065,m=e[14]&255|(e[15]&255)<<8,this.r[8]=(l>>>8|m<<8)&8191,this.r[9]=m>>>5&127,this.pad[0]=e[16]&255|(e[17]&255)<<8,this.pad[1]=e[18]&255|(e[19]&255)<<8,this.pad[2]=e[20]&255|(e[21]&255)<<8,this.pad[3]=e[22]&255|(e[23]&255)<<8,this.pad[4]=e[24]&255|(e[25]&255)<<8,this.pad[5]=e[26]&255|(e[27]&255)<<8,this.pad[6]=e[28]&255|(e[29]&255)<<8,this.pad[7]=e[30]&255|(e[31]&255)<<8},"poly1305");we.prototype.blocks=function(e,n,t){for(var r=this.fin?0:2048,i,x,u,l,m,M,U,q,S,D,I,Y,O,K,N,R,B,L,_,C=this.h[0],T=this.h[1],E=this.h[2],y=this.h[3],p=this.h[4],A=this.h[5],b=this.h[6],g=this.h[7],w=this.h[8],P=this.h[9],j=this.r[0],F=this.r[1],H=this.r[2],s=this.r[3],V=this.r[4],W=this.r[5],J=this.r[6],G=this.r[7],$=this.r[8],Z=this.r[9];t>=16;)i=e[n+0]&255|(e[n+1]&255)<<8,C+=i&8191,x=e[n+2]&255|(e[n+3]&255)<<8,T+=(i>>>13|x<<3)&8191,u=e[n+4]&255|(e[n+5]&255)<<8,E+=(x>>>10|u<<6)&8191,l=e[n+6]&255|(e[n+7]&255)<<8,y+=(u>>>7|l<<9)&8191,m=e[n+8]&255|(e[n+9]&255)<<8,p+=(l>>>4|m<<12)&8191,A+=m>>>1&8191,M=e[n+10]&255|(e[n+11]&255)<<8,b+=(m>>>14|M<<2)&8191,U=e[n+12]&255|(e[n+13]&255)<<8,g+=(M>>>11|U<<5)&8191,q=e[n+14]&255|(e[n+15]&255)<<8,w+=(U>>>8|q<<8)&8191,P+=q>>>5|r,S=0,D=S,D+=C*j,D+=T*(5*Z),D+=E*(5*$),D+=y*(5*G),D+=p*(5*J),S=D>>>13,D&=8191,D+=A*(5*W),D+=b*(5*V),D+=g*(5*s),D+=w*(5*H),D+=P*(5*F),S+=D>>>13,D&=8191,I=S,I+=C*F,I+=T*j,I+=E*(5*Z),I+=y*(5*$),I+=p*(5*G),S=I>>>13,I&=8191,I+=A*(5*J),I+=b*(5*W),I+=g*(5*V),I+=w*(5*s),I+=P*(5*H),S+=I>>>13,I&=8191,Y=S,Y+=C*H,Y+=T*F,Y+=E*j,Y+=y*(5*Z),Y+=p*(5*$),S=Y>>>13,Y&=8191,Y+=A*(5*G),Y+=b*(5*J),Y+=g*(5*W),Y+=w*(5*V),Y+=P*(5*s),S+=Y>>>13,Y&=8191,O=S,O+=C*s,O+=T*H,O+=E*F,O+=y*j,O+=p*(5*Z),S=O>>>13,O&=8191,O+=A*(5*$),O+=b*(5*G),O+=g*(5*J),O+=w*(5*W),O+=P*(5*V),S+=O>>>13,O&=8191,K=S,K+=C*V,K+=T*s,K+=E*H,K+=y*F,K+=p*j,S=K>>>13,K&=8191,K+=A*(5*Z),K+=b*(5*$),K+=g*(5*G),K+=w*(5*J),K+=P*(5*W),S+=K>>>13,K&=8191,N=S,N+=C*W,N+=T*V,N+=E*s,N+=y*H,N+=p*F,S=N>>>13,N&=8191,N+=A*j,N+=b*(5*Z),N+=g*(5*$),N+=w*(5*G),N+=P*(5*J),S+=N>>>13,N&=8191,R=S,R+=C*J,R+=T*W,R+=E*V,R+=y*s,R+=p*H,S=R>>>13,R&=8191,R+=A*F,R+=b*j,R+=g*(5*Z),R+=w*(5*$),R+=P*(5*G),S+=R>>>13,R&=8191,B=S,B+=C*G,B+=T*J,B+=E*W,B+=y*V,B+=p*s,S=B>>>13,B&=8191,B+=A*H,B+=b*F,B+=g*j,B+=w*(5*Z),B+=P*(5*$),S+=B>>>13,B&=8191,L=S,L+=C*$,L+=T*G,L+=E*J,L+=y*W,L+=p*V,S=L>>>13,L&=8191,L+=A*s,L+=b*H,L+=g*F,L+=w*j,L+=P*(5*Z),S+=L>>>13,L&=8191,_=S,_+=C*Z,_+=T*$,_+=E*G,_+=y*J,_+=p*W,S=_>>>13,_&=8191,_+=A*V,_+=b*s,_+=g*H,_+=w*F,_+=P*j,S+=_>>>13,_&=8191,S=(S<<2)+S|0,S=S+D|0,D=S&8191,S=S>>>13,I+=S,C=D,T=I,E=Y,y=O,p=K,A=N,b=R,g=B,w=L,P=_,n+=16,t-=16;this.h[0]=C,this.h[1]=T,this.h[2]=E,this.h[3]=y,this.h[4]=p,this.h[5]=A,this.h[6]=b,this.h[7]=g,this.h[8]=w,this.h[9]=P},we.prototype.finish=function(e,n){var t=new Uint16Array(10),r,i,x,u;if(this.leftover){for(u=this.leftover,this.buffer[u++]=1;u<16;u++)this.buffer[u]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,u=2;u<10;u++)this.h[u]+=r,r=this.h[u]>>>13,this.h[u]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,t[0]=this.h[0]+5,r=t[0]>>>13,t[0]&=8191,u=1;u<10;u++)t[u]=this.h[u]+r,r=t[u]>>>13,t[u]&=8191;for(t[9]-=8192,i=(r^1)-1,u=0;u<10;u++)t[u]&=i;for(i=~i,u=0;u<10;u++)this.h[u]=this.h[u]&i|t[u];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,x=this.h[0]+this.pad[0],this.h[0]=x&65535,u=1;u<8;u++)x=(this.h[u]+this.pad[u]|0)+(x>>>16)|0,this.h[u]=x&65535;e[n+0]=this.h[0]>>>0&255,e[n+1]=this.h[0]>>>8&255,e[n+2]=this.h[1]>>>0&255,e[n+3]=this.h[1]>>>8&255,e[n+4]=this.h[2]>>>0&255,e[n+5]=this.h[2]>>>8&255,e[n+6]=this.h[3]>>>0&255,e[n+7]=this.h[3]>>>8&255,e[n+8]=this.h[4]>>>0&255,e[n+9]=this.h[4]>>>8&255,e[n+10]=this.h[5]>>>0&255,e[n+11]=this.h[5]>>>8&255,e[n+12]=this.h[6]>>>0&255,e[n+13]=this.h[6]>>>8&255,e[n+14]=this.h[7]>>>0&255,e[n+15]=this.h[7]>>>8&255},we.prototype.update=function(e,n,t){var r,i;if(this.leftover){for(i=16-this.leftover,i>t&&(i=t),r=0;r<i;r++)this.buffer[this.leftover+r]=e[n+r];if(t-=i,n+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(t>=16&&(i=t-t%16,this.blocks(e,n,i),n+=i,t-=i),t){for(r=0;r<t;r++)this.buffer[this.leftover+r]=e[n+r];this.leftover+=t}};function Ne(e,n,t,r,i,x){var u=new we(x);return u.update(t,r,i),u.finish(e,n),0}c(Ne,"crypto_onetimeauth");function Rt(e,n,t,r,i,x){var u=new Uint8Array(16);return Ne(u,0,t,r,i,x),hr(e,n,u,0)}c(Rt,"crypto_onetimeauth_verify");function Oe(e,n,t,r,i){var x;if(t<32)return-1;for(Nr(e,0,n,0,t,r,i),Ne(e,16,e,32,t-32,e),x=0;x<16;x++)e[x]=0;return 0}c(Oe,"crypto_secretbox");function Ye(e,n,t,r,i){var x,u=new Uint8Array(32);if(t<32||(Er(u,0,32,r,i),Rt(n,16,n,32,t-32,u)!==0))return-1;for(Nr(e,0,n,0,t,r,i),x=0;x<32;x++)e[x]=0;return 0}c(Ye,"crypto_secretbox_open");function Dr(e,n){var t;for(t=0;t<16;t++)e[t]=n[t]|0}c(Dr,"set25519");function je(e){var n,t,r=1;for(n=0;n<16;n++)t=e[n]+r+65535,r=Math.floor(t/65536),e[n]=t-r*65536;e[0]+=r-1+37*(r-1)}c(je,"car25519");function Gr(e,n,t){for(var r,i=~(t-1),x=0;x<16;x++)r=i&(e[x]^n[x]),e[x]^=r,n[x]^=r}c(Gr,"sel25519");function Vr(e,n){var t,r,i,x=f(),u=f();for(t=0;t<16;t++)u[t]=n[t];for(je(u),je(u),je(u),r=0;r<2;r++){for(x[0]=u[0]-65517,t=1;t<15;t++)x[t]=u[t]-65535-(x[t-1]>>16&1),x[t-1]&=65535;x[15]=u[15]-32767-(x[14]>>16&1),i=x[15]>>16&1,x[14]&=65535,Gr(u,x,1-i)}for(t=0;t<16;t++)e[2*t]=u[t]&255,e[2*t+1]=u[t]>>8}c(Vr,"pack25519");function zt(e,n){var t=new Uint8Array(32),r=new Uint8Array(32);return Vr(t,e),Vr(r,n),Sr(t,0,r,0)}c(zt,"neq25519");function Nt(e){var n=new Uint8Array(32);return Vr(n,e),n[0]&1}c(Nt,"par25519");function He(e,n){var t;for(t=0;t<16;t++)e[t]=n[2*t]+(n[2*t+1]<<8);e[15]&=32767}c(He,"unpack25519");function Cr(e,n,t){for(var r=0;r<16;r++)e[r]=n[r]+t[r]}c(Cr,"A");function Tr(e,n,t){for(var r=0;r<16;r++)e[r]=n[r]-t[r]}c(Tr,"Z");function X(e,n,t){var r,i,x=0,u=0,l=0,m=0,M=0,U=0,q=0,S=0,D=0,I=0,Y=0,O=0,K=0,N=0,R=0,B=0,L=0,_=0,C=0,T=0,E=0,y=0,p=0,A=0,b=0,g=0,w=0,P=0,j=0,F=0,H=0,s=t[0],V=t[1],W=t[2],J=t[3],G=t[4],$=t[5],Z=t[6],ir=t[7],rr=t[8],tr=t[9],fr=t[10],nr=t[11],sr=t[12],pr=t[13],dr=t[14],br=t[15];r=n[0],x+=r*s,u+=r*V,l+=r*W,m+=r*J,M+=r*G,U+=r*$,q+=r*Z,S+=r*ir,D+=r*rr,I+=r*tr,Y+=r*fr,O+=r*nr,K+=r*sr,N+=r*pr,R+=r*dr,B+=r*br,r=n[1],u+=r*s,l+=r*V,m+=r*W,M+=r*J,U+=r*G,q+=r*$,S+=r*Z,D+=r*ir,I+=r*rr,Y+=r*tr,O+=r*fr,K+=r*nr,N+=r*sr,R+=r*pr,B+=r*dr,L+=r*br,r=n[2],l+=r*s,m+=r*V,M+=r*W,U+=r*J,q+=r*G,S+=r*$,D+=r*Z,I+=r*ir,Y+=r*rr,O+=r*tr,K+=r*fr,N+=r*nr,R+=r*sr,B+=r*pr,L+=r*dr,_+=r*br,r=n[3],m+=r*s,M+=r*V,U+=r*W,q+=r*J,S+=r*G,D+=r*$,I+=r*Z,Y+=r*ir,O+=r*rr,K+=r*tr,N+=r*fr,R+=r*nr,B+=r*sr,L+=r*pr,_+=r*dr,C+=r*br,r=n[4],M+=r*s,U+=r*V,q+=r*W,S+=r*J,D+=r*G,I+=r*$,Y+=r*Z,O+=r*ir,K+=r*rr,N+=r*tr,R+=r*fr,B+=r*nr,L+=r*sr,_+=r*pr,C+=r*dr,T+=r*br,r=n[5],U+=r*s,q+=r*V,S+=r*W,D+=r*J,I+=r*G,Y+=r*$,O+=r*Z,K+=r*ir,N+=r*rr,R+=r*tr,B+=r*fr,L+=r*nr,_+=r*sr,C+=r*pr,T+=r*dr,E+=r*br,r=n[6],q+=r*s,S+=r*V,D+=r*W,I+=r*J,Y+=r*G,O+=r*$,K+=r*Z,N+=r*ir,R+=r*rr,B+=r*tr,L+=r*fr,_+=r*nr,C+=r*sr,T+=r*pr,E+=r*dr,y+=r*br,r=n[7],S+=r*s,D+=r*V,I+=r*W,Y+=r*J,O+=r*G,K+=r*$,N+=r*Z,R+=r*ir,B+=r*rr,L+=r*tr,_+=r*fr,C+=r*nr,T+=r*sr,E+=r*pr,y+=r*dr,p+=r*br,r=n[8],D+=r*s,I+=r*V,Y+=r*W,O+=r*J,K+=r*G,N+=r*$,R+=r*Z,B+=r*ir,L+=r*rr,_+=r*tr,C+=r*fr,T+=r*nr,E+=r*sr,y+=r*pr,p+=r*dr,A+=r*br,r=n[9],I+=r*s,Y+=r*V,O+=r*W,K+=r*J,N+=r*G,R+=r*$,B+=r*Z,L+=r*ir,_+=r*rr,C+=r*tr,T+=r*fr,E+=r*nr,y+=r*sr,p+=r*pr,A+=r*dr,b+=r*br,r=n[10],Y+=r*s,O+=r*V,K+=r*W,N+=r*J,R+=r*G,B+=r*$,L+=r*Z,_+=r*ir,C+=r*rr,T+=r*tr,E+=r*fr,y+=r*nr,p+=r*sr,A+=r*pr,b+=r*dr,g+=r*br,r=n[11],O+=r*s,K+=r*V,N+=r*W,R+=r*J,B+=r*G,L+=r*$,_+=r*Z,C+=r*ir,T+=r*rr,E+=r*tr,y+=r*fr,p+=r*nr,A+=r*sr,b+=r*pr,g+=r*dr,w+=r*br,r=n[12],K+=r*s,N+=r*V,R+=r*W,B+=r*J,L+=r*G,_+=r*$,C+=r*Z,T+=r*ir,E+=r*rr,y+=r*tr,p+=r*fr,A+=r*nr,b+=r*sr,g+=r*pr,w+=r*dr,P+=r*br,r=n[13],N+=r*s,R+=r*V,B+=r*W,L+=r*J,_+=r*G,C+=r*$,T+=r*Z,E+=r*ir,y+=r*rr,p+=r*tr,A+=r*fr,b+=r*nr,g+=r*sr,w+=r*pr,P+=r*dr,j+=r*br,r=n[14],R+=r*s,B+=r*V,L+=r*W,_+=r*J,C+=r*G,T+=r*$,E+=r*Z,y+=r*ir,p+=r*rr,A+=r*tr,b+=r*fr,g+=r*nr,w+=r*sr,P+=r*pr,j+=r*dr,F+=r*br,r=n[15],B+=r*s,L+=r*V,_+=r*W,C+=r*J,T+=r*G,E+=r*$,y+=r*Z,p+=r*ir,A+=r*rr,b+=r*tr,g+=r*fr,w+=r*nr,P+=r*sr,j+=r*pr,F+=r*dr,H+=r*br,x+=38*L,u+=38*_,l+=38*C,m+=38*T,M+=38*E,U+=38*y,q+=38*p,S+=38*A,D+=38*b,I+=38*g,Y+=38*w,O+=38*P,K+=38*j,N+=38*F,R+=38*H,i=1,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=M+i+65535,i=Math.floor(r/65536),M=r-i*65536,r=U+i+65535,i=Math.floor(r/65536),U=r-i*65536,r=q+i+65535,i=Math.floor(r/65536),q=r-i*65536,r=S+i+65535,i=Math.floor(r/65536),S=r-i*65536,r=D+i+65535,i=Math.floor(r/65536),D=r-i*65536,r=I+i+65535,i=Math.floor(r/65536),I=r-i*65536,r=Y+i+65535,i=Math.floor(r/65536),Y=r-i*65536,r=O+i+65535,i=Math.floor(r/65536),O=r-i*65536,r=K+i+65535,i=Math.floor(r/65536),K=r-i*65536,r=N+i+65535,i=Math.floor(r/65536),N=r-i*65536,r=R+i+65535,i=Math.floor(r/65536),R=r-i*65536,r=B+i+65535,i=Math.floor(r/65536),B=r-i*65536,x+=i-1+37*(i-1),i=1,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=M+i+65535,i=Math.floor(r/65536),M=r-i*65536,r=U+i+65535,i=Math.floor(r/65536),U=r-i*65536,r=q+i+65535,i=Math.floor(r/65536),q=r-i*65536,r=S+i+65535,i=Math.floor(r/65536),S=r-i*65536,r=D+i+65535,i=Math.floor(r/65536),D=r-i*65536,r=I+i+65535,i=Math.floor(r/65536),I=r-i*65536,r=Y+i+65535,i=Math.floor(r/65536),Y=r-i*65536,r=O+i+65535,i=Math.floor(r/65536),O=r-i*65536,r=K+i+65535,i=Math.floor(r/65536),K=r-i*65536,r=N+i+65535,i=Math.floor(r/65536),N=r-i*65536,r=R+i+65535,i=Math.floor(r/65536),R=r-i*65536,r=B+i+65535,i=Math.floor(r/65536),B=r-i*65536,x+=i-1+37*(i-1),e[0]=x,e[1]=u,e[2]=l,e[3]=m,e[4]=M,e[5]=U,e[6]=q,e[7]=S,e[8]=D,e[9]=I,e[10]=Y,e[11]=O,e[12]=K,e[13]=N,e[14]=R,e[15]=B}c(X,"M");function Ur(e,n){X(e,n,n)}c(Ur,"S");function Ot(e,n){var t=f(),r;for(r=0;r<16;r++)t[r]=n[r];for(r=253;r>=0;r--)Ur(t,t),r!==2&&r!==4&&X(t,t,n);for(r=0;r<16;r++)e[r]=t[r]}c(Ot,"inv25519");function Yt(e,n){var t=f(),r;for(r=0;r<16;r++)t[r]=n[r];for(r=250;r>=0;r--)Ur(t,t),r!==1&&X(t,t,n);for(r=0;r<16;r++)e[r]=t[r]}c(Yt,"pow2523");function me(e,n,t){var r=new Uint8Array(32),i=new Float64Array(80),x,u,l=f(),m=f(),M=f(),U=f(),q=f(),S=f();for(u=0;u<31;u++)r[u]=n[u];for(r[31]=n[31]&127|64,r[0]&=248,He(i,t),u=0;u<16;u++)m[u]=i[u],U[u]=l[u]=M[u]=0;for(l[0]=U[0]=1,u=254;u>=0;--u)x=r[u>>>3]>>>(u&7)&1,Gr(l,m,x),Gr(M,U,x),Cr(q,l,M),Tr(l,l,M),Cr(M,m,U),Tr(m,m,U),Ur(U,q),Ur(S,l),X(l,M,l),X(M,m,q),Cr(q,l,M),Tr(l,l,M),Ur(m,l),Tr(M,U,S),X(l,M,er),Cr(l,l,U),X(M,M,l),X(l,U,S),X(U,m,i),Ur(m,q),Gr(l,m,x),Gr(M,U,x);for(u=0;u<16;u++)i[u+16]=l[u],i[u+32]=M[u],i[u+48]=m[u],i[u+64]=U[u];var D=i.subarray(32),I=i.subarray(16);return Ot(D,D),X(I,I,D),Vr(e,I),0}c(me,"crypto_scalarmult");function ve(e,n){return me(e,n,d)}c(ve,"crypto_scalarmult_base");function jt(e,n){return a(n,32),ve(e,n)}c(jt,"crypto_box_keypair");function Ee(e,n,t){var r=new Uint8Array(32);return me(r,t,n),yr(e,h,r,xr)}c(Ee,"crypto_box_beforenm");var Ht=Oe,Lf=Ye;function Pf(e,n,t,r,i,x){var u=new Uint8Array(32);return Ee(u,i,x),Ht(e,n,t,r,u)}c(Pf,"crypto_box");function Df(e,n,t,r,i,x){var u=new Uint8Array(32);return Ee(u,i,x),Lf(e,n,t,r,u)}c(Df,"crypto_box_open");var Ft=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Gt(e,n,t,r){for(var i=new Int32Array(16),x=new Int32Array(16),u,l,m,M,U,q,S,D,I,Y,O,K,N,R,B,L,_,C,T,E,y,p,A,b,g,w,P=e[0],j=e[1],F=e[2],H=e[3],s=e[4],V=e[5],W=e[6],J=e[7],G=n[0],$=n[1],Z=n[2],ir=n[3],rr=n[4],tr=n[5],fr=n[6],nr=n[7],sr=0;r>=128;){for(T=0;T<16;T++)E=8*T+sr,i[T]=t[E+0]<<24|t[E+1]<<16|t[E+2]<<8|t[E+3],x[T]=t[E+4]<<24|t[E+5]<<16|t[E+6]<<8|t[E+7];for(T=0;T<80;T++)if(u=P,l=j,m=F,M=H,U=s,q=V,S=W,D=J,I=G,Y=$,O=Z,K=ir,N=rr,R=tr,B=fr,L=nr,y=J,p=nr,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=(s>>>14|rr<<18)^(s>>>18|rr<<14)^(rr>>>9|s<<23),p=(rr>>>14|s<<18)^(rr>>>18|s<<14)^(s>>>9|rr<<23),A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,y=s&V^~s&W,p=rr&tr^~rr&fr,A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,y=Ft[T*2],p=Ft[T*2+1],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,y=i[T%16],p=x[T%16],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,_=g&65535|w<<16,C=A&65535|b<<16,y=_,p=C,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=(P>>>28|G<<4)^(G>>>2|P<<30)^(G>>>7|P<<25),p=(G>>>28|P<<4)^(P>>>2|G<<30)^(P>>>7|G<<25),A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,y=P&j^P&F^j&F,p=G&$^G&Z^$&Z,A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,D=g&65535|w<<16,L=A&65535|b<<16,y=M,p=K,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=_,p=C,A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,M=g&65535|w<<16,K=A&65535|b<<16,j=u,F=l,H=m,s=M,V=U,W=q,J=S,P=D,$=I,Z=Y,ir=O,rr=K,tr=N,fr=R,nr=B,G=L,T%16===15)for(E=0;E<16;E++)y=i[E],p=x[E],A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=i[(E+9)%16],p=x[(E+9)%16],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,_=i[(E+1)%16],C=x[(E+1)%16],y=(_>>>1|C<<31)^(_>>>8|C<<24)^_>>>7,p=(C>>>1|_<<31)^(C>>>8|_<<24)^(C>>>7|_<<25),A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,_=i[(E+14)%16],C=x[(E+14)%16],y=(_>>>19|C<<13)^(C>>>29|_<<3)^_>>>6,p=(C>>>19|_<<13)^(_>>>29|C<<3)^(C>>>6|_<<26),A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,i[E]=g&65535|w<<16,x[E]=A&65535|b<<16;y=P,p=G,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[0],p=n[0],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[0]=P=g&65535|w<<16,n[0]=G=A&65535|b<<16,y=j,p=$,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[1],p=n[1],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[1]=j=g&65535|w<<16,n[1]=$=A&65535|b<<16,y=F,p=Z,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[2],p=n[2],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[2]=F=g&65535|w<<16,n[2]=Z=A&65535|b<<16,y=H,p=ir,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[3],p=n[3],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[3]=H=g&65535|w<<16,n[3]=ir=A&65535|b<<16,y=s,p=rr,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[4],p=n[4],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[4]=s=g&65535|w<<16,n[4]=rr=A&65535|b<<16,y=V,p=tr,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[5],p=n[5],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[5]=V=g&65535|w<<16,n[5]=tr=A&65535|b<<16,y=W,p=fr,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[6],p=n[6],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[6]=W=g&65535|w<<16,n[6]=fr=A&65535|b<<16,y=J,p=nr,A=p&65535,b=p>>>16,g=y&65535,w=y>>>16,y=e[7],p=n[7],A+=p&65535,b+=p>>>16,g+=y&65535,w+=y>>>16,b+=A>>>16,g+=b>>>16,w+=g>>>16,e[7]=J=g&65535|w<<16,n[7]=nr=A&65535|b<<16,sr+=128,r-=128}return r}c(Gt,"crypto_hashblocks_hl");function Yr(e,n,t){var r=new Int32Array(8),i=new Int32Array(8),x=new Uint8Array(256),u,l=t;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Gt(r,i,n,t),t%=128,u=0;u<t;u++)x[u]=n[l-t+u];for(x[t]=128,t=256-128*(t<112?1:0),x[t-9]=0,Ae(x,t-8,l/536870912|0,l<<3),Gt(r,i,x,t),u=0;u<8;u++)Ae(e,8*u,r[u],i[u]);return 0}c(Yr,"crypto_hash");function Ue(e,n){var t=f(),r=f(),i=f(),x=f(),u=f(),l=f(),m=f(),M=f(),U=f();Tr(t,e[1],e[0]),Tr(U,n[1],n[0]),X(t,t,U),Cr(r,e[0],e[1]),Cr(U,n[0],n[1]),X(r,r,U),X(i,e[3],n[3]),X(i,i,zr),X(x,e[2],n[2]),Cr(x,x,x),Tr(u,r,t),Tr(l,x,i),Cr(m,x,i),Cr(M,r,t),X(e[0],u,l),X(e[1],M,m),X(e[2],m,l),X(e[3],u,M)}c(Ue,"add");function Vt(e,n,t){var r;for(r=0;r<4;r++)Gr(e[r],n[r],t)}c(Vt,"cswap");function Fe(e,n){var t=f(),r=f(),i=f();Ot(i,n[2]),X(t,n[0],i),X(r,n[1],i),Vr(e,r),e[31]^=Nt(t)<<7}c(Fe,"pack");function Ge(e,n,t){var r,i;for(Dr(e[0],v),Dr(e[1],z),Dr(e[2],z),Dr(e[3],v),i=255;i>=0;--i)r=t[i/8|0]>>(i&7)&1,Vt(e,n,r),Ue(n,e),Ue(e,e),Vt(e,n,r)}c(Ge,"scalarmult");function _e(e,n){var t=[f(),f(),f(),f()];Dr(t[0],lr),Dr(t[1],Pr),Dr(t[2],z),X(t[3],lr,Pr),Ge(e,t,n)}c(_e,"scalarbase");function Ve(e,n,t){var r=new Uint8Array(64),i=[f(),f(),f(),f()],x;for(t||a(n,32),Yr(r,n,32),r[0]&=248,r[31]&=127,r[31]|=64,_e(i,r),Fe(e,i),x=0;x<32;x++)n[x+32]=e[x];return 0}c(Ve,"crypto_sign_keypair");var Se=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 Xe(e,n){var t,r,i,x;for(r=63;r>=32;--r){for(t=0,i=r-32,x=r-12;i<x;++i)n[i]+=t-16*n[r]*Se[i-(r-32)],t=Math.floor((n[i]+128)/256),n[i]-=t*256;n[i]+=t,n[r]=0}for(t=0,i=0;i<32;i++)n[i]+=t-(n[31]>>4)*Se[i],t=n[i]>>8,n[i]&=255;for(i=0;i<32;i++)n[i]-=t*Se[i];for(r=0;r<32;r++)n[r+1]+=n[r]>>8,e[r]=n[r]&255}c(Xe,"modL");function $e(e){var n=new Float64Array(64),t;for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;Xe(e,n)}c($e,"reduce");function Xt(e,n,t,r){var i=new Uint8Array(64),x=new Uint8Array(64),u=new Uint8Array(64),l,m,M=new Float64Array(64),U=[f(),f(),f(),f()];Yr(i,r,32),i[0]&=248,i[31]&=127,i[31]|=64;var q=t+64;for(l=0;l<t;l++)e[64+l]=n[l];for(l=0;l<32;l++)e[32+l]=i[32+l];for(Yr(u,e.subarray(32),t+32),$e(u),_e(U,u),Fe(e,U),l=32;l<64;l++)e[l]=r[l];for(Yr(x,e,t+64),$e(x),l=0;l<64;l++)M[l]=0;for(l=0;l<32;l++)M[l]=u[l];for(l=0;l<32;l++)for(m=0;m<32;m++)M[l+m]+=x[l]*i[m];return Xe(e.subarray(32),M),q}c(Xt,"crypto_sign");function If(e,n){var t=f(),r=f(),i=f(),x=f(),u=f(),l=f(),m=f();return Dr(e[2],z),He(e[1],n),Ur(i,e[1]),X(x,i,ur),Tr(i,i,e[2]),Cr(x,e[2],x),Ur(u,x),Ur(l,u),X(m,l,u),X(t,m,i),X(t,t,x),Yt(t,t),X(t,t,i),X(t,t,x),X(t,t,x),X(e[0],t,x),Ur(r,e[0]),X(r,r,x),zt(r,i)&&X(e[0],e[0],Fr),Ur(r,e[0]),X(r,r,x),zt(r,i)?-1:(Nt(e[0])===n[31]>>7&&Tr(e[0],v,e[0]),X(e[3],e[0],e[1]),0)}c(If,"unpackneg");function Ze(e,n,t,r){var i,x=new Uint8Array(32),u=new Uint8Array(64),l=[f(),f(),f(),f()],m=[f(),f(),f(),f()];if(t<64||If(m,r))return-1;for(i=0;i<t;i++)e[i]=n[i];for(i=0;i<32;i++)e[i+32]=r[i];if(Yr(u,e,t),$e(u),Ge(l,m,u),_e(m,n.subarray(32)),Ue(l,m),Fe(x,l),t-=64,Sr(n,0,x,0)){for(i=0;i<t;i++)e[i]=0;return-1}for(i=0;i<t;i++)e[i]=n[i+64];return t}c(Ze,"crypto_sign_open");var qe=32,Be=24,se=32,Xr=16,xe=32,Ce=32,ce=32,ue=32,We=32,$t=Be,Kf=se,Rf=Xr,Ir=64,jr=32,$r=64,Je=32,Qe=64;o.lowlevel={crypto_core_hsalsa20:yr,crypto_stream_xor:Nr,crypto_stream:Er,crypto_stream_salsa20_xor:Br,crypto_stream_salsa20:Ar,crypto_onetimeauth:Ne,crypto_onetimeauth_verify:Rt,crypto_verify_16:hr,crypto_verify_32:Sr,crypto_secretbox:Oe,crypto_secretbox_open:Ye,crypto_scalarmult:me,crypto_scalarmult_base:ve,crypto_box_beforenm:Ee,crypto_box_afternm:Ht,crypto_box:Pf,crypto_box_open:Df,crypto_box_keypair:jt,crypto_hash:Yr,crypto_sign:Xt,crypto_sign_keypair:Ve,crypto_sign_open:Ze,crypto_secretbox_KEYBYTES:qe,crypto_secretbox_NONCEBYTES:Be,crypto_secretbox_ZEROBYTES:se,crypto_secretbox_BOXZEROBYTES:Xr,crypto_scalarmult_BYTES:xe,crypto_scalarmult_SCALARBYTES:Ce,crypto_box_PUBLICKEYBYTES:ce,crypto_box_SECRETKEYBYTES:ue,crypto_box_BEFORENMBYTES:We,crypto_box_NONCEBYTES:$t,crypto_box_ZEROBYTES:Kf,crypto_box_BOXZEROBYTES:Rf,crypto_sign_BYTES:Ir,crypto_sign_PUBLICKEYBYTES:jr,crypto_sign_SECRETKEYBYTES:$r,crypto_sign_SEEDBYTES:Je,crypto_hash_BYTES:Qe,gf:f,D:ur,L:Se,pack25519:Vr,unpack25519:He,M:X,A:Cr,S:Ur,Z:Tr,pow2523:Yt,add:Ue,set25519:Dr,modL:Xe,scalarmult:Ge,scalarbase:_e};function Zt(e,n){if(e.length!==qe)throw new Error("bad key size");if(n.length!==Be)throw new Error("bad nonce size")}c(Zt,"checkLengths");function zf(e,n){if(e.length!==ce)throw new Error("bad public key size");if(n.length!==ue)throw new Error("bad secret key size")}c(zf,"checkBoxLengths");function mr(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}c(mr,"checkArrayTypes");function qt(e){for(var n=0;n<e.length;n++)e[n]=0}c(qt,"cleanup"),o.randomBytes=function(e){var n=new Uint8Array(e);return a(n,e),n},o.secretbox=function(e,n,t){mr(e,n,t),Zt(t,n);for(var r=new Uint8Array(se+e.length),i=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+se]=e[x];return Oe(i,r,r.length,n,t),i.subarray(Xr)},o.secretbox.open=function(e,n,t){mr(e,n,t),Zt(t,n);for(var r=new Uint8Array(Xr+e.length),i=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+Xr]=e[x];return r.length<32||Ye(i,r,r.length,n,t)!==0?null:i.subarray(se)},o.secretbox.keyLength=qe,o.secretbox.nonceLength=Be,o.secretbox.overheadLength=Xr,o.scalarMult=function(e,n){if(mr(e,n),e.length!==Ce)throw new Error("bad n size");if(n.length!==xe)throw new Error("bad p size");var t=new Uint8Array(xe);return me(t,e,n),t},o.scalarMult.base=function(e){if(mr(e),e.length!==Ce)throw new Error("bad n size");var n=new Uint8Array(xe);return ve(n,e),n},o.scalarMult.scalarLength=Ce,o.scalarMult.groupElementLength=xe,o.box=function(e,n,t,r){var i=o.box.before(t,r);return o.secretbox(e,n,i)},o.box.before=function(e,n){mr(e,n),zf(e,n);var t=new Uint8Array(We);return Ee(t,e,n),t},o.box.after=o.secretbox,o.box.open=function(e,n,t,r){var i=o.box.before(t,r);return o.secretbox.open(e,n,i)},o.box.open.after=o.secretbox.open,o.box.keyPair=function(){var e=new Uint8Array(ce),n=new Uint8Array(ue);return jt(e,n),{publicKey:e,secretKey:n}},o.box.keyPair.fromSecretKey=function(e){if(mr(e),e.length!==ue)throw new Error("bad secret key size");var n=new Uint8Array(ce);return ve(n,e),{publicKey:n,secretKey:new Uint8Array(e)}},o.box.publicKeyLength=ce,o.box.secretKeyLength=ue,o.box.sharedKeyLength=We,o.box.nonceLength=$t,o.box.overheadLength=o.secretbox.overheadLength,o.sign=function(e,n){if(mr(e,n),n.length!==$r)throw new Error("bad secret key size");var t=new Uint8Array(Ir+e.length);return Xt(t,e,e.length,n),t},o.sign.open=function(e,n){if(mr(e,n),n.length!==jr)throw new Error("bad public key size");var t=new Uint8Array(e.length),r=Ze(t,e,e.length,n);if(r<0)return null;for(var i=new Uint8Array(r),x=0;x<i.length;x++)i[x]=t[x];return i},o.sign.detached=function(e,n){for(var t=o.sign(e,n),r=new Uint8Array(Ir),i=0;i<r.length;i++)r[i]=t[i];return r},o.sign.detached.verify=function(e,n,t){if(mr(e,n,t),n.length!==Ir)throw new Error("bad signature size");if(t.length!==jr)throw new Error("bad public key size");var r=new Uint8Array(Ir+e.length),i=new Uint8Array(Ir+e.length),x;for(x=0;x<Ir;x++)r[x]=n[x];for(x=0;x<e.length;x++)r[x+Ir]=e[x];return Ze(i,r,r.length,t)>=0},o.sign.keyPair=function(){var e=new Uint8Array(jr),n=new Uint8Array($r);return Ve(e,n),{publicKey:e,secretKey:n}},o.sign.keyPair.fromSecretKey=function(e){if(mr(e),e.length!==$r)throw new Error("bad secret key size");for(var n=new Uint8Array(jr),t=0;t<n.length;t++)n[t]=e[32+t];return{publicKey:n,secretKey:new Uint8Array(e)}},o.sign.keyPair.fromSeed=function(e){if(mr(e),e.length!==Je)throw new Error("bad seed size");for(var n=new Uint8Array(jr),t=new Uint8Array($r),r=0;r<32;r++)t[r]=e[r];return Ve(n,t,!0),{publicKey:n,secretKey:t}},o.sign.publicKeyLength=jr,o.sign.secretKeyLength=$r,o.sign.seedLength=Je,o.sign.signatureLength=Ir,o.hash=function(e){mr(e);var n=new Uint8Array(Qe);return Yr(n,e,e.length),n},o.hash.hashLength=Qe,o.verify=function(e,n){return mr(e,n),e.length===0||n.length===0||e.length!==n.length?!1:k(e,0,n,0,e.length)===0},o.setPRNG=function(e){a=e},function(){var e=typeof self<"u"?self.crypto||self.msCrypto:null;if(e&&e.getRandomValues){var n=65536;o.setPRNG(function(t,r){var i,x=new Uint8Array(r);for(i=0;i<r;i+=n)e.getRandomValues(x.subarray(i,i+Math.min(r-i,n)));for(i=0;i<r;i++)t[i]=x[i];qt(x)})}else typeof Wt<"u"&&(e=Sf(),e&&e.randomBytes&&o.setPRNG(function(t,r){var i,x=e.randomBytes(r);for(i=0;i<r;i++)t[i]=x[i];qt(x)}))}()})(typeof Re<"u"&&Re.exports?Re.exports:self.nacl=self.nacl||{})});var Xf=globalThis||window||self,ar=Xf.crypto;function Te(o=0){return new Uint8Array(o)}c(Te,"allocUnsafe");var at={};_r(at,{base10:()=>kf});var Ho=new Uint8Array(0);function Qt(o,f){if(o===f)return!0;if(o.byteLength!==f.byteLength)return!1;for(let a=0;a<o.byteLength;a++)if(o[a]!==f[a])return!1;return!0}c(Qt,"equals");function Kr(o){if(o instanceof Uint8Array&&o.constructor.name==="Uint8Array")return o;if(o instanceof ArrayBuffer)return new Uint8Array(o);if(ArrayBuffer.isView(o))return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);throw new Error("Unknown type, must be binary type")}c(Kr,"coerce");function kt(o){return new TextEncoder().encode(o)}c(kt,"fromString");function rf(o){return new TextDecoder().decode(o)}c(rf,"toString");function Zf(o,f){if(o.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),h=0;h<a.length;h++)a[h]=255;for(var d=0;d<o.length;d++){var v=o.charAt(d),z=v.charCodeAt(0);if(a[z]!==255)throw new TypeError(v+" is ambiguous");a[z]=d}var er=o.length,ur=o.charAt(0),zr=Math.log(er)/Math.log(256),lr=Math.log(256)/Math.log(er);function Pr(k){if(k instanceof Uint8Array||(ArrayBuffer.isView(k)?k=new Uint8Array(k.buffer,k.byteOffset,k.byteLength):Array.isArray(k)&&(k=Uint8Array.from(k))),!(k instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(k.length===0)return"";for(var hr=0,Sr=0,wr=0,vr=k.length;wr!==vr&&k[wr]===0;)wr++,hr++;for(var gr=(vr-wr)*lr+1>>>0,yr=new Uint8Array(gr);wr!==vr;){for(var xr=k[wr],Br=0,Ar=gr-1;(xr!==0||Br<Sr)&&Ar!==-1;Ar--,Br++)xr+=256*yr[Ar]>>>0,yr[Ar]=xr%er>>>0,xr=xr/er>>>0;if(xr!==0)throw new Error("Non-zero carry");Sr=Br,wr++}for(var Er=gr-Sr;Er!==gr&&yr[Er]===0;)Er++;for(var Nr=ur.repeat(hr);Er<gr;++Er)Nr+=o.charAt(yr[Er]);return Nr}c(Pr,"encode");function Fr(k){if(typeof k!="string")throw new TypeError("Expected String");if(k.length===0)return new Uint8Array;var hr=0;if(k[hr]!==" "){for(var Sr=0,wr=0;k[hr]===ur;)Sr++,hr++;for(var vr=(k.length-hr)*zr+1>>>0,gr=new Uint8Array(vr);k[hr];){var yr=a[k.charCodeAt(hr)];if(yr===255)return;for(var xr=0,Br=vr-1;(yr!==0||xr<wr)&&Br!==-1;Br--,xr++)yr+=er*gr[Br]>>>0,gr[Br]=yr%256>>>0,yr=yr/256>>>0;if(yr!==0)throw new Error("Non-zero carry");wr=xr,hr++}if(k[hr]!==" "){for(var Ar=vr-wr;Ar!==vr&&gr[Ar]===0;)Ar++;for(var Er=new Uint8Array(Sr+(vr-Ar)),Nr=Sr;Ar!==vr;)Er[Nr++]=gr[Ar++];return Er}}}c(Fr,"decodeUnsafe");function Ae(k){var hr=Fr(k);if(hr)return hr;throw new Error(`Non-${f} character`)}return c(Ae,"decode"),{encode:Pr,decodeUnsafe:Fr,decode:Ae}}c(Zf,"base");var qf=Zf,Wf=qf,tf=Wf;var ft=class ft{constructor(f,a,h){Q(this,"name");Q(this,"prefix");Q(this,"baseEncode");this.name=f,this.prefix=a,this.baseEncode=h}encode(f){if(f instanceof Uint8Array)return`${this.prefix}${this.baseEncode(f)}`;throw Error("Unknown type, must be binary type")}};c(ft,"Encoder");var ke=ft,nt=class nt{constructor(f,a,h){Q(this,"name");Q(this,"prefix");Q(this,"baseDecode");Q(this,"prefixCodePoint");this.name=f,this.prefix=a;let d=a.codePointAt(0);if(d===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=d,this.baseDecode=h}decode(f){if(typeof f=="string"){if(f.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(f)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(f.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(f){return ff(this,f)}};c(nt,"Decoder");var rt=nt,ot=class ot{constructor(f){Q(this,"decoders");this.decoders=f}or(f){return ff(this,f)}decode(f){let a=f[0],h=this.decoders[a];if(h!=null)return h.decode(f);throw RangeError(`Unable to decode multibase string ${JSON.stringify(f)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};c(ot,"ComposedDecoder");var et=ot;function ff(o,f){return new et({...o.decoders??{[o.prefix]:o},...f.decoders??{[f.prefix]:f}})}c(ff,"or");var it=class it{constructor(f,a,h,d){Q(this,"name");Q(this,"prefix");Q(this,"baseEncode");Q(this,"baseDecode");Q(this,"encoder");Q(this,"decoder");this.name=f,this.prefix=a,this.baseEncode=h,this.baseDecode=d,this.encoder=new ke(f,a,h),this.decoder=new rt(f,a,d)}encode(f){return this.encoder.encode(f)}decode(f){return this.decoder.decode(f)}};c(it,"Codec");var tt=it;function Zr({name:o,prefix:f,encode:a,decode:h}){return new tt(o,f,a,h)}c(Zr,"from");function Or({name:o,prefix:f,alphabet:a}){let{encode:h,decode:d}=tf(a,o);return Zr({prefix:f,name:o,encode:h,decode:c(v=>Kr(d(v)),"decode")})}c(Or,"baseX");function Jf(o,f,a,h){let d={};for(let lr=0;lr<f.length;++lr)d[f[lr]]=lr;let v=o.length;for(;o[v-1]==="=";)--v;let z=new Uint8Array(v*a/8|0),er=0,ur=0,zr=0;for(let lr=0;lr<v;++lr){let Pr=d[o[lr]];if(Pr===void 0)throw new SyntaxError(`Non-${h} character`);ur=ur<<a|Pr,er+=a,er>=8&&(er-=8,z[zr++]=255&ur>>er)}if(er>=a||(255&ur<<8-er)!==0)throw new SyntaxError("Unexpected end of data");return z}c(Jf,"decode");function Qf(o,f,a){let h=f[f.length-1]==="=",d=(1<<a)-1,v="",z=0,er=0;for(let ur=0;ur<o.length;++ur)for(er=er<<8|o[ur],z+=8;z>a;)z-=a,v+=f[d&er>>z];if(z!==0&&(v+=f[d&er<<a-z]),h)for(;(v.length*a&7)!==0;)v+="=";return v}c(Qf,"encode");function or({name:o,prefix:f,bitsPerChar:a,alphabet:h}){return Zr({prefix:f,name:o,encode(d){return Qf(d,h,a)},decode(d){return Jf(d,h,a,o)}})}c(or,"rfc4648");var kf=Or({prefix:"9",name:"base10",alphabet:"0123456789"});var st={};_r(st,{base16:()=>rn,base16upper:()=>en});var rn=or({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),en=or({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var xt={};_r(xt,{base2:()=>tn});var tn=or({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ct={};_r(ct,{base256emoji:()=>sn});var nf=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),fn=nf.reduce((o,f,a)=>(o[a]=f,o),[]),nn=nf.reduce((o,f,a)=>{let h=f.codePointAt(0);if(h==null)throw new Error(`Invalid character: ${f}`);return o[h]=a,o},[]);function on(o){return o.reduce((f,a)=>(f+=fn[a],f),"")}c(on,"encode");function an(o){let f=[];for(let a of o){let h=a.codePointAt(0);if(h==null)throw new Error(`Invalid character: ${a}`);let d=nn[h];if(d==null)throw new Error(`Non-base256emoji character: ${a}`);f.push(d)}return new Uint8Array(f)}c(an,"decode");var sn=Zr({prefix:"\u{1F680}",name:"base256emoji",encode:on,decode:an});var ut={};_r(ut,{base32:()=>qr,base32hex:()=>hn,base32hexpad:()=>pn,base32hexpadupper:()=>dn,base32hexupper:()=>yn,base32pad:()=>cn,base32padupper:()=>un,base32upper:()=>xn,base32z:()=>bn});var qr=or({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),xn=or({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),cn=or({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),un=or({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),hn=or({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),yn=or({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),pn=or({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),dn=or({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),bn=or({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ht={};_r(ht,{base36:()=>ye,base36upper:()=>ln});var ye=Or({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ln=Or({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var yt={};_r(yt,{base58btc:()=>Mr,base58flickr:()=>gn});var Mr=Or({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),gn=Or({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var pt={};_r(pt,{base64:()=>An,base64pad:()=>wn,base64url:()=>mn,base64urlpad:()=>vn});var An=or({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),wn=or({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),mn=or({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),vn=or({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var dt={};_r(dt,{base8:()=>En});var En=or({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var bt={};_r(bt,{identity:()=>Un});var Un=Zr({prefix:"\0",name:"identity",encode:c(o=>rf(o),"encode"),decode:c(o=>kt(o),"decode")});var xi=new TextEncoder,ci=new TextDecoder;var At={};_r(At,{identity:()=>$n});var Bn=sf,of=128,Cn=127,Tn=~Cn,Mn=Math.pow(2,31);function sf(o,f,a){f=f||[],a=a||0;for(var h=a;o>=Mn;)f[a++]=o&255|of,o/=128;for(;o&Tn;)f[a++]=o&255|of,o>>>=7;return f[a]=o|0,sf.bytes=a-h+1,f}c(sf,"encode");var Ln=lt,Pn=128,af=127;function lt(o,h){var a=0,h=h||0,d=0,v=h,z,er=o.length;do{if(v>=er)throw lt.bytes=0,new RangeError("Could not decode varint");z=o[v++],a+=d<28?(z&af)<<d:(z&af)*Math.pow(2,d),d+=7}while(z>=Pn);return lt.bytes=v-h,a}c(lt,"read");var Dn=Math.pow(2,7),In=Math.pow(2,14),Kn=Math.pow(2,21),Rn=Math.pow(2,28),zn=Math.pow(2,35),Nn=Math.pow(2,42),On=Math.pow(2,49),Yn=Math.pow(2,56),jn=Math.pow(2,63),Hn=c(function(o){return o<Dn?1:o<In?2:o<Kn?3:o<Rn?4:o<zn?5:o<Nn?6:o<On?7:o<Yn?8:o<jn?9:10},"length"),Fn={encode:Bn,decode:Ln,encodingLength:Hn},Gn=Fn,pe=Gn;function de(o,f=0){return[pe.decode(o,f),pe.decode.bytes]}c(de,"decode");function Wr(o,f,a=0){return pe.encode(o,f,a),f}c(Wr,"encodeTo");function Jr(o){return pe.encodingLength(o)}c(Jr,"encodingLength");function Hr(o,f){let a=f.byteLength,h=Jr(o),d=h+Jr(a),v=new Uint8Array(d+a);return Wr(o,v,0),Wr(a,v,h),v.set(f,d),new Qr(o,a,f,v)}c(Hr,"create");function xf(o){let f=Kr(o),[a,h]=de(f),[d,v]=de(f.subarray(h)),z=f.subarray(h+v);if(z.byteLength!==d)throw new Error("Incorrect length");return new Qr(a,d,z,f)}c(xf,"decode");function cf(o,f){if(o===f)return!0;{let a=f;return o.code===a.code&&o.size===a.size&&a.bytes instanceof Uint8Array&&Qt(o.bytes,a.bytes)}}c(cf,"equals");var gt=class gt{constructor(f,a,h,d){Q(this,"code");Q(this,"size");Q(this,"digest");Q(this,"bytes");this.code=f,this.size=a,this.digest=h,this.bytes=d}};c(gt,"Digest");var Qr=gt;var uf=0,Vn="identity",hf=Kr;function Xn(o){return Hr(uf,hf(o))}c(Xn,"digest");var $n={code:uf,name:Vn,encode:hf,digest:Xn};var Et={};_r(Et,{sha256:()=>Zn,sha512:()=>qn});function mt({name:o,code:f,encode:a}){return new wt(o,f,a)}c(mt,"from");var vt=class vt{constructor(f,a,h){Q(this,"name");Q(this,"code");Q(this,"encode");this.name=f,this.code=a,this.encode=h}digest(f){if(f instanceof Uint8Array){let a=this.encode(f);return a instanceof Uint8Array?Hr(this.code,a):a.then(h=>Hr(this.code,h))}else throw Error("Unknown type, must be binary type")}};c(vt,"Hasher");var wt=vt;function pf(o){return async f=>new Uint8Array(await crypto.subtle.digest(o,f))}c(pf,"sha");var Zn=mt({name:"sha2-256",code:18,encode:pf("SHA-256")}),qn=mt({name:"sha2-512",code:19,encode:pf("SHA-512")});function df(o,f){let{bytes:a,version:h}=o;switch(h){case 0:return Jn(a,Ut(o),f??Mr.encoder);default:return Qn(a,Ut(o),f??qr.encoder)}}c(df,"format");var bf=new WeakMap;function Ut(o){let f=bf.get(o);if(f==null){let a=new Map;return bf.set(o,a),a}return f}c(Ut,"baseCache");var gf,cr=class cr{constructor(f,a,h,d){Q(this,"code");Q(this,"version");Q(this,"multihash");Q(this,"bytes");Q(this,"/");Q(this,gf,"CID");this.code=a,this.version=f,this.multihash=h,this.bytes=d,this["/"]=d}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:f,multihash:a}=this;if(f!==le)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(a.code!==kn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return cr.createV0(a)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:f,digest:a}=this.multihash,h=Hr(f,a);return cr.createV1(this.code,h)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(f){return cr.equals(this,f)}static equals(f,a){let h=a;return h!=null&&f.code===h.code&&f.version===h.version&&cf(f.multihash,h.multihash)}toString(f){return df(this,f)}toJSON(){return{"/":df(this)}}link(){return this}[(gf=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(f){if(f==null)return null;let a=f;if(a instanceof cr)return a;if(a["/"]!=null&&a["/"]===a.bytes||a.asCID===a){let{version:h,code:d,multihash:v,bytes:z}=a;return new cr(h,d,v,z??lf(h,d,v.bytes))}else if(a[ro]===!0){let{version:h,multihash:d,code:v}=a,z=xf(d);return cr.create(h,v,z)}else return null}static create(f,a,h){if(typeof a!="number")throw new Error("String codecs are no longer supported");if(!(h.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(f){case 0:{if(a!==le)throw new Error(`Version 0 CID must use dag-pb (code: ${le}) block encoding`);return new cr(f,a,h,h.bytes)}case 1:{let d=lf(f,a,h.bytes);return new cr(f,a,h,d)}default:throw new Error("Invalid version")}}static createV0(f){return cr.create(0,le,f)}static createV1(f,a){return cr.create(1,f,a)}static decode(f){let[a,h]=cr.decodeFirst(f);if(h.length!==0)throw new Error("Incorrect length");return a}static decodeFirst(f){let a=cr.inspectBytes(f),h=a.size-a.multihashSize,d=Kr(f.subarray(h,h+a.multihashSize));if(d.byteLength!==a.multihashSize)throw new Error("Incorrect length");let v=d.subarray(a.multihashSize-a.digestSize),z=new Qr(a.multihashCode,a.digestSize,v,d);return[a.version===0?cr.createV0(z):cr.createV1(a.codec,z),f.subarray(a.size)]}static inspectBytes(f){let a=0,h=c(()=>{let[Pr,Fr]=de(f.subarray(a));return a+=Fr,Pr},"next"),d=h(),v=le;if(d===18?(d=0,a=0):v=h(),d!==0&&d!==1)throw new RangeError(`Invalid CID version ${d}`);let z=a,er=h(),ur=h(),zr=a+ur,lr=zr-z;return{version:d,codec:v,multihashCode:er,digestSize:ur,multihashSize:lr,size:zr}}static parse(f,a){let[h,d]=Wn(f,a),v=cr.decode(d);if(v.version===0&&f[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ut(v).set(h,f),v}};c(cr,"CID");var Le=cr;function Wn(o,f){switch(o[0]){case"Q":{let a=f??Mr;return[Mr.prefix,a.decode(`${Mr.prefix}${o}`)]}case Mr.prefix:{let a=f??Mr;return[Mr.prefix,a.decode(o)]}case qr.prefix:{let a=f??qr;return[qr.prefix,a.decode(o)]}case ye.prefix:{let a=f??ye;return[ye.prefix,a.decode(o)]}default:{if(f==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],f.decode(o)]}}}c(Wn,"parseCIDtoBytes");function Jn(o,f,a){let{prefix:h}=a;if(h!==Mr.prefix)throw Error(`Cannot string encode V0 in ${a.name} encoding`);let d=f.get(h);if(d==null){let v=a.encode(o).slice(1);return f.set(h,v),v}else return d}c(Jn,"toStringV0");function Qn(o,f,a){let{prefix:h}=a,d=f.get(h);if(d==null){let v=a.encode(o);return f.set(h,v),v}else return d}c(Qn,"toStringV1");var le=112,kn=18;function lf(o,f,a){let h=Jr(o),d=h+Jr(f),v=new Uint8Array(d+a.byteLength);return Wr(o,v,0),Wr(f,v,h),v.set(a,d),v}c(lf,"encodeCID");var ro=Symbol.for("@ipld/js-cid/CID");var _t={...bt,...xt,...dt,...at,...st,...ut,...ht,...yt,...pt,...ct},ji={...Et,...At};function wf(o,f,a,h){return{name:o,prefix:f,encoder:{name:o,prefix:f,encode:a},decoder:{decode:h}}}c(wf,"createCodec");var Af=wf("utf8","u",o=>"u"+new TextDecoder("utf8").decode(o),o=>new TextEncoder().encode(o.substring(1))),St=wf("ascii","a",o=>{let f="a";for(let a=0;a<o.length;a++)f+=String.fromCharCode(o[a]);return f},o=>{o=o.substring(1);let f=Te(o.length);for(let a=0;a<o.length;a++)f[a]=o.charCodeAt(a);return f}),eo={utf8:Af,"utf-8":Af,hex:_t.base16,latin1:St,ascii:St,binary:St,..._t},Pe=eo;function Lr(o,f="utf8"){let a=Pe[f];if(a==null)throw new Error(`Unsupported encoding "${f}"`);return a.decoder.decode(`${a.prefix}${o}`)}c(Lr,"fromString");function kr(o,f="utf8"){let a=Pe[f];if(a==null)throw new Error(`Unsupported encoding "${f}"`);return a.encoder.encode(o).substring(1)}c(kr,"toString");var De="did:key:z";var pa="X25519";var da="X25519";var re="RSA-OAEP",ee="RSASSA-PKCS1-v1_5",Bt="SHA-256",no=new Uint8Array([0,245,2]),ba=2048,Ct="SHA-256",te=8,fe="AES-GCM",ne=fe,ge=256,Ie=12,oo=new Uint8Array([234,1]),io=new Uint8Array([237,1]);var Tt=16;var mf=new Error("Invalid key use. Please use 'encryption' or 'signing"),so=new Error("Max must be less than 256 and greater than 0");function Rr(o){return new Uint8Array(o).buffer}c(Rr,"toArrayBuffer");function oe(o){let f=Lr(o,"base64pad");return Rr(f)}c(oe,"base64ToArrBuf");var Mt=c((o,f)=>{if(typeof o=="string")return f(o);if(typeof o=="object"&&o.byteLength!==void 0)return new Uint8Array(o).buffer;throw new Error("Improper value. Must be a string, ArrayBuffer, Uint8Array")},"normalizeToBuf");function Ke(o){return Mt(o,oe)}c(Ke,"normalizeBase64ToBuf");var xo=c(o=>Mt(o,f=>vf(f,8)),"normalizeUtf8ToBuf");function vf(o,f){let a=f===8?new Uint8Array(o.length):new Uint16Array(o.length);for(let h=0,d=o.length;h<d;h++)a[h]=o.charCodeAt(h);return a.buffer}c(vf,"strToArrBuf");var co=c(o=>Mt(o,f=>vf(f,16)),"normalizeUtf16ToBuf");function ie(o,f){switch(f){case 8:return xo(o);default:return co(o)}}c(ie,"normalizeUnicodeToBuf");var uo={equal:c((o,f)=>{let a=new Uint8Array(o),h=new Uint8Array(f);if(a.length!==h.length)return!1;for(let d=0;d<a.length;d++)if(a[d]!==h[d])return!1;return!0},"equal")};function Ef(o,f){return uo.equal(f,o.slice(0,f.byteLength))}c(Ef,"hasPrefix");function Lt(o){return kr(o instanceof ArrayBuffer?new Uint8Array(o):o,"base64pad")}c(Lt,"toBase64");async function Pt(o,f){let a=typeof o=="string"?oe(o):Rr(o);return ar.subtle.importKey("raw",a,{name:f?.alg||ne,length:f?.length||ge},!0,["encrypt","decrypt"])}c(Pt,"importKey");function Uf(o,{max:f}={max:255}){if(f<1||f>255)throw so;let a=new Uint8Array(o);if(f===255)return ar.getRandomValues(a),a.buffer;let h=0,d=f+1,v=Math.floor(256/d)*d,z=new Uint8Array(1);for(;h<a.length;)ar.getRandomValues(z),z[0]<v&&(a[h]=z[0]%d,h++);return a.buffer}c(Uf,"randomBuf");function _f(o,f){let a=o instanceof ArrayBuffer?new Uint8Array(o):new Uint8Array(Rr(o)),h=f instanceof ArrayBuffer?new Uint8Array(f):new Uint8Array(Rr(f)),d=new Uint8Array(a.length+h.length);return d.set(a),d.set(h,a.length),d.buffer}c(_f,"joinBufs");var Cf=Vf(Bf(),1);var ho={keyTypes:{"bls12-381":{magicBytes:new Uint8Array([234,1]),verify:c(()=>{throw new Error("Not implemented")},"verify")},rsa:{magicBytes:new Uint8Array([0,245,2]),verify:po},ed25519:{magicBytes:new Uint8Array([237,1]),verify:yo}}};async function yo({message:o,publicKey:f,signature:a}){let h=o;typeof o=="string"&&(h=Lr(o,"utf8"));let d=a;typeof a=="string"&&(d=Lr(a,"base64pad"));let v=f;if(typeof f=="string"&&(v=Tf(f).publicKey),v.length!==32)throw new Error(`Invalid Ed25519 public key size: ${v.length} bytes, expected 32`);if(d.length!==64)throw new Error(`Invalid Ed25519 signature size: ${d.length} bytes, expected 64`);return Cf.default.sign.detached.verify(h,d,v)}c(yo,"ed25519Verify");async function po({message:o,publicKey:f,signature:a}){let h=f;return typeof f=="string"&&(h=Tf(f).publicKey),bo.verify(o,a,await ar.subtle.importKey("spki",Rr(h),{name:ee,hash:Bt},!1,["verify"]),8)}c(po,"rsaVerify");var bo={verify:c(async function(f,a,h,d=te,v=Ct){return ar.subtle.verify({name:ee,saltLength:Tt},typeof h=="string"?await Dt(h,v,"signing"):h,Ke(a),ie(f,d))},"rsaVerify"),sign:c(async function(f,a,h=te){return ar.subtle.sign({name:ee,saltLength:Tt},a,ie(f,h))},"sign"),encrypt:c(async function(f,a,h=te,d=Ct){let v;return typeof a=="string"?v=await Dt(a,d,"exchange"):v=a instanceof Uint8Array?await Dt(Rr(a),d,"exchange"):a,ar.subtle.encrypt({name:re},v,ie(f,h))},"rsaEncrypt"),decrypt:c(async function(f,a){let h=ze(a)?a:await wo(a,["decrypt"]),d;typeof f=="string"?d=Lr(f,"base64pad"):d=f;let v=await ar.subtle.decrypt({name:re},h,d instanceof Uint8Array?Rr(d):d);return new Uint8Array(v)},"rsaDecrypt")};async function Dt(o,f,a){lo(a);let h=a==="exchange"?re:ee,d=a==="exchange"?["encrypt"]:["verify"],v=typeof o=="string"?oe(Ao(o)):o;return ar.subtle.importKey("spki",v,{name:h,hash:{name:f}},!0,d)}c(Dt,"importPublicKey");function lo(o){go(o,["signing","exchange"],mf)}c(lo,"checkValidKeyUse");function go(o,f,a){if(!f.some(d=>d===o))throw a}c(go,"checkValid");function Ao(o){return o.replace(`-----BEGIN PUBLIC KEY-----
|
|
2
2
|
`,"").replace(`
|
|
3
|
-
-----END PUBLIC KEY-----`,"")}c(Ao,"stripKeyHeader");function ze(o){return It(o,"algorithm")&&It(o,"extractable")&&It(o,"type")}c(ze,"isCryptoKey");function It(o,f){return typeof o=="object"&&o!=null&&f in o}c(It,"hasProp");function wo(o,f){return ar.subtle.importKey("spki",o instanceof Uint8Array?Rr(o):o,{name:re,hash:Bt},!1,f)}c(wo,"importRsaKey");function Tf(o){if(!o.startsWith(De))throw new Error("Please use a base58-encoded DID formatted `did:key:z...`");let f=o.substr(De.length),a=
|
|
3
|
+
-----END PUBLIC KEY-----`,"")}c(Ao,"stripKeyHeader");function ze(o){return It(o,"algorithm")&&It(o,"extractable")&&It(o,"type")}c(ze,"isCryptoKey");function It(o,f){return typeof o=="object"&&o!=null&&f in o}c(It,"hasProp");function wo(o,f){return ar.subtle.importKey("spki",o instanceof Uint8Array?Rr(o):o,{name:re,hash:Bt},!1,f)}c(wo,"importRsaKey");function Tf(o){if(!o.startsWith(De))throw new Error("Please use a base58-encoded DID formatted `did:key:z...`");let f=o.substr(De.length),a=Lr(f,"base58btc"),h=Object.entries(ho.keyTypes).find(([v,z])=>Ef(a.buffer,z.magicBytes.buffer));if(!h)throw new Error("Unsupported key algorithm.");let d=a.slice(h[1].magicBytes.length);return h[0]==="ed25519"&&d.length===44?{publicKey:d.slice(-32),type:h[0]}:{publicKey:d,type:h[0]}}c(Tf,"didToPublicKey");function ae(o){return new Uint8Array(o).buffer}c(ae,"toArrayBuffer");var Mf={create(o={alg:ne,length:ge}){let f=o.length||ge,a=o.alg||ne;return ar.subtle.generateKey({name:a,length:f},!0,["encrypt","decrypt"])},export:Object.assign(async o=>{let f=await ar.subtle.exportKey("raw",o);return new Uint8Array(f)},{asString:c(async(o,f)=>{let a=await Mf.export(o);return f?kr(a,f):Lt(a)},"asString")}),import(o){return Kt(typeof o=="string"?oe(o):o)},async exportAsString(o){let f=await Mf.export(o);return Lt(f)},encrypt:mo,async decrypt(o,f,a){let h=ze(f)?f:await Kt(f),d=a?await ar.subtle.decrypt({name:fe,iv:ae(a)},h,typeof o=="string"?ae(Lr(o)):o instanceof Uint8Array?ae(o):o):await Eo(o,h);return new Uint8Array(d)}};function Kt(o,f){return ar.subtle.importKey("raw",o instanceof Uint8Array?ae(o):o,{name:fe,length:f||256},!0,["encrypt","decrypt"])}c(Kt,"importAesKey");async function mo(o,f,a,h){let d=ze(f)?f:await Kt(f),v=h?await ar.subtle.encrypt({name:fe,iv:ae(h)},d,ae(o)):await vo(o,d);return a&&a==="arraybuffer"?v:new Uint8Array(v)}c(mo,"encrypt");async function vo(o,f,a){let h=ie(o,a?.charsize??te),d=typeof f=="string"?await Pt(f,a):f,v=a?.iv||Uf(Ie),z=await ar.subtle.encrypt({name:fe,iv:v},d,h);return _f(v,z)}c(vo,"encryptBytes");async function Eo(o,f,a){let h=Ke(o),d=typeof f=="string"?await Pt(f,a):f,v=h.slice(0,Ie),z=h.slice(Ie);return await ar.subtle.decrypt({name:ne,iv:v},d,z)}c(Eo,"decryptBytes");export{Mf as AES,Eo as decryptBytes,Kt as importAesKey};
|
|
4
4
|
//# sourceMappingURL=index.min.js.map
|