@helia/ipns 7.2.3-ec8bf66 → 7.2.3-f5a03fc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.HeliaIpns = factory()}(typeof self !== 'undefined' ? self : this, function () {
2
2
  "use strict";var HeliaIpns=(()=>{var rf=Object.create;var xn=Object.defineProperty;var nf=Object.getOwnPropertyDescriptor;var of=Object.getOwnPropertyNames;var sf=Object.getPrototypeOf,af=Object.prototype.hasOwnProperty;var gi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Be=(t,e)=>{for(var r in e)xn(t,r,{get:e[r],enumerable:!0})},na=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of of(e))!af.call(t,o)&&o!==r&&xn(t,o,{get:()=>e[o],enumerable:!(n=nf(e,o))||n.enumerable});return t};var Vr=(t,e,r)=>(r=t!=null?rf(sf(t)):{},na(e||!t||!t.__esModule?xn(r,"default",{value:t,enumerable:!0}):r,t)),cf=t=>na(xn({},"__esModule",{value:!0}),t);var uc=gi(br=>{"use strict";var Kd="[object ArrayBuffer]",ht=class t{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Kd}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,r){if(e.constructor===r)return e;if(this.isArrayBuffer(e))return new r(e);if(this.isArrayBufferView(e))return new r(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,r){let n=t.toUint8Array(e),o=t.toUint8Array(r);if(n.length!==o.byteLength)return!1;for(let i=0;i<n.length;i++)if(n[i]!==o[i])return!1;return!0}static concat(...e){let r;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?r=e[0]:e[e.length-1]instanceof Function?r=e.slice(0,e.length-1):r=e;let n=0;for(let s of r)n+=s.byteLength;let o=new Uint8Array(n),i=0;for(let s of r){let a=this.toUint8Array(s);o.set(a,i),i+=a.length}return e[e.length-1]instanceof Function?this.toView(o,e[e.length-1]):o.buffer}},bs="string",qd=/^[0-9a-f]+$/i,zd=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Gd=/^[a-zA-Z0-9-_]+$/,On=class{static fromString(e){let r=unescape(encodeURIComponent(e)),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n.buffer}static toString(e){let r=ht.toUint8Array(e),n="";for(let i=0;i<r.length;i++)n+=String.fromCharCode(r[i]);return decodeURIComponent(escape(n))}},Fe=class{static toString(e,r=!1){let n=ht.toArrayBuffer(e),o=new DataView(n),i="";for(let s=0;s<n.byteLength;s+=2){let a=o.getUint16(s,r);i+=String.fromCharCode(a)}return i}static fromString(e,r=!1){let n=new ArrayBuffer(e.length*2),o=new DataView(n);for(let i=0;i<e.length;i++)o.setUint16(i*2,e.charCodeAt(i),r);return n}},Hn=class t{static isHex(e){return typeof e===bs&&qd.test(e)}static isBase64(e){return typeof e===bs&&zd.test(e)}static isBase64Url(e){return typeof e===bs&&Gd.test(e)}static ToString(e,r="utf8"){let n=ht.toUint8Array(e);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return Fe.toString(n,!0);case"utf16":case"utf16be":return Fe.toString(n);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(e,r="utf8"){if(!e)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Fe.fromString(e,!0);case"utf16":case"utf16be":return Fe.fromString(e);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(e){let r=ht.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(r,"binary");return btoa(n)}else return Buffer.from(r).toString("base64")}static FromBase64(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,r=t.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(e);case"utf8":return On.fromString(e);case"utf16":case"utf16be":return Fe.fromString(e);case"utf16le":case"usc2":return Fe.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(e,r=t.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(e);case"utf8":return On.toString(e);case"utf16":case"utf16be":return Fe.toString(e);case"utf16le":case"usc2":return Fe.toString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(e){let r=e.length,n=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=e.charCodeAt(o);return n.buffer}static ToBinary(e){let r=ht.toUint8Array(e),n="";for(let o=0;o<r.length;o++)n+=String.fromCharCode(r[o]);return n}static ToHex(e){let r=ht.toUint8Array(e),n="",o=r.length;for(let i=0;i<o;i++){let s=r[i];s<16&&(n+="0"),n+=s.toString(16)}return n}static FromHex(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);let n=new Uint8Array(r.length/2);for(let o=0;o<r.length;o=o+2){let i=r.slice(o,o+2);n[o/2]=parseInt(i,16)}return n.buffer}static ToUtf16String(e,r=!1){return Fe.toString(e,r)}static FromUtf16String(e,r=!1){return Fe.fromString(e,r)}static Base64Padding(e){let r=4-e.length%4;if(r<4)for(let n=0;n<r;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Hn.DEFAULT_UTF8_ENCODING="utf8";function Zd(t,...e){let r=arguments[0];for(let n=1;n<arguments.length;n++){let o=arguments[n];for(let i in o)r[i]=o[i]}return r}function Wd(...t){let e=t.map(o=>o.byteLength).reduce((o,i)=>o+i),r=new Uint8Array(e),n=0;return t.map(o=>new Uint8Array(o)).forEach(o=>{for(let i of o)r[n++]=i}),r.buffer}function jd(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let o=0;o<t.byteLength;o++)if(r[o]!==n[o])return!1;return!0}br.BufferSourceConverter=ht;br.Convert=Hn;br.assign=Zd;br.combine=Wd;br.isEqual=jd});var Vo=gi((Zx,_s)=>{var Gx=function(){typeof _s<"u"&&(_s.exports=y);var t=86400,e=3200,r=146097*e/400,n=t*r,o=1e3*n,i=864e13,s=4294967296,a=1e6,c="000000000",l=Math.trunc||function(x){var b=x-x%1;return b==0&&(x<0||x===0&&1/x!=1/0)?-0:b},u=y.prototype,f=(y.fromDate=function(x){return new y(+x)},y.fromInt64BE=I(0,1,2,3,0,4),y.fromInt64LE=I(3,2,1,0,4,0),y.fromString=function(R){var b,M=new y,R=(R+="").replace(/^\s*[+\-]?\d+/,function($){var $=+$,B=1970+($-1970)%400;return M.year=$-B,B}).replace(/(?:Z|([+\-]\d{2}):?(\d{2}))$/,function(N,$,B){return $<0&&(B*=-1),b=6e4*(60*+$+ +B),""}).replace(/\.\d+$/,function(N){return M.nano=+(N+c).substr(1,9),""}).split(/\D+/);if(1<R.length?R[1]--:R[1]=0,M.time=b=Date.UTC.apply(Date,R)-(b||0),isNaN(b))throw new TypeError("Invalid Date");return d(M)},y.fromTimeT=function(x){return T(x,0)},u.year=0,u.time=0,u.nano=0,u.addNano=function(x){return this.nano+=+x||0,this},u.getNano=function(){var x=d(this);return(x.time%1e3*a+ +x.nano+1e9)%1e9},u.getTimeT=function(){var b=d(this),x=Math.floor(b.time/1e3),b=b.year;return b&&(x+=b*r*t/e),x},u.getYear=function(){return this.toDate().getUTCFullYear()+this.year},u.toDate=function(){return v(d(this).time)},u.toJSON=function(){return this.toString().replace(/0{1,6}Z$/,"Z")},u.toString=function(x){var b=this,M=b.toDate(),R={H:function(){return V(M.getUTCHours())},L:function(){return U(M.getUTCMilliseconds(),3)},M:function(){return V(M.getUTCMinutes())},N:function(){return U(b.getNano(),9)},S:function(){return V(M.getUTCSeconds())},Y:function(){var N=b.getYear();return 999999<N?"+"+N:9999<N?"+"+U(N,6):0<=N?U(N,4):-999999<=N?"-"+U(-N,6):N},a:function(){return S[M.getUTCDay()]},b:function(){return h[M.getUTCMonth()]},d:function(){return V(M.getUTCDate())},e:function(){return function(N){return(9<N?"":" ")+(0|N)}(M.getUTCDate())},m:function(){return V(M.getUTCMonth()+1)}};return function N($){return $.replace(/%./g,function(B){var m=B[1],A=k[m],m=R[m];return A?N(A):m?m():B})}(x||f)},u.writeInt64BE=w(0,1,2,3,0,4),u.writeInt64LE=w(3,2,1,0,4,0),"%Y-%m-%dT%H:%M:%S.%NZ"),h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],S=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],k={"%":"%",F:"%Y-%m-%d",n:`
3
- `,R:"%H:%M",T:"%H:%M:%S",t:" ",X:"%T",Z:"GMT",z:"+0000"};return y;function y(x,b,M){var R=this;if(!(R instanceof y))return new y(x,b,M);R.time=+x||0,R.nano=+b||0,R.year=+M||0,d(R)}function d(x){var b,M,R,N=x.year,$=x.time,B=x.nano,A=((B<0||a<=B)&&(B-=(M=Math.floor(B/a))*a,$+=M,M=1),N%e);return($<-i||i<$||A)&&((b=l($/o))&&(N+=b*e,$-=b*o),(R=v($)).setUTCFullYear(A+R.getUTCFullYear()),R=($=+R)+(b=l((N-=A)/e))*o,b&&-i<=R&&R<=i&&(N-=b*e,$=R),M=1),M&&(x.year=N,x.time=$,x.nano=B),x}function v(x){var b=new Date(0);return b.setTime(x),b}function T(N,R){N=+N||0;var M=l((R=(R|0)*s)/n)+l(N/n),R=R%n+N%n,N=l(R/n);return N&&(M+=N,R-=N*n),new y(1e3*R,0,M*e)}function w(x,b,M,R,N,$){return function(A,m){var E=d(this);A=A||new Array(8),F(A,m|=0);var D=Math.floor(E.time/1e3),E=E.year*(r*t/e),p=l(E/s)+l(D/s),E=E%s+D%s,D=Math.floor(E/s);return D&&(p+=D,E-=D*s),B(A,m+N,p),B(A,m+$,E),A};function B(A,m,p){A[m+x]=p>>24&255,A[m+b]=p>>16&255,A[m+M]=p>>8&255,A[m+R]=255&p}}function I(x,b,M,R,N,$){return function(A,m){F(A,m|=0);var p=B(A,m+N);return T(B(A,m+$),p)};function B(A,m){return 16777216*A[m+x]+(A[m+b]<<16|A[m+M]<<8|A[m+R])}}function F(x,b){if(x=x&&x.length,x==null)throw new TypeError("Invalid Buffer");if(x<b+8)throw new RangeError("Out of range")}function V(x){return(9<x?"":"0")+(0|x)}function U(x,b){return(c+(0|x)).substr(-b)}}()});var Ol=gi((s1,Ml)=>{Ml.exports=function(t){if(!t)throw Error("hashlru must have a max value, of type number, greater than 0");var e=0,r=Object.create(null),n=Object.create(null);function o(i,s){r[i]=s,e++,e>=t&&(e=0,n=r,r=Object.create(null))}return{has:function(i){return r[i]!==void 0||n[i]!==void 0},remove:function(i){r[i]!==void 0&&(r[i]=void 0),n[i]!==void 0&&(n[i]=void 0)},get:function(i){var s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set:function(i,s){r[i]!==void 0?r[i]=s:o(i,s)},clear:function(){r=Object.create(null),n=Object.create(null)}}}});var Ep={};Be(Ep,{ipns:()=>vp,ipnsSelector:()=>ei,ipnsValidator:()=>ri});function oa(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1")&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.toMultihash=="function"&&typeof t.toCID=="function"&&typeof t.verify=="function"}var mi=Symbol.for("@libp2p/peer-id");var we=class extends Error{static name="InvalidParametersError";constructor(e="Invalid parameters"){super(e),this.name="InvalidParametersError"}},ir=class extends Error{static name="InvalidPublicKeyError";constructor(e="Invalid public key"){super(e),this.name="InvalidPublicKeyError"}};var Dr=class extends Error{static name="NotFoundError";constructor(e="Not found"){super(e),this.name="NotFoundError"}};var sr=class extends Error{static name="InvalidMultihashError";constructor(e="Invalid Multihash"){super(e),this.name="InvalidMultihashError"}};var ar=class extends Error{static name="UnsupportedKeyTypeError";constructor(e="Unsupported key type"){super(e),this.name="UnsupportedKeyTypeError"}};var vi={};Be(vi,{base32:()=>St,base32hex:()=>yf,base32hexpad:()=>wf,base32hexpadupper:()=>bf,base32hexupper:()=>xf,base32pad:()=>gf,base32padupper:()=>mf,base32upper:()=>pf,base32z:()=>vf});var Cp=new Uint8Array(0);function ia(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function it(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")}function sa(t){return new TextEncoder().encode(t)}function aa(t){return new TextDecoder().decode(t)}function uf(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<t.length;o++){var i=t.charAt(o),s=i.charCodeAt(0);if(r[s]!==255)throw new TypeError(i+" is ambiguous");r[s]=o}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function f(k){if(k instanceof Uint8Array||(ArrayBuffer.isView(k)?k=new Uint8Array(k.buffer,k.byteOffset,k.byteLength):Array.isArray(k)&&(k=Uint8Array.from(k))),!(k instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(k.length===0)return"";for(var y=0,d=0,v=0,T=k.length;v!==T&&k[v]===0;)v++,y++;for(var w=(T-v)*u+1>>>0,I=new Uint8Array(w);v!==T;){for(var F=k[v],V=0,U=w-1;(F!==0||V<d)&&U!==-1;U--,V++)F+=256*I[U]>>>0,I[U]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");d=V,v++}for(var x=w-d;x!==w&&I[x]===0;)x++;for(var b=c.repeat(y);x<w;++x)b+=t.charAt(I[x]);return b}function h(k){if(typeof k!="string")throw new TypeError("Expected String");if(k.length===0)return new Uint8Array;var y=0;if(k[y]!==" "){for(var d=0,v=0;k[y]===c;)d++,y++;for(var T=(k.length-y)*l+1>>>0,w=new Uint8Array(T);k[y];){var I=r[k.charCodeAt(y)];if(I===255)return;for(var F=0,V=T-1;(I!==0||F<v)&&V!==-1;V--,F++)I+=a*w[V]>>>0,w[V]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");v=F,y++}if(k[y]!==" "){for(var U=T-v;U!==T&&w[U]===0;)U++;for(var x=new Uint8Array(d+(T-U)),b=d;U!==T;)x[b++]=w[U++];return x}}}function S(k){var y=h(k);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:S}}var lf=uf,ff=lf,ua=ff;var yi=class{name;prefix;baseEncode;constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},xi=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return la(this,e)}},wi=class{decoders;constructor(e){this.decoders=e}or(e){return la(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function la(t,e){return new wi({...t.decoders??{[t.prefix]:t},...e.decoders??{[e.prefix]:e}})}var bi=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,r,n,o){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new yi(e,r,n),this.decoder=new xi(e,r,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function cr({name:t,prefix:e,encode:r,decode:n}){return new bi(t,e,r,n)}function At({name:t,prefix:e,alphabet:r}){let{encode:n,decode:o}=ua(r,t);return cr({prefix:e,name:t,encode:n,decode:i=>it(o(i))})}function hf(t,e,r,n){let o={};for(let u=0;u<e.length;++u)o[e[u]]=u;let i=t.length;for(;t[i-1]==="=";)--i;let s=new Uint8Array(i*r/8|0),a=0,c=0,l=0;for(let u=0;u<i;++u){let f=o[t[u]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|f,a+=r,a>=8&&(a-=8,s[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s}function df(t,e,r){let n=e[e.length-1]==="=",o=(1<<r)-1,i="",s=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],s+=8;s>r;)s-=r,i+=e[o&a>>s];if(s!==0&&(i+=e[o&a<<r-s]),n)for(;i.length*r&7;)i+="=";return i}function oe({name:t,prefix:e,bitsPerChar:r,alphabet:n}){return cr({prefix:e,name:t,encode(o){return df(o,n,r)},decode(o){return hf(o,n,r,t)}})}var St=oe({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),pf=oe({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),gf=oe({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),mf=oe({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),yf=oe({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),xf=oe({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),wf=oe({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),bf=oe({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),vf=oe({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ei={};Be(Ei,{base58btc:()=>Q,base58flickr:()=>Ef});var Q=At({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ef=At({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ai={};Be(Ai,{base64:()=>Bi,base64pad:()=>Bf,base64url:()=>Af,base64urlpad:()=>Sf});var Bi=oe({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Bf=oe({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Af=oe({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Sf=oe({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function kf(t,e){try{if(typeof t=="string"&&t.length>0)return Cf(t);if(typeof t=="number"&&isFinite(t))return e?.long?If(t):Tf(t);throw new Error("Value is not a string or number.")}catch(r){let n=Nf(r)?`${r.message}. value=${JSON.stringify(t)}`:"An unknown error has occured.";throw new Error(n)}}function Cf(t){if(t=String(t),t.length>100)throw new Error("Value exceeds the maximum length of 100 characters.");let e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return NaN;let r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*315576e5;case"weeks":case"week":case"w":return r*6048e5;case"days":case"day":case"d":return r*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return r*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return r*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return r*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:throw new Error(`The unit ${n} was matched, but no matching case exists.`)}}var bn=kf;function Tf(t){let e=Math.abs(t);return e>=864e5?`${Math.round(t/864e5)}d`:e>=36e5?`${Math.round(t/36e5)}h`:e>=6e4?`${Math.round(t/6e4)}m`:e>=1e3?`${Math.round(t/1e3)}s`:`${t}ms`}function If(t){let e=Math.abs(t);return e>=864e5?wn(t,e,864e5,"day"):e>=36e5?wn(t,e,36e5,"hour"):e>=6e4?wn(t,e,6e4,"minute"):e>=1e3?wn(t,e,1e3,"second"):`${t} ms`}function wn(t,e,r,n){let o=e>=r*1.5;return`${Math.round(t/r)} ${n}${o?"s":""}`}function Nf(t){return typeof t=="object"&&t!==null&&"message"in t}function Si(t){r.debug=r,r.default=r,r.coerce=c,r.disable=i,r.enable=o,r.enabled=s,r.humanize=bn,r.destroy=l,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let f=0;for(let h=0;h<u.length;h++)f=(f<<5)-f+u.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(u){let f,h=null,S,k;function y(...d){if(!y.enabled)return;let v=y,T=Number(new Date),w=T-(f||T);v.diff=w,v.prev=f,v.curr=T,f=T,d[0]=r.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");let I=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(V,U)=>{if(V==="%%")return"%";I++;let x=r.formatters[U];if(typeof x=="function"){let b=d[I];V=x.call(v,b),d.splice(I,1),I--}return V}),r.formatArgs.call(v,d),(v.log||r.log).apply(v,d)}return y.namespace=u,y.useColors=r.useColors(),y.color=r.selectColor(u),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(S!==r.namespaces&&(S=r.namespaces,k=r.enabled(u)),k),set:d=>{h=d}}),typeof r.init=="function"&&r.init(y),y}function n(u,f){let h=r(this.namespace+(typeof f>"u"?":":f)+u);return h.log=this.log,h}function o(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let f,h=(typeof u=="string"?u:"").split(/[\s,]+/),S=h.length;for(f=0;f<S;f++)h[f]&&(u=h[f].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.substr(1)+"$")):r.names.push(new RegExp("^"+u+"$")))}function i(){let u=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),u}function s(u){if(u[u.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(u))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function c(u){return u instanceof Error?u.stack??u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.setupFormatters(r.formatters),r.enable(r.load()),r}var vn=Ff(),Uf=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Rf(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent?.toLowerCase().match(/(edge|trident)\/(\d+)/)!=null?!1:typeof document<"u"&&document.documentElement?.style?.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent?.toLowerCase().match(/firefox\/(\d+)/)!=null&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent?.toLowerCase().match(/applewebkit\/(\d+)/)}function _f(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+bn(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}var Lf=console.debug??console.log??(()=>{});function Vf(t){try{t?vn?.setItem("debug",t):vn?.removeItem("debug")}catch{}}function Df(){let t;try{t=vn?.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function Ff(){try{return localStorage}catch{}}function Mf(t){t.j=function(e){try{return JSON.stringify(e)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}}var fa=Si({formatArgs:_f,save:Vf,load:Df,useColors:Rf,setupFormatters:Mf,colors:Uf,storage:vn,log:Lf});var Ue=fa;Ue.formatters.b=t=>t==null?"undefined":Q.baseEncode(t);Ue.formatters.t=t=>t==null?"undefined":St.baseEncode(t);Ue.formatters.m=t=>t==null?"undefined":Bi.baseEncode(t);Ue.formatters.p=t=>t==null?"undefined":t.toString();Ue.formatters.c=t=>t==null?"undefined":t.toString();Ue.formatters.k=t=>t==null?"undefined":t.toString();Ue.formatters.a=t=>t==null?"undefined":t.toString();function Of(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function kt(t){let e=Of(`${t}:trace`);return Ue.enabled(`${t}:trace`)&&Ue.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=Ue(`${t}:trace`)),Object.assign(Ue(t),{error:Ue(`${t}:error`),trace:e})}var ki={};Be(ki,{base36:()=>He,base36upper:()=>Hf});var He=At({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Hf=At({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Pf=pa,ha=128,$f=127,Kf=~$f,qf=Math.pow(2,31);function pa(t,e,r){e=e||[],r=r||0;for(var n=r;t>=qf;)e[r++]=t&255|ha,t/=128;for(;t&Kf;)e[r++]=t&255|ha,t>>>=7;return e[r]=t|0,pa.bytes=r-n+1,e}var zf=Ci,Gf=128,da=127;function Ci(t,n){var r=0,n=n||0,o=0,i=n,s,a=t.length;do{if(i>=a)throw Ci.bytes=0,new RangeError("Could not decode varint");s=t[i++],r+=o<28?(s&da)<<o:(s&da)*Math.pow(2,o),o+=7}while(s>=Gf);return Ci.bytes=i-n,r}var Zf=Math.pow(2,7),Wf=Math.pow(2,14),jf=Math.pow(2,21),Yf=Math.pow(2,28),Jf=Math.pow(2,35),Xf=Math.pow(2,42),Qf=Math.pow(2,49),eh=Math.pow(2,56),th=Math.pow(2,63),rh=function(t){return t<Zf?1:t<Wf?2:t<jf?3:t<Yf?4:t<Jf?5:t<Xf?6:t<Qf?7:t<eh?8:t<th?9:10},nh={encode:Pf,decode:zf,encodingLength:rh},oh=nh,Fr=oh;function Mr(t,e=0){return[Fr.decode(t,e),Fr.decode.bytes]}function ur(t,e,r=0){return Fr.encode(t,e,r),e}function lr(t){return Fr.encodingLength(t)}function Pe(t,e){let r=e.byteLength,n=lr(t),o=n+lr(r),i=new Uint8Array(o+r);return ur(t,i,0),ur(r,i,n),i.set(e,o),new fr(t,r,e,i)}function st(t){let e=it(t),[r,n]=Mr(e),[o,i]=Mr(e.subarray(n)),s=e.subarray(n+i);if(s.byteLength!==o)throw new Error("Incorrect length");return new fr(r,o,s,e)}function ga(t,e){if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&ia(t.bytes,r.bytes)}}var fr=class{code;size;digest;bytes;constructor(e,r,n,o){this.code=e,this.size=r,this.digest=n,this.bytes=o}};function ma(t,e){let{bytes:r,version:n}=t;switch(n){case 0:return sh(r,Ti(t),e??Q.encoder);default:return ah(r,Ti(t),e??St.encoder)}}var ya=new WeakMap;function Ti(t){let e=ya.get(t);if(e==null){let r=new Map;return ya.set(t,r),r}return e}var re=class t{code;version;multihash;bytes;"/";constructor(e,r,n,o){this.code=r,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Or)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==ch)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Pe(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n!=null&&e.code===n.code&&e.version===n.version&&ga(e.multihash,n.multihash)}toString(e){return ma(this,e)}toJSON(){return{"/":ma(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:o,multihash:i,bytes:s}=r;return new t(n,o,i,s??xa(n,o,i.bytes))}else if(r[uh]===!0){let{version:n,multihash:o,code:i}=r,s=st(o);return t.create(n,i,s)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Or)throw new Error(`Version 0 CID must use dag-pb (code: ${Or}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let o=xa(e,r,n.bytes);return new t(e,r,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Or,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,o=it(e.subarray(n,n+r.multihashSize));if(o.byteLength!==r.multihashSize)throw new Error("Incorrect length");let i=o.subarray(r.multihashSize-r.digestSize),s=new fr(r.multihashCode,r.digestSize,i,o);return[r.version===0?t.createV0(s):t.createV1(r.codec,s),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[f,h]=Mr(e.subarray(r));return r+=h,f},o=n(),i=Or;if(o===18?(o=0,r=0):i=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let s=r,a=n(),c=n(),l=r+c,u=l-s;return{version:o,codec:i,multihashCode:a,digestSize:c,multihashSize:u,size:l}}static parse(e,r){let[n,o]=ih(e,r),i=t.decode(o);if(i.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ti(i).set(n,e),i}};function ih(t,e){switch(t[0]){case"Q":{let r=e??Q;return[Q.prefix,r.decode(`${Q.prefix}${t}`)]}case Q.prefix:{let r=e??Q;return[Q.prefix,r.decode(t)]}case St.prefix:{let r=e??St;return[St.prefix,r.decode(t)]}case He.prefix:{let r=e??He;return[He.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}}function sh(t,e,r){let{prefix:n}=r;if(n!==Q.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let o=e.get(n);if(o==null){let i=r.encode(t).slice(1);return e.set(n,i),i}else return o}function ah(t,e,r){let{prefix:n}=r,o=e.get(n);if(o==null){let i=r.encode(t);return e.set(n,i),i}else return o}var Or=112,ch=18;function xa(t,e,r){let n=lr(t),o=n+lr(e),i=new Uint8Array(o+r.byteLength);return ur(t,i,0),ur(e,i,n),i.set(r,o),i}var uh=Symbol.for("@ipld/js-cid/CID");var Ii={};Be(Ii,{identity:()=>at});var wa=0,lh="identity",ba=it;function fh(t){return Pe(wa,ba(t))}var at={code:wa,name:lh,encode:ba,digest:fh};function pe(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function va(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function hh(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function hr(t,...e){if(!hh(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function Ea(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");va(t.outputLen),va(t.blockLen)}function dr(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ba(t,e){hr(t);let r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var Gt=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Bn=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),$e=(t,e)=>t<<32-e|t>>>e;var lg=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Aa(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Hr(t){return typeof t=="string"&&(t=Aa(t)),hr(t),t}function Ni(...t){let e=0;for(let n=0;n<t.length;n++){let o=t[n];hr(o),e+=o.length}let r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){let i=t[n];r.set(i,o),o+=i.length}return r}var pr=class{clone(){return this._cloneInto()}},fg={}.toString;function An(t){let e=n=>t().update(Hr(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Sn(t=32){if(Gt&&typeof Gt.getRandomValues=="function")return Gt.getRandomValues(new Uint8Array(t));if(Gt&&typeof Gt.randomBytes=="function")return Gt.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function dh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,l=n?0:4;t.setUint32(e+c,s,n),t.setUint32(e+l,a,n)}var Sa=(t,e,r)=>t&e^~t&r,ka=(t,e,r)=>t&e^t&r^e&r,gr=class extends pr{constructor(e,r,n,o){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Bn(this.buffer)}update(e){dr(this);let{view:r,buffer:n,blockLen:o}=this;e=Hr(e);let i=e.length;for(let s=0;s<i;){let a=Math.min(o-this.pos,i-s);if(a===o){let c=Bn(e);for(;o<=i-s;s+=o)this.process(c,s);continue}n.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){dr(this),Ba(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:i}=this,{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>o-s&&(this.process(n,0),s=0);for(let f=s;f<o;f++)r[f]=0;dh(n,o-8,BigInt(this.length*8),i),this.process(n,0);let a=Bn(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)a.setUint32(4*f,u[f],i)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:i,destroyed:s,pos:a}=this;return e.length=o,e.pos=a,e.finished=i,e.destroyed=s,o%r&&e.buffer.set(n),e}};var kn=BigInt(4294967295),Ui=BigInt(32);function Ca(t,e=!1){return e?{h:Number(t&kn),l:Number(t>>Ui&kn)}:{h:Number(t>>Ui&kn)|0,l:Number(t&kn)|0}}function ph(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let o=0;o<t.length;o++){let{h:i,l:s}=Ca(t[o],e);[r[o],n[o]]=[i,s]}return[r,n]}var gh=(t,e)=>BigInt(t>>>0)<<Ui|BigInt(e>>>0),mh=(t,e,r)=>t>>>r,yh=(t,e,r)=>t<<32-r|e>>>r,xh=(t,e,r)=>t>>>r|e<<32-r,wh=(t,e,r)=>t<<32-r|e>>>r,bh=(t,e,r)=>t<<64-r|e>>>r-32,vh=(t,e,r)=>t>>>r-32|e<<64-r,Eh=(t,e)=>e,Bh=(t,e)=>t,Ah=(t,e,r)=>t<<r|e>>>32-r,Sh=(t,e,r)=>e<<r|t>>>32-r,kh=(t,e,r)=>e<<r-32|t>>>64-r,Ch=(t,e,r)=>t<<r-32|e>>>64-r;function Th(t,e,r,n){let o=(e>>>0)+(n>>>0);return{h:t+r+(o/2**32|0)|0,l:o|0}}var Ih=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Nh=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Uh=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Rh=(t,e,r,n,o)=>e+r+n+o+(t/2**32|0)|0,_h=(t,e,r,n,o)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(o>>>0),Lh=(t,e,r,n,o,i)=>e+r+n+o+i+(t/2**32|0)|0;var Vh={fromBig:Ca,split:ph,toBig:gh,shrSH:mh,shrSL:yh,rotrSH:xh,rotrSL:wh,rotrBH:bh,rotrBL:vh,rotr32H:Eh,rotr32L:Bh,rotlSH:Ah,rotlSL:Sh,rotlBH:kh,rotlBL:Ch,add:Th,add3L:Ih,add3H:Nh,add4L:Uh,add4H:Rh,add5H:Lh,add5L:_h},K=Vh;var[Dh,Fh]=K.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Tt=new Uint32Array(80),It=new Uint32Array(80),Ri=class extends gr{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:o,Ch:i,Cl:s,Dh:a,Dl:c,Eh:l,El:u,Fh:f,Fl:h,Gh:S,Gl:k,Hh:y,Hl:d}=this;return[e,r,n,o,i,s,a,c,l,u,f,h,S,k,y,d]}set(e,r,n,o,i,s,a,c,l,u,f,h,S,k,y,d){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=s|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=f|0,this.Fl=h|0,this.Gh=S|0,this.Gl=k|0,this.Hh=y|0,this.Hl=d|0}process(e,r){for(let w=0;w<16;w++,r+=4)Tt[w]=e.getUint32(r),It[w]=e.getUint32(r+=4);for(let w=16;w<80;w++){let I=Tt[w-15]|0,F=It[w-15]|0,V=K.rotrSH(I,F,1)^K.rotrSH(I,F,8)^K.shrSH(I,F,7),U=K.rotrSL(I,F,1)^K.rotrSL(I,F,8)^K.shrSL(I,F,7),x=Tt[w-2]|0,b=It[w-2]|0,M=K.rotrSH(x,b,19)^K.rotrBH(x,b,61)^K.shrSH(x,b,6),R=K.rotrSL(x,b,19)^K.rotrBL(x,b,61)^K.shrSL(x,b,6),N=K.add4L(U,R,It[w-7],It[w-16]),$=K.add4H(N,V,M,Tt[w-7],Tt[w-16]);Tt[w]=$|0,It[w]=N|0}let{Ah:n,Al:o,Bh:i,Bl:s,Ch:a,Cl:c,Dh:l,Dl:u,Eh:f,El:h,Fh:S,Fl:k,Gh:y,Gl:d,Hh:v,Hl:T}=this;for(let w=0;w<80;w++){let I=K.rotrSH(f,h,14)^K.rotrSH(f,h,18)^K.rotrBH(f,h,41),F=K.rotrSL(f,h,14)^K.rotrSL(f,h,18)^K.rotrBL(f,h,41),V=f&S^~f&y,U=h&k^~h&d,x=K.add5L(T,F,U,Fh[w],It[w]),b=K.add5H(x,v,I,V,Dh[w],Tt[w]),M=x|0,R=K.rotrSH(n,o,28)^K.rotrBH(n,o,34)^K.rotrBH(n,o,39),N=K.rotrSL(n,o,28)^K.rotrBL(n,o,34)^K.rotrBL(n,o,39),$=n&i^n&a^i&a,B=o&s^o&c^s&c;v=y|0,T=d|0,y=S|0,d=k|0,S=f|0,k=h|0,{h:f,l:h}=K.add(l|0,u|0,b|0,M|0),l=a|0,u=c|0,a=i|0,c=s|0,i=n|0,s=o|0;let A=K.add3L(M,N,B);n=K.add3H(A,b,R,$),o=A|0}({h:n,l:o}=K.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:s}=K.add(this.Bh|0,this.Bl|0,i|0,s|0),{h:a,l:c}=K.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=K.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:f,l:h}=K.add(this.Eh|0,this.El|0,f|0,h|0),{h:S,l:k}=K.add(this.Fh|0,this.Fl|0,S|0,k|0),{h:y,l:d}=K.add(this.Gh|0,this.Gl|0,y|0,d|0),{h:v,l:T}=K.add(this.Hh|0,this.Hl|0,v|0,T|0),this.set(n,o,i,s,a,c,l,u,f,h,S,k,y,d,v,T)}roundClean(){Tt.fill(0),It.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var Ta=An(()=>new Ri);var Tn={};Be(Tn,{aInRange:()=>Te,abool:()=>Ke,abytes:()=>mr,bitGet:()=>Kh,bitLen:()=>Fi,bitMask:()=>$r,bitSet:()=>qh,bytesToHex:()=>ut,bytesToNumberBE:()=>lt,bytesToNumberLE:()=>Ut,concatBytes:()=>ft,createHmacDrbg:()=>Mi,ensureBytes:()=>ie,equalBytes:()=>Ph,hexToBytes:()=>Wt,hexToNumber:()=>Di,inRange:()=>Pr,isBytes:()=>Nt,memoized:()=>Yt,notImplemented:()=>Gh,numberToBytesBE:()=>Rt,numberToBytesLE:()=>jt,numberToHexUnpadded:()=>Zt,numberToVarBytesBE:()=>Hh,utf8ToBytes:()=>$h,validateObject:()=>Ye});var Vi=BigInt(0),Cn=BigInt(1),Mh=BigInt(2);function Nt(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function mr(t){if(!Nt(t))throw new Error("Uint8Array expected")}function Ke(t,e){if(typeof e!="boolean")throw new Error(`${t} must be valid boolean, got "${e}".`)}var Oh=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ut(t){mr(t);let e="";for(let r=0;r<t.length;r++)e+=Oh[t[r]];return e}function Zt(t){let e=t.toString(16);return e.length&1?`0${e}`:e}function Di(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}var ct={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Ia(t){if(t>=ct._0&&t<=ct._9)return t-ct._0;if(t>=ct._A&&t<=ct._F)return t-(ct._A-10);if(t>=ct._a&&t<=ct._f)return t-(ct._a-10)}function Wt(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);let e=t.length,r=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){let s=Ia(t.charCodeAt(i)),a=Ia(t.charCodeAt(i+1));if(s===void 0||a===void 0){let c=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=s*16+a}return n}function lt(t){return Di(ut(t))}function Ut(t){return mr(t),Di(ut(Uint8Array.from(t).reverse()))}function Rt(t,e){return Wt(t.toString(16).padStart(e*2,"0"))}function jt(t,e){return Rt(t,e).reverse()}function Hh(t){return Wt(Zt(t))}function ie(t,e,r){let n;if(typeof e=="string")try{n=Wt(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(Nt(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(`${t} expected ${r} bytes, got ${o}`);return n}function ft(...t){let e=0;for(let n=0;n<t.length;n++){let o=t[n];mr(o),e+=o.length}let r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){let i=t[n];r.set(i,o),o+=i.length}return r}function Ph(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}function $h(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}var _i=t=>typeof t=="bigint"&&Vi<=t;function Pr(t,e,r){return _i(t)&&_i(e)&&_i(r)&&e<=t&&t<r}function Te(t,e,r,n){if(!Pr(e,r,n))throw new Error(`expected valid ${t}: ${r} <= n < ${n}, got ${typeof e} ${e}`)}function Fi(t){let e;for(e=0;t>Vi;t>>=Cn,e+=1);return e}function Kh(t,e){return t>>BigInt(e)&Cn}function qh(t,e,r){return t|(r?Cn:Vi)<<BigInt(e)}var $r=t=>(Mh<<BigInt(t-1))-Cn,Li=t=>new Uint8Array(t),Na=t=>Uint8Array.from(t);function Mi(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Li(t),o=Li(t),i=0,s=()=>{n.fill(1),o.fill(0),i=0},a=(...f)=>r(o,n,...f),c=(f=Li())=>{o=a(Na([0]),f),n=a(),f.length!==0&&(o=a(Na([1]),f),n=a())},l=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,h=[];for(;f<e;){n=a();let S=n.slice();h.push(S),f+=n.length}return ft(...h)};return(f,h)=>{s(),c(f);let S;for(;!(S=h(l()));)c();return s(),S}}var zh={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Nt(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Ye(t,e,r={}){let n=(o,i,s)=>{let a=zh[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=t[o];if(!(s&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(o)}=${c} (${typeof c}), expected ${i}`)};for(let[o,i]of Object.entries(e))n(o,i,!1);for(let[o,i]of Object.entries(r))n(o,i,!0);return t}var Gh=()=>{throw new Error("not implemented")};function Yt(t){let e=new WeakMap;return(r,...n)=>{let o=e.get(r);if(o!==void 0)return o;let i=t(r,...n);return e.set(r,i),i}}var ae=BigInt(0),ee=BigInt(1),Jt=BigInt(2),Zh=BigInt(3),Oi=BigInt(4),Ua=BigInt(5),Ra=BigInt(8),Wh=BigInt(9),jh=BigInt(16);function J(t,e){let r=t%e;return r>=ae?r:e+r}function Yh(t,e,r){if(r<=ae||e<ae)throw new Error("Expected power/modulo > 0");if(r===ee)return ae;let n=ee;for(;e>ae;)e&ee&&(n=n*t%r),t=t*t%r,e>>=ee;return n}function te(t,e,r){let n=t;for(;e-- >ae;)n*=n,n%=r;return n}function In(t,e){if(t===ae||e<=ae)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=J(t,e),n=e,o=ae,i=ee,s=ee,a=ae;for(;r!==ae;){let l=n/r,u=n%r,f=o-s*l,h=i-a*l;n=r,r=u,o=s,i=a,s=f,a=h}if(n!==ee)throw new Error("invert: does not exist");return J(o,e)}function Jh(t){let e=(t-ee)/Jt,r,n,o;for(r=t-ee,n=0;r%Jt===ae;r/=Jt,n++);for(o=Jt;o<t&&Yh(o,e,t)!==t-ee;o++);if(n===1){let s=(t+ee)/Oi;return function(c,l){let u=c.pow(l,s);if(!c.eql(c.sqr(u),l))throw new Error("Cannot find square root");return u}}let i=(r+ee)/Jt;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let l=n,u=a.pow(a.mul(a.ONE,o),r),f=a.pow(c,i),h=a.pow(c,r);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let S=1;for(let y=a.sqr(h);S<l&&!a.eql(y,a.ONE);S++)y=a.sqr(y);let k=a.pow(u,ee<<BigInt(l-S-1));u=a.sqr(k),f=a.mul(f,k),h=a.mul(h,u),l=S}return f}}function Xh(t){if(t%Oi===Zh){let e=(t+ee)/Oi;return function(n,o){let i=n.pow(o,e);if(!n.eql(n.sqr(i),o))throw new Error("Cannot find square root");return i}}if(t%Ra===Ua){let e=(t-Ua)/Ra;return function(n,o){let i=n.mul(o,Jt),s=n.pow(i,e),a=n.mul(o,s),c=n.mul(n.mul(a,Jt),s),l=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(l),o))throw new Error("Cannot find square root");return l}}return t%jh,Jh(t)}var _a=(t,e)=>(J(t,e)&ee)===ee,Qh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Hi(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Qh.reduce((n,o)=>(n[o]="function",n),e);return Ye(t,r)}function ed(t,e,r){if(r<ae)throw new Error("Expected power > 0");if(r===ae)return t.ONE;if(r===ee)return e;let n=t.ONE,o=e;for(;r>ae;)r&ee&&(n=t.mul(n,o)),o=t.sqr(o),r>>=ee;return n}function td(t,e){let r=new Array(e.length),n=e.reduce((i,s,a)=>t.is0(s)?i:(r[a]=i,t.mul(i,s)),t.ONE),o=t.inv(n);return e.reduceRight((i,s,a)=>t.is0(s)?i:(r[a]=t.mul(i,r[a]),t.mul(i,s)),o),r}function Pi(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function _t(t,e,r=!1,n={}){if(t<=ae)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:o,nByteLength:i}=Pi(t,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=Xh(t),a=Object.freeze({ORDER:t,BITS:o,BYTES:i,MASK:$r(o),ZERO:ae,ONE:ee,create:c=>J(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return ae<=c&&c<t},is0:c=>c===ae,isOdd:c=>(c&ee)===ee,neg:c=>J(-c,t),eql:(c,l)=>c===l,sqr:c=>J(c*c,t),add:(c,l)=>J(c+l,t),sub:(c,l)=>J(c-l,t),mul:(c,l)=>J(c*l,t),pow:(c,l)=>ed(a,c,l),div:(c,l)=>J(c*In(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>In(c,t),sqrt:n.sqrt||(c=>s(a,c)),invertBatch:c=>td(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>r?jt(c,i):Rt(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return r?Ut(c):lt(c)}});return Object.freeze(a)}function La(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function $i(t){let e=La(t);return e+Math.ceil(e/2)}function Va(t,e,r=!1){let n=t.length,o=La(e),i=$i(e);if(n<16||n<i||n>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);let s=r?lt(t):Ut(t),a=J(s,e-ee)+ee;return r?jt(a,o):Rt(a,o)}var nd=BigInt(0),Ki=BigInt(1),qi=new WeakMap,Da=new WeakMap;function Nn(t,e){let r=(i,s)=>{let a=s.negate();return i?a:s},n=i=>{if(!Number.isSafeInteger(i)||i<=0||i>e)throw new Error(`Wrong window size=${i}, should be [1..${e}]`)},o=i=>{n(i);let s=Math.ceil(e/i)+1,a=2**(i-1);return{windows:s,windowSize:a}};return{constTimeNegate:r,unsafeLadder(i,s){let a=t.ZERO,c=i;for(;s>nd;)s&Ki&&(a=a.add(c)),c=c.double(),s>>=Ki;return a},precomputeWindow(i,s){let{windows:a,windowSize:c}=o(s),l=[],u=i,f=u;for(let h=0;h<a;h++){f=u,l.push(f);for(let S=1;S<c;S++)f=f.add(u),l.push(f);u=f.double()}return l},wNAF(i,s,a){let{windows:c,windowSize:l}=o(i),u=t.ZERO,f=t.BASE,h=BigInt(2**i-1),S=2**i,k=BigInt(i);for(let y=0;y<c;y++){let d=y*l,v=Number(a&h);a>>=k,v>l&&(v-=S,a+=Ki);let T=d,w=d+Math.abs(v)-1,I=y%2!==0,F=v<0;v===0?f=f.add(r(I,s[T])):u=u.add(r(F,s[w]))}return{p:u,f}},wNAFCached(i,s,a){let c=Da.get(i)||1,l=qi.get(i);return l||(l=this.precomputeWindow(i,c),c!==1&&qi.set(i,a(l))),this.wNAF(c,l,s)},setWindowSize(i,s){n(s),Da.set(i,s),qi.delete(i)}}}function Un(t,e,r,n){if(!Array.isArray(r)||!Array.isArray(n)||n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");n.forEach((u,f)=>{if(!e.isValid(u))throw new Error(`wrong scalar at index ${f}`)}),r.forEach((u,f)=>{if(!(u instanceof t))throw new Error(`wrong point at index ${f}`)});let o=Fi(BigInt(r.length)),i=o>12?o-3:o>4?o-2:o?2:1,s=(1<<i)-1,a=new Array(s+1).fill(t.ZERO),c=Math.floor((e.BITS-1)/i)*i,l=t.ZERO;for(let u=c;u>=0;u-=i){a.fill(t.ZERO);for(let h=0;h<n.length;h++){let S=n[h],k=Number(S>>BigInt(u)&BigInt(s));a[k]=a[k].add(r[h])}let f=t.ZERO;for(let h=a.length-1,S=t.ZERO;h>0;h--)S=S.add(a[h]),f=f.add(S);if(l=l.add(f),u!==0)for(let h=0;h<i;h++)l=l.double()}return l}function Kr(t){return Hi(t.Fp),Ye(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Pi(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var qe=BigInt(0),Ie=BigInt(1),Rn=BigInt(2),od=BigInt(8),id={zip215:!0};function sd(t){let e=Kr(t);return Ye(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Fa(t){let e=sd(t),{Fp:r,n,prehash:o,hash:i,randomBytes:s,nByteLength:a,h:c}=e,l=Rn<<BigInt(a*8)-Ie,u=r.create,f=_t(e.n,e.nBitLength),h=e.uvRatio||((m,p)=>{try{return{isValid:!0,value:r.sqrt(m*r.inv(p))}}catch{return{isValid:!1,value:qe}}}),S=e.adjustScalarBytes||(m=>m),k=e.domain||((m,p,E)=>{if(Ke("phflag",E),p.length||E)throw new Error("Contexts/pre-hash are not supported");return m});function y(m,p){Te("coordinate "+m,p,qe,l)}function d(m){if(!(m instanceof w))throw new Error("ExtendedPoint expected")}let v=Yt((m,p)=>{let{ex:E,ey:D,ez:O}=m,H=m.is0();p==null&&(p=H?od:r.inv(O));let q=u(E*p),Z=u(D*p),z=u(O*p);if(H)return{x:qe,y:Ie};if(z!==Ie)throw new Error("invZ was invalid");return{x:q,y:Z}}),T=Yt(m=>{let{a:p,d:E}=e;if(m.is0())throw new Error("bad point: ZERO");let{ex:D,ey:O,ez:H,et:q}=m,Z=u(D*D),z=u(O*O),Y=u(H*H),X=u(Y*Y),ue=u(Z*p),le=u(Y*u(ue+z)),de=u(X+u(E*u(Z*z)));if(le!==de)throw new Error("bad point: equation left != right (1)");let Ee=u(D*O),se=u(H*q);if(Ee!==se)throw new Error("bad point: equation left != right (2)");return!0});class w{constructor(p,E,D,O){this.ex=p,this.ey=E,this.ez=D,this.et=O,y("x",p),y("y",E),y("z",D),y("t",O),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(p){if(p instanceof w)throw new Error("extended point not allowed");let{x:E,y:D}=p||{};return y("x",E),y("y",D),new w(E,D,Ie,u(E*D))}static normalizeZ(p){let E=r.invertBatch(p.map(D=>D.ez));return p.map((D,O)=>D.toAffine(E[O])).map(w.fromAffine)}static msm(p,E){return Un(w,f,p,E)}_setWindowSize(p){V.setWindowSize(this,p)}assertValidity(){T(this)}equals(p){d(p);let{ex:E,ey:D,ez:O}=this,{ex:H,ey:q,ez:Z}=p,z=u(E*Z),Y=u(H*O),X=u(D*Z),ue=u(q*O);return z===Y&&X===ue}is0(){return this.equals(w.ZERO)}negate(){return new w(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:p}=e,{ex:E,ey:D,ez:O}=this,H=u(E*E),q=u(D*D),Z=u(Rn*u(O*O)),z=u(p*H),Y=E+D,X=u(u(Y*Y)-H-q),ue=z+q,le=ue-Z,de=z-q,Ee=u(X*le),se=u(ue*de),Ce=u(X*de),ot=u(le*ue);return new w(Ee,se,ot,Ce)}add(p){d(p);let{a:E,d:D}=e,{ex:O,ey:H,ez:q,et:Z}=this,{ex:z,ey:Y,ez:X,et:ue}=p;if(E===BigInt(-1)){let Ys=u((H-O)*(Y+z)),Js=u((H+O)*(Y-z)),pi=u(Js-Ys);if(pi===qe)return this.double();let Xs=u(q*Rn*ue),Qs=u(Z*Rn*X),ea=Qs+Xs,ta=Js+Ys,ra=Qs-Xs,Xl=u(ea*pi),Ql=u(ta*ra),ef=u(ea*ra),tf=u(pi*ta);return new w(Xl,Ql,tf,ef)}let le=u(O*z),de=u(H*Y),Ee=u(Z*D*ue),se=u(q*X),Ce=u((O+H)*(z+Y)-le-de),ot=se-Ee,_r=se+Ee,Lr=u(de-E*le),Wl=u(Ce*ot),jl=u(_r*Lr),Yl=u(Ce*Lr),Jl=u(ot*_r);return new w(Wl,jl,Jl,Yl)}subtract(p){return this.add(p.negate())}wNAF(p){return V.wNAFCached(this,p,w.normalizeZ)}multiply(p){let E=p;Te("scalar",E,Ie,n);let{p:D,f:O}=this.wNAF(E);return w.normalizeZ([D,O])[0]}multiplyUnsafe(p){let E=p;return Te("scalar",E,qe,n),E===qe?F:this.equals(F)||E===Ie?this:this.equals(I)?this.wNAF(E).p:V.unsafeLadder(this,E)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return V.unsafeLadder(this,n).is0()}toAffine(p){return v(this,p)}clearCofactor(){let{h:p}=e;return p===Ie?this:this.multiplyUnsafe(p)}static fromHex(p,E=!1){let{d:D,a:O}=e,H=r.BYTES;p=ie("pointHex",p,H),Ke("zip215",E);let q=p.slice(),Z=p[H-1];q[H-1]=Z&-129;let z=Ut(q),Y=E?l:r.ORDER;Te("pointHex.y",z,qe,Y);let X=u(z*z),ue=u(X-Ie),le=u(D*X-O),{isValid:de,value:Ee}=h(ue,le);if(!de)throw new Error("Point.fromHex: invalid y coordinate");let se=(Ee&Ie)===Ie,Ce=(Z&128)!==0;if(!E&&Ee===qe&&Ce)throw new Error("Point.fromHex: x=0 and x_0=1");return Ce!==se&&(Ee=u(-Ee)),w.fromAffine({x:Ee,y:z})}static fromPrivateKey(p){return b(p).point}toRawBytes(){let{x:p,y:E}=this.toAffine(),D=jt(E,r.BYTES);return D[D.length-1]|=p&Ie?128:0,D}toHex(){return ut(this.toRawBytes())}}w.BASE=new w(e.Gx,e.Gy,Ie,u(e.Gx*e.Gy)),w.ZERO=new w(qe,Ie,Ie,qe);let{BASE:I,ZERO:F}=w,V=Nn(w,a*8);function U(m){return J(m,n)}function x(m){return U(Ut(m))}function b(m){let p=a;m=ie("private key",m,p);let E=ie("hashed private key",i(m),2*p),D=S(E.slice(0,p)),O=E.slice(p,2*p),H=x(D),q=I.multiply(H),Z=q.toRawBytes();return{head:D,prefix:O,scalar:H,point:q,pointBytes:Z}}function M(m){return b(m).pointBytes}function R(m=new Uint8Array,...p){let E=ft(...p);return x(i(k(E,ie("context",m),!!o)))}function N(m,p,E={}){m=ie("message",m),o&&(m=o(m));let{prefix:D,scalar:O,pointBytes:H}=b(p),q=R(E.context,D,m),Z=I.multiply(q).toRawBytes(),z=R(E.context,Z,H,m),Y=U(q+z*O);Te("signature.s",Y,qe,n);let X=ft(Z,jt(Y,r.BYTES));return ie("result",X,a*2)}let $=id;function B(m,p,E,D=$){let{context:O,zip215:H}=D,q=r.BYTES;m=ie("signature",m,2*q),p=ie("message",p),H!==void 0&&Ke("zip215",H),o&&(p=o(p));let Z=Ut(m.slice(q,2*q)),z,Y,X;try{z=w.fromHex(E,H),Y=w.fromHex(m.slice(0,q),H),X=I.multiplyUnsafe(Z)}catch{return!1}if(!H&&z.isSmallOrder())return!1;let ue=R(O,Y.toRawBytes(),z.toRawBytes(),p);return Y.add(z.multiplyUnsafe(ue)).subtract(X).clearCofactor().equals(w.ZERO)}return I._setWindowSize(8),{CURVE:e,getPublicKey:M,sign:N,verify:B,ExtendedPoint:w,utils:{getExtendedPublicKey:b,randomPrivateKey:()=>s(r.BYTES),precompute(m=8,p=w.BASE){return p._setWindowSize(m),p.multiply(BigInt(3)),p}}}}var zi=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ma=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Lg=BigInt(0),ad=BigInt(1),Oa=BigInt(2),Vg=BigInt(3),cd=BigInt(5),ud=BigInt(8);function ld(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=zi,a=t*t%i*t%i,c=te(a,Oa,i)*a%i,l=te(c,ad,i)*t%i,u=te(l,cd,i)*l%i,f=te(u,e,i)*u%i,h=te(f,r,i)*f%i,S=te(h,n,i)*h%i,k=te(S,o,i)*S%i,y=te(k,o,i)*S%i,d=te(y,e,i)*u%i;return{pow_p_5_8:te(d,Oa,i)*t%i,b2:a}}function fd(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function hd(t,e){let r=zi,n=J(e*e*e,r),o=J(n*n*e,r),i=ld(t*o).pow_p_5_8,s=J(t*n*i,r),a=J(e*s*s,r),c=s,l=J(s*Ma,r),u=a===t,f=a===J(-t,r),h=a===J(-t*Ma,r);return u&&(s=c),(f||h)&&(s=l),_a(s,r)&&(s=J(-s,r)),{isValid:u||f,value:s}}var dd=_t(zi,void 0,!0),pd={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:dd,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:ud,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Ta,randomBytes:Sn,adjustScalarBytes:fd,uvRatio:hd},Ha=Fa(pd);var _n=32;function Pa(t,e,r){return Ha.verify(e,r instanceof Uint8Array?r:r.subarray(),t)}var Ln=class{type="Ed25519";raw;constructor(e){this.raw=Gi(e,_n)}toMultihash(){return at.digest(yr(this))}toCID(){return re.createV1(114,this.toMultihash())}toString(){return Q.encode(this.toMultihash().bytes).substring(1)}equals(e){return e==null||!(e.raw instanceof Uint8Array)?!1:pe(this.raw,e.raw)}verify(e,r){return Pa(this.raw,r,e)}};function Zi(t){return t=Gi(t,_n),new Ln(t)}function Gi(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new we(`Key must be a Uint8Array of length ${e}, got ${t.length}`);return t}function Wi(t=0){return new Uint8Array(t)}function Je(t=0){return new Uint8Array(t)}var md=Math.pow(2,7),yd=Math.pow(2,14),xd=Math.pow(2,21),Ka=Math.pow(2,28),qa=Math.pow(2,35),za=Math.pow(2,42),Ga=Math.pow(2,49),Ae=128,Lt=127;function qr(t){if(t<md)return 1;if(t<yd)return 2;if(t<xd)return 3;if(t<Ka)return 4;if(t<qa)return 5;if(t<za)return 6;if(t<Ga)return 7;if(Number.MAX_SAFE_INTEGER!=null&&t>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Za(t,e,r=0){switch(qr(t)){case 8:e[r++]=t&255|Ae,t/=128;case 7:e[r++]=t&255|Ae,t/=128;case 6:e[r++]=t&255|Ae,t/=128;case 5:e[r++]=t&255|Ae,t/=128;case 4:e[r++]=t&255|Ae,t>>>=7;case 3:e[r++]=t&255|Ae,t>>>=7;case 2:e[r++]=t&255|Ae,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Wa(t,e){let r=t[e],n=0;if(n+=r&Lt,r<Ae||(r=t[e+1],n+=(r&Lt)<<7,r<Ae)||(r=t[e+2],n+=(r&Lt)<<14,r<Ae)||(r=t[e+3],n+=(r&Lt)<<21,r<Ae)||(r=t[e+4],n+=(r&Lt)*Ka,r<Ae)||(r=t[e+5],n+=(r&Lt)*qa,r<Ae)||(r=t[e+6],n+=(r&Lt)*za,r<Ae)||(r=t[e+7],n+=(r&Lt)*Ga,r<Ae))return n;throw new RangeError("Could not decode varint")}var ji=new Float32Array([-0]),Vt=new Uint8Array(ji.buffer);function ja(t,e,r){ji[0]=t,e[r]=Vt[0],e[r+1]=Vt[1],e[r+2]=Vt[2],e[r+3]=Vt[3]}function Ya(t,e){return Vt[0]=t[e],Vt[1]=t[e+1],Vt[2]=t[e+2],Vt[3]=t[e+3],ji[0]}var Yi=new Float64Array([-0]),be=new Uint8Array(Yi.buffer);function Ja(t,e,r){Yi[0]=t,e[r]=be[0],e[r+1]=be[1],e[r+2]=be[2],e[r+3]=be[3],e[r+4]=be[4],e[r+5]=be[5],e[r+6]=be[6],e[r+7]=be[7]}function Xa(t,e){return be[0]=t[e],be[1]=t[e+1],be[2]=t[e+2],be[3]=t[e+3],be[4]=t[e+4],be[5]=t[e+5],be[6]=t[e+6],be[7]=t[e+7],Yi[0]}var wd=BigInt(Number.MAX_SAFE_INTEGER),bd=BigInt(Number.MIN_SAFE_INTEGER),Re=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return Xt;if(e<wd&&e>bd)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,o=e-(n<<32n);return r&&(n=~n|0n,o=~o|0n,++o>Qa&&(o=0n,++n>Qa&&(n=0n))),new t(Number(o),Number(n))}static fromNumber(e){if(e===0)return Xt;let r=e<0;r&&(e=-e);let n=e>>>0,o=(e-n)/4294967296>>>0;return r&&(o=~o>>>0,n=~n>>>0,++n>4294967295&&(n=0,++o>4294967295&&(o=0))),new t(n,o)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):Xt}},Xt=new Re(0,0);Xt.toBigInt=function(){return 0n};Xt.zzEncode=Xt.zzDecode=function(){return this};Xt.length=function(){return 1};var Qa=4294967296n;function ec(t){let e=0,r=0;for(let n=0;n<t.length;++n)r=t.charCodeAt(n),r<128?e+=1:r<2048?e+=2:(r&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function tc(t,e,r){if(r-e<1)return"";let o,i=[],s=0,a;for(;e<r;)a=t[e++],a<128?i[s++]=a:a>191&&a<224?i[s++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,i[s++]=55296+(a>>10),i[s++]=56320+(a&1023)):i[s++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,s>8191&&((o??(o=[])).push(String.fromCharCode.apply(String,i)),s=0);return o!=null?(s>0&&o.push(String.fromCharCode.apply(String,i.slice(0,s))),o.join("")):String.fromCharCode.apply(String,i.slice(0,s))}function Ji(t,e,r){let n=r,o,i;for(let s=0;s<t.length;++s)o=t.charCodeAt(s),o<128?e[r++]=o:o<2048?(e[r++]=o>>6|192,e[r++]=o&63|128):(o&64512)===55296&&((i=t.charCodeAt(s+1))&64512)===56320?(o=65536+((o&1023)<<10)+(i&1023),++s,e[r++]=o>>18|240,e[r++]=o>>12&63|128,e[r++]=o>>6&63|128,e[r++]=o&63|128):(e[r++]=o>>12|224,e[r++]=o>>6&63|128,e[r++]=o&63|128);return r-n}function ze(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Vn(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var Xi=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,ze(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw ze(this,4);return Vn(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw ze(this,4);return Vn(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw ze(this,4);let e=Ya(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw ze(this,4);let e=Xa(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw ze(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return tc(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw ze(this,e);this.pos+=e}else do if(this.pos>=this.len)throw ze(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Re(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw ze(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<r*7)>>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw ze(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw ze(this,8);let e=Vn(this.buf,this.pos+=4),r=Vn(this.buf,this.pos+=4);return new Re(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=Wa(this.buf,this.pos);return this.pos+=qr(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Qi(t){return new Xi(t instanceof Uint8Array?t:t.subarray())}function Dt(t,e,r){let n=Qi(t);return e.decode(n,void 0,r)}var es={};Be(es,{base10:()=>vd});var vd=At({prefix:"9",name:"base10",alphabet:"0123456789"});var ts={};Be(ts,{base16:()=>Ed,base16upper:()=>Bd});var Ed=oe({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Bd=oe({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var rs={};Be(rs,{base2:()=>Ad});var Ad=oe({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ns={};Be(ns,{base256emoji:()=>Id});var nc=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}"),Sd=nc.reduce((t,e,r)=>(t[r]=e,t),[]),kd=nc.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Cd(t){return t.reduce((e,r)=>(e+=Sd[r],e),"")}function Td(t){let e=[];for(let r of t){let n=kd[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Id=cr({prefix:"\u{1F680}",name:"base256emoji",encode:Cd,decode:Td});var os={};Be(os,{base8:()=>Nd});var Nd=oe({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var is={};Be(is,{identity:()=>Ud});var Ud=cr({prefix:"\0",name:"identity",encode:t=>aa(t),decode:t=>sa(t)});var ym=new TextEncoder,xm=new TextDecoder;var cs={};Be(cs,{sha256:()=>zr,sha512:()=>Ld});function as({name:t,code:e,encode:r}){return new ss(t,e,r)}var ss=class{name;code;encode;constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Pe(this.code,r):r.then(n=>Pe(this.code,n))}else throw Error("Unknown type, must be binary type")}};function ic(t){return async e=>new Uint8Array(await crypto.subtle.digest(t,e))}var zr=as({name:"sha2-256",code:18,encode:ic("SHA-256")}),Ld=as({name:"sha2-512",code:19,encode:ic("SHA-512")});var us={...is,...rs,...os,...es,...ts,...vi,...ki,...Ei,...Ai,...ns},Nm={...cs,...Ii};function ac(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var sc=ac("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),ls=ac("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=Je(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Vd={utf8:sc,"utf-8":sc,hex:us.base16,latin1:ls,ascii:ls,binary:ls,...us},Dn=Vd;function j(t,e="utf8"){let r=Dn[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return r.decoder.decode(`${r.prefix}${t}`)}function fs(t){let e=t??8192,r=e>>>1,n,o=e;return function(s){if(s<1||s>r)return Je(s);o+s>e&&(n=Je(e),o=0);let a=n.subarray(o,o+=s);return o&7&&(o=(o|7)+1),a}}var Qt=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function hs(){}var ps=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Dd=fs();function Fd(t){return globalThis.Buffer!=null?Je(t):Dd(t)}var Zr=class{len;head;tail;states;constructor(){this.len=0,this.head=new Qt(hs,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new Qt(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new gs((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(Fn,10,Re.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Re.fromBigInt(e);return this._push(Fn,r.length(),r)}uint64Number(e){return this._push(Za,qr(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Re.fromBigInt(e).zzEncode();return this._push(Fn,r.length(),r)}sint64Number(e){let r=Re.fromNumber(e).zzEncode();return this._push(Fn,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(ds,1,e?1:0)}fixed32(e){return this._push(Gr,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Re.fromBigInt(e);return this._push(Gr,4,r.lo)._push(Gr,4,r.hi)}fixed64Number(e){let r=Re.fromNumber(e);return this._push(Gr,4,r.lo)._push(Gr,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(ja,4,e)}double(e){return this._push(Ja,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(ds,1,0):this.uint32(r)._push(Od,r,e)}string(e){let r=ec(e);return r!==0?this.uint32(r)._push(Ji,r,e):this._push(ds,1,0)}fork(){return this.states=new ps(this),this.head=this.tail=new Qt(hs,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Qt(hs,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Fd(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function ds(t,e,r){e[r]=t&255}function Md(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var gs=class extends Qt{next;constructor(e,r){super(Md,e,r),this.next=void 0}};function Fn(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Gr(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function Od(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(Zr.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Hd,e,t),this},Zr.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Pd,e,t),this});function Hd(t,e,r){e.set(t,r)}function Pd(t,e,r){t.length<40?Ji(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(j(t),r)}function ms(){return new Zr}function Ft(t,e){let r=ms();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var xr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(xr||(xr={}));function Mn(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Wr(t){function e(o){if(t[o.toString()]==null)throw new Error("Invalid enum value");return t[o]}let r=function(i,s){let a=e(i);s.int32(a)},n=function(i){let s=i.int32();return e(s)};return Mn("enum",xr.VARINT,r,n)}function Mt(t,e){return Mn("message",xr.LENGTH_DELIMITED,t,e)}var ce;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.secp256k1="secp256k1"})(ce||(ce={}));var ys;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.secp256k1=2]="secp256k1"})(ys||(ys={}));(function(t){t.codec=()=>Wr(ys)})(ce||(ce={}));var Xe;(function(t){let e;t.codec=()=>(e==null&&(e=Mt((r,n,o={})=>{o.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),ce.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),o.lengthDelimited!==!1&&n.ldelim()},(r,n,o={})=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos<s;){let a=r.uint32();switch(a>>>3){case 1:{i.Type=ce.codec().decode(r);break}case 2:{i.Data=r.bytes();break}default:{r.skipType(a&7);break}}}return i})),e),t.encode=r=>Ft(r,t.codec()),t.decode=(r,n)=>Dt(r,t.codec(),n)})(Xe||(Xe={}));var xs;(function(t){let e;t.codec=()=>(e==null&&(e=Mt((r,n,o={})=>{o.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),ce.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),o.lengthDelimited!==!1&&n.ldelim()},(r,n,o={})=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos<s;){let a=r.uint32();switch(a>>>3){case 1:{i.Type=ce.codec().decode(r);break}case 2:{i.Data=r.bytes();break}default:{r.skipType(a&7);break}}}return i})),e),t.encode=r=>Ft(r,t.codec()),t.decode=(r,n)=>Dt(r,t.codec(),n)})(xs||(xs={}));var on={};Be(on,{MAX_RSA_KEY_SIZE:()=>No,generateRSAKeyPair:()=>ou,jwkToJWKKeyPair:()=>iu,jwkToPkcs1:()=>n0,jwkToPkix:()=>Cs,jwkToRSAPrivateKey:()=>nu,pkcs1ToJwk:()=>eu,pkcs1ToRSAPrivateKey:()=>ru,pkixToJwk:()=>tu,pkixToRSAPublicKey:()=>Ts});var $d=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ot=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ht=new Uint32Array(64),ws=class extends gr{constructor(){super(64,32,8,!1),this.A=Ot[0]|0,this.B=Ot[1]|0,this.C=Ot[2]|0,this.D=Ot[3]|0,this.E=Ot[4]|0,this.F=Ot[5]|0,this.G=Ot[6]|0,this.H=Ot[7]|0}get(){let{A:e,B:r,C:n,D:o,E:i,F:s,G:a,H:c}=this;return[e,r,n,o,i,s,a,c]}set(e,r,n,o,i,s,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=s|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)Ht[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){let h=Ht[f-15],S=Ht[f-2],k=$e(h,7)^$e(h,18)^h>>>3,y=$e(S,17)^$e(S,19)^S>>>10;Ht[f]=y+Ht[f-7]+k+Ht[f-16]|0}let{A:n,B:o,C:i,D:s,E:a,F:c,G:l,H:u}=this;for(let f=0;f<64;f++){let h=$e(a,6)^$e(a,11)^$e(a,25),S=u+h+Sa(a,c,l)+$d[f]+Ht[f]|0,y=($e(n,2)^$e(n,13)^$e(n,22))+ka(n,o,i)|0;u=l,l=c,c=a,a=s+S|0,s=i,i=o,o=n,n=S+y|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,o,i,s,a,c,l,u)}roundClean(){Ht.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var wr=An(()=>new ws);var G=Vr(uc());function er(t,e){let r=0;if(t.length===1)return t[0];for(let n=t.length-1;n>=0;n--)r+=t[t.length-1-n]*Math.pow(2,e*n);return r}function Pt(t,e,r=-1){let n=r,o=t,i=0,s=Math.pow(2,e);for(let a=1;a<8;a++){if(t<s){let c;if(n<0)c=new ArrayBuffer(a),i=a;else{if(n<a)return new ArrayBuffer(0);c=new ArrayBuffer(n),i=n}let l=new Uint8Array(c);for(let u=a-1;u>=0;u--){let f=Math.pow(2,u*e);l[i-u-1]=Math.floor(o/f),o-=l[i-u-1]*f}return c}s*=Math.pow(2,e)}return new ArrayBuffer(0)}function Pn(...t){let e=0,r=0;for(let i of t)e+=i.length;let n=new ArrayBuffer(e),o=new Uint8Array(n);for(let i of t)o.set(i,r),r+=i.length;return o}function vs(){let t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=t[0]===255&&t[1]&128,c=t[0]===0&&(t[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)r[a]=0;r[0]=t[0]&128;let n=er(r,8),o=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(o);for(let a=0;a<this.valueHex.byteLength;a++)i[a]=t[a];return i[0]&=127,er(i,8)-n}function lc(t){let e=t<0?t*-1:t,r=128;for(let n=1;n<8;n++){if(e<=r){if(t<0){let s=r-e,a=Pt(s,8,n),c=new Uint8Array(a);return c[0]|=128,a}let o=Pt(e,8,n),i=new Uint8Array(o);if(i[0]&128){let s=o.slice(0),a=new Uint8Array(s);o=new ArrayBuffer(o.byteLength+1),i=new Uint8Array(o);for(let c=0;c<s.byteLength;c++)i[c+1]=a[c];i[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function fc(t,e){if(t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let o=0;o<r.length;o++)if(r[o]!==n[o])return!1;return!0}function Ne(t,e){let r=t.toString(10);if(e<r.length)return"";let n=e-r.length,o=new Array(n);for(let s=0;s<n;s++)o[s]="0";return o.join("").concat(r)}var fy=Math.log(2);function $n(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Es(t){let e=0,r=0;for(let o=0;o<t.length;o++){let i=t[o];e+=i.byteLength}let n=new Uint8Array(e);for(let o=0;o<t.length;o++){let i=t[o];n.set(new Uint8Array(i),r),r+=i.byteLength}return n.buffer}function mt(t,e,r,n){return e instanceof Uint8Array?e.byteLength?r<0?(t.error="Wrong parameter: inputOffset less than zero",!1):n<0?(t.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-r-n<0?(t.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(t.error="Wrong parameter: inputBuffer has zero length",!1):(t.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var Yr=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Es(this.items)}},jr=[new Uint8Array([1])],hc="0123456789";var Ar="",Ge=new ArrayBuffer(0),Bs=new Uint8Array(0),Jr="EndOfContent",pc="OCTET STRING",gc="BIT STRING";function yt(t){var e;return e=class extends t{constructor(...n){var o;super(...n);let i=n[0]||{};this.isHexOnly=(o=i.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=i.valueHex?G.BufferSourceConverter.toUint8Array(i.valueHex):Bs}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}fromBER(n,o,i){let s=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!mt(this,s,o,i))return-1;let a=o+i;return this.valueHexView=s.subarray(o,a),this.valueHexView.length?(this.blockLength=i,a):(this.warnings.push("Zero buffer length"),o)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Ge)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:G.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var dt=class{constructor({blockLength:e=0,error:r=Ar,warnings:n=[],valueBeforeDecode:o=Bs}={}){this.blockLength=e,this.error=r,this.warnings=n,this.valueBeforeDecodeView=G.BufferSourceConverter.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:G.Convert.ToHex(this.valueBeforeDecodeView)}}};dt.NAME="baseBlock";var ve=class extends dt{fromBER(e,r,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};ve.NAME="valueBlock";var Kn=class extends yt(dt){constructor({idBlock:e={}}={}){var r,n,o,i;super(),e?(this.isHexOnly=(r=e.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=e.valueHex?G.BufferSourceConverter.toUint8Array(e.valueHex):Bs,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(o=e.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(i=e.isConstructed)!==null&&i!==void 0?i:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",Ge}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){let o=new Uint8Array(1);if(!e){let i=this.tagNumber;i&=31,r|=i,o[0]=r}return o.buffer}if(!this.isHexOnly){let o=Pt(this.tagNumber,7),i=new Uint8Array(o),s=o.byteLength,a=new Uint8Array(s+1);if(a[0]=r|31,!e){for(let c=0;c<s-1;c++)a[c+1]=i[c]|128;a[s]=i[s-1]}return a.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=r|31,!e){let o=this.valueHexView;for(let i=0;i<o.length-1;i++)n[i+1]=o[i]|128;n[this.valueHexView.byteLength]=o[o.length-1]}return n.buffer}fromBER(e,r,n){let o=G.BufferSourceConverter.toUint8Array(e);if(!mt(this,o,r,n))return-1;let i=o.subarray(r,r+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let a=i[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=1,l=this.valueHexView=new Uint8Array(255),u=255;for(;i[c]&128;){if(l[c-1]=i[c]&127,c++,c>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(c===u){u+=255;let h=new Uint8Array(u);for(let S=0;S<l.length;S++)h[S]=l[S];l=this.valueHexView=new Uint8Array(u)}}this.blockLength=c+1,l[c-1]=i[c]&127;let f=new Uint8Array(c);for(let h=0;h<c;h++)f[h]=l[h];l=this.valueHexView=new Uint8Array(c),l.set(f),this.blockLength<=9?this.tagNumber=er(l,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};Kn.NAME="identificationBlock";var qn=class extends dt{constructor({lenBlock:e={}}={}){var r,n,o;super(),this.isIndefiniteForm=(r=e.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(o=e.length)!==null&&o!==void 0?o:0}fromBER(e,r,n){let o=G.BufferSourceConverter.toUint8Array(e);if(!mt(this,o,r,n))return-1;let i=o.subarray(r,r+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,r+this.blockLength;let s=i[0]&127;if(s>8)return this.error="Too big integer",-1;if(s+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let a=r+1,c=o.subarray(a,a+s);return c[s-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=er(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=s+1,r+this.blockLength}toBER(e=!1){let r,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(r),n[0]=128),r;if(this.longFormUsed){let o=Pt(this.length,8);if(o.byteLength>127)return this.error="Too big length",Ge;if(r=new ArrayBuffer(o.byteLength+1),e)return r;let i=new Uint8Array(o);n=new Uint8Array(r),n[0]=o.byteLength|128;for(let s=0;s<o.byteLength;s++)n[s+1]=i[s];return r}return r=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(r),n[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};qn.NAME="lengthBlock";var _={},ge=class extends dt{constructor({name:e=Ar,optional:r=!1,primitiveSchema:n,...o}={},i){super(o),this.name=e,this.optional=r,n&&(this.primitiveSchema=n),this.idBlock=new Kn(o),this.lenBlock=new qn(o),this.valueBlock=i?new i(o):new ve(o)}fromBER(e,r,n){let o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}toBER(e,r){let n=r||new Yr;r||mc(this);let o=this.idBlock.toBER(e);if(n.write(o),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let i=this.valueBlock.toBER(e);this.lenBlock.length=i.byteLength;let s=this.lenBlock.toBER(e);n.write(s),n.write(i)}return r?Ge:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():G.Convert.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${G.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let r=this.toBER(),n=e.toBER();return fc(r,n)}};ge.NAME="BaseBlock";function mc(t){if(t instanceof _.Constructed)for(let e of t.valueBlock.value)mc(e)&&(t.lenBlock.isIndefiniteForm=!0);return!!t.lenBlock.isIndefiniteForm}var zn=class extends ge{constructor({value:e=Ar,...r}={},n){super(r,n),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,r,n){let o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};zn.NAME="BaseStringBlock";var Gn=class extends yt(ve){constructor({isHexOnly:e=!0,...r}={}){super(r),this.isHexOnly=e}};Gn.NAME="PrimitiveValueBlock";var yc,Zn=class extends ge{constructor(e={}){super(e,Gn),this.idBlock.isConstructed=!1}};yc=Zn;_.Primitive=yc;Zn.NAME="PRIMITIVE";function Jd(t,e){if(t instanceof e)return t;let r=new e;return r.idBlock=t.idBlock,r.lenBlock=t.lenBlock,r.warnings=t.warnings,r.valueBeforeDecodeView=t.valueBeforeDecodeView,r}function To(t,e=0,r=t.length){let n=e,o=new ge({},ve),i=new dt;if(!mt(i,t,e,r))return o.error=i.error,{offset:-1,result:o};if(!t.subarray(e,e+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let a=o.idBlock.fromBER(t,e,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),a===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(e=a,r-=o.idBlock.blockLength,a=o.lenBlock.fromBER(t,e,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),a===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(e=a,r-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let c=ge;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};c=_.EndOfContent;break;case 1:c=_.Boolean;break;case 2:c=_.Integer;break;case 3:c=_.BitString;break;case 4:c=_.OctetString;break;case 5:c=_.Null;break;case 6:c=_.ObjectIdentifier;break;case 10:c=_.Enumerated;break;case 12:c=_.Utf8String;break;case 13:c=_.RelativeObjectIdentifier;break;case 14:c=_.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:c=_.Sequence;break;case 17:c=_.Set;break;case 18:c=_.NumericString;break;case 19:c=_.PrintableString;break;case 20:c=_.TeletexString;break;case 21:c=_.VideotexString;break;case 22:c=_.IA5String;break;case 23:c=_.UTCTime;break;case 24:c=_.GeneralizedTime;break;case 25:c=_.GraphicString;break;case 26:c=_.VisibleString;break;case 27:c=_.GeneralString;break;case 28:c=_.UniversalString;break;case 29:c=_.CharacterString;break;case 30:c=_.BmpString;break;case 31:c=_.DATE;break;case 32:c=_.TimeOfDay;break;case 33:c=_.DateTime;break;case 34:c=_.Duration;break;default:{let l=o.idBlock.isConstructed?new _.Constructed:new _.Primitive;l.idBlock=o.idBlock,l.lenBlock=o.lenBlock,l.warnings=o.warnings,o=l}}break;case 2:case 3:case 4:default:c=o.idBlock.isConstructed?_.Constructed:_.Primitive}return o=Jd(o,c),a=o.fromBER(t,e,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=t.subarray(n,n+o.blockLength),{offset:a,result:o}}function As(t){if(!t.byteLength){let e=new ge({},ve);return e.error="Input buffer has zero length",{offset:-1,result:e}}return To(G.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength)}function Xd(t,e){return t?1:e}var Qe=class extends ve{constructor({value:e=[],isIndefiniteForm:r=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=r}fromBER(e,r,n){let o=G.BufferSourceConverter.toUint8Array(e);if(!mt(this,o,r,n))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let i=r;for(;Xd(this.isIndefiniteForm,n)>0;){let s=To(o,i,n);if(s.offset===-1)return this.error=s.result.error,this.warnings.concat(s.result.warnings),-1;if(i=s.offset,this.blockLength+=s.result.blockLength,n-=s.result.blockLength,this.value.push(s.result),this.isIndefiniteForm&&s.result.constructor.NAME===Jr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Jr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,r){let n=r||new Yr;for(let o=0;o<this.value.length;o++)this.value[o].toBER(e,n);return r?Ge:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let r of this.value)e.value.push(r.toJSON());return e}};Qe.NAME="ConstructedValueBlock";var xc,$t=class extends ge{constructor(e={}){super(e,Qe),this.idBlock.isConstructed=!0}fromBER(e,r,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
3
+ `,R:"%H:%M",T:"%H:%M:%S",t:" ",X:"%T",Z:"GMT",z:"+0000"};return y;function y(x,b,M){var R=this;if(!(R instanceof y))return new y(x,b,M);R.time=+x||0,R.nano=+b||0,R.year=+M||0,d(R)}function d(x){var b,M,R,N=x.year,$=x.time,B=x.nano,A=((B<0||a<=B)&&(B-=(M=Math.floor(B/a))*a,$+=M,M=1),N%e);return($<-i||i<$||A)&&((b=l($/o))&&(N+=b*e,$-=b*o),(R=v($)).setUTCFullYear(A+R.getUTCFullYear()),R=($=+R)+(b=l((N-=A)/e))*o,b&&-i<=R&&R<=i&&(N-=b*e,$=R),M=1),M&&(x.year=N,x.time=$,x.nano=B),x}function v(x){var b=new Date(0);return b.setTime(x),b}function T(N,R){N=+N||0;var M=l((R=(R|0)*s)/n)+l(N/n),R=R%n+N%n,N=l(R/n);return N&&(M+=N,R-=N*n),new y(1e3*R,0,M*e)}function w(x,b,M,R,N,$){return function(A,m){var E=d(this);A=A||new Array(8),F(A,m|=0);var D=Math.floor(E.time/1e3),E=E.year*(r*t/e),p=l(E/s)+l(D/s),E=E%s+D%s,D=Math.floor(E/s);return D&&(p+=D,E-=D*s),B(A,m+N,p),B(A,m+$,E),A};function B(A,m,p){A[m+x]=p>>24&255,A[m+b]=p>>16&255,A[m+M]=p>>8&255,A[m+R]=255&p}}function I(x,b,M,R,N,$){return function(A,m){F(A,m|=0);var p=B(A,m+N);return T(B(A,m+$),p)};function B(A,m){return 16777216*A[m+x]+(A[m+b]<<16|A[m+M]<<8|A[m+R])}}function F(x,b){if(x=x&&x.length,x==null)throw new TypeError("Invalid Buffer");if(x<b+8)throw new RangeError("Out of range")}function V(x){return(9<x?"":"0")+(0|x)}function U(x,b){return(c+(0|x)).substr(-b)}}()});var Ol=gi((s1,Ml)=>{Ml.exports=function(t){if(!t)throw Error("hashlru must have a max value, of type number, greater than 0");var e=0,r=Object.create(null),n=Object.create(null);function o(i,s){r[i]=s,e++,e>=t&&(e=0,n=r,r=Object.create(null))}return{has:function(i){return r[i]!==void 0||n[i]!==void 0},remove:function(i){r[i]!==void 0&&(r[i]=void 0),n[i]!==void 0&&(n[i]=void 0)},get:function(i){var s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set:function(i,s){r[i]!==void 0?r[i]=s:o(i,s)},clear:function(){r=Object.create(null),n=Object.create(null)}}}});var Ep={};Be(Ep,{ipns:()=>vp,ipnsSelector:()=>ei,ipnsValidator:()=>ri});function oa(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1")&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.toMultihash=="function"&&typeof t.toCID=="function"&&typeof t.verify=="function"}var mi=Symbol.for("@libp2p/peer-id");var we=class extends Error{static name="InvalidParametersError";constructor(e="Invalid parameters"){super(e),this.name="InvalidParametersError"}},ir=class extends Error{static name="InvalidPublicKeyError";constructor(e="Invalid public key"){super(e),this.name="InvalidPublicKeyError"}};var Dr=class extends Error{static name="NotFoundError";constructor(e="Not found"){super(e),this.name="NotFoundError"}};var sr=class extends Error{static name="InvalidMultihashError";constructor(e="Invalid Multihash"){super(e),this.name="InvalidMultihashError"}};var ar=class extends Error{static name="UnsupportedKeyTypeError";constructor(e="Unsupported key type"){super(e),this.name="UnsupportedKeyTypeError"}};var vi={};Be(vi,{base32:()=>St,base32hex:()=>yf,base32hexpad:()=>wf,base32hexpadupper:()=>bf,base32hexupper:()=>xf,base32pad:()=>gf,base32padupper:()=>mf,base32upper:()=>pf,base32z:()=>vf});var Cp=new Uint8Array(0);function ia(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function it(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")}function sa(t){return new TextEncoder().encode(t)}function aa(t){return new TextDecoder().decode(t)}function uf(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<t.length;o++){var i=t.charAt(o),s=i.charCodeAt(0);if(r[s]!==255)throw new TypeError(i+" is ambiguous");r[s]=o}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function f(k){if(k instanceof Uint8Array||(ArrayBuffer.isView(k)?k=new Uint8Array(k.buffer,k.byteOffset,k.byteLength):Array.isArray(k)&&(k=Uint8Array.from(k))),!(k instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(k.length===0)return"";for(var y=0,d=0,v=0,T=k.length;v!==T&&k[v]===0;)v++,y++;for(var w=(T-v)*u+1>>>0,I=new Uint8Array(w);v!==T;){for(var F=k[v],V=0,U=w-1;(F!==0||V<d)&&U!==-1;U--,V++)F+=256*I[U]>>>0,I[U]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");d=V,v++}for(var x=w-d;x!==w&&I[x]===0;)x++;for(var b=c.repeat(y);x<w;++x)b+=t.charAt(I[x]);return b}function h(k){if(typeof k!="string")throw new TypeError("Expected String");if(k.length===0)return new Uint8Array;var y=0;if(k[y]!==" "){for(var d=0,v=0;k[y]===c;)d++,y++;for(var T=(k.length-y)*l+1>>>0,w=new Uint8Array(T);k[y];){var I=r[k.charCodeAt(y)];if(I===255)return;for(var F=0,V=T-1;(I!==0||F<v)&&V!==-1;V--,F++)I+=a*w[V]>>>0,w[V]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");v=F,y++}if(k[y]!==" "){for(var U=T-v;U!==T&&w[U]===0;)U++;for(var x=new Uint8Array(d+(T-U)),b=d;U!==T;)x[b++]=w[U++];return x}}}function S(k){var y=h(k);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:S}}var lf=uf,ff=lf,ua=ff;var yi=class{name;prefix;baseEncode;constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},xi=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,r,n){this.name=e,this.prefix=r;let o=r.codePointAt(0);if(o===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=o,this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return la(this,e)}},wi=class{decoders;constructor(e){this.decoders=e}or(e){return la(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function la(t,e){return new wi({...t.decoders??{[t.prefix]:t},...e.decoders??{[e.prefix]:e}})}var bi=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,r,n,o){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new yi(e,r,n),this.decoder=new xi(e,r,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function cr({name:t,prefix:e,encode:r,decode:n}){return new bi(t,e,r,n)}function At({name:t,prefix:e,alphabet:r}){let{encode:n,decode:o}=ua(r,t);return cr({prefix:e,name:t,encode:n,decode:i=>it(o(i))})}function hf(t,e,r,n){let o={};for(let u=0;u<e.length;++u)o[e[u]]=u;let i=t.length;for(;t[i-1]==="=";)--i;let s=new Uint8Array(i*r/8|0),a=0,c=0,l=0;for(let u=0;u<i;++u){let f=o[t[u]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|f,a+=r,a>=8&&(a-=8,s[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s}function df(t,e,r){let n=e[e.length-1]==="=",o=(1<<r)-1,i="",s=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],s+=8;s>r;)s-=r,i+=e[o&a>>s];if(s!==0&&(i+=e[o&a<<r-s]),n)for(;i.length*r&7;)i+="=";return i}function oe({name:t,prefix:e,bitsPerChar:r,alphabet:n}){return cr({prefix:e,name:t,encode(o){return df(o,n,r)},decode(o){return hf(o,n,r,t)}})}var St=oe({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),pf=oe({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),gf=oe({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),mf=oe({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),yf=oe({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),xf=oe({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),wf=oe({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),bf=oe({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),vf=oe({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ei={};Be(Ei,{base58btc:()=>Q,base58flickr:()=>Ef});var Q=At({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ef=At({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ai={};Be(Ai,{base64:()=>Bi,base64pad:()=>Bf,base64url:()=>Af,base64urlpad:()=>Sf});var Bi=oe({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Bf=oe({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Af=oe({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Sf=oe({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function kf(t,e){try{if(typeof t=="string"&&t.length>0)return Cf(t);if(typeof t=="number"&&isFinite(t))return e?.long?If(t):Tf(t);throw new Error("Value is not a string or number.")}catch(r){let n=Nf(r)?`${r.message}. value=${JSON.stringify(t)}`:"An unknown error has occured.";throw new Error(n)}}function Cf(t){if(t=String(t),t.length>100)throw new Error("Value exceeds the maximum length of 100 characters.");let e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return NaN;let r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*315576e5;case"weeks":case"week":case"w":return r*6048e5;case"days":case"day":case"d":return r*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return r*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return r*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return r*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:throw new Error(`The unit ${n} was matched, but no matching case exists.`)}}var bn=kf;function Tf(t){let e=Math.abs(t);return e>=864e5?`${Math.round(t/864e5)}d`:e>=36e5?`${Math.round(t/36e5)}h`:e>=6e4?`${Math.round(t/6e4)}m`:e>=1e3?`${Math.round(t/1e3)}s`:`${t}ms`}function If(t){let e=Math.abs(t);return e>=864e5?wn(t,e,864e5,"day"):e>=36e5?wn(t,e,36e5,"hour"):e>=6e4?wn(t,e,6e4,"minute"):e>=1e3?wn(t,e,1e3,"second"):`${t} ms`}function wn(t,e,r,n){let o=e>=r*1.5;return`${Math.round(t/r)} ${n}${o?"s":""}`}function Nf(t){return typeof t=="object"&&t!==null&&"message"in t}function Si(t){r.debug=r,r.default=r,r.coerce=c,r.disable=i,r.enable=o,r.enabled=s,r.humanize=bn,r.destroy=l,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let f=0;for(let h=0;h<u.length;h++)f=(f<<5)-f+u.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(u){let f,h=null,S,k;function y(...d){if(!y.enabled)return;let v=y,T=Number(new Date),w=T-(f||T);v.diff=w,v.prev=f,v.curr=T,f=T,d[0]=r.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");let I=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(V,U)=>{if(V==="%%")return"%";I++;let x=r.formatters[U];if(typeof x=="function"){let b=d[I];V=x.call(v,b),d.splice(I,1),I--}return V}),r.formatArgs.call(v,d),(v.log||r.log).apply(v,d)}return y.namespace=u,y.useColors=r.useColors(),y.color=r.selectColor(u),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(S!==r.namespaces&&(S=r.namespaces,k=r.enabled(u)),k),set:d=>{h=d}}),typeof r.init=="function"&&r.init(y),y}function n(u,f){let h=r(this.namespace+(typeof f>"u"?":":f)+u);return h.log=this.log,h}function o(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let f,h=(typeof u=="string"?u:"").split(/[\s,]+/),S=h.length;for(f=0;f<S;f++)h[f]&&(u=h[f].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.substr(1)+"$")):r.names.push(new RegExp("^"+u+"$")))}function i(){let u=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),u}function s(u){if(u[u.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(u))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function c(u){return u instanceof Error?u.stack??u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.setupFormatters(r.formatters),r.enable(r.load()),r}var vn=Ff(),Uf=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Rf(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent?.toLowerCase().match(/(edge|trident)\/(\d+)/)!=null?!1:typeof document<"u"&&document.documentElement?.style?.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent?.toLowerCase().match(/firefox\/(\d+)/)!=null&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent?.toLowerCase().match(/applewebkit\/(\d+)/)}function _f(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+bn(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}var Lf=console.debug??console.log??(()=>{});function Vf(t){try{t?vn?.setItem("debug",t):vn?.removeItem("debug")}catch{}}function Df(){let t;try{t=vn?.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function Ff(){try{return localStorage}catch{}}function Mf(t){t.j=function(e){try{return JSON.stringify(e)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}}var fa=Si({formatArgs:_f,save:Vf,load:Df,useColors:Rf,setupFormatters:Mf,colors:Uf,storage:vn,log:Lf});var Ue=fa;Ue.formatters.b=t=>t==null?"undefined":Q.baseEncode(t);Ue.formatters.t=t=>t==null?"undefined":St.baseEncode(t);Ue.formatters.m=t=>t==null?"undefined":Bi.baseEncode(t);Ue.formatters.p=t=>t==null?"undefined":t.toString();Ue.formatters.c=t=>t==null?"undefined":t.toString();Ue.formatters.k=t=>t==null?"undefined":t.toString();Ue.formatters.a=t=>t==null?"undefined":t.toString();function Of(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function kt(t){let e=Of(`${t}:trace`);return Ue.enabled(`${t}:trace`)&&Ue.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=Ue(`${t}:trace`)),Object.assign(Ue(t),{error:Ue(`${t}:error`),trace:e})}var ki={};Be(ki,{base36:()=>He,base36upper:()=>Hf});var He=At({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Hf=At({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Pf=pa,ha=128,$f=127,Kf=~$f,qf=Math.pow(2,31);function pa(t,e,r){e=e||[],r=r||0;for(var n=r;t>=qf;)e[r++]=t&255|ha,t/=128;for(;t&Kf;)e[r++]=t&255|ha,t>>>=7;return e[r]=t|0,pa.bytes=r-n+1,e}var zf=Ci,Gf=128,da=127;function Ci(t,n){var r=0,n=n||0,o=0,i=n,s,a=t.length;do{if(i>=a)throw Ci.bytes=0,new RangeError("Could not decode varint");s=t[i++],r+=o<28?(s&da)<<o:(s&da)*Math.pow(2,o),o+=7}while(s>=Gf);return Ci.bytes=i-n,r}var Zf=Math.pow(2,7),Wf=Math.pow(2,14),jf=Math.pow(2,21),Yf=Math.pow(2,28),Jf=Math.pow(2,35),Xf=Math.pow(2,42),Qf=Math.pow(2,49),eh=Math.pow(2,56),th=Math.pow(2,63),rh=function(t){return t<Zf?1:t<Wf?2:t<jf?3:t<Yf?4:t<Jf?5:t<Xf?6:t<Qf?7:t<eh?8:t<th?9:10},nh={encode:Pf,decode:zf,encodingLength:rh},oh=nh,Fr=oh;function Mr(t,e=0){return[Fr.decode(t,e),Fr.decode.bytes]}function ur(t,e,r=0){return Fr.encode(t,e,r),e}function lr(t){return Fr.encodingLength(t)}function Pe(t,e){let r=e.byteLength,n=lr(t),o=n+lr(r),i=new Uint8Array(o+r);return ur(t,i,0),ur(r,i,n),i.set(e,o),new fr(t,r,e,i)}function st(t){let e=it(t),[r,n]=Mr(e),[o,i]=Mr(e.subarray(n)),s=e.subarray(n+i);if(s.byteLength!==o)throw new Error("Incorrect length");return new fr(r,o,s,e)}function ga(t,e){if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&ia(t.bytes,r.bytes)}}var fr=class{code;size;digest;bytes;constructor(e,r,n,o){this.code=e,this.size=r,this.digest=n,this.bytes=o}};function ma(t,e){let{bytes:r,version:n}=t;switch(n){case 0:return sh(r,Ti(t),e??Q.encoder);default:return ah(r,Ti(t),e??St.encoder)}}var ya=new WeakMap;function Ti(t){let e=ya.get(t);if(e==null){let r=new Map;return ya.set(t,r),r}return e}var re=class t{code;version;multihash;bytes;"/";constructor(e,r,n,o){this.code=r,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Or)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==ch)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Pe(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n!=null&&e.code===n.code&&e.version===n.version&&ga(e.multihash,n.multihash)}toString(e){return ma(this,e)}toJSON(){return{"/":ma(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:o,multihash:i,bytes:s}=r;return new t(n,o,i,s??xa(n,o,i.bytes))}else if(r[uh]===!0){let{version:n,multihash:o,code:i}=r,s=st(o);return t.create(n,i,s)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Or)throw new Error(`Version 0 CID must use dag-pb (code: ${Or}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let o=xa(e,r,n.bytes);return new t(e,r,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Or,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,o=it(e.subarray(n,n+r.multihashSize));if(o.byteLength!==r.multihashSize)throw new Error("Incorrect length");let i=o.subarray(r.multihashSize-r.digestSize),s=new fr(r.multihashCode,r.digestSize,i,o);return[r.version===0?t.createV0(s):t.createV1(r.codec,s),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[f,h]=Mr(e.subarray(r));return r+=h,f},o=n(),i=Or;if(o===18?(o=0,r=0):i=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let s=r,a=n(),c=n(),l=r+c,u=l-s;return{version:o,codec:i,multihashCode:a,digestSize:c,multihashSize:u,size:l}}static parse(e,r){let[n,o]=ih(e,r),i=t.decode(o);if(i.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ti(i).set(n,e),i}};function ih(t,e){switch(t[0]){case"Q":{let r=e??Q;return[Q.prefix,r.decode(`${Q.prefix}${t}`)]}case Q.prefix:{let r=e??Q;return[Q.prefix,r.decode(t)]}case St.prefix:{let r=e??St;return[St.prefix,r.decode(t)]}case He.prefix:{let r=e??He;return[He.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}}function sh(t,e,r){let{prefix:n}=r;if(n!==Q.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let o=e.get(n);if(o==null){let i=r.encode(t).slice(1);return e.set(n,i),i}else return o}function ah(t,e,r){let{prefix:n}=r,o=e.get(n);if(o==null){let i=r.encode(t);return e.set(n,i),i}else return o}var Or=112,ch=18;function xa(t,e,r){let n=lr(t),o=n+lr(e),i=new Uint8Array(o+r.byteLength);return ur(t,i,0),ur(e,i,n),i.set(r,o),i}var uh=Symbol.for("@ipld/js-cid/CID");var Ii={};Be(Ii,{identity:()=>at});var wa=0,lh="identity",ba=it;function fh(t){return Pe(wa,ba(t))}var at={code:wa,name:lh,encode:ba,digest:fh};function pe(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function va(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function hh(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function hr(t,...e){if(!hh(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function Ea(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");va(t.outputLen),va(t.blockLen)}function dr(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ba(t,e){hr(t);let r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var Gt=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Bn=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),$e=(t,e)=>t<<32-e|t>>>e;var lg=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Aa(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Hr(t){return typeof t=="string"&&(t=Aa(t)),hr(t),t}function Ni(...t){let e=0;for(let n=0;n<t.length;n++){let o=t[n];hr(o),e+=o.length}let r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){let i=t[n];r.set(i,o),o+=i.length}return r}var pr=class{clone(){return this._cloneInto()}},fg={}.toString;function An(t){let e=n=>t().update(Hr(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Sn(t=32){if(Gt&&typeof Gt.getRandomValues=="function")return Gt.getRandomValues(new Uint8Array(t));if(Gt&&typeof Gt.randomBytes=="function")return Gt.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function dh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,l=n?0:4;t.setUint32(e+c,s,n),t.setUint32(e+l,a,n)}var Sa=(t,e,r)=>t&e^~t&r,ka=(t,e,r)=>t&e^t&r^e&r,gr=class extends pr{constructor(e,r,n,o){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Bn(this.buffer)}update(e){dr(this);let{view:r,buffer:n,blockLen:o}=this;e=Hr(e);let i=e.length;for(let s=0;s<i;){let a=Math.min(o-this.pos,i-s);if(a===o){let c=Bn(e);for(;o<=i-s;s+=o)this.process(c,s);continue}n.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){dr(this),Ba(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:i}=this,{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>o-s&&(this.process(n,0),s=0);for(let f=s;f<o;f++)r[f]=0;dh(n,o-8,BigInt(this.length*8),i),this.process(n,0);let a=Bn(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)a.setUint32(4*f,u[f],i)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:i,destroyed:s,pos:a}=this;return e.length=o,e.pos=a,e.finished=i,e.destroyed=s,o%r&&e.buffer.set(n),e}};var kn=BigInt(4294967295),Ui=BigInt(32);function Ca(t,e=!1){return e?{h:Number(t&kn),l:Number(t>>Ui&kn)}:{h:Number(t>>Ui&kn)|0,l:Number(t&kn)|0}}function ph(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let o=0;o<t.length;o++){let{h:i,l:s}=Ca(t[o],e);[r[o],n[o]]=[i,s]}return[r,n]}var gh=(t,e)=>BigInt(t>>>0)<<Ui|BigInt(e>>>0),mh=(t,e,r)=>t>>>r,yh=(t,e,r)=>t<<32-r|e>>>r,xh=(t,e,r)=>t>>>r|e<<32-r,wh=(t,e,r)=>t<<32-r|e>>>r,bh=(t,e,r)=>t<<64-r|e>>>r-32,vh=(t,e,r)=>t>>>r-32|e<<64-r,Eh=(t,e)=>e,Bh=(t,e)=>t,Ah=(t,e,r)=>t<<r|e>>>32-r,Sh=(t,e,r)=>e<<r|t>>>32-r,kh=(t,e,r)=>e<<r-32|t>>>64-r,Ch=(t,e,r)=>t<<r-32|e>>>64-r;function Th(t,e,r,n){let o=(e>>>0)+(n>>>0);return{h:t+r+(o/2**32|0)|0,l:o|0}}var Ih=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Nh=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Uh=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Rh=(t,e,r,n,o)=>e+r+n+o+(t/2**32|0)|0,_h=(t,e,r,n,o)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(o>>>0),Lh=(t,e,r,n,o,i)=>e+r+n+o+i+(t/2**32|0)|0;var Vh={fromBig:Ca,split:ph,toBig:gh,shrSH:mh,shrSL:yh,rotrSH:xh,rotrSL:wh,rotrBH:bh,rotrBL:vh,rotr32H:Eh,rotr32L:Bh,rotlSH:Ah,rotlSL:Sh,rotlBH:kh,rotlBL:Ch,add:Th,add3L:Ih,add3H:Nh,add4L:Uh,add4H:Rh,add5H:Lh,add5L:_h},K=Vh;var[Dh,Fh]=K.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Tt=new Uint32Array(80),It=new Uint32Array(80),Ri=class extends gr{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:o,Ch:i,Cl:s,Dh:a,Dl:c,Eh:l,El:u,Fh:f,Fl:h,Gh:S,Gl:k,Hh:y,Hl:d}=this;return[e,r,n,o,i,s,a,c,l,u,f,h,S,k,y,d]}set(e,r,n,o,i,s,a,c,l,u,f,h,S,k,y,d){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=s|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=f|0,this.Fl=h|0,this.Gh=S|0,this.Gl=k|0,this.Hh=y|0,this.Hl=d|0}process(e,r){for(let w=0;w<16;w++,r+=4)Tt[w]=e.getUint32(r),It[w]=e.getUint32(r+=4);for(let w=16;w<80;w++){let I=Tt[w-15]|0,F=It[w-15]|0,V=K.rotrSH(I,F,1)^K.rotrSH(I,F,8)^K.shrSH(I,F,7),U=K.rotrSL(I,F,1)^K.rotrSL(I,F,8)^K.shrSL(I,F,7),x=Tt[w-2]|0,b=It[w-2]|0,M=K.rotrSH(x,b,19)^K.rotrBH(x,b,61)^K.shrSH(x,b,6),R=K.rotrSL(x,b,19)^K.rotrBL(x,b,61)^K.shrSL(x,b,6),N=K.add4L(U,R,It[w-7],It[w-16]),$=K.add4H(N,V,M,Tt[w-7],Tt[w-16]);Tt[w]=$|0,It[w]=N|0}let{Ah:n,Al:o,Bh:i,Bl:s,Ch:a,Cl:c,Dh:l,Dl:u,Eh:f,El:h,Fh:S,Fl:k,Gh:y,Gl:d,Hh:v,Hl:T}=this;for(let w=0;w<80;w++){let I=K.rotrSH(f,h,14)^K.rotrSH(f,h,18)^K.rotrBH(f,h,41),F=K.rotrSL(f,h,14)^K.rotrSL(f,h,18)^K.rotrBL(f,h,41),V=f&S^~f&y,U=h&k^~h&d,x=K.add5L(T,F,U,Fh[w],It[w]),b=K.add5H(x,v,I,V,Dh[w],Tt[w]),M=x|0,R=K.rotrSH(n,o,28)^K.rotrBH(n,o,34)^K.rotrBH(n,o,39),N=K.rotrSL(n,o,28)^K.rotrBL(n,o,34)^K.rotrBL(n,o,39),$=n&i^n&a^i&a,B=o&s^o&c^s&c;v=y|0,T=d|0,y=S|0,d=k|0,S=f|0,k=h|0,{h:f,l:h}=K.add(l|0,u|0,b|0,M|0),l=a|0,u=c|0,a=i|0,c=s|0,i=n|0,s=o|0;let A=K.add3L(M,N,B);n=K.add3H(A,b,R,$),o=A|0}({h:n,l:o}=K.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:s}=K.add(this.Bh|0,this.Bl|0,i|0,s|0),{h:a,l:c}=K.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=K.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:f,l:h}=K.add(this.Eh|0,this.El|0,f|0,h|0),{h:S,l:k}=K.add(this.Fh|0,this.Fl|0,S|0,k|0),{h:y,l:d}=K.add(this.Gh|0,this.Gl|0,y|0,d|0),{h:v,l:T}=K.add(this.Hh|0,this.Hl|0,v|0,T|0),this.set(n,o,i,s,a,c,l,u,f,h,S,k,y,d,v,T)}roundClean(){Tt.fill(0),It.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var Ta=An(()=>new Ri);var Tn={};Be(Tn,{aInRange:()=>Te,abool:()=>Ke,abytes:()=>mr,bitGet:()=>Kh,bitLen:()=>Fi,bitMask:()=>$r,bitSet:()=>qh,bytesToHex:()=>ut,bytesToNumberBE:()=>lt,bytesToNumberLE:()=>Ut,concatBytes:()=>ft,createHmacDrbg:()=>Mi,ensureBytes:()=>ie,equalBytes:()=>Ph,hexToBytes:()=>Wt,hexToNumber:()=>Di,inRange:()=>Pr,isBytes:()=>Nt,memoized:()=>Yt,notImplemented:()=>Gh,numberToBytesBE:()=>Rt,numberToBytesLE:()=>jt,numberToHexUnpadded:()=>Zt,numberToVarBytesBE:()=>Hh,utf8ToBytes:()=>$h,validateObject:()=>Ye});var Vi=BigInt(0),Cn=BigInt(1),Mh=BigInt(2);function Nt(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function mr(t){if(!Nt(t))throw new Error("Uint8Array expected")}function Ke(t,e){if(typeof e!="boolean")throw new Error(`${t} must be valid boolean, got "${e}".`)}var Oh=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ut(t){mr(t);let e="";for(let r=0;r<t.length;r++)e+=Oh[t[r]];return e}function Zt(t){let e=t.toString(16);return e.length&1?`0${e}`:e}function Di(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}var ct={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Ia(t){if(t>=ct._0&&t<=ct._9)return t-ct._0;if(t>=ct._A&&t<=ct._F)return t-(ct._A-10);if(t>=ct._a&&t<=ct._f)return t-(ct._a-10)}function Wt(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);let e=t.length,r=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){let s=Ia(t.charCodeAt(i)),a=Ia(t.charCodeAt(i+1));if(s===void 0||a===void 0){let c=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=s*16+a}return n}function lt(t){return Di(ut(t))}function Ut(t){return mr(t),Di(ut(Uint8Array.from(t).reverse()))}function Rt(t,e){return Wt(t.toString(16).padStart(e*2,"0"))}function jt(t,e){return Rt(t,e).reverse()}function Hh(t){return Wt(Zt(t))}function ie(t,e,r){let n;if(typeof e=="string")try{n=Wt(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(Nt(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(`${t} expected ${r} bytes, got ${o}`);return n}function ft(...t){let e=0;for(let n=0;n<t.length;n++){let o=t[n];mr(o),e+=o.length}let r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){let i=t[n];r.set(i,o),o+=i.length}return r}function Ph(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}function $h(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}var _i=t=>typeof t=="bigint"&&Vi<=t;function Pr(t,e,r){return _i(t)&&_i(e)&&_i(r)&&e<=t&&t<r}function Te(t,e,r,n){if(!Pr(e,r,n))throw new Error(`expected valid ${t}: ${r} <= n < ${n}, got ${typeof e} ${e}`)}function Fi(t){let e;for(e=0;t>Vi;t>>=Cn,e+=1);return e}function Kh(t,e){return t>>BigInt(e)&Cn}function qh(t,e,r){return t|(r?Cn:Vi)<<BigInt(e)}var $r=t=>(Mh<<BigInt(t-1))-Cn,Li=t=>new Uint8Array(t),Na=t=>Uint8Array.from(t);function Mi(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Li(t),o=Li(t),i=0,s=()=>{n.fill(1),o.fill(0),i=0},a=(...f)=>r(o,n,...f),c=(f=Li())=>{o=a(Na([0]),f),n=a(),f.length!==0&&(o=a(Na([1]),f),n=a())},l=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,h=[];for(;f<e;){n=a();let S=n.slice();h.push(S),f+=n.length}return ft(...h)};return(f,h)=>{s(),c(f);let S;for(;!(S=h(l()));)c();return s(),S}}var zh={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Nt(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Ye(t,e,r={}){let n=(o,i,s)=>{let a=zh[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=t[o];if(!(s&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(o)}=${c} (${typeof c}), expected ${i}`)};for(let[o,i]of Object.entries(e))n(o,i,!1);for(let[o,i]of Object.entries(r))n(o,i,!0);return t}var Gh=()=>{throw new Error("not implemented")};function Yt(t){let e=new WeakMap;return(r,...n)=>{let o=e.get(r);if(o!==void 0)return o;let i=t(r,...n);return e.set(r,i),i}}var ae=BigInt(0),ee=BigInt(1),Jt=BigInt(2),Zh=BigInt(3),Oi=BigInt(4),Ua=BigInt(5),Ra=BigInt(8),Wh=BigInt(9),jh=BigInt(16);function J(t,e){let r=t%e;return r>=ae?r:e+r}function Yh(t,e,r){if(r<=ae||e<ae)throw new Error("Expected power/modulo > 0");if(r===ee)return ae;let n=ee;for(;e>ae;)e&ee&&(n=n*t%r),t=t*t%r,e>>=ee;return n}function te(t,e,r){let n=t;for(;e-- >ae;)n*=n,n%=r;return n}function In(t,e){if(t===ae||e<=ae)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=J(t,e),n=e,o=ae,i=ee,s=ee,a=ae;for(;r!==ae;){let l=n/r,u=n%r,f=o-s*l,h=i-a*l;n=r,r=u,o=s,i=a,s=f,a=h}if(n!==ee)throw new Error("invert: does not exist");return J(o,e)}function Jh(t){let e=(t-ee)/Jt,r,n,o;for(r=t-ee,n=0;r%Jt===ae;r/=Jt,n++);for(o=Jt;o<t&&Yh(o,e,t)!==t-ee;o++);if(n===1){let s=(t+ee)/Oi;return function(c,l){let u=c.pow(l,s);if(!c.eql(c.sqr(u),l))throw new Error("Cannot find square root");return u}}let i=(r+ee)/Jt;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let l=n,u=a.pow(a.mul(a.ONE,o),r),f=a.pow(c,i),h=a.pow(c,r);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let S=1;for(let y=a.sqr(h);S<l&&!a.eql(y,a.ONE);S++)y=a.sqr(y);let k=a.pow(u,ee<<BigInt(l-S-1));u=a.sqr(k),f=a.mul(f,k),h=a.mul(h,u),l=S}return f}}function Xh(t){if(t%Oi===Zh){let e=(t+ee)/Oi;return function(n,o){let i=n.pow(o,e);if(!n.eql(n.sqr(i),o))throw new Error("Cannot find square root");return i}}if(t%Ra===Ua){let e=(t-Ua)/Ra;return function(n,o){let i=n.mul(o,Jt),s=n.pow(i,e),a=n.mul(o,s),c=n.mul(n.mul(a,Jt),s),l=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(l),o))throw new Error("Cannot find square root");return l}}return t%jh,Jh(t)}var _a=(t,e)=>(J(t,e)&ee)===ee,Qh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Hi(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Qh.reduce((n,o)=>(n[o]="function",n),e);return Ye(t,r)}function ed(t,e,r){if(r<ae)throw new Error("Expected power > 0");if(r===ae)return t.ONE;if(r===ee)return e;let n=t.ONE,o=e;for(;r>ae;)r&ee&&(n=t.mul(n,o)),o=t.sqr(o),r>>=ee;return n}function td(t,e){let r=new Array(e.length),n=e.reduce((i,s,a)=>t.is0(s)?i:(r[a]=i,t.mul(i,s)),t.ONE),o=t.inv(n);return e.reduceRight((i,s,a)=>t.is0(s)?i:(r[a]=t.mul(i,r[a]),t.mul(i,s)),o),r}function Pi(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function _t(t,e,r=!1,n={}){if(t<=ae)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:o,nByteLength:i}=Pi(t,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=Xh(t),a=Object.freeze({ORDER:t,BITS:o,BYTES:i,MASK:$r(o),ZERO:ae,ONE:ee,create:c=>J(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return ae<=c&&c<t},is0:c=>c===ae,isOdd:c=>(c&ee)===ee,neg:c=>J(-c,t),eql:(c,l)=>c===l,sqr:c=>J(c*c,t),add:(c,l)=>J(c+l,t),sub:(c,l)=>J(c-l,t),mul:(c,l)=>J(c*l,t),pow:(c,l)=>ed(a,c,l),div:(c,l)=>J(c*In(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>In(c,t),sqrt:n.sqrt||(c=>s(a,c)),invertBatch:c=>td(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>r?jt(c,i):Rt(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return r?Ut(c):lt(c)}});return Object.freeze(a)}function La(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function $i(t){let e=La(t);return e+Math.ceil(e/2)}function Va(t,e,r=!1){let n=t.length,o=La(e),i=$i(e);if(n<16||n<i||n>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);let s=r?lt(t):Ut(t),a=J(s,e-ee)+ee;return r?jt(a,o):Rt(a,o)}var nd=BigInt(0),Ki=BigInt(1),qi=new WeakMap,Da=new WeakMap;function Nn(t,e){let r=(i,s)=>{let a=s.negate();return i?a:s},n=i=>{if(!Number.isSafeInteger(i)||i<=0||i>e)throw new Error(`Wrong window size=${i}, should be [1..${e}]`)},o=i=>{n(i);let s=Math.ceil(e/i)+1,a=2**(i-1);return{windows:s,windowSize:a}};return{constTimeNegate:r,unsafeLadder(i,s){let a=t.ZERO,c=i;for(;s>nd;)s&Ki&&(a=a.add(c)),c=c.double(),s>>=Ki;return a},precomputeWindow(i,s){let{windows:a,windowSize:c}=o(s),l=[],u=i,f=u;for(let h=0;h<a;h++){f=u,l.push(f);for(let S=1;S<c;S++)f=f.add(u),l.push(f);u=f.double()}return l},wNAF(i,s,a){let{windows:c,windowSize:l}=o(i),u=t.ZERO,f=t.BASE,h=BigInt(2**i-1),S=2**i,k=BigInt(i);for(let y=0;y<c;y++){let d=y*l,v=Number(a&h);a>>=k,v>l&&(v-=S,a+=Ki);let T=d,w=d+Math.abs(v)-1,I=y%2!==0,F=v<0;v===0?f=f.add(r(I,s[T])):u=u.add(r(F,s[w]))}return{p:u,f}},wNAFCached(i,s,a){let c=Da.get(i)||1,l=qi.get(i);return l||(l=this.precomputeWindow(i,c),c!==1&&qi.set(i,a(l))),this.wNAF(c,l,s)},setWindowSize(i,s){n(s),Da.set(i,s),qi.delete(i)}}}function Un(t,e,r,n){if(!Array.isArray(r)||!Array.isArray(n)||n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");n.forEach((u,f)=>{if(!e.isValid(u))throw new Error(`wrong scalar at index ${f}`)}),r.forEach((u,f)=>{if(!(u instanceof t))throw new Error(`wrong point at index ${f}`)});let o=Fi(BigInt(r.length)),i=o>12?o-3:o>4?o-2:o?2:1,s=(1<<i)-1,a=new Array(s+1).fill(t.ZERO),c=Math.floor((e.BITS-1)/i)*i,l=t.ZERO;for(let u=c;u>=0;u-=i){a.fill(t.ZERO);for(let h=0;h<n.length;h++){let S=n[h],k=Number(S>>BigInt(u)&BigInt(s));a[k]=a[k].add(r[h])}let f=t.ZERO;for(let h=a.length-1,S=t.ZERO;h>0;h--)S=S.add(a[h]),f=f.add(S);if(l=l.add(f),u!==0)for(let h=0;h<i;h++)l=l.double()}return l}function Kr(t){return Hi(t.Fp),Ye(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Pi(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var qe=BigInt(0),Ie=BigInt(1),Rn=BigInt(2),od=BigInt(8),id={zip215:!0};function sd(t){let e=Kr(t);return Ye(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Fa(t){let e=sd(t),{Fp:r,n,prehash:o,hash:i,randomBytes:s,nByteLength:a,h:c}=e,l=Rn<<BigInt(a*8)-Ie,u=r.create,f=_t(e.n,e.nBitLength),h=e.uvRatio||((m,p)=>{try{return{isValid:!0,value:r.sqrt(m*r.inv(p))}}catch{return{isValid:!1,value:qe}}}),S=e.adjustScalarBytes||(m=>m),k=e.domain||((m,p,E)=>{if(Ke("phflag",E),p.length||E)throw new Error("Contexts/pre-hash are not supported");return m});function y(m,p){Te("coordinate "+m,p,qe,l)}function d(m){if(!(m instanceof w))throw new Error("ExtendedPoint expected")}let v=Yt((m,p)=>{let{ex:E,ey:D,ez:O}=m,H=m.is0();p==null&&(p=H?od:r.inv(O));let q=u(E*p),Z=u(D*p),z=u(O*p);if(H)return{x:qe,y:Ie};if(z!==Ie)throw new Error("invZ was invalid");return{x:q,y:Z}}),T=Yt(m=>{let{a:p,d:E}=e;if(m.is0())throw new Error("bad point: ZERO");let{ex:D,ey:O,ez:H,et:q}=m,Z=u(D*D),z=u(O*O),Y=u(H*H),X=u(Y*Y),ue=u(Z*p),le=u(Y*u(ue+z)),de=u(X+u(E*u(Z*z)));if(le!==de)throw new Error("bad point: equation left != right (1)");let Ee=u(D*O),se=u(H*q);if(Ee!==se)throw new Error("bad point: equation left != right (2)");return!0});class w{constructor(p,E,D,O){this.ex=p,this.ey=E,this.ez=D,this.et=O,y("x",p),y("y",E),y("z",D),y("t",O),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(p){if(p instanceof w)throw new Error("extended point not allowed");let{x:E,y:D}=p||{};return y("x",E),y("y",D),new w(E,D,Ie,u(E*D))}static normalizeZ(p){let E=r.invertBatch(p.map(D=>D.ez));return p.map((D,O)=>D.toAffine(E[O])).map(w.fromAffine)}static msm(p,E){return Un(w,f,p,E)}_setWindowSize(p){V.setWindowSize(this,p)}assertValidity(){T(this)}equals(p){d(p);let{ex:E,ey:D,ez:O}=this,{ex:H,ey:q,ez:Z}=p,z=u(E*Z),Y=u(H*O),X=u(D*Z),ue=u(q*O);return z===Y&&X===ue}is0(){return this.equals(w.ZERO)}negate(){return new w(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:p}=e,{ex:E,ey:D,ez:O}=this,H=u(E*E),q=u(D*D),Z=u(Rn*u(O*O)),z=u(p*H),Y=E+D,X=u(u(Y*Y)-H-q),ue=z+q,le=ue-Z,de=z-q,Ee=u(X*le),se=u(ue*de),Ce=u(X*de),ot=u(le*ue);return new w(Ee,se,ot,Ce)}add(p){d(p);let{a:E,d:D}=e,{ex:O,ey:H,ez:q,et:Z}=this,{ex:z,ey:Y,ez:X,et:ue}=p;if(E===BigInt(-1)){let Ys=u((H-O)*(Y+z)),Js=u((H+O)*(Y-z)),pi=u(Js-Ys);if(pi===qe)return this.double();let Xs=u(q*Rn*ue),Qs=u(Z*Rn*X),ea=Qs+Xs,ta=Js+Ys,ra=Qs-Xs,Xl=u(ea*pi),Ql=u(ta*ra),ef=u(ea*ra),tf=u(pi*ta);return new w(Xl,Ql,tf,ef)}let le=u(O*z),de=u(H*Y),Ee=u(Z*D*ue),se=u(q*X),Ce=u((O+H)*(z+Y)-le-de),ot=se-Ee,_r=se+Ee,Lr=u(de-E*le),Wl=u(Ce*ot),jl=u(_r*Lr),Yl=u(Ce*Lr),Jl=u(ot*_r);return new w(Wl,jl,Jl,Yl)}subtract(p){return this.add(p.negate())}wNAF(p){return V.wNAFCached(this,p,w.normalizeZ)}multiply(p){let E=p;Te("scalar",E,Ie,n);let{p:D,f:O}=this.wNAF(E);return w.normalizeZ([D,O])[0]}multiplyUnsafe(p){let E=p;return Te("scalar",E,qe,n),E===qe?F:this.equals(F)||E===Ie?this:this.equals(I)?this.wNAF(E).p:V.unsafeLadder(this,E)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return V.unsafeLadder(this,n).is0()}toAffine(p){return v(this,p)}clearCofactor(){let{h:p}=e;return p===Ie?this:this.multiplyUnsafe(p)}static fromHex(p,E=!1){let{d:D,a:O}=e,H=r.BYTES;p=ie("pointHex",p,H),Ke("zip215",E);let q=p.slice(),Z=p[H-1];q[H-1]=Z&-129;let z=Ut(q),Y=E?l:r.ORDER;Te("pointHex.y",z,qe,Y);let X=u(z*z),ue=u(X-Ie),le=u(D*X-O),{isValid:de,value:Ee}=h(ue,le);if(!de)throw new Error("Point.fromHex: invalid y coordinate");let se=(Ee&Ie)===Ie,Ce=(Z&128)!==0;if(!E&&Ee===qe&&Ce)throw new Error("Point.fromHex: x=0 and x_0=1");return Ce!==se&&(Ee=u(-Ee)),w.fromAffine({x:Ee,y:z})}static fromPrivateKey(p){return b(p).point}toRawBytes(){let{x:p,y:E}=this.toAffine(),D=jt(E,r.BYTES);return D[D.length-1]|=p&Ie?128:0,D}toHex(){return ut(this.toRawBytes())}}w.BASE=new w(e.Gx,e.Gy,Ie,u(e.Gx*e.Gy)),w.ZERO=new w(qe,Ie,Ie,qe);let{BASE:I,ZERO:F}=w,V=Nn(w,a*8);function U(m){return J(m,n)}function x(m){return U(Ut(m))}function b(m){let p=a;m=ie("private key",m,p);let E=ie("hashed private key",i(m),2*p),D=S(E.slice(0,p)),O=E.slice(p,2*p),H=x(D),q=I.multiply(H),Z=q.toRawBytes();return{head:D,prefix:O,scalar:H,point:q,pointBytes:Z}}function M(m){return b(m).pointBytes}function R(m=new Uint8Array,...p){let E=ft(...p);return x(i(k(E,ie("context",m),!!o)))}function N(m,p,E={}){m=ie("message",m),o&&(m=o(m));let{prefix:D,scalar:O,pointBytes:H}=b(p),q=R(E.context,D,m),Z=I.multiply(q).toRawBytes(),z=R(E.context,Z,H,m),Y=U(q+z*O);Te("signature.s",Y,qe,n);let X=ft(Z,jt(Y,r.BYTES));return ie("result",X,a*2)}let $=id;function B(m,p,E,D=$){let{context:O,zip215:H}=D,q=r.BYTES;m=ie("signature",m,2*q),p=ie("message",p),H!==void 0&&Ke("zip215",H),o&&(p=o(p));let Z=Ut(m.slice(q,2*q)),z,Y,X;try{z=w.fromHex(E,H),Y=w.fromHex(m.slice(0,q),H),X=I.multiplyUnsafe(Z)}catch{return!1}if(!H&&z.isSmallOrder())return!1;let ue=R(O,Y.toRawBytes(),z.toRawBytes(),p);return Y.add(z.multiplyUnsafe(ue)).subtract(X).clearCofactor().equals(w.ZERO)}return I._setWindowSize(8),{CURVE:e,getPublicKey:M,sign:N,verify:B,ExtendedPoint:w,utils:{getExtendedPublicKey:b,randomPrivateKey:()=>s(r.BYTES),precompute(m=8,p=w.BASE){return p._setWindowSize(m),p.multiply(BigInt(3)),p}}}}var zi=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ma=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Lg=BigInt(0),ad=BigInt(1),Oa=BigInt(2),Vg=BigInt(3),cd=BigInt(5),ud=BigInt(8);function ld(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=zi,a=t*t%i*t%i,c=te(a,Oa,i)*a%i,l=te(c,ad,i)*t%i,u=te(l,cd,i)*l%i,f=te(u,e,i)*u%i,h=te(f,r,i)*f%i,S=te(h,n,i)*h%i,k=te(S,o,i)*S%i,y=te(k,o,i)*S%i,d=te(y,e,i)*u%i;return{pow_p_5_8:te(d,Oa,i)*t%i,b2:a}}function fd(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function hd(t,e){let r=zi,n=J(e*e*e,r),o=J(n*n*e,r),i=ld(t*o).pow_p_5_8,s=J(t*n*i,r),a=J(e*s*s,r),c=s,l=J(s*Ma,r),u=a===t,f=a===J(-t,r),h=a===J(-t*Ma,r);return u&&(s=c),(f||h)&&(s=l),_a(s,r)&&(s=J(-s,r)),{isValid:u||f,value:s}}var dd=_t(zi,void 0,!0),pd={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:dd,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:ud,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Ta,randomBytes:Sn,adjustScalarBytes:fd,uvRatio:hd},Ha=Fa(pd);var _n=32;function Pa(t,e,r){return Ha.verify(e,r instanceof Uint8Array?r:r.subarray(),t)}var Ln=class{type="Ed25519";raw;constructor(e){this.raw=Gi(e,_n)}toMultihash(){return at.digest(yr(this))}toCID(){return re.createV1(114,this.toMultihash())}toString(){return Q.encode(this.toMultihash().bytes).substring(1)}equals(e){return e==null||!(e.raw instanceof Uint8Array)?!1:pe(this.raw,e.raw)}verify(e,r){return Pa(this.raw,r,e)}};function Zi(t){return t=Gi(t,_n),new Ln(t)}function Gi(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new we(`Key must be a Uint8Array of length ${e}, got ${t.length}`);return t}function Wi(t=0){return new Uint8Array(t)}function Je(t=0){return new Uint8Array(t)}var md=Math.pow(2,7),yd=Math.pow(2,14),xd=Math.pow(2,21),Ka=Math.pow(2,28),qa=Math.pow(2,35),za=Math.pow(2,42),Ga=Math.pow(2,49),Ae=128,Lt=127;function qr(t){if(t<md)return 1;if(t<yd)return 2;if(t<xd)return 3;if(t<Ka)return 4;if(t<qa)return 5;if(t<za)return 6;if(t<Ga)return 7;if(Number.MAX_SAFE_INTEGER!=null&&t>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Za(t,e,r=0){switch(qr(t)){case 8:e[r++]=t&255|Ae,t/=128;case 7:e[r++]=t&255|Ae,t/=128;case 6:e[r++]=t&255|Ae,t/=128;case 5:e[r++]=t&255|Ae,t/=128;case 4:e[r++]=t&255|Ae,t>>>=7;case 3:e[r++]=t&255|Ae,t>>>=7;case 2:e[r++]=t&255|Ae,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Wa(t,e){let r=t[e],n=0;if(n+=r&Lt,r<Ae||(r=t[e+1],n+=(r&Lt)<<7,r<Ae)||(r=t[e+2],n+=(r&Lt)<<14,r<Ae)||(r=t[e+3],n+=(r&Lt)<<21,r<Ae)||(r=t[e+4],n+=(r&Lt)*Ka,r<Ae)||(r=t[e+5],n+=(r&Lt)*qa,r<Ae)||(r=t[e+6],n+=(r&Lt)*za,r<Ae)||(r=t[e+7],n+=(r&Lt)*Ga,r<Ae))return n;throw new RangeError("Could not decode varint")}var ji=new Float32Array([-0]),Vt=new Uint8Array(ji.buffer);function ja(t,e,r){ji[0]=t,e[r]=Vt[0],e[r+1]=Vt[1],e[r+2]=Vt[2],e[r+3]=Vt[3]}function Ya(t,e){return Vt[0]=t[e],Vt[1]=t[e+1],Vt[2]=t[e+2],Vt[3]=t[e+3],ji[0]}var Yi=new Float64Array([-0]),be=new Uint8Array(Yi.buffer);function Ja(t,e,r){Yi[0]=t,e[r]=be[0],e[r+1]=be[1],e[r+2]=be[2],e[r+3]=be[3],e[r+4]=be[4],e[r+5]=be[5],e[r+6]=be[6],e[r+7]=be[7]}function Xa(t,e){return be[0]=t[e],be[1]=t[e+1],be[2]=t[e+2],be[3]=t[e+3],be[4]=t[e+4],be[5]=t[e+5],be[6]=t[e+6],be[7]=t[e+7],Yi[0]}var wd=BigInt(Number.MAX_SAFE_INTEGER),bd=BigInt(Number.MIN_SAFE_INTEGER),Re=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return Xt;if(e<wd&&e>bd)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,o=e-(n<<32n);return r&&(n=~n|0n,o=~o|0n,++o>Qa&&(o=0n,++n>Qa&&(n=0n))),new t(Number(o),Number(n))}static fromNumber(e){if(e===0)return Xt;let r=e<0;r&&(e=-e);let n=e>>>0,o=(e-n)/4294967296>>>0;return r&&(o=~o>>>0,n=~n>>>0,++n>4294967295&&(n=0,++o>4294967295&&(o=0))),new t(n,o)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):Xt}},Xt=new Re(0,0);Xt.toBigInt=function(){return 0n};Xt.zzEncode=Xt.zzDecode=function(){return this};Xt.length=function(){return 1};var Qa=4294967296n;function ec(t){let e=0,r=0;for(let n=0;n<t.length;++n)r=t.charCodeAt(n),r<128?e+=1:r<2048?e+=2:(r&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function tc(t,e,r){if(r-e<1)return"";let o,i=[],s=0,a;for(;e<r;)a=t[e++],a<128?i[s++]=a:a>191&&a<224?i[s++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,i[s++]=55296+(a>>10),i[s++]=56320+(a&1023)):i[s++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,s>8191&&((o??(o=[])).push(String.fromCharCode.apply(String,i)),s=0);return o!=null?(s>0&&o.push(String.fromCharCode.apply(String,i.slice(0,s))),o.join("")):String.fromCharCode.apply(String,i.slice(0,s))}function Ji(t,e,r){let n=r,o,i;for(let s=0;s<t.length;++s)o=t.charCodeAt(s),o<128?e[r++]=o:o<2048?(e[r++]=o>>6|192,e[r++]=o&63|128):(o&64512)===55296&&((i=t.charCodeAt(s+1))&64512)===56320?(o=65536+((o&1023)<<10)+(i&1023),++s,e[r++]=o>>18|240,e[r++]=o>>12&63|128,e[r++]=o>>6&63|128,e[r++]=o&63|128):(e[r++]=o>>12|224,e[r++]=o>>6&63|128,e[r++]=o&63|128);return r-n}function ze(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Vn(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var Xi=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,ze(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw ze(this,4);return Vn(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw ze(this,4);return Vn(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw ze(this,4);let e=Ya(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw ze(this,4);let e=Xa(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw ze(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return tc(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw ze(this,e);this.pos+=e}else do if(this.pos>=this.len)throw ze(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Re(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw ze(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<r*7)>>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw ze(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw ze(this,8);let e=Vn(this.buf,this.pos+=4),r=Vn(this.buf,this.pos+=4);return new Re(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=Wa(this.buf,this.pos);return this.pos+=qr(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Qi(t){return new Xi(t instanceof Uint8Array?t:t.subarray())}function Dt(t,e,r){let n=Qi(t);return e.decode(n,void 0,r)}var es={};Be(es,{base10:()=>vd});var vd=At({prefix:"9",name:"base10",alphabet:"0123456789"});var ts={};Be(ts,{base16:()=>Ed,base16upper:()=>Bd});var Ed=oe({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Bd=oe({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var rs={};Be(rs,{base2:()=>Ad});var Ad=oe({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ns={};Be(ns,{base256emoji:()=>Id});var nc=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}"),Sd=nc.reduce((t,e,r)=>(t[r]=e,t),[]),kd=nc.reduce((t,e,r)=>{let n=e.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${e}`);return t[n]=r,t},[]);function Cd(t){return t.reduce((e,r)=>(e+=Sd[r],e),"")}function Td(t){let e=[];for(let r of t){let n=r.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${r}`);let o=kd[n];if(o==null)throw new Error(`Non-base256emoji character: ${r}`);e.push(o)}return new Uint8Array(e)}var Id=cr({prefix:"\u{1F680}",name:"base256emoji",encode:Cd,decode:Td});var os={};Be(os,{base8:()=>Nd});var Nd=oe({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var is={};Be(is,{identity:()=>Ud});var Ud=cr({prefix:"\0",name:"identity",encode:t=>aa(t),decode:t=>sa(t)});var ym=new TextEncoder,xm=new TextDecoder;var cs={};Be(cs,{sha256:()=>zr,sha512:()=>Ld});function as({name:t,code:e,encode:r}){return new ss(t,e,r)}var ss=class{name;code;encode;constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Pe(this.code,r):r.then(n=>Pe(this.code,n))}else throw Error("Unknown type, must be binary type")}};function ic(t){return async e=>new Uint8Array(await crypto.subtle.digest(t,e))}var zr=as({name:"sha2-256",code:18,encode:ic("SHA-256")}),Ld=as({name:"sha2-512",code:19,encode:ic("SHA-512")});var us={...is,...rs,...os,...es,...ts,...vi,...ki,...Ei,...Ai,...ns},Nm={...cs,...Ii};function ac(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var sc=ac("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),ls=ac("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=Je(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Vd={utf8:sc,"utf-8":sc,hex:us.base16,latin1:ls,ascii:ls,binary:ls,...us},Dn=Vd;function j(t,e="utf8"){let r=Dn[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return r.decoder.decode(`${r.prefix}${t}`)}function fs(t){let e=t??8192,r=e>>>1,n,o=e;return function(s){if(s<1||s>r)return Je(s);o+s>e&&(n=Je(e),o=0);let a=n.subarray(o,o+=s);return o&7&&(o=(o|7)+1),a}}var Qt=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function hs(){}var ps=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Dd=fs();function Fd(t){return globalThis.Buffer!=null?Je(t):Dd(t)}var Zr=class{len;head;tail;states;constructor(){this.len=0,this.head=new Qt(hs,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new Qt(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new gs((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(Fn,10,Re.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Re.fromBigInt(e);return this._push(Fn,r.length(),r)}uint64Number(e){return this._push(Za,qr(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Re.fromBigInt(e).zzEncode();return this._push(Fn,r.length(),r)}sint64Number(e){let r=Re.fromNumber(e).zzEncode();return this._push(Fn,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(ds,1,e?1:0)}fixed32(e){return this._push(Gr,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Re.fromBigInt(e);return this._push(Gr,4,r.lo)._push(Gr,4,r.hi)}fixed64Number(e){let r=Re.fromNumber(e);return this._push(Gr,4,r.lo)._push(Gr,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(ja,4,e)}double(e){return this._push(Ja,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(ds,1,0):this.uint32(r)._push(Od,r,e)}string(e){let r=ec(e);return r!==0?this.uint32(r)._push(Ji,r,e):this._push(ds,1,0)}fork(){return this.states=new ps(this),this.head=this.tail=new Qt(hs,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Qt(hs,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Fd(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function ds(t,e,r){e[r]=t&255}function Md(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var gs=class extends Qt{next;constructor(e,r){super(Md,e,r),this.next=void 0}};function Fn(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Gr(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function Od(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(Zr.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Hd,e,t),this},Zr.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Pd,e,t),this});function Hd(t,e,r){e.set(t,r)}function Pd(t,e,r){t.length<40?Ji(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(j(t),r)}function ms(){return new Zr}function Ft(t,e){let r=ms();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var xr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(xr||(xr={}));function Mn(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Wr(t){function e(o){if(t[o.toString()]==null)throw new Error("Invalid enum value");return t[o]}let r=function(i,s){let a=e(i);s.int32(a)},n=function(i){let s=i.int32();return e(s)};return Mn("enum",xr.VARINT,r,n)}function Mt(t,e){return Mn("message",xr.LENGTH_DELIMITED,t,e)}var ce;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.secp256k1="secp256k1"})(ce||(ce={}));var ys;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.secp256k1=2]="secp256k1"})(ys||(ys={}));(function(t){t.codec=()=>Wr(ys)})(ce||(ce={}));var Xe;(function(t){let e;t.codec=()=>(e==null&&(e=Mt((r,n,o={})=>{o.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),ce.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),o.lengthDelimited!==!1&&n.ldelim()},(r,n,o={})=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos<s;){let a=r.uint32();switch(a>>>3){case 1:{i.Type=ce.codec().decode(r);break}case 2:{i.Data=r.bytes();break}default:{r.skipType(a&7);break}}}return i})),e),t.encode=r=>Ft(r,t.codec()),t.decode=(r,n)=>Dt(r,t.codec(),n)})(Xe||(Xe={}));var xs;(function(t){let e;t.codec=()=>(e==null&&(e=Mt((r,n,o={})=>{o.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),ce.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),o.lengthDelimited!==!1&&n.ldelim()},(r,n,o={})=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos<s;){let a=r.uint32();switch(a>>>3){case 1:{i.Type=ce.codec().decode(r);break}case 2:{i.Data=r.bytes();break}default:{r.skipType(a&7);break}}}return i})),e),t.encode=r=>Ft(r,t.codec()),t.decode=(r,n)=>Dt(r,t.codec(),n)})(xs||(xs={}));var on={};Be(on,{MAX_RSA_KEY_SIZE:()=>No,generateRSAKeyPair:()=>ou,jwkToJWKKeyPair:()=>iu,jwkToPkcs1:()=>n0,jwkToPkix:()=>Cs,jwkToRSAPrivateKey:()=>nu,pkcs1ToJwk:()=>eu,pkcs1ToRSAPrivateKey:()=>ru,pkixToJwk:()=>tu,pkixToRSAPublicKey:()=>Ts});var $d=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ot=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ht=new Uint32Array(64),ws=class extends gr{constructor(){super(64,32,8,!1),this.A=Ot[0]|0,this.B=Ot[1]|0,this.C=Ot[2]|0,this.D=Ot[3]|0,this.E=Ot[4]|0,this.F=Ot[5]|0,this.G=Ot[6]|0,this.H=Ot[7]|0}get(){let{A:e,B:r,C:n,D:o,E:i,F:s,G:a,H:c}=this;return[e,r,n,o,i,s,a,c]}set(e,r,n,o,i,s,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=s|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)Ht[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){let h=Ht[f-15],S=Ht[f-2],k=$e(h,7)^$e(h,18)^h>>>3,y=$e(S,17)^$e(S,19)^S>>>10;Ht[f]=y+Ht[f-7]+k+Ht[f-16]|0}let{A:n,B:o,C:i,D:s,E:a,F:c,G:l,H:u}=this;for(let f=0;f<64;f++){let h=$e(a,6)^$e(a,11)^$e(a,25),S=u+h+Sa(a,c,l)+$d[f]+Ht[f]|0,y=($e(n,2)^$e(n,13)^$e(n,22))+ka(n,o,i)|0;u=l,l=c,c=a,a=s+S|0,s=i,i=o,o=n,n=S+y|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,o,i,s,a,c,l,u)}roundClean(){Ht.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var wr=An(()=>new ws);var G=Vr(uc());function er(t,e){let r=0;if(t.length===1)return t[0];for(let n=t.length-1;n>=0;n--)r+=t[t.length-1-n]*Math.pow(2,e*n);return r}function Pt(t,e,r=-1){let n=r,o=t,i=0,s=Math.pow(2,e);for(let a=1;a<8;a++){if(t<s){let c;if(n<0)c=new ArrayBuffer(a),i=a;else{if(n<a)return new ArrayBuffer(0);c=new ArrayBuffer(n),i=n}let l=new Uint8Array(c);for(let u=a-1;u>=0;u--){let f=Math.pow(2,u*e);l[i-u-1]=Math.floor(o/f),o-=l[i-u-1]*f}return c}s*=Math.pow(2,e)}return new ArrayBuffer(0)}function Pn(...t){let e=0,r=0;for(let i of t)e+=i.length;let n=new ArrayBuffer(e),o=new Uint8Array(n);for(let i of t)o.set(i,r),r+=i.length;return o}function vs(){let t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=t[0]===255&&t[1]&128,c=t[0]===0&&(t[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)r[a]=0;r[0]=t[0]&128;let n=er(r,8),o=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(o);for(let a=0;a<this.valueHex.byteLength;a++)i[a]=t[a];return i[0]&=127,er(i,8)-n}function lc(t){let e=t<0?t*-1:t,r=128;for(let n=1;n<8;n++){if(e<=r){if(t<0){let s=r-e,a=Pt(s,8,n),c=new Uint8Array(a);return c[0]|=128,a}let o=Pt(e,8,n),i=new Uint8Array(o);if(i[0]&128){let s=o.slice(0),a=new Uint8Array(s);o=new ArrayBuffer(o.byteLength+1),i=new Uint8Array(o);for(let c=0;c<s.byteLength;c++)i[c+1]=a[c];i[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function fc(t,e){if(t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let o=0;o<r.length;o++)if(r[o]!==n[o])return!1;return!0}function Ne(t,e){let r=t.toString(10);if(e<r.length)return"";let n=e-r.length,o=new Array(n);for(let s=0;s<n;s++)o[s]="0";return o.join("").concat(r)}var fy=Math.log(2);function $n(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Es(t){let e=0,r=0;for(let o=0;o<t.length;o++){let i=t[o];e+=i.byteLength}let n=new Uint8Array(e);for(let o=0;o<t.length;o++){let i=t[o];n.set(new Uint8Array(i),r),r+=i.byteLength}return n.buffer}function mt(t,e,r,n){return e instanceof Uint8Array?e.byteLength?r<0?(t.error="Wrong parameter: inputOffset less than zero",!1):n<0?(t.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-r-n<0?(t.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(t.error="Wrong parameter: inputBuffer has zero length",!1):(t.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var Yr=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Es(this.items)}},jr=[new Uint8Array([1])],hc="0123456789";var Ar="",Ge=new ArrayBuffer(0),Bs=new Uint8Array(0),Jr="EndOfContent",pc="OCTET STRING",gc="BIT STRING";function yt(t){var e;return e=class extends t{constructor(...n){var o;super(...n);let i=n[0]||{};this.isHexOnly=(o=i.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=i.valueHex?G.BufferSourceConverter.toUint8Array(i.valueHex):Bs}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}fromBER(n,o,i){let s=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!mt(this,s,o,i))return-1;let a=o+i;return this.valueHexView=s.subarray(o,a),this.valueHexView.length?(this.blockLength=i,a):(this.warnings.push("Zero buffer length"),o)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Ge)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:G.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var dt=class{constructor({blockLength:e=0,error:r=Ar,warnings:n=[],valueBeforeDecode:o=Bs}={}){this.blockLength=e,this.error=r,this.warnings=n,this.valueBeforeDecodeView=G.BufferSourceConverter.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:G.Convert.ToHex(this.valueBeforeDecodeView)}}};dt.NAME="baseBlock";var ve=class extends dt{fromBER(e,r,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};ve.NAME="valueBlock";var Kn=class extends yt(dt){constructor({idBlock:e={}}={}){var r,n,o,i;super(),e?(this.isHexOnly=(r=e.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=e.valueHex?G.BufferSourceConverter.toUint8Array(e.valueHex):Bs,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(o=e.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(i=e.isConstructed)!==null&&i!==void 0?i:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",Ge}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){let o=new Uint8Array(1);if(!e){let i=this.tagNumber;i&=31,r|=i,o[0]=r}return o.buffer}if(!this.isHexOnly){let o=Pt(this.tagNumber,7),i=new Uint8Array(o),s=o.byteLength,a=new Uint8Array(s+1);if(a[0]=r|31,!e){for(let c=0;c<s-1;c++)a[c+1]=i[c]|128;a[s]=i[s-1]}return a.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=r|31,!e){let o=this.valueHexView;for(let i=0;i<o.length-1;i++)n[i+1]=o[i]|128;n[this.valueHexView.byteLength]=o[o.length-1]}return n.buffer}fromBER(e,r,n){let o=G.BufferSourceConverter.toUint8Array(e);if(!mt(this,o,r,n))return-1;let i=o.subarray(r,r+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let a=i[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=1,l=this.valueHexView=new Uint8Array(255),u=255;for(;i[c]&128;){if(l[c-1]=i[c]&127,c++,c>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(c===u){u+=255;let h=new Uint8Array(u);for(let S=0;S<l.length;S++)h[S]=l[S];l=this.valueHexView=new Uint8Array(u)}}this.blockLength=c+1,l[c-1]=i[c]&127;let f=new Uint8Array(c);for(let h=0;h<c;h++)f[h]=l[h];l=this.valueHexView=new Uint8Array(c),l.set(f),this.blockLength<=9?this.tagNumber=er(l,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};Kn.NAME="identificationBlock";var qn=class extends dt{constructor({lenBlock:e={}}={}){var r,n,o;super(),this.isIndefiniteForm=(r=e.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(o=e.length)!==null&&o!==void 0?o:0}fromBER(e,r,n){let o=G.BufferSourceConverter.toUint8Array(e);if(!mt(this,o,r,n))return-1;let i=o.subarray(r,r+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,r+this.blockLength;let s=i[0]&127;if(s>8)return this.error="Too big integer",-1;if(s+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let a=r+1,c=o.subarray(a,a+s);return c[s-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=er(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=s+1,r+this.blockLength}toBER(e=!1){let r,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(r),n[0]=128),r;if(this.longFormUsed){let o=Pt(this.length,8);if(o.byteLength>127)return this.error="Too big length",Ge;if(r=new ArrayBuffer(o.byteLength+1),e)return r;let i=new Uint8Array(o);n=new Uint8Array(r),n[0]=o.byteLength|128;for(let s=0;s<o.byteLength;s++)n[s+1]=i[s];return r}return r=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(r),n[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};qn.NAME="lengthBlock";var _={},ge=class extends dt{constructor({name:e=Ar,optional:r=!1,primitiveSchema:n,...o}={},i){super(o),this.name=e,this.optional=r,n&&(this.primitiveSchema=n),this.idBlock=new Kn(o),this.lenBlock=new qn(o),this.valueBlock=i?new i(o):new ve(o)}fromBER(e,r,n){let o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}toBER(e,r){let n=r||new Yr;r||mc(this);let o=this.idBlock.toBER(e);if(n.write(o),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let i=this.valueBlock.toBER(e);this.lenBlock.length=i.byteLength;let s=this.lenBlock.toBER(e);n.write(s),n.write(i)}return r?Ge:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():G.Convert.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${G.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let r=this.toBER(),n=e.toBER();return fc(r,n)}};ge.NAME="BaseBlock";function mc(t){if(t instanceof _.Constructed)for(let e of t.valueBlock.value)mc(e)&&(t.lenBlock.isIndefiniteForm=!0);return!!t.lenBlock.isIndefiniteForm}var zn=class extends ge{constructor({value:e=Ar,...r}={},n){super(r,n),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,r,n){let o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};zn.NAME="BaseStringBlock";var Gn=class extends yt(ve){constructor({isHexOnly:e=!0,...r}={}){super(r),this.isHexOnly=e}};Gn.NAME="PrimitiveValueBlock";var yc,Zn=class extends ge{constructor(e={}){super(e,Gn),this.idBlock.isConstructed=!1}};yc=Zn;_.Primitive=yc;Zn.NAME="PRIMITIVE";function Jd(t,e){if(t instanceof e)return t;let r=new e;return r.idBlock=t.idBlock,r.lenBlock=t.lenBlock,r.warnings=t.warnings,r.valueBeforeDecodeView=t.valueBeforeDecodeView,r}function To(t,e=0,r=t.length){let n=e,o=new ge({},ve),i=new dt;if(!mt(i,t,e,r))return o.error=i.error,{offset:-1,result:o};if(!t.subarray(e,e+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let a=o.idBlock.fromBER(t,e,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),a===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(e=a,r-=o.idBlock.blockLength,a=o.lenBlock.fromBER(t,e,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),a===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(e=a,r-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let c=ge;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};c=_.EndOfContent;break;case 1:c=_.Boolean;break;case 2:c=_.Integer;break;case 3:c=_.BitString;break;case 4:c=_.OctetString;break;case 5:c=_.Null;break;case 6:c=_.ObjectIdentifier;break;case 10:c=_.Enumerated;break;case 12:c=_.Utf8String;break;case 13:c=_.RelativeObjectIdentifier;break;case 14:c=_.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:c=_.Sequence;break;case 17:c=_.Set;break;case 18:c=_.NumericString;break;case 19:c=_.PrintableString;break;case 20:c=_.TeletexString;break;case 21:c=_.VideotexString;break;case 22:c=_.IA5String;break;case 23:c=_.UTCTime;break;case 24:c=_.GeneralizedTime;break;case 25:c=_.GraphicString;break;case 26:c=_.VisibleString;break;case 27:c=_.GeneralString;break;case 28:c=_.UniversalString;break;case 29:c=_.CharacterString;break;case 30:c=_.BmpString;break;case 31:c=_.DATE;break;case 32:c=_.TimeOfDay;break;case 33:c=_.DateTime;break;case 34:c=_.Duration;break;default:{let l=o.idBlock.isConstructed?new _.Constructed:new _.Primitive;l.idBlock=o.idBlock,l.lenBlock=o.lenBlock,l.warnings=o.warnings,o=l}}break;case 2:case 3:case 4:default:c=o.idBlock.isConstructed?_.Constructed:_.Primitive}return o=Jd(o,c),a=o.fromBER(t,e,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=t.subarray(n,n+o.blockLength),{offset:a,result:o}}function As(t){if(!t.byteLength){let e=new ge({},ve);return e.error="Input buffer has zero length",{offset:-1,result:e}}return To(G.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength)}function Xd(t,e){return t?1:e}var Qe=class extends ve{constructor({value:e=[],isIndefiniteForm:r=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=r}fromBER(e,r,n){let o=G.BufferSourceConverter.toUint8Array(e);if(!mt(this,o,r,n))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let i=r;for(;Xd(this.isIndefiniteForm,n)>0;){let s=To(o,i,n);if(s.offset===-1)return this.error=s.result.error,this.warnings.concat(s.result.warnings),-1;if(i=s.offset,this.blockLength+=s.result.blockLength,n-=s.result.blockLength,this.value.push(s.result),this.isIndefiniteForm&&s.result.constructor.NAME===Jr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Jr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,r){let n=r||new Yr;for(let o=0;o<this.value.length;o++)this.value[o].toBER(e,n);return r?Ge:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let r of this.value)e.value.push(r.toJSON());return e}};Qe.NAME="ConstructedValueBlock";var xc,$t=class extends ge{constructor(e={}){super(e,Qe),this.idBlock.isConstructed=!0}fromBER(e,r,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
4
4
  `).map(o=>` ${o}`).join(`
5
5
  `));let r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${r} :
6
6
  ${e.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helia/ipns",
3
- "version": "7.2.3-ec8bf66",
3
+ "version": "7.2.3-f5a03fc",
4
4
  "description": "An implementation of IPNS for Helia",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/ipfs/helia/tree/main/packages/ipns#readme",
@@ -164,7 +164,7 @@
164
164
  "release": "aegir release"
165
165
  },
166
166
  "dependencies": {
167
- "@helia/interface": "4.3.1-ec8bf66",
167
+ "@helia/interface": "4.3.1-f5a03fc",
168
168
  "@libp2p/interface": "^2.0.0",
169
169
  "@libp2p/kad-dht": "^13.0.0",
170
170
  "@libp2p/logger": "^5.0.0",
@@ -182,7 +182,7 @@
182
182
  "aegir": "^44.0.1",
183
183
  "datastore-core": "^10.0.0",
184
184
  "it-drain": "^3.0.5",
185
- "sinon": "^18.0.0",
185
+ "sinon": "^19.0.2",
186
186
  "sinon-ts": "^2.0.0"
187
187
  },
188
188
  "browser": {