UNPKG

g1lib

Version:

An ubiquitous static javascript toolbox lib for Ǧ1 / Duniter ecosystem with reliability in mind.

1 lines 80.1 kB
import Kt from"stream";import Uf from"http";import ze from"url";import tf from"whatwg-url";import*as Rf from"crypto";var Pf=function(){for(var e=0,r=0,f=arguments.length;r<f;r++)e+=arguments[r].length;for(var t=Array(e),n=0,r=0;r<f;r++)for(var o=arguments[r],s=0,a=o.length;s<a;s++,n++)t[n]=o[s];return t};function Of(e,r,f){var t=f===void 0?{}:f,n=t.N,o=n===void 0?16384:n,s=t.logN,a=t.r,c=a===void 0?8:a,l=t.p,d=l===void 0?1:l,S=t.dkLen,g=S===void 0?32:S,v=t.interruptStep,B=v===void 0?0:v,R=t.encoding;return new Promise(function(L,I){if(!s&&!o)return I(new Error("scrypt: missing N or logN parameter"));if(s||s===0){if(s<1||s>31)return I(new Error("scrypt: logN must be between 1 and 31"));o=1<<s>>>0}else{if(o<2||o>Se)return I(new Error("scrypt: N is out of range"));if(o&o-1)return I(Error("scrypt: N is not a power of 2"))}if(d<1)return I(new Error("scrypt: invalid p"));if(c<1)return I(new Error("scrypt: invalid r"));zf({password:e,salt:r,N:o,r:c,p:d,dkLen:g,interruptStep:B,encoding:R},L)})}function zf(e,r){var f=e.password,t=e.salt,n=e.N,o=e.r,s=e.p,a=e.dkLen,c=e.interruptStep,l=e.encoding;function d(x){var i=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],b=1779033703,y=3144134277,P=1013904242,O=2773480762,D=1359893119,$=2600822924,G=528734635,q=1541459225,k=new Array(64);function tt(Zt){for(var xe=0,_=Zt.length;_>=64;){var yt=b,gt=y,vt=P,Pt=O,ct=D,mt=$,St=G,Ot=q,at=void 0,ft=void 0,Et=void 0,At=void 0,Bt=void 0;for(ft=0;ft<16;ft++)Et=xe+ft*4,k[ft]=(Zt[Et]&255)<<24|(Zt[Et+1]&255)<<16|(Zt[Et+2]&255)<<8|Zt[Et+3]&255;for(ft=16;ft<64;ft++)at=k[ft-2],At=(at>>>17|at<<32-17)^(at>>>19|at<<32-19)^at>>>10,at=k[ft-15],Bt=(at>>>7|at<<32-7)^(at>>>18|at<<32-18)^at>>>3,k[ft]=(At+k[ft-7]|0)+(Bt+k[ft-16]|0)|0;for(ft=0;ft<64;ft++)At=(((ct>>>6|ct<<32-6)^(ct>>>11|ct<<32-11)^(ct>>>25|ct<<32-25))+(ct&mt^~ct&St)|0)+(Ot+(i[ft]+k[ft]|0)|0)|0,Bt=((yt>>>2|yt<<32-2)^(yt>>>13|yt<<32-13)^(yt>>>22|yt<<32-22))+(yt&gt^yt&vt^gt&vt)|0,Ot=St,St=mt,mt=ct,ct=Pt+At|0,Pt=vt,vt=gt,gt=yt,yt=At+Bt|0;b=b+yt|0,y=y+gt|0,P=P+vt|0,O=O+Pt|0,D=D+ct|0,$=$+mt|0,G=G+St|0,q=q+Ot|0,xe+=64,_-=64}}tt(x);var Q,rt=x.length%64,nt=x.length/536870912|0,ot=x.length<<3,it=rt<56?56:120,wt=x.slice(x.length-rt,x.length);for(wt.push(128),Q=rt+1;Q<it;Q++)wt.push(0);return wt.push(nt>>>24&255),wt.push(nt>>>16&255),wt.push(nt>>>8&255),wt.push(nt>>>0&255),wt.push(ot>>>24&255),wt.push(ot>>>16&255),wt.push(ot>>>8&255),wt.push(ot>>>0&255),tt(wt),[b>>>24&255,b>>>16&255,b>>>8&255,b>>>0&255,y>>>24&255,y>>>16&255,y>>>8&255,y>>>0&255,P>>>24&255,P>>>16&255,P>>>8&255,P>>>0&255,O>>>24&255,O>>>16&255,O>>>8&255,O>>>0&255,D>>>24&255,D>>>16&255,D>>>8&255,D>>>0&255,$>>>24&255,$>>>16&255,$>>>8&255,$>>>0&255,G>>>24&255,G>>>16&255,G>>>8&255,G>>>0&255,q>>>24&255,q>>>16&255,q>>>8&255,q>>>0&255]}function S(x,i,b){x.length>64&&(x=d(x.push?x:Pf(x)));var y,P=64+i.length+4,O=new Array(P),D=new Array(64),$=[];for(y=0;y<64;y++)O[y]=54;for(y=0;y<x.length;y++)O[y]^=x[y];for(y=0;y<i.length;y++)O[64+y]=i[y];for(y=P-4;y<P;y++)O[y]=0;for(y=0;y<64;y++)D[y]=92;for(y=0;y<x.length;y++)D[y]^=x[y];function G(){for(var q=P-1;q>=P-4;q--){if(O[q]++,O[q]<=255)return;O[q]=0}}for(;b>=32;)G(),$=$.concat(d(D.concat(d(O)))),b-=32;return b>0&&(G(),$=$.concat(d(D.concat(d(O))).slice(0,b))),$}function g(x,i,b,y){var P=x[0]^i[b++],O=x[1]^i[b++],D=x[2]^i[b++],$=x[3]^i[b++],G=x[4]^i[b++],q=x[5]^i[b++],k=x[6]^i[b++],tt=x[7]^i[b++],Q=x[8]^i[b++],rt=x[9]^i[b++],nt=x[10]^i[b++],ot=x[11]^i[b++],it=x[12]^i[b++],wt=x[13]^i[b++],Zt=x[14]^i[b++],xe=x[15]^i[b++],_,yt,gt=P,vt=O,Pt=D,ct=$,mt=G,St=q,Ot=k,at=tt,ft=Q,Et=rt,At=nt,Bt=ot,Xt=it,Gt=wt,Wt=Zt,kt=xe;for(yt=0;yt<8;yt+=2)_=gt+Xt,mt^=_<<7|_>>>32-7,_=mt+gt,ft^=_<<9|_>>>32-9,_=ft+mt,Xt^=_<<13|_>>>32-13,_=Xt+ft,gt^=_<<18|_>>>32-18,_=St+vt,Et^=_<<7|_>>>32-7,_=Et+St,Gt^=_<<9|_>>>32-9,_=Gt+Et,vt^=_<<13|_>>>32-13,_=vt+Gt,St^=_<<18|_>>>32-18,_=At+Ot,Wt^=_<<7|_>>>32-7,_=Wt+At,Pt^=_<<9|_>>>32-9,_=Pt+Wt,Ot^=_<<13|_>>>32-13,_=Ot+Pt,At^=_<<18|_>>>32-18,_=kt+Bt,ct^=_<<7|_>>>32-7,_=ct+kt,at^=_<<9|_>>>32-9,_=at+ct,Bt^=_<<13|_>>>32-13,_=Bt+at,kt^=_<<18|_>>>32-18,_=gt+ct,vt^=_<<7|_>>>32-7,_=vt+gt,Pt^=_<<9|_>>>32-9,_=Pt+vt,ct^=_<<13|_>>>32-13,_=ct+Pt,gt^=_<<18|_>>>32-18,_=St+mt,Ot^=_<<7|_>>>32-7,_=Ot+St,at^=_<<9|_>>>32-9,_=at+Ot,mt^=_<<13|_>>>32-13,_=mt+at,St^=_<<18|_>>>32-18,_=At+Et,Bt^=_<<7|_>>>32-7,_=Bt+At,ft^=_<<9|_>>>32-9,_=ft+Bt,Et^=_<<13|_>>>32-13,_=Et+ft,At^=_<<18|_>>>32-18,_=kt+Wt,Xt^=_<<7|_>>>32-7,_=Xt+kt,Gt^=_<<9|_>>>32-9,_=Gt+Xt,Wt^=_<<13|_>>>32-13,_=Wt+Gt,kt^=_<<18|_>>>32-18;i[y++]=x[0]=gt+P|0,i[y++]=x[1]=vt+O|0,i[y++]=x[2]=Pt+D|0,i[y++]=x[3]=ct+$|0,i[y++]=x[4]=mt+G|0,i[y++]=x[5]=St+q|0,i[y++]=x[6]=Ot+k|0,i[y++]=x[7]=at+tt|0,i[y++]=x[8]=ft+Q|0,i[y++]=x[9]=Et+rt|0,i[y++]=x[10]=At+nt|0,i[y++]=x[11]=Bt+ot|0,i[y++]=x[12]=Xt+it|0,i[y++]=x[13]=Gt+wt|0,i[y++]=x[14]=Wt+Zt|0,i[y++]=x[15]=kt+xe|0}function v(x,i,b,y,P){for(;P--;)x[i++]=b[y++]}function B(x,i,b,y,P){for(;P--;)x[i++]^=b[y++]}function R(x,i,b,y,P){v(x,0,i,b+(2*P-1)*16,16);for(var O=0;O<2*P;O+=2)g(x,i,b+O*16,y+O*8),g(x,i,b+O*16+16,y+O*8+P*16)}function L(x,i,b){return x[i+(2*b-1)*16]}function I(x){for(var i=[],b=0;b<x.length;b++){var y=x.charCodeAt(b);if(y<128)i.push(y);else if(y<2048)i.push(192|y>>6),i.push(128|y&63);else if(y<55296)i.push(224|y>>12),i.push(128|y>>6&63),i.push(128|y&63);else{if(b>=x.length-1)throw new Error("invalid string");b++,y=(y&1023)<<10,y|=x.charCodeAt(b)&1023,y+=65536,i.push(240|y>>18),i.push(128|y>>12&63),i.push(128|y>>6&63),i.push(128|y&63)}}return i}function Y(x){for(var i="0123456789abcdef".split(""),b=x.length,y=[],P=0;P<b;P++)y.push(i[x[P]>>>4&15]),y.push(i[x[P]>>>0&15]);return y.join("")}function K(x){for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),b=x.length,y=[],P=0,O,D,$,G;P<b;)O=P<b?x[P++]:0,D=P<b?x[P++]:0,$=P<b?x[P++]:0,G=(O<<16)+(D<<8)+$,y.push(i[G>>>3*6&63]),y.push(i[G>>>2*6&63]),y.push(i[G>>>1*6&63]),y.push(i[G>>>0*6&63]);return b%3>0&&(y[y.length-1]="=",b%3===1&&(y[y.length-2]="=")),y.join("")}var F,j,T,N;if(o*s>=1<<30||o>Se/128/s||o>Se/256||n>Se/128/o)throw new Error("scrypt: parameters are too large");typeof f=="string"&&(f=I(f)),typeof t=="string"&&(t=I(t)),typeof Int32Array<"u"?(F=new Int32Array(64*o),j=new Int32Array(32*n*o),N=new Int32Array(16)):(F=[],j=[],N=new Array(16)),T=S(f,t,s*128*o);var z=0,U=32*o;function h(x){for(var i=0;i<32*o;i++){var b=x+i*4;F[z+i]=(T[b+3]&255)<<24|(T[b+2]&255)<<16|(T[b+1]&255)<<8|(T[b+0]&255)<<0}}function u(x,i){for(var b=x;b<i;b+=2)v(j,b*(32*o),F,z,32*o),R(N,F,z,U,o),v(j,(b+1)*(32*o),F,U,32*o),R(N,F,U,z,o)}function E(x,i){for(var b=x;b<i;b+=2){var y=L(F,z,o)&n-1;B(F,z,j,y*(32*o),32*o),R(N,F,z,U,o),y=L(F,U,o)&n-1,B(F,U,j,y*(32*o),32*o),R(N,F,U,z,o)}}function p(x){for(var i=0;i<32*o;i++){var b=F[z+i];T[x+i*4+0]=b>>>0&255,T[x+i*4+1]=b>>>8&255,T[x+i*4+2]=b>>>16&255,T[x+i*4+3]=b>>>24&255}}var w=typeof setImmediate<"u"?setImmediate:setTimeout;function m(x,i,b,y,P){(function O(){w(function(){y(x,x+b<i?x+b:i),x+=b,x<i?O():P()})})()}function Z(x){var i=S(f,T,a);return x==="base64"?K(i):x==="hex"?Y(i):x==="binary"?new Uint8Array(i):i}function V(){for(var x=0;x<s;x++)h(x*128*o),u(0,n),E(0,n),p(x*128*o);r(Z(l))}function X(x){h(x*128*o),m(0,n,c*2,u,function(){m(0,n,c*2,E,function(){p(x*128*o),x+1<s?w(function(){X(x+1)}):r(Z(l))})})}c<=0?V():X(0)}var Se=-1>>>0;var Fe="input is invalid type";typeof process=="object"&&process.versions&&process.versions.node;var M="0123456789abcdef".split(""),If=[-2147483648,8388608,32768,128],zt=[24,16,8,0],_e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Te=["hex","array","digest","arrayBuffer"],xt=[],Lr=function(e,r){return function(f){return new ht(r,!0).update(f)[e]()}};function xr(e){var r=Lr("hex",e);r.create=function(){return new ht(e)},r.update=function(n){return r.create().update(n)};for(var f=0;f<Te.length;++f){var t=Te[f];r[t]=Lr(t,e)}return r}var jr=function(e,r){return function(f,t){return new Ie(f,r,!0).update(t)[e]()}},ef=function(e){var r=jr("hex",e);r.create=function(n){return new Ie(n,e)},r.update=function(n,o){return r.create(n).update(o)};for(var f=0;f<Te.length;++f){var t=Te[f];r[t]=jr(t,e)}return r};function ht(e,r){r?(xt[0]=xt[16]=xt[1]=xt[2]=xt[3]=xt[4]=xt[5]=xt[6]=xt[7]=xt[8]=xt[9]=xt[10]=xt[11]=xt[12]=xt[13]=xt[14]=xt[15]=0,this.blocks=xt):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}ht.prototype.update=function(e){if(!this.finalized){var r,f=typeof e;if(f!=="string"){if(f==="object"){if(e===null)throw new Error(Fe);e=new Uint8Array(e)}else throw new Error(Fe);r=!0}for(var t,n=0,o,s=e.length,a=this.blocks;n<s;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),r)for(o=this.start;n<s&&o<64;++n)a[o>>2]|=e[n]<<zt[o++&3];else for(o=this.start;n<s&&o<64;++n)t=e.charCodeAt(n),t<128?a[o>>2]|=t<<zt[o++&3]:t<2048?(a[o>>2]|=(192|t>>6)<<zt[o++&3],a[o>>2]|=(128|t&63)<<zt[o++&3]):t<55296||t>=57344?(a[o>>2]|=(224|t>>12)<<zt[o++&3],a[o>>2]|=(128|t>>6&63)<<zt[o++&3],a[o>>2]|=(128|t&63)<<zt[o++&3]):(t=65536+((t&1023)<<10|e.charCodeAt(++n)&1023),a[o>>2]|=(240|t>>18)<<zt[o++&3],a[o>>2]|=(128|t>>12&63)<<zt[o++&3],a[o>>2]|=(128|t>>6&63)<<zt[o++&3],a[o>>2]|=(128|t&63)<<zt[o++&3]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=a[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}};ht.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,r=this.lastByteIndex;e[16]=this.block,e[r>>2]|=If[r&3],this.block=e[16],r>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}};ht.prototype.hash=function(){var e=this.h0,r=this.h1,f=this.h2,t=this.h3,n=this.h4,o=this.h5,s=this.h6,a=this.h7,c=this.blocks,l,d,S,g,v,B,R,L,I,Y,K;for(l=16;l<64;++l)v=c[l-15],d=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3,v=c[l-2],S=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,c[l]=c[l-16]+d+c[l-7]+S<<0;for(K=r&f,l=0;l<64;l+=4)this.first?(this.is224?(L=300032,v=c[0]-1413257819,a=v-150054599<<0,t=v+24177077<<0):(L=704751109,v=c[0]-210244248,a=v-1521486534<<0,t=v+143694565<<0),this.first=!1):(d=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),S=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),L=e&r,g=L^e&f^K,R=n&o^~n&s,v=a+S+R+_e[l]+c[l],B=d+g,a=t+v<<0,t=v+B<<0),d=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),S=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),I=t&e,g=I^t&r^L,R=a&n^~a&o,v=s+S+R+_e[l+1]+c[l+1],B=d+g,s=f+v<<0,f=v+B<<0,d=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),S=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),Y=f&t,g=Y^f&e^I,R=s&a^~s&n,v=o+S+R+_e[l+2]+c[l+2],B=d+g,o=r+v<<0,r=v+B<<0,d=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),S=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),K=r&f,g=K^r&t^Y,R=o&s^~o&a,v=n+S+R+_e[l+3]+c[l+3],B=d+g,n=e+v<<0,e=v+B<<0;this.h0=this.h0+e<<0,this.h1=this.h1+r<<0,this.h2=this.h2+f<<0,this.h3=this.h3+t<<0,this.h4=this.h4+n<<0,this.h5=this.h5+o<<0,this.h6=this.h6+s<<0,this.h7=this.h7+a<<0};ht.prototype.hex=function(){this.finalize();var e=this.h0,r=this.h1,f=this.h2,t=this.h3,n=this.h4,o=this.h5,s=this.h6,a=this.h7,c=M[e>>28&15]+M[e>>24&15]+M[e>>20&15]+M[e>>16&15]+M[e>>12&15]+M[e>>8&15]+M[e>>4&15]+M[e&15]+M[r>>28&15]+M[r>>24&15]+M[r>>20&15]+M[r>>16&15]+M[r>>12&15]+M[r>>8&15]+M[r>>4&15]+M[r&15]+M[f>>28&15]+M[f>>24&15]+M[f>>20&15]+M[f>>16&15]+M[f>>12&15]+M[f>>8&15]+M[f>>4&15]+M[f&15]+M[t>>28&15]+M[t>>24&15]+M[t>>20&15]+M[t>>16&15]+M[t>>12&15]+M[t>>8&15]+M[t>>4&15]+M[t&15]+M[n>>28&15]+M[n>>24&15]+M[n>>20&15]+M[n>>16&15]+M[n>>12&15]+M[n>>8&15]+M[n>>4&15]+M[n&15]+M[o>>28&15]+M[o>>24&15]+M[o>>20&15]+M[o>>16&15]+M[o>>12&15]+M[o>>8&15]+M[o>>4&15]+M[o&15]+M[s>>28&15]+M[s>>24&15]+M[s>>20&15]+M[s>>16&15]+M[s>>12&15]+M[s>>8&15]+M[s>>4&15]+M[s&15];return this.is224||(c+=M[a>>28&15]+M[a>>24&15]+M[a>>20&15]+M[a>>16&15]+M[a>>12&15]+M[a>>8&15]+M[a>>4&15]+M[a&15]),c};ht.prototype.toString=ht.prototype.hex;ht.prototype.digest=function(){this.finalize();var e=this.h0,r=this.h1,f=this.h2,t=this.h3,n=this.h4,o=this.h5,s=this.h6,a=this.h7,c=[e>>24&255,e>>16&255,e>>8&255,e&255,r>>24&255,r>>16&255,r>>8&255,r&255,f>>24&255,f>>16&255,f>>8&255,f&255,t>>24&255,t>>16&255,t>>8&255,t&255,n>>24&255,n>>16&255,n>>8&255,n&255,o>>24&255,o>>16&255,o>>8&255,o&255,s>>24&255,s>>16&255,s>>8&255,s&255];return this.is224||c.push(a>>24&255,a>>16&255,a>>8&255,a&255),c};ht.prototype.array=ht.prototype.digest;ht.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),r=new DataView(e);return r.setUint32(0,this.h0),r.setUint32(4,this.h1),r.setUint32(8,this.h2),r.setUint32(12,this.h3),r.setUint32(16,this.h4),r.setUint32(20,this.h5),r.setUint32(24,this.h6),this.is224||r.setUint32(28,this.h7),e};function Ie(e,r,f){var t,n=typeof e;if(n==="string"){var o=[],s=e.length,a=0,c;for(t=0;t<s;++t)c=e.charCodeAt(t),c<128?o[a++]=c:c<2048?(o[a++]=192|c>>6,o[a++]=128|c&63):c<55296||c>=57344?(o[a++]=224|c>>12,o[a++]=128|c>>6&63,o[a++]=128|c&63):(c=65536+((c&1023)<<10|e.charCodeAt(++t)&1023),o[a++]=240|c>>18,o[a++]=128|c>>12&63,o[a++]=128|c>>6&63,o[a++]=128|c&63);e=o}else if(n==="object"){if(e===null)throw new Error(Fe);e=new Uint8Array(e)}else throw new Error(Fe);e.length>64&&(e=new ht(r,!0).update(e).array());var l=[],d=[];for(t=0;t<64;++t){var S=e[t]||0;l[t]=92^S,d[t]=54^S}ht.call(this,r,f),this.update(d),this.oKeyPad=l,this.inner=!0,this.sharedMemory=f}Ie.prototype=new ht;Ie.prototype.finalize=function(){if(ht.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();ht.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),ht.prototype.finalize.call(this)}};const de=xr();de.sha256=de;de.sha224=xr(!0);de.sha256.hmac=ef();de.sha224.hmac=ef(!0);var H={},C=function(e){var r,f=new Float64Array(16);if(e)for(r=0;r<e.length;r++)f[r]=e[r];return f},Ne=function(){throw new Error("no PRNG")},Nf=new Uint8Array(16),rf=new Uint8Array(32);rf[0]=9;var er=C(),ie=C([1]),Lf=C([56129,1]),ff=C([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),jf=C([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Mr=C([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Cr=C([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Mf=C([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Yr(e,r,f,t){e[r]=f>>24&255,e[r+1]=f>>16&255,e[r+2]=f>>8&255,e[r+3]=f&255,e[r+4]=t>>24&255,e[r+5]=t>>16&255,e[r+6]=t>>8&255,e[r+7]=t&255}function hr(e,r,f,t,n){var o,s=0;for(o=0;o<n;o++)s|=e[r+o]^f[t+o];return(1&s-1>>>8)-1}function nf(e,r,f,t){return hr(e,r,f,t,16)}function ur(e,r,f,t){return hr(e,r,f,t,32)}function Cf(e,r,f,t){for(var n=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,o=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,s=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,a=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,c=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,l=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,d=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,S=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,g=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,v=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,B=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,R=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,L=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,I=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,Y=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,K=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,F=n,j=o,T=s,N=a,z=c,U=l,h=d,u=S,E=g,p=v,w=B,m=R,Z=L,V=I,X=Y,x=K,i,b=0;b<20;b+=2)i=F+Z|0,z^=i<<7|i>>>32-7,i=z+F|0,E^=i<<9|i>>>32-9,i=E+z|0,Z^=i<<13|i>>>32-13,i=Z+E|0,F^=i<<18|i>>>32-18,i=U+j|0,p^=i<<7|i>>>32-7,i=p+U|0,V^=i<<9|i>>>32-9,i=V+p|0,j^=i<<13|i>>>32-13,i=j+V|0,U^=i<<18|i>>>32-18,i=w+h|0,X^=i<<7|i>>>32-7,i=X+w|0,T^=i<<9|i>>>32-9,i=T+X|0,h^=i<<13|i>>>32-13,i=h+T|0,w^=i<<18|i>>>32-18,i=x+m|0,N^=i<<7|i>>>32-7,i=N+x|0,u^=i<<9|i>>>32-9,i=u+N|0,m^=i<<13|i>>>32-13,i=m+u|0,x^=i<<18|i>>>32-18,i=F+N|0,j^=i<<7|i>>>32-7,i=j+F|0,T^=i<<9|i>>>32-9,i=T+j|0,N^=i<<13|i>>>32-13,i=N+T|0,F^=i<<18|i>>>32-18,i=U+z|0,h^=i<<7|i>>>32-7,i=h+U|0,u^=i<<9|i>>>32-9,i=u+h|0,z^=i<<13|i>>>32-13,i=z+u|0,U^=i<<18|i>>>32-18,i=w+p|0,m^=i<<7|i>>>32-7,i=m+w|0,E^=i<<9|i>>>32-9,i=E+m|0,p^=i<<13|i>>>32-13,i=p+E|0,w^=i<<18|i>>>32-18,i=x+X|0,Z^=i<<7|i>>>32-7,i=Z+x|0,V^=i<<9|i>>>32-9,i=V+Z|0,X^=i<<13|i>>>32-13,i=X+V|0,x^=i<<18|i>>>32-18;F=F+n|0,j=j+o|0,T=T+s|0,N=N+a|0,z=z+c|0,U=U+l|0,h=h+d|0,u=u+S|0,E=E+g|0,p=p+v|0,w=w+B|0,m=m+R|0,Z=Z+L|0,V=V+I|0,X=X+Y|0,x=x+K|0,e[0]=F>>>0&255,e[1]=F>>>8&255,e[2]=F>>>16&255,e[3]=F>>>24&255,e[4]=j>>>0&255,e[5]=j>>>8&255,e[6]=j>>>16&255,e[7]=j>>>24&255,e[8]=T>>>0&255,e[9]=T>>>8&255,e[10]=T>>>16&255,e[11]=T>>>24&255,e[12]=N>>>0&255,e[13]=N>>>8&255,e[14]=N>>>16&255,e[15]=N>>>24&255,e[16]=z>>>0&255,e[17]=z>>>8&255,e[18]=z>>>16&255,e[19]=z>>>24&255,e[20]=U>>>0&255,e[21]=U>>>8&255,e[22]=U>>>16&255,e[23]=U>>>24&255,e[24]=h>>>0&255,e[25]=h>>>8&255,e[26]=h>>>16&255,e[27]=h>>>24&255,e[28]=u>>>0&255,e[29]=u>>>8&255,e[30]=u>>>16&255,e[31]=u>>>24&255,e[32]=E>>>0&255,e[33]=E>>>8&255,e[34]=E>>>16&255,e[35]=E>>>24&255,e[36]=p>>>0&255,e[37]=p>>>8&255,e[38]=p>>>16&255,e[39]=p>>>24&255,e[40]=w>>>0&255,e[41]=w>>>8&255,e[42]=w>>>16&255,e[43]=w>>>24&255,e[44]=m>>>0&255,e[45]=m>>>8&255,e[46]=m>>>16&255,e[47]=m>>>24&255,e[48]=Z>>>0&255,e[49]=Z>>>8&255,e[50]=Z>>>16&255,e[51]=Z>>>24&255,e[52]=V>>>0&255,e[53]=V>>>8&255,e[54]=V>>>16&255,e[55]=V>>>24&255,e[56]=X>>>0&255,e[57]=X>>>8&255,e[58]=X>>>16&255,e[59]=X>>>24&255,e[60]=x>>>0&255,e[61]=x>>>8&255,e[62]=x>>>16&255,e[63]=x>>>24&255}function Yf(e,r,f,t){for(var n=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,o=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,s=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,a=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,c=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,l=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,d=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,S=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,g=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,v=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,B=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,R=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,L=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,I=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,Y=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,K=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,F=n,j=o,T=s,N=a,z=c,U=l,h=d,u=S,E=g,p=v,w=B,m=R,Z=L,V=I,X=Y,x=K,i,b=0;b<20;b+=2)i=F+Z|0,z^=i<<7|i>>>32-7,i=z+F|0,E^=i<<9|i>>>32-9,i=E+z|0,Z^=i<<13|i>>>32-13,i=Z+E|0,F^=i<<18|i>>>32-18,i=U+j|0,p^=i<<7|i>>>32-7,i=p+U|0,V^=i<<9|i>>>32-9,i=V+p|0,j^=i<<13|i>>>32-13,i=j+V|0,U^=i<<18|i>>>32-18,i=w+h|0,X^=i<<7|i>>>32-7,i=X+w|0,T^=i<<9|i>>>32-9,i=T+X|0,h^=i<<13|i>>>32-13,i=h+T|0,w^=i<<18|i>>>32-18,i=x+m|0,N^=i<<7|i>>>32-7,i=N+x|0,u^=i<<9|i>>>32-9,i=u+N|0,m^=i<<13|i>>>32-13,i=m+u|0,x^=i<<18|i>>>32-18,i=F+N|0,j^=i<<7|i>>>32-7,i=j+F|0,T^=i<<9|i>>>32-9,i=T+j|0,N^=i<<13|i>>>32-13,i=N+T|0,F^=i<<18|i>>>32-18,i=U+z|0,h^=i<<7|i>>>32-7,i=h+U|0,u^=i<<9|i>>>32-9,i=u+h|0,z^=i<<13|i>>>32-13,i=z+u|0,U^=i<<18|i>>>32-18,i=w+p|0,m^=i<<7|i>>>32-7,i=m+w|0,E^=i<<9|i>>>32-9,i=E+m|0,p^=i<<13|i>>>32-13,i=p+E|0,w^=i<<18|i>>>32-18,i=x+X|0,Z^=i<<7|i>>>32-7,i=Z+x|0,V^=i<<9|i>>>32-9,i=V+Z|0,X^=i<<13|i>>>32-13,i=X+V|0,x^=i<<18|i>>>32-18;e[0]=F>>>0&255,e[1]=F>>>8&255,e[2]=F>>>16&255,e[3]=F>>>24&255,e[4]=U>>>0&255,e[5]=U>>>8&255,e[6]=U>>>16&255,e[7]=U>>>24&255,e[8]=w>>>0&255,e[9]=w>>>8&255,e[10]=w>>>16&255,e[11]=w>>>24&255,e[12]=x>>>0&255,e[13]=x>>>8&255,e[14]=x>>>16&255,e[15]=x>>>24&255,e[16]=h>>>0&255,e[17]=h>>>8&255,e[18]=h>>>16&255,e[19]=h>>>24&255,e[20]=u>>>0&255,e[21]=u>>>8&255,e[22]=u>>>16&255,e[23]=u>>>24&255,e[24]=E>>>0&255,e[25]=E>>>8&255,e[26]=E>>>16&255,e[27]=E>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}function Ue(e,r,f,t){Cf(e,r,f,t)}function Le(e,r,f,t){Yf(e,r,f,t)}var te=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function of(e,r,f,t,n,o,s){var a=new Uint8Array(16),c=new Uint8Array(64),l,d;for(d=0;d<16;d++)a[d]=0;for(d=0;d<8;d++)a[d]=o[d];for(;n>=64;){for(Ue(c,a,s,te),d=0;d<64;d++)e[r+d]=f[t+d]^c[d];for(l=1,d=8;d<16;d++)l=l+(a[d]&255)|0,a[d]=l&255,l>>>=8;n-=64,r+=64,t+=64}if(n>0)for(Ue(c,a,s,te),d=0;d<n;d++)e[r+d]=f[t+d]^c[d];return 0}function sf(e,r,f,t,n){var o=new Uint8Array(16),s=new Uint8Array(64),a,c;for(c=0;c<16;c++)o[c]=0;for(c=0;c<8;c++)o[c]=t[c];for(;f>=64;){for(Ue(s,o,n,te),c=0;c<64;c++)e[r+c]=s[c];for(a=1,c=8;c<16;c++)a=a+(o[c]&255)|0,o[c]=a&255,a>>>=8;f-=64,r+=64}if(f>0)for(Ue(s,o,n,te),c=0;c<f;c++)e[r+c]=s[c];return 0}function af(e,r,f,t,n){var o=new Uint8Array(32);Le(o,t,n,te);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=t[a+16];return sf(e,r,f,s,o)}function lr(e,r,f,t,n,o,s){var a=new Uint8Array(32);Le(a,o,s,te);for(var c=new Uint8Array(8),l=0;l<8;l++)c[l]=o[l+16];return of(e,r,f,t,n,c,a)}var je=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 r,f,t,n,o,s,a,c;r=e[0]&255|(e[1]&255)<<8,this.r[0]=r&8191,f=e[2]&255|(e[3]&255)<<8,this.r[1]=(r>>>13|f<<3)&8191,t=e[4]&255|(e[5]&255)<<8,this.r[2]=(f>>>10|t<<6)&7939,n=e[6]&255|(e[7]&255)<<8,this.r[3]=(t>>>7|n<<9)&8191,o=e[8]&255|(e[9]&255)<<8,this.r[4]=(n>>>4|o<<12)&255,this.r[5]=o>>>1&8190,s=e[10]&255|(e[11]&255)<<8,this.r[6]=(o>>>14|s<<2)&8191,a=e[12]&255|(e[13]&255)<<8,this.r[7]=(s>>>11|a<<5)&8065,c=e[14]&255|(e[15]&255)<<8,this.r[8]=(a>>>8|c<<8)&8191,this.r[9]=c>>>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};je.prototype.blocks=function(e,r,f){for(var t=this.fin?0:2048,n,o,s,a,c,l,d,S,g,v,B,R,L,I,Y,K,F,j,T,N=this.h[0],z=this.h[1],U=this.h[2],h=this.h[3],u=this.h[4],E=this.h[5],p=this.h[6],w=this.h[7],m=this.h[8],Z=this.h[9],V=this.r[0],X=this.r[1],x=this.r[2],i=this.r[3],b=this.r[4],y=this.r[5],P=this.r[6],O=this.r[7],D=this.r[8],$=this.r[9];f>=16;)n=e[r+0]&255|(e[r+1]&255)<<8,N+=n&8191,o=e[r+2]&255|(e[r+3]&255)<<8,z+=(n>>>13|o<<3)&8191,s=e[r+4]&255|(e[r+5]&255)<<8,U+=(o>>>10|s<<6)&8191,a=e[r+6]&255|(e[r+7]&255)<<8,h+=(s>>>7|a<<9)&8191,c=e[r+8]&255|(e[r+9]&255)<<8,u+=(a>>>4|c<<12)&8191,E+=c>>>1&8191,l=e[r+10]&255|(e[r+11]&255)<<8,p+=(c>>>14|l<<2)&8191,d=e[r+12]&255|(e[r+13]&255)<<8,w+=(l>>>11|d<<5)&8191,S=e[r+14]&255|(e[r+15]&255)<<8,m+=(d>>>8|S<<8)&8191,Z+=S>>>5|t,g=0,v=g,v+=N*V,v+=z*(5*$),v+=U*(5*D),v+=h*(5*O),v+=u*(5*P),g=v>>>13,v&=8191,v+=E*(5*y),v+=p*(5*b),v+=w*(5*i),v+=m*(5*x),v+=Z*(5*X),g+=v>>>13,v&=8191,B=g,B+=N*X,B+=z*V,B+=U*(5*$),B+=h*(5*D),B+=u*(5*O),g=B>>>13,B&=8191,B+=E*(5*P),B+=p*(5*y),B+=w*(5*b),B+=m*(5*i),B+=Z*(5*x),g+=B>>>13,B&=8191,R=g,R+=N*x,R+=z*X,R+=U*V,R+=h*(5*$),R+=u*(5*D),g=R>>>13,R&=8191,R+=E*(5*O),R+=p*(5*P),R+=w*(5*y),R+=m*(5*b),R+=Z*(5*i),g+=R>>>13,R&=8191,L=g,L+=N*i,L+=z*x,L+=U*X,L+=h*V,L+=u*(5*$),g=L>>>13,L&=8191,L+=E*(5*D),L+=p*(5*O),L+=w*(5*P),L+=m*(5*y),L+=Z*(5*b),g+=L>>>13,L&=8191,I=g,I+=N*b,I+=z*i,I+=U*x,I+=h*X,I+=u*V,g=I>>>13,I&=8191,I+=E*(5*$),I+=p*(5*D),I+=w*(5*O),I+=m*(5*P),I+=Z*(5*y),g+=I>>>13,I&=8191,Y=g,Y+=N*y,Y+=z*b,Y+=U*i,Y+=h*x,Y+=u*X,g=Y>>>13,Y&=8191,Y+=E*V,Y+=p*(5*$),Y+=w*(5*D),Y+=m*(5*O),Y+=Z*(5*P),g+=Y>>>13,Y&=8191,K=g,K+=N*P,K+=z*y,K+=U*b,K+=h*i,K+=u*x,g=K>>>13,K&=8191,K+=E*X,K+=p*V,K+=w*(5*$),K+=m*(5*D),K+=Z*(5*O),g+=K>>>13,K&=8191,F=g,F+=N*O,F+=z*P,F+=U*y,F+=h*b,F+=u*i,g=F>>>13,F&=8191,F+=E*x,F+=p*X,F+=w*V,F+=m*(5*$),F+=Z*(5*D),g+=F>>>13,F&=8191,j=g,j+=N*D,j+=z*O,j+=U*P,j+=h*y,j+=u*b,g=j>>>13,j&=8191,j+=E*i,j+=p*x,j+=w*X,j+=m*V,j+=Z*(5*$),g+=j>>>13,j&=8191,T=g,T+=N*$,T+=z*D,T+=U*O,T+=h*P,T+=u*y,g=T>>>13,T&=8191,T+=E*b,T+=p*i,T+=w*x,T+=m*X,T+=Z*V,g+=T>>>13,T&=8191,g=(g<<2)+g|0,g=g+v|0,v=g&8191,g=g>>>13,B+=g,N=v,z=B,U=R,h=L,u=I,E=Y,p=K,w=F,m=j,Z=T,r+=16,f-=16;this.h[0]=N,this.h[1]=z,this.h[2]=U,this.h[3]=h,this.h[4]=u,this.h[5]=E,this.h[6]=p,this.h[7]=w,this.h[8]=m,this.h[9]=Z};je.prototype.finish=function(e,r){var f=new Uint16Array(10),t,n,o,s;if(this.leftover){for(s=this.leftover,this.buffer[s++]=1;s<16;s++)this.buffer[s]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(t=this.h[1]>>>13,this.h[1]&=8191,s=2;s<10;s++)this.h[s]+=t,t=this.h[s]>>>13,this.h[s]&=8191;for(this.h[0]+=t*5,t=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=t,t=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=t,f[0]=this.h[0]+5,t=f[0]>>>13,f[0]&=8191,s=1;s<10;s++)f[s]=this.h[s]+t,t=f[s]>>>13,f[s]&=8191;for(f[9]-=1<<13,n=(t^1)-1,s=0;s<10;s++)f[s]&=n;for(n=~n,s=0;s<10;s++)this.h[s]=this.h[s]&n|f[s];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,o=this.h[0]+this.pad[0],this.h[0]=o&65535,s=1;s<8;s++)o=(this.h[s]+this.pad[s]|0)+(o>>>16)|0,this.h[s]=o&65535;e[r+0]=this.h[0]>>>0&255,e[r+1]=this.h[0]>>>8&255,e[r+2]=this.h[1]>>>0&255,e[r+3]=this.h[1]>>>8&255,e[r+4]=this.h[2]>>>0&255,e[r+5]=this.h[2]>>>8&255,e[r+6]=this.h[3]>>>0&255,e[r+7]=this.h[3]>>>8&255,e[r+8]=this.h[4]>>>0&255,e[r+9]=this.h[4]>>>8&255,e[r+10]=this.h[5]>>>0&255,e[r+11]=this.h[5]>>>8&255,e[r+12]=this.h[6]>>>0&255,e[r+13]=this.h[6]>>>8&255,e[r+14]=this.h[7]>>>0&255,e[r+15]=this.h[7]>>>8&255};je.prototype.update=function(e,r,f){var t,n;if(this.leftover){for(n=16-this.leftover,n>f&&(n=f),t=0;t<n;t++)this.buffer[this.leftover+t]=e[r+t];if(f-=n,r+=n,this.leftover+=n,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(f>=16&&(n=f-f%16,this.blocks(e,r,n),r+=n,f-=n),f){for(t=0;t<f;t++)this.buffer[this.leftover+t]=e[r+t];this.leftover+=f}};function dr(e,r,f,t,n,o){var s=new je(o);return s.update(f,t,n),s.finish(e,r),0}function cf(e,r,f,t,n,o){var s=new Uint8Array(16);return dr(s,0,f,t,n,o),nf(e,r,s,0)}function yr(e,r,f,t,n){var o;if(f<32)return-1;for(lr(e,0,r,0,f,t,n),dr(e,16,e,32,f-32,e),o=0;o<16;o++)e[o]=0;return 0}function br(e,r,f,t,n){var o,s=new Uint8Array(32);if(f<32||(af(s,0,32,t,n),cf(r,16,r,32,f-32,s)!==0))return-1;for(lr(e,0,r,0,f,t,n),o=0;o<32;o++)e[o]=0;return 0}function Ct(e,r){var f;for(f=0;f<16;f++)e[f]=r[f]|0}function Ve(e){var r,f,t=1;for(r=0;r<16;r++)f=e[r]+t+65535,t=Math.floor(f/65536),e[r]=f-t*65536;e[0]+=t-1+37*(t-1)}function ne(e,r,f){for(var t,n=~(f-1),o=0;o<16;o++)t=n&(e[o]^r[o]),e[o]^=t,r[o]^=t}function ee(e,r){var f,t,n,o=C(),s=C();for(f=0;f<16;f++)s[f]=r[f];for(Ve(s),Ve(s),Ve(s),t=0;t<2;t++){for(o[0]=s[0]-65517,f=1;f<15;f++)o[f]=s[f]-65535-(o[f-1]>>16&1),o[f-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),n=o[15]>>16&1,o[14]&=65535,ne(s,o,1-n)}for(f=0;f<16;f++)e[2*f]=s[f]&255,e[2*f+1]=s[f]>>8}function Hr(e,r){var f=new Uint8Array(32),t=new Uint8Array(32);return ee(f,e),ee(t,r),ur(f,0,t,0)}function xf(e){var r=new Uint8Array(32);return ee(r,e),r[0]&1}function pr(e,r){var f;for(f=0;f<16;f++)e[f]=r[2*f]+(r[2*f+1]<<8);e[15]&=32767}function Tt(e,r,f){for(var t=0;t<16;t++)e[t]=r[t]+f[t]}function Rt(e,r,f){for(var t=0;t<16;t++)e[t]=r[t]-f[t]}function W(e,r,f){var t,n,o=0,s=0,a=0,c=0,l=0,d=0,S=0,g=0,v=0,B=0,R=0,L=0,I=0,Y=0,K=0,F=0,j=0,T=0,N=0,z=0,U=0,h=0,u=0,E=0,p=0,w=0,m=0,Z=0,V=0,X=0,x=0,i=f[0],b=f[1],y=f[2],P=f[3],O=f[4],D=f[5],$=f[6],G=f[7],q=f[8],k=f[9],tt=f[10],Q=f[11],rt=f[12],nt=f[13],ot=f[14],it=f[15];t=r[0],o+=t*i,s+=t*b,a+=t*y,c+=t*P,l+=t*O,d+=t*D,S+=t*$,g+=t*G,v+=t*q,B+=t*k,R+=t*tt,L+=t*Q,I+=t*rt,Y+=t*nt,K+=t*ot,F+=t*it,t=r[1],s+=t*i,a+=t*b,c+=t*y,l+=t*P,d+=t*O,S+=t*D,g+=t*$,v+=t*G,B+=t*q,R+=t*k,L+=t*tt,I+=t*Q,Y+=t*rt,K+=t*nt,F+=t*ot,j+=t*it,t=r[2],a+=t*i,c+=t*b,l+=t*y,d+=t*P,S+=t*O,g+=t*D,v+=t*$,B+=t*G,R+=t*q,L+=t*k,I+=t*tt,Y+=t*Q,K+=t*rt,F+=t*nt,j+=t*ot,T+=t*it,t=r[3],c+=t*i,l+=t*b,d+=t*y,S+=t*P,g+=t*O,v+=t*D,B+=t*$,R+=t*G,L+=t*q,I+=t*k,Y+=t*tt,K+=t*Q,F+=t*rt,j+=t*nt,T+=t*ot,N+=t*it,t=r[4],l+=t*i,d+=t*b,S+=t*y,g+=t*P,v+=t*O,B+=t*D,R+=t*$,L+=t*G,I+=t*q,Y+=t*k,K+=t*tt,F+=t*Q,j+=t*rt,T+=t*nt,N+=t*ot,z+=t*it,t=r[5],d+=t*i,S+=t*b,g+=t*y,v+=t*P,B+=t*O,R+=t*D,L+=t*$,I+=t*G,Y+=t*q,K+=t*k,F+=t*tt,j+=t*Q,T+=t*rt,N+=t*nt,z+=t*ot,U+=t*it,t=r[6],S+=t*i,g+=t*b,v+=t*y,B+=t*P,R+=t*O,L+=t*D,I+=t*$,Y+=t*G,K+=t*q,F+=t*k,j+=t*tt,T+=t*Q,N+=t*rt,z+=t*nt,U+=t*ot,h+=t*it,t=r[7],g+=t*i,v+=t*b,B+=t*y,R+=t*P,L+=t*O,I+=t*D,Y+=t*$,K+=t*G,F+=t*q,j+=t*k,T+=t*tt,N+=t*Q,z+=t*rt,U+=t*nt,h+=t*ot,u+=t*it,t=r[8],v+=t*i,B+=t*b,R+=t*y,L+=t*P,I+=t*O,Y+=t*D,K+=t*$,F+=t*G,j+=t*q,T+=t*k,N+=t*tt,z+=t*Q,U+=t*rt,h+=t*nt,u+=t*ot,E+=t*it,t=r[9],B+=t*i,R+=t*b,L+=t*y,I+=t*P,Y+=t*O,K+=t*D,F+=t*$,j+=t*G,T+=t*q,N+=t*k,z+=t*tt,U+=t*Q,h+=t*rt,u+=t*nt,E+=t*ot,p+=t*it,t=r[10],R+=t*i,L+=t*b,I+=t*y,Y+=t*P,K+=t*O,F+=t*D,j+=t*$,T+=t*G,N+=t*q,z+=t*k,U+=t*tt,h+=t*Q,u+=t*rt,E+=t*nt,p+=t*ot,w+=t*it,t=r[11],L+=t*i,I+=t*b,Y+=t*y,K+=t*P,F+=t*O,j+=t*D,T+=t*$,N+=t*G,z+=t*q,U+=t*k,h+=t*tt,u+=t*Q,E+=t*rt,p+=t*nt,w+=t*ot,m+=t*it,t=r[12],I+=t*i,Y+=t*b,K+=t*y,F+=t*P,j+=t*O,T+=t*D,N+=t*$,z+=t*G,U+=t*q,h+=t*k,u+=t*tt,E+=t*Q,p+=t*rt,w+=t*nt,m+=t*ot,Z+=t*it,t=r[13],Y+=t*i,K+=t*b,F+=t*y,j+=t*P,T+=t*O,N+=t*D,z+=t*$,U+=t*G,h+=t*q,u+=t*k,E+=t*tt,p+=t*Q,w+=t*rt,m+=t*nt,Z+=t*ot,V+=t*it,t=r[14],K+=t*i,F+=t*b,j+=t*y,T+=t*P,N+=t*O,z+=t*D,U+=t*$,h+=t*G,u+=t*q,E+=t*k,p+=t*tt,w+=t*Q,m+=t*rt,Z+=t*nt,V+=t*ot,X+=t*it,t=r[15],F+=t*i,j+=t*b,T+=t*y,N+=t*P,z+=t*O,U+=t*D,h+=t*$,u+=t*G,E+=t*q,p+=t*k,w+=t*tt,m+=t*Q,Z+=t*rt,V+=t*nt,X+=t*ot,x+=t*it,o+=38*j,s+=38*T,a+=38*N,c+=38*z,l+=38*U,d+=38*h,S+=38*u,g+=38*E,v+=38*p,B+=38*w,R+=38*m,L+=38*Z,I+=38*V,Y+=38*X,K+=38*x,n=1,t=o+n+65535,n=Math.floor(t/65536),o=t-n*65536,t=s+n+65535,n=Math.floor(t/65536),s=t-n*65536,t=a+n+65535,n=Math.floor(t/65536),a=t-n*65536,t=c+n+65535,n=Math.floor(t/65536),c=t-n*65536,t=l+n+65535,n=Math.floor(t/65536),l=t-n*65536,t=d+n+65535,n=Math.floor(t/65536),d=t-n*65536,t=S+n+65535,n=Math.floor(t/65536),S=t-n*65536,t=g+n+65535,n=Math.floor(t/65536),g=t-n*65536,t=v+n+65535,n=Math.floor(t/65536),v=t-n*65536,t=B+n+65535,n=Math.floor(t/65536),B=t-n*65536,t=R+n+65535,n=Math.floor(t/65536),R=t-n*65536,t=L+n+65535,n=Math.floor(t/65536),L=t-n*65536,t=I+n+65535,n=Math.floor(t/65536),I=t-n*65536,t=Y+n+65535,n=Math.floor(t/65536),Y=t-n*65536,t=K+n+65535,n=Math.floor(t/65536),K=t-n*65536,t=F+n+65535,n=Math.floor(t/65536),F=t-n*65536,o+=n-1+37*(n-1),n=1,t=o+n+65535,n=Math.floor(t/65536),o=t-n*65536,t=s+n+65535,n=Math.floor(t/65536),s=t-n*65536,t=a+n+65535,n=Math.floor(t/65536),a=t-n*65536,t=c+n+65535,n=Math.floor(t/65536),c=t-n*65536,t=l+n+65535,n=Math.floor(t/65536),l=t-n*65536,t=d+n+65535,n=Math.floor(t/65536),d=t-n*65536,t=S+n+65535,n=Math.floor(t/65536),S=t-n*65536,t=g+n+65535,n=Math.floor(t/65536),g=t-n*65536,t=v+n+65535,n=Math.floor(t/65536),v=t-n*65536,t=B+n+65535,n=Math.floor(t/65536),B=t-n*65536,t=R+n+65535,n=Math.floor(t/65536),R=t-n*65536,t=L+n+65535,n=Math.floor(t/65536),L=t-n*65536,t=I+n+65535,n=Math.floor(t/65536),I=t-n*65536,t=Y+n+65535,n=Math.floor(t/65536),Y=t-n*65536,t=K+n+65535,n=Math.floor(t/65536),K=t-n*65536,t=F+n+65535,n=Math.floor(t/65536),F=t-n*65536,o+=n-1+37*(n-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=l,e[5]=d,e[6]=S,e[7]=g,e[8]=v,e[9]=B,e[10]=R,e[11]=L,e[12]=I,e[13]=Y,e[14]=K,e[15]=F}function Ut(e,r){W(e,r,r)}function wr(e,r){var f=C(),t;for(t=0;t<16;t++)f[t]=r[t];for(t=253;t>=0;t--)Ut(f,f),t!==2&&t!==4&&W(f,f,r);for(t=0;t<16;t++)e[t]=f[t]}function hf(e,r){var f=C(),t;for(t=0;t<16;t++)f[t]=r[t];for(t=250;t>=0;t--)Ut(f,f),t!==1&&W(f,f,r);for(t=0;t<16;t++)e[t]=f[t]}function Me(e,r,f){var t=new Uint8Array(32),n=new Float64Array(80),o,s,a=C(),c=C(),l=C(),d=C(),S=C(),g=C();for(s=0;s<31;s++)t[s]=r[s];for(t[31]=r[31]&127|64,t[0]&=248,pr(n,f),s=0;s<16;s++)c[s]=n[s],d[s]=a[s]=l[s]=0;for(a[0]=d[0]=1,s=254;s>=0;--s)o=t[s>>>3]>>>(s&7)&1,ne(a,c,o),ne(l,d,o),Tt(S,a,l),Rt(a,a,l),Tt(l,c,d),Rt(c,c,d),Ut(d,S),Ut(g,a),W(a,l,a),W(l,c,S),Tt(S,a,l),Rt(a,a,l),Ut(c,a),Rt(l,d,g),W(a,l,Lf),Tt(a,a,d),W(l,l,a),W(a,d,g),W(d,c,n),Ut(c,S),ne(a,c,o),ne(l,d,o);for(s=0;s<16;s++)n[s+16]=a[s],n[s+32]=l[s],n[s+48]=c[s],n[s+64]=d[s];var v=n.subarray(32),B=n.subarray(16);return wr(v,v),W(B,B,v),ee(e,B),0}function Ce(e,r){return Me(e,r,rf)}function uf(e,r){return Ne(r,32),Ce(e,r)}function Ye(e,r,f){var t=new Uint8Array(32);return Me(t,f,r),Le(e,Nf,t,te)}var lf=yr,Hf=br;function Kf(e,r,f,t,n,o){var s=new Uint8Array(32);return Ye(s,n,o),lf(e,r,f,t,s)}function Zf(e,r,f,t,n,o){var s=new Uint8Array(32);return Ye(s,n,o),Hf(e,r,f,t,s)}var Kr=[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 Zr(e,r,f,t){for(var n=new Int32Array(16),o=new Int32Array(16),s,a,c,l,d,S,g,v,B,R,L,I,Y,K,F,j,T,N,z,U,h,u,E,p,w,m,Z=e[0],V=e[1],X=e[2],x=e[3],i=e[4],b=e[5],y=e[6],P=e[7],O=r[0],D=r[1],$=r[2],G=r[3],q=r[4],k=r[5],tt=r[6],Q=r[7],rt=0;t>=128;){for(z=0;z<16;z++)U=8*z+rt,n[z]=f[U+0]<<24|f[U+1]<<16|f[U+2]<<8|f[U+3],o[z]=f[U+4]<<24|f[U+5]<<16|f[U+6]<<8|f[U+7];for(z=0;z<80;z++)if(s=Z,a=V,c=X,l=x,d=i,S=b,g=y,v=P,B=O,R=D,L=$,I=G,Y=q,K=k,F=tt,j=Q,h=P,u=Q,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=(i>>>14|q<<32-14)^(i>>>18|q<<32-18)^(q>>>41-32|i<<32-(41-32)),u=(q>>>14|i<<32-14)^(q>>>18|i<<32-18)^(i>>>41-32|q<<32-(41-32)),E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,h=i&b^~i&y,u=q&k^~q&tt,E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,h=Kr[z*2],u=Kr[z*2+1],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,h=n[z%16],u=o[z%16],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,T=w&65535|m<<16,N=E&65535|p<<16,h=T,u=N,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=(Z>>>28|O<<32-28)^(O>>>34-32|Z<<32-(34-32))^(O>>>39-32|Z<<32-(39-32)),u=(O>>>28|Z<<32-28)^(Z>>>34-32|O<<32-(34-32))^(Z>>>39-32|O<<32-(39-32)),E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,h=Z&V^Z&X^V&X,u=O&D^O&$^D&$,E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,v=w&65535|m<<16,j=E&65535|p<<16,h=l,u=I,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=T,u=N,E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,l=w&65535|m<<16,I=E&65535|p<<16,V=s,X=a,x=c,i=l,b=d,y=S,P=g,Z=v,D=B,$=R,G=L,q=I,k=Y,tt=K,Q=F,O=j,z%16===15)for(U=0;U<16;U++)h=n[U],u=o[U],E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=n[(U+9)%16],u=o[(U+9)%16],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,T=n[(U+1)%16],N=o[(U+1)%16],h=(T>>>1|N<<32-1)^(T>>>8|N<<32-8)^T>>>7,u=(N>>>1|T<<32-1)^(N>>>8|T<<32-8)^(N>>>7|T<<32-7),E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,T=n[(U+14)%16],N=o[(U+14)%16],h=(T>>>19|N<<32-19)^(N>>>61-32|T<<32-(61-32))^T>>>6,u=(N>>>19|T<<32-19)^(T>>>61-32|N<<32-(61-32))^(N>>>6|T<<32-6),E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,n[U]=w&65535|m<<16,o[U]=E&65535|p<<16;h=Z,u=O,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=e[0],u=r[0],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,e[0]=Z=w&65535|m<<16,r[0]=O=E&65535|p<<16,h=V,u=D,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=e[1],u=r[1],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,e[1]=V=w&65535|m<<16,r[1]=D=E&65535|p<<16,h=X,u=$,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=e[2],u=r[2],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,e[2]=X=w&65535|m<<16,r[2]=$=E&65535|p<<16,h=x,u=G,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=e[3],u=r[3],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,e[3]=x=w&65535|m<<16,r[3]=G=E&65535|p<<16,h=i,u=q,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=e[4],u=r[4],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,e[4]=i=w&65535|m<<16,r[4]=q=E&65535|p<<16,h=b,u=k,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=e[5],u=r[5],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,e[5]=b=w&65535|m<<16,r[5]=k=E&65535|p<<16,h=y,u=tt,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=e[6],u=r[6],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,e[6]=y=w&65535|m<<16,r[6]=tt=E&65535|p<<16,h=P,u=Q,E=u&65535,p=u>>>16,w=h&65535,m=h>>>16,h=e[7],u=r[7],E+=u&65535,p+=u>>>16,w+=h&65535,m+=h>>>16,p+=E>>>16,w+=p>>>16,m+=w>>>16,e[7]=P=w&65535|m<<16,r[7]=Q=E&65535|p<<16,rt+=128,t-=128}return t}function Qt(e,r,f){var t=new Int32Array(8),n=new Int32Array(8),o=new Uint8Array(256),s,a=f;for(t[0]=1779033703,t[1]=3144134277,t[2]=1013904242,t[3]=2773480762,t[4]=1359893119,t[5]=2600822924,t[6]=528734635,t[7]=1541459225,n[0]=4089235720,n[1]=2227873595,n[2]=4271175723,n[3]=1595750129,n[4]=2917565137,n[5]=725511199,n[6]=4215389547,n[7]=327033209,Zr(t,n,r,f),f%=128,s=0;s<f;s++)o[s]=r[a-f+s];for(o[f]=128,f=256-128*(f<112?1:0),o[f-9]=0,Yr(o,f-8,a/536870912|0,a<<3),Zr(t,n,o,f),s=0;s<8;s++)Yr(e,8*s,t[s],n[s]);return 0}function Re(e,r){var f=C(),t=C(),n=C(),o=C(),s=C(),a=C(),c=C(),l=C(),d=C();Rt(f,e[1],e[0]),Rt(d,r[1],r[0]),W(f,f,d),Tt(t,e[0],e[1]),Tt(d,r[0],r[1]),W(t,t,d),W(n,e[3],r[3]),W(n,n,jf),W(o,e[2],r[2]),Tt(o,o,o),Rt(s,t,f),Rt(a,o,n),Tt(c,o,n),Tt(l,t,f),W(e[0],s,a),W(e[1],l,c),W(e[2],c,a),W(e[3],s,l)}function $r(e,r,f){var t;for(t=0;t<4;t++)ne(e[t],r[t],f)}function gr(e,r){var f=C(),t=C(),n=C();wr(n,r[2]),W(f,r[0],n),W(t,r[1],n),ee(e,t),e[31]^=xf(f)<<7}function vr(e,r,f){var t,n;for(Ct(e[0],er),Ct(e[1],ie),Ct(e[2],ie),Ct(e[3],er),n=255;n>=0;--n)t=f[n/8|0]>>(n&7)&1,$r(e,r,t),Re(r,e),Re(e,e),$r(e,r,t)}function He(e,r){var f=[C(),C(),C(),C()];Ct(f[0],Mr),Ct(f[1],Cr),Ct(f[2],ie),W(f[3],Mr,Cr),vr(e,f,r)}function Er(e,r,f){var t=new Uint8Array(64),n=[C(),C(),C(),C()],o;for(f||Ne(r,32),Qt(t,r,32),t[0]&=248,t[31]&=127,t[31]|=64,He(n,t),gr(e,n),o=0;o<32;o++)r[o+32]=e[o];return 0}var Be=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 Ar(e,r){var f,t,n,o;for(t=63;t>=32;--t){for(f=0,n=t-32,o=t-12;n<o;++n)r[n]+=f-16*r[t]*Be[n-(t-32)],f=Math.floor((r[n]+128)/256),r[n]-=f*256;r[n]+=f,r[t]=0}for(f=0,n=0;n<32;n++)r[n]+=f-(r[31]>>4)*Be[n],f=r[n]>>8,r[n]&=255;for(n=0;n<32;n++)r[n]-=f*Be[n];for(t=0;t<32;t++)r[t+1]+=r[t]>>8,e[t]=r[t]&255}function rr(e){var r=new Float64Array(64),f;for(f=0;f<64;f++)r[f]=e[f];for(f=0;f<64;f++)e[f]=0;Ar(e,r)}function df(e,r,f,t){var n=new Uint8Array(64),o=new Uint8Array(64),s=new Uint8Array(64),a,c,l=new Float64Array(64),d=[C(),C(),C(),C()];Qt(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64;var S=f+64;for(a=0;a<f;a++)e[64+a]=r[a];for(a=0;a<32;a++)e[32+a]=n[32+a];for(Qt(s,e.subarray(32),f+32),rr(s),He(d,s),gr(e,d),a=32;a<64;a++)e[a]=t[a];for(Qt(o,e,f+64),rr(o),a=0;a<64;a++)l[a]=0;for(a=0;a<32;a++)l[a]=s[a];for(a=0;a<32;a++)for(c=0;c<32;c++)l[a+c]+=o[a]*n[c];return Ar(e.subarray(32),l),S}function yf(e,r){var f=C(),t=C(),n=C(),o=C(),s=C(),a=C(),c=C();return Ct(e[2],ie),pr(e[1],r),Ut(n,e[1]),W(o,n,ff),Rt(n,n,e[2]),Tt(o,e[2],o),Ut(s,o),Ut(a,s),W(c,a,s),W(f,c,n),W(f,f,o),hf(f,f),W(f,f,n),W(f,f,o),W(f,f,o),W(e[0],f,o),Ut(t,e[0]),W(t,t,o),Hr(t,n)&&W(e[0],e[0],Mf),Ut(t,e[0]),W(t,t,o),Hr(t,n)?-1:(xf(e[0])===r[31]>>7&&Rt(e[0],er,e[0]),W(e[3],e[0],e[1]),0)}function _r(e,r,f,t){var n,o=new Uint8Array(32),s=new Uint8Array(64),a=[C(),C(),C(),C()],c=[C(),C(),C(),C()];if(f<64||yf(c,t))return-1;for(n=0;n<f;n++)e[n]=r[n];for(n=0;n<32;n++)e[n+32]=t[n];if(Qt(s,e,f),rr(s),vr(a,c,s),He(c,r.subarray(32)),Re(a,c),gr(o,a),f-=64,ur(r,0,o,0)){for(n=0;n<f;n++)e[n]=0;return-1}for(n=0;n<f;n++)e[n]=r[n+64];return f}var mr=32,Ke=24,ye=32,se=16,be=32,Ze=32,we=32,ge=32,Sr=32,bf=Ke,$f=ye,Df=se,Mt=64,re=32,ce=64,Br=32,Fr=64;H.lowlevel={crypto_core_hsalsa20:Le,crypto_stream_xor:lr,crypto_stream:af,crypto_stream_salsa20_xor:of,crypto_stream_salsa20:sf,crypto_onetimeauth:dr,crypto_onetimeauth_verify:cf,crypto_verify_16:nf,crypto_verify_32:ur,crypto_secretbox:yr,crypto_secretbox_open:br,crypto_scalarmult:Me,crypto_scalarmult_base:Ce,crypto_box_beforenm:Ye,crypto_box_afternm:lf,crypto_box:Kf,crypto_box_open:Zf,crypto_box_keypair:uf,crypto_hash:Qt,crypto_sign:df,crypto_sign_keypair:Er,crypto_sign_open:_r,crypto_secretbox_KEYBYTES:mr,crypto_secretbox_NONCEBYTES:Ke,crypto_secretbox_ZEROBYTES:ye,crypto_secretbox_BOXZEROBYTES:se,crypto_scalarmult_BYTES:be,crypto_scalarmult_SCALARBYTES:Ze,crypto_box_PUBLICKEYBYTES:we,crypto_box_SECRETKEYBYTES:ge,crypto_box_BEFORENMBYTES:Sr,crypto_box_NONCEBYTES:bf,crypto_box_ZEROBYTES:$f,crypto_box_BOXZEROBYTES:Df,crypto_sign_BYTES:Mt,crypto_sign_PUBLICKEYBYTES:re,crypto_sign_SECRETKEYBYTES:ce,crypto_sign_SEEDBYTES:Br,crypto_hash_BYTES:Fr,gf:C,D:ff,L:Be,pack25519:ee,unpack25519:pr,M:W,A:Tt,S:Ut,Z:Rt,pow2523:hf,add:Re,set25519:Ct,modL:Ar,scalarmult:vr,scalarbase:He};function pf(e,r){if(e.length!==mr)throw new Error("bad key size");if(r.length!==Ke)throw new Error("bad nonce size")}function qf(e,r){if(e.length!==we)throw new Error("bad public key size");if(r.length!==ge)throw new Error("bad secret key size")}function _t(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Dr(e){for(var r=0;r<e.length;r++)e[r]=0}H.randomBytes=function(e){var r=new Uint8Array(e);return Ne(r,e),r};H.secretbox=function(e,r,f){_t(e,r,f),pf(f,r);for(var t=new Uint8Array(ye+e.length),n=new Uint8Array(t.length),o=0;o<e.length;o++)t[o+ye]=e[o];return yr(n,t,t.length,r,f),n.subarray(se)};H.secretbox.open=function(e,r,f){_t(e,r,f),pf(f,r);for(var t=new Uint8Array(se+e.length),n=new Uint8Array(t.length),o=0;o<e.length;o++)t[o+se]=e[o];return t.length<32||br(n,t,t.length,r,f)!==0?null:n.subarray(ye)};H.secretbox.keyLength=mr;H.secretbox.nonceLength=Ke;H.secretbox.overheadLength=se;H.scalarMult=function(e,r){if(_t(e,r),e.length!==Ze)throw new Error("bad n size");if(r.length!==be)throw new Error("bad p size");var f=new Uint8Array(be);return Me(f,e,r),f};H.scalarMult.base=function(e){if(_t(e),e.length!==Ze)throw new Error("bad n size");var r=new Uint8Array(be);return Ce(r,e),r};H.scalarMult.scalarLength=Ze;H.scalarMult.groupElementLength=be;H.box=function(e,r,f,t){var n=H.box.before(f,t);return H.secretbox(e,r,n)};H.box.before=function(e,r){_t(e,r),qf(e,r);var f=new Uint8Array(Sr);return Ye(f,e,r),f};H.box.after=H.secretbox;H.box.open=function(e,r,f,t){var n=H.box.before(f,t);return H.secretbox.open(e,r,n)};H.box.open.after=H.secretbox.open;H.box.keyPair=function(){var e=new Uint8Array(we),r=new Uint8Array(ge);return uf(e,r),{publicKey:e,secretKey:r}};H.box.keyPair.fromSecretKey=function(e){if(_t(e),e.length!==ge)throw new Error("bad secret key size");var r=new Uint8Array(we);return Ce(r,e),{publicKey:r,secretKey:new Uint8Array(e)}};H.box.publicKeyLength=we;H.box.secretKeyLength=ge;H.box.sharedKeyLength=Sr;H.box.nonceLength=bf;H.box.overheadLength=H.secretbox.overheadLength;H.sign=function(e,r){if(_t(e,r),r.length!==ce)throw new Error("bad secret key size");var f=new Uint8Array(Mt+e.length);return df(f,e,e.length,r),f};H.sign.open=function(e,r){if(_t(e,r),r.length!==re)throw new Error("bad public key size");var f=new Uint8Array(e.length),t=_r(f,e,e.length,r);if(t<0)return null;for(var n=new Uint8Array(t),o=0;o<n.length;o++)n[o]=f[o];return n};H.sign.detached=function(e,r){for(var f=H.sign(e,r),t=new Uint8Array(Mt),n=0;n<t.length;n++)t[n]=f[n];return t};H.sign.detached.verify=function(e,r,f){if(_t(e,r,f),r.length!==Mt)throw new Error("bad signature size");if(f.length!==re)throw new Error("bad public key size");var t=new Uint8Array(Mt+e.length),n=new Uint8Array(Mt+e.length),o;for(o=0;o<Mt;o++)t[o]=r[o];for(o=0;o<e.length;o++)t[o+Mt]=e[o];return _r(n,t,t.length,f)>=0};H.sign.keyPair=function(){var e=new Uint8Array(re),r=new Uint8Array(ce);return Er(e,r),{publicKey:e,secretKey:r}};H.sign.keyPair.fromSecretKey=function(e){if(_t(e),e.length!==ce)throw new Error("bad secret key size");for(var r=new Uint8Array(re),f=0;f<r.length;f++)r[f]=e[32+f];return{publicKey:r,secretKey:new Uint8Array(e)}};H.sign.keyPair.fromSeed=function(e){if(_t(e),e.length!==Br)throw new Error("bad seed size");for(var r=new Uint8Array(re),f=new Uint8Array(ce),t=0;t<32;t++)f[t]=e[t];return Er(r,f,!0),{publicKey:r,secretKey:f}};H.sign.publicKeyLength=re;H.sign.secretKeyLength=ce;H.sign.seedLength=Br;H.sign.signatureLength=Mt;H.hash=function(e){_t(e);var r=new Uint8Array(Fr);return Qt(r,e,e.length),r};H.hash.hashLength=Fr;H.verify=function(e,r){return _t(e,r),e.length===0||r.length===0||e.length!==r.length?!1:hr(e,0,r,0,e.length)===0};H.setPRNG=function(e){Ne=e};(function(){var e=typeof self<"u"?self.crypto||self.msCrypto:null;if(e&&e.getRandomValues){var r=65536;H.setPRNG(function(f,t){var n,o=new Uint8Array(t);for(n=0;n<t;n+=r)e.getRandomValues(o.subarray(n,n+Math.min(t-n,r)));for(n=0;n<t;n++)f[n]=o[n];Dr(o)})}else typeof require<"u"&&(e=require("crypto"),e&&e.randomBytes&&H.setPRNG(function(f,t){var n,o=e.randomBytes(t);for(n=0;n<t;n++)f[n]=o[n];Dr(o)}))})();function wf(e){var r=new Uint8Array(32),f=[C(),C(),C(),C()],t=C(),n=C();if(yf(f,e))return null;var o=f[1];return Tt(t,ie,o),Rt(n,ie,o),wr(n,n),W(t,t,n),ee(r,t),r}function gf(e){var r=new Uint8Array(64),f=new Uint8Array(32),t;for(H.lowlevel.crypto_hash(r,e,32),r[0]&=248,r[31]&=127,r[31]|=64,t=0;t<32;t++)f[t]=r[t];for(t=0;t<64;t++)r[t]=0;return f}const Vf="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",vf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pt=Ur(Vf),Xf=Ur("0123456789abcdef"),qr=Ur(vf),Tr={encode:e=>{const r=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e),f=Math.ceil(r.length/3)*3,t=new Uint8Array(f);t.set(r);const n=qr.encode(t).split(""),o=f*4/3;for(;n.length<o;)n.unshift(vf[0]);for(let s=0;s<f-r.length;s++)n[n.length-1-s]="=";return n.join("")},decode:e=>{const r=qr.decode(e.replace(/=/g,"A")),f=Math.ceil(3*e.length/4),t=(e.match(/=/g)||[]).length,n=r.length-f;return r.slice(n,r.length-t)}};function Ur(e){const r={ALPHABET_MAP:{},BASE:e.length,LEADER:e.charAt(0),ALPHABET:e};for(let f=0;f<r.ALPHABET.length;f++){const t=r.ALPHABET.charAt(f);if(r.ALPHABET_MAP[t]!==void 0)throw new TypeError(t+" is ambiguous");r.ALPHABET_MAP[t]=f}return{encode:f=>Gf(f,r),decode:f=>kf(f,r)}}function Gf(e,r){if(e.length===0)return"";const f=[0];for(let n of e){for(let o=0;o<f.length;++o)n+=f[o]<<8,f[o]=n%r.BASE,n=n/r.BASE|0;for(;n>0;)f.push(n%r.BASE),n=n/r.BASE|0}let t="";for(let n=0;e[n]===0&&n<e.length-1;++n)t+=r.LEADER;for(let n=f.length-1;n>=0;--n)t+=r.ALPHABET[f[n]];return t}function Wf(e,r){if(typeof e!="string")throw new TypeError("Expected String");if(e.length===0)return new Uint8Array(0);co