UNPKG

g1lib

Version:

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

1 lines 91.3 kB
const fr="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",i0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt=ue(fr),o0=ue("0123456789abcdef"),Kf=ue(i0),we={encode:t=>{const f=typeof t=="string"?new TextEncoder().encode(t):new Uint8Array(t),r=Math.ceil(f.length/3)*3,e=new Uint8Array(r);e.set(f);const n=Kf.encode(e).split(""),i=r*4/3;for(;n.length<i;)n.unshift(i0[0]);for(let a=0;a<r-f.length;a++)n[n.length-1-a]="=";return n.join("")},decode:t=>{const f=Kf.decode(t.replace(/=/g,"A")),r=Math.ceil(3*t.length/4),e=(t.match(/=/g)||[]).length,n=f.length-r;return f.slice(n,f.length-e)}};function ue(t){const f={ALPHABET_MAP:{},BASE:t.length,LEADER:t.charAt(0),ALPHABET:t};for(let r=0;r<f.ALPHABET.length;r++){const e=f.ALPHABET.charAt(r);if(f.ALPHABET_MAP[e]!==void 0)throw new TypeError(e+" is ambiguous");f.ALPHABET_MAP[e]=r}return{encode:r=>rr(r,f),decode:r=>ir(r,f)}}function rr(t,f){if(t.length===0)return"";const r=[0];for(let n of t){for(let i=0;i<r.length;++i)n+=r[i]<<8,r[i]=n%f.BASE,n=n/f.BASE|0;for(;n>0;)r.push(n%f.BASE),n=n/f.BASE|0}let e="";for(let n=0;t[n]===0&&n<t.length-1;++n)e+=f.LEADER;for(let n=r.length-1;n>=0;--n)e+=f.ALPHABET[r[n]];return e}function nr(t,f){if(typeof t!="string")throw new TypeError("Expected String");if(t.length===0)return new Uint8Array(0);const r=[0];for(const e of t){const n=f.ALPHABET_MAP[e];if(n===void 0)return;let i=n;for(let a=0;a<r.length;++a)i+=r[a]*f.BASE,r[a]=i&255,i>>=8;for(;i>0;)r.push(i&255),i>>=8}for(let e=0;t[e]===f.LEADER&&e<t.length-1;++e)r.push(0);return new Uint8Array(r.reverse())}function ir(t,f){const r=nr(t,f);if(r)return r;throw new Error("Non-base"+f.BASE+" character")}var Rn=Object.freeze({__proto__:null,b58:dt,b16:o0,default:ue,b64:we,basex:ue});var or=function(){for(var t=0,f=0,r=arguments.length;f<r;f++)t+=arguments[f].length;for(var e=Array(t),n=0,f=0;f<r;f++)for(var i=arguments[f],a=0,s=i.length;a<s;a++,n++)e[n]=i[a];return e};function ar(t,f,r){var e=r===void 0?{}:r,n=e.N,i=n===void 0?16384:n,a=e.logN,s=e.r,c=s===void 0?8:s,p=e.p,l=p===void 0?1:p,S=e.dkLen,w=S===void 0?32:S,v=e.interruptStep,F=v===void 0?0:v,B=e.encoding;return new Promise(function(N,P){if(!a&&!i)return P(new Error("scrypt: missing N or logN parameter"));if(a||a===0){if(a<1||a>31)return P(new Error("scrypt: logN must be between 1 and 31"));i=1<<a>>>0}else{if(i<2||i>Se)return P(new Error("scrypt: N is out of range"));if(i&i-1)return P(Error("scrypt: N is not a power of 2"))}if(l<1)return P(new Error("scrypt: invalid p"));if(c<1)return P(new Error("scrypt: invalid r"));sr({password:t,salt:f,N:i,r:c,p:l,dkLen:w,interruptStep:F,encoding:B},N)})}function sr(t,f){var r=t.password,e=t.salt,n=t.N,i=t.r,a=t.p,s=t.dkLen,c=t.interruptStep,p=t.encoding;function l(x){var o=[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],y=1779033703,d=3144134277,m=1013904242,z=2773480762,H=1359893119,Z=2600822924,V=528734635,G=1541459225,X=new Array(64);function tt(Dt){for(var xe=0,_=Dt.length;_>=64;){var pt=y,bt=d,gt=m,Tt=z,ct=H,Et=Z,_t=V,Bt=G,st=void 0,rt=void 0,wt=void 0,vt=void 0,Ut=void 0;for(rt=0;rt<16;rt++)wt=xe+rt*4,X[rt]=(Dt[wt]&255)<<24|(Dt[wt+1]&255)<<16|(Dt[wt+2]&255)<<8|Dt[wt+3]&255;for(rt=16;rt<64;rt++)st=X[rt-2],vt=(st>>>17|st<<32-17)^(st>>>19|st<<32-19)^st>>>10,st=X[rt-15],Ut=(st>>>7|st<<32-7)^(st>>>18|st<<32-18)^st>>>3,X[rt]=(vt+X[rt-7]|0)+(Ut+X[rt-16]|0)|0;for(rt=0;rt<64;rt++)vt=(((ct>>>6|ct<<32-6)^(ct>>>11|ct<<32-11)^(ct>>>25|ct<<32-25))+(ct&Et^~ct&_t)|0)+(Bt+(o[rt]+X[rt]|0)|0)|0,Ut=((pt>>>2|pt<<32-2)^(pt>>>13|pt<<32-13)^(pt>>>22|pt<<32-22))+(pt&bt^pt&gt^bt&gt)|0,Bt=_t,_t=Et,Et=ct,ct=Tt+vt|0,Tt=gt,gt=bt,bt=pt,pt=vt+Ut|0;y=y+pt|0,d=d+bt|0,m=m+gt|0,z=z+Tt|0,H=H+ct|0,Z=Z+Et|0,V=V+_t|0,G=G+Bt|0,xe+=64,_-=64}}tt(x);var Q,ft=x.length%64,nt=x.length/536870912|0,it=x.length<<3,ot=ft<56?56:120,yt=x.slice(x.length-ft,x.length);for(yt.push(128),Q=ft+1;Q<ot;Q++)yt.push(0);return yt.push(nt>>>24&255),yt.push(nt>>>16&255),yt.push(nt>>>8&255),yt.push(nt>>>0&255),yt.push(it>>>24&255),yt.push(it>>>16&255),yt.push(it>>>8&255),yt.push(it>>>0&255),tt(yt),[y>>>24&255,y>>>16&255,y>>>8&255,y>>>0&255,d>>>24&255,d>>>16&255,d>>>8&255,d>>>0&255,m>>>24&255,m>>>16&255,m>>>8&255,m>>>0&255,z>>>24&255,z>>>16&255,z>>>8&255,z>>>0&255,H>>>24&255,H>>>16&255,H>>>8&255,H>>>0&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z>>>0&255,V>>>24&255,V>>>16&255,V>>>8&255,V>>>0&255,G>>>24&255,G>>>16&255,G>>>8&255,G>>>0&255]}function S(x,o,y){x.length>64&&(x=l(x.push?x:or(x)));var d,m=64+o.length+4,z=new Array(m),H=new Array(64),Z=[];for(d=0;d<64;d++)z[d]=54;for(d=0;d<x.length;d++)z[d]^=x[d];for(d=0;d<o.length;d++)z[64+d]=o[d];for(d=m-4;d<m;d++)z[d]=0;for(d=0;d<64;d++)H[d]=92;for(d=0;d<x.length;d++)H[d]^=x[d];function V(){for(var G=m-1;G>=m-4;G--){if(z[G]++,z[G]<=255)return;z[G]=0}}for(;y>=32;)V(),Z=Z.concat(l(H.concat(l(z)))),y-=32;return y>0&&(V(),Z=Z.concat(l(H.concat(l(z))).slice(0,y))),Z}function w(x,o,y,d){var m=x[0]^o[y++],z=x[1]^o[y++],H=x[2]^o[y++],Z=x[3]^o[y++],V=x[4]^o[y++],G=x[5]^o[y++],X=x[6]^o[y++],tt=x[7]^o[y++],Q=x[8]^o[y++],ft=x[9]^o[y++],nt=x[10]^o[y++],it=x[11]^o[y++],ot=x[12]^o[y++],yt=x[13]^o[y++],Dt=x[14]^o[y++],xe=x[15]^o[y++],_,pt,bt=m,gt=z,Tt=H,ct=Z,Et=V,_t=G,Bt=X,st=tt,rt=Q,wt=ft,vt=nt,Ut=it,Zt=ot,Ht=yt,Gt=Dt,kt=xe;for(pt=0;pt<8;pt+=2)_=bt+Zt,Et^=_<<7|_>>>32-7,_=Et+bt,rt^=_<<9|_>>>32-9,_=rt+Et,Zt^=_<<13|_>>>32-13,_=Zt+rt,bt^=_<<18|_>>>32-18,_=_t+gt,wt^=_<<7|_>>>32-7,_=wt+_t,Ht^=_<<9|_>>>32-9,_=Ht+wt,gt^=_<<13|_>>>32-13,_=gt+Ht,_t^=_<<18|_>>>32-18,_=vt+Bt,Gt^=_<<7|_>>>32-7,_=Gt+vt,Tt^=_<<9|_>>>32-9,_=Tt+Gt,Bt^=_<<13|_>>>32-13,_=Bt+Tt,vt^=_<<18|_>>>32-18,_=kt+Ut,ct^=_<<7|_>>>32-7,_=ct+kt,st^=_<<9|_>>>32-9,_=st+ct,Ut^=_<<13|_>>>32-13,_=Ut+st,kt^=_<<18|_>>>32-18,_=bt+ct,gt^=_<<7|_>>>32-7,_=gt+bt,Tt^=_<<9|_>>>32-9,_=Tt+gt,ct^=_<<13|_>>>32-13,_=ct+Tt,bt^=_<<18|_>>>32-18,_=_t+Et,Bt^=_<<7|_>>>32-7,_=Bt+_t,st^=_<<9|_>>>32-9,_=st+Bt,Et^=_<<13|_>>>32-13,_=Et+st,_t^=_<<18|_>>>32-18,_=vt+wt,Ut^=_<<7|_>>>32-7,_=Ut+vt,rt^=_<<9|_>>>32-9,_=rt+Ut,wt^=_<<13|_>>>32-13,_=wt+rt,vt^=_<<18|_>>>32-18,_=kt+Gt,Zt^=_<<7|_>>>32-7,_=Zt+kt,Ht^=_<<9|_>>>32-9,_=Ht+Zt,Gt^=_<<13|_>>>32-13,_=Gt+Ht,kt^=_<<18|_>>>32-18;o[d++]=x[0]=bt+m|0,o[d++]=x[1]=gt+z|0,o[d++]=x[2]=Tt+H|0,o[d++]=x[3]=ct+Z|0,o[d++]=x[4]=Et+V|0,o[d++]=x[5]=_t+G|0,o[d++]=x[6]=Bt+X|0,o[d++]=x[7]=st+tt|0,o[d++]=x[8]=rt+Q|0,o[d++]=x[9]=wt+ft|0,o[d++]=x[10]=vt+nt|0,o[d++]=x[11]=Ut+it|0,o[d++]=x[12]=Zt+ot|0,o[d++]=x[13]=Ht+yt|0,o[d++]=x[14]=Gt+Dt|0,o[d++]=x[15]=kt+xe|0}function v(x,o,y,d,m){for(;m--;)x[o++]=y[d++]}function F(x,o,y,d,m){for(;m--;)x[o++]^=y[d++]}function B(x,o,y,d,m){v(x,0,o,y+(2*m-1)*16,16);for(var z=0;z<2*m;z+=2)w(x,o,y+z*16,d+z*8),w(x,o,y+z*16+16,d+z*8+m*16)}function N(x,o,y){return x[o+(2*y-1)*16]}function P(x){for(var o=[],y=0;y<x.length;y++){var d=x.charCodeAt(y);if(d<128)o.push(d);else if(d<2048)o.push(192|d>>6),o.push(128|d&63);else if(d<55296)o.push(224|d>>12),o.push(128|d>>6&63),o.push(128|d&63);else{if(y>=x.length-1)throw new Error("invalid string");y++,d=(d&1023)<<10,d|=x.charCodeAt(y)&1023,d+=65536,o.push(240|d>>18),o.push(128|d>>12&63),o.push(128|d>>6&63),o.push(128|d&63)}}return o}function D(x){for(var o="0123456789abcdef".split(""),y=x.length,d=[],m=0;m<y;m++)d.push(o[x[m]>>>4&15]),d.push(o[x[m]>>>0&15]);return d.join("")}function K(x){for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),y=x.length,d=[],m=0,z,H,Z,V;m<y;)z=m<y?x[m++]:0,H=m<y?x[m++]:0,Z=m<y?x[m++]:0,V=(z<<16)+(H<<8)+Z,d.push(o[V>>>3*6&63]),d.push(o[V>>>2*6&63]),d.push(o[V>>>1*6&63]),d.push(o[V>>>0*6&63]);return y%3>0&&(d[d.length-1]="=",y%3===1&&(d[d.length-2]="=")),d.join("")}var C,L,O,I;if(i*a>=1<<30||i>Se/128/a||i>Se/256||n>Se/128/i)throw new Error("scrypt: parameters are too large");typeof r=="string"&&(r=P(r)),typeof e=="string"&&(e=P(e)),typeof Int32Array<"u"?(C=new Int32Array(64*i),L=new Int32Array(32*n*i),I=new Int32Array(16)):(C=[],L=[],I=new Array(16)),O=S(r,e,a*128*i);var R=0,T=32*i;function h(x){for(var o=0;o<32*i;o++){var y=x+o*4;C[R+o]=(O[y+3]&255)<<24|(O[y+2]&255)<<16|(O[y+1]&255)<<8|(O[y+0]&255)<<0}}function u(x,o){for(var y=x;y<o;y+=2)v(L,y*(32*i),C,R,32*i),B(I,C,R,T,i),v(L,(y+1)*(32*i),C,T,32*i),B(I,C,T,R,i)}function A(x,o){for(var y=x;y<o;y+=2){var d=N(C,R,i)&n-1;F(C,R,L,d*(32*i),32*i),B(I,C,R,T,i),d=N(C,T,i)&n-1,F(C,T,L,d*(32*i),32*i),B(I,C,T,R,i)}}function b(x){for(var o=0;o<32*i;o++){var y=C[R+o];O[x+o*4+0]=y>>>0&255,O[x+o*4+1]=y>>>8&255,O[x+o*4+2]=y>>>16&255,O[x+o*4+3]=y>>>24&255}}var g=typeof setImmediate<"u"?setImmediate:setTimeout;function U(x,o,y,d,m){(function z(){g(function(){d(x,x+y<o?x+y:o),x+=y,x<o?z():m()})})()}function $(x){var o=S(r,O,s);return x==="base64"?K(o):x==="hex"?D(o):x==="binary"?new Uint8Array(o):o}function k(){for(var x=0;x<a;x++)h(x*128*i),u(0,n),A(0,n),b(x*128*i);f($(p))}function q(x){h(x*128*i),U(0,n,c*2,u,function(){U(0,n,c*2,A,function(){b(x*128*i),x+1<a?g(function(){q(x+1)}):f($(p))})})}c<=0?k():q(0)}var Se=-1>>>0;var Oe="input is invalid type";typeof process=="object"&&process.versions&&process.versions.node;var j="0123456789abcdef".split(""),cr=[-2147483648,8388608,32768,128],mt=[24,16,8,0],Ee=[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=[],$f=function(t,f){return function(r){return new ht(f,!0).update(r)[t]()}};function Ne(t){var f=$f("hex",t);f.create=function(){return new ht(t)},f.update=function(n){return f.create().update(n)};for(var r=0;r<Te.length;++r){var e=Te[r];f[e]=$f(e,t)}return f}var Zf=function(t,f){return function(r,e){return new Le(r,f,!0).update(e)[t]()}},a0=function(t){var f=Zf("hex",t);f.create=function(n){return new Le(n,t)},f.update=function(n,i){return f.create(n).update(i)};for(var r=0;r<Te.length;++r){var e=Te[r];f[e]=Zf(e,t)}return f};function ht(t,f){f?(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],t?(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=t}ht.prototype.update=function(t){if(!this.finalized){var f,r=typeof t;if(r!=="string"){if(r==="object"){if(t===null)throw new Error(Oe);t=new Uint8Array(t)}else throw new Error(Oe);f=!0}for(var e,n=0,i,a=t.length,s=this.blocks;n<a;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),f)for(i=this.start;n<a&&i<64;++n)s[i>>2]|=t[n]<<mt[i++&3];else for(i=this.start;n<a&&i<64;++n)e=t.charCodeAt(n),e<128?s[i>>2]|=e<<mt[i++&3]:e<2048?(s[i>>2]|=(192|e>>6)<<mt[i++&3],s[i>>2]|=(128|e&63)<<mt[i++&3]):e<55296||e>=57344?(s[i>>2]|=(224|e>>12)<<mt[i++&3],s[i>>2]|=(128|e>>6&63)<<mt[i++&3],s[i>>2]|=(128|e&63)<<mt[i++&3]):(e=65536+((e&1023)<<10|t.charCodeAt(++n)&1023),s[i>>2]|=(240|e>>18)<<mt[i++&3],s[i>>2]|=(128|e>>12&63)<<mt[i++&3],s[i>>2]|=(128|e>>6&63)<<mt[i++&3],s[i>>2]|=(128|e&63)<<mt[i++&3]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=s[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}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 t=this.blocks,f=this.lastByteIndex;t[16]=this.block,t[f>>2]|=cr[f&3],this.block=t[16],f>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}};ht.prototype.hash=function(){var t=this.h0,f=this.h1,r=this.h2,e=this.h3,n=this.h4,i=this.h5,a=this.h6,s=this.h7,c=this.blocks,p,l,S,w,v,F,B,N,P,D,K;for(p=16;p<64;++p)v=c[p-15],l=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3,v=c[p-2],S=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,c[p]=c[p-16]+l+c[p-7]+S<<0;for(K=f&r,p=0;p<64;p+=4)this.first?(this.is224?(N=300032,v=c[0]-1413257819,s=v-150054599<<0,e=v+24177077<<0):(N=704751109,v=c[0]-210244248,s=v-1521486534<<0,e=v+143694565<<0),this.first=!1):(l=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),S=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),N=t&f,w=N^t&r^K,B=n&i^~n&a,v=s+S+B+Ee[p]+c[p],F=l+w,s=e+v<<0,e=v+F<<0),l=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),S=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),P=e&t,w=P^e&f^N,B=s&n^~s&i,v=a+S+B+Ee[p+1]+c[p+1],F=l+w,a=r+v<<0,r=v+F<<0,l=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),S=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),D=r&e,w=D^r&t^P,B=a&s^~a&n,v=i+S+B+Ee[p+2]+c[p+2],F=l+w,i=f+v<<0,f=v+F<<0,l=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),S=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),K=f&r,w=K^f&e^D,B=i&a^~i&s,v=n+S+B+Ee[p+3]+c[p+3],F=l+w,n=t+v<<0,t=v+F<<0;this.h0=this.h0+t<<0,this.h1=this.h1+f<<0,this.h2=this.h2+r<<0,this.h3=this.h3+e<<0,this.h4=this.h4+n<<0,this.h5=this.h5+i<<0,this.h6=this.h6+a<<0,this.h7=this.h7+s<<0};ht.prototype.hex=function(){this.finalize();var t=this.h0,f=this.h1,r=this.h2,e=this.h3,n=this.h4,i=this.h5,a=this.h6,s=this.h7,c=j[t>>28&15]+j[t>>24&15]+j[t>>20&15]+j[t>>16&15]+j[t>>12&15]+j[t>>8&15]+j[t>>4&15]+j[t&15]+j[f>>28&15]+j[f>>24&15]+j[f>>20&15]+j[f>>16&15]+j[f>>12&15]+j[f>>8&15]+j[f>>4&15]+j[f&15]+j[r>>28&15]+j[r>>24&15]+j[r>>20&15]+j[r>>16&15]+j[r>>12&15]+j[r>>8&15]+j[r>>4&15]+j[r&15]+j[e>>28&15]+j[e>>24&15]+j[e>>20&15]+j[e>>16&15]+j[e>>12&15]+j[e>>8&15]+j[e>>4&15]+j[e&15]+j[n>>28&15]+j[n>>24&15]+j[n>>20&15]+j[n>>16&15]+j[n>>12&15]+j[n>>8&15]+j[n>>4&15]+j[n&15]+j[i>>28&15]+j[i>>24&15]+j[i>>20&15]+j[i>>16&15]+j[i>>12&15]+j[i>>8&15]+j[i>>4&15]+j[i&15]+j[a>>28&15]+j[a>>24&15]+j[a>>20&15]+j[a>>16&15]+j[a>>12&15]+j[a>>8&15]+j[a>>4&15]+j[a&15];return this.is224||(c+=j[s>>28&15]+j[s>>24&15]+j[s>>20&15]+j[s>>16&15]+j[s>>12&15]+j[s>>8&15]+j[s>>4&15]+j[s&15]),c};ht.prototype.toString=ht.prototype.hex;ht.prototype.digest=function(){this.finalize();var t=this.h0,f=this.h1,r=this.h2,e=this.h3,n=this.h4,i=this.h5,a=this.h6,s=this.h7,c=[t>>24&255,t>>16&255,t>>8&255,t&255,f>>24&255,f>>16&255,f>>8&255,f&255,r>>24&255,r>>16&255,r>>8&255,r&255,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24&255,n>>16&255,n>>8&255,n&255,i>>24&255,i>>16&255,i>>8&255,i&255,a>>24&255,a>>16&255,a>>8&255,a&255];return this.is224||c.push(s>>24&255,s>>16&255,s>>8&255,s&255),c};ht.prototype.array=ht.prototype.digest;ht.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),f=new DataView(t);return f.setUint32(0,this.h0),f.setUint32(4,this.h1),f.setUint32(8,this.h2),f.setUint32(12,this.h3),f.setUint32(16,this.h4),f.setUint32(20,this.h5),f.setUint32(24,this.h6),this.is224||f.setUint32(28,this.h7),t};function Le(t,f,r){var e,n=typeof t;if(n==="string"){var i=[],a=t.length,s=0,c;for(e=0;e<a;++e)c=t.charCodeAt(e),c<128?i[s++]=c:c<2048?(i[s++]=192|c>>6,i[s++]=128|c&63):c<55296||c>=57344?(i[s++]=224|c>>12,i[s++]=128|c>>6&63,i[s++]=128|c&63):(c=65536+((c&1023)<<10|t.charCodeAt(++e)&1023),i[s++]=240|c>>18,i[s++]=128|c>>12&63,i[s++]=128|c>>6&63,i[s++]=128|c&63);t=i}else if(n==="object"){if(t===null)throw new Error(Oe);t=new Uint8Array(t)}else throw new Error(Oe);t.length>64&&(t=new ht(f,!0).update(t).array());var p=[],l=[];for(e=0;e<64;++e){var S=t[e]||0;p[e]=92^S,l[e]=54^S}ht.call(this,f,r),this.update(l),this.oKeyPad=p,this.inner=!0,this.sharedMemory=r}Le.prototype=new ht;Le.prototype.finalize=function(){if(ht.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();ht.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),ht.prototype.finalize.call(this)}};const le=Ne();le.sha256=le;le.sha224=Ne(!0);le.sha256.hmac=a0();le.sha224.hmac=a0(!0);var Y={},M=function(t){var f,r=new Float64Array(16);if(t)for(f=0;f<t.length;f++)r[f]=t[f];return r},je=function(){throw new Error("no PRNG")},xr=new Uint8Array(16),s0=new Uint8Array(32);s0[0]=9;var af=M(),ne=M([1]),hr=M([56129,1]),c0=M([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),ur=M([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Hf=M([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Gf=M([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),lr=M([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function kf(t,f,r,e){t[f]=r>>24&255,t[f+1]=r>>16&255,t[f+2]=r>>8&255,t[f+3]=r&255,t[f+4]=e>>24&255,t[f+5]=e>>16&255,t[f+6]=e>>8&255,t[f+7]=e&255}function gf(t,f,r,e,n){var i,a=0;for(i=0;i<n;i++)a|=t[f+i]^r[e+i];return(1&a-1>>>8)-1}function x0(t,f,r,e){return gf(t,f,r,e,16)}function wf(t,f,r,e){return gf(t,f,r,e,32)}function dr(t,f,r,e){for(var n=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,s=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,c=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,p=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,l=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,w=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,v=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,F=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,B=r[16]&255|(r[17]&255)<<8|(r[18]&255)<<16|(r[19]&255)<<24,N=r[20]&255|(r[21]&255)<<8|(r[22]&255)<<16|(r[23]&255)<<24,P=r[24]&255|(r[25]&255)<<8|(r[26]&255)<<16|(r[27]&255)<<24,D=r[28]&255|(r[29]&255)<<8|(r[30]&255)<<16|(r[31]&255)<<24,K=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,C=n,L=i,O=a,I=s,R=c,T=p,h=l,u=S,A=w,b=v,g=F,U=B,$=N,k=P,q=D,x=K,o,y=0;y<20;y+=2)o=C+$|0,R^=o<<7|o>>>32-7,o=R+C|0,A^=o<<9|o>>>32-9,o=A+R|0,$^=o<<13|o>>>32-13,o=$+A|0,C^=o<<18|o>>>32-18,o=T+L|0,b^=o<<7|o>>>32-7,o=b+T|0,k^=o<<9|o>>>32-9,o=k+b|0,L^=o<<13|o>>>32-13,o=L+k|0,T^=o<<18|o>>>32-18,o=g+h|0,q^=o<<7|o>>>32-7,o=q+g|0,O^=o<<9|o>>>32-9,o=O+q|0,h^=o<<13|o>>>32-13,o=h+O|0,g^=o<<18|o>>>32-18,o=x+U|0,I^=o<<7|o>>>32-7,o=I+x|0,u^=o<<9|o>>>32-9,o=u+I|0,U^=o<<13|o>>>32-13,o=U+u|0,x^=o<<18|o>>>32-18,o=C+I|0,L^=o<<7|o>>>32-7,o=L+C|0,O^=o<<9|o>>>32-9,o=O+L|0,I^=o<<13|o>>>32-13,o=I+O|0,C^=o<<18|o>>>32-18,o=T+R|0,h^=o<<7|o>>>32-7,o=h+T|0,u^=o<<9|o>>>32-9,o=u+h|0,R^=o<<13|o>>>32-13,o=R+u|0,T^=o<<18|o>>>32-18,o=g+b|0,U^=o<<7|o>>>32-7,o=U+g|0,A^=o<<9|o>>>32-9,o=A+U|0,b^=o<<13|o>>>32-13,o=b+A|0,g^=o<<18|o>>>32-18,o=x+q|0,$^=o<<7|o>>>32-7,o=$+x|0,k^=o<<9|o>>>32-9,o=k+$|0,q^=o<<13|o>>>32-13,o=q+k|0,x^=o<<18|o>>>32-18;C=C+n|0,L=L+i|0,O=O+a|0,I=I+s|0,R=R+c|0,T=T+p|0,h=h+l|0,u=u+S|0,A=A+w|0,b=b+v|0,g=g+F|0,U=U+B|0,$=$+N|0,k=k+P|0,q=q+D|0,x=x+K|0,t[0]=C>>>0&255,t[1]=C>>>8&255,t[2]=C>>>16&255,t[3]=C>>>24&255,t[4]=L>>>0&255,t[5]=L>>>8&255,t[6]=L>>>16&255,t[7]=L>>>24&255,t[8]=O>>>0&255,t[9]=O>>>8&255,t[10]=O>>>16&255,t[11]=O>>>24&255,t[12]=I>>>0&255,t[13]=I>>>8&255,t[14]=I>>>16&255,t[15]=I>>>24&255,t[16]=R>>>0&255,t[17]=R>>>8&255,t[18]=R>>>16&255,t[19]=R>>>24&255,t[20]=T>>>0&255,t[21]=T>>>8&255,t[22]=T>>>16&255,t[23]=T>>>24&255,t[24]=h>>>0&255,t[25]=h>>>8&255,t[26]=h>>>16&255,t[27]=h>>>24&255,t[28]=u>>>0&255,t[29]=u>>>8&255,t[30]=u>>>16&255,t[31]=u>>>24&255,t[32]=A>>>0&255,t[33]=A>>>8&255,t[34]=A>>>16&255,t[35]=A>>>24&255,t[36]=b>>>0&255,t[37]=b>>>8&255,t[38]=b>>>16&255,t[39]=b>>>24&255,t[40]=g>>>0&255,t[41]=g>>>8&255,t[42]=g>>>16&255,t[43]=g>>>24&255,t[44]=U>>>0&255,t[45]=U>>>8&255,t[46]=U>>>16&255,t[47]=U>>>24&255,t[48]=$>>>0&255,t[49]=$>>>8&255,t[50]=$>>>16&255,t[51]=$>>>24&255,t[52]=k>>>0&255,t[53]=k>>>8&255,t[54]=k>>>16&255,t[55]=k>>>24&255,t[56]=q>>>0&255,t[57]=q>>>8&255,t[58]=q>>>16&255,t[59]=q>>>24&255,t[60]=x>>>0&255,t[61]=x>>>8&255,t[62]=x>>>16&255,t[63]=x>>>24&255}function pr(t,f,r,e){for(var n=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,s=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,c=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,p=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,l=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,w=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,v=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,F=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,B=r[16]&255|(r[17]&255)<<8|(r[18]&255)<<16|(r[19]&255)<<24,N=r[20]&255|(r[21]&255)<<8|(r[22]&255)<<16|(r[23]&255)<<24,P=r[24]&255|(r[25]&255)<<8|(r[26]&255)<<16|(r[27]&255)<<24,D=r[28]&255|(r[29]&255)<<8|(r[30]&255)<<16|(r[31]&255)<<24,K=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,C=n,L=i,O=a,I=s,R=c,T=p,h=l,u=S,A=w,b=v,g=F,U=B,$=N,k=P,q=D,x=K,o,y=0;y<20;y+=2)o=C+$|0,R^=o<<7|o>>>32-7,o=R+C|0,A^=o<<9|o>>>32-9,o=A+R|0,$^=o<<13|o>>>32-13,o=$+A|0,C^=o<<18|o>>>32-18,o=T+L|0,b^=o<<7|o>>>32-7,o=b+T|0,k^=o<<9|o>>>32-9,o=k+b|0,L^=o<<13|o>>>32-13,o=L+k|0,T^=o<<18|o>>>32-18,o=g+h|0,q^=o<<7|o>>>32-7,o=q+g|0,O^=o<<9|o>>>32-9,o=O+q|0,h^=o<<13|o>>>32-13,o=h+O|0,g^=o<<18|o>>>32-18,o=x+U|0,I^=o<<7|o>>>32-7,o=I+x|0,u^=o<<9|o>>>32-9,o=u+I|0,U^=o<<13|o>>>32-13,o=U+u|0,x^=o<<18|o>>>32-18,o=C+I|0,L^=o<<7|o>>>32-7,o=L+C|0,O^=o<<9|o>>>32-9,o=O+L|0,I^=o<<13|o>>>32-13,o=I+O|0,C^=o<<18|o>>>32-18,o=T+R|0,h^=o<<7|o>>>32-7,o=h+T|0,u^=o<<9|o>>>32-9,o=u+h|0,R^=o<<13|o>>>32-13,o=R+u|0,T^=o<<18|o>>>32-18,o=g+b|0,U^=o<<7|o>>>32-7,o=U+g|0,A^=o<<9|o>>>32-9,o=A+U|0,b^=o<<13|o>>>32-13,o=b+A|0,g^=o<<18|o>>>32-18,o=x+q|0,$^=o<<7|o>>>32-7,o=$+x|0,k^=o<<9|o>>>32-9,o=k+$|0,q^=o<<13|o>>>32-13,o=q+k|0,x^=o<<18|o>>>32-18;t[0]=C>>>0&255,t[1]=C>>>8&255,t[2]=C>>>16&255,t[3]=C>>>24&255,t[4]=T>>>0&255,t[5]=T>>>8&255,t[6]=T>>>16&255,t[7]=T>>>24&255,t[8]=g>>>0&255,t[9]=g>>>8&255,t[10]=g>>>16&255,t[11]=g>>>24&255,t[12]=x>>>0&255,t[13]=x>>>8&255,t[14]=x>>>16&255,t[15]=x>>>24&255,t[16]=h>>>0&255,t[17]=h>>>8&255,t[18]=h>>>16&255,t[19]=h>>>24&255,t[20]=u>>>0&255,t[21]=u>>>8&255,t[22]=u>>>16&255,t[23]=u>>>24&255,t[24]=A>>>0&255,t[25]=A>>>8&255,t[26]=A>>>16&255,t[27]=A>>>24&255,t[28]=b>>>0&255,t[29]=b>>>8&255,t[30]=b>>>16&255,t[31]=b>>>24&255}function Be(t,f,r,e){dr(t,f,r,e)}function Me(t,f,r,e){pr(t,f,r,e)}var Vt=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function h0(t,f,r,e,n,i,a){var s=new Uint8Array(16),c=new Uint8Array(64),p,l;for(l=0;l<16;l++)s[l]=0;for(l=0;l<8;l++)s[l]=i[l];for(;n>=64;){for(Be(c,s,a,Vt),l=0;l<64;l++)t[f+l]=r[e+l]^c[l];for(p=1,l=8;l<16;l++)p=p+(s[l]&255)|0,s[l]=p&255,p>>>=8;n-=64,f+=64,e+=64}if(n>0)for(Be(c,s,a,Vt),l=0;l<n;l++)t[f+l]=r[e+l]^c[l];return 0}function u0(t,f,r,e,n){var i=new Uint8Array(16),a=new Uint8Array(64),s,c;for(c=0;c<16;c++)i[c]=0;for(c=0;c<8;c++)i[c]=e[c];for(;r>=64;){for(Be(a,i,n,Vt),c=0;c<64;c++)t[f+c]=a[c];for(s=1,c=8;c<16;c++)s=s+(i[c]&255)|0,i[c]=s&255,s>>>=8;r-=64,f+=64}if(r>0)for(Be(a,i,n,Vt),c=0;c<r;c++)t[f+c]=a[c];return 0}function l0(t,f,r,e,n){var i=new Uint8Array(32);Me(i,e,n,Vt);for(var a=new Uint8Array(8),s=0;s<8;s++)a[s]=e[s+16];return u0(t,f,r,a,i)}function vf(t,f,r,e,n,i,a){var s=new Uint8Array(32);Me(s,i,a,Vt);for(var c=new Uint8Array(8),p=0;p<8;p++)c[p]=i[p+16];return h0(t,f,r,e,n,c,s)}var De=function(t){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 f,r,e,n,i,a,s,c;f=t[0]&255|(t[1]&255)<<8,this.r[0]=f&8191,r=t[2]&255|(t[3]&255)<<8,this.r[1]=(f>>>13|r<<3)&8191,e=t[4]&255|(t[5]&255)<<8,this.r[2]=(r>>>10|e<<6)&7939,n=t[6]&255|(t[7]&255)<<8,this.r[3]=(e>>>7|n<<9)&8191,i=t[8]&255|(t[9]&255)<<8,this.r[4]=(n>>>4|i<<12)&255,this.r[5]=i>>>1&8190,a=t[10]&255|(t[11]&255)<<8,this.r[6]=(i>>>14|a<<2)&8191,s=t[12]&255|(t[13]&255)<<8,this.r[7]=(a>>>11|s<<5)&8065,c=t[14]&255|(t[15]&255)<<8,this.r[8]=(s>>>8|c<<8)&8191,this.r[9]=c>>>5&127,this.pad[0]=t[16]&255|(t[17]&255)<<8,this.pad[1]=t[18]&255|(t[19]&255)<<8,this.pad[2]=t[20]&255|(t[21]&255)<<8,this.pad[3]=t[22]&255|(t[23]&255)<<8,this.pad[4]=t[24]&255|(t[25]&255)<<8,this.pad[5]=t[26]&255|(t[27]&255)<<8,this.pad[6]=t[28]&255|(t[29]&255)<<8,this.pad[7]=t[30]&255|(t[31]&255)<<8};De.prototype.blocks=function(t,f,r){for(var e=this.fin?0:2048,n,i,a,s,c,p,l,S,w,v,F,B,N,P,D,K,C,L,O,I=this.h[0],R=this.h[1],T=this.h[2],h=this.h[3],u=this.h[4],A=this.h[5],b=this.h[6],g=this.h[7],U=this.h[8],$=this.h[9],k=this.r[0],q=this.r[1],x=this.r[2],o=this.r[3],y=this.r[4],d=this.r[5],m=this.r[6],z=this.r[7],H=this.r[8],Z=this.r[9];r>=16;)n=t[f+0]&255|(t[f+1]&255)<<8,I+=n&8191,i=t[f+2]&255|(t[f+3]&255)<<8,R+=(n>>>13|i<<3)&8191,a=t[f+4]&255|(t[f+5]&255)<<8,T+=(i>>>10|a<<6)&8191,s=t[f+6]&255|(t[f+7]&255)<<8,h+=(a>>>7|s<<9)&8191,c=t[f+8]&255|(t[f+9]&255)<<8,u+=(s>>>4|c<<12)&8191,A+=c>>>1&8191,p=t[f+10]&255|(t[f+11]&255)<<8,b+=(c>>>14|p<<2)&8191,l=t[f+12]&255|(t[f+13]&255)<<8,g+=(p>>>11|l<<5)&8191,S=t[f+14]&255|(t[f+15]&255)<<8,U+=(l>>>8|S<<8)&8191,$+=S>>>5|e,w=0,v=w,v+=I*k,v+=R*(5*Z),v+=T*(5*H),v+=h*(5*z),v+=u*(5*m),w=v>>>13,v&=8191,v+=A*(5*d),v+=b*(5*y),v+=g*(5*o),v+=U*(5*x),v+=$*(5*q),w+=v>>>13,v&=8191,F=w,F+=I*q,F+=R*k,F+=T*(5*Z),F+=h*(5*H),F+=u*(5*z),w=F>>>13,F&=8191,F+=A*(5*m),F+=b*(5*d),F+=g*(5*y),F+=U*(5*o),F+=$*(5*x),w+=F>>>13,F&=8191,B=w,B+=I*x,B+=R*q,B+=T*k,B+=h*(5*Z),B+=u*(5*H),w=B>>>13,B&=8191,B+=A*(5*z),B+=b*(5*m),B+=g*(5*d),B+=U*(5*y),B+=$*(5*o),w+=B>>>13,B&=8191,N=w,N+=I*o,N+=R*x,N+=T*q,N+=h*k,N+=u*(5*Z),w=N>>>13,N&=8191,N+=A*(5*H),N+=b*(5*z),N+=g*(5*m),N+=U*(5*d),N+=$*(5*y),w+=N>>>13,N&=8191,P=w,P+=I*y,P+=R*o,P+=T*x,P+=h*q,P+=u*k,w=P>>>13,P&=8191,P+=A*(5*Z),P+=b*(5*H),P+=g*(5*z),P+=U*(5*m),P+=$*(5*d),w+=P>>>13,P&=8191,D=w,D+=I*d,D+=R*y,D+=T*o,D+=h*x,D+=u*q,w=D>>>13,D&=8191,D+=A*k,D+=b*(5*Z),D+=g*(5*H),D+=U*(5*z),D+=$*(5*m),w+=D>>>13,D&=8191,K=w,K+=I*m,K+=R*d,K+=T*y,K+=h*o,K+=u*x,w=K>>>13,K&=8191,K+=A*q,K+=b*k,K+=g*(5*Z),K+=U*(5*H),K+=$*(5*z),w+=K>>>13,K&=8191,C=w,C+=I*z,C+=R*m,C+=T*d,C+=h*y,C+=u*o,w=C>>>13,C&=8191,C+=A*x,C+=b*q,C+=g*k,C+=U*(5*Z),C+=$*(5*H),w+=C>>>13,C&=8191,L=w,L+=I*H,L+=R*z,L+=T*m,L+=h*d,L+=u*y,w=L>>>13,L&=8191,L+=A*o,L+=b*x,L+=g*q,L+=U*k,L+=$*(5*Z),w+=L>>>13,L&=8191,O=w,O+=I*Z,O+=R*H,O+=T*z,O+=h*m,O+=u*d,w=O>>>13,O&=8191,O+=A*y,O+=b*o,O+=g*x,O+=U*q,O+=$*k,w+=O>>>13,O&=8191,w=(w<<2)+w|0,w=w+v|0,v=w&8191,w=w>>>13,F+=w,I=v,R=F,T=B,h=N,u=P,A=D,b=K,g=C,U=L,$=O,f+=16,r-=16;this.h[0]=I,this.h[1]=R,this.h[2]=T,this.h[3]=h,this.h[4]=u,this.h[5]=A,this.h[6]=b,this.h[7]=g,this.h[8]=U,this.h[9]=$};De.prototype.finish=function(t,f){var r=new Uint16Array(10),e,n,i,a;if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(e=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=e,e=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=e*5,e=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=e,e=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=e,r[0]=this.h[0]+5,e=r[0]>>>13,r[0]&=8191,a=1;a<10;a++)r[a]=this.h[a]+e,e=r[a]>>>13,r[a]&=8191;for(r[9]-=1<<13,n=(e^1)-1,a=0;a<10;a++)r[a]&=n;for(n=~n,a=0;a<10;a++)this.h[a]=this.h[a]&n|r[a];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,i=this.h[0]+this.pad[0],this.h[0]=i&65535,a=1;a<8;a++)i=(this.h[a]+this.pad[a]|0)+(i>>>16)|0,this.h[a]=i&65535;t[f+0]=this.h[0]>>>0&255,t[f+1]=this.h[0]>>>8&255,t[f+2]=this.h[1]>>>0&255,t[f+3]=this.h[1]>>>8&255,t[f+4]=this.h[2]>>>0&255,t[f+5]=this.h[2]>>>8&255,t[f+6]=this.h[3]>>>0&255,t[f+7]=this.h[3]>>>8&255,t[f+8]=this.h[4]>>>0&255,t[f+9]=this.h[4]>>>8&255,t[f+10]=this.h[5]>>>0&255,t[f+11]=this.h[5]>>>8&255,t[f+12]=this.h[6]>>>0&255,t[f+13]=this.h[6]>>>8&255,t[f+14]=this.h[7]>>>0&255,t[f+15]=this.h[7]>>>8&255};De.prototype.update=function(t,f,r){var e,n;if(this.leftover){for(n=16-this.leftover,n>r&&(n=r),e=0;e<n;e++)this.buffer[this.leftover+e]=t[f+e];if(r-=n,f+=n,this.leftover+=n,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(n=r-r%16,this.blocks(t,f,n),f+=n,r-=n),r){for(e=0;e<r;e++)this.buffer[this.leftover+e]=t[f+e];this.leftover+=r}};function Af(t,f,r,e,n,i){var a=new De(i);return a.update(r,e,n),a.finish(t,f),0}function d0(t,f,r,e,n,i){var a=new Uint8Array(16);return Af(a,0,r,e,n,i),x0(t,f,a,0)}function Ef(t,f,r,e,n){var i;if(r<32)return-1;for(vf(t,0,f,0,r,e,n),Af(t,16,t,32,r-32,t),i=0;i<16;i++)t[i]=0;return 0}function _f(t,f,r,e,n){var i,a=new Uint8Array(32);if(r<32||(l0(a,0,32,e,n),d0(f,16,f,32,r-32,a)!==0))return-1;for(vf(t,0,f,0,r,e,n),i=0;i<32;i++)t[i]=0;return 0}function It(t,f){var r;for(r=0;r<16;r++)t[r]=f[r]|0}function Qe(t){var f,r,e=1;for(f=0;f<16;f++)r=t[f]+e+65535,e=Math.floor(r/65536),t[f]=r-e*65536;t[0]+=e-1+37*(e-1)}function te(t,f,r){for(var e,n=~(r-1),i=0;i<16;i++)e=n&(t[i]^f[i]),t[i]^=e,f[i]^=e}function Wt(t,f){var r,e,n,i=M(),a=M();for(r=0;r<16;r++)a[r]=f[r];for(Qe(a),Qe(a),Qe(a),e=0;e<2;e++){for(i[0]=a[0]-65517,r=1;r<15;r++)i[r]=a[r]-65535-(i[r-1]>>16&1),i[r-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),n=i[15]>>16&1,i[14]&=65535,te(a,i,1-n)}for(r=0;r<16;r++)t[2*r]=a[r]&255,t[2*r+1]=a[r]>>8}function qf(t,f){var r=new Uint8Array(32),e=new Uint8Array(32);return Wt(r,t),Wt(e,f),wf(r,0,e,0)}function p0(t){var f=new Uint8Array(32);return Wt(f,t),f[0]&1}function Uf(t,f){var r;for(r=0;r<16;r++)t[r]=f[2*r]+(f[2*r+1]<<8);t[15]&=32767}function Ft(t,f,r){for(var e=0;e<16;e++)t[e]=f[e]+r[e]}function Ot(t,f,r){for(var e=0;e<16;e++)t[e]=f[e]-r[e]}function W(t,f,r){var e,n,i=0,a=0,s=0,c=0,p=0,l=0,S=0,w=0,v=0,F=0,B=0,N=0,P=0,D=0,K=0,C=0,L=0,O=0,I=0,R=0,T=0,h=0,u=0,A=0,b=0,g=0,U=0,$=0,k=0,q=0,x=0,o=r[0],y=r[1],d=r[2],m=r[3],z=r[4],H=r[5],Z=r[6],V=r[7],G=r[8],X=r[9],tt=r[10],Q=r[11],ft=r[12],nt=r[13],it=r[14],ot=r[15];e=f[0],i+=e*o,a+=e*y,s+=e*d,c+=e*m,p+=e*z,l+=e*H,S+=e*Z,w+=e*V,v+=e*G,F+=e*X,B+=e*tt,N+=e*Q,P+=e*ft,D+=e*nt,K+=e*it,C+=e*ot,e=f[1],a+=e*o,s+=e*y,c+=e*d,p+=e*m,l+=e*z,S+=e*H,w+=e*Z,v+=e*V,F+=e*G,B+=e*X,N+=e*tt,P+=e*Q,D+=e*ft,K+=e*nt,C+=e*it,L+=e*ot,e=f[2],s+=e*o,c+=e*y,p+=e*d,l+=e*m,S+=e*z,w+=e*H,v+=e*Z,F+=e*V,B+=e*G,N+=e*X,P+=e*tt,D+=e*Q,K+=e*ft,C+=e*nt,L+=e*it,O+=e*ot,e=f[3],c+=e*o,p+=e*y,l+=e*d,S+=e*m,w+=e*z,v+=e*H,F+=e*Z,B+=e*V,N+=e*G,P+=e*X,D+=e*tt,K+=e*Q,C+=e*ft,L+=e*nt,O+=e*it,I+=e*ot,e=f[4],p+=e*o,l+=e*y,S+=e*d,w+=e*m,v+=e*z,F+=e*H,B+=e*Z,N+=e*V,P+=e*G,D+=e*X,K+=e*tt,C+=e*Q,L+=e*ft,O+=e*nt,I+=e*it,R+=e*ot,e=f[5],l+=e*o,S+=e*y,w+=e*d,v+=e*m,F+=e*z,B+=e*H,N+=e*Z,P+=e*V,D+=e*G,K+=e*X,C+=e*tt,L+=e*Q,O+=e*ft,I+=e*nt,R+=e*it,T+=e*ot,e=f[6],S+=e*o,w+=e*y,v+=e*d,F+=e*m,B+=e*z,N+=e*H,P+=e*Z,D+=e*V,K+=e*G,C+=e*X,L+=e*tt,O+=e*Q,I+=e*ft,R+=e*nt,T+=e*it,h+=e*ot,e=f[7],w+=e*o,v+=e*y,F+=e*d,B+=e*m,N+=e*z,P+=e*H,D+=e*Z,K+=e*V,C+=e*G,L+=e*X,O+=e*tt,I+=e*Q,R+=e*ft,T+=e*nt,h+=e*it,u+=e*ot,e=f[8],v+=e*o,F+=e*y,B+=e*d,N+=e*m,P+=e*z,D+=e*H,K+=e*Z,C+=e*V,L+=e*G,O+=e*X,I+=e*tt,R+=e*Q,T+=e*ft,h+=e*nt,u+=e*it,A+=e*ot,e=f[9],F+=e*o,B+=e*y,N+=e*d,P+=e*m,D+=e*z,K+=e*H,C+=e*Z,L+=e*V,O+=e*G,I+=e*X,R+=e*tt,T+=e*Q,h+=e*ft,u+=e*nt,A+=e*it,b+=e*ot,e=f[10],B+=e*o,N+=e*y,P+=e*d,D+=e*m,K+=e*z,C+=e*H,L+=e*Z,O+=e*V,I+=e*G,R+=e*X,T+=e*tt,h+=e*Q,u+=e*ft,A+=e*nt,b+=e*it,g+=e*ot,e=f[11],N+=e*o,P+=e*y,D+=e*d,K+=e*m,C+=e*z,L+=e*H,O+=e*Z,I+=e*V,R+=e*G,T+=e*X,h+=e*tt,u+=e*Q,A+=e*ft,b+=e*nt,g+=e*it,U+=e*ot,e=f[12],P+=e*o,D+=e*y,K+=e*d,C+=e*m,L+=e*z,O+=e*H,I+=e*Z,R+=e*V,T+=e*G,h+=e*X,u+=e*tt,A+=e*Q,b+=e*ft,g+=e*nt,U+=e*it,$+=e*ot,e=f[13],D+=e*o,K+=e*y,C+=e*d,L+=e*m,O+=e*z,I+=e*H,R+=e*Z,T+=e*V,h+=e*G,u+=e*X,A+=e*tt,b+=e*Q,g+=e*ft,U+=e*nt,$+=e*it,k+=e*ot,e=f[14],K+=e*o,C+=e*y,L+=e*d,O+=e*m,I+=e*z,R+=e*H,T+=e*Z,h+=e*V,u+=e*G,A+=e*X,b+=e*tt,g+=e*Q,U+=e*ft,$+=e*nt,k+=e*it,q+=e*ot,e=f[15],C+=e*o,L+=e*y,O+=e*d,I+=e*m,R+=e*z,T+=e*H,h+=e*Z,u+=e*V,A+=e*G,b+=e*X,g+=e*tt,U+=e*Q,$+=e*ft,k+=e*nt,q+=e*it,x+=e*ot,i+=38*L,a+=38*O,s+=38*I,c+=38*R,p+=38*T,l+=38*h,S+=38*u,w+=38*A,v+=38*b,F+=38*g,B+=38*U,N+=38*$,P+=38*k,D+=38*q,K+=38*x,n=1,e=i+n+65535,n=Math.floor(e/65536),i=e-n*65536,e=a+n+65535,n=Math.floor(e/65536),a=e-n*65536,e=s+n+65535,n=Math.floor(e/65536),s=e-n*65536,e=c+n+65535,n=Math.floor(e/65536),c=e-n*65536,e=p+n+65535,n=Math.floor(e/65536),p=e-n*65536,e=l+n+65535,n=Math.floor(e/65536),l=e-n*65536,e=S+n+65535,n=Math.floor(e/65536),S=e-n*65536,e=w+n+65535,n=Math.floor(e/65536),w=e-n*65536,e=v+n+65535,n=Math.floor(e/65536),v=e-n*65536,e=F+n+65535,n=Math.floor(e/65536),F=e-n*65536,e=B+n+65535,n=Math.floor(e/65536),B=e-n*65536,e=N+n+65535,n=Math.floor(e/65536),N=e-n*65536,e=P+n+65535,n=Math.floor(e/65536),P=e-n*65536,e=D+n+65535,n=Math.floor(e/65536),D=e-n*65536,e=K+n+65535,n=Math.floor(e/65536),K=e-n*65536,e=C+n+65535,n=Math.floor(e/65536),C=e-n*65536,i+=n-1+37*(n-1),n=1,e=i+n+65535,n=Math.floor(e/65536),i=e-n*65536,e=a+n+65535,n=Math.floor(e/65536),a=e-n*65536,e=s+n+65535,n=Math.floor(e/65536),s=e-n*65536,e=c+n+65535,n=Math.floor(e/65536),c=e-n*65536,e=p+n+65535,n=Math.floor(e/65536),p=e-n*65536,e=l+n+65535,n=Math.floor(e/65536),l=e-n*65536,e=S+n+65535,n=Math.floor(e/65536),S=e-n*65536,e=w+n+65535,n=Math.floor(e/65536),w=e-n*65536,e=v+n+65535,n=Math.floor(e/65536),v=e-n*65536,e=F+n+65535,n=Math.floor(e/65536),F=e-n*65536,e=B+n+65535,n=Math.floor(e/65536),B=e-n*65536,e=N+n+65535,n=Math.floor(e/65536),N=e-n*65536,e=P+n+65535,n=Math.floor(e/65536),P=e-n*65536,e=D+n+65535,n=Math.floor(e/65536),D=e-n*65536,e=K+n+65535,n=Math.floor(e/65536),K=e-n*65536,e=C+n+65535,n=Math.floor(e/65536),C=e-n*65536,i+=n-1+37*(n-1),t[0]=i,t[1]=a,t[2]=s,t[3]=c,t[4]=p,t[5]=l,t[6]=S,t[7]=w,t[8]=v,t[9]=F,t[10]=B,t[11]=N,t[12]=P,t[13]=D,t[14]=K,t[15]=C}function Ct(t,f){W(t,f,f)}function Sf(t,f){var r=M(),e;for(e=0;e<16;e++)r[e]=f[e];for(e=253;e>=0;e--)Ct(r,r),e!==2&&e!==4&&W(r,r,f);for(e=0;e<16;e++)t[e]=r[e]}function y0(t,f){var r=M(),e;for(e=0;e<16;e++)r[e]=f[e];for(e=250;e>=0;e--)Ct(r,r),e!==1&&W(r,r,f);for(e=0;e<16;e++)t[e]=r[e]}function Ye(t,f,r){var e=new Uint8Array(32),n=new Float64Array(80),i,a,s=M(),c=M(),p=M(),l=M(),S=M(),w=M();for(a=0;a<31;a++)e[a]=f[a];for(e[31]=f[31]&127|64,e[0]&=248,Uf(n,r),a=0;a<16;a++)c[a]=n[a],l[a]=s[a]=p[a]=0;for(s[0]=l[0]=1,a=254;a>=0;--a)i=e[a>>>3]>>>(a&7)&1,te(s,c,i),te(p,l,i),Ft(S,s,p),Ot(s,s,p),Ft(p,c,l),Ot(c,c,l),Ct(l,S),Ct(w,s),W(s,p,s),W(p,c,S),Ft(S,s,p),Ot(s,s,p),Ct(c,s),Ot(p,l,w),W(s,p,hr),Ft(s,s,l),W(p,p,s),W(s,l,w),W(l,c,n),Ct(c,S),te(s,c,i),te(p,l,i);for(a=0;a<16;a++)n[a+16]=s[a],n[a+32]=p[a],n[a+48]=c[a],n[a+64]=l[a];var v=n.subarray(32),F=n.subarray(16);return Sf(v,v),W(F,F,v),Wt(t,F),0}function Ke(t,f){return Ye(t,f,s0)}function b0(t,f){return je(f,32),Ke(t,f)}function $e(t,f,r){var e=new Uint8Array(32);return Ye(e,r,f),Me(t,xr,e,Vt)}var g0=Ef,yr=_f;function br(t,f,r,e,n,i){var a=new Uint8Array(32);return $e(a,n,i),g0(t,f,r,e,a)}function gr(t,f,r,e,n,i){var a=new Uint8Array(32);return $e(a,n,i),yr(t,f,r,e,a)}var Vf=[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 Wf(t,f,r,e){for(var n=new Int32Array(16),i=new Int32Array(16),a,s,c,p,l,S,w,v,F,B,N,P,D,K,C,L,O,I,R,T,h,u,A,b,g,U,$=t[0],k=t[1],q=t[2],x=t[3],o=t[4],y=t[5],d=t[6],m=t[7],z=f[0],H=f[1],Z=f[2],V=f[3],G=f[4],X=f[5],tt=f[6],Q=f[7],ft=0;e>=128;){for(R=0;R<16;R++)T=8*R+ft,n[R]=r[T+0]<<24|r[T+1]<<16|r[T+2]<<8|r[T+3],i[R]=r[T+4]<<24|r[T+5]<<16|r[T+6]<<8|r[T+7];for(R=0;R<80;R++)if(a=$,s=k,c=q,p=x,l=o,S=y,w=d,v=m,F=z,B=H,N=Z,P=V,D=G,K=X,C=tt,L=Q,h=m,u=Q,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=(o>>>14|G<<32-14)^(o>>>18|G<<32-18)^(G>>>41-32|o<<32-(41-32)),u=(G>>>14|o<<32-14)^(G>>>18|o<<32-18)^(o>>>41-32|G<<32-(41-32)),A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,h=o&y^~o&d,u=G&X^~G&tt,A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,h=Vf[R*2],u=Vf[R*2+1],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,h=n[R%16],u=i[R%16],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,O=g&65535|U<<16,I=A&65535|b<<16,h=O,u=I,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=($>>>28|z<<32-28)^(z>>>34-32|$<<32-(34-32))^(z>>>39-32|$<<32-(39-32)),u=(z>>>28|$<<32-28)^($>>>34-32|z<<32-(34-32))^($>>>39-32|z<<32-(39-32)),A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,h=$&k^$&q^k&q,u=z&H^z&Z^H&Z,A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,v=g&65535|U<<16,L=A&65535|b<<16,h=p,u=P,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=O,u=I,A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,p=g&65535|U<<16,P=A&65535|b<<16,k=a,q=s,x=c,o=p,y=l,d=S,m=w,$=v,H=F,Z=B,V=N,G=P,X=D,tt=K,Q=C,z=L,R%16===15)for(T=0;T<16;T++)h=n[T],u=i[T],A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=n[(T+9)%16],u=i[(T+9)%16],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,O=n[(T+1)%16],I=i[(T+1)%16],h=(O>>>1|I<<32-1)^(O>>>8|I<<32-8)^O>>>7,u=(I>>>1|O<<32-1)^(I>>>8|O<<32-8)^(I>>>7|O<<32-7),A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,O=n[(T+14)%16],I=i[(T+14)%16],h=(O>>>19|I<<32-19)^(I>>>61-32|O<<32-(61-32))^O>>>6,u=(I>>>19|O<<32-19)^(O>>>61-32|I<<32-(61-32))^(I>>>6|O<<32-6),A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,n[T]=g&65535|U<<16,i[T]=A&65535|b<<16;h=$,u=z,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=t[0],u=f[0],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,t[0]=$=g&65535|U<<16,f[0]=z=A&65535|b<<16,h=k,u=H,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=t[1],u=f[1],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,t[1]=k=g&65535|U<<16,f[1]=H=A&65535|b<<16,h=q,u=Z,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=t[2],u=f[2],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,t[2]=q=g&65535|U<<16,f[2]=Z=A&65535|b<<16,h=x,u=V,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=t[3],u=f[3],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,t[3]=x=g&65535|U<<16,f[3]=V=A&65535|b<<16,h=o,u=G,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=t[4],u=f[4],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,t[4]=o=g&65535|U<<16,f[4]=G=A&65535|b<<16,h=y,u=X,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=t[5],u=f[5],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,t[5]=y=g&65535|U<<16,f[5]=X=A&65535|b<<16,h=d,u=tt,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=t[6],u=f[6],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,t[6]=d=g&65535|U<<16,f[6]=tt=A&65535|b<<16,h=m,u=Q,A=u&65535,b=u>>>16,g=h&65535,U=h>>>16,h=t[7],u=f[7],A+=u&65535,b+=u>>>16,g+=h&65535,U+=h>>>16,b+=A>>>16,g+=b>>>16,U+=g>>>16,t[7]=m=g&65535|U<<16,f[7]=Q=A&65535|b<<16,ft+=128,e-=128}return e}function qt(t,f,r){var e=new Int32Array(8),n=new Int32Array(8),i=new Uint8Array(256),a,s=r;for(e[0]=1779033703,e[1]=3144134277,e[2]=1013904242,e[3]=2773480762,e[4]=1359893119,e[5]=2600822924,e[6]=528734635,e[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,Wf(e,n,f,r),r%=128,a=0;a<r;a++)i[a]=f[s-r+a];for(i[r]=128,r=256-128*(r<112?1:0),i[r-9]=0,kf(i,r-8,s/536870912|0,s<<3),Wf(e,n,i,r),a=0;a<8;a++)kf(t,8*a,e[a],n[a]);return 0}function me(t,f){var r=M(),e=M(),n=M(),i=M(),a=M(),s=M(),c=M(),p=M(),l=M();Ot(r,t[1],t[0]),Ot(l,f[1],f[0]),W(r,r,l),Ft(e,t[0],t[1]),Ft(l,f[0],f[1]),W(e,e,l),W(n,t[3],f[3]),W(n,n,ur),W(i,t[2],f[2]),Ft(i,i,i),Ot(a,e,r),Ot(s,i,n),Ft(c,i,n),Ft(p,e,r),W(t[0],a,s),W(t[1],p,c),W(t[2],c,s),W(t[3],a,p)}function Xf(t,f,r){var e;for(e=0;e<4;e++)te(t[e],f[e],r)}function Ff(t,f){var r=M(),e=M(),n=M();Sf(n,f[2]),W(r,f[0],n),W(e,f[1],n),Wt(t,e),t[31]^=p0(r)<<7}function Cf(t,f,r){var e,n;for(It(t[0],af),It(t[1],ne),It(t[2],ne),It(t[3],af),n=255;n>=0;--n)e=r[n/8|0]>>(n&7)&1,Xf(t,f,e),me(f,t),me(t,t),Xf(t,f,e)}function Ze(t,f){var r=[M(),M(),M(),M()];It(r[0],Hf),It(r[1],Gf),It(r[2],ne),W(r[3],Hf,Gf),Cf(t,r,f)}function Of(t,f,r){var e=new Uint8Array(64),n=[M(),M(),M(),M()],i;for(r||je(f,32),qt(e,f,32),e[0]&=248,e[31]&=127,e[31]|=64,Ze(n,e),Ff(t,n),i=0;i<32;i++)f[i+32]=t[i];return 0}var Fe=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 Tf(t,f){var r,e,n,i;for(e=63;e>=32;--e){for(r=0,n=e-32,i=e-12;n<i;++n)f[n]+=r-16*f[e]*Fe[n-(e-32)],r=Math.floor((f[n]+128)/256),f[n]-=r*256;f[n]+=r,f[e]=0}for(r=0,n=0;n<32;n++)f[n]+=r-(f[31]>>4)*Fe[n],r=f[n]>>8,f[n]&=255;for(n=0;n<32;n++)f[n]-=r*Fe[n];for(e=0;e<32;e++)f[e+1]+=f[e]>>8,t[e]=f[e]&255}function sf(t){var f=new Float64Array(64),r;for(r=0;r<64;r++)f[r]=t[r];for(r=0;r<64;r++)t[r]=0;Tf(t,f)}function w0(t,f,r,e){var n=new Uint8Array(64),i=new Uint8Array(64),a=new Uint8Array(64),s,c,p=new Float64Array(64),l=[M(),M(),M(),M()];qt(n,e,32),n[0]&=248,n[31]&=127,n[31]|=64;var S=r+64;for(s=0;s<r;s++)t[64+s]=f[s];for(s=0;s<32;s++)t[32+s]=n[32+s];for(qt(a,t.subarray(32),r+32),sf(a),Ze(l,a),Ff(t,l),s=32;s<64;s++)t[s]=e[s];for(qt(i,t,r+64),sf(i),s=0;s<64;s++)p[s]=0;for(s=0;s<32;s++)p[s]=a[s];for(s=0;s<32;s++)for(c=0;c<32;c++)p[s+c]+=i[s]*n[c];return Tf(t.subarray(32),p),S}function v0(t,f){var r=M(),e=M(),n=M(),i=M(),a=M(),s=M(),c=M();return It(t[2],ne),Uf(t[1],f),Ct(n,t[1]),W(i,n,c0),Ot(n,n,t[2]),Ft(i,t[2],i),Ct(a,i),Ct(s,a),W(c,s,a),W(r,c,n),W(r,r,i),y0(r,r),W(r,r,n),W(r,r,i),W(r,r,i),W(t[0],r,i),Ct(e,t[0]),W(e,e,i),qf(e,n)&&W(t[0],t[0],lr),Ct(e,t[0]),W(e,e,i),qf(e,n)?-1:(p0(t[0])===f[31]>>7&&Ot(t[0],af,t[0]),W(t[3],t[0],t[1]),0)}function Bf(t,f,r,e){var n,i=new Uint8Array(32),a=new Uint8Array(64),s=[M(),M(),M(),M()],c=[M(),M(),M(),M()];if(r<64||v0(c,e))return-1;for(n=0;n<r;n++)t[n]=f[n];for(n=0;n<32;n++)t[n+32]=e[n];if(qt(a,t,r),sf(a),Cf(s,c,a),Ze(c,f.subarray(32)),me(s,c),Ff(i,s),r-=64,wf(f,0,i,0)){for(n=0;n<r;n++)t[n]=0;return-1}for(n=0;n<r;n++)t[n]=f[n+64];return r}var mf=32,He=24,de=32,ie=16,pe=32,Ge=32,ve=32,Ae=32,zf=32,A0=He,wr=de,vr=ie,Pt=64,Qt=32,oe=64,Rf=32,Pf=64;Y.lowlevel={crypto_core_hsalsa20:Me,crypto_stream_xor:vf,crypto_stream:l0,crypto_stream_salsa20_xor:h0,crypto_stream_salsa20:u0,crypto_onetimeauth:Af,crypto_onetimeauth_verify:d0,crypto_verify_16:x0,crypto_verify_32:wf,crypto_secretbox:Ef,crypto_secretbox_open:_f,crypto_scalarmult:Ye,crypto_scalarmult_base:Ke,crypto_box_beforenm:$e,crypto_box_afternm:g0,crypto_box:br,crypto_box_open:gr,crypto_box_keypair:b0,crypto_hash:qt,crypto_sign:w0,crypto_sign_keypair:Of,crypto_sign_open:Bf,crypto_secretbox_KEYBYTES:mf,crypto_secretbox_NONCEBYTES:He,crypto_secretbox_ZEROBYTES:de,crypto_secretbox_BOXZEROBYTES:ie,crypto_scalarmult_BYTES:pe,crypto_scalarmult_SCALARBYTES:Ge,crypto_box_PUBLICKEYBYTES:ve,crypto_box_SECRETKEYBYTES:Ae,crypto_box_BEFORENMBYTES:zf,crypto_box_NONCEBYTES:A0,crypto_box_ZEROBYTES:wr,crypto_box_BOXZEROBYTES:vr,crypto_sign_BYTES:Pt,crypto_sign_PUBLICKEYBYTES:Qt,crypto_sign_SECRETKEYBYTES:oe,crypto_sign_SEEDBYTES:Rf,crypto_hash_BYTES:Pf,gf:M,D:c0,L:Fe,pack25519:Wt,unpack25519:Uf,M:W,A:Ft,S:Ct,Z:Ot,pow2523:y0,add:me,set25519:It,modL:Tf,scalarmult:Cf,scalarbase:Ze};function E0(t,f){if(t.length!==mf)throw new Error("bad key size");if(f.length!==He)throw new Error("bad nonce size")}function Ar(t,f){if(t.length!==ve)throw new Error("bad public key size");if(f.length!==Ae)throw new Error("bad secret key size")}function At(){for(var t=0;t<arguments.length;t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Jf(t){for(var f=0;f<t.length;f++)t[f]=0}Y.randomBytes=function(t){var f=new Uint8Array(t);return je(f,t),f};Y.secretbox=function(t,f,r){At(t,f,r),E0(r,f);for(var e=new Uint8Array(de+t.length),n=new Uint8Array(e.length),i=0;i<t.length;i++)e[i+de]=t[i];return Ef(n,e,e.length,f,r),n.subarray(ie)};Y.secretbox.open=function(t,f,r){At(t,f,r),E0(r,f);for(var e=new Uint8Array(ie+t.length),n=new Uint8Array(e.length),i=0;i<t.length;i++)e[i+ie]=t[i];return e.length<32||_f(n,e,e.length,f,r)!==0?null:n.subarray(de)};Y.secretbox.keyLength=mf;Y.secretbox.nonceLength=He;Y.secretbox.overheadLength=ie;Y.scalarMult=function(t,f){if(At(t,f),t.length!==Ge)throw new Error("bad n size");if(f.length!==pe)throw new Error("bad p size");var r=new Uint8Array(pe);return Ye(r,t,f),r};Y.scalarMult.base=function(t){if(At(t),t.length!==Ge)throw new Error("bad n size");var f=new Uint8Array(pe);return Ke(f,t),f};Y.scalarMult.scalarLength=Ge;Y.scalarMult.groupElementLength=pe;Y.box=function(t,f,r,e){var n=Y.box.before(r,e);return Y.secretbox(t,f,n)};Y.box.before=function(t,f){At(t,f),Ar(t,f);var r=new Uint8Array(zf);return $e(r,t,f),r};Y.box.after=Y.secretbox;Y.box.open=function(t,f,r,e){var n=Y.box.before(r,e);return Y.secretbox.open(t,f,n)};Y.box.open.after=Y.secretbox.open;Y.box.keyPair=function(){var t=new Uint8Array(ve),f=new Uint8Array(Ae);return b0(t,f),{publicKey:t,secretKey:f}};Y.box.keyPair.fromSecretKey=function(t){if(At(t),t.length!==Ae)throw new Error("bad secret key size");var f=new Uint8Array(ve);return Ke(f,t),{publicKey:f,secretKey:new Uint8Array(t)}};Y.box.publicKeyLength=ve;Y.box.secretKeyLength=Ae;Y.box.sharedKeyLength=zf;Y.box.nonceLength=A0;Y.box.overheadLength=Y.secretbox.overheadLength;Y.sign=function(t,f){if(At(t,f),f.length!==oe)throw new Error("bad secret key size");var r=new Uint8Array(Pt+t.length);return w0(r,t,t.length,f),r};Y.sign.open=function(t,f){if(At(t,f),f.length!==Qt)throw new Error("bad public key size");var r=new Uint8Array(t.length),e=Bf(r,t,t.length,f);if(e<0)return null;for(var n=new Uint8Array(e),i=0;i<n.length;i++)n[i]=r[i];return n};Y.sign.detached=function(t,f){for(var r=Y.sign(t,f),e=new Uint8Array(Pt),n=0;n<e.length;n++)e[n]=r[n];return e};Y.sign.detached.verify=function(t,f,r){if(At(t,f,r),f.length!==Pt)throw new Error("bad signature size");if(r.length!==Qt)throw new Error("bad public key size");var e=new Uint8Array(Pt+t.length),n=new Uint8Array(Pt+t.length),i;for(i=0;i<Pt;i++)e[i]=f[i];for(i=0;i<t.length;i++)e[i+Pt]=t[i];return Bf(n,e,e.length,r)>=0};Y.sign.keyPair=function(){var t=new Uint8Array(Qt),f=new Uint8Array(oe);return Of(t,f),{publicKey:t,secretKey:f}};Y.sign.keyPair.fromSecretKey=function(t){if(At(t),t.length!==oe)throw new Error("bad secret key size");for(var f=new Uint8Array(Qt),r=0;r<f.length;r++)f[r]=t[32+r];return{publicKey:f,secretKey:new Uint8Array(t)}};Y.sign.keyPair.fromSeed=function(t){if(At(t),t.length!==Rf)throw new Error("bad seed size");for(var f=new Uint8Array(Qt),r=new Uint8Array(oe),e=0;e<32;e++)r[e]=t[e];return Of(f,r,!0),{publicKey:f,secretKey:r}};Y.sign.publicKeyLength=Qt;Y.sign.secretKeyLength=oe;Y.sign.seedLength=Rf;Y.sign.signatureLength=Pt;Y.hash=function(t){At(t);var f=new Uint8Array(Pf);return qt(f,t,t.length),f};Y.hash.hashLength=Pf;Y.verify=function(t,f){return At(t,f),t.length===0||f.length===0||t.length!==f.length?!1:gf(t,0,f,0,t.length)===0};Y.setPRNG=function(t){je=t};(function(){var t=typeof self<"u"?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){var f=65536;Y.setPRNG(function(r,e){var n,i=new Uint8Array(e);for(n=0;n<e;n+=f)t.getRandomValues(i.subarray(n,n+Math.min(e-n,f)));for(n=0;n<e;n++)r[n]=i[n];Jf(i)})}else typeof require<"u"&&(t=require("crypto"),t&&t.randomBytes&&Y.setPRNG(function(r,e){var n,i=t.randomBytes(e);for(n=0;n<e;n++)r[n]=i[n];Jf(i)}))})();function _0(t){var f=new U