@walletconnect/relay-auth
Advanced tools
Comparing version 1.0.4-2ee93a0 to 1.0.4-5b9d89e
@@ -1,15 +0,2 @@ | ||
(function(O,Ye){typeof exports=="object"&&typeof module<"u"?Ye(exports):typeof define=="function"&&define.amd?define(["exports"],Ye):(O=typeof globalThis<"u"?globalThis:O||self,Ye(O["@walletconnect/relay-auth"]={}))})(this,function(O){"use strict";function Ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pt(e){var r=e.default;if(typeof r=="function"){var n=function(){return r.apply(this,arguments)};n.prototype=r.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,a.get?a:{enumerable:!0,get:function(){return e[i]}})}),n}var et={},st={},tt={},rt={};Object.defineProperty(rt,"__esModule",{value:!0}),rt.BrowserRandomSource=void 0;const jt=65536;class Fr{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let i=0;i<n.length;i+=jt)this._crypto.getRandomValues(n.subarray(i,i+Math.min(n.length-i,jt)));return n}}rt.BrowserRandomSource=Fr;function Mr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var nt={},Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});function Br(e){for(var r=0;r<e.length;r++)e[r]=0;return e}Pe.wipe=Br;var Lr={},Rr=Object.freeze({__proto__:null,default:Lr}),Hr=Pt(Rr);Object.defineProperty(nt,"__esModule",{value:!0}),nt.NodeRandomSource=void 0;const Pr=Pe;class jr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Mr<"u"){const r=Hr;r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(r);for(let a=0;a<i.length;a++)i[a]=n[a];return(0,Pr.wipe)(n),i}}nt.NodeRandomSource=jr,Object.defineProperty(tt,"__esModule",{value:!0}),tt.SystemRandomSource=void 0;const $r=rt,Kr=nt;class Gr{constructor(){if(this.isAvailable=!1,this.name="",this._source=new $r.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Kr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}tt.SystemRandomSource=Gr;var C={},$t={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function r(d,h){var D=d>>>16&65535,_=d&65535,I=h>>>16&65535,A=h&65535;return _*A+(D*A+_*I<<16>>>0)|0}e.mul=Math.imul||r;function n(d,h){return d+h|0}e.add=n;function i(d,h){return d-h|0}e.sub=i;function a(d,h){return d<<h|d>>>32-h}e.rotl=a;function o(d,h){return d<<32-h|d>>>h}e.rotr=o;function x(d){return typeof d=="number"&&isFinite(d)&&Math.floor(d)===d}e.isInteger=Number.isInteger||x,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(d){return e.isInteger(d)&&d>=-e.MAX_SAFE_INTEGER&&d<=e.MAX_SAFE_INTEGER}})($t),Object.defineProperty(C,"__esModule",{value:!0});var Kt=$t;function Yr(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])<<16>>16}C.readInt16BE=Yr;function Wr(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])>>>0}C.readUint16BE=Wr;function zr(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])<<16>>16}C.readInt16LE=zr;function Jr(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])>>>0}C.readUint16LE=Jr;function Gt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>8,r[n+1]=e>>>0,r}C.writeUint16BE=Gt,C.writeInt16BE=Gt;function Yt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r}C.writeUint16LE=Yt,C.writeInt16LE=Yt;function Dt(e,r){return r===void 0&&(r=0),e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]}C.readInt32BE=Dt;function dt(e,r){return r===void 0&&(r=0),(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0}C.readUint32BE=dt;function lt(e,r){return r===void 0&&(r=0),e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]}C.readInt32LE=lt;function bt(e,r){return r===void 0&&(r=0),(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r])>>>0}C.readUint32LE=bt;function it(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>24,r[n+1]=e>>>16,r[n+2]=e>>>8,r[n+3]=e>>>0,r}C.writeUint32BE=it,C.writeInt32BE=it;function at(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r[n+2]=e>>>16,r[n+3]=e>>>24,r}C.writeUint32LE=at,C.writeInt32LE=at;function Vr(e,r){r===void 0&&(r=0);var n=Dt(e,r),i=Dt(e,r+4);return n*4294967296+i-(i>>31)*4294967296}C.readInt64BE=Vr;function kr(e,r){r===void 0&&(r=0);var n=dt(e,r),i=dt(e,r+4);return n*4294967296+i}C.readUint64BE=kr;function Xr(e,r){r===void 0&&(r=0);var n=lt(e,r),i=lt(e,r+4);return i*4294967296+n-(n>>31)*4294967296}C.readInt64LE=Xr;function qr(e,r){r===void 0&&(r=0);var n=bt(e,r),i=bt(e,r+4);return i*4294967296+n}C.readUint64LE=qr;function Wt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),it(e/4294967296>>>0,r,n),it(e>>>0,r,n+4),r}C.writeUint64BE=Wt,C.writeInt64BE=Wt;function zt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),at(e>>>0,r,n),at(e/4294967296>>>0,r,n+4),r}C.writeUint64LE=zt,C.writeInt64LE=zt;function Zr(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,a=1,o=e/8+n-1;o>=n;o--)i+=r[o]*a,a*=256;return i}C.readUintBE=Zr;function Qr(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,a=1,o=n;o<n+e/8;o++)i+=r[o]*a,a*=256;return i}C.readUintLE=Qr;function en(e,r,n,i){if(n===void 0&&(n=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Kt.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var a=1,o=e/8+i-1;o>=i;o--)n[o]=r/a&255,a*=256;return n}C.writeUintBE=en;function tn(e,r,n,i){if(n===void 0&&(n=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Kt.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var a=1,o=i;o<i+e/8;o++)n[o]=r/a&255,a*=256;return n}C.writeUintLE=tn;function rn(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r)}C.readFloat32BE=rn;function nn(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r,!0)}C.readFloat32LE=nn;function an(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r)}C.readFloat64BE=an;function un(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r,!0)}C.readFloat64LE=un;function fn(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,e),r}C.writeFloat32BE=fn;function on(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,e,!0),r}C.writeFloat32LE=on;function cn(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,e),r}C.writeFloat64BE=cn;function sn(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,e,!0),r}C.writeFloat64LE=sn,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const r=tt,n=C,i=Pe;e.defaultRandomSource=new r.SystemRandomSource;function a(D,_=e.defaultRandomSource){return _.randomBytes(D)}e.randomBytes=a;function o(D=e.defaultRandomSource){const _=a(4,D),I=(0,n.readUint32LE)(_);return(0,i.wipe)(_),I}e.randomUint32=o;const x="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function d(D,_=x,I=e.defaultRandomSource){if(_.length<2)throw new Error("randomString charset is too short");if(_.length>256)throw new Error("randomString charset is too long");let A="";const N=_.length,w=256-256%N;for(;D>0;){const U=a(Math.ceil(D*256/w),I);for(let L=0;L<U.length&&D>0;L++){const $=U[L];$<w&&(A+=_.charAt($%N),D--)}(0,i.wipe)(U)}return A}e.randomString=d;function h(D,_=x,I=e.defaultRandomSource){const A=Math.ceil(D/(Math.log(_.length)/Math.LN2));return d(A,_,I)}e.randomStringForEntropy=h}(st);var Jt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=C,n=Pe;e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var i=function(){function d(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return d.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},d.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},d.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},d.prototype.update=function(h,D){if(D===void 0&&(D=h.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var _=0;if(this._bytesHashed+=D,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&D>0;)this._buffer[this._bufferLength++]=h[_++],D--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(D>=this.blockSize&&(_=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,h,_,D),D%=this.blockSize);D>0;)this._buffer[this._bufferLength++]=h[_++],D--;return this},d.prototype.finish=function(h){if(!this._finished){var D=this._bytesHashed,_=this._bufferLength,I=D/536870912|0,A=D<<3,N=D%128<112?128:256;this._buffer[_]=128;for(var w=_+1;w<N-8;w++)this._buffer[w]=0;r.writeUint32BE(I,this._buffer,N-8),r.writeUint32BE(A,this._buffer,N-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,N),this._finished=!0}for(var w=0;w<this.digestLength/8;w++)r.writeUint32BE(this._stateHi[w],h,w*8),r.writeUint32BE(this._stateLo[w],h,w*8+4);return this},d.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},d.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},d.prototype.restoreState=function(h){return this._stateHi.set(h.stateHi),this._stateLo.set(h.stateLo),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},d.prototype.cleanSavedState=function(h){n.wipe(h.stateHi),n.wipe(h.stateLo),h.buffer&&n.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},d}();e.SHA512=i;var a=new Int32Array([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 o(d,h,D,_,I,A,N){for(var w=D[0],U=D[1],L=D[2],$=D[3],M=D[4],J=D[5],Y=D[6],R=D[7],T=_[0],g=_[1],H=_[2],Ce=_[3],me=_[4],Te=_[5],Fe=_[6],Ne=_[7],b,l,W,Z,p,E,y,v;N>=128;){for(var xe=0;xe<16;xe++){var k=8*xe+A;d[xe]=r.readUint32BE(I,k),h[xe]=r.readUint32BE(I,k+4)}for(var xe=0;xe<80;xe++){var Bt=w,Lt=U,Rt=L,c=$,s=M,f=J,t=Y,u=R,m=T,S=g,B=H,P=Ce,F=me,j=Te,we=Fe,Q=Ne;if(b=R,l=Ne,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=(M>>>14|me<<32-14)^(M>>>18|me<<32-18)^(me>>>41-32|M<<32-(41-32)),l=(me>>>14|M<<32-14)^(me>>>18|M<<32-18)^(M>>>41-32|me<<32-(41-32)),p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,b=M&J^~M&Y,l=me&Te^~me&Fe,p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,b=a[xe*2],l=a[xe*2+1],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,b=d[xe%16],l=h[xe%16],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,W=y&65535|v<<16,Z=p&65535|E<<16,b=W,l=Z,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=(w>>>28|T<<32-28)^(T>>>34-32|w<<32-(34-32))^(T>>>39-32|w<<32-(39-32)),l=(T>>>28|w<<32-28)^(w>>>34-32|T<<32-(34-32))^(w>>>39-32|T<<32-(39-32)),p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,b=w&U^w&L^U&L,l=T&g^T&H^g&H,p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,u=y&65535|v<<16,Q=p&65535|E<<16,b=c,l=P,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=W,l=Z,p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,c=y&65535|v<<16,P=p&65535|E<<16,U=Bt,L=Lt,$=Rt,M=c,J=s,Y=f,R=t,w=u,g=m,H=S,Ce=B,me=P,Te=F,Fe=j,Ne=we,T=Q,xe%16===15)for(var k=0;k<16;k++)b=d[k],l=h[k],p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=d[(k+9)%16],l=h[(k+9)%16],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,W=d[(k+1)%16],Z=h[(k+1)%16],b=(W>>>1|Z<<32-1)^(W>>>8|Z<<32-8)^W>>>7,l=(Z>>>1|W<<32-1)^(Z>>>8|W<<32-8)^(Z>>>7|W<<32-7),p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,W=d[(k+14)%16],Z=h[(k+14)%16],b=(W>>>19|Z<<32-19)^(Z>>>61-32|W<<32-(61-32))^W>>>6,l=(Z>>>19|W<<32-19)^(W>>>61-32|Z<<32-(61-32))^(Z>>>6|W<<32-6),p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,d[k]=y&65535|v<<16,h[k]=p&65535|E<<16}b=w,l=T,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=D[0],l=_[0],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,D[0]=w=y&65535|v<<16,_[0]=T=p&65535|E<<16,b=U,l=g,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=D[1],l=_[1],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,D[1]=U=y&65535|v<<16,_[1]=g=p&65535|E<<16,b=L,l=H,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=D[2],l=_[2],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,D[2]=L=y&65535|v<<16,_[2]=H=p&65535|E<<16,b=$,l=Ce,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=D[3],l=_[3],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,D[3]=$=y&65535|v<<16,_[3]=Ce=p&65535|E<<16,b=M,l=me,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=D[4],l=_[4],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,D[4]=M=y&65535|v<<16,_[4]=me=p&65535|E<<16,b=J,l=Te,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=D[5],l=_[5],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,D[5]=J=y&65535|v<<16,_[5]=Te=p&65535|E<<16,b=Y,l=Fe,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=D[6],l=_[6],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,D[6]=Y=y&65535|v<<16,_[6]=Fe=p&65535|E<<16,b=R,l=Ne,p=l&65535,E=l>>>16,y=b&65535,v=b>>>16,b=D[7],l=_[7],p+=l&65535,E+=l>>>16,y+=b&65535,v+=b>>>16,E+=p>>>16,y+=E>>>16,v+=y>>>16,D[7]=R=y&65535|v<<16,_[7]=Ne=p&65535|E<<16,A+=128,N-=128}return A}function x(d){var h=new i;h.update(d);var D=h.digest();return h.clean(),D}e.hash=x})(Jt),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.convertSecretKeyToX25519=e.convertPublicKeyToX25519=e.verify=e.sign=e.extractPublicKeyFromSecretKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.SEED_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=e.SIGNATURE_LENGTH=void 0;const r=st,n=Jt,i=Pe;e.SIGNATURE_LENGTH=64,e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=64,e.SEED_LENGTH=32;function a(c){const s=new Float64Array(16);if(c)for(let f=0;f<c.length;f++)s[f]=c[f];return s}const o=new Uint8Array(32);o[0]=9;const x=a(),d=a([1]),h=a([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),D=a([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),_=a([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),I=a([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),A=a([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function N(c,s){for(let f=0;f<16;f++)c[f]=s[f]|0}function w(c){let s=1;for(let f=0;f<16;f++){let t=c[f]+s+65535;s=Math.floor(t/65536),c[f]=t-s*65536}c[0]+=s-1+37*(s-1)}function U(c,s,f){const t=~(f-1);for(let u=0;u<16;u++){const m=t&(c[u]^s[u]);c[u]^=m,s[u]^=m}}function L(c,s){const f=a(),t=a();for(let u=0;u<16;u++)t[u]=s[u];w(t),w(t),w(t);for(let u=0;u<2;u++){f[0]=t[0]-65517;for(let S=1;S<15;S++)f[S]=t[S]-65535-(f[S-1]>>16&1),f[S-1]&=65535;f[15]=t[15]-32767-(f[14]>>16&1);const m=f[15]>>16&1;f[14]&=65535,U(t,f,1-m)}for(let u=0;u<16;u++)c[2*u]=t[u]&255,c[2*u+1]=t[u]>>8}function $(c,s){let f=0;for(let t=0;t<32;t++)f|=c[t]^s[t];return(1&f-1>>>8)-1}function M(c,s){const f=new Uint8Array(32),t=new Uint8Array(32);return L(f,c),L(t,s),$(f,t)}function J(c){const s=new Uint8Array(32);return L(s,c),s[0]&1}function Y(c,s){for(let f=0;f<16;f++)c[f]=s[2*f]+(s[2*f+1]<<8);c[15]&=32767}function R(c,s,f){for(let t=0;t<16;t++)c[t]=s[t]+f[t]}function T(c,s,f){for(let t=0;t<16;t++)c[t]=s[t]-f[t]}function g(c,s,f){let t,u,m=0,S=0,B=0,P=0,F=0,j=0,we=0,Q=0,ve=0,te=0,ee=0,X=0,V=0,z=0,K=0,G=0,re=0,pe=0,ge=0,Se=0,Ae=0,Oe=0,Ue=0,Ie=0,Me=0,He=0,Ge=0,Qe=0,ct=0,Ht=0,Ir=0,ne=f[0],ie=f[1],ae=f[2],ue=f[3],fe=f[4],oe=f[5],ce=f[6],se=f[7],De=f[8],de=f[9],le=f[10],be=f[11],he=f[12],_e=f[13],Ee=f[14],ye=f[15];t=s[0],m+=t*ne,S+=t*ie,B+=t*ae,P+=t*ue,F+=t*fe,j+=t*oe,we+=t*ce,Q+=t*se,ve+=t*De,te+=t*de,ee+=t*le,X+=t*be,V+=t*he,z+=t*_e,K+=t*Ee,G+=t*ye,t=s[1],S+=t*ne,B+=t*ie,P+=t*ae,F+=t*ue,j+=t*fe,we+=t*oe,Q+=t*ce,ve+=t*se,te+=t*De,ee+=t*de,X+=t*le,V+=t*be,z+=t*he,K+=t*_e,G+=t*Ee,re+=t*ye,t=s[2],B+=t*ne,P+=t*ie,F+=t*ae,j+=t*ue,we+=t*fe,Q+=t*oe,ve+=t*ce,te+=t*se,ee+=t*De,X+=t*de,V+=t*le,z+=t*be,K+=t*he,G+=t*_e,re+=t*Ee,pe+=t*ye,t=s[3],P+=t*ne,F+=t*ie,j+=t*ae,we+=t*ue,Q+=t*fe,ve+=t*oe,te+=t*ce,ee+=t*se,X+=t*De,V+=t*de,z+=t*le,K+=t*be,G+=t*he,re+=t*_e,pe+=t*Ee,ge+=t*ye,t=s[4],F+=t*ne,j+=t*ie,we+=t*ae,Q+=t*ue,ve+=t*fe,te+=t*oe,ee+=t*ce,X+=t*se,V+=t*De,z+=t*de,K+=t*le,G+=t*be,re+=t*he,pe+=t*_e,ge+=t*Ee,Se+=t*ye,t=s[5],j+=t*ne,we+=t*ie,Q+=t*ae,ve+=t*ue,te+=t*fe,ee+=t*oe,X+=t*ce,V+=t*se,z+=t*De,K+=t*de,G+=t*le,re+=t*be,pe+=t*he,ge+=t*_e,Se+=t*Ee,Ae+=t*ye,t=s[6],we+=t*ne,Q+=t*ie,ve+=t*ae,te+=t*ue,ee+=t*fe,X+=t*oe,V+=t*ce,z+=t*se,K+=t*De,G+=t*de,re+=t*le,pe+=t*be,ge+=t*he,Se+=t*_e,Ae+=t*Ee,Oe+=t*ye,t=s[7],Q+=t*ne,ve+=t*ie,te+=t*ae,ee+=t*ue,X+=t*fe,V+=t*oe,z+=t*ce,K+=t*se,G+=t*De,re+=t*de,pe+=t*le,ge+=t*be,Se+=t*he,Ae+=t*_e,Oe+=t*Ee,Ue+=t*ye,t=s[8],ve+=t*ne,te+=t*ie,ee+=t*ae,X+=t*ue,V+=t*fe,z+=t*oe,K+=t*ce,G+=t*se,re+=t*De,pe+=t*de,ge+=t*le,Se+=t*be,Ae+=t*he,Oe+=t*_e,Ue+=t*Ee,Ie+=t*ye,t=s[9],te+=t*ne,ee+=t*ie,X+=t*ae,V+=t*ue,z+=t*fe,K+=t*oe,G+=t*ce,re+=t*se,pe+=t*De,ge+=t*de,Se+=t*le,Ae+=t*be,Oe+=t*he,Ue+=t*_e,Ie+=t*Ee,Me+=t*ye,t=s[10],ee+=t*ne,X+=t*ie,V+=t*ae,z+=t*ue,K+=t*fe,G+=t*oe,re+=t*ce,pe+=t*se,ge+=t*De,Se+=t*de,Ae+=t*le,Oe+=t*be,Ue+=t*he,Ie+=t*_e,Me+=t*Ee,He+=t*ye,t=s[11],X+=t*ne,V+=t*ie,z+=t*ae,K+=t*ue,G+=t*fe,re+=t*oe,pe+=t*ce,ge+=t*se,Se+=t*De,Ae+=t*de,Oe+=t*le,Ue+=t*be,Ie+=t*he,Me+=t*_e,He+=t*Ee,Ge+=t*ye,t=s[12],V+=t*ne,z+=t*ie,K+=t*ae,G+=t*ue,re+=t*fe,pe+=t*oe,ge+=t*ce,Se+=t*se,Ae+=t*De,Oe+=t*de,Ue+=t*le,Ie+=t*be,Me+=t*he,He+=t*_e,Ge+=t*Ee,Qe+=t*ye,t=s[13],z+=t*ne,K+=t*ie,G+=t*ae,re+=t*ue,pe+=t*fe,ge+=t*oe,Se+=t*ce,Ae+=t*se,Oe+=t*De,Ue+=t*de,Ie+=t*le,Me+=t*be,He+=t*he,Ge+=t*_e,Qe+=t*Ee,ct+=t*ye,t=s[14],K+=t*ne,G+=t*ie,re+=t*ae,pe+=t*ue,ge+=t*fe,Se+=t*oe,Ae+=t*ce,Oe+=t*se,Ue+=t*De,Ie+=t*de,Me+=t*le,He+=t*be,Ge+=t*he,Qe+=t*_e,ct+=t*Ee,Ht+=t*ye,t=s[15],G+=t*ne,re+=t*ie,pe+=t*ae,ge+=t*ue,Se+=t*fe,Ae+=t*oe,Oe+=t*ce,Ue+=t*se,Ie+=t*De,Me+=t*de,He+=t*le,Ge+=t*be,Qe+=t*he,ct+=t*_e,Ht+=t*Ee,Ir+=t*ye,m+=38*re,S+=38*pe,B+=38*ge,P+=38*Se,F+=38*Ae,j+=38*Oe,we+=38*Ue,Q+=38*Ie,ve+=38*Me,te+=38*He,ee+=38*Ge,X+=38*Qe,V+=38*ct,z+=38*Ht,K+=38*Ir,u=1,t=m+u+65535,u=Math.floor(t/65536),m=t-u*65536,t=S+u+65535,u=Math.floor(t/65536),S=t-u*65536,t=B+u+65535,u=Math.floor(t/65536),B=t-u*65536,t=P+u+65535,u=Math.floor(t/65536),P=t-u*65536,t=F+u+65535,u=Math.floor(t/65536),F=t-u*65536,t=j+u+65535,u=Math.floor(t/65536),j=t-u*65536,t=we+u+65535,u=Math.floor(t/65536),we=t-u*65536,t=Q+u+65535,u=Math.floor(t/65536),Q=t-u*65536,t=ve+u+65535,u=Math.floor(t/65536),ve=t-u*65536,t=te+u+65535,u=Math.floor(t/65536),te=t-u*65536,t=ee+u+65535,u=Math.floor(t/65536),ee=t-u*65536,t=X+u+65535,u=Math.floor(t/65536),X=t-u*65536,t=V+u+65535,u=Math.floor(t/65536),V=t-u*65536,t=z+u+65535,u=Math.floor(t/65536),z=t-u*65536,t=K+u+65535,u=Math.floor(t/65536),K=t-u*65536,t=G+u+65535,u=Math.floor(t/65536),G=t-u*65536,m+=u-1+37*(u-1),u=1,t=m+u+65535,u=Math.floor(t/65536),m=t-u*65536,t=S+u+65535,u=Math.floor(t/65536),S=t-u*65536,t=B+u+65535,u=Math.floor(t/65536),B=t-u*65536,t=P+u+65535,u=Math.floor(t/65536),P=t-u*65536,t=F+u+65535,u=Math.floor(t/65536),F=t-u*65536,t=j+u+65535,u=Math.floor(t/65536),j=t-u*65536,t=we+u+65535,u=Math.floor(t/65536),we=t-u*65536,t=Q+u+65535,u=Math.floor(t/65536),Q=t-u*65536,t=ve+u+65535,u=Math.floor(t/65536),ve=t-u*65536,t=te+u+65535,u=Math.floor(t/65536),te=t-u*65536,t=ee+u+65535,u=Math.floor(t/65536),ee=t-u*65536,t=X+u+65535,u=Math.floor(t/65536),X=t-u*65536,t=V+u+65535,u=Math.floor(t/65536),V=t-u*65536,t=z+u+65535,u=Math.floor(t/65536),z=t-u*65536,t=K+u+65535,u=Math.floor(t/65536),K=t-u*65536,t=G+u+65535,u=Math.floor(t/65536),G=t-u*65536,m+=u-1+37*(u-1),c[0]=m,c[1]=S,c[2]=B,c[3]=P,c[4]=F,c[5]=j,c[6]=we,c[7]=Q,c[8]=ve,c[9]=te,c[10]=ee,c[11]=X,c[12]=V,c[13]=z,c[14]=K,c[15]=G}function H(c,s){g(c,s,s)}function Ce(c,s){const f=a();let t;for(t=0;t<16;t++)f[t]=s[t];for(t=253;t>=0;t--)H(f,f),t!==2&&t!==4&&g(f,f,s);for(t=0;t<16;t++)c[t]=f[t]}function me(c,s){const f=a();let t;for(t=0;t<16;t++)f[t]=s[t];for(t=250;t>=0;t--)H(f,f),t!==1&&g(f,f,s);for(t=0;t<16;t++)c[t]=f[t]}function Te(c,s){const f=a(),t=a(),u=a(),m=a(),S=a(),B=a(),P=a(),F=a(),j=a();T(f,c[1],c[0]),T(j,s[1],s[0]),g(f,f,j),R(t,c[0],c[1]),R(j,s[0],s[1]),g(t,t,j),g(u,c[3],s[3]),g(u,u,D),g(m,c[2],s[2]),R(m,m,m),T(S,t,f),T(B,m,u),R(P,m,u),R(F,t,f),g(c[0],S,B),g(c[1],F,P),g(c[2],P,B),g(c[3],S,F)}function Fe(c,s,f){for(let t=0;t<4;t++)U(c[t],s[t],f)}function Ne(c,s){const f=a(),t=a(),u=a();Ce(u,s[2]),g(f,s[0],u),g(t,s[1],u),L(c,t),c[31]^=J(f)<<7}function b(c,s,f){N(c[0],x),N(c[1],d),N(c[2],d),N(c[3],x);for(let t=255;t>=0;--t){const u=f[t/8|0]>>(t&7)&1;Fe(c,s,u),Te(s,c),Te(c,c),Fe(c,s,u)}}function l(c,s){const f=[a(),a(),a(),a()];N(f[0],_),N(f[1],I),N(f[2],d),g(f[3],_,I),b(c,f,s)}function W(c){if(c.length!==e.SEED_LENGTH)throw new Error(`ed25519: seed must be ${e.SEED_LENGTH} bytes`);const s=(0,n.hash)(c);s[0]&=248,s[31]&=127,s[31]|=64;const f=new Uint8Array(32),t=[a(),a(),a(),a()];l(t,s),Ne(f,t);const u=new Uint8Array(64);return u.set(c),u.set(f,32),{publicKey:f,secretKey:u}}e.generateKeyPairFromSeed=W;function Z(c){const s=(0,r.randomBytes)(32,c),f=W(s);return(0,i.wipe)(s),f}e.generateKeyPair=Z;function p(c){if(c.length!==e.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${e.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(c.subarray(32))}e.extractPublicKeyFromSecretKey=p;const E=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 y(c,s){let f,t,u,m;for(t=63;t>=32;--t){for(f=0,u=t-32,m=t-12;u<m;++u)s[u]+=f-16*s[t]*E[u-(t-32)],f=Math.floor((s[u]+128)/256),s[u]-=f*256;s[u]+=f,s[t]=0}for(f=0,u=0;u<32;u++)s[u]+=f-(s[31]>>4)*E[u],f=s[u]>>8,s[u]&=255;for(u=0;u<32;u++)s[u]-=f*E[u];for(t=0;t<32;t++)s[t+1]+=s[t]>>8,c[t]=s[t]&255}function v(c){const s=new Float64Array(64);for(let f=0;f<64;f++)s[f]=c[f];for(let f=0;f<64;f++)c[f]=0;y(c,s)}function xe(c,s){const f=new Float64Array(64),t=[a(),a(),a(),a()],u=(0,n.hash)(c.subarray(0,32));u[0]&=248,u[31]&=127,u[31]|=64;const m=new Uint8Array(64);m.set(u.subarray(32),32);const S=new n.SHA512;S.update(m.subarray(32)),S.update(s);const B=S.digest();S.clean(),v(B),l(t,B),Ne(m,t),S.reset(),S.update(m.subarray(0,32)),S.update(c.subarray(32)),S.update(s);const P=S.digest();v(P);for(let F=0;F<32;F++)f[F]=B[F];for(let F=0;F<32;F++)for(let j=0;j<32;j++)f[F+j]+=P[F]*u[j];return y(m.subarray(32),f),m}e.sign=xe;function k(c,s){const f=a(),t=a(),u=a(),m=a(),S=a(),B=a(),P=a();return N(c[2],d),Y(c[1],s),H(u,c[1]),g(m,u,h),T(u,u,c[2]),R(m,c[2],m),H(S,m),H(B,S),g(P,B,S),g(f,P,u),g(f,f,m),me(f,f),g(f,f,u),g(f,f,m),g(f,f,m),g(c[0],f,m),H(t,c[0]),g(t,t,m),M(t,u)&&g(c[0],c[0],A),H(t,c[0]),g(t,t,m),M(t,u)?-1:(J(c[0])===s[31]>>7&&T(c[0],x,c[0]),g(c[3],c[0],c[1]),0)}function Bt(c,s,f){const t=new Uint8Array(32),u=[a(),a(),a(),a()],m=[a(),a(),a(),a()];if(f.length!==e.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${e.SIGNATURE_LENGTH} bytes`);if(k(m,c))return!1;const S=new n.SHA512;S.update(f.subarray(0,32)),S.update(c),S.update(s);const B=S.digest();return v(B),b(u,m,B),l(m,f.subarray(32)),Te(u,m),Ne(t,u),!$(f,t)}e.verify=Bt;function Lt(c){let s=[a(),a(),a(),a()];if(k(s,c))throw new Error("Ed25519: invalid public key");let f=a(),t=a(),u=s[1];R(f,d,u),T(t,d,u),Ce(t,t),g(f,f,t);let m=new Uint8Array(32);return L(m,f),m}e.convertPublicKeyToX25519=Lt;function Rt(c){const s=(0,n.hash)(c.subarray(0,32));s[0]&=248,s[31]&=127,s[31]|=64;const f=new Uint8Array(s.subarray(0,32));return(0,i.wipe)(s),f}e.convertSecretKeyToX25519=Rt}(et);var ht={};/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var _t=function(e,r){return _t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},_t(e,r)};function Dn(e,r){_t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var Et=function(){return Et=Object.assign||function(r){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},Et.apply(this,arguments)};function dn(e,r){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,i=Object.getOwnPropertySymbols(e);a<i.length;a++)r.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]]);return n}function ln(e,r,n,i){var a=arguments.length,o=a<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,n):i,x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,r,n,i);else for(var d=e.length-1;d>=0;d--)(x=e[d])&&(o=(a<3?x(o):a>3?x(r,n,o):x(r,n))||o);return a>3&&o&&Object.defineProperty(r,n,o),o}function bn(e,r){return function(n,i){r(n,i,e)}}function hn(e,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,r)}function _n(e,r,n,i){function a(o){return o instanceof n?o:new n(function(x){x(o)})}return new(n||(n=Promise))(function(o,x){function d(_){try{D(i.next(_))}catch(I){x(I)}}function h(_){try{D(i.throw(_))}catch(I){x(I)}}function D(_){_.done?o(_.value):a(_.value).then(d,h)}D((i=i.apply(e,r||[])).next())})}function En(e,r){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,a,o,x;return x={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function d(D){return function(_){return h([D,_])}}function h(D){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,a&&(o=D[0]&2?a.return:D[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,D[1])).done)return o;switch(a=0,o&&(D=[D[0]&2,o.value]),D[0]){case 0:case 1:o=D;break;case 4:return n.label++,{value:D[1],done:!1};case 5:n.label++,a=D[1],D=[0];continue;case 7:D=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(D[0]===6||D[0]===2)){n=0;continue}if(D[0]===3&&(!o||D[1]>o[0]&&D[1]<o[3])){n.label=D[1];break}if(D[0]===6&&n.label<o[1]){n.label=o[1],o=D;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(D);break}o[2]&&n.ops.pop(),n.trys.pop();continue}D=r.call(e,n)}catch(_){D=[6,_],a=0}finally{i=o=0}if(D[0]&5)throw D[1];return{value:D[0]?D[1]:void 0,done:!0}}}function yn(e,r,n,i){i===void 0&&(i=n),e[i]=r[n]}function xn(e,r){for(var n in e)n!=="default"&&!r.hasOwnProperty(n)&&(r[n]=e[n])}function yt(e){var r=typeof Symbol=="function"&&Symbol.iterator,n=r&&e[r],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Vt(e,r){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),a,o=[],x;try{for(;(r===void 0||r-- >0)&&!(a=i.next()).done;)o.push(a.value)}catch(d){x={error:d}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(x)throw x.error}}return o}function wn(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(Vt(arguments[r]));return e}function vn(){for(var e=0,r=0,n=arguments.length;r<n;r++)e+=arguments[r].length;for(var i=Array(e),a=0,r=0;r<n;r++)for(var o=arguments[r],x=0,d=o.length;x<d;x++,a++)i[a]=o[x];return i}function We(e){return this instanceof We?(this.v=e,this):new We(e)}function pn(e,r,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,r||[]),a,o=[];return a={},x("next"),x("throw"),x("return"),a[Symbol.asyncIterator]=function(){return this},a;function x(A){i[A]&&(a[A]=function(N){return new Promise(function(w,U){o.push([A,N,w,U])>1||d(A,N)})})}function d(A,N){try{h(i[A](N))}catch(w){I(o[0][3],w)}}function h(A){A.value instanceof We?Promise.resolve(A.value.v).then(D,_):I(o[0][2],A)}function D(A){d("next",A)}function _(A){d("throw",A)}function I(A,N){A(N),o.shift(),o.length&&d(o[0][0],o[0][1])}}function mn(e){var r,n;return r={},i("next"),i("throw",function(a){throw a}),i("return"),r[Symbol.iterator]=function(){return this},r;function i(a,o){r[a]=e[a]?function(x){return(n=!n)?{value:We(e[a](x)),done:a==="return"}:o?o(x):x}:o}}function gn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e[Symbol.asyncIterator],n;return r?r.call(e):(e=typeof yt=="function"?yt(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(o){n[o]=e[o]&&function(x){return new Promise(function(d,h){x=e[o](x),a(d,h,x.done,x.value)})}}function a(o,x,d,h){Promise.resolve(h).then(function(D){o({value:D,done:d})},x)}}function Sn(e,r){return Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,e}function Cn(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r.default=e,r}function An(e){return e&&e.__esModule?e:{default:e}}function On(e,r){if(!r.has(e))throw new TypeError("attempted to get private field on non-instance");return r.get(e)}function Un(e,r,n){if(!r.has(e))throw new TypeError("attempted to set private field on non-instance");return r.set(e,n),n}var Tn=Object.freeze({__proto__:null,__extends:Dn,get __assign(){return Et},__rest:dn,__decorate:ln,__param:bn,__metadata:hn,__awaiter:_n,__generator:En,__createBinding:yn,__exportStar:xn,__values:yt,__read:Vt,__spread:wn,__spreadArrays:vn,__await:We,__asyncGenerator:pn,__asyncDelegator:mn,__asyncValues:gn,__makeTemplateObject:Sn,__importStar:Cn,__importDefault:An,__classPrivateFieldGet:On,__classPrivateFieldSet:Un}),ut=Pt(Tn),xt={},ze={},kt;function Nn(){if(kt)return ze;kt=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.delay=void 0;function e(r){return new Promise(n=>{setTimeout(()=>{n(!0)},r)})}return ze.delay=e,ze}var Be={},wt={},Le={},Xt;function In(){return Xt||(Xt=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.ONE_THOUSAND=Le.ONE_HUNDRED=void 0,Le.ONE_HUNDRED=100,Le.ONE_THOUSAND=1e3),Le}var vt={},qt;function Fn(){return qt||(qt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=e.ONE_MINUTE*5,e.TEN_MINUTES=e.ONE_MINUTE*10,e.THIRTY_MINUTES=e.ONE_MINUTE*30,e.SIXTY_MINUTES=e.ONE_MINUTE*60,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=e.ONE_HOUR*3,e.SIX_HOURS=e.ONE_HOUR*6,e.TWELVE_HOURS=e.ONE_HOUR*12,e.TWENTY_FOUR_HOURS=e.ONE_HOUR*24,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=e.ONE_DAY*3,e.FIVE_DAYS=e.ONE_DAY*5,e.SEVEN_DAYS=e.ONE_DAY*7,e.THIRTY_DAYS=e.ONE_DAY*30,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=e.ONE_WEEK*2,e.THREE_WEEKS=e.ONE_WEEK*3,e.FOUR_WEEKS=e.ONE_WEEK*4,e.ONE_YEAR=e.ONE_DAY*365}(vt)),vt}var Zt;function Qt(){return Zt||(Zt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const r=ut;r.__exportStar(In(),e),r.__exportStar(Fn(),e)}(wt)),wt}var er;function Mn(){if(er)return Be;er=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.fromMiliseconds=Be.toMiliseconds=void 0;const e=Qt();function r(i){return i*e.ONE_THOUSAND}Be.toMiliseconds=r;function n(i){return Math.floor(i/e.ONE_THOUSAND)}return Be.fromMiliseconds=n,Be}var tr;function Bn(){return tr||(tr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const r=ut;r.__exportStar(Nn(),e),r.__exportStar(Mn(),e)}(xt)),xt}var je={},rr;function Ln(){if(rr)return je;rr=1,Object.defineProperty(je,"__esModule",{value:!0}),je.Watch=void 0;class e{constructor(){this.timestamps=new Map}start(n){if(this.timestamps.has(n))throw new Error(`Watch already started for label: ${n}`);this.timestamps.set(n,{started:Date.now()})}stop(n){const i=this.get(n);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${n}`);const a=Date.now()-i.started;this.timestamps.set(n,{started:i.started,elapsed:a})}get(n){const i=this.timestamps.get(n);if(typeof i>"u")throw new Error(`No timestamp found for label: ${n}`);return i}elapsed(n){const i=this.get(n);return i.elapsed||Date.now()-i.started}}return je.Watch=e,je.default=e,je}var pt={},Je={},nr;function Rn(){if(nr)return Je;nr=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.IWatch=void 0;class e{}return Je.IWatch=e,Je}var ir;function Hn(){return ir||(ir=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),ut.__exportStar(Rn(),e)}(pt)),pt}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const r=ut;r.__exportStar(Bn(),e),r.__exportStar(Ln(),e),r.__exportStar(Hn(),e),r.__exportStar(Qt(),e)})(ht),Ye(ht);const mt="EdDSA",gt="JWT",$e=".",Ve="base64url",St="utf8",ft="utf8",Ct=":",At="did",Ot="key",ke="base58btc",Ut="z",Tt="K36",ar=32,ur=32;function Nt(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function fr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Nt(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Pn(e,r){r||(r=e.reduce((a,o)=>a+o.length,0));const n=fr(r);let i=0;for(const a of e)n.set(a,i),i+=a.length;return Nt(n)}function jn(e,r){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var a=0;a<e.length;a++){var o=e.charAt(a),x=o.charCodeAt(0);if(n[x]!==255)throw new TypeError(o+" is ambiguous");n[x]=a}var d=e.length,h=e.charAt(0),D=Math.log(d)/Math.log(256),_=Math.log(256)/Math.log(d);function I(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var U=0,L=0,$=0,M=w.length;$!==M&&w[$]===0;)$++,U++;for(var J=(M-$)*_+1>>>0,Y=new Uint8Array(J);$!==M;){for(var R=w[$],T=0,g=J-1;(R!==0||T<L)&&g!==-1;g--,T++)R+=256*Y[g]>>>0,Y[g]=R%d>>>0,R=R/d>>>0;if(R!==0)throw new Error("Non-zero carry");L=T,$++}for(var H=J-L;H!==J&&Y[H]===0;)H++;for(var Ce=h.repeat(U);H<J;++H)Ce+=e.charAt(Y[H]);return Ce}function A(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var U=0;if(w[U]!==" "){for(var L=0,$=0;w[U]===h;)L++,U++;for(var M=(w.length-U)*D+1>>>0,J=new Uint8Array(M);w[U];){var Y=n[w.charCodeAt(U)];if(Y===255)return;for(var R=0,T=M-1;(Y!==0||R<$)&&T!==-1;T--,R++)Y+=d*J[T]>>>0,J[T]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");$=R,U++}if(w[U]!==" "){for(var g=M-$;g!==M&&J[g]===0;)g++;for(var H=new Uint8Array(L+(M-g)),Ce=L;g!==M;)H[Ce++]=J[g++];return H}}}function N(w){var U=A(w);if(U)return U;throw new Error(`Non-${r} character`)}return{encode:I,decodeUnsafe:A,decode:N}}var $n=jn,Kn=$n;const or=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Gn=e=>new TextEncoder().encode(e),Yn=e=>new TextDecoder().decode(e);class Wn{constructor(r,n,i){this.name=r,this.prefix=n,this.baseEncode=i}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class zn{constructor(r,n,i){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return cr(this,r)}}class Jn{constructor(r){this.decoders=r}or(r){return cr(this,r)}decode(r){const n=r[0],i=this.decoders[n];if(i)return i.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const cr=(e,r)=>new Jn({...e.decoders||{[e.prefix]:e},...r.decoders||{[r.prefix]:r}});class Vn{constructor(r,n,i,a){this.name=r,this.prefix=n,this.baseEncode=i,this.baseDecode=a,this.encoder=new Wn(r,n,i),this.decoder=new zn(r,n,a)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const ot=({name:e,prefix:r,encode:n,decode:i})=>new Vn(e,r,n,i),Xe=({prefix:e,name:r,alphabet:n})=>{const{encode:i,decode:a}=Kn(n,r);return ot({prefix:e,name:r,encode:i,decode:o=>or(a(o))})},kn=(e,r,n,i)=>{const a={};for(let _=0;_<r.length;++_)a[r[_]]=_;let o=e.length;for(;e[o-1]==="=";)--o;const x=new Uint8Array(o*n/8|0);let d=0,h=0,D=0;for(let _=0;_<o;++_){const I=a[e[_]];if(I===void 0)throw new SyntaxError(`Non-${i} character`);h=h<<n|I,d+=n,d>=8&&(d-=8,x[D++]=255&h>>d)}if(d>=n||255&h<<8-d)throw new SyntaxError("Unexpected end of data");return x},Xn=(e,r,n)=>{const i=r[r.length-1]==="=",a=(1<<n)-1;let o="",x=0,d=0;for(let h=0;h<e.length;++h)for(d=d<<8|e[h],x+=8;x>n;)x-=n,o+=r[a&d>>x];if(x&&(o+=r[a&d<<n-x]),i)for(;o.length*n&7;)o+="=";return o},q=({name:e,prefix:r,bitsPerChar:n,alphabet:i})=>ot({prefix:r,name:e,encode(a){return Xn(a,i,n)},decode(a){return kn(a,i,n,e)}}),qn=ot({prefix:"\0",name:"identity",encode:e=>Yn(e),decode:e=>Gn(e)});var Zn=Object.freeze({__proto__:null,identity:qn});const Qn=q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ei=Object.freeze({__proto__:null,base2:Qn});const ti=q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ri=Object.freeze({__proto__:null,base8:ti});const ni=Xe({prefix:"9",name:"base10",alphabet:"0123456789"});var ii=Object.freeze({__proto__:null,base10:ni});const ai=q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ui=q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var fi=Object.freeze({__proto__:null,base16:ai,base16upper:ui});const oi=q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ci=q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),si=q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Di=q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),di=q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),li=q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),bi=q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),hi=q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),_i=q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ei=Object.freeze({__proto__:null,base32:oi,base32upper:ci,base32pad:si,base32padupper:Di,base32hex:di,base32hexupper:li,base32hexpad:bi,base32hexpadupper:hi,base32z:_i});const yi=Xe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),xi=Xe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var wi=Object.freeze({__proto__:null,base36:yi,base36upper:xi});const vi=Xe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),pi=Xe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var mi=Object.freeze({__proto__:null,base58btc:vi,base58flickr:pi});const gi=q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Si=q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ci=q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ai=q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Oi=Object.freeze({__proto__:null,base64:gi,base64pad:Si,base64url:Ci,base64urlpad:Ai});const sr=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Ui=sr.reduce((e,r,n)=>(e[n]=r,e),[]),Ti=sr.reduce((e,r,n)=>(e[r.codePointAt(0)]=n,e),[]);function Ni(e){return e.reduce((r,n)=>(r+=Ui[n],r),"")}function Ii(e){const r=[];for(const n of e){const i=Ti[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(i)}return new Uint8Array(r)}const Fi=ot({prefix:"\u{1F680}",name:"base256emoji",encode:Ni,decode:Ii});var Mi=Object.freeze({__proto__:null,base256emoji:Fi}),Bi=dr,Dr=128,Li=127,Ri=~Li,Hi=Math.pow(2,31);function dr(e,r,n){r=r||[],n=n||0;for(var i=n;e>=Hi;)r[n++]=e&255|Dr,e/=128;for(;e&Ri;)r[n++]=e&255|Dr,e>>>=7;return r[n]=e|0,dr.bytes=n-i+1,r}var Pi=It,ji=128,lr=127;function It(e,i){var n=0,i=i||0,a=0,o=i,x,d=e.length;do{if(o>=d)throw It.bytes=0,new RangeError("Could not decode varint");x=e[o++],n+=a<28?(x&lr)<<a:(x&lr)*Math.pow(2,a),a+=7}while(x>=ji);return It.bytes=o-i,n}var $i=Math.pow(2,7),Ki=Math.pow(2,14),Gi=Math.pow(2,21),Yi=Math.pow(2,28),Wi=Math.pow(2,35),zi=Math.pow(2,42),Ji=Math.pow(2,49),Vi=Math.pow(2,56),ki=Math.pow(2,63),Xi=function(e){return e<$i?1:e<Ki?2:e<Gi?3:e<Yi?4:e<Wi?5:e<zi?6:e<Ji?7:e<Vi?8:e<ki?9:10},qi={encode:Bi,decode:Pi,encodingLength:Xi},br=qi;const hr=(e,r,n=0)=>(br.encode(e,r,n),r),_r=e=>br.encodingLength(e),Ft=(e,r)=>{const n=r.byteLength,i=_r(e),a=i+_r(n),o=new Uint8Array(a+n);return hr(e,o,0),hr(n,o,i),o.set(r,a),new Zi(e,n,r,o)};class Zi{constructor(r,n,i,a){this.code=r,this.size=n,this.digest=i,this.bytes=a}}const Er=({name:e,code:r,encode:n})=>new Qi(e,r,n);class Qi{constructor(r,n,i){this.name=r,this.code=n,this.encode=i}digest(r){if(r instanceof Uint8Array){const n=this.encode(r);return n instanceof Uint8Array?Ft(this.code,n):n.then(i=>Ft(this.code,i))}else throw Error("Unknown type, must be binary type")}}const yr=e=>async r=>new Uint8Array(await crypto.subtle.digest(e,r)),ea=Er({name:"sha2-256",code:18,encode:yr("SHA-256")}),ta=Er({name:"sha2-512",code:19,encode:yr("SHA-512")});var ra=Object.freeze({__proto__:null,sha256:ea,sha512:ta});const xr=0,na="identity",wr=or;var ia=Object.freeze({__proto__:null,identity:{code:xr,name:na,encode:wr,digest:e=>Ft(xr,wr(e))}});new TextEncoder,new TextDecoder;const vr={...Zn,...ei,...ri,...ii,...fi,...Ei,...wi,...mi,...Oi,...Mi};({...ra,...ia});function pr(e,r,n,i){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:i}}}const mr=pr("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Mt=pr("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=fr(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),gr={utf8:mr,"utf-8":mr,hex:vr.base16,latin1:Mt,ascii:Mt,binary:Mt,...vr};function Ke(e,r="utf8"){const n=gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}function Re(e,r="utf8"){const n=gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Nt(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}const aa=e=>JSON.stringify(e,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),ua=e=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=e.replace(r,'$1"$2n"$3');return JSON.parse(n,(i,a)=>typeof a=="string"&&a.match(/^\d+n$/)?BigInt(a.substring(0,a.length-1)):a)};function fa(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return ua(e)}catch{return e}}function oa(e){return typeof e=="string"?e:aa(e)||""}function qe(e){return fa(Ke(Re(e,Ve),St))}function Ze(e){return Ke(Re(oa(e),St),Ve)}function Sr(e){const r=Re(Tt,ke),n=Ut+Ke(Pn([r,e]),ke);return[At,Ot,n].join(Ct)}function Cr(e){const[r,n,i]=e.split(Ct);if(r!==At||n!==Ot)throw new Error('Issuer must be a DID with method "key"');if(i.slice(0,1)!==Ut)throw new Error("Issuer must be a key in mulicodec format");const a=Re(i.slice(1),ke);if(Ke(a.slice(0,2),ke)!==Tt)throw new Error('Issuer must be a public key with type "Ed25519"');const o=a.slice(2);if(o.length!==ar)throw new Error("Issuer must be a public key with length 32 bytes");return o}function Ar(e){return Ke(e,Ve)}function Or(e){return Re(e,Ve)}function Ur(e){return Re([Ze(e.header),Ze(e.payload)].join($e),ft)}function ca(e){const r=Ke(e,ft).split($e),n=qe(r[0]),i=qe(r[1]);return{header:n,payload:i}}function Tr(e){return[Ze(e.header),Ze(e.payload),Ar(e.signature)].join($e)}function Nr(e){const r=e.split($e),n=qe(r[0]),i=qe(r[1]),a=Or(r[2]),o=Re(r.slice(0,2).join($e),ft);return{header:n,payload:i,signature:a,data:o}}function sa(e=st.randomBytes(ur)){return et.generateKeyPairFromSeed(e)}async function Da(e,r,n,i,a=ht.fromMiliseconds(Date.now())){const o={alg:mt,typ:gt},x=Sr(i.publicKey),d=a+n,h={iss:x,sub:e,aud:r,iat:a,exp:d},D=Ur({header:o,payload:h}),_=et.sign(i.secretKey,D);return Tr({header:o,payload:h,signature:_})}async function da(e){const{header:r,payload:n,data:i,signature:a}=Nr(e);if(r.alg!==mt||r.typ!==gt)throw new Error("JWT must use EdDSA algorithm");const o=Cr(n.iss);return et.verify(o,i,a)}O.DATA_ENCODING=ft,O.DID_DELIMITER=Ct,O.DID_METHOD=Ot,O.DID_PREFIX=At,O.JSON_ENCODING=St,O.JWT_DELIMITER=$e,O.JWT_ENCODING=Ve,O.JWT_IRIDIUM_ALG=mt,O.JWT_IRIDIUM_TYP=gt,O.KEY_PAIR_SEED_LENGTH=ur,O.MULTICODEC_ED25519_BASE=Ut,O.MULTICODEC_ED25519_ENCODING=ke,O.MULTICODEC_ED25519_HEADER=Tt,O.MULTICODEC_ED25519_LENGTH=ar,O.decodeData=ca,O.decodeIss=Cr,O.decodeJSON=qe,O.decodeJWT=Nr,O.decodeSig=Or,O.encodeData=Ur,O.encodeIss=Sr,O.encodeJSON=Ze,O.encodeJWT=Tr,O.encodeSig=Ar,O.generateKeyPair=sa,O.signJWT=Da,O.verifyJWT=da,Object.defineProperty(O,"__esModule",{value:!0})}); | ||
(function(A,Ge){typeof exports=="object"&&typeof module<"u"?Ge(exports):typeof define=="function"&&define.amd?define(["exports"],Ge):(A=typeof globalThis<"u"?globalThis:A||self,Ge(A["@walletconnect/relay-auth"]={}))})(this,function(A){"use strict";function Ge(t){var r=t.default;if(typeof r=="function"){var n=function(){return r.apply(this,arguments)};n.prototype=r.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var a=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,a.get?a:{enumerable:!0,get:function(){return t[o]}})}),n}var Ve={},nt={},Xe={},Ye={};Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.BrowserRandomSource=void 0;const gt=65536;class ar{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let o=0;o<n.length;o+=gt)this._crypto.getRandomValues(n.subarray(o,o+Math.min(n.length-o,gt)));return n}}Ye.BrowserRandomSource=ar;function fr(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qe={},He={};Object.defineProperty(He,"__esModule",{value:!0});function or(t){for(var r=0;r<t.length;r++)t[r]=0;return t}He.wipe=or;var Dr={},cr=Object.freeze({__proto__:null,default:Dr}),sr=Ge(cr);Object.defineProperty(qe,"__esModule",{value:!0}),qe.NodeRandomSource=void 0;const dr=He;class br{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof fr<"u"){const r=sr;r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const o=new Uint8Array(r);for(let a=0;a<o.length;a++)o[a]=n[a];return(0,dr.wipe)(n),o}}qe.NodeRandomSource=br,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.SystemRandomSource=void 0;const lr=Ye,hr=qe;class Er{constructor(){if(this.isAvailable=!1,this.name="",this._source=new lr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new hr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}Xe.SystemRandomSource=Er;var m={},mt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function r(d,h){var w=d>>>16&65535,E=d&65535,K=h>>>16&65535,V=h&65535;return E*V+(w*V+E*K<<16>>>0)|0}t.mul=Math.imul||r;function n(d,h){return d+h|0}t.add=n;function o(d,h){return d-h|0}t.sub=o;function a(d,h){return d<<h|d>>>32-h}t.rotl=a;function x(d,h){return d<<32-h|d>>>h}t.rotr=x;function U(d){return typeof d=="number"&&isFinite(d)&&Math.floor(d)===d}t.isInteger=Number.isInteger||U,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(d){return t.isInteger(d)&&d>=-t.MAX_SAFE_INTEGER&&d<=t.MAX_SAFE_INTEGER}})(mt),Object.defineProperty(m,"__esModule",{value:!0});var At=mt;function xr(t,r){return r===void 0&&(r=0),(t[r+0]<<8|t[r+1])<<16>>16}m.readInt16BE=xr;function wr(t,r){return r===void 0&&(r=0),(t[r+0]<<8|t[r+1])>>>0}m.readUint16BE=wr;function yr(t,r){return r===void 0&&(r=0),(t[r+1]<<8|t[r])<<16>>16}m.readInt16LE=yr;function _r(t,r){return r===void 0&&(r=0),(t[r+1]<<8|t[r])>>>0}m.readUint16LE=_r;function Ut(t,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=t>>>8,r[n+1]=t>>>0,r}m.writeUint16BE=Ut,m.writeInt16BE=Ut;function Lt(t,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=t>>>0,r[n+1]=t>>>8,r}m.writeUint16LE=Lt,m.writeInt16LE=Lt;function it(t,r){return r===void 0&&(r=0),t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]}m.readInt32BE=it;function ut(t,r){return r===void 0&&(r=0),(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0}m.readUint32BE=ut;function at(t,r){return r===void 0&&(r=0),t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]}m.readInt32LE=at;function ft(t,r){return r===void 0&&(r=0),(t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r])>>>0}m.readUint32LE=ft;function Ze(t,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=t>>>24,r[n+1]=t>>>16,r[n+2]=t>>>8,r[n+3]=t>>>0,r}m.writeUint32BE=Ze,m.writeInt32BE=Ze;function Qe(t,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=t>>>0,r[n+1]=t>>>8,r[n+2]=t>>>16,r[n+3]=t>>>24,r}m.writeUint32LE=Qe,m.writeInt32LE=Qe;function vr(t,r){r===void 0&&(r=0);var n=it(t,r),o=it(t,r+4);return n*4294967296+o-(o>>31)*4294967296}m.readInt64BE=vr;function pr(t,r){r===void 0&&(r=0);var n=ut(t,r),o=ut(t,r+4);return n*4294967296+o}m.readUint64BE=pr;function Cr(t,r){r===void 0&&(r=0);var n=at(t,r),o=at(t,r+4);return o*4294967296+n-(n>>31)*4294967296}m.readInt64LE=Cr;function gr(t,r){r===void 0&&(r=0);var n=ft(t,r),o=ft(t,r+4);return o*4294967296+n}m.readUint64LE=gr;function Bt(t,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Ze(t/4294967296>>>0,r,n),Ze(t>>>0,r,n+4),r}m.writeUint64BE=Bt,m.writeInt64BE=Bt;function St(t,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Qe(t>>>0,r,n),Qe(t/4294967296>>>0,r,n+4),r}m.writeUint64LE=St,m.writeInt64LE=St;function mr(t,r,n){if(n===void 0&&(n=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var o=0,a=1,x=t/8+n-1;x>=n;x--)o+=r[x]*a,a*=256;return o}m.readUintBE=mr;function Ar(t,r,n){if(n===void 0&&(n=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var o=0,a=1,x=n;x<n+t/8;x++)o+=r[x]*a,a*=256;return o}m.readUintLE=Ar;function Ur(t,r,n,o){if(n===void 0&&(n=new Uint8Array(t/8)),o===void 0&&(o=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!At.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var a=1,x=t/8+o-1;x>=o;x--)n[x]=r/a&255,a*=256;return n}m.writeUintBE=Ur;function Lr(t,r,n,o){if(n===void 0&&(n=new Uint8Array(t/8)),o===void 0&&(o=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!At.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var a=1,x=o;x<o+t/8;x++)n[x]=r/a&255,a*=256;return n}m.writeUintLE=Lr;function Br(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat32(r)}m.readFloat32BE=Br;function Sr(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat32(r,!0)}m.readFloat32LE=Sr;function Fr(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat64(r)}m.readFloat64BE=Fr;function Ir(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat64(r,!0)}m.readFloat64LE=Ir;function Tr(t,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var o=new DataView(r.buffer,r.byteOffset,r.byteLength);return o.setFloat32(n,t),r}m.writeFloat32BE=Tr;function Mr(t,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var o=new DataView(r.buffer,r.byteOffset,r.byteLength);return o.setFloat32(n,t,!0),r}m.writeFloat32LE=Mr;function Nr(t,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var o=new DataView(r.buffer,r.byteOffset,r.byteLength);return o.setFloat64(n,t),r}m.writeFloat64BE=Nr;function Or(t,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var o=new DataView(r.buffer,r.byteOffset,r.byteLength);return o.setFloat64(n,t,!0),r}m.writeFloat64LE=Or,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const r=Xe,n=m,o=He;t.defaultRandomSource=new r.SystemRandomSource;function a(w,E=t.defaultRandomSource){return E.randomBytes(w)}t.randomBytes=a;function x(w=t.defaultRandomSource){const E=a(4,w),K=(0,n.readUint32LE)(E);return(0,o.wipe)(E),K}t.randomUint32=x;const U="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function d(w,E=U,K=t.defaultRandomSource){if(E.length<2)throw new Error("randomString charset is too short");if(E.length>256)throw new Error("randomString charset is too long");let V="";const P=E.length,_=256-256%P;for(;w>0;){const B=a(Math.ceil(w*256/_),K);for(let T=0;T<B.length&&w>0;T++){const R=B[T];R<_&&(V+=E.charAt(R%P),w--)}(0,o.wipe)(B)}return V}t.randomString=d;function h(w,E=U,K=t.defaultRandomSource){const V=Math.ceil(w/(Math.log(E.length)/Math.LN2));return d(V,E,K)}t.randomStringForEntropy=h}(nt);var Ft={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=m,n=He;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var o=function(){function d(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return d.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},d.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},d.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},d.prototype.update=function(h,w){if(w===void 0&&(w=h.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var E=0;if(this._bytesHashed+=w,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&w>0;)this._buffer[this._bufferLength++]=h[E++],w--;this._bufferLength===this.blockSize&&(x(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(w>=this.blockSize&&(E=x(this._tempHi,this._tempLo,this._stateHi,this._stateLo,h,E,w),w%=this.blockSize);w>0;)this._buffer[this._bufferLength++]=h[E++],w--;return this},d.prototype.finish=function(h){if(!this._finished){var w=this._bytesHashed,E=this._bufferLength,K=w/536870912|0,V=w<<3,P=w%128<112?128:256;this._buffer[E]=128;for(var _=E+1;_<P-8;_++)this._buffer[_]=0;r.writeUint32BE(K,this._buffer,P-8),r.writeUint32BE(V,this._buffer,P-4),x(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,P),this._finished=!0}for(var _=0;_<this.digestLength/8;_++)r.writeUint32BE(this._stateHi[_],h,_*8),r.writeUint32BE(this._stateLo[_],h,_*8+4);return this},d.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},d.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},d.prototype.restoreState=function(h){return this._stateHi.set(h.stateHi),this._stateLo.set(h.stateLo),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},d.prototype.cleanSavedState=function(h){n.wipe(h.stateHi),n.wipe(h.stateLo),h.buffer&&n.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},d}();t.SHA512=o;var a=new Int32Array([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 x(d,h,w,E,K,V,P){for(var _=w[0],B=w[1],T=w[2],R=w[3],F=w[4],J=w[5],$=w[6],M=w[7],L=E[0],C=E[1],N=E[2],Ae=E[3],Ce=E[4],Se=E[5],Te=E[6],Fe=E[7],s,c,z,Z,v,b,l,y;P>=128;){for(var ye=0;ye<16;ye++){var X=8*ye+V;d[ye]=r.readUint32BE(K,X),h[ye]=r.readUint32BE(K,X+4)}for(var ye=0;ye<80;ye++){var _t=_,vt=B,pt=T,f=R,D=F,u=J,e=$,i=M,p=L,g=C,I=N,O=Ae,S=Ce,H=Se,_e=Te,Q=Fe;if(s=M,c=Fe,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=(F>>>14|Ce<<32-14)^(F>>>18|Ce<<32-18)^(Ce>>>41-32|F<<32-(41-32)),c=(Ce>>>14|F<<32-14)^(Ce>>>18|F<<32-18)^(F>>>41-32|Ce<<32-(41-32)),v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,s=F&J^~F&$,c=Ce&Se^~Ce&Te,v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,s=a[ye*2],c=a[ye*2+1],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,s=d[ye%16],c=h[ye%16],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,z=l&65535|y<<16,Z=v&65535|b<<16,s=z,c=Z,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=(_>>>28|L<<32-28)^(L>>>34-32|_<<32-(34-32))^(L>>>39-32|_<<32-(39-32)),c=(L>>>28|_<<32-28)^(_>>>34-32|L<<32-(34-32))^(_>>>39-32|L<<32-(39-32)),v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,s=_&B^_&T^B&T,c=L&C^L&N^C&N,v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,i=l&65535|y<<16,Q=v&65535|b<<16,s=f,c=O,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=z,c=Z,v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,f=l&65535|y<<16,O=v&65535|b<<16,B=_t,T=vt,R=pt,F=f,J=D,$=u,M=e,_=i,C=p,N=g,Ae=I,Ce=O,Se=S,Te=H,Fe=_e,L=Q,ye%16===15)for(var X=0;X<16;X++)s=d[X],c=h[X],v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=d[(X+9)%16],c=h[(X+9)%16],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,z=d[(X+1)%16],Z=h[(X+1)%16],s=(z>>>1|Z<<32-1)^(z>>>8|Z<<32-8)^z>>>7,c=(Z>>>1|z<<32-1)^(Z>>>8|z<<32-8)^(Z>>>7|z<<32-7),v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,z=d[(X+14)%16],Z=h[(X+14)%16],s=(z>>>19|Z<<32-19)^(Z>>>61-32|z<<32-(61-32))^z>>>6,c=(Z>>>19|z<<32-19)^(z>>>61-32|Z<<32-(61-32))^(Z>>>6|z<<32-6),v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,d[X]=l&65535|y<<16,h[X]=v&65535|b<<16}s=_,c=L,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=w[0],c=E[0],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,w[0]=_=l&65535|y<<16,E[0]=L=v&65535|b<<16,s=B,c=C,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=w[1],c=E[1],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,w[1]=B=l&65535|y<<16,E[1]=C=v&65535|b<<16,s=T,c=N,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=w[2],c=E[2],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,w[2]=T=l&65535|y<<16,E[2]=N=v&65535|b<<16,s=R,c=Ae,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=w[3],c=E[3],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,w[3]=R=l&65535|y<<16,E[3]=Ae=v&65535|b<<16,s=F,c=Ce,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=w[4],c=E[4],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,w[4]=F=l&65535|y<<16,E[4]=Ce=v&65535|b<<16,s=J,c=Se,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=w[5],c=E[5],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,w[5]=J=l&65535|y<<16,E[5]=Se=v&65535|b<<16,s=$,c=Te,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=w[6],c=E[6],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,w[6]=$=l&65535|y<<16,E[6]=Te=v&65535|b<<16,s=M,c=Fe,v=c&65535,b=c>>>16,l=s&65535,y=s>>>16,s=w[7],c=E[7],v+=c&65535,b+=c>>>16,l+=s&65535,y+=s>>>16,b+=v>>>16,l+=b>>>16,y+=l>>>16,w[7]=M=l&65535|y<<16,E[7]=Fe=v&65535|b<<16,V+=128,P-=128}return V}function U(d){var h=new o;h.update(d);var w=h.digest();return h.clean(),w}t.hash=U})(Ft),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const r=nt,n=Ft,o=He;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function a(f){const D=new Float64Array(16);if(f)for(let u=0;u<f.length;u++)D[u]=f[u];return D}const x=new Uint8Array(32);x[0]=9;const U=a(),d=a([1]),h=a([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),w=a([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),E=a([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),K=a([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),V=a([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function P(f,D){for(let u=0;u<16;u++)f[u]=D[u]|0}function _(f){let D=1;for(let u=0;u<16;u++){let e=f[u]+D+65535;D=Math.floor(e/65536),f[u]=e-D*65536}f[0]+=D-1+37*(D-1)}function B(f,D,u){const e=~(u-1);for(let i=0;i<16;i++){const p=e&(f[i]^D[i]);f[i]^=p,D[i]^=p}}function T(f,D){const u=a(),e=a();for(let i=0;i<16;i++)e[i]=D[i];_(e),_(e),_(e);for(let i=0;i<2;i++){u[0]=e[0]-65517;for(let g=1;g<15;g++)u[g]=e[g]-65535-(u[g-1]>>16&1),u[g-1]&=65535;u[15]=e[15]-32767-(u[14]>>16&1);const p=u[15]>>16&1;u[14]&=65535,B(e,u,1-p)}for(let i=0;i<16;i++)f[2*i]=e[i]&255,f[2*i+1]=e[i]>>8}function R(f,D){let u=0;for(let e=0;e<32;e++)u|=f[e]^D[e];return(1&u-1>>>8)-1}function F(f,D){const u=new Uint8Array(32),e=new Uint8Array(32);return T(u,f),T(e,D),R(u,e)}function J(f){const D=new Uint8Array(32);return T(D,f),D[0]&1}function $(f,D){for(let u=0;u<16;u++)f[u]=D[2*u]+(D[2*u+1]<<8);f[15]&=32767}function M(f,D,u){for(let e=0;e<16;e++)f[e]=D[e]+u[e]}function L(f,D,u){for(let e=0;e<16;e++)f[e]=D[e]-u[e]}function C(f,D,u){let e,i,p=0,g=0,I=0,O=0,S=0,H=0,_e=0,Q=0,ve=0,te=0,ee=0,Y=0,W=0,k=0,j=0,G=0,re=0,pe=0,ge=0,me=0,Ue=0,Le=0,Be=0,Ie=0,Me=0,Oe=0,je=0,We=0,rt=0,Ct=0,ur=0,ne=u[0],ie=u[1],ue=u[2],ae=u[3],fe=u[4],oe=u[5],De=u[6],ce=u[7],se=u[8],de=u[9],be=u[10],le=u[11],he=u[12],Ee=u[13],xe=u[14],we=u[15];e=D[0],p+=e*ne,g+=e*ie,I+=e*ue,O+=e*ae,S+=e*fe,H+=e*oe,_e+=e*De,Q+=e*ce,ve+=e*se,te+=e*de,ee+=e*be,Y+=e*le,W+=e*he,k+=e*Ee,j+=e*xe,G+=e*we,e=D[1],g+=e*ne,I+=e*ie,O+=e*ue,S+=e*ae,H+=e*fe,_e+=e*oe,Q+=e*De,ve+=e*ce,te+=e*se,ee+=e*de,Y+=e*be,W+=e*le,k+=e*he,j+=e*Ee,G+=e*xe,re+=e*we,e=D[2],I+=e*ne,O+=e*ie,S+=e*ue,H+=e*ae,_e+=e*fe,Q+=e*oe,ve+=e*De,te+=e*ce,ee+=e*se,Y+=e*de,W+=e*be,k+=e*le,j+=e*he,G+=e*Ee,re+=e*xe,pe+=e*we,e=D[3],O+=e*ne,S+=e*ie,H+=e*ue,_e+=e*ae,Q+=e*fe,ve+=e*oe,te+=e*De,ee+=e*ce,Y+=e*se,W+=e*de,k+=e*be,j+=e*le,G+=e*he,re+=e*Ee,pe+=e*xe,ge+=e*we,e=D[4],S+=e*ne,H+=e*ie,_e+=e*ue,Q+=e*ae,ve+=e*fe,te+=e*oe,ee+=e*De,Y+=e*ce,W+=e*se,k+=e*de,j+=e*be,G+=e*le,re+=e*he,pe+=e*Ee,ge+=e*xe,me+=e*we,e=D[5],H+=e*ne,_e+=e*ie,Q+=e*ue,ve+=e*ae,te+=e*fe,ee+=e*oe,Y+=e*De,W+=e*ce,k+=e*se,j+=e*de,G+=e*be,re+=e*le,pe+=e*he,ge+=e*Ee,me+=e*xe,Ue+=e*we,e=D[6],_e+=e*ne,Q+=e*ie,ve+=e*ue,te+=e*ae,ee+=e*fe,Y+=e*oe,W+=e*De,k+=e*ce,j+=e*se,G+=e*de,re+=e*be,pe+=e*le,ge+=e*he,me+=e*Ee,Ue+=e*xe,Le+=e*we,e=D[7],Q+=e*ne,ve+=e*ie,te+=e*ue,ee+=e*ae,Y+=e*fe,W+=e*oe,k+=e*De,j+=e*ce,G+=e*se,re+=e*de,pe+=e*be,ge+=e*le,me+=e*he,Ue+=e*Ee,Le+=e*xe,Be+=e*we,e=D[8],ve+=e*ne,te+=e*ie,ee+=e*ue,Y+=e*ae,W+=e*fe,k+=e*oe,j+=e*De,G+=e*ce,re+=e*se,pe+=e*de,ge+=e*be,me+=e*le,Ue+=e*he,Le+=e*Ee,Be+=e*xe,Ie+=e*we,e=D[9],te+=e*ne,ee+=e*ie,Y+=e*ue,W+=e*ae,k+=e*fe,j+=e*oe,G+=e*De,re+=e*ce,pe+=e*se,ge+=e*de,me+=e*be,Ue+=e*le,Le+=e*he,Be+=e*Ee,Ie+=e*xe,Me+=e*we,e=D[10],ee+=e*ne,Y+=e*ie,W+=e*ue,k+=e*ae,j+=e*fe,G+=e*oe,re+=e*De,pe+=e*ce,ge+=e*se,me+=e*de,Ue+=e*be,Le+=e*le,Be+=e*he,Ie+=e*Ee,Me+=e*xe,Oe+=e*we,e=D[11],Y+=e*ne,W+=e*ie,k+=e*ue,j+=e*ae,G+=e*fe,re+=e*oe,pe+=e*De,ge+=e*ce,me+=e*se,Ue+=e*de,Le+=e*be,Be+=e*le,Ie+=e*he,Me+=e*Ee,Oe+=e*xe,je+=e*we,e=D[12],W+=e*ne,k+=e*ie,j+=e*ue,G+=e*ae,re+=e*fe,pe+=e*oe,ge+=e*De,me+=e*ce,Ue+=e*se,Le+=e*de,Be+=e*be,Ie+=e*le,Me+=e*he,Oe+=e*Ee,je+=e*xe,We+=e*we,e=D[13],k+=e*ne,j+=e*ie,G+=e*ue,re+=e*ae,pe+=e*fe,ge+=e*oe,me+=e*De,Ue+=e*ce,Le+=e*se,Be+=e*de,Ie+=e*be,Me+=e*le,Oe+=e*he,je+=e*Ee,We+=e*xe,rt+=e*we,e=D[14],j+=e*ne,G+=e*ie,re+=e*ue,pe+=e*ae,ge+=e*fe,me+=e*oe,Ue+=e*De,Le+=e*ce,Be+=e*se,Ie+=e*de,Me+=e*be,Oe+=e*le,je+=e*he,We+=e*Ee,rt+=e*xe,Ct+=e*we,e=D[15],G+=e*ne,re+=e*ie,pe+=e*ue,ge+=e*ae,me+=e*fe,Ue+=e*oe,Le+=e*De,Be+=e*ce,Ie+=e*se,Me+=e*de,Oe+=e*be,je+=e*le,We+=e*he,rt+=e*Ee,Ct+=e*xe,ur+=e*we,p+=38*re,g+=38*pe,I+=38*ge,O+=38*me,S+=38*Ue,H+=38*Le,_e+=38*Be,Q+=38*Ie,ve+=38*Me,te+=38*Oe,ee+=38*je,Y+=38*We,W+=38*rt,k+=38*Ct,j+=38*ur,i=1,e=p+i+65535,i=Math.floor(e/65536),p=e-i*65536,e=g+i+65535,i=Math.floor(e/65536),g=e-i*65536,e=I+i+65535,i=Math.floor(e/65536),I=e-i*65536,e=O+i+65535,i=Math.floor(e/65536),O=e-i*65536,e=S+i+65535,i=Math.floor(e/65536),S=e-i*65536,e=H+i+65535,i=Math.floor(e/65536),H=e-i*65536,e=_e+i+65535,i=Math.floor(e/65536),_e=e-i*65536,e=Q+i+65535,i=Math.floor(e/65536),Q=e-i*65536,e=ve+i+65535,i=Math.floor(e/65536),ve=e-i*65536,e=te+i+65535,i=Math.floor(e/65536),te=e-i*65536,e=ee+i+65535,i=Math.floor(e/65536),ee=e-i*65536,e=Y+i+65535,i=Math.floor(e/65536),Y=e-i*65536,e=W+i+65535,i=Math.floor(e/65536),W=e-i*65536,e=k+i+65535,i=Math.floor(e/65536),k=e-i*65536,e=j+i+65535,i=Math.floor(e/65536),j=e-i*65536,e=G+i+65535,i=Math.floor(e/65536),G=e-i*65536,p+=i-1+37*(i-1),i=1,e=p+i+65535,i=Math.floor(e/65536),p=e-i*65536,e=g+i+65535,i=Math.floor(e/65536),g=e-i*65536,e=I+i+65535,i=Math.floor(e/65536),I=e-i*65536,e=O+i+65535,i=Math.floor(e/65536),O=e-i*65536,e=S+i+65535,i=Math.floor(e/65536),S=e-i*65536,e=H+i+65535,i=Math.floor(e/65536),H=e-i*65536,e=_e+i+65535,i=Math.floor(e/65536),_e=e-i*65536,e=Q+i+65535,i=Math.floor(e/65536),Q=e-i*65536,e=ve+i+65535,i=Math.floor(e/65536),ve=e-i*65536,e=te+i+65535,i=Math.floor(e/65536),te=e-i*65536,e=ee+i+65535,i=Math.floor(e/65536),ee=e-i*65536,e=Y+i+65535,i=Math.floor(e/65536),Y=e-i*65536,e=W+i+65535,i=Math.floor(e/65536),W=e-i*65536,e=k+i+65535,i=Math.floor(e/65536),k=e-i*65536,e=j+i+65535,i=Math.floor(e/65536),j=e-i*65536,e=G+i+65535,i=Math.floor(e/65536),G=e-i*65536,p+=i-1+37*(i-1),f[0]=p,f[1]=g,f[2]=I,f[3]=O,f[4]=S,f[5]=H,f[6]=_e,f[7]=Q,f[8]=ve,f[9]=te,f[10]=ee,f[11]=Y,f[12]=W,f[13]=k,f[14]=j,f[15]=G}function N(f,D){C(f,D,D)}function Ae(f,D){const u=a();let e;for(e=0;e<16;e++)u[e]=D[e];for(e=253;e>=0;e--)N(u,u),e!==2&&e!==4&&C(u,u,D);for(e=0;e<16;e++)f[e]=u[e]}function Ce(f,D){const u=a();let e;for(e=0;e<16;e++)u[e]=D[e];for(e=250;e>=0;e--)N(u,u),e!==1&&C(u,u,D);for(e=0;e<16;e++)f[e]=u[e]}function Se(f,D){const u=a(),e=a(),i=a(),p=a(),g=a(),I=a(),O=a(),S=a(),H=a();L(u,f[1],f[0]),L(H,D[1],D[0]),C(u,u,H),M(e,f[0],f[1]),M(H,D[0],D[1]),C(e,e,H),C(i,f[3],D[3]),C(i,i,w),C(p,f[2],D[2]),M(p,p,p),L(g,e,u),L(I,p,i),M(O,p,i),M(S,e,u),C(f[0],g,I),C(f[1],S,O),C(f[2],O,I),C(f[3],g,S)}function Te(f,D,u){for(let e=0;e<4;e++)B(f[e],D[e],u)}function Fe(f,D){const u=a(),e=a(),i=a();Ae(i,D[2]),C(u,D[0],i),C(e,D[1],i),T(f,e),f[31]^=J(u)<<7}function s(f,D,u){P(f[0],U),P(f[1],d),P(f[2],d),P(f[3],U);for(let e=255;e>=0;--e){const i=u[e/8|0]>>(e&7)&1;Te(f,D,i),Se(D,f),Se(f,f),Te(f,D,i)}}function c(f,D){const u=[a(),a(),a(),a()];P(u[0],E),P(u[1],K),P(u[2],d),C(u[3],E,K),s(f,u,D)}function z(f){if(f.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const D=(0,n.hash)(f);D[0]&=248,D[31]&=127,D[31]|=64;const u=new Uint8Array(32),e=[a(),a(),a(),a()];c(e,D),Fe(u,e);const i=new Uint8Array(64);return i.set(f),i.set(u,32),{publicKey:u,secretKey:i}}t.generateKeyPairFromSeed=z;function Z(f){const D=(0,r.randomBytes)(32,f),u=z(D);return(0,o.wipe)(D),u}t.generateKeyPair=Z;function v(f){if(f.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(f.subarray(32))}t.extractPublicKeyFromSecretKey=v;const b=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 l(f,D){let u,e,i,p;for(e=63;e>=32;--e){for(u=0,i=e-32,p=e-12;i<p;++i)D[i]+=u-16*D[e]*b[i-(e-32)],u=Math.floor((D[i]+128)/256),D[i]-=u*256;D[i]+=u,D[e]=0}for(u=0,i=0;i<32;i++)D[i]+=u-(D[31]>>4)*b[i],u=D[i]>>8,D[i]&=255;for(i=0;i<32;i++)D[i]-=u*b[i];for(e=0;e<32;e++)D[e+1]+=D[e]>>8,f[e]=D[e]&255}function y(f){const D=new Float64Array(64);for(let u=0;u<64;u++)D[u]=f[u];for(let u=0;u<64;u++)f[u]=0;l(f,D)}function ye(f,D){const u=new Float64Array(64),e=[a(),a(),a(),a()],i=(0,n.hash)(f.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;const p=new Uint8Array(64);p.set(i.subarray(32),32);const g=new n.SHA512;g.update(p.subarray(32)),g.update(D);const I=g.digest();g.clean(),y(I),c(e,I),Fe(p,e),g.reset(),g.update(p.subarray(0,32)),g.update(f.subarray(32)),g.update(D);const O=g.digest();y(O);for(let S=0;S<32;S++)u[S]=I[S];for(let S=0;S<32;S++)for(let H=0;H<32;H++)u[S+H]+=O[S]*i[H];return l(p.subarray(32),u),p}t.sign=ye;function X(f,D){const u=a(),e=a(),i=a(),p=a(),g=a(),I=a(),O=a();return P(f[2],d),$(f[1],D),N(i,f[1]),C(p,i,h),L(i,i,f[2]),M(p,f[2],p),N(g,p),N(I,g),C(O,I,g),C(u,O,i),C(u,u,p),Ce(u,u),C(u,u,i),C(u,u,p),C(u,u,p),C(f[0],u,p),N(e,f[0]),C(e,e,p),F(e,i)&&C(f[0],f[0],V),N(e,f[0]),C(e,e,p),F(e,i)?-1:(J(f[0])===D[31]>>7&&L(f[0],U,f[0]),C(f[3],f[0],f[1]),0)}function _t(f,D,u){const e=new Uint8Array(32),i=[a(),a(),a(),a()],p=[a(),a(),a(),a()];if(u.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(X(p,f))return!1;const g=new n.SHA512;g.update(u.subarray(0,32)),g.update(f),g.update(D);const I=g.digest();return y(I),s(i,p,I),c(p,u.subarray(32)),Se(i,p),Fe(e,i),!R(u,e)}t.verify=_t;function vt(f){let D=[a(),a(),a(),a()];if(X(D,f))throw new Error("Ed25519: invalid public key");let u=a(),e=a(),i=D[1];M(u,d,i),L(e,d,i),Ae(e,e),C(u,u,e);let p=new Uint8Array(32);return T(p,u),p}t.convertPublicKeyToX25519=vt;function pt(f){const D=(0,n.hash)(f.subarray(0,32));D[0]&=248,D[31]&=127,D[31]|=64;const u=new Uint8Array(D.subarray(0,32));return(0,o.wipe)(D),u}t.convertSecretKeyToX25519=pt}(Ve);const Hr=1e3;function Rr(t){return Math.floor(t/Hr)}const ot="EdDSA",Dt="JWT",Re=".",Ke="base64url",ct="utf8",et="utf8",st=":",dt="did",bt="key",$e="base58btc",lt="z",ht="K36",It=32,Tt=32;function Et(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Mt(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Et(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Pr(t,r){r||(r=t.reduce((a,x)=>a+x.length,0));const n=Mt(r);let o=0;for(const a of t)n.set(a,o),o+=a.length;return Et(n)}function jr(t,r){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),o=0;o<n.length;o++)n[o]=255;for(var a=0;a<t.length;a++){var x=t.charAt(a),U=x.charCodeAt(0);if(n[U]!==255)throw new TypeError(x+" is ambiguous");n[U]=a}var d=t.length,h=t.charAt(0),w=Math.log(d)/Math.log(256),E=Math.log(256)/Math.log(d);function K(_){if(_ instanceof Uint8Array||(ArrayBuffer.isView(_)?_=new Uint8Array(_.buffer,_.byteOffset,_.byteLength):Array.isArray(_)&&(_=Uint8Array.from(_))),!(_ instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(_.length===0)return"";for(var B=0,T=0,R=0,F=_.length;R!==F&&_[R]===0;)R++,B++;for(var J=(F-R)*E+1>>>0,$=new Uint8Array(J);R!==F;){for(var M=_[R],L=0,C=J-1;(M!==0||L<T)&&C!==-1;C--,L++)M+=256*$[C]>>>0,$[C]=M%d>>>0,M=M/d>>>0;if(M!==0)throw new Error("Non-zero carry");T=L,R++}for(var N=J-T;N!==J&&$[N]===0;)N++;for(var Ae=h.repeat(B);N<J;++N)Ae+=t.charAt($[N]);return Ae}function V(_){if(typeof _!="string")throw new TypeError("Expected String");if(_.length===0)return new Uint8Array;var B=0;if(_[B]!==" "){for(var T=0,R=0;_[B]===h;)T++,B++;for(var F=(_.length-B)*w+1>>>0,J=new Uint8Array(F);_[B];){var $=n[_.charCodeAt(B)];if($===255)return;for(var M=0,L=F-1;($!==0||M<R)&&L!==-1;L--,M++)$+=d*J[L]>>>0,J[L]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");R=M,B++}if(_[B]!==" "){for(var C=F-R;C!==F&&J[C]===0;)C++;for(var N=new Uint8Array(T+(F-C)),Ae=T;C!==F;)N[Ae++]=J[C++];return N}}}function P(_){var B=V(_);if(B)return B;throw new Error(`Non-${r} character`)}return{encode:K,decodeUnsafe:V,decode:P}}var Gr=jr,Kr=Gr;const Nt=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},$r=t=>new TextEncoder().encode(t),zr=t=>new TextDecoder().decode(t);class kr{constructor(r,n,o){this.name=r,this.prefix=n,this.baseEncode=o}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Jr{constructor(r,n,o){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=o}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Ot(this,r)}}class Wr{constructor(r){this.decoders=r}or(r){return Ot(this,r)}decode(r){const n=r[0],o=this.decoders[n];if(o)return o.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Ot=(t,r)=>new Wr({...t.decoders||{[t.prefix]:t},...r.decoders||{[r.prefix]:r}});class Vr{constructor(r,n,o,a){this.name=r,this.prefix=n,this.baseEncode=o,this.baseDecode=a,this.encoder=new kr(r,n,o),this.decoder=new Jr(r,n,a)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const tt=({name:t,prefix:r,encode:n,decode:o})=>new Vr(t,r,n,o),ze=({prefix:t,name:r,alphabet:n})=>{const{encode:o,decode:a}=Kr(n,r);return tt({prefix:t,name:r,encode:o,decode:x=>Nt(a(x))})},Xr=(t,r,n,o)=>{const a={};for(let E=0;E<r.length;++E)a[r[E]]=E;let x=t.length;for(;t[x-1]==="=";)--x;const U=new Uint8Array(x*n/8|0);let d=0,h=0,w=0;for(let E=0;E<x;++E){const K=a[t[E]];if(K===void 0)throw new SyntaxError(`Non-${o} character`);h=h<<n|K,d+=n,d>=8&&(d-=8,U[w++]=255&h>>d)}if(d>=n||255&h<<8-d)throw new SyntaxError("Unexpected end of data");return U},Yr=(t,r,n)=>{const o=r[r.length-1]==="=",a=(1<<n)-1;let x="",U=0,d=0;for(let h=0;h<t.length;++h)for(d=d<<8|t[h],U+=8;U>n;)U-=n,x+=r[a&d>>U];if(U&&(x+=r[a&d<<n-U]),o)for(;x.length*n&7;)x+="=";return x},q=({name:t,prefix:r,bitsPerChar:n,alphabet:o})=>tt({prefix:r,name:t,encode(a){return Yr(a,o,n)},decode(a){return Xr(a,o,n,t)}}),qr=tt({prefix:"\0",name:"identity",encode:t=>zr(t),decode:t=>$r(t)});var Zr=Object.freeze({__proto__:null,identity:qr});const Qr=q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var en=Object.freeze({__proto__:null,base2:Qr});const tn=q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var rn=Object.freeze({__proto__:null,base8:tn});const nn=ze({prefix:"9",name:"base10",alphabet:"0123456789"});var un=Object.freeze({__proto__:null,base10:nn});const an=q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),fn=q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var on=Object.freeze({__proto__:null,base16:an,base16upper:fn});const Dn=q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),cn=q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),sn=q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),dn=q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),bn=q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ln=q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),hn=q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),En=q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),xn=q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var wn=Object.freeze({__proto__:null,base32:Dn,base32upper:cn,base32pad:sn,base32padupper:dn,base32hex:bn,base32hexupper:ln,base32hexpad:hn,base32hexpadupper:En,base32z:xn});const yn=ze({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),_n=ze({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var vn=Object.freeze({__proto__:null,base36:yn,base36upper:_n});const pn=ze({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Cn=ze({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var gn=Object.freeze({__proto__:null,base58btc:pn,base58flickr:Cn});const mn=q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),An=q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Un=q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ln=q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Bn=Object.freeze({__proto__:null,base64:mn,base64pad:An,base64url:Un,base64urlpad:Ln});const Ht=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Sn=Ht.reduce((t,r,n)=>(t[n]=r,t),[]),Fn=Ht.reduce((t,r,n)=>(t[r.codePointAt(0)]=n,t),[]);function In(t){return t.reduce((r,n)=>(r+=Sn[n],r),"")}function Tn(t){const r=[];for(const n of t){const o=Fn[n.codePointAt(0)];if(o===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(o)}return new Uint8Array(r)}const Mn=tt({prefix:"\u{1F680}",name:"base256emoji",encode:In,decode:Tn});var Nn=Object.freeze({__proto__:null,base256emoji:Mn}),On=Pt,Rt=128,Hn=127,Rn=~Hn,Pn=Math.pow(2,31);function Pt(t,r,n){r=r||[],n=n||0;for(var o=n;t>=Pn;)r[n++]=t&255|Rt,t/=128;for(;t&Rn;)r[n++]=t&255|Rt,t>>>=7;return r[n]=t|0,Pt.bytes=n-o+1,r}var jn=xt,Gn=128,jt=127;function xt(t,o){var n=0,o=o||0,a=0,x=o,U,d=t.length;do{if(x>=d)throw xt.bytes=0,new RangeError("Could not decode varint");U=t[x++],n+=a<28?(U&jt)<<a:(U&jt)*Math.pow(2,a),a+=7}while(U>=Gn);return xt.bytes=x-o,n}var Kn=Math.pow(2,7),$n=Math.pow(2,14),zn=Math.pow(2,21),kn=Math.pow(2,28),Jn=Math.pow(2,35),Wn=Math.pow(2,42),Vn=Math.pow(2,49),Xn=Math.pow(2,56),Yn=Math.pow(2,63),qn=function(t){return t<Kn?1:t<$n?2:t<zn?3:t<kn?4:t<Jn?5:t<Wn?6:t<Vn?7:t<Xn?8:t<Yn?9:10},Zn={encode:On,decode:jn,encodingLength:qn},Gt=Zn;const Kt=(t,r,n=0)=>(Gt.encode(t,r,n),r),$t=t=>Gt.encodingLength(t),wt=(t,r)=>{const n=r.byteLength,o=$t(t),a=o+$t(n),x=new Uint8Array(a+n);return Kt(t,x,0),Kt(n,x,o),x.set(r,a),new Qn(t,n,r,x)};class Qn{constructor(r,n,o,a){this.code=r,this.size=n,this.digest=o,this.bytes=a}}const zt=({name:t,code:r,encode:n})=>new ei(t,r,n);class ei{constructor(r,n,o){this.name=r,this.code=n,this.encode=o}digest(r){if(r instanceof Uint8Array){const n=this.encode(r);return n instanceof Uint8Array?wt(this.code,n):n.then(o=>wt(this.code,o))}else throw Error("Unknown type, must be binary type")}}const kt=t=>async r=>new Uint8Array(await crypto.subtle.digest(t,r)),ti=zt({name:"sha2-256",code:18,encode:kt("SHA-256")}),ri=zt({name:"sha2-512",code:19,encode:kt("SHA-512")});var ni=Object.freeze({__proto__:null,sha256:ti,sha512:ri});const Jt=0,ii="identity",Wt=Nt;var ui=Object.freeze({__proto__:null,identity:{code:Jt,name:ii,encode:Wt,digest:t=>wt(Jt,Wt(t))}});new TextEncoder,new TextDecoder;const Vt={...Zr,...en,...rn,...un,...on,...wn,...vn,...gn,...Bn,...Nn};({...ni,...ui});function Xt(t,r,n,o){return{name:t,prefix:r,encoder:{name:t,prefix:r,encode:n},decoder:{decode:o}}}const Yt=Xt("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),yt=Xt("ascii","a",t=>{let r="a";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return r},t=>{t=t.substring(1);const r=Mt(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}),qt={utf8:Yt,"utf-8":Yt,hex:Vt.base16,latin1:yt,ascii:yt,binary:yt,...Vt};function Pe(t,r="utf8"){const n=qt[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}function Ne(t,r="utf8"){const n=qt[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Et(globalThis.Buffer.from(t,"utf-8")):n.decoder.decode(`${n.prefix}${t}`)}const ai=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),fi=t=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=t.replace(r,'$1"$2n"$3');return JSON.parse(n,(o,a)=>typeof a=="string"&&a.match(/^\d+n$/)?BigInt(a.substring(0,a.length-1)):a)};function oi(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return fi(t)}catch{return t}}function Di(t){return typeof t=="string"?t:ai(t)||""}function ke(t){return oi(Pe(Ne(t,Ke),ct))}function Je(t){return Pe(Ne(Di(t),ct),Ke)}function Zt(t){const r=Ne(ht,$e),n=lt+Pe(Pr([r,t]),$e);return[dt,bt,n].join(st)}function Qt(t){const[r,n,o]=t.split(st);if(r!==dt||n!==bt)throw new Error('Issuer must be a DID with method "key"');if(o.slice(0,1)!==lt)throw new Error("Issuer must be a key in mulicodec format");const a=Ne(o.slice(1),$e);if(Pe(a.slice(0,2),$e)!==ht)throw new Error('Issuer must be a public key with type "Ed25519"');const x=a.slice(2);if(x.length!==It)throw new Error("Issuer must be a public key with length 32 bytes");return x}function er(t){return Pe(t,Ke)}function tr(t){return Ne(t,Ke)}function rr(t){return Ne([Je(t.header),Je(t.payload)].join(Re),et)}function ci(t){const r=Pe(t,et).split(Re),n=ke(r[0]),o=ke(r[1]);return{header:n,payload:o}}function nr(t){return[Je(t.header),Je(t.payload),er(t.signature)].join(Re)}function ir(t){const r=t.split(Re),n=ke(r[0]),o=ke(r[1]),a=tr(r[2]),x=Ne(r.slice(0,2).join(Re),et);return{header:n,payload:o,signature:a,data:x}}function si(t=nt.randomBytes(Tt)){return Ve.generateKeyPairFromSeed(t)}async function di(t,r,n,o,a=Rr(Date.now())){const x={alg:ot,typ:Dt},U=Zt(o.publicKey),d=a+n,h={iss:U,sub:t,aud:r,iat:a,exp:d},w=rr({header:x,payload:h}),E=Ve.sign(o.secretKey,w);return nr({header:x,payload:h,signature:E})}async function bi(t){const{header:r,payload:n,data:o,signature:a}=ir(t);if(r.alg!==ot||r.typ!==Dt)throw new Error("JWT must use EdDSA algorithm");const x=Qt(n.iss);return Ve.verify(x,o,a)}A.DATA_ENCODING=et,A.DID_DELIMITER=st,A.DID_METHOD=bt,A.DID_PREFIX=dt,A.JSON_ENCODING=ct,A.JWT_DELIMITER=Re,A.JWT_ENCODING=Ke,A.JWT_IRIDIUM_ALG=ot,A.JWT_IRIDIUM_TYP=Dt,A.KEY_PAIR_SEED_LENGTH=Tt,A.MULTICODEC_ED25519_BASE=lt,A.MULTICODEC_ED25519_ENCODING=$e,A.MULTICODEC_ED25519_HEADER=ht,A.MULTICODEC_ED25519_LENGTH=It,A.decodeData=ci,A.decodeIss=Qt,A.decodeJSON=ke,A.decodeJWT=ir,A.decodeSig=tr,A.encodeData=rr,A.encodeIss=Zt,A.encodeJSON=Je,A.encodeJWT=nr,A.encodeSig=er,A.generateKeyPair=si,A.signJWT=di,A.verifyJWT=bi,Object.defineProperty(A,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@walletconnect/relay-auth", | ||
"description": "Relay Client Authentication", | ||
"version": "1.0.4-2ee93a0", | ||
"version": "1.0.4-5b9d89e", | ||
"author": "WalletConnect, Inc. <walletconnect.com>", | ||
@@ -41,3 +41,5 @@ "license": "MIT", | ||
"npm-publish:canary": "npm publish --access public --tag canary", | ||
"prepublishOnly": "npm run test && npm run build" | ||
"prepublishOnly": "npm run test && npm run build", | ||
"prettier": "prettier --config ../../.prettierrc --check {src,test}/**/*.ts", | ||
"format": "prettier --config ../../.prettierrc --write {src,test}/**/*.ts" | ||
}, | ||
@@ -49,3 +51,2 @@ "devDependencies": { | ||
"did-resolver": "^3.2.2", | ||
"husky": "^4.3.0", | ||
"key-did-resolver": "^2.0.4", | ||
@@ -56,13 +57,2 @@ "typescript": "^4.9.5", | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "run-s lint" | ||
} | ||
}, | ||
"prettier": { | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": false, | ||
"trailingComma": "es5" | ||
}, | ||
"dependencies": { | ||
@@ -73,5 +63,4 @@ "@stablelib/ed25519": "^1.0.2", | ||
"@walletconnect/time": "^1.0.2", | ||
"tslib": "1.14.1", | ||
"uint8arrays": "^3.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
5
8
463471
342
- Removedtslib@1.14.1