UNPKG

@web3auth/auth-adapter

Version:
2 lines 730 kB
/*! For license information please see authAdapter.umd.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AuthAdapter=t():e.AuthAdapter=t()}(self,(()=>(()=>{var e={3131:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function n(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}Object.defineProperty(t,"__esModule",{value:!0}),t.anumber=r,t.abytes=n,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)},t.aexists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},t.aoutput=function(e,t){n(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}},3972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashMD=void 0,t.setBigUint64=a,t.Chi=function(e,t,r){return e&t^~e&r},t.Maj=function(e,t,r){return e&t^e&r^t&r};const n=r(3131),i=r(9369);function a(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),a=BigInt(4294967295),o=Number(r>>i&a),s=Number(r&a),c=n?4:0,f=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+f,s,n)}class o extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){(0,n.aexists)(this);const{view:t,buffer:r,blockLen:a}=this,o=(e=(0,i.toBytes)(e)).length;for(let n=0;n<o;){const s=Math.min(a-this.pos,o-n);if(s!==a)r.set(e.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===a&&(this.process(t,0),this.pos=0);else{const t=(0,i.createView)(e);for(;a<=o-n;n+=a)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.aexists)(this),(0,n.aoutput)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:s}=this;let{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(r,0),c=0);for(let e=c;e<o;e++)t[e]=0;a(r,o-8,BigInt(8*this.length),s),this.process(r,0);const f=(0,i.createView)(e),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=d/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<u;e++)f.setUint32(4*e,l[e],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:a,pos:o}=this;return e.length=n,e.pos=o,e.finished=i,e.destroyed=a,n%t&&e.buffer.set(r),e}}t.HashMD=o},5800:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=void 0,t.fromBig=i,t.split=a,t.add=w;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function a(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let a=0;a<e.length;a++){const{h:o,l:s}=i(e[a],t);[r[a],n[a]]=[o,s]}return[r,n]}const o=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=o;const s=(e,t,r)=>e>>>r;t.shrSH=s;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const f=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=f;const d=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=d;const u=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=u;const l=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=l;const h=(e,t)=>t;t.rotr32H=h;const b=(e,t)=>e;t.rotr32L=b;const p=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=p;const g=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=g;const y=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=y;const m=(e,t,r)=>e<<r-32|t>>>64-r;function w(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.rotlBL=m;const v=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=v;const E=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=E;const S=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=S;const _=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;t.add4H=_;const A=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);t.add5L=A;const x=(e,t,r,n,i,a)=>t+r+n+i+a+(e/2**32|0)|0;t.add5H=x;const M={fromBig:i,split:a,toBig:o,shrSH:s,shrSL:c,rotrSH:f,rotrSL:d,rotrBH:u,rotrBL:l,rotr32H:h,rotr32L:b,rotlSH:p,rotlSL:g,rotlBH:y,rotlBL:m,add:w,add3L:v,add3H:E,add4L:S,add4H:_,add5H:x,add5L:A};t.default=M},6527:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},9973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const n=r(3131),i=r(9369);class a extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.ahash)(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const a=this.blockLen,o=new Uint8Array(a);o.set(r.length>a?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),o.fill(0)}update(e){return(0,n.aexists)(this),this.iHash.update(e),this}digestInto(e){(0,n.aexists)(this),(0,n.abytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:a,outputLen:o}=this;return e.finished=n,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=a,t.hmac=(e,t,r)=>new a(e,t).update(r).digest(),t.hmac.create=(e,t)=>new a(e,t)},1919:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2=function(e,t,r,n){const{c:i,dkLen:c,DK:f,PRF:d,PRFSalt:u}=o(e,t,r,n);let l;const h=new Uint8Array(4),b=(0,a.createView)(h),p=new Uint8Array(d.outputLen);for(let e=1,t=0;t<c;e++,t+=d.outputLen){const r=f.subarray(t,t+d.outputLen);b.setInt32(0,e,!1),(l=u._cloneInto(l)).update(h).digestInto(p),r.set(p.subarray(0,r.length));for(let e=1;e<i;e++){d._cloneInto(l).update(p).digestInto(p);for(let e=0;e<r.length;e++)r[e]^=p[e]}}return s(d,u,f,l,p)},t.pbkdf2Async=async function(e,t,r,n){const{c:i,dkLen:c,asyncTick:f,DK:d,PRF:u,PRFSalt:l}=o(e,t,r,n);let h;const b=new Uint8Array(4),p=(0,a.createView)(b),g=new Uint8Array(u.outputLen);for(let e=1,t=0;t<c;e++,t+=u.outputLen){const r=d.subarray(t,t+u.outputLen);p.setInt32(0,e,!1),(h=l._cloneInto(h)).update(b).digestInto(g),r.set(g.subarray(0,r.length)),await(0,a.asyncLoop)(i-1,f,(()=>{u._cloneInto(h).update(g).digestInto(g);for(let e=0;e<r.length;e++)r[e]^=g[e]}))}return s(u,l,d,h,g)};const n=r(3131),i=r(9973),a=r(9369);function o(e,t,r,o){(0,n.ahash)(e);const s=(0,a.checkOpts)({dkLen:32,asyncTick:10},o),{c,dkLen:f,asyncTick:d}=s;if((0,n.anumber)(c),(0,n.anumber)(f),(0,n.anumber)(d),c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const u=(0,a.toBytes)(t),l=(0,a.toBytes)(r),h=new Uint8Array(f),b=i.hmac.create(e,u),p=b._cloneInto().update(l);return{c,dkLen:f,asyncTick:d,DK:h,PRF:b,PRFSalt:p}}function s(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}},3741:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=t.SHA256=void 0;const n=r(3972),i=r(9369),a=new Uint32Array([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]),o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint32Array(64);class c extends n.HashMD{constructor(){super(64,32,8,!1),this.A=0|o[0],this.B=0|o[1],this.C=0|o[2],this.D=0|o[3],this.E=0|o[4],this.F=0|o[5],this.G=0|o[6],this.H=0|o[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:a,G:o,H:s}=this;return[e,t,r,n,i,a,o,s]}set(e,t,r,n,i,a,o,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|a,this.G=0|o,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)s[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=s[e-15],r=s[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,a=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;s[e]=a+s[e-7]+n+s[e-16]|0}let{A:r,B:o,C:c,D:f,E:d,F:u,G:l,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,i.rotr)(d,6)^(0,i.rotr)(d,11)^(0,i.rotr)(d,25))+(0,n.Chi)(d,u,l)+a[e]+s[e]|0,b=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+(0,n.Maj)(r,o,c)|0;h=l,l=u,u=d,d=f+t|0,f=c,c=o,o=r,r=t+b|0}r=r+this.A|0,o=o+this.B|0,c=c+this.C|0,f=f+this.D|0,d=d+this.E|0,u=u+this.F|0,l=l+this.G|0,h=h+this.H|0,this.set(r,o,c,f,d,u,l,h)}roundClean(){s.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.SHA256=c;class f extends c{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)((()=>new c)),t.sha224=(0,i.wrapConstructor)((()=>new f))},9224:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA384=t.SHA512_256=t.SHA512_224=t.SHA512=void 0;const n=r(3972),i=r(5800),a=r(9369),[o,s]=(()=>i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),c=new Uint32Array(80),f=new Uint32Array(80);class d extends n.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:f,Fh:d,Fl:u,Gh:l,Gl:h,Hh:b,Hl:p}=this;return[e,t,r,n,i,a,o,s,c,f,d,u,l,h,b,p]}set(e,t,r,n,i,a,o,s,c,f,d,u,l,h,b,p){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|a,this.Dh=0|o,this.Dl=0|s,this.Eh=0|c,this.El=0|f,this.Fh=0|d,this.Fl=0|u,this.Gh=0|l,this.Gl=0|h,this.Hh=0|b,this.Hl=0|p}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t),f[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],r=0|f[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),a=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),o=0|c[e-2],s=0|f[e-2],d=i.default.rotrSH(o,s,19)^i.default.rotrBH(o,s,61)^i.default.shrSH(o,s,6),u=i.default.rotrSL(o,s,19)^i.default.rotrBL(o,s,61)^i.default.shrSL(o,s,6),l=i.default.add4L(a,u,f[e-7],f[e-16]),h=i.default.add4H(l,n,d,c[e-7],c[e-16]);c[e]=0|h,f[e]=0|l}let{Ah:r,Al:n,Bh:a,Bl:d,Ch:u,Cl:l,Dh:h,Dl:b,Eh:p,El:g,Fh:y,Fl:m,Gh:w,Gl:v,Hh:E,Hl:S}=this;for(let e=0;e<80;e++){const t=i.default.rotrSH(p,g,14)^i.default.rotrSH(p,g,18)^i.default.rotrBH(p,g,41),_=i.default.rotrSL(p,g,14)^i.default.rotrSL(p,g,18)^i.default.rotrBL(p,g,41),A=p&y^~p&w,x=g&m^~g&v,M=i.default.add5L(S,_,x,s[e],f[e]),I=i.default.add5H(M,E,t,A,o[e],c[e]),k=0|M,O=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),R=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),B=r&a^r&u^a&u,N=n&d^n&l^d&l;E=0|w,S=0|v,w=0|y,v=0|m,y=0|p,m=0|g,({h:p,l:g}=i.default.add(0|h,0|b,0|I,0|k)),h=0|u,b=0|l,u=0|a,l=0|d,a=0|r,d=0|n;const P=i.default.add3L(k,R,N);r=i.default.add3H(P,I,O,B),n=0|P}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:a,l:d}=i.default.add(0|this.Bh,0|this.Bl,0|a,0|d)),({h:u,l}=i.default.add(0|this.Ch,0|this.Cl,0|u,0|l)),({h,l:b}=i.default.add(0|this.Dh,0|this.Dl,0|h,0|b)),({h:p,l:g}=i.default.add(0|this.Eh,0|this.El,0|p,0|g)),({h:y,l:m}=i.default.add(0|this.Fh,0|this.Fl,0|y,0|m)),({h:w,l:v}=i.default.add(0|this.Gh,0|this.Gl,0|w,0|v)),({h:E,l:S}=i.default.add(0|this.Hh,0|this.Hl,0|E,0|S)),this.set(r,n,a,d,u,l,h,b,p,g,y,m,w,v,E,S)}roundClean(){c.fill(0),f.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=d;class u extends d{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}t.SHA512_224=u;class l extends d{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}t.SHA512_256=l;class h extends d{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.SHA384=h,t.sha512=(0,a.wrapConstructor)((()=>new d)),t.sha512_224=(0,a.wrapConstructor)((()=>new u)),t.sha512_256=(0,a.wrapConstructor)((()=>new l)),t.sha384=(0,a.wrapConstructor)((()=>new h))},9369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},t.rotr=function(e,t){return e<<32-t|e>>>t},t.rotl=function(e,t){return e<<t|e>>>32-t>>>0},t.byteSwap=a,t.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=a(e[t])},t.bytesToHex=function(e){(0,i.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=c(e.charCodeAt(i)),a=c(e.charCodeAt(i+1));if(void 0===r||void 0===a){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+a}return n},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let a=0;a<e;a++){n(a);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=f,t.toBytes=d,t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];(0,i.abytes)(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(d(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(d(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(d(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return n.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const n=r(6527),i=r(3131);function a(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.byteSwapIfBE=t.isLE?e=>e:e=>a(e);const o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0"))),s={_0:48,_9:57,A:65,F:70,a:97,f:102};function c(e){return e>=s._0&&e<=s._9?e-s._0:e>=s.A&&e<=s.F?e-(s.A-10):e>=s.a&&e<=s.f?e-(s.a-10):void 0}function f(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function d(e){return"string"==typeof e&&(e=f(e)),(0,i.abytes)(e),e}t.nextTick=async()=>{},t.Hash=class{clone(){return this._cloneInto()}}},6881:(e,t,r)=>{!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var o=t(),s=t([1]),c=t([56129,1]),f=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),d=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function b(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function p(e,t,r,n,i){var a,o=0;for(a=0;a<i;a++)o|=e[t+a]^r[n+a];return(1&o-1>>>8)-1}function g(e,t,r,n){return p(e,t,r,n,16)}function y(e,t,r,n){return p(e,t,r,n,32)}function m(e,t,r,n){!function(e,t,r,n){for(var i,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,f=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,d=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,w=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,v=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=a,S=o,_=s,A=c,x=f,M=d,I=u,k=l,O=h,R=b,B=p,N=g,P=y,T=m,L=w,j=v,C=0;C<20;C+=2)E^=(i=(P^=(i=(O^=(i=(x^=(i=E+P|0)<<7|i>>>25)+E|0)<<9|i>>>23)+x|0)<<13|i>>>19)+O|0)<<18|i>>>14,M^=(i=(S^=(i=(T^=(i=(R^=(i=M+S|0)<<7|i>>>25)+M|0)<<9|i>>>23)+R|0)<<13|i>>>19)+T|0)<<18|i>>>14,B^=(i=(I^=(i=(_^=(i=(L^=(i=B+I|0)<<7|i>>>25)+B|0)<<9|i>>>23)+L|0)<<13|i>>>19)+_|0)<<18|i>>>14,j^=(i=(N^=(i=(k^=(i=(A^=(i=j+N|0)<<7|i>>>25)+j|0)<<9|i>>>23)+A|0)<<13|i>>>19)+k|0)<<18|i>>>14,E^=(i=(A^=(i=(_^=(i=(S^=(i=E+A|0)<<7|i>>>25)+E|0)<<9|i>>>23)+S|0)<<13|i>>>19)+_|0)<<18|i>>>14,M^=(i=(x^=(i=(k^=(i=(I^=(i=M+x|0)<<7|i>>>25)+M|0)<<9|i>>>23)+I|0)<<13|i>>>19)+k|0)<<18|i>>>14,B^=(i=(R^=(i=(O^=(i=(N^=(i=B+R|0)<<7|i>>>25)+B|0)<<9|i>>>23)+N|0)<<13|i>>>19)+O|0)<<18|i>>>14,j^=(i=(L^=(i=(T^=(i=(P^=(i=j+L|0)<<7|i>>>25)+j|0)<<9|i>>>23)+P|0)<<13|i>>>19)+T|0)<<18|i>>>14;E=E+a|0,S=S+o|0,_=_+s|0,A=A+c|0,x=x+f|0,M=M+d|0,I=I+u|0,k=k+l|0,O=O+h|0,R=R+b|0,B=B+p|0,N=N+g|0,P=P+y|0,T=T+m|0,L=L+w|0,j=j+v|0,e[0]=E>>>0&255,e[1]=E>>>8&255,e[2]=E>>>16&255,e[3]=E>>>24&255,e[4]=S>>>0&255,e[5]=S>>>8&255,e[6]=S>>>16&255,e[7]=S>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=A>>>0&255,e[13]=A>>>8&255,e[14]=A>>>16&255,e[15]=A>>>24&255,e[16]=x>>>0&255,e[17]=x>>>8&255,e[18]=x>>>16&255,e[19]=x>>>24&255,e[20]=M>>>0&255,e[21]=M>>>8&255,e[22]=M>>>16&255,e[23]=M>>>24&255,e[24]=I>>>0&255,e[25]=I>>>8&255,e[26]=I>>>16&255,e[27]=I>>>24&255,e[28]=k>>>0&255,e[29]=k>>>8&255,e[30]=k>>>16&255,e[31]=k>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=R>>>0&255,e[37]=R>>>8&255,e[38]=R>>>16&255,e[39]=R>>>24&255,e[40]=B>>>0&255,e[41]=B>>>8&255,e[42]=B>>>16&255,e[43]=B>>>24&255,e[44]=N>>>0&255,e[45]=N>>>8&255,e[46]=N>>>16&255,e[47]=N>>>24&255,e[48]=P>>>0&255,e[49]=P>>>8&255,e[50]=P>>>16&255,e[51]=P>>>24&255,e[52]=T>>>0&255,e[53]=T>>>8&255,e[54]=T>>>16&255,e[55]=T>>>24&255,e[56]=L>>>0&255,e[57]=L>>>8&255,e[58]=L>>>16&255,e[59]=L>>>24&255,e[60]=j>>>0&255,e[61]=j>>>8&255,e[62]=j>>>16&255,e[63]=j>>>24&255}(e,t,r,n)}function w(e,t,r,n){!function(e,t,r,n){for(var i,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,f=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,d=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,w=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,v=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=0;E<20;E+=2)a^=(i=(y^=(i=(h^=(i=(f^=(i=a+y|0)<<7|i>>>25)+a|0)<<9|i>>>23)+f|0)<<13|i>>>19)+h|0)<<18|i>>>14,d^=(i=(o^=(i=(m^=(i=(b^=(i=d+o|0)<<7|i>>>25)+d|0)<<9|i>>>23)+b|0)<<13|i>>>19)+m|0)<<18|i>>>14,p^=(i=(u^=(i=(s^=(i=(w^=(i=p+u|0)<<7|i>>>25)+p|0)<<9|i>>>23)+w|0)<<13|i>>>19)+s|0)<<18|i>>>14,v^=(i=(g^=(i=(l^=(i=(c^=(i=v+g|0)<<7|i>>>25)+v|0)<<9|i>>>23)+c|0)<<13|i>>>19)+l|0)<<18|i>>>14,a^=(i=(c^=(i=(s^=(i=(o^=(i=a+c|0)<<7|i>>>25)+a|0)<<9|i>>>23)+o|0)<<13|i>>>19)+s|0)<<18|i>>>14,d^=(i=(f^=(i=(l^=(i=(u^=(i=d+f|0)<<7|i>>>25)+d|0)<<9|i>>>23)+u|0)<<13|i>>>19)+l|0)<<18|i>>>14,p^=(i=(b^=(i=(h^=(i=(g^=(i=p+b|0)<<7|i>>>25)+p|0)<<9|i>>>23)+g|0)<<13|i>>>19)+h|0)<<18|i>>>14,v^=(i=(w^=(i=(m^=(i=(y^=(i=v+w|0)<<7|i>>>25)+v|0)<<9|i>>>23)+y|0)<<13|i>>>19)+m|0)<<18|i>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=d>>>0&255,e[5]=d>>>8&255,e[6]=d>>>16&255,e[7]=d>>>24&255,e[8]=p>>>0&255,e[9]=p>>>8&255,e[10]=p>>>16&255,e[11]=p>>>24&255,e[12]=v>>>0&255,e[13]=v>>>8&255,e[14]=v>>>16&255,e[15]=v>>>24&255,e[16]=u>>>0&255,e[17]=u>>>8&255,e[18]=u>>>16&255,e[19]=u>>>24&255,e[20]=l>>>0&255,e[21]=l>>>8&255,e[22]=l>>>16&255,e[23]=l>>>24&255,e[24]=h>>>0&255,e[25]=h>>>8&255,e[26]=h>>>16&255,e[27]=h>>>24&255,e[28]=b>>>0&255,e[29]=b>>>8&255,e[30]=b>>>16&255,e[31]=b>>>24&255}(e,t,r,n)}var v=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function E(e,t,r,n,i,a,o){var s,c,f=new Uint8Array(16),d=new Uint8Array(64);for(c=0;c<16;c++)f[c]=0;for(c=0;c<8;c++)f[c]=a[c];for(;i>=64;){for(m(d,f,o,v),c=0;c<64;c++)e[t+c]=r[n+c]^d[c];for(s=1,c=8;c<16;c++)s=s+(255&f[c])|0,f[c]=255&s,s>>>=8;i-=64,t+=64,n+=64}if(i>0)for(m(d,f,o,v),c=0;c<i;c++)e[t+c]=r[n+c]^d[c];return 0}function S(e,t,r,n,i){var a,o,s=new Uint8Array(16),c=new Uint8Array(64);for(o=0;o<16;o++)s[o]=0;for(o=0;o<8;o++)s[o]=n[o];for(;r>=64;){for(m(c,s,i,v),o=0;o<64;o++)e[t+o]=c[o];for(a=1,o=8;o<16;o++)a=a+(255&s[o])|0,s[o]=255&a,a>>>=8;r-=64,t+=64}if(r>0)for(m(c,s,i,v),o=0;o<r;o++)e[t+o]=c[o];return 0}function _(e,t,r,n,i){var a=new Uint8Array(32);w(a,n,i,v);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=n[s+16];return S(e,t,r,o,a)}function A(e,t,r,n,i,a,o){var s=new Uint8Array(32);w(s,a,o,v);for(var c=new Uint8Array(8),f=0;f<8;f++)c[f]=a[f+16];return E(e,t,r,n,i,c,s)}var x=function(e){var t,r,n,i,a,o,s,c;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,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function M(e,t,r,n,i,a){var o=new x(a);return o.update(r,n,i),o.finish(e,t),0}function I(e,t,r,n,i,a){var o=new Uint8Array(16);return M(o,0,r,n,i,a),g(e,t,o,0)}function k(e,t,r,n,i){var a;if(r<32)return-1;for(A(e,0,t,0,r,n,i),M(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,n,i){var a,o=new Uint8Array(32);if(r<32)return-1;if(_(o,0,32,n,i),0!==I(t,16,t,32,r-32,o))return-1;for(A(e,0,t,0,r,n,i),a=0;a<32;a++)e[a]=0;return 0}function R(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function N(e,t,r){for(var n,i=~(r-1),a=0;a<16;a++)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function P(e,r){var n,i,a,o=t(),s=t();for(n=0;n<16;n++)s[n]=r[n];for(B(s),B(s),B(s),i=0;i<2;i++){for(o[0]=s[0]-65517,n=1;n<15;n++)o[n]=s[n]-65535-(o[n-1]>>16&1),o[n-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,N(s,o,1-a)}for(n=0;n<16;n++)e[2*n]=255&s[n],e[2*n+1]=s[n]>>8}function T(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return P(r,e),P(n,t),y(r,0,n,0)}function L(e){var t=new Uint8Array(32);return P(t,e),1&t[0]}function j(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function C(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function U(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function F(e,t,r){var n,i,a=0,o=0,s=0,c=0,f=0,d=0,u=0,l=0,h=0,b=0,p=0,g=0,y=0,m=0,w=0,v=0,E=0,S=0,_=0,A=0,x=0,M=0,I=0,k=0,O=0,R=0,B=0,N=0,P=0,T=0,L=0,j=r[0],C=r[1],U=r[2],F=r[3],q=r[4],D=r[5],H=r[6],z=r[7],$=r[8],K=r[9],W=r[10],V=r[11],G=r[12],Y=r[13],J=r[14],Z=r[15];a+=(n=t[0])*j,o+=n*C,s+=n*U,c+=n*F,f+=n*q,d+=n*D,u+=n*H,l+=n*z,h+=n*$,b+=n*K,p+=n*W,g+=n*V,y+=n*G,m+=n*Y,w+=n*J,v+=n*Z,o+=(n=t[1])*j,s+=n*C,c+=n*U,f+=n*F,d+=n*q,u+=n*D,l+=n*H,h+=n*z,b+=n*$,p+=n*K,g+=n*W,y+=n*V,m+=n*G,w+=n*Y,v+=n*J,E+=n*Z,s+=(n=t[2])*j,c+=n*C,f+=n*U,d+=n*F,u+=n*q,l+=n*D,h+=n*H,b+=n*z,p+=n*$,g+=n*K,y+=n*W,m+=n*V,w+=n*G,v+=n*Y,E+=n*J,S+=n*Z,c+=(n=t[3])*j,f+=n*C,d+=n*U,u+=n*F,l+=n*q,h+=n*D,b+=n*H,p+=n*z,g+=n*$,y+=n*K,m+=n*W,w+=n*V,v+=n*G,E+=n*Y,S+=n*J,_+=n*Z,f+=(n=t[4])*j,d+=n*C,u+=n*U,l+=n*F,h+=n*q,b+=n*D,p+=n*H,g+=n*z,y+=n*$,m+=n*K,w+=n*W,v+=n*V,E+=n*G,S+=n*Y,_+=n*J,A+=n*Z,d+=(n=t[5])*j,u+=n*C,l+=n*U,h+=n*F,b+=n*q,p+=n*D,g+=n*H,y+=n*z,m+=n*$,w+=n*K,v+=n*W,E+=n*V,S+=n*G,_+=n*Y,A+=n*J,x+=n*Z,u+=(n=t[6])*j,l+=n*C,h+=n*U,b+=n*F,p+=n*q,g+=n*D,y+=n*H,m+=n*z,w+=n*$,v+=n*K,E+=n*W,S+=n*V,_+=n*G,A+=n*Y,x+=n*J,M+=n*Z,l+=(n=t[7])*j,h+=n*C,b+=n*U,p+=n*F,g+=n*q,y+=n*D,m+=n*H,w+=n*z,v+=n*$,E+=n*K,S+=n*W,_+=n*V,A+=n*G,x+=n*Y,M+=n*J,I+=n*Z,h+=(n=t[8])*j,b+=n*C,p+=n*U,g+=n*F,y+=n*q,m+=n*D,w+=n*H,v+=n*z,E+=n*$,S+=n*K,_+=n*W,A+=n*V,x+=n*G,M+=n*Y,I+=n*J,k+=n*Z,b+=(n=t[9])*j,p+=n*C,g+=n*U,y+=n*F,m+=n*q,w+=n*D,v+=n*H,E+=n*z,S+=n*$,_+=n*K,A+=n*W,x+=n*V,M+=n*G,I+=n*Y,k+=n*J,O+=n*Z,p+=(n=t[10])*j,g+=n*C,y+=n*U,m+=n*F,w+=n*q,v+=n*D,E+=n*H,S+=n*z,_+=n*$,A+=n*K,x+=n*W,M+=n*V,I+=n*G,k+=n*Y,O+=n*J,R+=n*Z,g+=(n=t[11])*j,y+=n*C,m+=n*U,w+=n*F,v+=n*q,E+=n*D,S+=n*H,_+=n*z,A+=n*$,x+=n*K,M+=n*W,I+=n*V,k+=n*G,O+=n*Y,R+=n*J,B+=n*Z,y+=(n=t[12])*j,m+=n*C,w+=n*U,v+=n*F,E+=n*q,S+=n*D,_+=n*H,A+=n*z,x+=n*$,M+=n*K,I+=n*W,k+=n*V,O+=n*G,R+=n*Y,B+=n*J,N+=n*Z,m+=(n=t[13])*j,w+=n*C,v+=n*U,E+=n*F,S+=n*q,_+=n*D,A+=n*H,x+=n*z,M+=n*$,I+=n*K,k+=n*W,O+=n*V,R+=n*G,B+=n*Y,N+=n*J,P+=n*Z,w+=(n=t[14])*j,v+=n*C,E+=n*U,S+=n*F,_+=n*q,A+=n*D,x+=n*H,M+=n*z,I+=n*$,k+=n*K,O+=n*W,R+=n*V,B+=n*G,N+=n*Y,P+=n*J,T+=n*Z,v+=(n=t[15])*j,o+=38*(S+=n*U),s+=38*(_+=n*F),c+=38*(A+=n*q),f+=38*(x+=n*D),d+=38*(M+=n*H),u+=38*(I+=n*z),l+=38*(k+=n*$),h+=38*(O+=n*K),b+=38*(R+=n*W),p+=38*(B+=n*V),g+=38*(N+=n*G),y+=38*(P+=n*Y),m+=38*(T+=n*J),w+=38*(L+=n*Z),a=(n=(a+=38*(E+=n*C))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=f,e[5]=d,e[6]=u,e[7]=l,e[8]=h,e[9]=b,e[10]=p,e[11]=g,e[12]=y,e[13]=m,e[14]=w,e[15]=v}function q(e,t){F(e,t,t)}function D(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)q(i,i),2!==n&&4!==n&&F(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function H(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)q(i,i),1!==n&&F(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function z(e,r,n){var i,a,o=new Uint8Array(32),s=new Float64Array(80),f=t(),d=t(),u=t(),l=t(),h=t(),b=t();for(a=0;a<31;a++)o[a]=r[a];for(o[31]=127&r[31]|64,o[0]&=248,j(s,n),a=0;a<16;a++)d[a]=s[a],l[a]=f[a]=u[a]=0;for(f[0]=l[0]=1,a=254;a>=0;--a)N(f,d,i=o[a>>>3]>>>(7&a)&1),N(u,l,i),C(h,f,u),U(f,f,u),C(u,d,l),U(d,d,l),q(l,h),q(b,f),F(f,u,f),F(u,d,h),C(h,f,u),U(f,f,u),q(d,f),U(u,l,b),F(f,u,c),C(f,f,l),F(u,u,f),F(f,l,b),F(l,d,s),q(d,h),N(f,d,i),N(u,l,i);for(a=0;a<16;a++)s[a+16]=f[a],s[a+32]=u[a],s[a+48]=d[a],s[a+64]=l[a];var p=s.subarray(32),g=s.subarray(16);return D(p,p),F(g,g,p),P(e,g),0}function $(e,t){return z(e,t,a)}function K(e,t){return n(t,32),$(e,t)}function W(e,t,r){var n=new Uint8Array(32);return z(n,r,t),w(e,i,n,v)}x.prototype.blocks=function(e,t,r){for(var n,i,a,o,s,c,f,d,u,l,h,b,p,g,y,m,w,v,E,S=this.fin?0:2048,_=this.h[0],A=this.h[1],x=this.h[2],M=this.h[3],I=this.h[4],k=this.h[5],O=this.h[6],R=this.h[7],B=this.h[8],N=this.h[9],P=this.r[0],T=this.r[1],L=this.r[2],j=this.r[3],C=this.r[4],U=this.r[5],F=this.r[6],q=this.r[7],D=this.r[8],H=this.r[9];r>=16;)l=u=0,l+=(_+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*P,l+=(A+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*H),l+=(x+=8191&(i>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*D),l+=(M+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),u=(l+=(I+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*F))>>>13,l&=8191,l+=(k+=s>>>1&8191)*(5*U),l+=(O+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*C),l+=(R+=8191&(c>>>11|(f=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*j),l+=(B+=8191&(f>>>8|(d=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*L),h=u+=(l+=(N+=d>>>5|S)*(5*T))>>>13,h+=_*T,h+=A*P,h+=x*(5*H),h+=M*(5*D),u=(h+=I*(5*q))>>>13,h&=8191,h+=k*(5*F),h+=O*(5*U),h+=R*(5*C),h+=B*(5*j),u+=(h+=N*(5*L))>>>13,h&=8191,b=u,b+=_*L,b+=A*T,b+=x*P,b+=M*(5*H),u=(b+=I*(5*D))>>>13,b&=8191,b+=k*(5*q),b+=O*(5*F),b+=R*(5*U),b+=B*(5*C),p=u+=(b+=N*(5*j))>>>13,p+=_*j,p+=A*L,p+=x*T,p+=M*P,u=(p+=I*(5*H))>>>13,p&=8191,p+=k*(5*D),p+=O*(5*q),p+=R*(5*F),p+=B*(5*U),g=u+=(p+=N*(5*C))>>>13,g+=_*C,g+=A*j,g+=x*L,g+=M*T,u=(g+=I*P)>>>13,g&=8191,g+=k*(5*H),g+=O*(5*D),g+=R*(5*q),g+=B*(5*F),y=u+=(g+=N*(5*U))>>>13,y+=_*U,y+=A*C,y+=x*j,y+=M*L,u=(y+=I*T)>>>13,y&=8191,y+=k*P,y+=O*(5*H),y+=R*(5*D),y+=B*(5*q),m=u+=(y+=N*(5*F))>>>13,m+=_*F,m+=A*U,m+=x*C,m+=M*j,u=(m+=I*L)>>>13,m&=8191,m+=k*T,m+=O*P,m+=R*(5*H),m+=B*(5*D),w=u+=(m+=N*(5*q))>>>13,w+=_*q,w+=A*F,w+=x*U,w+=M*C,u=(w+=I*j)>>>13,w&=8191,w+=k*L,w+=O*T,w+=R*P,w+=B*(5*H),v=u+=(w+=N*(5*D))>>>13,v+=_*D,v+=A*q,v+=x*F,v+=M*U,u=(v+=I*C)>>>13,v&=8191,v+=k*j,v+=O*L,v+=R*T,v+=B*P,E=u+=(v+=N*(5*H))>>>13,E+=_*H,E+=A*D,E+=x*q,E+=M*F,u=(E+=I*U)>>>13,E&=8191,E+=k*C,E+=O*j,E+=R*L,E+=B*T,_=l=8191&(u=(u=((u+=(E+=N*P)>>>13)<<2)+u|0)+(l&=8191)|0),A=h+=u>>>=13,x=b&=8191,M=p&=8191,I=g&=8191,k=y&=8191,O=m&=8191,R=w&=8191,B=v&=8191,N=E&=8191,t+=16,r-=16;this.h[0]=_,this.h[1]=A,this.h[2]=x,this.h[3]=M,this.h[4]=I,this.h[5]=k,this.h[6]=O,this.h[7]=R,this.h[8]=B,this.h[9]=N},x.prototype.finish=function(e,t){var r,n,i,a,o=new Uint16Array(10);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(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,n=(1^r)-1,a=0;a<10;a++)o[a]&=n;for(n=~n,a=0;a<10;a++)this.h[a]=this.h[a]&n|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,a=1;a<8;a++)i=(this.h[a]+this.pad[a]|0)+(i>>>16)|0,this.h[a]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},x.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var V=k,G=O,Y=[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 J(e,t,r,n){for(var i,a,o,s,c,f,d,u,l,h,b,p,g,y,m,w,v,E,S,_,A,x,M,I,k,O,R=new Int32Array(16),B=new Int32Array(16),N=e[0],P=e[1],T=e[2],L=e[3],j=e[4],C=e[5],U=e[6],F=e[7],q=t[0],D=t[1],H=t[2],z=t[3],$=t[4],K=t[5],W=t[6],V=t[7],G=0;n>=128;){for(S=0;S<16;S++)_=8*S+G,R[S]=r[_+0]<<24|r[_+1]<<16|r[_+2]<<8|r[_+3],B[S]=r[_+4]<<24|r[_+5]<<16|r[_+6]<<8|r[_+7];for(S=0;S<80;S++)if(i=N,a=P,o=T,s=L,c=j,f=C,d=U,l=q,h=D,b=H,p=z,g=$,y=K,m=W,M=65535&(x=V),I=x>>>16,k=65535&(A=F),O=A>>>16,M+=65535&(x=($>>>14|j<<18)^($>>>18|j<<14)^(j>>>9|$<<23)),I+=x>>>16,k+=65535&(A=(j>>>14|$<<18)^(j>>>18|$<<14)^($>>>9|j<<23)),O+=A>>>16,M+=65535&(x=$&K^~$&W),I+=x>>>16,k+=65535&(A=j&C^~j&U),O+=A>>>16,A=Y[2*S],M+=65535&(x=Y[2*S+1]),I+=x>>>16,k+=65535&A,O+=A>>>16,A=R[S%16],I+=(x=B[S%16])>>>16,k+=65535&A,O+=A>>>16,k+=(I+=(M+=65535&x)>>>16)>>>16,M=65535&(x=E=65535&M|I<<16),I=x>>>16,k=65535&(A=v=65535&k|(O+=k>>>16)<<16),O=A>>>16,M+=65535&(x=(q>>>28|N<<4)^(N>>>2|q<<30)^(N>>>7|q<<25)),I+=x>>>16,k+=65535&(A=(N>>>28|q<<4)^(q>>>2|N<<30)^(q>>>7|N<<25)),O+=A>>>16,I+=(x=q&D^q&H^D&H)>>>16,k+=65535&(A=N&P^N&T^P&T),O+=A>>>16,u=65535&(k+=(I+=(M+=65535&x)>>>16)>>>16)|(O+=k>>>16)<<16,w=65535&M|I<<16,M=65535&(x=p),I=x>>>16,k=65535&(A=s),O=A>>>16,I+=(x=E)>>>16,k+=65535&(A=v),O+=A>>>16,P=i,T=a,L=o,j=s=65535&(k+=(I+=(M+=65535&x)>>>16)>>>16)|(O+=k>>>16)<<16,C=c,U=f,F=d,N=u,D=l,H=h,z=b,$=p=65535&M|I<<16,K=g,W=y,V=m,q=w,S%16==15)for(_=0;_<16;_++)A=R[_],M=65535&(x=B[_]),I=x>>>16,k=65535&A,O=A>>>16,A=R[(_+9)%16],M+=65535&(x=B[(_+9)%16]),I+=x>>>16,k+=65535&A,O+=A>>>16,v=R[(_+1)%16],M+=65535&(x=((E=B[(_+1)%16])>>>1|v<<31)^(E>>>8|v<<24)^(E>>>7|v<<25)),I+=x>>>16,k+=65535&(A=(v>>>1|E<<31)^(v>>>8|E<<24)^v>>>7),O+=A>>>16,v=R[(_+14)%16],I+=(x=((E=B[(_+14)%16])>>>19|v<<13)^(v>>>29|E<<3)^(E>>>6|v<<26))>>>16,k+=65535&(A=(v>>>19|E<<13)^(E>>>29|v<<3)^v>>>6),O+=A>>>16,O+=(k+=(I+=(M+=65535&x)>>>16)>>>16)>>>16,R[_]=65535&k|O<<16,B[_]=65535&M|I<<16;M=65535&(x=q),I=x>>>16,k=65535&(A=N),O=A>>>16,A=e[0],I+=(x=t[0])>>>16,k+=65535&A,O+=A>>>16,O+=(k+=(I+=(M+=65535&x)>>>16)>>>16)>>>16,e[0]=N=65535&k|O<<16,t[0]=q=65535&M|I<<16,M=65535&(x=D),I=x>>>16,k=65535&(A=P),O=A>>>16,A=e[1],I+=(x=t[1])>>>16,k+=65535&A,O+=A>>>16,O+=(k+=(I+=(M+=65535&x)>>>16)>>>16)>>>16,e[1]=P=65535&k|O<<16,t[1]=D=65535&M|I<<16,M=65535&(x=H),I=x>>>16,k=65535&(A=T),O=A>>>16,A=e[2],I+=(x=t[2])>>>16,k+=65535&A,O+=A>>>16,O+=(k+=(I+=(M+=65535&x)>>>16)>>>16)>>>16,e[2]=T=65535&k|O<<16,t[2]=H=65535&M|I<<16,M=65535&(x=z),I=x>>>16,k=65535&(A=L),O=A>>>16,A=e[3],I+=(x=t[3])>>>16,k+=65535&A,O+=A>>>16,O+=(k+=(I+=(M+=65535&x)>>>16)>>>16)>>>16,e[3]=L=65535&k|O<<16,t[3]=z=65535&M|I<<16,M=65535&(x=$),I=x>>>16,k=65535&(A=j),O=A>>>16,A=e[4],I+=(x=t[4])>>>16,k+=65535&A,O+=A>>>16,O+=(k+=(I+=(M+=65535&x)>>>16)>>>16)>>>16,e[4]=j=65535&k|O<<16,t[4]=$=65535&M|I<<16,M=65535&(x=K),I=x>>>16,k=65535&(A=C),O=A>>>16,A=e[5],I+=(x=t[5])>>>16,k+=65535&A,O+=A>>>16,O+=(k+=(I+=(M+=65535&x)>>>16)>>>16)>>>16,e[5]=C=65535&k|O<<16,t[5]=K=65535&M|I<<16,M=65535&(x=W),I=x>>>16,k=65535&(A=U),O=A>>>16,A=e[6],I+=(x=t[6])>>>16,k+=65535&A,O+=A>>>16,O+=(k+=(I+=(M+=65535&x)>>>16)>>>16)>>>16,e[6]=U=65535&k|O<<16,t[6]=W=65535&M|I<<16,M=65535&(x=V),I=x>>>16,k=65535&(A=F),O=A>>>16,A=e[7],I+=(x=t[7])>>>16,k+=65535&A,O+=A>>>16,O+=(k+=(I+=(M+=65535&x)>>>16)>>>16)>>>16,e[7]=F=65535&k|O<<16,t[7]=V=65535&M|I<<16,G+=128,n-=128}return n}function Z(e,t,r){var n,i=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,J(i,a,t,r),r%=128,n=0;n<r;n++)o[n]=t[s-r+n];for(o[r]=128,o[(r=256-128*(r<112?1:0))-9]=0,b(o,r-8,s/536870912|0,s<<3),J(i,a,o,r),n=0;n<8;n++)b(e,8*n,i[n],a[n]);return 0}function X(e,r){var n=t(),i=t(),a=t(),o=t(),s=t(),c=t(),f=t(),u=t(),l=t();U(n,e[1],e[0]),U(l,r[1],r[0]),F(n,n,l),C(i,e[0],e[1]),C(l,r[0],r[1]),F(i,i,l),F(a,e[3],r[3]),F(a,a,d),F(o,e[2],r[2]),C(o,o,o),U(s,i,n),U(c,o,a),C(f,o,a),C(u,i,n),F(e[0],s,c),F(e[1],u,f),F(e[2],f,c),F(e[3],s,u)}function Q(e,t,r){var n;for(n=0;n<4;n++)N(e[n],t[n],r)}function ee(e,r){var n=t(),i=t(),a=t();D(a,r[2]),F(n,r[0],a),F(i,r[1],a),P(e,i),e[31]^=L(n)<<7}function te(e,t,r){var n,i;for(R(e[0],o),R(e[1],s),R(e[2],s),R(e[3],o),i=255;i>=0;--i)Q(e,t,n=r[i/8|0]>>(7&i)&1),X(t,e),X(e,e),Q(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];R(n[0],u),R(n[1],l),R(n[2],s),F(n[3],u,l),te(e,n,r)}function ne(e,r,i){var a,o=new Uint8Array(64),s=[t(),t(),t(),t()];for(i||n(r,32),Z(o,r,32),o[0]&=248,o[31]&=127,o[31]|=64,re(s,o),ee(e,s),a=0;a<32;a++)r[a+32]=e[a];return 0}var ie=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 ae(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i<a;++i)t[i]+=r-16*t[n]*ie[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*ie[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ie[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,r,n,i){var a,o,s=new Uint8Array(64),c=new Uint8Array(64),f=new Uint8Array(64),d=new Float64Array(64),u=[t(),t(),t(),t()];Z(s,i,32),s[0]&=248,s[31]&=127,s[31]|=64;var l=n+64;for(a=0;a<n;a++)e[64+a]=r[a];for(a=0;a<32;a++)e[32+a]=s[32+a];for(Z(f,e.subarray(32),n+32),oe(f),re(u,f),ee(e,u),a=32;a<64;a++)e[a]=i[a];for(Z(c,e,n+64),oe(c),a=0;a<64;a++)d[a]=0;for(a=0;a<32;a++)d[a]=f[a];for(a=0;a<32;a++)for(o=0;o<32;o++)d[a+o]+=c[a]*s[o];return ae(e.subarray(32),d),l}function ce(e,r,n,i){var a,c=new Uint8Array(32),d=new Uint8Array(64),u=[t(),t(),t(),t()],l=[t(),t(),t(),t()];if(n<64)return-1;if(function(e,r){var n=t(),i=t(),a=t(),c=t(),d=t(),u=t(),l=t();return R(e[2],s),j(e[1],r),q(a,e[1]),F(c,a,f),U(a,a,e[2]),C(c,e[2],c),q(d,c),q(u,d),F(l,u,d),F(n,l,a),F(n,n,c),H(n,n),F(n,n,a),F(n,n,c),F(n,n,c),F(e[0],n,c),q(i,e[0]),F(i,i,c),T(i,a)&&F(e[0],e[0],h),q(i,e[0]),F(i,i,c),T(i,a)?-1:(L(e[0])===r[31]>>7&&U(e[0],o,e[0]),F(e[3],e[0],e[1]),0)}(l,i))return-1;for(a=0;a<n;a++)e[a]=r[a];for(a=0;a<32;a++)e[a+32]=i[a];if(Z(d,e,n),oe(d),te(u,l,d),re(l,r.subarray(32)),X(u,l),ee(c,u),n-=64,y(r,0,c,0)){for(a=0;a<n;a++)e[a]=0;return-1}for(a=0;a<n;a++)e[a]=r[a+64];return n}var fe,de=64,ue=32,le=64;function he(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function be(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function pe(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:w,crypto_stream_xor:A,crypto_stream:_,crypto_stream_salsa20_xor:E,crypto_stream_salsa20:S,crypto_onetimeauth:M,crypto_onetimeauth_verify:I,crypto_verify_16:g,crypto_verify_32:y,crypto_secretbox:k,crypto_secretbox_open:O,crypto_scalarmult:z,crypto_scalarmult_base:$,crypto_box_beforenm:W,crypto_box_afternm:V,crypto_box:function(e,t,r,n,i,a){var o=new Uint8Array(32);return W(o,i,a),V(e,t,r,n,o)},crypto_box_open:function(e,t,r,n,i,a){var o=new Uint8Array(32);return W(o,i,a),G(e,t,r,n,o)},crypto_box_keypair:K,crypto_hash:Z,crypto_sign:se,crypto_sign_keypair:ne,crypto_sign_open:ce,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:de,crypto_sign_PUBLICKEYBYTES:ue,crypto_sign_SECRETKEYBYTES:le,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:f,L:ie,pack:ee,pack25519:P,unpack25519:j,M:F,A:C,S:q,Z:U,pow2523:H,add:X,set25519:R,modL:ae,scalarmult:te,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,r){be(e,t,r),he(r,t);for(var n=new Uint8Array(32+e.length),i=new Uint8Array(n.length),a=0;a<e.length;a++)n[a+32]=e[a];return k(i,n,n.length,t,r),i.subarray(16)},e.secretbox.open=function(e,t,r){be(e,t,r),he(r,t);for(var n=new Uint8Array(16+e.length),i=new Uint8Array(n.length),a=0;a<e.length;a++)n[a+16]=e[a];return n.length<32||0!==O(i,n,n.length,t,r)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(be(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return z(r,e,t),r},e.scalarMult.base=function(e){if(be(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return $(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,i){var a=e.box.before(n,i);return e.secretbox(t,r,a)},e.box.before=function(e,t){be(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return W(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,i){var a=e.box.before(n,i);return e.secretbox.open(t,r,a)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return K(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(be(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return $(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(be(e,t),t.length!==le)throw new Error("bad secret key size");var r=new Uint8Array(de+e.length);return se(r,e,e.length,t),r},e.sign.open=function(e,t){if(be(e,t),t.length!==ue)throw new Error("bad public key size");var r=new Uint8Array(e.length),n=ce(r,e,e.length,t);if(n<0)return null;for(var i=new Uint8Array(n),a=0;a<i.length;a++)i[a]=r[a];return i},e.sign.detached=function(t,r){for(var n=e.sign(t,r),i=new Uint8Array(de),a=0;a<i.length;a++)i[a]=n[a];return i},e.sign.detached.verify=function(e,t,