New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tbd54566975/common

Package Overview
Dependencies
Maintainers
10
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tbd54566975/common - npm Package Compare versions

Comparing version 0.1.1-alpha-20230713-d1dda95 to 0.1.1-alpha-20230728-527e57a

dist/cjs/convert.js

15

dist/browser.js

@@ -1,15 +0,2 @@

"use strict";var Web5=(()=>{var Be=Object.create;var fr=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var Te=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty;var Ce=(t,r)=>()=>(t&&(r=t(t=0)),r);var pr=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),Pr=(t,r)=>{for(var e in r)fr(t,e,{get:r[e],enumerable:!0})},qr=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Fe(r))!Se.call(t,i)&&i!==e&&fr(t,i,{get:()=>r[i],enumerable:!(n=Ue(r,i))||n.enumerable});return t};var Jr=(t,r,e)=>(e=t!=null?Be(Te(t)):{},qr(r||!t||!t.__esModule?fr(e,"default",{value:t,enumerable:!0}):e,t)),Ie=t=>qr(fr({},"__esModule",{value:!0}),t);var Kr=pr(lr=>{"use strict";h();lr.byteLength=Le;lr.toByteArray=Ne;lr.fromByteArray=Oe;var k=[],C=[],Me=typeof Uint8Array<"u"?Uint8Array:Array,gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(W=0,_r=gr.length;W<_r;++W)k[W]=gr[W],C[gr.charCodeAt(W)]=W;var W,_r;C["-".charCodeAt(0)]=62;C["_".charCodeAt(0)]=63;function jr(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");e===-1&&(e=r);var n=e===r?0:4-e%4;return[e,n]}function Le(t){var r=jr(t),e=r[0],n=r[1];return(e+n)*3/4-n}function De(t,r,e){return(r+e)*3/4-e}function Ne(t){var r,e=jr(t),n=e[0],i=e[1],o=new Me(De(t,n,i)),a=0,u=i>0?n-4:n,c;for(c=0;c<u;c+=4)r=C[t.charCodeAt(c)]<<18|C[t.charCodeAt(c+1)]<<12|C[t.charCodeAt(c+2)]<<6|C[t.charCodeAt(c+3)],o[a++]=r>>16&255,o[a++]=r>>8&255,o[a++]=r&255;return i===2&&(r=C[t.charCodeAt(c)]<<2|C[t.charCodeAt(c+1)]>>4,o[a++]=r&255),i===1&&(r=C[t.charCodeAt(c)]<<10|C[t.charCodeAt(c+1)]<<4|C[t.charCodeAt(c+2)]>>2,o[a++]=r>>8&255,o[a++]=r&255),o}function Re(t){return k[t>>18&63]+k[t>>12&63]+k[t>>6&63]+k[t&63]}function ke(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(Re(n));return i.join("")}function Oe(t){for(var r,e=t.length,n=e%3,i=[],o=16383,a=0,u=e-n;a<u;a+=o)i.push(ke(t,a,a+o>u?u:a+o));return n===1?(r=t[e-1],i.push(k[r>>2]+k[r<<4&63]+"==")):n===2&&(r=(t[e-2]<<8)+t[e-1],i.push(k[r>>10]+k[r>>4&63]+k[r<<2&63]+"=")),i.join("")}});var Hr=pr(br=>{h();br.read=function(t,r,e,n,i){var o,a,u=i*8-n-1,c=(1<<u)-1,l=c>>1,f=-7,p=e?i-1:0,E=e?-1:1,B=t[r+p];for(p+=E,o=B&(1<<-f)-1,B>>=-f,f+=u;f>0;o=o*256+t[r+p],p+=E,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+t[r+p],p+=E,f-=8);if(o===0)o=1-l;else{if(o===c)return a?NaN:(B?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(B?-1:1)*a*Math.pow(2,o-n)};br.write=function(t,r,e,n,i,o){var a,u,c,l=o*8-i-1,f=(1<<l)-1,p=f>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=n?0:o-1,d=n?1:-1,v=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+p>=1?r+=E/c:r+=E*Math.pow(2,1-p),r*c>=2&&(a++,c/=2),a+p>=f?(u=0,a=f):a+p>=1?(u=(r*c-1)*Math.pow(2,i),a=a+p):(u=r*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[e+B]=u&255,B+=d,u/=256,i-=8);for(a=a<<i|u,l+=i;l>0;t[e+B]=a&255,B+=d,a/=256,l-=8);t[e+B-d]|=v*128}});var ae=pr(rr=>{"use strict";h();var Er=Kr(),Z=Hr(),Wr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rr.Buffer=s;rr.SlowBuffer=Je;rr.INSPECT_MAX_BYTES=50;var dr=2147483647;rr.kMaxLength=dr;s.TYPED_ARRAY_SUPPORT=ze();!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ze(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),t.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function P(t){if(t>dr)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,s.prototype),r}function s(t,r,e){if(typeof t=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ur(t)}return Qr(t,r,e)}s.poolSize=8192;function Qr(t,r,e){if(typeof t=="string")return $e(t,r);if(ArrayBuffer.isView(t))return Pe(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(O(t,ArrayBuffer)||t&&O(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(O(t,SharedArrayBuffer)||t&&O(t.buffer,SharedArrayBuffer)))return Ar(t,r,e);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return s.from(n,r,e);var i=qe(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return s.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s.from=function(t,r,e){return Qr(t,r,e)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function Yr(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Ve(t,r,e){return Yr(t),t<=0?P(t):r!==void 0?typeof e=="string"?P(t).fill(r,e):P(t).fill(r):P(t)}s.alloc=function(t,r,e){return Ve(t,r,e)};function Ur(t){return Yr(t),P(t<0?0:Fr(t)|0)}s.allocUnsafe=function(t){return Ur(t)};s.allocUnsafeSlow=function(t){return Ur(t)};function $e(t,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=Zr(t,r)|0,n=P(e),i=n.write(t,r);return i!==e&&(n=n.slice(0,i)),n}function vr(t){for(var r=t.length<0?0:Fr(t.length)|0,e=P(r),n=0;n<r;n+=1)e[n]=t[n]&255;return e}function Pe(t){if(O(t,Uint8Array)){var r=new Uint8Array(t);return Ar(r.buffer,r.byteOffset,r.byteLength)}return vr(t)}function Ar(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var n;return r===void 0&&e===void 0?n=new Uint8Array(t):e===void 0?n=new Uint8Array(t,r):n=new Uint8Array(t,r,e),Object.setPrototypeOf(n,s.prototype),n}function qe(t){if(s.isBuffer(t)){var r=Fr(t.length)|0,e=P(r);return e.length===0||t.copy(e,0,0,r),e}if(t.length!==void 0)return typeof t.length!="number"||Tr(t.length)?P(0):vr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return vr(t.data)}function Fr(t){if(t>=dr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+dr.toString(16)+" bytes");return t|0}function Je(t){return+t!=t&&(t=0),s.alloc(+t)}s.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==s.prototype};s.compare=function(r,e){if(O(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),O(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(r)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};s.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=s.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(O(a,Uint8Array))o+a.length>i.length?s.from(a).copy(i,o):Uint8Array.prototype.set.call(i,a,o);else if(s.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Zr(t,r){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||O(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var e=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return Br(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return oe(t).length;default:if(i)return n?-1:Br(t).length;r=(""+r).toLowerCase(),i=!0}}s.byteLength=Zr;function _e(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return rt(this,r,e);case"utf8":case"utf-8":return ee(this,r,e);case"ascii":return Ye(this,r,e);case"latin1":case"binary":return Ze(this,r,e);case"base64":return Ge(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function X(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)X(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)X(this,e,e+3),X(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)X(this,e,e+7),X(this,e+1,e+6),X(this,e+2,e+5),X(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?ee(this,0,r):_e.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(r){if(!s.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.inspect=function(){var r="",e=rr.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"};Wr&&(s.prototype[Wr]=s.prototype.inspect);s.prototype.compare=function(r,e,n,i,o){if(O(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,u=n-e,c=Math.min(a,u),l=this.slice(i,o),f=r.slice(e,n),p=0;p<c;++p)if(l[p]!==f[p]){a=l[p],u=f[p];break}return a<u?-1:u<a?1:0};function re(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,Tr(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),s.isBuffer(r))return r.length===0?-1:Xr(t,r,e,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Xr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Xr(t,r,e,n,i){var o=1,a=t.length,u=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,a/=2,u/=2,e/=2}function c(B,d){return o===1?B[d]:B.readUInt16BE(d*o)}var l;if(i){var f=-1;for(l=e;l<a;l++)if(c(t,l)===c(r,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===u)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+u>a&&(e=a-u),l=e;l>=0;l--){for(var p=!0,E=0;E<u;E++)if(c(t,l+E)!==c(r,E)){p=!1;break}if(p)return l}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return re(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return re(this,r,e,n,!1)};function je(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(r.substr(a*2,2),16);if(Tr(u))return a;t[e+a]=u}return a}function Ke(t,r,e,n){return yr(Br(r,t.length-e),t,e,n)}function He(t,r,e,n){return yr(it(r),t,e,n)}function We(t,r,e,n){return yr(oe(r),t,e,n)}function Xe(t,r,e,n){return yr(ot(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return je(this,r,e,n);case"utf8":case"utf-8":return Ke(this,r,e,n);case"ascii":case"latin1":case"binary":return He(this,r,e,n);case"base64":return We(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xe(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ge(t,r,e){return r===0&&e===t.length?Er.fromByteArray(t):Er.fromByteArray(t.slice(r,e))}function ee(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=e){var c,l,f,p;switch(u){case 1:o<128&&(a=o);break;case 2:c=t[i+1],(c&192)===128&&(p=(o&31)<<6|c&63,p>127&&(a=p));break;case 3:c=t[i+1],l=t[i+2],(c&192)===128&&(l&192)===128&&(p=(o&15)<<12|(c&63)<<6|l&63,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:c=t[i+1],l=t[i+2],f=t[i+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(p=(o&15)<<18|(c&63)<<12|(l&63)<<6|f&63,p>65535&&p<1114112&&(a=p))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=u}return Qe(n)}var Gr=4096;function Qe(t){var r=t.length;if(r<=Gr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Gr));return e}function Ye(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function Ze(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function rt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=at[t[o]];return i}function et(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i=this.subarray(r,e);return Object.setPrototypeOf(i,s.prototype),i};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(r,e,n){r=r>>>0,e=e>>>0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};s.prototype.readUintBE=s.prototype.readUIntBE=function(r,e,n){r=r>>>0,e=e>>>0,n||b(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};s.prototype.readUint8=s.prototype.readUInt8=function(r,e){return r=r>>>0,e||b(r,1,this.length),this[r]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(r,e){return r=r>>>0,e||b(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(r,e){return r=r>>>0,e||b(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(r,e){return r=r>>>0,e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(r,e){return r=r>>>0,e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r>>>0,e=e>>>0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(r,e,n){r=r>>>0,e=e>>>0,n||b(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return r=r>>>0,e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){r=r>>>0,e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){r=r>>>0,e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return r=r>>>0,e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return r=r>>>0,e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return r=r>>>0,e||b(r,4,this.length),Z.read(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return r=r>>>0,e||b(r,4,this.length),Z.read(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return r=r>>>0,e||b(r,8,this.length),Z.read(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return r=r>>>0,e||b(r,8,this.length),Z.read(this,r,!1,52,8)};function F(t,r,e,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;F(this,r,e,n,o,0)}var a=1,u=0;for(this[e]=r&255;++u<n&&(a*=256);)this[e+u]=r/a&255;return e+n};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;F(this,r,e,n,o,0)}var a=n-1,u=1;for(this[e+a]=r&255;--a>=0&&(u*=256);)this[e+a]=r/u&255;return e+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,1,255,0),this[e]=r&255,e+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,2,65535,0),this[e]=r&255,this[e+1]=r>>>8,e+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=r&255,e+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,4,4294967295,0),this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255,e+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,4,4294967295,0),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4};s.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e>>>0,!i){var o=Math.pow(2,8*n-1);F(this,r,e,n,o-1,-o)}var a=0,u=1,c=0;for(this[e]=r&255;++a<n&&(u*=256);)r<0&&c===0&&this[e+a-1]!==0&&(c=1),this[e+a]=(r/u>>0)-c&255;return e+n};s.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e>>>0,!i){var o=Math.pow(2,8*n-1);F(this,r,e,n,o-1,-o)}var a=n-1,u=1,c=0;for(this[e+a]=r&255;--a>=0&&(u*=256);)r<0&&c===0&&this[e+a+1]!==0&&(c=1),this[e+a]=(r/u>>0)-c&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,2,32767,-32768),this[e]=r&255,this[e+1]=r>>>8,e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=r&255,e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,4,2147483647,-2147483648),this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24,e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4};function te(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ne(t,r,e,n,i){return r=+r,e=e>>>0,i||te(t,r,e,4,34028234663852886e22,-34028234663852886e22),Z.write(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return ne(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return ne(this,r,e,!1,n)};function ie(t,r,e,n,i){return r=+r,e=e>>>0,i||te(t,r,e,8,17976931348623157e292,-17976931348623157e292),Z.write(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return ie(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return ie(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,i){if(!s.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),e),o};s.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){var o=r.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var u=s.isBuffer(r)?r:s.from(r,i),c=u.length;if(c===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(a=0;a<n-e;++a)this[a+e]=u[a%c]}return this};var tt=/[^+/0-9A-Za-z-_]/g;function nt(t){if(t=t.split("=")[0],t=t.trim().replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Br(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function it(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ot(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function oe(t){return Er.toByteArray(nt(t))}function yr(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function O(t,r){return t instanceof r||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===r.name}function Tr(t){return t!==t}var at=function(){for(var t="0123456789abcdef",r=new Array(256),e=0;e<16;++e)for(var n=e*16,i=0;i<16;++i)r[n+i]=t[e]+t[i];return r}()});var fe=pr((Wt,he)=>{h();var m=he.exports={},z,V;function Sr(){throw new Error("setTimeout has not been defined")}function Cr(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?z=setTimeout:z=Sr}catch{z=Sr}try{typeof clearTimeout=="function"?V=clearTimeout:V=Cr}catch{V=Cr}})();function se(t){if(z===setTimeout)return setTimeout(t,0);if((z===Sr||!z)&&setTimeout)return z=setTimeout,setTimeout(t,0);try{return z(t,0)}catch{try{return z.call(null,t,0)}catch{return z.call(this,t,0)}}}function st(t){if(V===clearTimeout)return clearTimeout(t);if((V===Cr||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(t);try{return V(t)}catch{try{return V.call(null,t)}catch{return V.call(this,t)}}}var q=[],er=!1,G,wr=-1;function ut(){!er||!G||(er=!1,G.length?q=G.concat(q):wr=-1,q.length&&ue())}function ue(){if(!er){var t=se(ut);er=!0;for(var r=q.length;r;){for(G=q,q=[];++wr<r;)G&&G[wr].run();wr=-1,r=q.length}G=null,er=!1,st(t)}}m.nextTick=function(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];q.push(new ce(t,r)),q.length===1&&!er&&se(ue)};function ce(t,r){this.fun=t,this.array=r}ce.prototype.run=function(){this.fun.apply(null,this.array)};m.title="browser";m.browser=!0;m.env={};m.argv=[];m.version="";m.versions={};function J(){}m.on=J;m.addListener=J;m.once=J;m.off=J;m.removeListener=J;m.removeAllListeners=J;m.emit=J;m.prependListener=J;m.prependOnceListener=J;m.listeners=function(t){return[]};m.binding=function(t){throw new Error("process.binding is not supported")};m.cwd=function(){return"/"};m.chdir=function(t){throw new Error("process.chdir is not supported")};m.umask=function(){return 0}});var y,w,Gt,h=Ce(()=>{y=Jr(ae()),w=Jr(fe()),Gt=function(t){function r(){var n=this||self;return delete t.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return r();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:r});var e=__magic__;return e}(Object)});var $t={};Pr($t,{Convert:()=>A,MemoryStore:()=>$r,Multicodec:()=>L,isArrayBufferSlice:()=>Rr,isDefined:()=>yt,universalTypeOf:()=>xr});h();h();h();h();h();function ct(t,r){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),a=o.charCodeAt(0);if(e[a]!==255)throw new TypeError(o+" is ambiguous");e[a]=i}var u=t.length,c=t.charAt(0),l=Math.log(u)/Math.log(256),f=Math.log(256)/Math.log(u);function p(d){if(d instanceof Uint8Array||(ArrayBuffer.isView(d)?d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):Array.isArray(d)&&(d=Uint8Array.from(d))),!(d instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(d.length===0)return"";for(var v=0,H=0,I=0,D=d.length;I!==D&&d[I]===0;)I++,v++;for(var N=(D-I)*f+1>>>0,S=new Uint8Array(N);I!==D;){for(var R=d[I],K=0,M=N-1;(R!==0||K<H)&&M!==-1;M--,K++)R+=256*S[M]>>>0,S[M]=R%u>>>0,R=R/u>>>0;if(R!==0)throw new Error("Non-zero carry");H=K,I++}for(var $=N-H;$!==N&&S[$]===0;)$++;for(var hr=c.repeat(v);$<N;++$)hr+=t.charAt(S[$]);return hr}function E(d){if(typeof d!="string")throw new TypeError("Expected String");if(d.length===0)return new Uint8Array;var v=0;if(d[v]!==" "){for(var H=0,I=0;d[v]===c;)H++,v++;for(var D=(d.length-v)*l+1>>>0,N=new Uint8Array(D);d[v];){var S=e[d.charCodeAt(v)];if(S===255)return;for(var R=0,K=D-1;(S!==0||R<I)&&K!==-1;K--,R++)S+=u*N[K]>>>0,N[K]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");I=R,v++}if(d[v]!==" "){for(var M=D-I;M!==D&&N[M]===0;)M++;for(var $=new Uint8Array(H+(D-M)),hr=H;M!==D;)$[hr++]=N[M++];return $}}}function B(d){var v=E(d);if(v)return v;throw new Error(`Non-${r} character`)}return{encode:p,decodeUnsafe:E,decode:B}}var ht=ct,ft=ht,pe=ft;h();var rn=new Uint8Array(0);var le=(t,r)=>{if(t===r)return!0;if(t.byteLength!==r.byteLength)return!1;for(let e=0;e<t.byteLength;e++)if(t[e]!==r[e])return!1;return!0},tr=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")};h();var Ir=class{constructor(r,e,n){this.name=r,this.prefix=e,this.baseEncode=n}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}},Mr=class{constructor(r,e,n){if(this.name=r,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return de(this,r)}},Lr=class{constructor(r){this.decoders=r}or(r){return de(this,r)}decode(r){let e=r[0],n=this.decoders[e];if(n)return n.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},de=(t,r)=>new Lr({...t.decoders||{[t.prefix]:t},...r.decoders||{[r.prefix]:r}}),Dr=class{constructor(r,e,n,i){this.name=r,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new Ir(r,e,n),this.decoder=new Mr(r,e,i)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}},ye=({name:t,prefix:r,encode:e,decode:n})=>new Dr(t,r,e,n),Nr=({prefix:t,name:r,alphabet:e})=>{let{encode:n,decode:i}=pe(e,r);return ye({prefix:t,name:r,encode:n,decode:o=>tr(i(o))})},lt=(t,r,e,n)=>{let i={};for(let f=0;f<r.length;++f)i[r[f]]=f;let o=t.length;for(;t[o-1]==="=";)--o;let a=new Uint8Array(o*e/8|0),u=0,c=0,l=0;for(let f=0;f<o;++f){let p=i[t[f]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<e|p,u+=e,u>=8&&(u-=8,a[l++]=255&c>>u)}if(u>=e||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return a},dt=(t,r,e)=>{let n=r[r.length-1]==="=",i=(1<<e)-1,o="",a=0,u=0;for(let c=0;c<t.length;++c)for(u=u<<8|t[c],a+=8;a>e;)a-=e,o+=r[i&u>>a];if(a&&(o+=r[i&u<<e-a]),n)for(;o.length*e&7;)o+="=";return o},U=({name:t,prefix:r,bitsPerChar:e,alphabet:n})=>ye({prefix:r,name:t,encode(i){return dt(i,n,e)},decode(i){return lt(i,n,e,t)}});var T=Nr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),hn=Nr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});h();var dn=U({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),yn=U({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),_=U({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),wn=U({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});h();function Rr(t){return t.byteOffset!==0||t.byteLength!==t.buffer.byteLength}function yt(t){return t!==null&&typeof t<"u"}function xr(t){let e=Object.prototype.toString.call(t).match(/\s([a-zA-Z0-9]+)/),[n,i]=e;return i}var mr=new TextEncoder,ar=new TextDecoder,A=class{constructor(r,e){this.data=r,this.format=e}static arrayBuffer(r){return new A(r,"ArrayBuffer")}static base58Btc(r){return new A(r,"Base58Btc")}static base64Url(r){return new A(r,"Base64Url")}static bufferSource(r){return new A(r,"BufferSource")}static hex(r){if(typeof r!="string")throw new TypeError("Hex input must be a string.");if(r.length%2!==0)throw new TypeError("Hex input must have an even number of characters.");return new A(r,"Hex")}static multibase(r){return new A(r,"Multibase")}static object(r){return new A(r,"Object")}static string(r){return new A(r,"String")}static uint8Array(r){return new A(r,"Uint8Array")}toArrayBuffer(){switch(this.format){case"Base58Btc":return T.baseDecode(this.data).buffer;case"Base64Url":return _.baseDecode(this.data).buffer;case"BufferSource":{if(xr(this.data)==="ArrayBuffer")return this.data;if(ArrayBuffer.isView(this.data))return Rr(this.data)?this.data.buffer.slice(this.data.byteOffset,this.data.byteOffset+this.data.byteLength):this.data.buffer;throw new TypeError(`${this.format} value is not of type: ArrayBuffer, DataView, or TypedArray.`)}case"Hex":return A.hex(this.data).toUint8Array().buffer;case"String":return A.string(this.data).toUint8Array().buffer;case"Uint8Array":return this.data.buffer;default:throw new TypeError(`Conversion from ${this.format} to ArrayBuffer is not supported.`)}}toBase58Btc(){switch(this.format){case"ArrayBuffer":{let r=new Uint8Array(this.data);return T.baseEncode(r)}case"Multibase":return this.data.substring(1);case"Uint8Array":return T.baseEncode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Base58Btc is not supported.`)}}toBase64Url(){switch(this.format){case"ArrayBuffer":{let r=new Uint8Array(this.data);return _.baseEncode(r)}case"Object":{let r=JSON.stringify(this.data),e=mr.encode(r);return _.baseEncode(e)}case"String":{let r=mr.encode(this.data);return _.baseEncode(r)}case"Uint8Array":return _.baseEncode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Base64Url is not supported.`)}}toHex(){let r=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));switch(this.format){case"ArrayBuffer":{let e=new Uint8Array(this.data);return A.uint8Array(e).toHex()}case"Uint8Array":{let e="";for(let n=0;n<this.data.length;n++)e+=r[this.data[n]];return e}default:throw new TypeError(`Conversion from ${this.format} to Object is not supported.`)}}toMultibase(){switch(this.format){case"Base58Btc":return`z${this.data}`;default:throw new TypeError(`Conversion from ${this.format} to Multibase is not supported.`)}}toObject(){switch(this.format){case"Base64Url":{let r=_.baseDecode(this.data),e=ar.decode(r);return JSON.parse(e)}case"String":return JSON.parse(this.data);case"Uint8Array":{let r=ar.decode(this.data);return JSON.parse(r)}default:throw new TypeError(`Conversion from ${this.format} to Object is not supported.`)}}toString(){switch(this.format){case"ArrayBuffer":return ar.decode(this.data);case"Base64Url":{let r=_.baseDecode(this.data);return ar.decode(r)}case"Object":return JSON.stringify(this.data);case"Uint8Array":return ar.decode(this.data);default:throw new TypeError(`Conversion from ${this.format} to String is not supported.`)}}toUint8Array(){switch(this.format){case"ArrayBuffer":return new Uint8Array(this.data);case"Base58Btc":return T.baseDecode(this.data);case"Base64Url":return _.baseDecode(this.data);case"BufferSource":{let r=xr(this.data);if(r==="Uint8Array")return this.data;if(r==="ArrayBuffer")return new Uint8Array(this.data);if(ArrayBuffer.isView(this.data))return new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength);throw new TypeError(`${this.format} value is not of type: ArrayBuffer, DataView, or TypedArray.`)}case"Hex":{let r=new Uint8Array(this.data.length/2);for(let e=0;e<this.data.length;e+=2){let n=parseInt(this.data.substring(e,e+2),16);if(isNaN(n))throw new TypeError("Input is not a valid hexadecimal string.");r[e/2]=n}return r}case"Object":{let r=JSON.stringify(this.data);return mr.encode(r)}case"String":return mr.encode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Uint8Array is not supported.`)}}};h();h();h();var j={};Pr(j,{decode:()=>nr,encodeTo:()=>Q,encodingLength:()=>Y});h();h();var wt=me,we=128,xt=127,mt=~xt,gt=Math.pow(2,31);function me(t,r,e){r=r||[],e=e||0;for(var n=e;t>=gt;)r[e++]=t&255|we,t/=128;for(;t&mt;)r[e++]=t&255|we,t>>>=7;return r[e]=t|0,me.bytes=e-n+1,r}var bt=kr,Et=128,xe=127;function kr(t,n){var e=0,n=n||0,i=0,o=n,a,u=t.length;do{if(o>=u)throw kr.bytes=0,new RangeError("Could not decode varint");a=t[o++],e+=i<28?(a&xe)<<i:(a&xe)*Math.pow(2,i),i+=7}while(a>=Et);return kr.bytes=o-n,e}var vt=Math.pow(2,7),At=Math.pow(2,14),Bt=Math.pow(2,21),Ut=Math.pow(2,28),Ft=Math.pow(2,35),Tt=Math.pow(2,42),St=Math.pow(2,49),Ct=Math.pow(2,56),It=Math.pow(2,63),Mt=function(t){return t<vt?1:t<At?2:t<Bt?3:t<Ut?4:t<Ft?5:t<Tt?6:t<St?7:t<Ct?8:t<It?9:10},Lt={encode:wt,decode:bt,encodingLength:Mt},Dt=Lt,sr=Dt;var nr=(t,r=0)=>[sr.decode(t,r),sr.decode.bytes],Q=(t,r,e=0)=>(sr.encode(t,r,e),r),Y=t=>sr.encodingLength(t);h();var Or=(t,r)=>{let e=r.byteLength,n=Y(t),i=n+Y(e),o=new Uint8Array(i+e);return Q(t,o,0),Q(e,o,n),o.set(r,i),new ir(t,e,r,o)},ge=t=>{let r=tr(t),[e,n]=nr(r),[i,o]=nr(r.subarray(n)),a=r.subarray(n+o);if(a.byteLength!==i)throw new Error("Incorrect length");return new ir(e,i,a,r)},be=(t,r)=>{if(t===r)return!0;{let e=r;return t.code===e.code&&t.size===e.size&&e.bytes instanceof Uint8Array&&le(t.bytes,e.bytes)}},ir=class{constructor(r,e,n,i){this.code=r,this.size=e,this.digest=n,this.bytes=i}};h();var ur=U({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Dn=U({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Nn=U({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Rn=U({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),kn=U({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),On=U({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),zn=U({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Vn=U({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),$n=U({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});h();var Ee=(t,r)=>{let{bytes:e,version:n}=t;switch(n){case 0:return Rt(e,Vr(t),r||T.encoder);default:return kt(e,Vr(t),r||ur.encoder)}};var ve=new WeakMap,Vr=t=>{let r=ve.get(t);if(r==null){let e=new Map;return ve.set(t,e),e}return r},g=class{constructor(r,e,n,i){this.code=e,this.version=r,this.multihash=n,this.bytes=i,this["/"]=i}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:r,multihash:e}=this;if(r!==cr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==Ot)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return g.createV0(e)}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:r,digest:e}=this.multihash,n=Or(r,e);return g.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(r){return g.equals(this,r)}static equals(r,e){let n=e;return n&&r.code===n.code&&r.version===n.version&&be(r.multihash,n.multihash)}toString(r){return Ee(this,r)}toJSON(){return{"/":Ee(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(r){if(r==null)return null;let e=r;if(e instanceof g)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:i,multihash:o,bytes:a}=e;return new g(n,i,o,a||Ae(n,i,o.bytes))}else if(e[zt]===!0){let{version:n,multihash:i,code:o}=e,a=ge(i);return g.create(n,o,a)}else return null}static create(r,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(r){case 0:{if(e!==cr)throw new Error(`Version 0 CID must use dag-pb (code: ${cr}) block encoding`);return new g(r,e,n,n.bytes)}case 1:{let i=Ae(r,e,n.bytes);return new g(r,e,n,i)}default:throw new Error("Invalid version")}}static createV0(r){return g.create(0,cr,r)}static createV1(r,e){return g.create(1,r,e)}static decode(r){let[e,n]=g.decodeFirst(r);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(r){let e=g.inspectBytes(r),n=e.size-e.multihashSize,i=tr(r.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let o=i.subarray(e.multihashSize-e.digestSize),a=new ir(e.multihashCode,e.digestSize,o,i);return[e.version===0?g.createV0(a):g.createV1(e.codec,a),r.subarray(e.size)]}static inspectBytes(r){let e=0,n=()=>{let[p,E]=nr(r.subarray(e));return e+=E,p},i=n(),o=cr;if(i===18?(i=0,e=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let a=e,u=n(),c=n(),l=e+c,f=l-a;return{version:i,codec:o,multihashCode:u,digestSize:c,multihashSize:f,size:l}}static parse(r,e){let[n,i]=Nt(r,e),o=g.decode(i);if(o.version===0&&r[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Vr(o).set(n,r),o}},Nt=(t,r)=>{switch(t[0]){case"Q":{let e=r||T;return[T.prefix,e.decode(`${T.prefix}${t}`)]}case T.prefix:{let e=r||T;return[T.prefix,e.decode(t)]}case ur.prefix:{let e=r||ur;return[ur.prefix,e.decode(t)]}default:{if(r==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],r.decode(t)]}}},Rt=(t,r,e)=>{let{prefix:n}=e;if(n!==T.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=r.get(n);if(i==null){let o=e.encode(t).slice(1);return r.set(n,o),o}else return i},kt=(t,r,e)=>{let{prefix:n}=e,i=r.get(n);if(i==null){let o=e.encode(t);return r.set(n,o),o}else return i},cr=112,Ot=18,Ae=(t,r,e)=>{let n=Y(t),i=n+Y(r),o=new Uint8Array(i+e.byteLength);return Q(t,o,0),Q(r,o,n),o.set(e,i),o},zt=Symbol.for("@ipld/js-cid/CID");h();h();var or=class{static addPrefix(r){let{code:e,data:n,name:i}=r;if(!(i?!e:e))throw new Error("Exactly one of 'name' or 'code' must be defined.");if(e=or.codeToName.has(e)?e:or.nameToCode.get(i),e===void 0)throw new Error(`Multicodec not found: ${i??e}`);let o=j.encodingLength(e),a=new Uint8Array(o+n.byteLength);return a.set(n,o),j.encodeTo(e,a),a}static getCodeFromData(r){let{prefixedData:e}=r,[n,i]=j.decode(e);return n}static registerCodec(r){or.codeToName.set(r.code,r.name),or.nameToCode.set(r.name,r.code)}static removePrefix(r){let{prefixedData:e}=r,[n,i]=j.decode(e);return e.slice(i)}},L=or;L.codeToName=new Map,L.nameToCode=new Map;L.registerCodec({code:237,name:"ed25519-pub"});L.registerCodec({code:4864,name:"ed25519-priv"});L.registerCodec({code:236,name:"x25519-pub"});L.registerCodec({code:4866,name:"x25519-priv"});L.registerCodec({code:231,name:"secp256k1-pub"});L.registerCodec({code:4865,name:"secp256k1-priv"});h();var $r=class{#r=new Map;async clear(){this.#r.clear()}async close(){throw new Error("MemoryStore does not support the close() method.")}async delete(r){return this.#r.delete(r)}async get(r){return this.#r.get(r)}async has(r){return this.#r.has(r)}async list(){return Array.from(this.#r.values())}async set(r,e){this.#r.set(r,e)}};return Ie($t);})();
/*! Bundled license information:
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
*/
"use strict";var Web5Common=(()=>{var q=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var we=Object.prototype.hasOwnProperty;var re=(r,e)=>{for(var t in e)q(r,t,{get:e[t],enumerable:!0})},ge=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of me(e))!we.call(r,o)&&o!==t&&q(r,o,{get:()=>e[o],enumerable:!(n=be(e,o))||n.enumerable});return r};var xe=r=>ge(q({},"__esModule",{value:!0}),r);var Ye={};re(Ye,{Convert:()=>f,MemoryStore:()=>te,Multicodec:()=>g,isArrayBufferSlice:()=>W,isDefined:()=>Ce,universalTypeOf:()=>J});function ve(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var o=0;o<r.length;o++){var s=r.charAt(o),a=s.charCodeAt(0);if(t[a]!==255)throw new TypeError(s+" is ambiguous");t[a]=o}var c=r.length,u=r.charAt(0),O=Math.log(c)/Math.log(256),y=Math.log(256)/Math.log(c);function D(i){if(i instanceof Uint8Array||(ArrayBuffer.isView(i)?i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength):Array.isArray(i)&&(i=Uint8Array.from(i))),!(i instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(i.length===0)return"";for(var p=0,C=0,m=0,x=i.length;m!==x&&i[m]===0;)m++,p++;for(var v=(x-m)*y+1>>>0,b=new Uint8Array(v);m!==x;){for(var A=i[m],B=0,w=v-1;(A!==0||B<C)&&w!==-1;w--,B++)A+=256*b[w]>>>0,b[w]=A%c>>>0,A=A/c>>>0;if(A!==0)throw new Error("Non-zero carry");C=B,m++}for(var U=v-C;U!==v&&b[U]===0;)U++;for(var F=u.repeat(p);U<v;++U)F+=r.charAt(b[U]);return F}function k(i){if(typeof i!="string")throw new TypeError("Expected String");if(i.length===0)return new Uint8Array;var p=0;if(i[p]!==" "){for(var C=0,m=0;i[p]===u;)C++,p++;for(var x=(i.length-p)*O+1>>>0,v=new Uint8Array(x);i[p];){var b=t[i.charCodeAt(p)];if(b===255)return;for(var A=0,B=x-1;(b!==0||A<m)&&B!==-1;B--,A++)b+=c*v[B]>>>0,v[B]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");m=A,p++}if(i[p]!==" "){for(var w=x-m;w!==x&&v[w]===0;)w++;for(var U=new Uint8Array(C+(x-w)),F=C;w!==x;)U[F++]=v[w++];return U}}}function ye(i){var p=k(i);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:D,decodeUnsafe:k,decode:ye}}var Ae=ve,Ue=Ae,ne=Ue;var tt=new Uint8Array(0);var oe=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},z=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var K=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},H=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.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 se(this,e)}},Q=class{constructor(e){this.decoders=e}or(e){return se(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},se=(r,e)=>new Q({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),G=class{constructor(e,t,n,o){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=o,this.encoder=new K(e,t,n),this.decoder=new H(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ae=({name:r,prefix:e,encode:t,decode:n})=>new G(r,e,t,n),X=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:o}=ne(t,e);return ae({prefix:r,name:e,encode:n,decode:s=>z(o(s))})},Ee=(r,e,t,n)=>{let o={};for(let y=0;y<e.length;++y)o[e[y]]=y;let s=r.length;for(;r[s-1]==="=";)--s;let a=new Uint8Array(s*t/8|0),c=0,u=0,O=0;for(let y=0;y<s;++y){let D=o[r[y]];if(D===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<t|D,c+=t,c>=8&&(c-=8,a[O++]=255&u>>c)}if(c>=t||255&u<<8-c)throw new SyntaxError("Unexpected end of data");return a},Be=(r,e,t)=>{let n=e[e.length-1]==="=",o=(1<<t)-1,s="",a=0,c=0;for(let u=0;u<r.length;++u)for(c=c<<8|r[u],a+=8;a>t;)a-=t,s+=e[o&c>>a];if(a&&(s+=e[o&c<<t-a]),n)for(;s.length*t&7;)s+="=";return s},h=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>ae({prefix:e,name:r,encode(o){return Be(o,n,t)},decode(o){return Ee(o,n,t,r)}});var l=X({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),at=X({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var dt=h({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ft=h({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),S=h({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ht=h({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function W(r){return r.byteOffset!==0||r.byteLength!==r.buffer.byteLength}function Ce(r){return r!==null&&typeof r<"u"}function J(r){let t=Object.prototype.toString.call(r).match(/\s([a-zA-Z0-9]+)/),[n,o]=t;return o}var R=new TextEncoder,$=new TextDecoder,f=class{constructor(e,t){this.data=e,this.format=t}static arrayBuffer(e){return new f(e,"ArrayBuffer")}static base58Btc(e){return new f(e,"Base58Btc")}static base64Url(e){return new f(e,"Base64Url")}static bufferSource(e){return new f(e,"BufferSource")}static hex(e){if(typeof e!="string")throw new TypeError("Hex input must be a string.");if(e.length%2!==0)throw new TypeError("Hex input must have an even number of characters.");return new f(e,"Hex")}static multibase(e){return new f(e,"Multibase")}static object(e){return new f(e,"Object")}static string(e){return new f(e,"String")}static uint8Array(e){return new f(e,"Uint8Array")}toArrayBuffer(){switch(this.format){case"Base58Btc":return l.baseDecode(this.data).buffer;case"Base64Url":return S.baseDecode(this.data).buffer;case"BufferSource":{if(J(this.data)==="ArrayBuffer")return this.data;if(ArrayBuffer.isView(this.data))return W(this.data)?this.data.buffer.slice(this.data.byteOffset,this.data.byteOffset+this.data.byteLength):this.data.buffer;throw new TypeError(`${this.format} value is not of type: ArrayBuffer, DataView, or TypedArray.`)}case"Hex":return f.hex(this.data).toUint8Array().buffer;case"String":return f.string(this.data).toUint8Array().buffer;case"Uint8Array":return this.data.buffer;default:throw new TypeError(`Conversion from ${this.format} to ArrayBuffer is not supported.`)}}toBase58Btc(){switch(this.format){case"ArrayBuffer":{let e=new Uint8Array(this.data);return l.baseEncode(e)}case"Multibase":return this.data.substring(1);case"Uint8Array":return l.baseEncode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Base58Btc is not supported.`)}}toBase64Url(){switch(this.format){case"ArrayBuffer":{let e=new Uint8Array(this.data);return S.baseEncode(e)}case"Object":{let e=JSON.stringify(this.data),t=R.encode(e);return S.baseEncode(t)}case"String":{let e=R.encode(this.data);return S.baseEncode(e)}case"Uint8Array":return S.baseEncode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Base64Url is not supported.`)}}toHex(){let e=Array.from({length:256},(t,n)=>n.toString(16).padStart(2,"0"));switch(this.format){case"ArrayBuffer":{let t=new Uint8Array(this.data);return f.uint8Array(t).toHex()}case"Uint8Array":{let t="";for(let n=0;n<this.data.length;n++)t+=e[this.data[n]];return t}default:throw new TypeError(`Conversion from ${this.format} to Object is not supported.`)}}toMultibase(){switch(this.format){case"Base58Btc":return`z${this.data}`;default:throw new TypeError(`Conversion from ${this.format} to Multibase is not supported.`)}}toObject(){switch(this.format){case"Base64Url":{let e=S.baseDecode(this.data),t=$.decode(e);return JSON.parse(t)}case"String":return JSON.parse(this.data);case"Uint8Array":{let e=$.decode(this.data);return JSON.parse(e)}default:throw new TypeError(`Conversion from ${this.format} to Object is not supported.`)}}toString(){switch(this.format){case"ArrayBuffer":return $.decode(this.data);case"Base64Url":{let e=S.baseDecode(this.data);return $.decode(e)}case"Object":return JSON.stringify(this.data);case"Uint8Array":return $.decode(this.data);default:throw new TypeError(`Conversion from ${this.format} to String is not supported.`)}}toUint8Array(){switch(this.format){case"ArrayBuffer":return new Uint8Array(this.data);case"Base58Btc":return l.baseDecode(this.data);case"Base64Url":return S.baseDecode(this.data);case"BufferSource":{let e=J(this.data);if(e==="Uint8Array")return this.data;if(e==="ArrayBuffer")return new Uint8Array(this.data);if(ArrayBuffer.isView(this.data))return new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength);throw new TypeError(`${this.format} value is not of type: ArrayBuffer, DataView, or TypedArray.`)}case"Hex":{let e=new Uint8Array(this.data.length/2);for(let t=0;t<this.data.length;t+=2){let n=parseInt(this.data.substring(t,t+2),16);if(isNaN(n))throw new TypeError("Input is not a valid hexadecimal string.");e[t/2]=n}return e}case"Object":{let e=JSON.stringify(this.data);return R.encode(e)}case"String":return R.encode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Uint8Array is not supported.`)}}};var E={};re(E,{decode:()=>N,encodeTo:()=>T,encodingLength:()=>M});var Te=de,ie=128,Me=127,Oe=~Me,De=Math.pow(2,31);function de(r,e,t){e=e||[],t=t||0;for(var n=t;r>=De;)e[t++]=r&255|ie,r/=128;for(;r&Oe;)e[t++]=r&255|ie,r>>>=7;return e[t]=r|0,de.bytes=t-n+1,e}var ze=Z,Ne=128,ce=127;function Z(r,n){var t=0,n=n||0,o=0,s=n,a,c=r.length;do{if(s>=c)throw Z.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=o<28?(a&ce)<<o:(a&ce)*Math.pow(2,o),o+=7}while(a>=Ne);return Z.bytes=s-n,t}var Ve=Math.pow(2,7),Le=Math.pow(2,14),$e=Math.pow(2,21),Pe=Math.pow(2,28),je=Math.pow(2,35),Ie=Math.pow(2,42),ke=Math.pow(2,49),Fe=Math.pow(2,56),Je=Math.pow(2,63),Re=function(r){return r<Ve?1:r<Le?2:r<$e?3:r<Pe?4:r<je?5:r<Ie?6:r<ke?7:r<Fe?8:r<Je?9:10},qe={encode:Te,decode:ze,encodingLength:Re},Ke=qe,P=Ke;var N=(r,e=0)=>[P.decode(r,e),P.decode.bytes],T=(r,e,t=0)=>(P.encode(r,e,t),e),M=r=>P.encodingLength(r);var Y=(r,e)=>{let t=e.byteLength,n=M(r),o=n+M(t),s=new Uint8Array(o+t);return T(r,s,0),T(t,s,n),s.set(e,o),new V(r,t,e,s)},fe=r=>{let e=z(r),[t,n]=N(e),[o,s]=N(e.subarray(n)),a=e.subarray(n+s);if(a.byteLength!==o)throw new Error("Incorrect length");return new V(t,o,a,e)},he=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&oe(r.bytes,t.bytes)}},V=class{constructor(e,t,n,o){this.code=e,this.size=t,this.digest=n,this.bytes=o}};var j=h({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),At=h({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ut=h({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),St=h({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Et=h({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Bt=h({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ct=h({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Tt=h({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Mt=h({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ue=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return Qe(t,ee(r),e||l.encoder);default:return Ge(t,ee(r),e||j.encoder)}};var pe=new WeakMap,ee=r=>{let e=pe.get(r);if(e==null){let t=new Map;return pe.set(r,t),t}return e},d=class{constructor(e,t,n,o){this.code=t,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:t}=this;if(e!==I)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Xe)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return d.createV0(t)}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:t}=this.multihash,n=Y(e,t);return d.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 d.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&he(e.multihash,n.multihash)}toString(e){return ue(this,e)}toJSON(){return{"/":ue(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof d)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:o,multihash:s,bytes:a}=t;return new d(n,o,s,a||le(n,o,s.bytes))}else if(t[We]===!0){let{version:n,multihash:o,code:s}=t,a=fe(o);return d.create(n,s,a)}else return null}static create(e,t,n){if(typeof t!="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(t!==I)throw new Error(`Version 0 CID must use dag-pb (code: ${I}) block encoding`);return new d(e,t,n,n.bytes)}case 1:{let o=le(e,t,n.bytes);return new d(e,t,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return d.create(0,I,e)}static createV1(e,t){return d.create(1,e,t)}static decode(e){let[t,n]=d.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=d.inspectBytes(e),n=t.size-t.multihashSize,o=z(e.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=o.subarray(t.multihashSize-t.digestSize),a=new V(t.multihashCode,t.digestSize,s,o);return[t.version===0?d.createV0(a):d.createV1(t.codec,a),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[D,k]=N(e.subarray(t));return t+=k,D},o=n(),s=I;if(o===18?(o=0,t=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let a=t,c=n(),u=n(),O=t+u,y=O-a;return{version:o,codec:s,multihashCode:c,digestSize:u,multihashSize:y,size:O}}static parse(e,t){let[n,o]=He(e,t),s=d.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return ee(s).set(n,e),s}},He=(r,e)=>{switch(r[0]){case"Q":{let t=e||l;return[l.prefix,t.decode(`${l.prefix}${r}`)]}case l.prefix:{let t=e||l;return[l.prefix,t.decode(r)]}case j.prefix:{let t=e||j;return[j.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},Qe=(r,e,t)=>{let{prefix:n}=t;if(n!==l.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(n);if(o==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return o},Ge=(r,e,t)=>{let{prefix:n}=t,o=e.get(n);if(o==null){let s=t.encode(r);return e.set(n,s),s}else return o},I=112,Xe=18,le=(r,e,t)=>{let n=M(r),o=n+M(e),s=new Uint8Array(o+t.byteLength);return T(r,s,0),T(e,s,n),s.set(t,o),s},We=Symbol.for("@ipld/js-cid/CID");var L=class{static addPrefix(e){let{code:t,data:n,name:o}=e;if(!(o?!t:t))throw new Error("Exactly one of 'name' or 'code' must be defined.");if(t=L.codeToName.has(t)?t:L.nameToCode.get(o),t===void 0)throw new Error(`Multicodec not found: ${o??t}`);let s=E.encodingLength(t),a=new Uint8Array(s+n.byteLength);return a.set(n,s),E.encodeTo(t,a),a}static getCodeFromData(e){let{prefixedData:t}=e,[n,o]=E.decode(t);return n}static registerCodec(e){L.codeToName.set(e.code,e.name),L.nameToCode.set(e.name,e.code)}static removePrefix(e){let{prefixedData:t}=e,[n,o]=E.decode(t);return t.slice(o)}},g=L;g.codeToName=new Map,g.nameToCode=new Map;g.registerCodec({code:237,name:"ed25519-pub"});g.registerCodec({code:4864,name:"ed25519-priv"});g.registerCodec({code:236,name:"x25519-pub"});g.registerCodec({code:4866,name:"x25519-priv"});g.registerCodec({code:231,name:"secp256k1-pub"});g.registerCodec({code:4865,name:"secp256k1-priv"});var te=class{constructor(){this.store=new Map}async clear(){this.store.clear()}async close(){throw new Error("MemoryStore does not support the close() method.")}async delete(e){return this.store.delete(e)}async get(e){return this.store.get(e)}async has(e){return this.store.has(e)}async list(){return Array.from(this.store.values())}async set(e,t){this.store.set(e,t)}};return xe(Ye);})();
//# sourceMappingURL=browser.js.map

@@ -22,4 +22,7 @@ import type { KeyValueStore } from './types.js';

export declare class MemoryStore<K, V> implements KeyValueStore<K, V> {
#private;
/**
* A private field that contains the Map used as the key-value store.
*/
private store;
/**
* Clears all entries in the key-value store.

@@ -26,0 +29,0 @@ *

{
"name": "@tbd54566975/common",
"version": "0.1.1-alpha-20230713-d1dda95",
"version": "0.1.1-alpha-20230728-527e57a",
"type": "module",
"main": "./dist/cjs/main.cjs",
"module": "./dist/esm/main.mjs",
"module": "./dist/esm/main.js",
"types": "./dist/types/main.d.ts",
"scripts": {
"build": "rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc",
"clean": "rimraf dist coverage tests/compiled",
"build:esm": "rimraf dist/esm dist/types && npx tsc -p tsconfig.json",
"build:cjs": "rimraf dist/cjs && tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
"build:browser": "rimraf dist/browser.mjs dist/browser.js && node build/bundles.js",
"build": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:browser",
"lint": "eslint . --ext .ts --max-warnings 0",
"lint:fix": "eslint . --ext .ts --fix",
"test:node": "rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha",
"test:node": "rimraf tests/compiled && tsc -p tests/tsconfig.json && c8 mocha",
"test:browser": "karma start karma.conf.cjs"

@@ -43,4 +47,4 @@ },

".": {
"import": "./dist/esm/main.mjs",
"require": "./dist/cjs/main.cjs",
"import": "./dist/esm/main.js",
"require": "./dist/cjs/main.js",
"types": "./dist/types/main.d.ts"

@@ -52,19 +56,5 @@ },

"types": "./dist/types/main.d.ts"
},
"./electron": {
"import": "./dist/esm/main.mjs",
"require": "./dist/electron/main.cjs",
"types": "./dist/types/main.d.ts"
}
},
"browser": {
"./dist/esm/main.mjs": "./dist/browser.mjs",
"./dist/cjs/main.cjs": "./dist/browser.js",
"types": "./dist/types/main.d.ts"
},
"react-native": {
"./dist/esm/main.mjs": "./dist/esm/main.mjs",
"./dist/cjs/main.cjs": "./dist/esm/main.mjs",
"types": "./dist/types/main.d.ts"
},
"react-native": "./dist/esm/main.js",
"keywords": [

@@ -108,7 +98,6 @@ "decentralized",

"mocha": "10.2.0",
"node-stdlib-browser": "1.2.0",
"playwright": "1.31.2",
"rimraf": "4.4.0",
"typescript": "5.0.4"
"typescript": "5.1.6"
}
}

@@ -26,3 +26,3 @@ import type { KeyValueStore } from './types.js';

*/
#store: Map<K, V> = new Map();
private store: Map<K, V> = new Map();

@@ -35,3 +35,3 @@ /**

async clear(): Promise<void> {
this.#store.clear();
this.store.clear();
}

@@ -54,3 +54,3 @@

async delete(id: K): Promise<boolean> {
return this.#store.delete(id);
return this.store.delete(id);
}

@@ -65,3 +65,3 @@

async get(id: K): Promise<V | undefined> {
return this.#store.get(id);
return this.store.get(id);
}

@@ -76,3 +76,3 @@

async has(id: K): Promise<boolean> {
return this.#store.has(id);
return this.store.has(id);
}

@@ -86,3 +86,3 @@

async list(): Promise<V[]> {
return Array.from(this.#store.values());
return Array.from(this.store.values());
}

@@ -98,4 +98,4 @@

async set(id: K, key: V): Promise<void> {
this.#store.set(id, key);
this.store.set(id, key);
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc