@substrate-system/keys 0.2.10 → 0.2.12
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.cjs +12 -11
- package/dist/_base.cjs.map +3 -3
- package/dist/_base.d.ts +2 -2
- package/dist/_base.d.ts.map +1 -1
- package/dist/_base.js +6 -4
- package/dist/_base.js.map +2 -2
- package/dist/_base.min.cjs +1 -1
- package/dist/_base.min.cjs.map +3 -3
- package/dist/_base.min.js +2 -2
- package/dist/_base.min.js.map +4 -4
- package/dist/aes/index.cjs +3 -2
- package/dist/aes/index.cjs.map +2 -2
- package/dist/aes/index.js +1 -1
- package/dist/aes/index.js.map +2 -2
- package/dist/aes/index.min.cjs +1 -1
- package/dist/aes/index.min.cjs.map +3 -3
- package/dist/aes/index.min.js +2 -2
- package/dist/aes/index.min.js.map +4 -4
- package/dist/browser/index.js +178 -177
- package/dist/browser/index.min.js +2 -2
- package/dist/crypto.cjs +221 -0
- package/dist/crypto.cjs.map +7 -0
- package/dist/crypto.d.ts +54 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +208 -0
- package/dist/crypto.js.map +7 -0
- package/dist/crypto.min.cjs +4 -0
- package/dist/crypto.min.cjs.map +7 -0
- package/dist/crypto.min.js +4 -0
- package/dist/crypto.min.js.map +7 -0
- package/dist/ecc/index.min.js +2 -2
- package/dist/ecc/index.min.js.map +4 -4
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +4 -4
- package/dist/meta.json +99 -34
- package/dist/rsa/index.cjs +12 -11
- package/dist/rsa/index.cjs.map +3 -3
- package/dist/rsa/index.d.ts +2 -2
- package/dist/rsa/index.d.ts.map +1 -1
- package/dist/rsa/index.js +8 -6
- package/dist/rsa/index.js.map +2 -2
- package/dist/rsa/index.min.cjs +1 -1
- package/dist/rsa/index.min.cjs.map +3 -3
- package/dist/rsa/index.min.js +2 -2
- package/dist/rsa/index.min.js.map +4 -4
- package/dist/util.cjs +13 -203
- package/dist/util.cjs.map +3 -3
- package/dist/util.d.ts +4 -54
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +14 -198
- package/dist/util.js.map +3 -3
- package/dist/util.min.cjs +1 -3
- package/dist/util.min.cjs.map +3 -3
- package/dist/util.min.js +1 -3
- package/dist/util.min.js.map +4 -4
- package/package.json +5 -1
package/dist/_base.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Jn=Object.create;var ue=Object.defineProperty;var kn=Object.getOwnPropertyDescriptor;var Qn=Object.getOwnPropertyNames;var rf=Object.getPrototypeOf,ef=Object.prototype.hasOwnProperty;var tf=(n,t,a)=>t in n?ue(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var c=(n,t)=>ue(n,"name",{value:t,configurable:!0}),cn=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,a)=>(typeof require<"u"?require:t)[a]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var xn=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Kr=(n,t)=>{for(var a in t)ue(n,a,{get:t[a],enumerable:!0})},nf=(n,t,a,y)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of Qn(t))!ef.call(n,h)&&h!==a&&ue(n,h,{get:()=>t[h],enumerable:!(y=kn(t,h))||y.enumerable});return n};var ff=(n,t,a)=>(a=n!=null?Jn(rf(n)):{},nf(t||!n||!n.__esModule?ue(a,"default",{value:n,enumerable:!0}):a,n));var V=(n,t,a)=>tf(n,typeof t!="symbol"?t+"":t,a);var Ln=xn(()=>{"use strict"});var In=xn((_a,ze)=>{"use strict";(function(n){"use strict";var t=c(function(e){var i,f=new Float64Array(16);if(e)for(i=0;i<e.length;i++)f[i]=e[i];return f},"gf"),a=c(function(){throw new Error("no PRNG")},"randombytes"),y=new Uint8Array(16),h=new Uint8Array(32);h[0]=9;var E=t(),D=t([1]),er=t([56129,1]),yr=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),Rr=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),br=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Dr=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),$r=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ue(e,i,f,r){e[i]=f>>24&255,e[i+1]=f>>16&255,e[i+2]=f>>8&255,e[i+3]=f&255,e[i+4]=r>>24&255,e[i+5]=r>>16&255,e[i+6]=r>>8&255,e[i+7]=r&255}c(Ue,"ts64");function Q(e,i,f,r,o){var x,u=0;for(x=0;x<o;x++)u|=e[i+x]^f[r+x];return(1&u-1>>>8)-1}c(Q,"vn");function ur(e,i,f,r){return Q(e,i,f,r,16)}c(ur,"crypto_verify_16");function _r(e,i,f,r){return Q(e,i,f,r,32)}c(_r,"crypto_verify_32");function mr(e,i,f,r){for(var o=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,u=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,b=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,w=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,P=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,U=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,q=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,S=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,L=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,I=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,Y=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,O=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,R=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,z=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,N=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,_=o,T=x,K=u,B=b,C=w,v=P,p=U,d=q,A=S,l=L,g=I,m=Y,M=O,j=R,F=z,H=N,s,X=0;X<20;X+=2)s=_+M|0,C^=s<<7|s>>>25,s=C+_|0,A^=s<<9|s>>>23,s=A+C|0,M^=s<<13|s>>>19,s=M+A|0,_^=s<<18|s>>>14,s=v+T|0,l^=s<<7|s>>>25,s=l+v|0,j^=s<<9|s>>>23,s=j+l|0,T^=s<<13|s>>>19,s=T+j|0,v^=s<<18|s>>>14,s=g+p|0,F^=s<<7|s>>>25,s=F+g|0,K^=s<<9|s>>>23,s=K+F|0,p^=s<<13|s>>>19,s=p+K|0,g^=s<<18|s>>>14,s=H+m|0,B^=s<<7|s>>>25,s=B+H|0,d^=s<<9|s>>>23,s=d+B|0,m^=s<<13|s>>>19,s=m+d|0,H^=s<<18|s>>>14,s=_+B|0,T^=s<<7|s>>>25,s=T+_|0,K^=s<<9|s>>>23,s=K+T|0,B^=s<<13|s>>>19,s=B+K|0,_^=s<<18|s>>>14,s=v+C|0,p^=s<<7|s>>>25,s=p+v|0,d^=s<<9|s>>>23,s=d+p|0,C^=s<<13|s>>>19,s=C+d|0,v^=s<<18|s>>>14,s=g+l|0,m^=s<<7|s>>>25,s=m+g|0,A^=s<<9|s>>>23,s=A+m|0,l^=s<<13|s>>>19,s=l+A|0,g^=s<<18|s>>>14,s=H+F|0,M^=s<<7|s>>>25,s=M+H|0,j^=s<<9|s>>>23,s=j+M|0,F^=s<<13|s>>>19,s=F+j|0,H^=s<<18|s>>>14;_=_+o|0,T=T+x|0,K=K+u|0,B=B+b|0,C=C+w|0,v=v+P|0,p=p+U|0,d=d+q|0,A=A+S|0,l=l+L|0,g=g+I|0,m=m+Y|0,M=M+O|0,j=j+R|0,F=F+z|0,H=H+N|0,e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=K>>>0&255,e[9]=K>>>8&255,e[10]=K>>>16&255,e[11]=K>>>24&255,e[12]=B>>>0&255,e[13]=B>>>8&255,e[14]=B>>>16&255,e[15]=B>>>24&255,e[16]=C>>>0&255,e[17]=C>>>8&255,e[18]=C>>>16&255,e[19]=C>>>24&255,e[20]=v>>>0&255,e[21]=v>>>8&255,e[22]=v>>>16&255,e[23]=v>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255,e[32]=A>>>0&255,e[33]=A>>>8&255,e[34]=A>>>16&255,e[35]=A>>>24&255,e[36]=l>>>0&255,e[37]=l>>>8&255,e[38]=l>>>16&255,e[39]=l>>>24&255,e[40]=g>>>0&255,e[41]=g>>>8&255,e[42]=g>>>16&255,e[43]=g>>>24&255,e[44]=m>>>0&255,e[45]=m>>>8&255,e[46]=m>>>16&255,e[47]=m>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>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(mr,"core_salsa20");function Er(e,i,f,r){for(var o=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,u=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,b=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,w=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,P=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,U=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,q=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,S=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,L=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,I=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,Y=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,O=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,R=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,z=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,N=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,_=o,T=x,K=u,B=b,C=w,v=P,p=U,d=q,A=S,l=L,g=I,m=Y,M=O,j=R,F=z,H=N,s,X=0;X<20;X+=2)s=_+M|0,C^=s<<7|s>>>25,s=C+_|0,A^=s<<9|s>>>23,s=A+C|0,M^=s<<13|s>>>19,s=M+A|0,_^=s<<18|s>>>14,s=v+T|0,l^=s<<7|s>>>25,s=l+v|0,j^=s<<9|s>>>23,s=j+l|0,T^=s<<13|s>>>19,s=T+j|0,v^=s<<18|s>>>14,s=g+p|0,F^=s<<7|s>>>25,s=F+g|0,K^=s<<9|s>>>23,s=K+F|0,p^=s<<13|s>>>19,s=p+K|0,g^=s<<18|s>>>14,s=H+m|0,B^=s<<7|s>>>25,s=B+H|0,d^=s<<9|s>>>23,s=d+B|0,m^=s<<13|s>>>19,s=m+d|0,H^=s<<18|s>>>14,s=_+B|0,T^=s<<7|s>>>25,s=T+_|0,K^=s<<9|s>>>23,s=K+T|0,B^=s<<13|s>>>19,s=B+K|0,_^=s<<18|s>>>14,s=v+C|0,p^=s<<7|s>>>25,s=p+v|0,d^=s<<9|s>>>23,s=d+p|0,C^=s<<13|s>>>19,s=C+d|0,v^=s<<18|s>>>14,s=g+l|0,m^=s<<7|s>>>25,s=m+g|0,A^=s<<9|s>>>23,s=A+m|0,l^=s<<13|s>>>19,s=l+A|0,g^=s<<18|s>>>14,s=H+F|0,M^=s<<7|s>>>25,s=M+H|0,j^=s<<9|s>>>23,s=j+M|0,F^=s<<13|s>>>19,s=F+j|0,H^=s<<18|s>>>14;e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=v>>>0&255,e[5]=v>>>8&255,e[6]=v>>>16&255,e[7]=v>>>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]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=l>>>0&255,e[29]=l>>>8&255,e[30]=l>>>16&255,e[31]=l>>>24&255}c(Er,"core_hsalsa20");function gr(e,i,f,r){mr(e,i,f,r)}c(gr,"crypto_core_salsa20");function hr(e,i,f,r){Er(e,i,f,r)}c(hr,"crypto_core_hsalsa20");var cr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Br(e,i,f,r,o,x,u){var b=new Uint8Array(16),w=new Uint8Array(64),P,U;for(U=0;U<16;U++)b[U]=0;for(U=0;U<8;U++)b[U]=x[U];for(;o>=64;){for(gr(w,b,u,cr),U=0;U<64;U++)e[i+U]=f[r+U]^w[U];for(P=1,U=8;U<16;U++)P=P+(b[U]&255)|0,b[U]=P&255,P>>>=8;o-=64,i+=64,r+=64}if(o>0)for(gr(w,b,u,cr),U=0;U<o;U++)e[i+U]=f[r+U]^w[U];return 0}c(Br,"crypto_stream_salsa20_xor");function Ar(e,i,f,r,o){var x=new Uint8Array(16),u=new Uint8Array(64),b,w;for(w=0;w<16;w++)x[w]=0;for(w=0;w<8;w++)x[w]=r[w];for(;f>=64;){for(gr(u,x,o,cr),w=0;w<64;w++)e[i+w]=u[w];for(b=1,w=8;w<16;w++)b=b+(x[w]&255)|0,x[w]=b&255,b>>>=8;f-=64,i+=64}if(f>0)for(gr(u,x,o,cr),w=0;w<f;w++)e[i+w]=u[w];return 0}c(Ar,"crypto_stream_salsa20");function vr(e,i,f,r,o){var x=new Uint8Array(32);hr(x,r,o,cr);for(var u=new Uint8Array(8),b=0;b<8;b++)u[b]=r[b+16];return Ar(e,i,f,u,x)}c(vr,"crypto_stream");function Nr(e,i,f,r,o,x,u){var b=new Uint8Array(32);hr(b,x,u,cr);for(var w=new Uint8Array(8),P=0;P<8;P++)w[P]=x[P+16];return Br(e,i,f,r,o,w,b)}c(Nr,"crypto_stream_xor");var Ke=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 i,f,r,o,x,u,b,w;i=e[0]&255|(e[1]&255)<<8,this.r[0]=i&8191,f=e[2]&255|(e[3]&255)<<8,this.r[1]=(i>>>13|f<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(f>>>10|r<<6)&7939,o=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|o<<9)&8191,x=e[8]&255|(e[9]&255)<<8,this.r[4]=(o>>>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,b=e[12]&255|(e[13]&255)<<8,this.r[7]=(u>>>11|b<<5)&8065,w=e[14]&255|(e[15]&255)<<8,this.r[8]=(b>>>8|w<<8)&8191,this.r[9]=w>>>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");Ke.prototype.blocks=function(e,i,f){for(var r=this.fin?0:2048,o,x,u,b,w,P,U,q,S,L,I,Y,O,R,z,N,_,T,K,B=this.h[0],C=this.h[1],v=this.h[2],p=this.h[3],d=this.h[4],A=this.h[5],l=this.h[6],g=this.h[7],m=this.h[8],M=this.h[9],j=this.r[0],F=this.r[1],H=this.r[2],s=this.r[3],X=this.r[4],J=this.r[5],k=this.r[6],G=this.r[7],$=this.r[8],Z=this.r[9];f>=16;)o=e[i+0]&255|(e[i+1]&255)<<8,B+=o&8191,x=e[i+2]&255|(e[i+3]&255)<<8,C+=(o>>>13|x<<3)&8191,u=e[i+4]&255|(e[i+5]&255)<<8,v+=(x>>>10|u<<6)&8191,b=e[i+6]&255|(e[i+7]&255)<<8,p+=(u>>>7|b<<9)&8191,w=e[i+8]&255|(e[i+9]&255)<<8,d+=(b>>>4|w<<12)&8191,A+=w>>>1&8191,P=e[i+10]&255|(e[i+11]&255)<<8,l+=(w>>>14|P<<2)&8191,U=e[i+12]&255|(e[i+13]&255)<<8,g+=(P>>>11|U<<5)&8191,q=e[i+14]&255|(e[i+15]&255)<<8,m+=(U>>>8|q<<8)&8191,M+=q>>>5|r,S=0,L=S,L+=B*j,L+=C*(5*Z),L+=v*(5*$),L+=p*(5*G),L+=d*(5*k),S=L>>>13,L&=8191,L+=A*(5*J),L+=l*(5*X),L+=g*(5*s),L+=m*(5*H),L+=M*(5*F),S+=L>>>13,L&=8191,I=S,I+=B*F,I+=C*j,I+=v*(5*Z),I+=p*(5*$),I+=d*(5*G),S=I>>>13,I&=8191,I+=A*(5*k),I+=l*(5*J),I+=g*(5*X),I+=m*(5*s),I+=M*(5*H),S+=I>>>13,I&=8191,Y=S,Y+=B*H,Y+=C*F,Y+=v*j,Y+=p*(5*Z),Y+=d*(5*$),S=Y>>>13,Y&=8191,Y+=A*(5*G),Y+=l*(5*k),Y+=g*(5*J),Y+=m*(5*X),Y+=M*(5*s),S+=Y>>>13,Y&=8191,O=S,O+=B*s,O+=C*H,O+=v*F,O+=p*j,O+=d*(5*Z),S=O>>>13,O&=8191,O+=A*(5*$),O+=l*(5*G),O+=g*(5*k),O+=m*(5*J),O+=M*(5*X),S+=O>>>13,O&=8191,R=S,R+=B*X,R+=C*s,R+=v*H,R+=p*F,R+=d*j,S=R>>>13,R&=8191,R+=A*(5*Z),R+=l*(5*$),R+=g*(5*G),R+=m*(5*k),R+=M*(5*J),S+=R>>>13,R&=8191,z=S,z+=B*J,z+=C*X,z+=v*s,z+=p*H,z+=d*F,S=z>>>13,z&=8191,z+=A*j,z+=l*(5*Z),z+=g*(5*$),z+=m*(5*G),z+=M*(5*k),S+=z>>>13,z&=8191,N=S,N+=B*k,N+=C*J,N+=v*X,N+=p*s,N+=d*H,S=N>>>13,N&=8191,N+=A*F,N+=l*j,N+=g*(5*Z),N+=m*(5*$),N+=M*(5*G),S+=N>>>13,N&=8191,_=S,_+=B*G,_+=C*k,_+=v*J,_+=p*X,_+=d*s,S=_>>>13,_&=8191,_+=A*H,_+=l*F,_+=g*j,_+=m*(5*Z),_+=M*(5*$),S+=_>>>13,_&=8191,T=S,T+=B*$,T+=C*G,T+=v*k,T+=p*J,T+=d*X,S=T>>>13,T&=8191,T+=A*s,T+=l*H,T+=g*F,T+=m*j,T+=M*(5*Z),S+=T>>>13,T&=8191,K=S,K+=B*Z,K+=C*$,K+=v*G,K+=p*k,K+=d*J,S=K>>>13,K&=8191,K+=A*X,K+=l*s,K+=g*H,K+=m*F,K+=M*j,S+=K>>>13,K&=8191,S=(S<<2)+S|0,S=S+L|0,L=S&8191,S=S>>>13,I+=S,B=L,C=I,v=Y,p=O,d=R,A=z,l=N,g=_,m=T,M=K,i+=16,f-=16;this.h[0]=B,this.h[1]=C,this.h[2]=v,this.h[3]=p,this.h[4]=d,this.h[5]=A,this.h[6]=l,this.h[7]=g,this.h[8]=m,this.h[9]=M},Ke.prototype.finish=function(e,i){var f=new Uint16Array(10),r,o,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,f[0]=this.h[0]+5,r=f[0]>>>13,f[0]&=8191,u=1;u<10;u++)f[u]=this.h[u]+r,r=f[u]>>>13,f[u]&=8191;for(f[9]-=8192,o=(r^1)-1,u=0;u<10;u++)f[u]&=o;for(o=~o,u=0;u<10;u++)this.h[u]=this.h[u]&o|f[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[i+0]=this.h[0]>>>0&255,e[i+1]=this.h[0]>>>8&255,e[i+2]=this.h[1]>>>0&255,e[i+3]=this.h[1]>>>8&255,e[i+4]=this.h[2]>>>0&255,e[i+5]=this.h[2]>>>8&255,e[i+6]=this.h[3]>>>0&255,e[i+7]=this.h[3]>>>8&255,e[i+8]=this.h[4]>>>0&255,e[i+9]=this.h[4]>>>8&255,e[i+10]=this.h[5]>>>0&255,e[i+11]=this.h[5]>>>8&255,e[i+12]=this.h[6]>>>0&255,e[i+13]=this.h[6]>>>8&255,e[i+14]=this.h[7]>>>0&255,e[i+15]=this.h[7]>>>8&255},Ke.prototype.update=function(e,i,f){var r,o;if(this.leftover){for(o=16-this.leftover,o>f&&(o=f),r=0;r<o;r++)this.buffer[this.leftover+r]=e[i+r];if(f-=o,i+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(f>=16&&(o=f-f%16,this.blocks(e,i,o),i+=o,f-=o),f){for(r=0;r<f;r++)this.buffer[this.leftover+r]=e[i+r];this.leftover+=f}};function He(e,i,f,r,o,x){var u=new Ke(x);return u.update(f,r,o),u.finish(e,i),0}c(He,"crypto_onetimeauth");function $t(e,i,f,r,o,x){var u=new Uint8Array(16);return He(u,0,f,r,o,x),ur(e,i,u,0)}c($t,"crypto_onetimeauth_verify");function Fe(e,i,f,r,o){var x;if(f<32)return-1;for(Nr(e,0,i,0,f,r,o),He(e,16,e,32,f-32,e),x=0;x<16;x++)e[x]=0;return 0}c(Fe,"crypto_secretbox");function Ge(e,i,f,r,o){var x,u=new Uint8Array(32);if(f<32||(vr(u,0,32,r,o),$t(i,16,i,32,f-32,u)!==0))return-1;for(Nr(e,0,i,0,f,r,o),x=0;x<32;x++)e[x]=0;return 0}c(Ge,"crypto_secretbox_open");function Mr(e,i){var f;for(f=0;f<16;f++)e[f]=i[f]|0}c(Mr,"set25519");function Ve(e){var i,f,r=1;for(i=0;i<16;i++)f=e[i]+r+65535,r=Math.floor(f/65536),e[i]=f-r*65536;e[0]+=r-1+37*(r-1)}c(Ve,"car25519");function Zr(e,i,f){for(var r,o=~(f-1),x=0;x<16;x++)r=o&(e[x]^i[x]),e[x]^=r,i[x]^=r}c(Zr,"sel25519");function qr(e,i){var f,r,o,x=t(),u=t();for(f=0;f<16;f++)u[f]=i[f];for(Ve(u),Ve(u),Ve(u),r=0;r<2;r++){for(x[0]=u[0]-65517,f=1;f<15;f++)x[f]=u[f]-65535-(x[f-1]>>16&1),x[f-1]&=65535;x[15]=u[15]-32767-(x[14]>>16&1),o=x[15]>>16&1,x[14]&=65535,Zr(u,x,1-o)}for(f=0;f<16;f++)e[2*f]=u[f]&255,e[2*f+1]=u[f]>>8}c(qr,"pack25519");function Zt(e,i){var f=new Uint8Array(32),r=new Uint8Array(32);return qr(f,e),qr(r,i),_r(f,0,r,0)}c(Zt,"neq25519");function qt(e){var i=new Uint8Array(32);return qr(i,e),i[0]&1}c(qt,"par25519");function Xe(e,i){var f;for(f=0;f<16;f++)e[f]=i[2*f]+(i[2*f+1]<<8);e[15]&=32767}c(Xe,"unpack25519");function Cr(e,i,f){for(var r=0;r<16;r++)e[r]=i[r]+f[r]}c(Cr,"A");function Pr(e,i,f){for(var r=0;r<16;r++)e[r]=i[r]-f[r]}c(Pr,"Z");function W(e,i,f){var r,o,x=0,u=0,b=0,w=0,P=0,U=0,q=0,S=0,L=0,I=0,Y=0,O=0,R=0,z=0,N=0,_=0,T=0,K=0,B=0,C=0,v=0,p=0,d=0,A=0,l=0,g=0,m=0,M=0,j=0,F=0,H=0,s=f[0],X=f[1],J=f[2],k=f[3],G=f[4],$=f[5],Z=f[6],ar=f[7],rr=f[8],tr=f[9],nr=f[10],fr=f[11],sr=f[12],pr=f[13],dr=f[14],lr=f[15];r=i[0],x+=r*s,u+=r*X,b+=r*J,w+=r*k,P+=r*G,U+=r*$,q+=r*Z,S+=r*ar,L+=r*rr,I+=r*tr,Y+=r*nr,O+=r*fr,R+=r*sr,z+=r*pr,N+=r*dr,_+=r*lr,r=i[1],u+=r*s,b+=r*X,w+=r*J,P+=r*k,U+=r*G,q+=r*$,S+=r*Z,L+=r*ar,I+=r*rr,Y+=r*tr,O+=r*nr,R+=r*fr,z+=r*sr,N+=r*pr,_+=r*dr,T+=r*lr,r=i[2],b+=r*s,w+=r*X,P+=r*J,U+=r*k,q+=r*G,S+=r*$,L+=r*Z,I+=r*ar,Y+=r*rr,O+=r*tr,R+=r*nr,z+=r*fr,N+=r*sr,_+=r*pr,T+=r*dr,K+=r*lr,r=i[3],w+=r*s,P+=r*X,U+=r*J,q+=r*k,S+=r*G,L+=r*$,I+=r*Z,Y+=r*ar,O+=r*rr,R+=r*tr,z+=r*nr,N+=r*fr,_+=r*sr,T+=r*pr,K+=r*dr,B+=r*lr,r=i[4],P+=r*s,U+=r*X,q+=r*J,S+=r*k,L+=r*G,I+=r*$,Y+=r*Z,O+=r*ar,R+=r*rr,z+=r*tr,N+=r*nr,_+=r*fr,T+=r*sr,K+=r*pr,B+=r*dr,C+=r*lr,r=i[5],U+=r*s,q+=r*X,S+=r*J,L+=r*k,I+=r*G,Y+=r*$,O+=r*Z,R+=r*ar,z+=r*rr,N+=r*tr,_+=r*nr,T+=r*fr,K+=r*sr,B+=r*pr,C+=r*dr,v+=r*lr,r=i[6],q+=r*s,S+=r*X,L+=r*J,I+=r*k,Y+=r*G,O+=r*$,R+=r*Z,z+=r*ar,N+=r*rr,_+=r*tr,T+=r*nr,K+=r*fr,B+=r*sr,C+=r*pr,v+=r*dr,p+=r*lr,r=i[7],S+=r*s,L+=r*X,I+=r*J,Y+=r*k,O+=r*G,R+=r*$,z+=r*Z,N+=r*ar,_+=r*rr,T+=r*tr,K+=r*nr,B+=r*fr,C+=r*sr,v+=r*pr,p+=r*dr,d+=r*lr,r=i[8],L+=r*s,I+=r*X,Y+=r*J,O+=r*k,R+=r*G,z+=r*$,N+=r*Z,_+=r*ar,T+=r*rr,K+=r*tr,B+=r*nr,C+=r*fr,v+=r*sr,p+=r*pr,d+=r*dr,A+=r*lr,r=i[9],I+=r*s,Y+=r*X,O+=r*J,R+=r*k,z+=r*G,N+=r*$,_+=r*Z,T+=r*ar,K+=r*rr,B+=r*tr,C+=r*nr,v+=r*fr,p+=r*sr,d+=r*pr,A+=r*dr,l+=r*lr,r=i[10],Y+=r*s,O+=r*X,R+=r*J,z+=r*k,N+=r*G,_+=r*$,T+=r*Z,K+=r*ar,B+=r*rr,C+=r*tr,v+=r*nr,p+=r*fr,d+=r*sr,A+=r*pr,l+=r*dr,g+=r*lr,r=i[11],O+=r*s,R+=r*X,z+=r*J,N+=r*k,_+=r*G,T+=r*$,K+=r*Z,B+=r*ar,C+=r*rr,v+=r*tr,p+=r*nr,d+=r*fr,A+=r*sr,l+=r*pr,g+=r*dr,m+=r*lr,r=i[12],R+=r*s,z+=r*X,N+=r*J,_+=r*k,T+=r*G,K+=r*$,B+=r*Z,C+=r*ar,v+=r*rr,p+=r*tr,d+=r*nr,A+=r*fr,l+=r*sr,g+=r*pr,m+=r*dr,M+=r*lr,r=i[13],z+=r*s,N+=r*X,_+=r*J,T+=r*k,K+=r*G,B+=r*$,C+=r*Z,v+=r*ar,p+=r*rr,d+=r*tr,A+=r*nr,l+=r*fr,g+=r*sr,m+=r*pr,M+=r*dr,j+=r*lr,r=i[14],N+=r*s,_+=r*X,T+=r*J,K+=r*k,B+=r*G,C+=r*$,v+=r*Z,p+=r*ar,d+=r*rr,A+=r*tr,l+=r*nr,g+=r*fr,m+=r*sr,M+=r*pr,j+=r*dr,F+=r*lr,r=i[15],_+=r*s,T+=r*X,K+=r*J,B+=r*k,C+=r*G,v+=r*$,p+=r*Z,d+=r*ar,A+=r*rr,l+=r*tr,g+=r*nr,m+=r*fr,M+=r*sr,j+=r*pr,F+=r*dr,H+=r*lr,x+=38*T,u+=38*K,b+=38*B,w+=38*C,P+=38*v,U+=38*p,q+=38*d,S+=38*A,L+=38*l,I+=38*g,Y+=38*m,O+=38*M,R+=38*j,z+=38*F,N+=38*H,o=1,r=x+o+65535,o=Math.floor(r/65536),x=r-o*65536,r=u+o+65535,o=Math.floor(r/65536),u=r-o*65536,r=b+o+65535,o=Math.floor(r/65536),b=r-o*65536,r=w+o+65535,o=Math.floor(r/65536),w=r-o*65536,r=P+o+65535,o=Math.floor(r/65536),P=r-o*65536,r=U+o+65535,o=Math.floor(r/65536),U=r-o*65536,r=q+o+65535,o=Math.floor(r/65536),q=r-o*65536,r=S+o+65535,o=Math.floor(r/65536),S=r-o*65536,r=L+o+65535,o=Math.floor(r/65536),L=r-o*65536,r=I+o+65535,o=Math.floor(r/65536),I=r-o*65536,r=Y+o+65535,o=Math.floor(r/65536),Y=r-o*65536,r=O+o+65535,o=Math.floor(r/65536),O=r-o*65536,r=R+o+65535,o=Math.floor(r/65536),R=r-o*65536,r=z+o+65535,o=Math.floor(r/65536),z=r-o*65536,r=N+o+65535,o=Math.floor(r/65536),N=r-o*65536,r=_+o+65535,o=Math.floor(r/65536),_=r-o*65536,x+=o-1+37*(o-1),o=1,r=x+o+65535,o=Math.floor(r/65536),x=r-o*65536,r=u+o+65535,o=Math.floor(r/65536),u=r-o*65536,r=b+o+65535,o=Math.floor(r/65536),b=r-o*65536,r=w+o+65535,o=Math.floor(r/65536),w=r-o*65536,r=P+o+65535,o=Math.floor(r/65536),P=r-o*65536,r=U+o+65535,o=Math.floor(r/65536),U=r-o*65536,r=q+o+65535,o=Math.floor(r/65536),q=r-o*65536,r=S+o+65535,o=Math.floor(r/65536),S=r-o*65536,r=L+o+65535,o=Math.floor(r/65536),L=r-o*65536,r=I+o+65535,o=Math.floor(r/65536),I=r-o*65536,r=Y+o+65535,o=Math.floor(r/65536),Y=r-o*65536,r=O+o+65535,o=Math.floor(r/65536),O=r-o*65536,r=R+o+65535,o=Math.floor(r/65536),R=r-o*65536,r=z+o+65535,o=Math.floor(r/65536),z=r-o*65536,r=N+o+65535,o=Math.floor(r/65536),N=r-o*65536,r=_+o+65535,o=Math.floor(r/65536),_=r-o*65536,x+=o-1+37*(o-1),e[0]=x,e[1]=u,e[2]=b,e[3]=w,e[4]=P,e[5]=U,e[6]=q,e[7]=S,e[8]=L,e[9]=I,e[10]=Y,e[11]=O,e[12]=R,e[13]=z,e[14]=N,e[15]=_}c(W,"M");function Ur(e,i){W(e,i,i)}c(Ur,"S");function Jt(e,i){var f=t(),r;for(r=0;r<16;r++)f[r]=i[r];for(r=253;r>=0;r--)Ur(f,f),r!==2&&r!==4&&W(f,f,i);for(r=0;r<16;r++)e[r]=f[r]}c(Jt,"inv25519");function kt(e,i){var f=t(),r;for(r=0;r<16;r++)f[r]=i[r];for(r=250;r>=0;r--)Ur(f,f),r!==1&&W(f,f,i);for(r=0;r<16;r++)e[r]=f[r]}c(kt,"pow2523");function Se(e,i,f){var r=new Uint8Array(32),o=new Float64Array(80),x,u,b=t(),w=t(),P=t(),U=t(),q=t(),S=t();for(u=0;u<31;u++)r[u]=i[u];for(r[31]=i[31]&127|64,r[0]&=248,Xe(o,f),u=0;u<16;u++)w[u]=o[u],U[u]=b[u]=P[u]=0;for(b[0]=U[0]=1,u=254;u>=0;--u)x=r[u>>>3]>>>(u&7)&1,Zr(b,w,x),Zr(P,U,x),Cr(q,b,P),Pr(b,b,P),Cr(P,w,U),Pr(w,w,U),Ur(U,q),Ur(S,b),W(b,P,b),W(P,w,q),Cr(q,b,P),Pr(b,b,P),Ur(w,b),Pr(P,U,S),W(b,P,er),Cr(b,b,U),W(P,P,b),W(b,U,S),W(U,w,o),Ur(w,q),Zr(b,w,x),Zr(P,U,x);for(u=0;u<16;u++)o[u+16]=b[u],o[u+32]=P[u],o[u+48]=w[u],o[u+64]=U[u];var L=o.subarray(32),I=o.subarray(16);return Jt(L,L),W(I,I,L),qr(e,I),0}c(Se,"crypto_scalarmult");function _e(e,i){return Se(e,i,h)}c(_e,"crypto_scalarmult_base");function Qt(e,i){return a(i,32),_e(e,i)}c(Qt,"crypto_box_keypair");function Be(e,i,f){var r=new Uint8Array(32);return Se(r,f,i),hr(e,y,r,cr)}c(Be,"crypto_box_beforenm");var rn=Fe,Gn=Ge;function Vn(e,i,f,r,o,x){var u=new Uint8Array(32);return Be(u,o,x),rn(e,i,f,r,u)}c(Vn,"crypto_box");function Xn(e,i,f,r,o,x){var u=new Uint8Array(32);return Be(u,o,x),Gn(e,i,f,r,u)}c(Xn,"crypto_box_open");var en=[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 tn(e,i,f,r){for(var o=new Int32Array(16),x=new Int32Array(16),u,b,w,P,U,q,S,L,I,Y,O,R,z,N,_,T,K,B,C,v,p,d,A,l,g,m,M=e[0],j=e[1],F=e[2],H=e[3],s=e[4],X=e[5],J=e[6],k=e[7],G=i[0],$=i[1],Z=i[2],ar=i[3],rr=i[4],tr=i[5],nr=i[6],fr=i[7],sr=0;r>=128;){for(C=0;C<16;C++)v=8*C+sr,o[C]=f[v+0]<<24|f[v+1]<<16|f[v+2]<<8|f[v+3],x[C]=f[v+4]<<24|f[v+5]<<16|f[v+6]<<8|f[v+7];for(C=0;C<80;C++)if(u=M,b=j,w=F,P=H,U=s,q=X,S=J,L=k,I=G,Y=$,O=Z,R=ar,z=rr,N=tr,_=nr,T=fr,p=k,d=fr,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=(s>>>14|rr<<18)^(s>>>18|rr<<14)^(rr>>>9|s<<23),d=(rr>>>14|s<<18)^(rr>>>18|s<<14)^(s>>>9|rr<<23),A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,p=s&X^~s&J,d=rr&tr^~rr&nr,A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,p=en[C*2],d=en[C*2+1],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,p=o[C%16],d=x[C%16],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,K=g&65535|m<<16,B=A&65535|l<<16,p=K,d=B,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=(M>>>28|G<<4)^(G>>>2|M<<30)^(G>>>7|M<<25),d=(G>>>28|M<<4)^(M>>>2|G<<30)^(M>>>7|G<<25),A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,p=M&j^M&F^j&F,d=G&$^G&Z^$&Z,A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,L=g&65535|m<<16,T=A&65535|l<<16,p=P,d=R,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=K,d=B,A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,P=g&65535|m<<16,R=A&65535|l<<16,j=u,F=b,H=w,s=P,X=U,J=q,k=S,M=L,$=I,Z=Y,ar=O,rr=R,tr=z,nr=N,fr=_,G=T,C%16===15)for(v=0;v<16;v++)p=o[v],d=x[v],A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=o[(v+9)%16],d=x[(v+9)%16],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,K=o[(v+1)%16],B=x[(v+1)%16],p=(K>>>1|B<<31)^(K>>>8|B<<24)^K>>>7,d=(B>>>1|K<<31)^(B>>>8|K<<24)^(B>>>7|K<<25),A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,K=o[(v+14)%16],B=x[(v+14)%16],p=(K>>>19|B<<13)^(B>>>29|K<<3)^K>>>6,d=(B>>>19|K<<13)^(K>>>29|B<<3)^(B>>>6|K<<26),A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,o[v]=g&65535|m<<16,x[v]=A&65535|l<<16;p=M,d=G,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[0],d=i[0],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[0]=M=g&65535|m<<16,i[0]=G=A&65535|l<<16,p=j,d=$,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[1],d=i[1],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[1]=j=g&65535|m<<16,i[1]=$=A&65535|l<<16,p=F,d=Z,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[2],d=i[2],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[2]=F=g&65535|m<<16,i[2]=Z=A&65535|l<<16,p=H,d=ar,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[3],d=i[3],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[3]=H=g&65535|m<<16,i[3]=ar=A&65535|l<<16,p=s,d=rr,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[4],d=i[4],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[4]=s=g&65535|m<<16,i[4]=rr=A&65535|l<<16,p=X,d=tr,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[5],d=i[5],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[5]=X=g&65535|m<<16,i[5]=tr=A&65535|l<<16,p=J,d=nr,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[6],d=i[6],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[6]=J=g&65535|m<<16,i[6]=nr=A&65535|l<<16,p=k,d=fr,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[7],d=i[7],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[7]=k=g&65535|m<<16,i[7]=fr=A&65535|l<<16,sr+=128,r-=128}return r}c(tn,"crypto_hashblocks_hl");function Hr(e,i,f){var r=new Int32Array(8),o=new Int32Array(8),x=new Uint8Array(256),u,b=f;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,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,tn(r,o,i,f),f%=128,u=0;u<f;u++)x[u]=i[b-f+u];for(x[f]=128,f=256-128*(f<112?1:0),x[f-9]=0,Ue(x,f-8,b/536870912|0,b<<3),tn(r,o,x,f),u=0;u<8;u++)Ue(e,8*u,r[u],o[u]);return 0}c(Hr,"crypto_hash");function Ce(e,i){var f=t(),r=t(),o=t(),x=t(),u=t(),b=t(),w=t(),P=t(),U=t();Pr(f,e[1],e[0]),Pr(U,i[1],i[0]),W(f,f,U),Cr(r,e[0],e[1]),Cr(U,i[0],i[1]),W(r,r,U),W(o,e[3],i[3]),W(o,o,Rr),W(x,e[2],i[2]),Cr(x,x,x),Pr(u,r,f),Pr(b,x,o),Cr(w,x,o),Cr(P,r,f),W(e[0],u,b),W(e[1],P,w),W(e[2],w,b),W(e[3],u,P)}c(Ce,"add");function nn(e,i,f){var r;for(r=0;r<4;r++)Zr(e[r],i[r],f)}c(nn,"cswap");function We(e,i){var f=t(),r=t(),o=t();Jt(o,i[2]),W(f,i[0],o),W(r,i[1],o),qr(e,r),e[31]^=qt(f)<<7}c(We,"pack");function $e(e,i,f){var r,o;for(Mr(e[0],E),Mr(e[1],D),Mr(e[2],D),Mr(e[3],E),o=255;o>=0;--o)r=f[o/8|0]>>(o&7)&1,nn(e,i,r),Ce(i,e),Ce(e,e),nn(e,i,r)}c($e,"scalarmult");function Pe(e,i){var f=[t(),t(),t(),t()];Mr(f[0],br),Mr(f[1],Dr),Mr(f[2],D),W(f[3],br,Dr),$e(e,f,i)}c(Pe,"scalarbase");function Ze(e,i,f){var r=new Uint8Array(64),o=[t(),t(),t(),t()],x;for(f||a(i,32),Hr(r,i,32),r[0]&=248,r[31]&=127,r[31]|=64,Pe(o,r),We(e,o),x=0;x<32;x++)i[x+32]=e[x];return 0}c(Ze,"crypto_sign_keypair");var Te=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 qe(e,i){var f,r,o,x;for(r=63;r>=32;--r){for(f=0,o=r-32,x=r-12;o<x;++o)i[o]+=f-16*i[r]*Te[o-(r-32)],f=Math.floor((i[o]+128)/256),i[o]-=f*256;i[o]+=f,i[r]=0}for(f=0,o=0;o<32;o++)i[o]+=f-(i[31]>>4)*Te[o],f=i[o]>>8,i[o]&=255;for(o=0;o<32;o++)i[o]-=f*Te[o];for(r=0;r<32;r++)i[r+1]+=i[r]>>8,e[r]=i[r]&255}c(qe,"modL");function Je(e){var i=new Float64Array(64),f;for(f=0;f<64;f++)i[f]=e[f];for(f=0;f<64;f++)e[f]=0;qe(e,i)}c(Je,"reduce");function fn(e,i,f,r){var o=new Uint8Array(64),x=new Uint8Array(64),u=new Uint8Array(64),b,w,P=new Float64Array(64),U=[t(),t(),t(),t()];Hr(o,r,32),o[0]&=248,o[31]&=127,o[31]|=64;var q=f+64;for(b=0;b<f;b++)e[64+b]=i[b];for(b=0;b<32;b++)e[32+b]=o[32+b];for(Hr(u,e.subarray(32),f+32),Je(u),Pe(U,u),We(e,U),b=32;b<64;b++)e[b]=r[b];for(Hr(x,e,f+64),Je(x),b=0;b<64;b++)P[b]=0;for(b=0;b<32;b++)P[b]=u[b];for(b=0;b<32;b++)for(w=0;w<32;w++)P[b+w]+=x[b]*o[w];return qe(e.subarray(32),P),q}c(fn,"crypto_sign");function Wn(e,i){var f=t(),r=t(),o=t(),x=t(),u=t(),b=t(),w=t();return Mr(e[2],D),Xe(e[1],i),Ur(o,e[1]),W(x,o,yr),Pr(o,o,e[2]),Cr(x,e[2],x),Ur(u,x),Ur(b,u),W(w,b,u),W(f,w,o),W(f,f,x),kt(f,f),W(f,f,o),W(f,f,x),W(f,f,x),W(e[0],f,x),Ur(r,e[0]),W(r,r,x),Zt(r,o)&&W(e[0],e[0],$r),Ur(r,e[0]),W(r,r,x),Zt(r,o)?-1:(qt(e[0])===i[31]>>7&&Pr(e[0],E,e[0]),W(e[3],e[0],e[1]),0)}c(Wn,"unpackneg");function ke(e,i,f,r){var o,x=new Uint8Array(32),u=new Uint8Array(64),b=[t(),t(),t(),t()],w=[t(),t(),t(),t()];if(f<64||Wn(w,r))return-1;for(o=0;o<f;o++)e[o]=i[o];for(o=0;o<32;o++)e[o+32]=r[o];if(Hr(u,e,f),Je(u),$e(b,w,u),Pe(w,i.subarray(32)),Ce(b,w),We(x,b),f-=64,_r(i,0,x,0)){for(o=0;o<f;o++)e[o]=0;return-1}for(o=0;o<f;o++)e[o]=i[o+64];return f}c(ke,"crypto_sign_open");var Qe=32,De=24,se=32,Jr=16,ce=32,Me=32,xe=32,ye=32,rt=32,on=De,$n=se,Zn=Jr,Lr=64,Fr=32,kr=64,et=32,tt=64;n.lowlevel={crypto_core_hsalsa20:hr,crypto_stream_xor:Nr,crypto_stream:vr,crypto_stream_salsa20_xor:Br,crypto_stream_salsa20:Ar,crypto_onetimeauth:He,crypto_onetimeauth_verify:$t,crypto_verify_16:ur,crypto_verify_32:_r,crypto_secretbox:Fe,crypto_secretbox_open:Ge,crypto_scalarmult:Se,crypto_scalarmult_base:_e,crypto_box_beforenm:Be,crypto_box_afternm:rn,crypto_box:Vn,crypto_box_open:Xn,crypto_box_keypair:Qt,crypto_hash:Hr,crypto_sign:fn,crypto_sign_keypair:Ze,crypto_sign_open:ke,crypto_secretbox_KEYBYTES:Qe,crypto_secretbox_NONCEBYTES:De,crypto_secretbox_ZEROBYTES:se,crypto_secretbox_BOXZEROBYTES:Jr,crypto_scalarmult_BYTES:ce,crypto_scalarmult_SCALARBYTES:Me,crypto_box_PUBLICKEYBYTES:xe,crypto_box_SECRETKEYBYTES:ye,crypto_box_BEFORENMBYTES:rt,crypto_box_NONCEBYTES:on,crypto_box_ZEROBYTES:$n,crypto_box_BOXZEROBYTES:Zn,crypto_sign_BYTES:Lr,crypto_sign_PUBLICKEYBYTES:Fr,crypto_sign_SECRETKEYBYTES:kr,crypto_sign_SEEDBYTES:et,crypto_hash_BYTES:tt,gf:t,D:yr,L:Te,pack25519:qr,unpack25519:Xe,M:W,A:Cr,S:Ur,Z:Pr,pow2523:kt,add:Ce,set25519:Mr,modL:qe,scalarmult:$e,scalarbase:Pe};function an(e,i){if(e.length!==Qe)throw new Error("bad key size");if(i.length!==De)throw new Error("bad nonce size")}c(an,"checkLengths");function qn(e,i){if(e.length!==xe)throw new Error("bad public key size");if(i.length!==ye)throw new Error("bad secret key size")}c(qn,"checkBoxLengths");function wr(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}c(wr,"checkArrayTypes");function sn(e){for(var i=0;i<e.length;i++)e[i]=0}c(sn,"cleanup"),n.randomBytes=function(e){var i=new Uint8Array(e);return a(i,e),i},n.secretbox=function(e,i,f){wr(e,i,f),an(f,i);for(var r=new Uint8Array(se+e.length),o=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+se]=e[x];return Fe(o,r,r.length,i,f),o.subarray(Jr)},n.secretbox.open=function(e,i,f){wr(e,i,f),an(f,i);for(var r=new Uint8Array(Jr+e.length),o=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+Jr]=e[x];return r.length<32||Ge(o,r,r.length,i,f)!==0?null:o.subarray(se)},n.secretbox.keyLength=Qe,n.secretbox.nonceLength=De,n.secretbox.overheadLength=Jr,n.scalarMult=function(e,i){if(wr(e,i),e.length!==Me)throw new Error("bad n size");if(i.length!==ce)throw new Error("bad p size");var f=new Uint8Array(ce);return Se(f,e,i),f},n.scalarMult.base=function(e){if(wr(e),e.length!==Me)throw new Error("bad n size");var i=new Uint8Array(ce);return _e(i,e),i},n.scalarMult.scalarLength=Me,n.scalarMult.groupElementLength=ce,n.box=function(e,i,f,r){var o=n.box.before(f,r);return n.secretbox(e,i,o)},n.box.before=function(e,i){wr(e,i),qn(e,i);var f=new Uint8Array(rt);return Be(f,e,i),f},n.box.after=n.secretbox,n.box.open=function(e,i,f,r){var o=n.box.before(f,r);return n.secretbox.open(e,i,o)},n.box.open.after=n.secretbox.open,n.box.keyPair=function(){var e=new Uint8Array(xe),i=new Uint8Array(ye);return Qt(e,i),{publicKey:e,secretKey:i}},n.box.keyPair.fromSecretKey=function(e){if(wr(e),e.length!==ye)throw new Error("bad secret key size");var i=new Uint8Array(xe);return _e(i,e),{publicKey:i,secretKey:new Uint8Array(e)}},n.box.publicKeyLength=xe,n.box.secretKeyLength=ye,n.box.sharedKeyLength=rt,n.box.nonceLength=on,n.box.overheadLength=n.secretbox.overheadLength,n.sign=function(e,i){if(wr(e,i),i.length!==kr)throw new Error("bad secret key size");var f=new Uint8Array(Lr+e.length);return fn(f,e,e.length,i),f},n.sign.open=function(e,i){if(wr(e,i),i.length!==Fr)throw new Error("bad public key size");var f=new Uint8Array(e.length),r=ke(f,e,e.length,i);if(r<0)return null;for(var o=new Uint8Array(r),x=0;x<o.length;x++)o[x]=f[x];return o},n.sign.detached=function(e,i){for(var f=n.sign(e,i),r=new Uint8Array(Lr),o=0;o<r.length;o++)r[o]=f[o];return r},n.sign.detached.verify=function(e,i,f){if(wr(e,i,f),i.length!==Lr)throw new Error("bad signature size");if(f.length!==Fr)throw new Error("bad public key size");var r=new Uint8Array(Lr+e.length),o=new Uint8Array(Lr+e.length),x;for(x=0;x<Lr;x++)r[x]=i[x];for(x=0;x<e.length;x++)r[x+Lr]=e[x];return ke(o,r,r.length,f)>=0},n.sign.keyPair=function(){var e=new Uint8Array(Fr),i=new Uint8Array(kr);return Ze(e,i),{publicKey:e,secretKey:i}},n.sign.keyPair.fromSecretKey=function(e){if(wr(e),e.length!==kr)throw new Error("bad secret key size");for(var i=new Uint8Array(Fr),f=0;f<i.length;f++)i[f]=e[32+f];return{publicKey:i,secretKey:new Uint8Array(e)}},n.sign.keyPair.fromSeed=function(e){if(wr(e),e.length!==et)throw new Error("bad seed size");for(var i=new Uint8Array(Fr),f=new Uint8Array(kr),r=0;r<32;r++)f[r]=e[r];return Ze(i,f,!0),{publicKey:i,secretKey:f}},n.sign.publicKeyLength=Fr,n.sign.secretKeyLength=kr,n.sign.seedLength=et,n.sign.signatureLength=Lr,n.hash=function(e){wr(e);var i=new Uint8Array(tt);return Hr(i,e,e.length),i},n.hash.hashLength=tt,n.verify=function(e,i){return wr(e,i),e.length===0||i.length===0||e.length!==i.length?!1:Q(e,0,i,0,e.length)===0},n.setPRNG=function(e){a=e},function(){var e=typeof self<"u"?self.crypto||self.msCrypto:null;if(e&&e.getRandomValues){var i=65536;n.setPRNG(function(f,r){var o,x=new Uint8Array(r);for(o=0;o<r;o+=i)e.getRandomValues(x.subarray(o,o+Math.min(r-o,i)));for(o=0;o<r;o++)f[o]=x[o];sn(x)})}else typeof cn<"u"&&(e=Ln(),e&&e.randomBytes&&n.setPRNG(function(f,r){var o,x=e.randomBytes(r);for(o=0;o<r;o++)f[o]=x[o];sn(x)}))}()})(typeof ze<"u"&&ze.exports?ze.exports:self.nacl=self.nacl||{})});function he(n=0){return new Uint8Array(n)}c(he,"allocUnsafe");function nt(n,t){t==null&&(t=n.reduce((h,E)=>h+E.length,0));let a=he(t),y=0;for(let h of n)a.set(h,y),y+=h.length;return a}c(nt,"concat");var ut={};Kr(ut,{base10:()=>uf});var ro=new Uint8Array(0);function yn(n,t){if(n===t)return!0;if(n.byteLength!==t.byteLength)return!1;for(let a=0;a<n.byteLength;a++)if(n[a]!==t[a])return!1;return!0}c(yn,"equals");function Ir(n){if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")}c(Ir,"coerce");function un(n){return new TextEncoder().encode(n)}c(un,"fromString");function hn(n){return new TextDecoder().decode(n)}c(hn,"toString");function af(n,t){if(n.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),y=0;y<a.length;y++)a[y]=255;for(var h=0;h<n.length;h++){var E=n.charAt(h),D=E.charCodeAt(0);if(a[D]!==255)throw new TypeError(E+" is ambiguous");a[D]=h}var er=n.length,yr=n.charAt(0),Rr=Math.log(er)/Math.log(256),br=Math.log(256)/Math.log(er);function Dr(Q){if(Q instanceof Uint8Array||(ArrayBuffer.isView(Q)?Q=new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength):Array.isArray(Q)&&(Q=Uint8Array.from(Q))),!(Q instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(Q.length===0)return"";for(var ur=0,_r=0,mr=0,Er=Q.length;mr!==Er&&Q[mr]===0;)mr++,ur++;for(var gr=(Er-mr)*br+1>>>0,hr=new Uint8Array(gr);mr!==Er;){for(var cr=Q[mr],Br=0,Ar=gr-1;(cr!==0||Br<_r)&&Ar!==-1;Ar--,Br++)cr+=256*hr[Ar]>>>0,hr[Ar]=cr%er>>>0,cr=cr/er>>>0;if(cr!==0)throw new Error("Non-zero carry");_r=Br,mr++}for(var vr=gr-_r;vr!==gr&&hr[vr]===0;)vr++;for(var Nr=yr.repeat(ur);vr<gr;++vr)Nr+=n.charAt(hr[vr]);return Nr}c(Dr,"encode");function $r(Q){if(typeof Q!="string")throw new TypeError("Expected String");if(Q.length===0)return new Uint8Array;var ur=0;if(Q[ur]!==" "){for(var _r=0,mr=0;Q[ur]===yr;)_r++,ur++;for(var Er=(Q.length-ur)*Rr+1>>>0,gr=new Uint8Array(Er);Q[ur];){var hr=a[Q.charCodeAt(ur)];if(hr===255)return;for(var cr=0,Br=Er-1;(hr!==0||cr<mr)&&Br!==-1;Br--,cr++)hr+=er*gr[Br]>>>0,gr[Br]=hr%256>>>0,hr=hr/256>>>0;if(hr!==0)throw new Error("Non-zero carry");mr=cr,ur++}if(Q[ur]!==" "){for(var Ar=Er-mr;Ar!==Er&&gr[Ar]===0;)Ar++;for(var vr=new Uint8Array(_r+(Er-Ar)),Nr=_r;Ar!==Er;)vr[Nr++]=gr[Ar++];return vr}}}c($r,"decodeUnsafe");function Ue(Q){var ur=$r(Q);if(ur)return ur;throw new Error(`Non-${t} character`)}return c(Ue,"decode"),{encode:Dr,decodeUnsafe:$r,decode:Ue}}c(af,"base");var sf=af,cf=sf,dn=cf;var st=class st{constructor(t,a,y){V(this,"name");V(this,"prefix");V(this,"baseEncode");this.name=t,this.prefix=a,this.baseEncode=y}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}};c(st,"Encoder");var ft=st,ct=class ct{constructor(t,a,y){V(this,"name");V(this,"prefix");V(this,"baseDecode");V(this,"prefixCodePoint");this.name=t,this.prefix=a;let h=a.codePointAt(0);if(h===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=h,this.baseDecode=y}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return ln(this,t)}};c(ct,"Decoder");var it=ct,xt=class xt{constructor(t){V(this,"decoders");this.decoders=t}or(t){return ln(this,t)}decode(t){let a=t[0],y=this.decoders[a];if(y!=null)return y.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};c(xt,"ComposedDecoder");var ot=xt;function ln(n,t){return new ot({...n.decoders??{[n.prefix]:n},...t.decoders??{[t.prefix]:t}})}c(ln,"or");var yt=class yt{constructor(t,a,y,h){V(this,"name");V(this,"prefix");V(this,"baseEncode");V(this,"baseDecode");V(this,"encoder");V(this,"decoder");this.name=t,this.prefix=a,this.baseEncode=y,this.baseDecode=h,this.encoder=new ft(t,a,y),this.decoder=new it(t,a,h)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};c(yt,"Codec");var at=yt;function Qr({name:n,prefix:t,encode:a,decode:y}){return new at(n,t,a,y)}c(Qr,"from");function zr({name:n,prefix:t,alphabet:a}){let{encode:y,decode:h}=dn(a,n);return Qr({prefix:t,name:n,encode:y,decode:c(E=>Ir(h(E)),"decode")})}c(zr,"baseX");function xf(n,t,a,y){let h={};for(let br=0;br<t.length;++br)h[t[br]]=br;let E=n.length;for(;n[E-1]==="=";)--E;let D=new Uint8Array(E*a/8|0),er=0,yr=0,Rr=0;for(let br=0;br<E;++br){let Dr=h[n[br]];if(Dr===void 0)throw new SyntaxError(`Non-${y} character`);yr=yr<<a|Dr,er+=a,er>=8&&(er-=8,D[Rr++]=255&yr>>er)}if(er>=a||(255&yr<<8-er)!==0)throw new SyntaxError("Unexpected end of data");return D}c(xf,"decode");function yf(n,t,a){let y=t[t.length-1]==="=",h=(1<<a)-1,E="",D=0,er=0;for(let yr=0;yr<n.length;++yr)for(er=er<<8|n[yr],D+=8;D>a;)D-=a,E+=t[h&er>>D];if(D!==0&&(E+=t[h&er<<a-D]),y)for(;(E.length*a&7)!==0;)E+="=";return E}c(yf,"encode");function ir({name:n,prefix:t,bitsPerChar:a,alphabet:y}){return Qr({prefix:t,name:n,encode(h){return yf(h,y,a)},decode(h){return xf(h,y,a,n)}})}c(ir,"rfc4648");var uf=zr({prefix:"9",name:"base10",alphabet:"0123456789"});var ht={};Kr(ht,{base16:()=>hf,base16upper:()=>pf});var hf=ir({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),pf=ir({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var pt={};Kr(pt,{base2:()=>df});var df=ir({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var dt={};Kr(dt,{base256emoji:()=>mf});var bn=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}"),lf=bn.reduce((n,t,a)=>(n[a]=t,n),[]),bf=bn.reduce((n,t,a)=>{let y=t.codePointAt(0);if(y==null)throw new Error(`Invalid character: ${t}`);return n[y]=a,n},[]);function gf(n){return n.reduce((t,a)=>(t+=lf[a],t),"")}c(gf,"encode");function Af(n){let t=[];for(let a of n){let y=a.codePointAt(0);if(y==null)throw new Error(`Invalid character: ${a}`);let h=bf[y];if(h==null)throw new Error(`Non-base256emoji character: ${a}`);t.push(h)}return new Uint8Array(t)}c(Af,"decode");var mf=Qr({prefix:"\u{1F680}",name:"base256emoji",encode:gf,decode:Af});var lt={};Kr(lt,{base32:()=>re,base32hex:()=>Uf,base32hexpad:()=>Sf,base32hexpadupper:()=>_f,base32hexupper:()=>Kf,base32pad:()=>Ef,base32padupper:()=>vf,base32upper:()=>wf,base32z:()=>Bf});var re=ir({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),wf=ir({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ef=ir({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),vf=ir({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Uf=ir({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Kf=ir({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Sf=ir({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),_f=ir({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Bf=ir({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var bt={};Kr(bt,{base36:()=>pe,base36upper:()=>Cf});var pe=zr({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Cf=zr({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var gt={};Kr(gt,{base58btc:()=>Tr,base58flickr:()=>Pf});var Tr=zr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Pf=zr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var At={};Kr(At,{base64:()=>Tf,base64pad:()=>Df,base64url:()=>Mf,base64urlpad:()=>Lf});var Tf=ir({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Df=ir({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Mf=ir({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Lf=ir({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var mt={};Kr(mt,{base8:()=>If});var If=ir({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var wt={};Kr(wt,{identity:()=>Rf});var Rf=Qr({prefix:"\0",name:"identity",encode:c(n=>hn(n),"encode"),decode:c(n=>un(n),"decode")});var Eo=new TextEncoder,vo=new TextDecoder;var Ut={};Kr(Ut,{identity:()=>ii});var Of=mn,gn=128,Yf=127,jf=~Yf,Hf=Math.pow(2,31);function mn(n,t,a){t=t||[],a=a||0;for(var y=a;n>=Hf;)t[a++]=n&255|gn,n/=128;for(;n&jf;)t[a++]=n&255|gn,n>>>=7;return t[a]=n|0,mn.bytes=a-y+1,t}c(mn,"encode");var Ff=Et,Gf=128,An=127;function Et(n,y){var a=0,y=y||0,h=0,E=y,D,er=n.length;do{if(E>=er)throw Et.bytes=0,new RangeError("Could not decode varint");D=n[E++],a+=h<28?(D&An)<<h:(D&An)*Math.pow(2,h),h+=7}while(D>=Gf);return Et.bytes=E-y,a}c(Et,"read");var Vf=Math.pow(2,7),Xf=Math.pow(2,14),Wf=Math.pow(2,21),$f=Math.pow(2,28),Zf=Math.pow(2,35),qf=Math.pow(2,42),Jf=Math.pow(2,49),kf=Math.pow(2,56),Qf=Math.pow(2,63),ri=c(function(n){return n<Vf?1:n<Xf?2:n<Wf?3:n<$f?4:n<Zf?5:n<qf?6:n<Jf?7:n<kf?8:n<Qf?9:10},"length"),ei={encode:Of,decode:Ff,encodingLength:ri},ti=ei,de=ti;function le(n,t=0){return[de.decode(n,t),de.decode.bytes]}c(le,"decode");function ee(n,t,a=0){return de.encode(n,t,a),t}c(ee,"encodeTo");function te(n){return de.encodingLength(n)}c(te,"encodingLength");function Gr(n,t){let a=t.byteLength,y=te(n),h=y+te(a),E=new Uint8Array(h+a);return ee(n,E,0),ee(a,E,y),E.set(t,h),new ne(n,a,t,E)}c(Gr,"create");function wn(n){let t=Ir(n),[a,y]=le(t),[h,E]=le(t.subarray(y)),D=t.subarray(y+E);if(D.byteLength!==h)throw new Error("Incorrect length");return new ne(a,h,D,t)}c(wn,"decode");function En(n,t){if(n===t)return!0;{let a=t;return n.code===a.code&&n.size===a.size&&a.bytes instanceof Uint8Array&&yn(n.bytes,a.bytes)}}c(En,"equals");var vt=class vt{constructor(t,a,y,h){V(this,"code");V(this,"size");V(this,"digest");V(this,"bytes");this.code=t,this.size=a,this.digest=y,this.bytes=h}};c(vt,"Digest");var ne=vt;var vn=0,ni="identity",Un=Ir;function fi(n){return Gr(vn,Un(n))}c(fi,"digest");var ii={code:vn,name:ni,encode:Un,digest:fi};var Bt={};Kr(Bt,{sha256:()=>oi,sha512:()=>ai});function St({name:n,code:t,encode:a}){return new Kt(n,t,a)}c(St,"from");var _t=class _t{constructor(t,a,y){V(this,"name");V(this,"code");V(this,"encode");this.name=t,this.code=a,this.encode=y}digest(t){if(t instanceof Uint8Array){let a=this.encode(t);return a instanceof Uint8Array?Gr(this.code,a):a.then(y=>Gr(this.code,y))}else throw Error("Unknown type, must be binary type")}};c(_t,"Hasher");var Kt=_t;function Sn(n){return async t=>new Uint8Array(await crypto.subtle.digest(n,t))}c(Sn,"sha");var oi=St({name:"sha2-256",code:18,encode:Sn("SHA-256")}),ai=St({name:"sha2-512",code:19,encode:Sn("SHA-512")});function _n(n,t){let{bytes:a,version:y}=n;switch(y){case 0:return ci(a,Ct(n),t??Tr.encoder);default:return xi(a,Ct(n),t??re.encoder)}}c(_n,"format");var Bn=new WeakMap;function Ct(n){let t=Bn.get(n);if(t==null){let a=new Map;return Bn.set(n,a),a}return t}c(Ct,"baseCache");var Pn,xr=class xr{constructor(t,a,y,h){V(this,"code");V(this,"version");V(this,"multihash");V(this,"bytes");V(this,"/");V(this,Pn,"CID");this.code=a,this.version=t,this.multihash=y,this.bytes=h,this["/"]=h}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:t,multihash:a}=this;if(t!==ge)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(a.code!==yi)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return xr.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:t,digest:a}=this.multihash,y=Gr(t,a);return xr.createV1(this.code,y)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return xr.equals(this,t)}static equals(t,a){let y=a;return y!=null&&t.code===y.code&&t.version===y.version&&En(t.multihash,y.multihash)}toString(t){return _n(this,t)}toJSON(){return{"/":_n(this)}}link(){return this}[(Pn=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let a=t;if(a instanceof xr)return a;if(a["/"]!=null&&a["/"]===a.bytes||a.asCID===a){let{version:y,code:h,multihash:E,bytes:D}=a;return new xr(y,h,E,D??Cn(y,h,E.bytes))}else if(a[ui]===!0){let{version:y,multihash:h,code:E}=a,D=wn(h);return xr.create(y,E,D)}else return null}static create(t,a,y){if(typeof a!="number")throw new Error("String codecs are no longer supported");if(!(y.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(a!==ge)throw new Error(`Version 0 CID must use dag-pb (code: ${ge}) block encoding`);return new xr(t,a,y,y.bytes)}case 1:{let h=Cn(t,a,y.bytes);return new xr(t,a,y,h)}default:throw new Error("Invalid version")}}static createV0(t){return xr.create(0,ge,t)}static createV1(t,a){return xr.create(1,t,a)}static decode(t){let[a,y]=xr.decodeFirst(t);if(y.length!==0)throw new Error("Incorrect length");return a}static decodeFirst(t){let a=xr.inspectBytes(t),y=a.size-a.multihashSize,h=Ir(t.subarray(y,y+a.multihashSize));if(h.byteLength!==a.multihashSize)throw new Error("Incorrect length");let E=h.subarray(a.multihashSize-a.digestSize),D=new ne(a.multihashCode,a.digestSize,E,h);return[a.version===0?xr.createV0(D):xr.createV1(a.codec,D),t.subarray(a.size)]}static inspectBytes(t){let a=0,y=c(()=>{let[Dr,$r]=le(t.subarray(a));return a+=$r,Dr},"next"),h=y(),E=ge;if(h===18?(h=0,a=0):E=y(),h!==0&&h!==1)throw new RangeError(`Invalid CID version ${h}`);let D=a,er=y(),yr=y(),Rr=a+yr,br=Rr-D;return{version:h,codec:E,multihashCode:er,digestSize:yr,multihashSize:br,size:Rr}}static parse(t,a){let[y,h]=si(t,a),E=xr.decode(h);if(E.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ct(E).set(y,t),E}};c(xr,"CID");var Ie=xr;function si(n,t){switch(n[0]){case"Q":{let a=t??Tr;return[Tr.prefix,a.decode(`${Tr.prefix}${n}`)]}case Tr.prefix:{let a=t??Tr;return[Tr.prefix,a.decode(n)]}case re.prefix:{let a=t??re;return[re.prefix,a.decode(n)]}case pe.prefix:{let a=t??pe;return[pe.prefix,a.decode(n)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[n[0],t.decode(n)]}}}c(si,"parseCIDtoBytes");function ci(n,t,a){let{prefix:y}=a;if(y!==Tr.prefix)throw Error(`Cannot string encode V0 in ${a.name} encoding`);let h=t.get(y);if(h==null){let E=a.encode(n).slice(1);return t.set(y,E),E}else return h}c(ci,"toStringV0");function xi(n,t,a){let{prefix:y}=a,h=t.get(y);if(h==null){let E=a.encode(n);return t.set(y,E),E}else return h}c(xi,"toStringV1");var ge=112,yi=18;function Cn(n,t,a){let y=te(n),h=y+te(t),E=new Uint8Array(h+a.byteLength);return ee(n,E,0),ee(t,E,y),E.set(a,h),E}c(Cn,"encodeCID");var ui=Symbol.for("@ipld/js-cid/CID");var Pt={...wt,...pt,...mt,...ut,...ht,...lt,...bt,...gt,...At,...dt},ra={...Bt,...Ut};function Dn(n,t,a,y){return{name:n,prefix:t,encoder:{name:n,prefix:t,encode:a},decoder:{decode:y}}}c(Dn,"createCodec");var Tn=Dn("utf8","u",n=>"u"+new TextDecoder("utf8").decode(n),n=>new TextEncoder().encode(n.substring(1))),Tt=Dn("ascii","a",n=>{let t="a";for(let a=0;a<n.length;a++)t+=String.fromCharCode(n[a]);return t},n=>{n=n.substring(1);let t=he(n.length);for(let a=0;a<n.length;a++)t[a]=n.charCodeAt(a);return t}),hi={utf8:Tn,"utf-8":Tn,hex:Pt.base16,latin1:Tt,ascii:Tt,binary:Tt,...Pt},Re=hi;function Or(n,t="utf8"){let a=Re[t];if(a==null)throw new Error(`Unsupported encoding "${t}"`);return a.decoder.decode(`${a.prefix}${n}`)}c(Or,"fromString");function Sr(n,t="utf8"){let a=Re[t];if(a==null)throw new Error(`Unsupported encoding "${t}"`);return a.encoder.encode(n).substring(1)}c(Sr,"toString");function Ne(n){return new Promise((t,a)=>{n.oncomplete=n.onsuccess=()=>t(n.result),n.onabort=n.onerror=()=>a(n.error)})}c(Ne,"promisifyRequest");function pi(n,t){let a,y=c(()=>{if(a)return a;let h=indexedDB.open(n);return h.onupgradeneeded=()=>h.result.createObjectStore(t),a=Ne(h),a.then(E=>{E.onclose=()=>a=void 0},()=>{}),a},"getDB");return(h,E)=>y().then(D=>E(D.transaction(t,h).objectStore(t)))}c(pi,"createStore");var Dt;function Mt(){return Dt||(Dt=pi("keyval-store","keyval")),Dt}c(Mt,"defaultGetStore");function Lt(n,t=Mt()){return t("readonly",a=>Ne(a.get(n)))}c(Lt,"get");function It(n,t,a=Mt()){return a("readwrite",y=>(y.put(t,n),Ne(y.transaction)))}c(It,"set");function Mn(n,t=Mt()){return t("readwrite",a=>(n.forEach(y=>a.delete(y)),Ne(a.transaction)))}c(Mn,"delMany");var di=globalThis||window||self,or=di.crypto;var zn=ff(In(),1);var Rn="did:key:z",La="Ed25519",Ia="X25519",Ra="X25519",Na="Ed25519",za="X25519",bi={sign:["sign","verify"],encrypt:["deriveKey","deriveBits"]},Ae="RSA-OAEP",me="RSASSA-PKCS1-v1_5",Rt="SHA-256",gi=new Uint8Array([0,245,2]),Oa=2048,Nt="SHA-256",fe=8,ie="AES-GCM",oe=ie,we=256,Oe=12,Ai=new Uint8Array([234,1]),mi=new Uint8Array([237,1]),wi={RSA:"rsa",Edwards:"ed25519",BLS:"bls12-381"},Ya="rsa-exchange-key",ja="rsa-write-key",Ha="ecc-exchange",Fa="ecc-write",zt=16;function Yr(n){return new Uint8Array(n).buffer}c(Yr,"toArrayBuffer");var Nn={keyTypes:{"bls12-381":{magicBytes:new Uint8Array([234,1]),verify:c(()=>{throw new Error("Not implemented")},"verify")},rsa:{magicBytes:new Uint8Array([0,245,2]),verify:vi},ed25519:{magicBytes:new Uint8Array([237,1]),verify:Ei}}};async function Ei({message:n,publicKey:t,signature:a}){return zn.default.sign.detached.verify(n,a,t)}c(Ei,"ed25519Verify");async function On(n){return new Uint8Array(await or.subtle.digest("sha-256",n.buffer))}c(On,"sha256");async function jt(n,t="rsa"){let a=n instanceof CryptoKey?new Uint8Array(await Vr(n)):n,y=Nn.keyTypes[t]?.magicBytes;if(!y)throw new Error(`Key type '${t}' not supported, available types: ${Object.keys(Nn.keyTypes).join(", ")}`);let h=nt([y,a]);return Rn+Sr(h,"base58btc")}c(jt,"publicKeyToDid");var Ht={verify:c(async function(t,a,y,h=fe,E=Nt){return or.subtle.verify({name:me,saltLength:zt},typeof y=="string"?await Ot(y,E,"signing"):y,Gt(a),Ee(t,h))},"rsaVerify"),sign:c(async function(t,a,y=fe){return or.subtle.sign({name:me,saltLength:zt},a,Ee(t,y))},"sign"),encrypt:c(async function(t,a,y=fe,h=Nt){let E;return typeof a=="string"?E=await Ot(a,h,"exchange"):E=a instanceof Uint8Array?await Ot(Yr(a),h,"exchange"):a,or.subtle.encrypt({name:Ae},E,Ee(t,y))},"rsaEncrypt"),decrypt:c(async function(t,a){let y=Ye(a)?a:await Ti(a,["decrypt"]),h;typeof t=="string"?h=Or(t,"base64pad"):h=t;let E=await or.subtle.decrypt({name:Ae},y,h instanceof Uint8Array?Yr(h):h);return new Uint8Array(E)},"rsaDecrypt")};async function vi({message:n,publicKey:t,signature:a}){return Ht.verify(n,a,await or.subtle.importKey("spki",Yr(t),{name:me,hash:Rt},!1,["verify"]),8)}c(vi,"rsaVerify");async function Ot(n,t,a){Si(a);let y=a==="exchange"?Ae:me,h=a==="exchange"?["encrypt"]:["verify"],E=typeof n=="string"?ve(Bi(n)):n;return or.subtle.importKey("spki",E,{name:y,hash:{name:t}},!0,h)}c(Ot,"importPublicKey");var Ui=new Error("Invalid key use. Please use 'encryption' or 'signing"),Ki=new Error("Max must be less than 256 and greater than 0");function Si(n){_i(n,["signing","exchange"],Ui)}c(Si,"checkValidKeyUse");function _i(n,t,a){if(!t.some(h=>h===n))throw a}c(_i,"checkValid");function Bi(n){return n.replace(`-----BEGIN PUBLIC KEY-----
|
|
1
|
+
var kn=Object.create;var le=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var rf=Object.getOwnPropertyNames;var ef=Object.getPrototypeOf,tf=Object.prototype.hasOwnProperty;var nf=(n,t,a)=>t in n?le(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var c=(n,t)=>le(n,"name",{value:t,configurable:!0}),xn=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,a)=>(typeof require<"u"?require:t)[a]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var yn=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Kr=(n,t)=>{for(var a in t)le(n,a,{get:t[a],enumerable:!0})},ff=(n,t,a,y)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of rf(t))!tf.call(n,h)&&h!==a&&le(n,h,{get:()=>t[h],enumerable:!(y=Qn(t,h))||y.enumerable});return n};var of=(n,t,a)=>(a=n!=null?kn(ef(n)):{},ff(t||!n||!n.__esModule?le(a,"default",{value:n,enumerable:!0}):a,n));var V=(n,t,a)=>nf(n,typeof t!="symbol"?t+"":t,a);var On=yn(()=>{"use strict"});var Yn=yn((qa,je)=>{"use strict";(function(n){"use strict";var t=c(function(e){var i,f=new Float64Array(16);if(e)for(i=0;i<e.length;i++)f[i]=e[i];return f},"gf"),a=c(function(){throw new Error("no PRNG")},"randombytes"),y=new Uint8Array(16),h=new Uint8Array(32);h[0]=9;var E=t(),D=t([1]),er=t([56129,1]),yr=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),zr=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),br=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Dr=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),$r=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ue(e,i,f,r){e[i]=f>>24&255,e[i+1]=f>>16&255,e[i+2]=f>>8&255,e[i+3]=f&255,e[i+4]=r>>24&255,e[i+5]=r>>16&255,e[i+6]=r>>8&255,e[i+7]=r&255}c(Ue,"ts64");function Q(e,i,f,r,o){var x,u=0;for(x=0;x<o;x++)u|=e[i+x]^f[r+x];return(1&u-1>>>8)-1}c(Q,"vn");function ur(e,i,f,r){return Q(e,i,f,r,16)}c(ur,"crypto_verify_16");function _r(e,i,f,r){return Q(e,i,f,r,32)}c(_r,"crypto_verify_32");function mr(e,i,f,r){for(var o=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,u=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,b=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,w=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,T=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,U=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,q=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,K=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,I=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,L=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,Y=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,O=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,R=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,z=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,N=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,_=o,P=x,S=u,B=b,C=w,v=T,p=U,d=q,A=K,l=I,g=L,m=Y,M=O,j=R,F=z,H=N,s,X=0;X<20;X+=2)s=_+M|0,C^=s<<7|s>>>25,s=C+_|0,A^=s<<9|s>>>23,s=A+C|0,M^=s<<13|s>>>19,s=M+A|0,_^=s<<18|s>>>14,s=v+P|0,l^=s<<7|s>>>25,s=l+v|0,j^=s<<9|s>>>23,s=j+l|0,P^=s<<13|s>>>19,s=P+j|0,v^=s<<18|s>>>14,s=g+p|0,F^=s<<7|s>>>25,s=F+g|0,S^=s<<9|s>>>23,s=S+F|0,p^=s<<13|s>>>19,s=p+S|0,g^=s<<18|s>>>14,s=H+m|0,B^=s<<7|s>>>25,s=B+H|0,d^=s<<9|s>>>23,s=d+B|0,m^=s<<13|s>>>19,s=m+d|0,H^=s<<18|s>>>14,s=_+B|0,P^=s<<7|s>>>25,s=P+_|0,S^=s<<9|s>>>23,s=S+P|0,B^=s<<13|s>>>19,s=B+S|0,_^=s<<18|s>>>14,s=v+C|0,p^=s<<7|s>>>25,s=p+v|0,d^=s<<9|s>>>23,s=d+p|0,C^=s<<13|s>>>19,s=C+d|0,v^=s<<18|s>>>14,s=g+l|0,m^=s<<7|s>>>25,s=m+g|0,A^=s<<9|s>>>23,s=A+m|0,l^=s<<13|s>>>19,s=l+A|0,g^=s<<18|s>>>14,s=H+F|0,M^=s<<7|s>>>25,s=M+H|0,j^=s<<9|s>>>23,s=j+M|0,F^=s<<13|s>>>19,s=F+j|0,H^=s<<18|s>>>14;_=_+o|0,P=P+x|0,S=S+u|0,B=B+b|0,C=C+w|0,v=v+T|0,p=p+U|0,d=d+q|0,A=A+K|0,l=l+I|0,g=g+L|0,m=m+Y|0,M=M+O|0,j=j+R|0,F=F+z|0,H=H+N|0,e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=P>>>0&255,e[5]=P>>>8&255,e[6]=P>>>16&255,e[7]=P>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=B>>>0&255,e[13]=B>>>8&255,e[14]=B>>>16&255,e[15]=B>>>24&255,e[16]=C>>>0&255,e[17]=C>>>8&255,e[18]=C>>>16&255,e[19]=C>>>24&255,e[20]=v>>>0&255,e[21]=v>>>8&255,e[22]=v>>>16&255,e[23]=v>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255,e[32]=A>>>0&255,e[33]=A>>>8&255,e[34]=A>>>16&255,e[35]=A>>>24&255,e[36]=l>>>0&255,e[37]=l>>>8&255,e[38]=l>>>16&255,e[39]=l>>>24&255,e[40]=g>>>0&255,e[41]=g>>>8&255,e[42]=g>>>16&255,e[43]=g>>>24&255,e[44]=m>>>0&255,e[45]=m>>>8&255,e[46]=m>>>16&255,e[47]=m>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>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(mr,"core_salsa20");function vr(e,i,f,r){for(var o=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,u=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,b=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,w=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,T=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,U=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,q=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,K=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,I=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,L=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,Y=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,O=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,R=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,z=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,N=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,_=o,P=x,S=u,B=b,C=w,v=T,p=U,d=q,A=K,l=I,g=L,m=Y,M=O,j=R,F=z,H=N,s,X=0;X<20;X+=2)s=_+M|0,C^=s<<7|s>>>25,s=C+_|0,A^=s<<9|s>>>23,s=A+C|0,M^=s<<13|s>>>19,s=M+A|0,_^=s<<18|s>>>14,s=v+P|0,l^=s<<7|s>>>25,s=l+v|0,j^=s<<9|s>>>23,s=j+l|0,P^=s<<13|s>>>19,s=P+j|0,v^=s<<18|s>>>14,s=g+p|0,F^=s<<7|s>>>25,s=F+g|0,S^=s<<9|s>>>23,s=S+F|0,p^=s<<13|s>>>19,s=p+S|0,g^=s<<18|s>>>14,s=H+m|0,B^=s<<7|s>>>25,s=B+H|0,d^=s<<9|s>>>23,s=d+B|0,m^=s<<13|s>>>19,s=m+d|0,H^=s<<18|s>>>14,s=_+B|0,P^=s<<7|s>>>25,s=P+_|0,S^=s<<9|s>>>23,s=S+P|0,B^=s<<13|s>>>19,s=B+S|0,_^=s<<18|s>>>14,s=v+C|0,p^=s<<7|s>>>25,s=p+v|0,d^=s<<9|s>>>23,s=d+p|0,C^=s<<13|s>>>19,s=C+d|0,v^=s<<18|s>>>14,s=g+l|0,m^=s<<7|s>>>25,s=m+g|0,A^=s<<9|s>>>23,s=A+m|0,l^=s<<13|s>>>19,s=l+A|0,g^=s<<18|s>>>14,s=H+F|0,M^=s<<7|s>>>25,s=M+H|0,j^=s<<9|s>>>23,s=j+M|0,F^=s<<13|s>>>19,s=F+j|0,H^=s<<18|s>>>14;e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=v>>>0&255,e[5]=v>>>8&255,e[6]=v>>>16&255,e[7]=v>>>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]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=l>>>0&255,e[29]=l>>>8&255,e[30]=l>>>16&255,e[31]=l>>>24&255}c(vr,"core_hsalsa20");function gr(e,i,f,r){mr(e,i,f,r)}c(gr,"crypto_core_salsa20");function hr(e,i,f,r){vr(e,i,f,r)}c(hr,"crypto_core_hsalsa20");var cr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Br(e,i,f,r,o,x,u){var b=new Uint8Array(16),w=new Uint8Array(64),T,U;for(U=0;U<16;U++)b[U]=0;for(U=0;U<8;U++)b[U]=x[U];for(;o>=64;){for(gr(w,b,u,cr),U=0;U<64;U++)e[i+U]=f[r+U]^w[U];for(T=1,U=8;U<16;U++)T=T+(b[U]&255)|0,b[U]=T&255,T>>>=8;o-=64,i+=64,r+=64}if(o>0)for(gr(w,b,u,cr),U=0;U<o;U++)e[i+U]=f[r+U]^w[U];return 0}c(Br,"crypto_stream_salsa20_xor");function Ar(e,i,f,r,o){var x=new Uint8Array(16),u=new Uint8Array(64),b,w;for(w=0;w<16;w++)x[w]=0;for(w=0;w<8;w++)x[w]=r[w];for(;f>=64;){for(gr(u,x,o,cr),w=0;w<64;w++)e[i+w]=u[w];for(b=1,w=8;w<16;w++)b=b+(x[w]&255)|0,x[w]=b&255,b>>>=8;f-=64,i+=64}if(f>0)for(gr(u,x,o,cr),w=0;w<f;w++)e[i+w]=u[w];return 0}c(Ar,"crypto_stream_salsa20");function Ur(e,i,f,r,o){var x=new Uint8Array(32);hr(x,r,o,cr);for(var u=new Uint8Array(8),b=0;b<8;b++)u[b]=r[b+16];return Ar(e,i,f,u,x)}c(Ur,"crypto_stream");function Or(e,i,f,r,o,x,u){var b=new Uint8Array(32);hr(b,x,u,cr);for(var w=new Uint8Array(8),T=0;T<8;T++)w[T]=x[T+16];return Br(e,i,f,r,o,w,b)}c(Or,"crypto_stream_xor");var Se=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 i,f,r,o,x,u,b,w;i=e[0]&255|(e[1]&255)<<8,this.r[0]=i&8191,f=e[2]&255|(e[3]&255)<<8,this.r[1]=(i>>>13|f<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(f>>>10|r<<6)&7939,o=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|o<<9)&8191,x=e[8]&255|(e[9]&255)<<8,this.r[4]=(o>>>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,b=e[12]&255|(e[13]&255)<<8,this.r[7]=(u>>>11|b<<5)&8065,w=e[14]&255|(e[15]&255)<<8,this.r[8]=(b>>>8|w<<8)&8191,this.r[9]=w>>>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");Se.prototype.blocks=function(e,i,f){for(var r=this.fin?0:2048,o,x,u,b,w,T,U,q,K,I,L,Y,O,R,z,N,_,P,S,B=this.h[0],C=this.h[1],v=this.h[2],p=this.h[3],d=this.h[4],A=this.h[5],l=this.h[6],g=this.h[7],m=this.h[8],M=this.h[9],j=this.r[0],F=this.r[1],H=this.r[2],s=this.r[3],X=this.r[4],J=this.r[5],k=this.r[6],G=this.r[7],$=this.r[8],Z=this.r[9];f>=16;)o=e[i+0]&255|(e[i+1]&255)<<8,B+=o&8191,x=e[i+2]&255|(e[i+3]&255)<<8,C+=(o>>>13|x<<3)&8191,u=e[i+4]&255|(e[i+5]&255)<<8,v+=(x>>>10|u<<6)&8191,b=e[i+6]&255|(e[i+7]&255)<<8,p+=(u>>>7|b<<9)&8191,w=e[i+8]&255|(e[i+9]&255)<<8,d+=(b>>>4|w<<12)&8191,A+=w>>>1&8191,T=e[i+10]&255|(e[i+11]&255)<<8,l+=(w>>>14|T<<2)&8191,U=e[i+12]&255|(e[i+13]&255)<<8,g+=(T>>>11|U<<5)&8191,q=e[i+14]&255|(e[i+15]&255)<<8,m+=(U>>>8|q<<8)&8191,M+=q>>>5|r,K=0,I=K,I+=B*j,I+=C*(5*Z),I+=v*(5*$),I+=p*(5*G),I+=d*(5*k),K=I>>>13,I&=8191,I+=A*(5*J),I+=l*(5*X),I+=g*(5*s),I+=m*(5*H),I+=M*(5*F),K+=I>>>13,I&=8191,L=K,L+=B*F,L+=C*j,L+=v*(5*Z),L+=p*(5*$),L+=d*(5*G),K=L>>>13,L&=8191,L+=A*(5*k),L+=l*(5*J),L+=g*(5*X),L+=m*(5*s),L+=M*(5*H),K+=L>>>13,L&=8191,Y=K,Y+=B*H,Y+=C*F,Y+=v*j,Y+=p*(5*Z),Y+=d*(5*$),K=Y>>>13,Y&=8191,Y+=A*(5*G),Y+=l*(5*k),Y+=g*(5*J),Y+=m*(5*X),Y+=M*(5*s),K+=Y>>>13,Y&=8191,O=K,O+=B*s,O+=C*H,O+=v*F,O+=p*j,O+=d*(5*Z),K=O>>>13,O&=8191,O+=A*(5*$),O+=l*(5*G),O+=g*(5*k),O+=m*(5*J),O+=M*(5*X),K+=O>>>13,O&=8191,R=K,R+=B*X,R+=C*s,R+=v*H,R+=p*F,R+=d*j,K=R>>>13,R&=8191,R+=A*(5*Z),R+=l*(5*$),R+=g*(5*G),R+=m*(5*k),R+=M*(5*J),K+=R>>>13,R&=8191,z=K,z+=B*J,z+=C*X,z+=v*s,z+=p*H,z+=d*F,K=z>>>13,z&=8191,z+=A*j,z+=l*(5*Z),z+=g*(5*$),z+=m*(5*G),z+=M*(5*k),K+=z>>>13,z&=8191,N=K,N+=B*k,N+=C*J,N+=v*X,N+=p*s,N+=d*H,K=N>>>13,N&=8191,N+=A*F,N+=l*j,N+=g*(5*Z),N+=m*(5*$),N+=M*(5*G),K+=N>>>13,N&=8191,_=K,_+=B*G,_+=C*k,_+=v*J,_+=p*X,_+=d*s,K=_>>>13,_&=8191,_+=A*H,_+=l*F,_+=g*j,_+=m*(5*Z),_+=M*(5*$),K+=_>>>13,_&=8191,P=K,P+=B*$,P+=C*G,P+=v*k,P+=p*J,P+=d*X,K=P>>>13,P&=8191,P+=A*s,P+=l*H,P+=g*F,P+=m*j,P+=M*(5*Z),K+=P>>>13,P&=8191,S=K,S+=B*Z,S+=C*$,S+=v*G,S+=p*k,S+=d*J,K=S>>>13,S&=8191,S+=A*X,S+=l*s,S+=g*H,S+=m*F,S+=M*j,K+=S>>>13,S&=8191,K=(K<<2)+K|0,K=K+I|0,I=K&8191,K=K>>>13,L+=K,B=I,C=L,v=Y,p=O,d=R,A=z,l=N,g=_,m=P,M=S,i+=16,f-=16;this.h[0]=B,this.h[1]=C,this.h[2]=v,this.h[3]=p,this.h[4]=d,this.h[5]=A,this.h[6]=l,this.h[7]=g,this.h[8]=m,this.h[9]=M},Se.prototype.finish=function(e,i){var f=new Uint16Array(10),r,o,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,f[0]=this.h[0]+5,r=f[0]>>>13,f[0]&=8191,u=1;u<10;u++)f[u]=this.h[u]+r,r=f[u]>>>13,f[u]&=8191;for(f[9]-=8192,o=(r^1)-1,u=0;u<10;u++)f[u]&=o;for(o=~o,u=0;u<10;u++)this.h[u]=this.h[u]&o|f[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[i+0]=this.h[0]>>>0&255,e[i+1]=this.h[0]>>>8&255,e[i+2]=this.h[1]>>>0&255,e[i+3]=this.h[1]>>>8&255,e[i+4]=this.h[2]>>>0&255,e[i+5]=this.h[2]>>>8&255,e[i+6]=this.h[3]>>>0&255,e[i+7]=this.h[3]>>>8&255,e[i+8]=this.h[4]>>>0&255,e[i+9]=this.h[4]>>>8&255,e[i+10]=this.h[5]>>>0&255,e[i+11]=this.h[5]>>>8&255,e[i+12]=this.h[6]>>>0&255,e[i+13]=this.h[6]>>>8&255,e[i+14]=this.h[7]>>>0&255,e[i+15]=this.h[7]>>>8&255},Se.prototype.update=function(e,i,f){var r,o;if(this.leftover){for(o=16-this.leftover,o>f&&(o=f),r=0;r<o;r++)this.buffer[this.leftover+r]=e[i+r];if(f-=o,i+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(f>=16&&(o=f-f%16,this.blocks(e,i,o),i+=o,f-=o),f){for(r=0;r<f;r++)this.buffer[this.leftover+r]=e[i+r];this.leftover+=f}};function Fe(e,i,f,r,o,x){var u=new Se(x);return u.update(f,r,o),u.finish(e,i),0}c(Fe,"crypto_onetimeauth");function Zt(e,i,f,r,o,x){var u=new Uint8Array(16);return Fe(u,0,f,r,o,x),ur(e,i,u,0)}c(Zt,"crypto_onetimeauth_verify");function Ge(e,i,f,r,o){var x;if(f<32)return-1;for(Or(e,0,i,0,f,r,o),Fe(e,16,e,32,f-32,e),x=0;x<16;x++)e[x]=0;return 0}c(Ge,"crypto_secretbox");function Ve(e,i,f,r,o){var x,u=new Uint8Array(32);if(f<32||(Ur(u,0,32,r,o),Zt(i,16,i,32,f-32,u)!==0))return-1;for(Or(e,0,i,0,f,r,o),x=0;x<32;x++)e[x]=0;return 0}c(Ve,"crypto_secretbox_open");function Mr(e,i){var f;for(f=0;f<16;f++)e[f]=i[f]|0}c(Mr,"set25519");function Xe(e){var i,f,r=1;for(i=0;i<16;i++)f=e[i]+r+65535,r=Math.floor(f/65536),e[i]=f-r*65536;e[0]+=r-1+37*(r-1)}c(Xe,"car25519");function Zr(e,i,f){for(var r,o=~(f-1),x=0;x<16;x++)r=o&(e[x]^i[x]),e[x]^=r,i[x]^=r}c(Zr,"sel25519");function qr(e,i){var f,r,o,x=t(),u=t();for(f=0;f<16;f++)u[f]=i[f];for(Xe(u),Xe(u),Xe(u),r=0;r<2;r++){for(x[0]=u[0]-65517,f=1;f<15;f++)x[f]=u[f]-65535-(x[f-1]>>16&1),x[f-1]&=65535;x[15]=u[15]-32767-(x[14]>>16&1),o=x[15]>>16&1,x[14]&=65535,Zr(u,x,1-o)}for(f=0;f<16;f++)e[2*f]=u[f]&255,e[2*f+1]=u[f]>>8}c(qr,"pack25519");function qt(e,i){var f=new Uint8Array(32),r=new Uint8Array(32);return qr(f,e),qr(r,i),_r(f,0,r,0)}c(qt,"neq25519");function Jt(e){var i=new Uint8Array(32);return qr(i,e),i[0]&1}c(Jt,"par25519");function We(e,i){var f;for(f=0;f<16;f++)e[f]=i[2*f]+(i[2*f+1]<<8);e[15]&=32767}c(We,"unpack25519");function Cr(e,i,f){for(var r=0;r<16;r++)e[r]=i[r]+f[r]}c(Cr,"A");function Tr(e,i,f){for(var r=0;r<16;r++)e[r]=i[r]-f[r]}c(Tr,"Z");function W(e,i,f){var r,o,x=0,u=0,b=0,w=0,T=0,U=0,q=0,K=0,I=0,L=0,Y=0,O=0,R=0,z=0,N=0,_=0,P=0,S=0,B=0,C=0,v=0,p=0,d=0,A=0,l=0,g=0,m=0,M=0,j=0,F=0,H=0,s=f[0],X=f[1],J=f[2],k=f[3],G=f[4],$=f[5],Z=f[6],ar=f[7],rr=f[8],nr=f[9],fr=f[10],ir=f[11],sr=f[12],pr=f[13],dr=f[14],lr=f[15];r=i[0],x+=r*s,u+=r*X,b+=r*J,w+=r*k,T+=r*G,U+=r*$,q+=r*Z,K+=r*ar,I+=r*rr,L+=r*nr,Y+=r*fr,O+=r*ir,R+=r*sr,z+=r*pr,N+=r*dr,_+=r*lr,r=i[1],u+=r*s,b+=r*X,w+=r*J,T+=r*k,U+=r*G,q+=r*$,K+=r*Z,I+=r*ar,L+=r*rr,Y+=r*nr,O+=r*fr,R+=r*ir,z+=r*sr,N+=r*pr,_+=r*dr,P+=r*lr,r=i[2],b+=r*s,w+=r*X,T+=r*J,U+=r*k,q+=r*G,K+=r*$,I+=r*Z,L+=r*ar,Y+=r*rr,O+=r*nr,R+=r*fr,z+=r*ir,N+=r*sr,_+=r*pr,P+=r*dr,S+=r*lr,r=i[3],w+=r*s,T+=r*X,U+=r*J,q+=r*k,K+=r*G,I+=r*$,L+=r*Z,Y+=r*ar,O+=r*rr,R+=r*nr,z+=r*fr,N+=r*ir,_+=r*sr,P+=r*pr,S+=r*dr,B+=r*lr,r=i[4],T+=r*s,U+=r*X,q+=r*J,K+=r*k,I+=r*G,L+=r*$,Y+=r*Z,O+=r*ar,R+=r*rr,z+=r*nr,N+=r*fr,_+=r*ir,P+=r*sr,S+=r*pr,B+=r*dr,C+=r*lr,r=i[5],U+=r*s,q+=r*X,K+=r*J,I+=r*k,L+=r*G,Y+=r*$,O+=r*Z,R+=r*ar,z+=r*rr,N+=r*nr,_+=r*fr,P+=r*ir,S+=r*sr,B+=r*pr,C+=r*dr,v+=r*lr,r=i[6],q+=r*s,K+=r*X,I+=r*J,L+=r*k,Y+=r*G,O+=r*$,R+=r*Z,z+=r*ar,N+=r*rr,_+=r*nr,P+=r*fr,S+=r*ir,B+=r*sr,C+=r*pr,v+=r*dr,p+=r*lr,r=i[7],K+=r*s,I+=r*X,L+=r*J,Y+=r*k,O+=r*G,R+=r*$,z+=r*Z,N+=r*ar,_+=r*rr,P+=r*nr,S+=r*fr,B+=r*ir,C+=r*sr,v+=r*pr,p+=r*dr,d+=r*lr,r=i[8],I+=r*s,L+=r*X,Y+=r*J,O+=r*k,R+=r*G,z+=r*$,N+=r*Z,_+=r*ar,P+=r*rr,S+=r*nr,B+=r*fr,C+=r*ir,v+=r*sr,p+=r*pr,d+=r*dr,A+=r*lr,r=i[9],L+=r*s,Y+=r*X,O+=r*J,R+=r*k,z+=r*G,N+=r*$,_+=r*Z,P+=r*ar,S+=r*rr,B+=r*nr,C+=r*fr,v+=r*ir,p+=r*sr,d+=r*pr,A+=r*dr,l+=r*lr,r=i[10],Y+=r*s,O+=r*X,R+=r*J,z+=r*k,N+=r*G,_+=r*$,P+=r*Z,S+=r*ar,B+=r*rr,C+=r*nr,v+=r*fr,p+=r*ir,d+=r*sr,A+=r*pr,l+=r*dr,g+=r*lr,r=i[11],O+=r*s,R+=r*X,z+=r*J,N+=r*k,_+=r*G,P+=r*$,S+=r*Z,B+=r*ar,C+=r*rr,v+=r*nr,p+=r*fr,d+=r*ir,A+=r*sr,l+=r*pr,g+=r*dr,m+=r*lr,r=i[12],R+=r*s,z+=r*X,N+=r*J,_+=r*k,P+=r*G,S+=r*$,B+=r*Z,C+=r*ar,v+=r*rr,p+=r*nr,d+=r*fr,A+=r*ir,l+=r*sr,g+=r*pr,m+=r*dr,M+=r*lr,r=i[13],z+=r*s,N+=r*X,_+=r*J,P+=r*k,S+=r*G,B+=r*$,C+=r*Z,v+=r*ar,p+=r*rr,d+=r*nr,A+=r*fr,l+=r*ir,g+=r*sr,m+=r*pr,M+=r*dr,j+=r*lr,r=i[14],N+=r*s,_+=r*X,P+=r*J,S+=r*k,B+=r*G,C+=r*$,v+=r*Z,p+=r*ar,d+=r*rr,A+=r*nr,l+=r*fr,g+=r*ir,m+=r*sr,M+=r*pr,j+=r*dr,F+=r*lr,r=i[15],_+=r*s,P+=r*X,S+=r*J,B+=r*k,C+=r*G,v+=r*$,p+=r*Z,d+=r*ar,A+=r*rr,l+=r*nr,g+=r*fr,m+=r*ir,M+=r*sr,j+=r*pr,F+=r*dr,H+=r*lr,x+=38*P,u+=38*S,b+=38*B,w+=38*C,T+=38*v,U+=38*p,q+=38*d,K+=38*A,I+=38*l,L+=38*g,Y+=38*m,O+=38*M,R+=38*j,z+=38*F,N+=38*H,o=1,r=x+o+65535,o=Math.floor(r/65536),x=r-o*65536,r=u+o+65535,o=Math.floor(r/65536),u=r-o*65536,r=b+o+65535,o=Math.floor(r/65536),b=r-o*65536,r=w+o+65535,o=Math.floor(r/65536),w=r-o*65536,r=T+o+65535,o=Math.floor(r/65536),T=r-o*65536,r=U+o+65535,o=Math.floor(r/65536),U=r-o*65536,r=q+o+65535,o=Math.floor(r/65536),q=r-o*65536,r=K+o+65535,o=Math.floor(r/65536),K=r-o*65536,r=I+o+65535,o=Math.floor(r/65536),I=r-o*65536,r=L+o+65535,o=Math.floor(r/65536),L=r-o*65536,r=Y+o+65535,o=Math.floor(r/65536),Y=r-o*65536,r=O+o+65535,o=Math.floor(r/65536),O=r-o*65536,r=R+o+65535,o=Math.floor(r/65536),R=r-o*65536,r=z+o+65535,o=Math.floor(r/65536),z=r-o*65536,r=N+o+65535,o=Math.floor(r/65536),N=r-o*65536,r=_+o+65535,o=Math.floor(r/65536),_=r-o*65536,x+=o-1+37*(o-1),o=1,r=x+o+65535,o=Math.floor(r/65536),x=r-o*65536,r=u+o+65535,o=Math.floor(r/65536),u=r-o*65536,r=b+o+65535,o=Math.floor(r/65536),b=r-o*65536,r=w+o+65535,o=Math.floor(r/65536),w=r-o*65536,r=T+o+65535,o=Math.floor(r/65536),T=r-o*65536,r=U+o+65535,o=Math.floor(r/65536),U=r-o*65536,r=q+o+65535,o=Math.floor(r/65536),q=r-o*65536,r=K+o+65535,o=Math.floor(r/65536),K=r-o*65536,r=I+o+65535,o=Math.floor(r/65536),I=r-o*65536,r=L+o+65535,o=Math.floor(r/65536),L=r-o*65536,r=Y+o+65535,o=Math.floor(r/65536),Y=r-o*65536,r=O+o+65535,o=Math.floor(r/65536),O=r-o*65536,r=R+o+65535,o=Math.floor(r/65536),R=r-o*65536,r=z+o+65535,o=Math.floor(r/65536),z=r-o*65536,r=N+o+65535,o=Math.floor(r/65536),N=r-o*65536,r=_+o+65535,o=Math.floor(r/65536),_=r-o*65536,x+=o-1+37*(o-1),e[0]=x,e[1]=u,e[2]=b,e[3]=w,e[4]=T,e[5]=U,e[6]=q,e[7]=K,e[8]=I,e[9]=L,e[10]=Y,e[11]=O,e[12]=R,e[13]=z,e[14]=N,e[15]=_}c(W,"M");function Sr(e,i){W(e,i,i)}c(Sr,"S");function kt(e,i){var f=t(),r;for(r=0;r<16;r++)f[r]=i[r];for(r=253;r>=0;r--)Sr(f,f),r!==2&&r!==4&&W(f,f,i);for(r=0;r<16;r++)e[r]=f[r]}c(kt,"inv25519");function Qt(e,i){var f=t(),r;for(r=0;r<16;r++)f[r]=i[r];for(r=250;r>=0;r--)Sr(f,f),r!==1&&W(f,f,i);for(r=0;r<16;r++)e[r]=f[r]}c(Qt,"pow2523");function Ke(e,i,f){var r=new Uint8Array(32),o=new Float64Array(80),x,u,b=t(),w=t(),T=t(),U=t(),q=t(),K=t();for(u=0;u<31;u++)r[u]=i[u];for(r[31]=i[31]&127|64,r[0]&=248,We(o,f),u=0;u<16;u++)w[u]=o[u],U[u]=b[u]=T[u]=0;for(b[0]=U[0]=1,u=254;u>=0;--u)x=r[u>>>3]>>>(u&7)&1,Zr(b,w,x),Zr(T,U,x),Cr(q,b,T),Tr(b,b,T),Cr(T,w,U),Tr(w,w,U),Sr(U,q),Sr(K,b),W(b,T,b),W(T,w,q),Cr(q,b,T),Tr(b,b,T),Sr(w,b),Tr(T,U,K),W(b,T,er),Cr(b,b,U),W(T,T,b),W(b,U,K),W(U,w,o),Sr(w,q),Zr(b,w,x),Zr(T,U,x);for(u=0;u<16;u++)o[u+16]=b[u],o[u+32]=T[u],o[u+48]=w[u],o[u+64]=U[u];var I=o.subarray(32),L=o.subarray(16);return kt(I,I),W(L,L,I),qr(e,L),0}c(Ke,"crypto_scalarmult");function _e(e,i){return Ke(e,i,h)}c(_e,"crypto_scalarmult_base");function rn(e,i){return a(i,32),_e(e,i)}c(rn,"crypto_box_keypair");function Be(e,i,f){var r=new Uint8Array(32);return Ke(r,f,i),hr(e,y,r,cr)}c(Be,"crypto_box_beforenm");var en=Ge,Vn=Ve;function Xn(e,i,f,r,o,x){var u=new Uint8Array(32);return Be(u,o,x),en(e,i,f,r,u)}c(Xn,"crypto_box");function Wn(e,i,f,r,o,x){var u=new Uint8Array(32);return Be(u,o,x),Vn(e,i,f,r,u)}c(Wn,"crypto_box_open");var tn=[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 nn(e,i,f,r){for(var o=new Int32Array(16),x=new Int32Array(16),u,b,w,T,U,q,K,I,L,Y,O,R,z,N,_,P,S,B,C,v,p,d,A,l,g,m,M=e[0],j=e[1],F=e[2],H=e[3],s=e[4],X=e[5],J=e[6],k=e[7],G=i[0],$=i[1],Z=i[2],ar=i[3],rr=i[4],nr=i[5],fr=i[6],ir=i[7],sr=0;r>=128;){for(C=0;C<16;C++)v=8*C+sr,o[C]=f[v+0]<<24|f[v+1]<<16|f[v+2]<<8|f[v+3],x[C]=f[v+4]<<24|f[v+5]<<16|f[v+6]<<8|f[v+7];for(C=0;C<80;C++)if(u=M,b=j,w=F,T=H,U=s,q=X,K=J,I=k,L=G,Y=$,O=Z,R=ar,z=rr,N=nr,_=fr,P=ir,p=k,d=ir,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=(s>>>14|rr<<18)^(s>>>18|rr<<14)^(rr>>>9|s<<23),d=(rr>>>14|s<<18)^(rr>>>18|s<<14)^(s>>>9|rr<<23),A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,p=s&X^~s&J,d=rr&nr^~rr&fr,A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,p=tn[C*2],d=tn[C*2+1],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,p=o[C%16],d=x[C%16],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,S=g&65535|m<<16,B=A&65535|l<<16,p=S,d=B,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=(M>>>28|G<<4)^(G>>>2|M<<30)^(G>>>7|M<<25),d=(G>>>28|M<<4)^(M>>>2|G<<30)^(M>>>7|G<<25),A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,p=M&j^M&F^j&F,d=G&$^G&Z^$&Z,A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,I=g&65535|m<<16,P=A&65535|l<<16,p=T,d=R,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=S,d=B,A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,T=g&65535|m<<16,R=A&65535|l<<16,j=u,F=b,H=w,s=T,X=U,J=q,k=K,M=I,$=L,Z=Y,ar=O,rr=R,nr=z,fr=N,ir=_,G=P,C%16===15)for(v=0;v<16;v++)p=o[v],d=x[v],A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=o[(v+9)%16],d=x[(v+9)%16],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,S=o[(v+1)%16],B=x[(v+1)%16],p=(S>>>1|B<<31)^(S>>>8|B<<24)^S>>>7,d=(B>>>1|S<<31)^(B>>>8|S<<24)^(B>>>7|S<<25),A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,S=o[(v+14)%16],B=x[(v+14)%16],p=(S>>>19|B<<13)^(B>>>29|S<<3)^S>>>6,d=(B>>>19|S<<13)^(S>>>29|B<<3)^(B>>>6|S<<26),A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,o[v]=g&65535|m<<16,x[v]=A&65535|l<<16;p=M,d=G,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[0],d=i[0],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[0]=M=g&65535|m<<16,i[0]=G=A&65535|l<<16,p=j,d=$,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[1],d=i[1],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[1]=j=g&65535|m<<16,i[1]=$=A&65535|l<<16,p=F,d=Z,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[2],d=i[2],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[2]=F=g&65535|m<<16,i[2]=Z=A&65535|l<<16,p=H,d=ar,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[3],d=i[3],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[3]=H=g&65535|m<<16,i[3]=ar=A&65535|l<<16,p=s,d=rr,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[4],d=i[4],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[4]=s=g&65535|m<<16,i[4]=rr=A&65535|l<<16,p=X,d=nr,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[5],d=i[5],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[5]=X=g&65535|m<<16,i[5]=nr=A&65535|l<<16,p=J,d=fr,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[6],d=i[6],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[6]=J=g&65535|m<<16,i[6]=fr=A&65535|l<<16,p=k,d=ir,A=d&65535,l=d>>>16,g=p&65535,m=p>>>16,p=e[7],d=i[7],A+=d&65535,l+=d>>>16,g+=p&65535,m+=p>>>16,l+=A>>>16,g+=l>>>16,m+=g>>>16,e[7]=k=g&65535|m<<16,i[7]=ir=A&65535|l<<16,sr+=128,r-=128}return r}c(nn,"crypto_hashblocks_hl");function Hr(e,i,f){var r=new Int32Array(8),o=new Int32Array(8),x=new Uint8Array(256),u,b=f;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,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,nn(r,o,i,f),f%=128,u=0;u<f;u++)x[u]=i[b-f+u];for(x[f]=128,f=256-128*(f<112?1:0),x[f-9]=0,Ue(x,f-8,b/536870912|0,b<<3),nn(r,o,x,f),u=0;u<8;u++)Ue(e,8*u,r[u],o[u]);return 0}c(Hr,"crypto_hash");function Ce(e,i){var f=t(),r=t(),o=t(),x=t(),u=t(),b=t(),w=t(),T=t(),U=t();Tr(f,e[1],e[0]),Tr(U,i[1],i[0]),W(f,f,U),Cr(r,e[0],e[1]),Cr(U,i[0],i[1]),W(r,r,U),W(o,e[3],i[3]),W(o,o,zr),W(x,e[2],i[2]),Cr(x,x,x),Tr(u,r,f),Tr(b,x,o),Cr(w,x,o),Cr(T,r,f),W(e[0],u,b),W(e[1],T,w),W(e[2],w,b),W(e[3],u,T)}c(Ce,"add");function fn(e,i,f){var r;for(r=0;r<4;r++)Zr(e[r],i[r],f)}c(fn,"cswap");function $e(e,i){var f=t(),r=t(),o=t();kt(o,i[2]),W(f,i[0],o),W(r,i[1],o),qr(e,r),e[31]^=Jt(f)<<7}c($e,"pack");function Ze(e,i,f){var r,o;for(Mr(e[0],E),Mr(e[1],D),Mr(e[2],D),Mr(e[3],E),o=255;o>=0;--o)r=f[o/8|0]>>(o&7)&1,fn(e,i,r),Ce(i,e),Ce(e,e),fn(e,i,r)}c(Ze,"scalarmult");function Te(e,i){var f=[t(),t(),t(),t()];Mr(f[0],br),Mr(f[1],Dr),Mr(f[2],D),W(f[3],br,Dr),Ze(e,f,i)}c(Te,"scalarbase");function qe(e,i,f){var r=new Uint8Array(64),o=[t(),t(),t(),t()],x;for(f||a(i,32),Hr(r,i,32),r[0]&=248,r[31]&=127,r[31]|=64,Te(o,r),$e(e,o),x=0;x<32;x++)i[x+32]=e[x];return 0}c(qe,"crypto_sign_keypair");var Pe=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 Je(e,i){var f,r,o,x;for(r=63;r>=32;--r){for(f=0,o=r-32,x=r-12;o<x;++o)i[o]+=f-16*i[r]*Pe[o-(r-32)],f=Math.floor((i[o]+128)/256),i[o]-=f*256;i[o]+=f,i[r]=0}for(f=0,o=0;o<32;o++)i[o]+=f-(i[31]>>4)*Pe[o],f=i[o]>>8,i[o]&=255;for(o=0;o<32;o++)i[o]-=f*Pe[o];for(r=0;r<32;r++)i[r+1]+=i[r]>>8,e[r]=i[r]&255}c(Je,"modL");function ke(e){var i=new Float64Array(64),f;for(f=0;f<64;f++)i[f]=e[f];for(f=0;f<64;f++)e[f]=0;Je(e,i)}c(ke,"reduce");function on(e,i,f,r){var o=new Uint8Array(64),x=new Uint8Array(64),u=new Uint8Array(64),b,w,T=new Float64Array(64),U=[t(),t(),t(),t()];Hr(o,r,32),o[0]&=248,o[31]&=127,o[31]|=64;var q=f+64;for(b=0;b<f;b++)e[64+b]=i[b];for(b=0;b<32;b++)e[32+b]=o[32+b];for(Hr(u,e.subarray(32),f+32),ke(u),Te(U,u),$e(e,U),b=32;b<64;b++)e[b]=r[b];for(Hr(x,e,f+64),ke(x),b=0;b<64;b++)T[b]=0;for(b=0;b<32;b++)T[b]=u[b];for(b=0;b<32;b++)for(w=0;w<32;w++)T[b+w]+=x[b]*o[w];return Je(e.subarray(32),T),q}c(on,"crypto_sign");function $n(e,i){var f=t(),r=t(),o=t(),x=t(),u=t(),b=t(),w=t();return Mr(e[2],D),We(e[1],i),Sr(o,e[1]),W(x,o,yr),Tr(o,o,e[2]),Cr(x,e[2],x),Sr(u,x),Sr(b,u),W(w,b,u),W(f,w,o),W(f,f,x),Qt(f,f),W(f,f,o),W(f,f,x),W(f,f,x),W(e[0],f,x),Sr(r,e[0]),W(r,r,x),qt(r,o)&&W(e[0],e[0],$r),Sr(r,e[0]),W(r,r,x),qt(r,o)?-1:(Jt(e[0])===i[31]>>7&&Tr(e[0],E,e[0]),W(e[3],e[0],e[1]),0)}c($n,"unpackneg");function Qe(e,i,f,r){var o,x=new Uint8Array(32),u=new Uint8Array(64),b=[t(),t(),t(),t()],w=[t(),t(),t(),t()];if(f<64||$n(w,r))return-1;for(o=0;o<f;o++)e[o]=i[o];for(o=0;o<32;o++)e[o+32]=r[o];if(Hr(u,e,f),ke(u),Ze(b,w,u),Te(w,i.subarray(32)),Ce(b,w),$e(x,b),f-=64,_r(i,0,x,0)){for(o=0;o<f;o++)e[o]=0;return-1}for(o=0;o<f;o++)e[o]=i[o+64];return f}c(Qe,"crypto_sign_open");var rt=32,De=24,ue=32,Jr=16,he=32,Me=32,pe=32,de=32,et=32,an=De,Zn=ue,qn=Jr,Ir=64,Fr=32,kr=64,tt=32,nt=64;n.lowlevel={crypto_core_hsalsa20:hr,crypto_stream_xor:Or,crypto_stream:Ur,crypto_stream_salsa20_xor:Br,crypto_stream_salsa20:Ar,crypto_onetimeauth:Fe,crypto_onetimeauth_verify:Zt,crypto_verify_16:ur,crypto_verify_32:_r,crypto_secretbox:Ge,crypto_secretbox_open:Ve,crypto_scalarmult:Ke,crypto_scalarmult_base:_e,crypto_box_beforenm:Be,crypto_box_afternm:en,crypto_box:Xn,crypto_box_open:Wn,crypto_box_keypair:rn,crypto_hash:Hr,crypto_sign:on,crypto_sign_keypair:qe,crypto_sign_open:Qe,crypto_secretbox_KEYBYTES:rt,crypto_secretbox_NONCEBYTES:De,crypto_secretbox_ZEROBYTES:ue,crypto_secretbox_BOXZEROBYTES:Jr,crypto_scalarmult_BYTES:he,crypto_scalarmult_SCALARBYTES:Me,crypto_box_PUBLICKEYBYTES:pe,crypto_box_SECRETKEYBYTES:de,crypto_box_BEFORENMBYTES:et,crypto_box_NONCEBYTES:an,crypto_box_ZEROBYTES:Zn,crypto_box_BOXZEROBYTES:qn,crypto_sign_BYTES:Ir,crypto_sign_PUBLICKEYBYTES:Fr,crypto_sign_SECRETKEYBYTES:kr,crypto_sign_SEEDBYTES:tt,crypto_hash_BYTES:nt,gf:t,D:yr,L:Pe,pack25519:qr,unpack25519:We,M:W,A:Cr,S:Sr,Z:Tr,pow2523:Qt,add:Ce,set25519:Mr,modL:Je,scalarmult:Ze,scalarbase:Te};function sn(e,i){if(e.length!==rt)throw new Error("bad key size");if(i.length!==De)throw new Error("bad nonce size")}c(sn,"checkLengths");function Jn(e,i){if(e.length!==pe)throw new Error("bad public key size");if(i.length!==de)throw new Error("bad secret key size")}c(Jn,"checkBoxLengths");function wr(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}c(wr,"checkArrayTypes");function cn(e){for(var i=0;i<e.length;i++)e[i]=0}c(cn,"cleanup"),n.randomBytes=function(e){var i=new Uint8Array(e);return a(i,e),i},n.secretbox=function(e,i,f){wr(e,i,f),sn(f,i);for(var r=new Uint8Array(ue+e.length),o=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+ue]=e[x];return Ge(o,r,r.length,i,f),o.subarray(Jr)},n.secretbox.open=function(e,i,f){wr(e,i,f),sn(f,i);for(var r=new Uint8Array(Jr+e.length),o=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+Jr]=e[x];return r.length<32||Ve(o,r,r.length,i,f)!==0?null:o.subarray(ue)},n.secretbox.keyLength=rt,n.secretbox.nonceLength=De,n.secretbox.overheadLength=Jr,n.scalarMult=function(e,i){if(wr(e,i),e.length!==Me)throw new Error("bad n size");if(i.length!==he)throw new Error("bad p size");var f=new Uint8Array(he);return Ke(f,e,i),f},n.scalarMult.base=function(e){if(wr(e),e.length!==Me)throw new Error("bad n size");var i=new Uint8Array(he);return _e(i,e),i},n.scalarMult.scalarLength=Me,n.scalarMult.groupElementLength=he,n.box=function(e,i,f,r){var o=n.box.before(f,r);return n.secretbox(e,i,o)},n.box.before=function(e,i){wr(e,i),Jn(e,i);var f=new Uint8Array(et);return Be(f,e,i),f},n.box.after=n.secretbox,n.box.open=function(e,i,f,r){var o=n.box.before(f,r);return n.secretbox.open(e,i,o)},n.box.open.after=n.secretbox.open,n.box.keyPair=function(){var e=new Uint8Array(pe),i=new Uint8Array(de);return rn(e,i),{publicKey:e,secretKey:i}},n.box.keyPair.fromSecretKey=function(e){if(wr(e),e.length!==de)throw new Error("bad secret key size");var i=new Uint8Array(pe);return _e(i,e),{publicKey:i,secretKey:new Uint8Array(e)}},n.box.publicKeyLength=pe,n.box.secretKeyLength=de,n.box.sharedKeyLength=et,n.box.nonceLength=an,n.box.overheadLength=n.secretbox.overheadLength,n.sign=function(e,i){if(wr(e,i),i.length!==kr)throw new Error("bad secret key size");var f=new Uint8Array(Ir+e.length);return on(f,e,e.length,i),f},n.sign.open=function(e,i){if(wr(e,i),i.length!==Fr)throw new Error("bad public key size");var f=new Uint8Array(e.length),r=Qe(f,e,e.length,i);if(r<0)return null;for(var o=new Uint8Array(r),x=0;x<o.length;x++)o[x]=f[x];return o},n.sign.detached=function(e,i){for(var f=n.sign(e,i),r=new Uint8Array(Ir),o=0;o<r.length;o++)r[o]=f[o];return r},n.sign.detached.verify=function(e,i,f){if(wr(e,i,f),i.length!==Ir)throw new Error("bad signature size");if(f.length!==Fr)throw new Error("bad public key size");var r=new Uint8Array(Ir+e.length),o=new Uint8Array(Ir+e.length),x;for(x=0;x<Ir;x++)r[x]=i[x];for(x=0;x<e.length;x++)r[x+Ir]=e[x];return Qe(o,r,r.length,f)>=0},n.sign.keyPair=function(){var e=new Uint8Array(Fr),i=new Uint8Array(kr);return qe(e,i),{publicKey:e,secretKey:i}},n.sign.keyPair.fromSecretKey=function(e){if(wr(e),e.length!==kr)throw new Error("bad secret key size");for(var i=new Uint8Array(Fr),f=0;f<i.length;f++)i[f]=e[32+f];return{publicKey:i,secretKey:new Uint8Array(e)}},n.sign.keyPair.fromSeed=function(e){if(wr(e),e.length!==tt)throw new Error("bad seed size");for(var i=new Uint8Array(Fr),f=new Uint8Array(kr),r=0;r<32;r++)f[r]=e[r];return qe(i,f,!0),{publicKey:i,secretKey:f}},n.sign.publicKeyLength=Fr,n.sign.secretKeyLength=kr,n.sign.seedLength=tt,n.sign.signatureLength=Ir,n.hash=function(e){wr(e);var i=new Uint8Array(nt);return Hr(i,e,e.length),i},n.hash.hashLength=nt,n.verify=function(e,i){return wr(e,i),e.length===0||i.length===0||e.length!==i.length?!1:Q(e,0,i,0,e.length)===0},n.setPRNG=function(e){a=e},function(){var e=typeof self<"u"?self.crypto||self.msCrypto:null;if(e&&e.getRandomValues){var i=65536;n.setPRNG(function(f,r){var o,x=new Uint8Array(r);for(o=0;o<r;o+=i)e.getRandomValues(x.subarray(o,o+Math.min(r-o,i)));for(o=0;o<r;o++)f[o]=x[o];cn(x)})}else typeof xn<"u"&&(e=On(),e&&e.randomBytes&&n.setPRNG(function(f,r){var o,x=e.randomBytes(r);for(o=0;o<r;o++)f[o]=x[o];cn(x)}))}()})(typeof je<"u"&&je.exports?je.exports:self.nacl=self.nacl||{})});function be(n=0){return new Uint8Array(n)}c(be,"allocUnsafe");function ft(n,t){t==null&&(t=n.reduce((h,E)=>h+E.length,0));let a=be(t),y=0;for(let h of n)a.set(h,y),y+=h.length;return a}c(ft,"concat");var ht={};Kr(ht,{base10:()=>hf});var eo=new Uint8Array(0);function un(n,t){if(n===t)return!0;if(n.byteLength!==t.byteLength)return!1;for(let a=0;a<n.byteLength;a++)if(n[a]!==t[a])return!1;return!0}c(un,"equals");function Lr(n){if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")}c(Lr,"coerce");function hn(n){return new TextEncoder().encode(n)}c(hn,"fromString");function pn(n){return new TextDecoder().decode(n)}c(pn,"toString");function sf(n,t){if(n.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),y=0;y<a.length;y++)a[y]=255;for(var h=0;h<n.length;h++){var E=n.charAt(h),D=E.charCodeAt(0);if(a[D]!==255)throw new TypeError(E+" is ambiguous");a[D]=h}var er=n.length,yr=n.charAt(0),zr=Math.log(er)/Math.log(256),br=Math.log(256)/Math.log(er);function Dr(Q){if(Q instanceof Uint8Array||(ArrayBuffer.isView(Q)?Q=new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength):Array.isArray(Q)&&(Q=Uint8Array.from(Q))),!(Q instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(Q.length===0)return"";for(var ur=0,_r=0,mr=0,vr=Q.length;mr!==vr&&Q[mr]===0;)mr++,ur++;for(var gr=(vr-mr)*br+1>>>0,hr=new Uint8Array(gr);mr!==vr;){for(var cr=Q[mr],Br=0,Ar=gr-1;(cr!==0||Br<_r)&&Ar!==-1;Ar--,Br++)cr+=256*hr[Ar]>>>0,hr[Ar]=cr%er>>>0,cr=cr/er>>>0;if(cr!==0)throw new Error("Non-zero carry");_r=Br,mr++}for(var Ur=gr-_r;Ur!==gr&&hr[Ur]===0;)Ur++;for(var Or=yr.repeat(ur);Ur<gr;++Ur)Or+=n.charAt(hr[Ur]);return Or}c(Dr,"encode");function $r(Q){if(typeof Q!="string")throw new TypeError("Expected String");if(Q.length===0)return new Uint8Array;var ur=0;if(Q[ur]!==" "){for(var _r=0,mr=0;Q[ur]===yr;)_r++,ur++;for(var vr=(Q.length-ur)*zr+1>>>0,gr=new Uint8Array(vr);Q[ur];){var hr=a[Q.charCodeAt(ur)];if(hr===255)return;for(var cr=0,Br=vr-1;(hr!==0||cr<mr)&&Br!==-1;Br--,cr++)hr+=er*gr[Br]>>>0,gr[Br]=hr%256>>>0,hr=hr/256>>>0;if(hr!==0)throw new Error("Non-zero carry");mr=cr,ur++}if(Q[ur]!==" "){for(var Ar=vr-mr;Ar!==vr&&gr[Ar]===0;)Ar++;for(var Ur=new Uint8Array(_r+(vr-Ar)),Or=_r;Ar!==vr;)Ur[Or++]=gr[Ar++];return Ur}}}c($r,"decodeUnsafe");function Ue(Q){var ur=$r(Q);if(ur)return ur;throw new Error(`Non-${t} character`)}return c(Ue,"decode"),{encode:Dr,decodeUnsafe:$r,decode:Ue}}c(sf,"base");var cf=sf,xf=cf,ln=xf;var ct=class ct{constructor(t,a,y){V(this,"name");V(this,"prefix");V(this,"baseEncode");this.name=t,this.prefix=a,this.baseEncode=y}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}};c(ct,"Encoder");var it=ct,xt=class xt{constructor(t,a,y){V(this,"name");V(this,"prefix");V(this,"baseDecode");V(this,"prefixCodePoint");this.name=t,this.prefix=a;let h=a.codePointAt(0);if(h===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=h,this.baseDecode=y}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return bn(this,t)}};c(xt,"Decoder");var ot=xt,yt=class yt{constructor(t){V(this,"decoders");this.decoders=t}or(t){return bn(this,t)}decode(t){let a=t[0],y=this.decoders[a];if(y!=null)return y.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};c(yt,"ComposedDecoder");var at=yt;function bn(n,t){return new at({...n.decoders??{[n.prefix]:n},...t.decoders??{[t.prefix]:t}})}c(bn,"or");var ut=class ut{constructor(t,a,y,h){V(this,"name");V(this,"prefix");V(this,"baseEncode");V(this,"baseDecode");V(this,"encoder");V(this,"decoder");this.name=t,this.prefix=a,this.baseEncode=y,this.baseDecode=h,this.encoder=new it(t,a,y),this.decoder=new ot(t,a,h)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};c(ut,"Codec");var st=ut;function Qr({name:n,prefix:t,encode:a,decode:y}){return new st(n,t,a,y)}c(Qr,"from");function Yr({name:n,prefix:t,alphabet:a}){let{encode:y,decode:h}=ln(a,n);return Qr({prefix:t,name:n,encode:y,decode:c(E=>Lr(h(E)),"decode")})}c(Yr,"baseX");function yf(n,t,a,y){let h={};for(let br=0;br<t.length;++br)h[t[br]]=br;let E=n.length;for(;n[E-1]==="=";)--E;let D=new Uint8Array(E*a/8|0),er=0,yr=0,zr=0;for(let br=0;br<E;++br){let Dr=h[n[br]];if(Dr===void 0)throw new SyntaxError(`Non-${y} character`);yr=yr<<a|Dr,er+=a,er>=8&&(er-=8,D[zr++]=255&yr>>er)}if(er>=a||(255&yr<<8-er)!==0)throw new SyntaxError("Unexpected end of data");return D}c(yf,"decode");function uf(n,t,a){let y=t[t.length-1]==="=",h=(1<<a)-1,E="",D=0,er=0;for(let yr=0;yr<n.length;++yr)for(er=er<<8|n[yr],D+=8;D>a;)D-=a,E+=t[h&er>>D];if(D!==0&&(E+=t[h&er<<a-D]),y)for(;(E.length*a&7)!==0;)E+="=";return E}c(uf,"encode");function or({name:n,prefix:t,bitsPerChar:a,alphabet:y}){return Qr({prefix:t,name:n,encode(h){return uf(h,y,a)},decode(h){return yf(h,y,a,n)}})}c(or,"rfc4648");var hf=Yr({prefix:"9",name:"base10",alphabet:"0123456789"});var pt={};Kr(pt,{base16:()=>pf,base16upper:()=>df});var pf=or({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),df=or({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var dt={};Kr(dt,{base2:()=>lf});var lf=or({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var lt={};Kr(lt,{base256emoji:()=>wf});var gn=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}"),bf=gn.reduce((n,t,a)=>(n[a]=t,n),[]),gf=gn.reduce((n,t,a)=>{let y=t.codePointAt(0);if(y==null)throw new Error(`Invalid character: ${t}`);return n[y]=a,n},[]);function Af(n){return n.reduce((t,a)=>(t+=bf[a],t),"")}c(Af,"encode");function mf(n){let t=[];for(let a of n){let y=a.codePointAt(0);if(y==null)throw new Error(`Invalid character: ${a}`);let h=gf[y];if(h==null)throw new Error(`Non-base256emoji character: ${a}`);t.push(h)}return new Uint8Array(t)}c(mf,"decode");var wf=Qr({prefix:"\u{1F680}",name:"base256emoji",encode:Af,decode:mf});var bt={};Kr(bt,{base32:()=>re,base32hex:()=>Sf,base32hexpad:()=>_f,base32hexpadupper:()=>Bf,base32hexupper:()=>Kf,base32pad:()=>vf,base32padupper:()=>Uf,base32upper:()=>Ef,base32z:()=>Cf});var re=or({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ef=or({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),vf=or({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Uf=or({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Sf=or({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Kf=or({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),_f=or({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Bf=or({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Cf=or({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var gt={};Kr(gt,{base36:()=>ge,base36upper:()=>Tf});var ge=Yr({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Tf=Yr({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var At={};Kr(At,{base58btc:()=>Pr,base58flickr:()=>Pf});var Pr=Yr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Pf=Yr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var mt={};Kr(mt,{base64:()=>Df,base64pad:()=>Mf,base64url:()=>If,base64urlpad:()=>Lf});var Df=or({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Mf=or({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),If=or({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Lf=or({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var wt={};Kr(wt,{base8:()=>Rf});var Rf=or({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Et={};Kr(Et,{identity:()=>Nf});var Nf=Qr({prefix:"\0",name:"identity",encode:c(n=>pn(n),"encode"),decode:c(n=>hn(n),"decode")});var vo=new TextEncoder,Uo=new TextDecoder;var St={};Kr(St,{identity:()=>oi});var Yf=wn,An=128,jf=127,Hf=~jf,Ff=Math.pow(2,31);function wn(n,t,a){t=t||[],a=a||0;for(var y=a;n>=Ff;)t[a++]=n&255|An,n/=128;for(;n&Hf;)t[a++]=n&255|An,n>>>=7;return t[a]=n|0,wn.bytes=a-y+1,t}c(wn,"encode");var Gf=vt,Vf=128,mn=127;function vt(n,y){var a=0,y=y||0,h=0,E=y,D,er=n.length;do{if(E>=er)throw vt.bytes=0,new RangeError("Could not decode varint");D=n[E++],a+=h<28?(D&mn)<<h:(D&mn)*Math.pow(2,h),h+=7}while(D>=Vf);return vt.bytes=E-y,a}c(vt,"read");var Xf=Math.pow(2,7),Wf=Math.pow(2,14),$f=Math.pow(2,21),Zf=Math.pow(2,28),qf=Math.pow(2,35),Jf=Math.pow(2,42),kf=Math.pow(2,49),Qf=Math.pow(2,56),ri=Math.pow(2,63),ei=c(function(n){return n<Xf?1:n<Wf?2:n<$f?3:n<Zf?4:n<qf?5:n<Jf?6:n<kf?7:n<Qf?8:n<ri?9:10},"length"),ti={encode:Yf,decode:Gf,encodingLength:ei},ni=ti,Ae=ni;function me(n,t=0){return[Ae.decode(n,t),Ae.decode.bytes]}c(me,"decode");function ee(n,t,a=0){return Ae.encode(n,t,a),t}c(ee,"encodeTo");function te(n){return Ae.encodingLength(n)}c(te,"encodingLength");function Gr(n,t){let a=t.byteLength,y=te(n),h=y+te(a),E=new Uint8Array(h+a);return ee(n,E,0),ee(a,E,y),E.set(t,h),new ne(n,a,t,E)}c(Gr,"create");function En(n){let t=Lr(n),[a,y]=me(t),[h,E]=me(t.subarray(y)),D=t.subarray(y+E);if(D.byteLength!==h)throw new Error("Incorrect length");return new ne(a,h,D,t)}c(En,"decode");function vn(n,t){if(n===t)return!0;{let a=t;return n.code===a.code&&n.size===a.size&&a.bytes instanceof Uint8Array&&un(n.bytes,a.bytes)}}c(vn,"equals");var Ut=class Ut{constructor(t,a,y,h){V(this,"code");V(this,"size");V(this,"digest");V(this,"bytes");this.code=t,this.size=a,this.digest=y,this.bytes=h}};c(Ut,"Digest");var ne=Ut;var Un=0,fi="identity",Sn=Lr;function ii(n){return Gr(Un,Sn(n))}c(ii,"digest");var oi={code:Un,name:fi,encode:Sn,digest:ii};var Ct={};Kr(Ct,{sha256:()=>ai,sha512:()=>si});function _t({name:n,code:t,encode:a}){return new Kt(n,t,a)}c(_t,"from");var Bt=class Bt{constructor(t,a,y){V(this,"name");V(this,"code");V(this,"encode");this.name=t,this.code=a,this.encode=y}digest(t){if(t instanceof Uint8Array){let a=this.encode(t);return a instanceof Uint8Array?Gr(this.code,a):a.then(y=>Gr(this.code,y))}else throw Error("Unknown type, must be binary type")}};c(Bt,"Hasher");var Kt=Bt;function _n(n){return async t=>new Uint8Array(await crypto.subtle.digest(n,t))}c(_n,"sha");var ai=_t({name:"sha2-256",code:18,encode:_n("SHA-256")}),si=_t({name:"sha2-512",code:19,encode:_n("SHA-512")});function Bn(n,t){let{bytes:a,version:y}=n;switch(y){case 0:return xi(a,Tt(n),t??Pr.encoder);default:return yi(a,Tt(n),t??re.encoder)}}c(Bn,"format");var Cn=new WeakMap;function Tt(n){let t=Cn.get(n);if(t==null){let a=new Map;return Cn.set(n,a),a}return t}c(Tt,"baseCache");var Pn,xr=class xr{constructor(t,a,y,h){V(this,"code");V(this,"version");V(this,"multihash");V(this,"bytes");V(this,"/");V(this,Pn,"CID");this.code=a,this.version=t,this.multihash=y,this.bytes=h,this["/"]=h}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:t,multihash:a}=this;if(t!==Ee)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(a.code!==ui)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return xr.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:t,digest:a}=this.multihash,y=Gr(t,a);return xr.createV1(this.code,y)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return xr.equals(this,t)}static equals(t,a){let y=a;return y!=null&&t.code===y.code&&t.version===y.version&&vn(t.multihash,y.multihash)}toString(t){return Bn(this,t)}toJSON(){return{"/":Bn(this)}}link(){return this}[(Pn=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let a=t;if(a instanceof xr)return a;if(a["/"]!=null&&a["/"]===a.bytes||a.asCID===a){let{version:y,code:h,multihash:E,bytes:D}=a;return new xr(y,h,E,D??Tn(y,h,E.bytes))}else if(a[hi]===!0){let{version:y,multihash:h,code:E}=a,D=En(h);return xr.create(y,E,D)}else return null}static create(t,a,y){if(typeof a!="number")throw new Error("String codecs are no longer supported");if(!(y.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(a!==Ee)throw new Error(`Version 0 CID must use dag-pb (code: ${Ee}) block encoding`);return new xr(t,a,y,y.bytes)}case 1:{let h=Tn(t,a,y.bytes);return new xr(t,a,y,h)}default:throw new Error("Invalid version")}}static createV0(t){return xr.create(0,Ee,t)}static createV1(t,a){return xr.create(1,t,a)}static decode(t){let[a,y]=xr.decodeFirst(t);if(y.length!==0)throw new Error("Incorrect length");return a}static decodeFirst(t){let a=xr.inspectBytes(t),y=a.size-a.multihashSize,h=Lr(t.subarray(y,y+a.multihashSize));if(h.byteLength!==a.multihashSize)throw new Error("Incorrect length");let E=h.subarray(a.multihashSize-a.digestSize),D=new ne(a.multihashCode,a.digestSize,E,h);return[a.version===0?xr.createV0(D):xr.createV1(a.codec,D),t.subarray(a.size)]}static inspectBytes(t){let a=0,y=c(()=>{let[Dr,$r]=me(t.subarray(a));return a+=$r,Dr},"next"),h=y(),E=Ee;if(h===18?(h=0,a=0):E=y(),h!==0&&h!==1)throw new RangeError(`Invalid CID version ${h}`);let D=a,er=y(),yr=y(),zr=a+yr,br=zr-D;return{version:h,codec:E,multihashCode:er,digestSize:yr,multihashSize:br,size:zr}}static parse(t,a){let[y,h]=ci(t,a),E=xr.decode(h);if(E.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Tt(E).set(y,t),E}};c(xr,"CID");var Le=xr;function ci(n,t){switch(n[0]){case"Q":{let a=t??Pr;return[Pr.prefix,a.decode(`${Pr.prefix}${n}`)]}case Pr.prefix:{let a=t??Pr;return[Pr.prefix,a.decode(n)]}case re.prefix:{let a=t??re;return[re.prefix,a.decode(n)]}case ge.prefix:{let a=t??ge;return[ge.prefix,a.decode(n)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[n[0],t.decode(n)]}}}c(ci,"parseCIDtoBytes");function xi(n,t,a){let{prefix:y}=a;if(y!==Pr.prefix)throw Error(`Cannot string encode V0 in ${a.name} encoding`);let h=t.get(y);if(h==null){let E=a.encode(n).slice(1);return t.set(y,E),E}else return h}c(xi,"toStringV0");function yi(n,t,a){let{prefix:y}=a,h=t.get(y);if(h==null){let E=a.encode(n);return t.set(y,E),E}else return h}c(yi,"toStringV1");var Ee=112,ui=18;function Tn(n,t,a){let y=te(n),h=y+te(t),E=new Uint8Array(h+a.byteLength);return ee(n,E,0),ee(t,E,y),E.set(a,h),E}c(Tn,"encodeCID");var hi=Symbol.for("@ipld/js-cid/CID");var Pt={...Et,...dt,...wt,...ht,...pt,...bt,...gt,...At,...mt,...lt},ea={...Ct,...St};function Mn(n,t,a,y){return{name:n,prefix:t,encoder:{name:n,prefix:t,encode:a},decoder:{decode:y}}}c(Mn,"createCodec");var Dn=Mn("utf8","u",n=>"u"+new TextDecoder("utf8").decode(n),n=>new TextEncoder().encode(n.substring(1))),Dt=Mn("ascii","a",n=>{let t="a";for(let a=0;a<n.length;a++)t+=String.fromCharCode(n[a]);return t},n=>{n=n.substring(1);let t=be(n.length);for(let a=0;a<n.length;a++)t[a]=n.charCodeAt(a);return t}),pi={utf8:Dn,"utf-8":Dn,hex:Pt.base16,latin1:Dt,ascii:Dt,binary:Dt,...Pt},Re=pi;function Rr(n,t="utf8"){let a=Re[t];if(a==null)throw new Error(`Unsupported encoding "${t}"`);return a.decoder.decode(`${a.prefix}${n}`)}c(Rr,"fromString");function Er(n,t="utf8"){let a=Re[t];if(a==null)throw new Error(`Unsupported encoding "${t}"`);return a.encoder.encode(n).substring(1)}c(Er,"toString");function Ne(n){return new Promise((t,a)=>{n.oncomplete=n.onsuccess=()=>t(n.result),n.onabort=n.onerror=()=>a(n.error)})}c(Ne,"promisifyRequest");function di(n,t){let a,y=c(()=>{if(a)return a;let h=indexedDB.open(n);return h.onupgradeneeded=()=>h.result.createObjectStore(t),a=Ne(h),a.then(E=>{E.onclose=()=>a=void 0},()=>{}),a},"getDB");return(h,E)=>y().then(D=>E(D.transaction(t,h).objectStore(t)))}c(di,"createStore");var Mt;function It(){return Mt||(Mt=di("keyval-store","keyval")),Mt}c(It,"defaultGetStore");function Lt(n,t=It()){return t("readonly",a=>Ne(a.get(n)))}c(Lt,"get");function Rt(n,t,a=It()){return a("readwrite",y=>(y.put(t,n),Ne(y.transaction)))}c(Rt,"set");function In(n,t=It()){return t("readwrite",a=>(n.forEach(y=>a.delete(y)),Ne(a.transaction)))}c(In,"delMany");var li=globalThis||window||self,tr=li.crypto;var Nt="did:key:z",Pa="Ed25519",Da="X25519",Ma="X25519",Ia="Ed25519",La="X25519",gi={sign:["sign","verify"],encrypt:["deriveKey","deriveBits"]},fe="RSA-OAEP",ie="RSASSA-PKCS1-v1_5",zt="SHA-256",Ai=new Uint8Array([0,245,2]),Ra=2048,Ot="SHA-256",oe=8,ae="AES-GCM",se=ae,ve=256,ze=12,mi=new Uint8Array([234,1]),wi=new Uint8Array([237,1]),Ei={RSA:"rsa",Edwards:"ed25519",BLS:"bls12-381"},Na="rsa-exchange-key",za="rsa-write-key",Oa="ecc-exchange",Ya="ecc-write",Yt=16;var Ln=new Error("Invalid key use. Please use 'encryption' or 'signing"),Ui=new Error("Max must be less than 256 and greater than 0");function Nr(n){return new Uint8Array(n).buffer}c(Nr,"toArrayBuffer");async function Rn(n){return new Uint8Array(await tr.subtle.digest("sha-256",n.buffer))}c(Rn,"sha256");function ce(n){let t=Rr(n,"base64pad");return Nr(t)}c(ce,"base64ToArrBuf");var jt=c((n,t)=>{if(typeof n=="string")return t(n);if(typeof n=="object"&&n.byteLength!==void 0)return new Uint8Array(n).buffer;throw new Error("Improper value. Must be a string, ArrayBuffer, Uint8Array")},"normalizeToBuf");function Oe(n){return jt(n,ce)}c(Oe,"normalizeBase64ToBuf");var Si=c(n=>jt(n,t=>Nn(t,8)),"normalizeUtf8ToBuf");function Nn(n,t){let a=t===8?new Uint8Array(n.length):new Uint16Array(n.length);for(let y=0,h=n.length;y<h;y++)a[y]=n.charCodeAt(y);return a.buffer}c(Nn,"strToArrBuf");var Ki=c(n=>jt(n,t=>Nn(t,16)),"normalizeUtf16ToBuf");function xe(n,t){switch(t){case 8:return Si(n);default:return Ki(n)}}c(xe,"normalizeUnicodeToBuf");function Vr(n){return Er(n instanceof ArrayBuffer?new Uint8Array(n):n,"base64pad")}c(Vr,"toBase64");async function Ht(n,t){let a=typeof n=="string"?ce(n):Nr(n);return tr.subtle.importKey("raw",a,{name:t?.alg||se,length:t?.length||ve},!0,["encrypt","decrypt"])}c(Ht,"importKey");function zn(n,{max:t}={max:255}){if(t<1||t>255)throw Ui;let a=new Uint8Array(n);if(t===255)return tr.getRandomValues(a),a.buffer;let y=0,h=t+1,E=Math.floor(256/h)*h,D=new Uint8Array(1);for(;y<a.length;)tr.getRandomValues(D),D[0]<E&&(a[y]=D[0]%h,y++);return a.buffer}c(zn,"randomBuf");function Ye(n,t){let a=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(Nr(n)),y=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(Nr(t)),h=new Uint8Array(a.length+y.length);return h.set(a),h.set(y,a.length),h.buffer}c(Ye,"joinBufs");var Hn=of(Yn(),1);async function _i({message:n,publicKey:t,signature:a}){return Hn.default.sign.detached.verify(n,a,t)}c(_i,"ed25519Verify");var jn={keyTypes:{"bls12-381":{magicBytes:new Uint8Array([234,1]),verify:c(()=>{throw new Error("Not implemented")},"verify")},rsa:{magicBytes:new Uint8Array([0,245,2]),verify:Bi},ed25519:{magicBytes:new Uint8Array([237,1]),verify:_i}}};async function Bi({message:n,publicKey:t,signature:a}){return Vt.verify(n,a,await tr.subtle.importKey("spki",Nr(t),{name:ie,hash:zt},!1,["verify"]),8)}c(Bi,"rsaVerify");var Vt={verify:c(async function(t,a,y,h=oe,E=Ot){return tr.subtle.verify({name:ie,saltLength:Yt},typeof y=="string"?await Ft(y,E,"signing"):y,Oe(a),xe(t,h))},"rsaVerify"),sign:c(async function(t,a,y=oe){return tr.subtle.sign({name:ie,saltLength:Yt},a,xe(t,y))},"sign"),encrypt:c(async function(t,a,y=oe,h=Ot){let E;return typeof a=="string"?E=await Ft(a,h,"exchange"):E=a instanceof Uint8Array?await Ft(Nr(a),h,"exchange"):a,tr.subtle.encrypt({name:fe},E,xe(t,y))},"rsaEncrypt"),decrypt:c(async function(t,a){let y=He(a)?a:await Di(a,["decrypt"]),h;typeof t=="string"?h=Rr(t,"base64pad"):h=t;let E=await tr.subtle.decrypt({name:fe},y,h instanceof Uint8Array?Nr(h):h);return new Uint8Array(E)},"rsaDecrypt")};async function Ft(n,t,a){Ci(a);let y=a==="exchange"?fe:ie,h=a==="exchange"?["encrypt"]:["verify"],E=typeof n=="string"?ce(Pi(n)):n;return tr.subtle.importKey("spki",E,{name:y,hash:{name:t}},!0,h)}c(Ft,"importPublicKey");function Ci(n){Ti(n,["signing","exchange"],Ln)}c(Ci,"checkValidKeyUse");function Ti(n,t,a){if(!t.some(h=>h===n))throw a}c(Ti,"checkValid");function Pi(n){return n.replace(`-----BEGIN PUBLIC KEY-----
|
|
2
2
|
`,"").replace(`
|
|
3
|
-
-----END PUBLIC KEY-----`,"")}c(
|
|
3
|
+
-----END PUBLIC KEY-----`,"")}c(Pi,"stripKeyHeader");function He(n){return Gt(n,"algorithm")&&Gt(n,"extractable")&&Gt(n,"type")}c(He,"isCryptoKey");function Gt(n,t){return typeof n=="object"&&n!=null&&t in n}c(Gt,"hasProp");function Di(n,t){return tr.subtle.importKey("spki",n instanceof Uint8Array?Nr(n):n,{name:fe,hash:zt},!1,t)}c(Di,"importRsaKey");async function Xt(n,t="rsa"){let a=n instanceof CryptoKey?new Uint8Array(await Xr(n)):n,y=jn.keyTypes[t]?.magicBytes;if(!y)throw new Error(`Key type '${t}' not supported, available types: ${Object.keys(jn.keyTypes).join(", ")}`);let h=ft([y,a]);return Nt+Er(h,"base58btc")}c(Xt,"publicKeyToDid");async function Xr(n){return n instanceof CryptoKey?await tr.subtle.exportKey("spki",n):await tr.subtle.exportKey("spki",n.publicKey)}c(Xr,"getPublicKeyAsArrayBuffer");async function Mi(n){let t=await Xr(n);return new Uint8Array(t)}c(Mi,"getPublicKeyAsUint8Array");function ye(n){return new Uint8Array(n).buffer}c(ye,"toArrayBuffer");var Wr={create(n={alg:se,length:ve}){let t=n.length||ve,a=n.alg||se;return tr.subtle.generateKey({name:a,length:t},!0,["encrypt","decrypt"])},export:Object.assign(async n=>{let t=await tr.subtle.exportKey("raw",n);return new Uint8Array(t)},{asString:c(async(n,t)=>{let a=await Wr.export(n);return t?Er(a,t):Vr(a)},"asString")}),import(n){return Wt(typeof n=="string"?ce(n):n)},async exportAsString(n){let t=await Wr.export(n);return Vr(t)},encrypt:Ii,async decrypt(n,t,a){let y=He(t)?t:await Wt(t),h=a?await tr.subtle.decrypt({name:ae,iv:ye(a)},y,typeof n=="string"?ye(Rr(n)):n instanceof Uint8Array?ye(n):n):await Ri(n,y);return new Uint8Array(h)}};function Wt(n,t){return tr.subtle.importKey("raw",n instanceof Uint8Array?ye(n):n,{name:ae,length:t||256},!0,["encrypt","decrypt"])}c(Wt,"importAesKey");async function Ii(n,t,a,y){let h=He(t)?t:await Wt(t),E=y?await tr.subtle.encrypt({name:ae,iv:ye(y)},h,ye(n)):await Li(n,h);return a&&a==="arraybuffer"?E:new Uint8Array(E)}c(Ii,"encrypt");async function Li(n,t,a){let y=xe(n,a?.charsize??oe),h=typeof t=="string"?await Ht(t,a):t,E=a?.iv||zn(ze),D=await tr.subtle.encrypt({name:ae,iv:E},h,y);return Ye(E,D)}c(Li,"encryptBytes");async function Ri(n,t,a){let y=Oe(n),h=typeof t=="string"?await Ht(t,a):t,E=y.slice(0,ze),D=y.slice(ze);return await tr.subtle.decrypt({name:se,iv:E},h,D)}c(Ri,"decryptBytes");var jr=class jr{constructor(t){V(this,"DID");V(this,"exchangeKey");V(this,"writeKey");V(this,"hasPersisted");V(this,"isSessionOnly");let{keys:a}=t;this.DID=t.did,this.exchangeKey=a.exchange,this.writeKey=a.write,this.hasPersisted=t.hasPersisted,this.isSessionOnly=!!t.isSessionOnly}publicExchangeKeyAsString(t){return this.publicExchangeKey.asString(t)}publicWriteKeyAsString(t){return this.publicWriteKey.asString(t)}get publicWriteKey(){let t=this.writeKey.publicKey;return Object.assign(t,{asString:c(async a=>{let y=await Xr(this.writeKey),h=new Uint8Array(y);return a?Er(h,a):Vr(h)},"asString")})}get publicExchangeKey(){let t=this.exchangeKey.publicKey;return Object.assign(t,{asString:c(async a=>{let y=await Xr(this.exchangeKey),h=new Uint8Array(y);return a?Er(h,a):Vr(h)},"asString")})}get privateWriteKey(){return this.writeKey.privateKey}get privateExchangeKey(){return this.exchangeKey.privateKey}get deviceName(){return jr.deviceName(this.DID)}static deviceName(t){return Ni(t)}async persist(){if(this.isSessionOnly)return;let t=this.constructor.EXCHANGE_KEY_NAME,a=this.constructor.WRITE_KEY_NAME;await Promise.all([Rt(t,this.exchangeKey),Rt(a,this.writeKey)]),this.hasPersisted=!0}async delete(){await In([this.constructor.EXCHANGE_KEY_NAME,this.constructor.WRITE_KEY_NAME]),this.hasPersisted=!1}async getDeviceName(){return jr.deviceName(this.DID)}static _createExchangeKeys(){throw new Error("The child should implement this")}static _createWriteKeys(){throw new Error("The child should implement this")}static async create(t){let a=await this._createExchangeKeys(),y=await this._createWriteKeys(),h=await Xr(y),E=await Xt(new Uint8Array(h),this.TYPE==="ecc"?"ed25519":"rsa"),D=new this({keys:{exchange:a,write:y},did:E,hasPersisted:!1,isSessionOnly:!!t});return this._instance=D,D}static async load(t={session:!1}){if(this._instance)return this._instance;let a=!0,y=await Lt(t.encryptionKeyName||this.EXCHANGE_KEY_NAME),h=await Lt(t.signingKeyName||this.WRITE_KEY_NAME);y||(a=!1,y=await this._createExchangeKeys()),h||(a=!1,h=await this._createWriteKeys());let E=await Xr(h),D=await Xt(new Uint8Array(E),this.TYPE==="ecc"?"ed25519":"rsa"),er=new this({keys:{exchange:y,write:h},did:D,hasPersisted:a,isSessionOnly:!!t.session});return this._instance=er,er}};c(jr,"AbstractKeys"),V(jr,"EXCHANGE_KEY_NAME"),V(jr,"WRITE_KEY_NAME"),V(jr,"_instance");var Fn=jr;async function Gn(n,t){let{content:a,publicKey:y}=n,h=t||await Wr.create(),E=await Wr.encrypt(typeof a=="string"?Rr(a):a,typeof h=="string"?await Wr.import(h):h),D=await $t({key:h,publicKey:y});return Ye(D,E)}c(Gn,"encryptTo");Gn.asString=async function(n,t){let a=await Gn(n,t);return Er(new Uint8Array(a),"base64pad")};async function $t({key:n,publicKey:t},a){let y;n instanceof CryptoKey?y=await Wr.export(n):y=n;let h=await Vt.encrypt(y,t);return a&&a==="arraybuffer"?h:new Uint8Array(h)}c($t,"encryptKeyTo");$t.asString=async function({key:n,publicKey:t},a){let y=await $t({key:n,publicKey:t});return a?Er(y,a):Vr(y)};async function Ni(n){let t=await Rn(new TextEncoder().encode(n.normalize("NFD")));return Er(t,"base32").slice(0,32)}c(Ni,"getDeviceName");export{ae as AES_GCM,Fn as AbstractKeys,Nt as BASE58_DID_PREFIX,mi as BLS_DID_PREFIX,oe as DEFAULT_CHAR_SIZE,Oa as DEFAULT_ECC_EXCHANGE,Ma as DEFAULT_ECC_EXCHANGE_CURVE,Ya as DEFAULT_ECC_WRITE,Ot as DEFAULT_HASH_ALGORITHM,Na as DEFAULT_RSA_EXCHANGE,Ra as DEFAULT_RSA_SIZE,za as DEFAULT_RSA_WRITE,se as DEFAULT_SYMM_ALGORITHM,ve as DEFAULT_SYMM_LENGTH,Da as ECC_EXCHANGE_ALG,La as ECC_EXCHANGE_NAME,Pa as ECC_WRITE_ALG,Ia as ECC_WRITE_NAME,wi as EDWARDS_DID_PREFIX,ze as IV_LENGTH,Ei as KEY_TYPE,gi as KEY_USE,fe as RSA_ALGORITHM,Ai as RSA_DID_PREFIX,zt as RSA_HASHING_ALGORITHM,ie as RSA_SIGN_ALGORITHM,Yt as SALT_LENGTH,$t as encryptKeyTo,Gn as encryptTo,Ni as getDeviceName,Xr as getPublicKeyAsArrayBuffer,Mi as getPublicKeyAsUint8Array,Xt as publicKeyToDid};
|
|
4
4
|
//# sourceMappingURL=_base.min.js.map
|