@helia/car 4.0.1 → 4.0.2
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/README.md +2 -2
- package/dist/index.min.js +1 -1
- package/package.json +20 -106
- package/LICENSE +0 -4
package/README.md
CHANGED
|
@@ -109,8 +109,8 @@ Loading this module through a script tag will make its exports available as `Hel
|
|
|
109
109
|
|
|
110
110
|
Licensed under either of
|
|
111
111
|
|
|
112
|
-
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
113
|
-
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
|
|
112
|
+
- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/helia/blob/main/packages/car/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
113
|
+
- MIT ([LICENSE-MIT](https://github.com/ipfs/helia/blob/main/packages/car/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
|
|
114
114
|
|
|
115
115
|
# Contribute
|
|
116
116
|
|
package/dist/index.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.HeliaCar = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
-
"use strict";var HeliaCar=(()=>{var Tn=Object.create;var Se=Object.defineProperty;var In=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var Sn=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty;var ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bn=(e,t)=>{for(var r in t)Se(e,r,{get:t[r],enumerable:!0})},$t=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Cn(t))!Un.call(e,o)&&o!==r&&Se(e,o,{get:()=>t[o],enumerable:!(n=In(t,o))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?Tn(Sn(e)):{},$t(t||!e||!e.__esModule?Se(r,"default",{value:e,enumerable:!0}):r,e)),Nn=e=>$t(Se({},"__esModule",{value:!0}),e);var on=ce((ta,nn)=>{nn.exports=gt;var rn=128,qo=127,Ho=~qo,Go=Math.pow(2,31);function gt(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw gt.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=Go;)t[r++]=e&255|rn,e/=128;for(;e&Ho;)t[r++]=e&255|rn,e>>>=7;return t[r]=e|0,gt.bytes=r-n+1,t}});var cn=ce((ra,an)=>{an.exports=xt;var Wo=128,sn=127;function xt(e,n){var r=0,n=n||0,o=0,i=n,a,u=e.length;do{if(i>=u||o>49)throw xt.bytes=0,new RangeError("Could not decode varint");a=e[i++],r+=o<28?(a&sn)<<o:(a&sn)*Math.pow(2,o),o+=7}while(a>=Wo);return xt.bytes=i-n,r}});var fn=ce((na,un)=>{var jo=Math.pow(2,7),Ko=Math.pow(2,14),Yo=Math.pow(2,21),Jo=Math.pow(2,28),Xo=Math.pow(2,35),Qo=Math.pow(2,42),Zo=Math.pow(2,49),ei=Math.pow(2,56),ti=Math.pow(2,63);un.exports=function(e){return e<jo?1:e<Ko?2:e<Yo?3:e<Jo?4:e<Xo?5:e<Qo?6:e<Zo?7:e<ei?8:e<ti?9:10}});var Ge=ce((oa,dn)=>{dn.exports={encode:on(),decode:cn(),encodingLength:fn()}});var _n=ce((wc,Nt)=>{"use strict";var xi=Object.prototype.hasOwnProperty,_="~";function ke(){}Object.create&&(ke.prototype=Object.create(null),new ke().__proto__||(_=!1));function bi(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function En(e,t,r,n,o){if(typeof r!="function")throw new TypeError("The listener must be a function");var i=new bi(r,n||e,o),a=_?_+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],i]:e._events[a].push(i):(e._events[a]=i,e._eventsCount++),e}function Ye(e,t){--e._eventsCount===0?e._events=new ke:delete e._events[t]}function E(){this._events=new ke,this._eventsCount=0}E.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)xi.call(r,n)&&t.push(_?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};E.prototype.listeners=function(t){var r=_?_+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o<i;o++)a[o]=n[o].fn;return a};E.prototype.listenerCount=function(t){var r=_?_+t:t,n=this._events[r];return n?n.fn?1:n.length:0};E.prototype.emit=function(t,r,n,o,i,a){var u=_?_+t:t;if(!this._events[u])return!1;var c=this._events[u],p=arguments.length,l,m;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),p){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,o),!0;case 5:return c.fn.call(c.context,r,n,o,i),!0;case 6:return c.fn.call(c.context,r,n,o,i,a),!0}for(m=1,l=new Array(p-1);m<p;m++)l[m-1]=arguments[m];c.fn.apply(c.context,l)}else{var v=c.length,R;for(m=0;m<v;m++)switch(c[m].once&&this.removeListener(t,c[m].fn,void 0,!0),p){case 1:c[m].fn.call(c[m].context);break;case 2:c[m].fn.call(c[m].context,r);break;case 3:c[m].fn.call(c[m].context,r,n);break;case 4:c[m].fn.call(c[m].context,r,n,o);break;default:if(!l)for(R=1,l=new Array(p-1);R<p;R++)l[R-1]=arguments[R];c[m].fn.apply(c[m].context,l)}}return!0};E.prototype.on=function(t,r,n){return En(this,t,r,n,!1)};E.prototype.once=function(t,r,n){return En(this,t,r,n,!0)};E.prototype.removeListener=function(t,r,n,o){var i=_?_+t:t;if(!this._events[i])return this;if(!r)return Ye(this,i),this;var a=this._events[i];if(a.fn)a.fn===r&&(!o||a.once)&&(!n||a.context===n)&&Ye(this,i);else{for(var u=0,c=[],p=a.length;u<p;u++)(a[u].fn!==r||o&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[i]=c.length===1?c[0]:c:Ye(this,i)}return this};E.prototype.removeAllListeners=function(t){var r;return t?(r=_?_+t:t,this._events[r]&&Ye(this,r)):(this._events=new ke,this._eventsCount=0),this};E.prototype.off=E.prototype.removeListener;E.prototype.addListener=E.prototype.on;E.prefixed=_;E.EventEmitter=E;typeof Nt<"u"&&(Nt.exports=E)});var _i={};Bn(_i,{car:()=>Ei});var On=["string","number","bigint","symbol"],Dn=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Lt(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(On.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Mn(e))return"Buffer";let r=Rn(e);return r||"Object"}function Mn(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Rn(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Dn.includes(t))return t}var s=class{constructor(t,r,n){this.major=t,this.majorEncoded=t<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(t){return this.major<t.major?-1:this.major>t.major?1:0}};s.uint=new s(0,"uint",!0);s.negint=new s(1,"negint",!0);s.bytes=new s(2,"bytes",!0);s.string=new s(3,"string",!0);s.array=new s(4,"array",!1);s.map=new s(5,"map",!1);s.tag=new s(6,"tag",!1);s.float=new s(7,"float",!0);s.false=new s(7,"false",!0);s.true=new s(7,"true",!0);s.null=new s(7,"null",!0);s.undefined=new s(7,"undefined",!0);s.break=new s(7,"break",!0);var d=class{constructor(t,r,n){this.type=t,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};var X=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",zn=new TextDecoder,$n=new TextEncoder;function Be(e){return X&&globalThis.Buffer.isBuffer(e)}function Je(e){return e instanceof Uint8Array?Be(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var qt=X?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Pt(e,t,r):(e,t,r)=>r-t>64?zn.decode(e.subarray(t,r)):Pt(e,t,r),Ht=X?e=>e.length>64?globalThis.Buffer.from(e):Vt(e):e=>e.length>64?$n.encode(e):Vt(e),V=e=>Uint8Array.from(e),Q=X?(e,t,r)=>Be(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Gt=X?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),Je(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let o of e)n+o.length>r.length&&(o=o.subarray(0,r.length-n)),r.set(o,n),n+=o.length;return r},Wt=X?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function jt(e,t){if(Be(e)&&Be(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function Vt(e){let t=[],r=0;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);o<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=o&63|128):(o&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(o=65536+((o&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=o&63|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=o&63|128)}return t}function Pt(e,t,r){let n=[];for(;t<r;){let o=e[t],i=null,a=o>239?4:o>223?3:o>191?2:1;if(t+a<=r){let u,c,p,l;switch(a){case 1:o<128&&(i=o);break;case 2:u=e[t+1],(u&192)===128&&(l=(o&31)<<6|u&63,l>127&&(i=l));break;case 3:u=e[t+1],c=e[t+2],(u&192)===128&&(c&192)===128&&(l=(o&15)<<12|(u&63)<<6|c&63,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:u=e[t+1],c=e[t+2],p=e[t+3],(u&192)===128&&(c&192)===128&&(p&192)===128&&(l=(o&15)<<18|(u&63)<<12|(c&63)<<6|p&63,l>65535&&l<1114112&&(i=l))}}i===null?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),t+=a}return Ln(n)}var Ft=4096;function Ln(e){let t=e.length;if(t<=Ft)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Ft));return r}var Vn=256,ue=class{constructor(t=Vn){this.chunkSize=t,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(t){let r=this.chunks[this.chunks.length-1];if(this.cursor+t.length<=this.maxCursor+1){let o=r.length-(this.maxCursor-this.cursor)-1;r.set(t,o)}else{if(r){let o=r.length-(this.maxCursor-this.cursor)-1;o<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,o),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=Wt(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(t,0)):(this.chunks.push(t),this.maxCursor+=t.length)}this.cursor+=t.length}toBytes(t=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];t&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=Q(n,0,this.cursor)}else r=Gt(this.chunks,this.cursor);return t&&this.reset(),r}};var h="CBOR decode error:",Xe="CBOR encode error:",fe=[];fe[23]=1;fe[24]=2;fe[25]=3;fe[26]=5;fe[27]=9;function q(e,t,r){if(e.length-t<r)throw new Error(`${h} not enough data for type`)}var x=[24,256,65536,4294967296,BigInt("18446744073709551616")];function A(e,t,r){q(e,t,1);let n=e[t];if(r.strict===!0&&n<x[0])throw new Error(`${h} integer encoded in more bytes than necessary (strict decode)`);return n}function T(e,t,r){q(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<x[1])throw new Error(`${h} integer encoded in more bytes than necessary (strict decode)`);return n}function I(e,t,r){q(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<x[2])throw new Error(`${h} integer encoded in more bytes than necessary (strict decode)`);return n}function C(e,t,r){q(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],o=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],i=(BigInt(n)<<BigInt(32))+BigInt(o);if(r.strict===!0&&i<x[3])throw new Error(`${h} integer encoded in more bytes than necessary (strict decode)`);if(i<=Number.MAX_SAFE_INTEGER)return Number(i);if(r.allowBigInt===!0)return i;throw new Error(`${h} integers outside of the safe integer range are not supported`)}function Kt(e,t,r,n){return new d(s.uint,A(e,t+1,n),2)}function Yt(e,t,r,n){return new d(s.uint,T(e,t+1,n),3)}function Jt(e,t,r,n){return new d(s.uint,I(e,t+1,n),5)}function Xt(e,t,r,n){return new d(s.uint,C(e,t+1,n),9)}function U(e,t){return b(e,0,t.value)}function b(e,t,r){if(r<x[0]){let n=Number(r);e.push([t|n])}else if(r<x[1]){let n=Number(r);e.push([t|24,n])}else if(r<x[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<x[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<x[4]){let o=[t|27,0,0,0,0,0,0,0],i=Number(n&BigInt(4294967295)),a=Number(n>>BigInt(32)&BigInt(4294967295));o[8]=i&255,i=i>>8,o[7]=i&255,i=i>>8,o[6]=i&255,i=i>>8,o[5]=i&255,o[4]=a&255,a=a>>8,o[3]=a&255,a=a>>8,o[2]=a&255,a=a>>8,o[1]=a&255,e.push(o)}else throw new Error(`${h} encountered BigInt larger than allowable range`)}}U.encodedSize=function(t){return b.encodedSize(t.value)};b.encodedSize=function(t){return t<x[0]?1:t<x[1]?2:t<x[2]?3:t<x[3]?5:9};U.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function Qt(e,t,r,n){return new d(s.negint,-1-A(e,t+1,n),2)}function Zt(e,t,r,n){return new d(s.negint,-1-T(e,t+1,n),3)}function er(e,t,r,n){return new d(s.negint,-1-I(e,t+1,n),5)}var Qe=BigInt(-1),tr=BigInt(1);function rr(e,t,r,n){let o=C(e,t+1,n);if(typeof o!="bigint"){let i=-1-o;if(i>=Number.MIN_SAFE_INTEGER)return new d(s.negint,i,9)}if(n.allowBigInt!==!0)throw new Error(`${h} integers outside of the safe integer range are not supported`);return new d(s.negint,Qe-BigInt(o),9)}function Ne(e,t){let r=t.value,n=typeof r=="bigint"?r*Qe-tr:r*-1-1;b(e,t.type.majorEncoded,n)}Ne.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*Qe-tr:r*-1-1;return n<x[0]?1:n<x[1]?2:n<x[2]?3:n<x[3]?5:9};Ne.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function de(e,t,r,n){q(e,t,r+n);let o=Q(e,t+r,t+r+n);return new d(s.bytes,o,r+n)}function nr(e,t,r,n){return de(e,t,1,r)}function or(e,t,r,n){return de(e,t,2,A(e,t+1,n))}function ir(e,t,r,n){return de(e,t,3,T(e,t+1,n))}function sr(e,t,r,n){return de(e,t,5,I(e,t+1,n))}function ar(e,t,r,n){let o=C(e,t+1,n);if(typeof o=="bigint")throw new Error(`${h} 64-bit integer bytes lengths not supported`);return de(e,t,9,o)}function Oe(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===s.string?Ht(e.value):e.value),e.encodedBytes}function Z(e,t){let r=Oe(t);b(e,t.type.majorEncoded,r.length),e.push(r)}Z.encodedSize=function(t){let r=Oe(t);return b.encodedSize(r.length)+r.length};Z.compareTokens=function(t,r){return Fn(Oe(t),Oe(r))};function Fn(e,t){return e.length<t.length?-1:e.length>t.length?1:jt(e,t)}function le(e,t,r,n,o){let i=r+n;q(e,t,i);let a=new d(s.string,qt(e,t+r,t+i),i);return o.retainStringBytes===!0&&(a.byteValue=Q(e,t+r,t+i)),a}function cr(e,t,r,n){return le(e,t,1,r,n)}function ur(e,t,r,n){return le(e,t,2,A(e,t+1,n),n)}function fr(e,t,r,n){return le(e,t,3,T(e,t+1,n),n)}function dr(e,t,r,n){return le(e,t,5,I(e,t+1,n),n)}function lr(e,t,r,n){let o=C(e,t+1,n);if(typeof o=="bigint")throw new Error(`${h} 64-bit integer string lengths not supported`);return le(e,t,9,o,n)}var hr=Z;function ee(e,t,r,n){return new d(s.array,n,r)}function pr(e,t,r,n){return ee(e,t,1,r)}function yr(e,t,r,n){return ee(e,t,2,A(e,t+1,n))}function mr(e,t,r,n){return ee(e,t,3,T(e,t+1,n))}function wr(e,t,r,n){return ee(e,t,5,I(e,t+1,n))}function gr(e,t,r,n){let o=C(e,t+1,n);if(typeof o=="bigint")throw new Error(`${h} 64-bit integer array lengths not supported`);return ee(e,t,9,o)}function xr(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${h} indefinite length items not allowed`);return ee(e,t,1,1/0)}function De(e,t){b(e,s.array.majorEncoded,t.value)}De.compareTokens=U.compareTokens;De.encodedSize=function(t){return b.encodedSize(t.value)};function te(e,t,r,n){return new d(s.map,n,r)}function br(e,t,r,n){return te(e,t,1,r)}function vr(e,t,r,n){return te(e,t,2,A(e,t+1,n))}function Er(e,t,r,n){return te(e,t,3,T(e,t+1,n))}function _r(e,t,r,n){return te(e,t,5,I(e,t+1,n))}function kr(e,t,r,n){let o=C(e,t+1,n);if(typeof o=="bigint")throw new Error(`${h} 64-bit integer map lengths not supported`);return te(e,t,9,o)}function Ar(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${h} indefinite length items not allowed`);return te(e,t,1,1/0)}function Me(e,t){b(e,s.map.majorEncoded,t.value)}Me.compareTokens=U.compareTokens;Me.encodedSize=function(t){return b.encodedSize(t.value)};function Tr(e,t,r,n){return new d(s.tag,r,1)}function Ir(e,t,r,n){return new d(s.tag,A(e,t+1,n),2)}function Cr(e,t,r,n){return new d(s.tag,T(e,t+1,n),3)}function Sr(e,t,r,n){return new d(s.tag,I(e,t+1,n),5)}function Ur(e,t,r,n){return new d(s.tag,C(e,t+1,n),9)}function Re(e,t){b(e,s.tag.majorEncoded,t.value)}Re.compareTokens=U.compareTokens;Re.encodedSize=function(t){return b.encodedSize(t.value)};var Kn=20,Yn=21,Jn=22,Xn=23;function Br(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${h} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new d(s.null,null,1):new d(s.undefined,void 0,1)}function Nr(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${h} indefinite length items not allowed`);return new d(s.break,void 0,1)}function Ze(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${h} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${h} Infinity values are not supported`)}return new d(s.float,e,t)}function Or(e,t,r,n){return Ze(et(e,t+1),3,n)}function Dr(e,t,r,n){return Ze(tt(e,t+1),5,n)}function Mr(e,t,r,n){return Ze(Lr(e,t+1),9,n)}function ze(e,t,r){let n=t.value;if(n===!1)e.push([s.float.majorEncoded|Kn]);else if(n===!0)e.push([s.float.majorEncoded|Yn]);else if(n===null)e.push([s.float.majorEncoded|Jn]);else if(n===void 0)e.push([s.float.majorEncoded|Xn]);else{let o,i=!1;(!r||r.float64!==!0)&&(zr(n),o=et(D,1),n===o||Number.isNaN(n)?(D[0]=249,e.push(D.slice(0,3)),i=!0):($r(n),o=tt(D,1),n===o&&(D[0]=250,e.push(D.slice(0,5)),i=!0))),i||(Qn(n),o=Lr(D,1),D[0]=251,e.push(D.slice(0,9)))}}ze.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){zr(n);let o=et(D,1);if(n===o||Number.isNaN(n))return 3;if($r(n),o=tt(D,1),n===o)return 5}return 9};var Rr=new ArrayBuffer(9),B=new DataView(Rr,1),D=new Uint8Array(Rr,0);function zr(e){if(e===1/0)B.setUint16(0,31744,!1);else if(e===-1/0)B.setUint16(0,64512,!1);else if(Number.isNaN(e))B.setUint16(0,32256,!1);else{B.setFloat32(0,e);let t=B.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)B.setUint16(0,31744,!1);else if(r===0)B.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let o=r-127;o<-24?B.setUint16(0,0):o<-14?B.setUint16(0,(t&2147483648)>>16|1<<24+o,!1):B.setUint16(0,(t&2147483648)>>16|o+15<<10|n>>13,!1)}}}function et(e,t){if(e.length-t<2)throw new Error(`${h} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,o=r&1023,i;return n===0?i=o*2**-24:n!==31?i=(o+1024)*2**(n-25):i=o===0?1/0:NaN,r&32768?-i:i}function $r(e){B.setFloat32(0,e,!1)}function tt(e,t){if(e.length-t<4)throw new Error(`${h} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function Qn(e){B.setFloat64(0,e,!1)}function Lr(e,t){if(e.length-t<8)throw new Error(`${h} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}ze.compareTokens=U.compareTokens;function y(e,t,r){throw new Error(`${h} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function $e(e){return()=>{throw new Error(`${h} ${e}`)}}var f=[];for(let e=0;e<=23;e++)f[e]=y;f[24]=Kt;f[25]=Yt;f[26]=Jt;f[27]=Xt;f[28]=y;f[29]=y;f[30]=y;f[31]=y;for(let e=32;e<=55;e++)f[e]=y;f[56]=Qt;f[57]=Zt;f[58]=er;f[59]=rr;f[60]=y;f[61]=y;f[62]=y;f[63]=y;for(let e=64;e<=87;e++)f[e]=nr;f[88]=or;f[89]=ir;f[90]=sr;f[91]=ar;f[92]=y;f[93]=y;f[94]=y;f[95]=$e("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)f[e]=cr;f[120]=ur;f[121]=fr;f[122]=dr;f[123]=lr;f[124]=y;f[125]=y;f[126]=y;f[127]=$e("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)f[e]=pr;f[152]=yr;f[153]=mr;f[154]=wr;f[155]=gr;f[156]=y;f[157]=y;f[158]=y;f[159]=xr;for(let e=160;e<=183;e++)f[e]=br;f[184]=vr;f[185]=Er;f[186]=_r;f[187]=kr;f[188]=y;f[189]=y;f[190]=y;f[191]=Ar;for(let e=192;e<=215;e++)f[e]=Tr;f[216]=Ir;f[217]=Cr;f[218]=Sr;f[219]=Ur;f[220]=y;f[221]=y;f[222]=y;f[223]=y;for(let e=224;e<=243;e++)f[e]=$e("simple values are not supported");f[244]=y;f[245]=y;f[246]=y;f[247]=Br;f[248]=$e("simple values are not supported");f[249]=Or;f[250]=Dr;f[251]=Mr;f[252]=y;f[253]=y;f[254]=y;f[255]=Nr;var M=[];for(let e=0;e<24;e++)M[e]=new d(s.uint,e,1);for(let e=-1;e>=-24;e--)M[31-e]=new d(s.negint,e,1);M[64]=new d(s.bytes,new Uint8Array(0),1);M[96]=new d(s.string,"",1);M[128]=new d(s.array,0,1);M[160]=new d(s.map,0,1);M[244]=new d(s.false,!1,1);M[245]=new d(s.true,!0,1);M[246]=new d(s.null,null,1);function rt(e){switch(e.type){case s.false:return V([244]);case s.true:return V([245]);case s.null:return V([246]);case s.bytes:return e.value.length?void 0:V([64]);case s.string:return e.value===""?V([96]):void 0;case s.array:return e.value===0?V([128]):void 0;case s.map:return e.value===0?V([160]):void 0;case s.uint:return e.value<24?V([Number(e.value)]):void 0;case s.negint:if(e.value>=-24)return V([31-Number(e.value)])}}var eo={float64:!1,mapSorter:ro,quickEncodeToken:rt};function ot(){let e=[];return e[s.uint.major]=U,e[s.negint.major]=Ne,e[s.bytes.major]=Z,e[s.string.major]=hr,e[s.array.major]=De,e[s.map.major]=Me,e[s.tag.major]=Re,e[s.float.major]=ze,e}var Vr=ot(),nt=new ue,Le=class e{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${Xe} object contains circular references`);return new e(r,t)}},W={null:new d(s.null,null),undefined:new d(s.undefined,void 0),true:new d(s.true,!0),false:new d(s.false,!1),emptyArray:new d(s.array,0),emptyMap:new d(s.map,0)},j={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new d(s.float,e):e>=0?new d(s.uint,e):new d(s.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new d(s.uint,e):new d(s.negint,e)},Uint8Array(e,t,r,n){return new d(s.bytes,e)},string(e,t,r,n){return new d(s.string,e)},boolean(e,t,r,n){return e?W.true:W.false},null(e,t,r,n){return W.null},undefined(e,t,r,n){return W.undefined},ArrayBuffer(e,t,r,n){return new d(s.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new d(s.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[W.emptyArray,new d(s.break)]:W.emptyArray;n=Le.createCheck(n,e);let o=[],i=0;for(let a of e)o[i++]=he(a,r,n);return r.addBreakTokens?[new d(s.array,e.length),o,new d(s.break)]:[new d(s.array,e.length),o]},Object(e,t,r,n){let o=t!=="Object",i=o?e.keys():Object.keys(e),a=o?e.size:i.length;if(!a)return r.addBreakTokens===!0?[W.emptyMap,new d(s.break)]:W.emptyMap;n=Le.createCheck(n,e);let u=[],c=0;for(let p of i)u[c++]=[he(p,r,n),he(o?e.get(p):e[p],r,n)];return to(u,r),r.addBreakTokens?[new d(s.map,a),u,new d(s.break)]:[new d(s.map,a),u]}};j.Map=j.Object;j.Buffer=j.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))j[`${e}Array`]=j.DataView;function he(e,t={},r){let n=Lt(e),o=t&&t.typeEncoders&&t.typeEncoders[n]||j[n];if(typeof o=="function"){let a=o(e,n,t,r);if(a!=null)return a}let i=j[n];if(!i)throw new Error(`${Xe} unsupported type: ${n}`);return i(e,n,t,r)}function to(e,t){t.mapSorter&&e.sort(t.mapSorter)}function ro(e,t){let r=Array.isArray(e[0])?e[0][0]:e[0],n=Array.isArray(t[0])?t[0][0]:t[0];if(r.type!==n.type)return r.type.compare(n.type);let o=r.type.major,i=Vr[o].compareTokens(r,n);return i===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),i}function Pr(e,t,r,n){if(Array.isArray(t))for(let o of t)Pr(e,o,r,n);else r[t.type.major](e,t,n)}function no(e,t,r){let n=he(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let o=r.quickEncodeToken(n);if(o)return o;let i=t[n.type.major];if(i.encodedSize){let a=i.encodedSize(n,r),u=new ue(a);if(i(u,n,r),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return Je(u.chunks[0])}}return nt.reset(),Pr(nt,n,t,r),nt.toBytes(!0)}function it(e,t){return t=Object.assign({},eo,t),no(e,Vr,t)}var oo={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Ve=class{constructor(t,r={}){this._pos=0,this.data=t,this.options=r}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let t=this.data[this._pos],r=M[t];if(r===void 0){let n=f[t];if(!n)throw new Error(`${h} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let o=t&31;r=n(this.data,this._pos,o,this.options)}return this._pos+=r.encodedLength,r}},pe=Symbol.for("DONE"),Pe=Symbol.for("BREAK");function io(e,t,r){let n=[];for(let o=0;o<e.value;o++){let i=re(t,r);if(i===Pe){if(e.value===1/0)break;throw new Error(`${h} got unexpected break to lengthed array`)}if(i===pe)throw new Error(`${h} found array but not enough entries (got ${o}, expected ${e.value})`);n[o]=i}return n}function so(e,t,r){let n=r.useMaps===!0,o=n?void 0:{},i=n?new Map:void 0;for(let a=0;a<e.value;a++){let u=re(t,r);if(u===Pe){if(e.value===1/0)break;throw new Error(`${h} got unexpected break to lengthed map`)}if(u===pe)throw new Error(`${h} found map but not enough entries (got ${a} [no key], expected ${e.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${h} non-string keys not supported (got ${typeof u})`);if(r.rejectDuplicateMapKeys===!0&&(n&&i.has(u)||!n&&u in o))throw new Error(`${h} found repeat map key "${u}"`);let c=re(t,r);if(c===pe)throw new Error(`${h} found map but not enough entries (got ${a} [no value], expected ${e.value})`);n?i.set(u,c):o[u]=c}return n?i:o}function re(e,t){if(e.done())return pe;let r=e.next();if(r.type===s.break)return Pe;if(r.type.terminal)return r.value;if(r.type===s.array)return io(r,e,t);if(r.type===s.map)return so(r,e,t);if(r.type===s.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=re(e,t);return t.tags[r.value](n)}throw new Error(`${h} tag not supported (${r.value})`)}throw new Error("unsupported")}function Fr(e,t){if(!(e instanceof Uint8Array))throw new Error(`${h} data to decode must be a Uint8Array`);t=Object.assign({},oo,t);let r=t.tokenizer||new Ve(e,t),n=re(r,t);if(n===pe)throw new Error(`${h} did not find any content to decode`);if(n===Pe)throw new Error(`${h} got unexpected break`);return[n,e.subarray(r.pos())]}function st(e,t){let[r,n]=Fr(e,t);if(n.length>0)throw new Error(`${h} too many terminals, data makes no sense`);return r}var Es=new Uint8Array(0);function qr(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}function ne(e){if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}function co(e,t){if(e.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<e.length;o++){var i=e.charAt(o),a=i.charCodeAt(0);if(r[a]!==255)throw new TypeError(i+" is ambiguous");r[a]=o}var u=e.length,c=e.charAt(0),p=Math.log(u)/Math.log(256),l=Math.log(256)/Math.log(u);function m(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var k=0,Y=0,N=0,z=w.length;N!==z&&w[N]===0;)N++,k++;for(var $=(z-N)*l+1>>>0,S=new Uint8Array($);N!==z;){for(var L=w[N],G=0,O=$-1;(L!==0||G<Y)&&O!==-1;O--,G++)L+=256*S[O]>>>0,S[O]=L%u>>>0,L=L/u>>>0;if(L!==0)throw new Error("Non-zero carry");Y=G,N++}for(var F=$-Y;F!==$&&S[F]===0;)F++;for(var Ce=c.repeat(k);F<$;++F)Ce+=e.charAt(S[F]);return Ce}function v(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var k=0;if(w[k]!==" "){for(var Y=0,N=0;w[k]===c;)Y++,k++;for(var z=(w.length-k)*p+1>>>0,$=new Uint8Array(z);w[k];){var S=r[w.charCodeAt(k)];if(S===255)return;for(var L=0,G=z-1;(S!==0||L<N)&&G!==-1;G--,L++)S+=u*$[G]>>>0,$[G]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");N=L,k++}if(w[k]!==" "){for(var O=z-N;O!==z&&$[O]===0;)O++;for(var F=new Uint8Array(Y+(z-O)),Ce=Y;O!==z;)F[Ce++]=$[O++];return F}}}function R(w){var k=v(w);if(k)return k;throw new Error(`Non-${t} character`)}return{encode:m,decodeUnsafe:v,decode:R}}var uo=co,fo=uo,Gr=fo;var at=class{name;prefix;baseEncode;constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},ct=class{name;prefix;baseDecode;prefixCodePoint;constructor(t,r,n){this.name=t,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(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Wr(this,t)}},ut=class{decoders;constructor(t){this.decoders=t}or(t){return Wr(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n!=null)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Wr(e,t){return new ut({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var ft=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new at(t,r,n),this.decoder=new ct(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};function jr({name:e,prefix:t,encode:r,decode:n}){return new ft(e,t,r,n)}function oe({name:e,prefix:t,alphabet:r}){let{encode:n,decode:o}=Gr(r,e);return jr({prefix:t,name:e,encode:n,decode:i=>ne(o(i))})}function lo(e,t,r,n){let o={};for(let l=0;l<t.length;++l)o[t[l]]=l;let i=e.length;for(;e[i-1]==="=";)--i;let a=new Uint8Array(i*r/8|0),u=0,c=0,p=0;for(let l=0;l<i;++l){let m=o[e[l]];if(m===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|m,u+=r,u>=8&&(u-=8,a[p++]=255&c>>u)}if(u>=r||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return a}function ho(e,t,r){let n=t[t.length-1]==="=",o=(1<<r)-1,i="",a=0,u=0;for(let c=0;c<e.length;++c)for(u=u<<8|e[c],a+=8;a>r;)a-=r,i+=t[o&u>>a];if(a!==0&&(i+=t[o&u<<r-a]),n)for(;i.length*r&7;)i+="=";return i}function P({name:e,prefix:t,bitsPerChar:r,alphabet:n}){return jr({prefix:t,name:e,encode(o){return ho(o,n,r)},decode(o){return lo(o,n,r,e)}})}var ye=P({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Cs=P({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ss=P({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Us=P({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Bs=P({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ns=P({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Os=P({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ds=P({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Ms=P({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Fe=oe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$s=oe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var H=oe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ps=oe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var po=Jr,Kr=128,yo=127,mo=~yo,wo=Math.pow(2,31);function Jr(e,t,r){t=t||[],r=r||0;for(var n=r;e>=wo;)t[r++]=e&255|Kr,e/=128;for(;e&mo;)t[r++]=e&255|Kr,e>>>=7;return t[r]=e|0,Jr.bytes=r-n+1,t}var go=dt,xo=128,Yr=127;function dt(e,n){var r=0,n=n||0,o=0,i=n,a,u=e.length;do{if(i>=u)throw dt.bytes=0,new RangeError("Could not decode varint");a=e[i++],r+=o<28?(a&Yr)<<o:(a&Yr)*Math.pow(2,o),o+=7}while(a>=xo);return dt.bytes=i-n,r}var bo=Math.pow(2,7),vo=Math.pow(2,14),Eo=Math.pow(2,21),_o=Math.pow(2,28),ko=Math.pow(2,35),Ao=Math.pow(2,42),To=Math.pow(2,49),Io=Math.pow(2,56),Co=Math.pow(2,63),So=function(e){return e<bo?1:e<vo?2:e<Eo?3:e<_o?4:e<ko?5:e<Ao?6:e<To?7:e<Io?8:e<Co?9:10},Uo={encode:po,decode:go,encodingLength:So},Bo=Uo,me=Bo;function we(e,t=0){return[me.decode(e,t),me.decode.bytes]}function ie(e,t,r=0){return me.encode(e,t,r),t}function se(e){return me.encodingLength(e)}function ht(e,t){let r=t.byteLength,n=se(e),o=n+se(r),i=new Uint8Array(o+r);return ie(e,i,0),ie(r,i,n),i.set(t,o),new ae(e,r,t,i)}function qe(e){let t=ne(e),[r,n]=we(t),[o,i]=we(t.subarray(n)),a=t.subarray(n+i);if(a.byteLength!==o)throw new Error("Incorrect length");return new ae(r,o,a,t)}function Xr(e,t){if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&qr(e.bytes,r.bytes)}}var ae=class{code;size;digest;bytes;constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}};function Qr(e,t){let{bytes:r,version:n}=e;switch(n){case 0:return Oo(r,pt(e),t??H.encoder);default:return Do(r,pt(e),t??ye.encoder)}}var Zr=new WeakMap;function pt(e){let t=Zr.get(e);if(t==null){let r=new Map;return Zr.set(e,r),r}return t}var g=class e{code;version;multihash;bytes;"/";constructor(t,r,n,o){this.code=r,this.version=t,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:t,multihash:r}=this;if(t!==xe)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Mo)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.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:t,digest:r}=this.multihash,n=ht(t,r);return e.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(t){return e.equals(this,t)}static equals(t,r){let n=r;return n!=null&&t.code===n.code&&t.version===n.version&&Xr(t.multihash,n.multihash)}toString(t){return Qr(this,t)}toJSON(){return{"/":Qr(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof e)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:o,multihash:i,bytes:a}=r;return new e(n,o,i,a??en(n,o,i.bytes))}else if(r[Ro]===!0){let{version:n,multihash:o,code:i}=r,a=qe(o);return e.create(n,i,a)}else return null}static create(t,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(t){case 0:{if(r!==xe)throw new Error(`Version 0 CID must use dag-pb (code: ${xe}) block encoding`);return new e(t,r,n,n.bytes)}case 1:{let o=en(t,r,n.bytes);return new e(t,r,n,o)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,xe,t)}static createV1(t,r){return e.create(1,t,r)}static decode(t){let[r,n]=e.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=e.inspectBytes(t),n=r.size-r.multihashSize,o=ne(t.subarray(n,n+r.multihashSize));if(o.byteLength!==r.multihashSize)throw new Error("Incorrect length");let i=o.subarray(r.multihashSize-r.digestSize),a=new ae(r.multihashCode,r.digestSize,i,o);return[r.version===0?e.createV0(a):e.createV1(r.codec,a),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[m,v]=we(t.subarray(r));return r+=v,m},o=n(),i=xe;if(o===18?(o=0,r=0):i=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let a=r,u=n(),c=n(),p=r+c,l=p-a;return{version:o,codec:i,multihashCode:u,digestSize:c,multihashSize:l,size:p}}static parse(t,r){let[n,o]=No(t,r),i=e.decode(o);if(i.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return pt(i).set(n,t),i}};function No(e,t){switch(e[0]){case"Q":{let r=t??H;return[H.prefix,r.decode(`${H.prefix}${e}`)]}case H.prefix:{let r=t??H;return[H.prefix,r.decode(e)]}case ye.prefix:{let r=t??ye;return[ye.prefix,r.decode(e)]}case Fe.prefix:{let r=t??Fe;return[Fe.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function Oo(e,t,r){let{prefix:n}=r;if(n!==H.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let o=t.get(n);if(o==null){let i=r.encode(e).slice(1);return t.set(n,i),i}else return o}function Do(e,t,r){let{prefix:n}=r,o=t.get(n);if(o==null){let i=r.encode(e);return t.set(n,i),i}else return o}var xe=112,Mo=18;function en(e,t,r){let n=se(e),o=n+se(t),i=new Uint8Array(o+r.byteLength);return ie(e,i,0),ie(t,i,n),i.set(r,o),i}var Ro=Symbol.for("@ipld/js-cid/CID");var tn=42;function zo(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function $o(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=g.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new d(s.tag,tn),new d(s.bytes,r)]}function Lo(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function Vo(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var yt={float64:!0,typeEncoders:{Object:$o,undefined:Lo,number:Vo}},Zs={...yt,typeEncoders:{...yt.typeEncoders}};function Po(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return g.decode(e.subarray(1))}var He={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};He.tags[tn]=Po;var ea={...He,tags:He.tags.slice()};var mt=e=>it(e,yt),wt=e=>st(zo(e),He);var bt=Ue(Ge(),1);var vt=40;function Et(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=bt.default.decode(e);return t.seek(bt.default.decode.bytes),r}function _t(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0;return{version:2,characteristics:[t.getBigUint64(r,!0),t.getBigUint64(r+=8,!0)],dataOffset:Number(t.getBigUint64(r+=8,!0)),dataSize:Number(t.getBigUint64(r+=8,!0)),indexOffset:Number(t.getBigUint64(r+=8,!0))}}var K={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},be={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":K.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(K.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=be["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let o=t;o<e.length;o++){let i=e[o];if(i=be["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](i),i===void 0)return;n.push(i)}return n}}return e}},Int:K.Int,CarV1HeaderOrV2Pragma:e=>{if(K.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let o=0;o<t.length;o++){let[i,a]=t[o];switch(i){case"roots":{let u=be["CarV1HeaderOrV2Pragma > roots (anon)"](e[i]);if(u===void 0)return;if(u!==a||r!==e){if(r===e){r={};for(let c=0;c<o;c++)r[t[c][0]]=t[c][1]}r.roots=u}}break;case"version":{n--;let u=be.Int(e[i]);if(u===void 0)return;if(u!==a||r!==e){if(r===e){r={};for(let c=0;c<o;c++)r[t[c][0]]=t[c][1]}r.version=u}}break;default:return}}if(!(n>0))return r}},ve={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":K.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(K.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=ve["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let o=t;o<e.length;o++){let i=e[o];if(i=ve["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](i),i===void 0)return;n.push(i)}return n}}return e}},Int:K.Int,CarV1HeaderOrV2Pragma:e=>{if(K.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let o=0;o<t.length;o++){let[i,a]=t[o];switch(i){case"roots":{let u=ve["CarV1HeaderOrV2Pragma > roots (anon)"](a);if(u===void 0)return;if(u!==a||r!==e){if(r===e){r={};for(let c=0;c<o;c++)r[t[c][0]]=t[c][1]}r.roots=u}}break;case"version":{n--;let u=ve.Int(a);if(u===void 0)return;if(u!==a||r!==e){if(r===e){r={};for(let c=0;c<o;c++)r[t[c][0]]=t[c][1]}r.version=u}}break;default:return}}if(!(n>0))return r}},kt={toTyped:be.CarV1HeaderOrV2Pragma,toRepresentation:ve.CarV1HeaderOrV2Pragma};var ya=ot();var ii=Ue(Ge(),1);var ba=[new d(s.map,2),new d(s.string,"version"),new d(s.uint,1),new d(s.string,"roots")],va=new d(s.tag,42);async function At(e,t){let r=Et(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),o=wt(n);if(kt.toTyped(o)===void 0)throw new Error("Invalid CAR header format");if(o.version!==1&&o.version!==2||t!==void 0&&o.version!==t)throw new Error(`Invalid CAR version: ${o.version}${t!==void 0?` (expected ${t})`:""}`);if(o.version===1){if(!Array.isArray(o.roots))throw new Error("Invalid CAR header format");return o}if(o.roots!==void 0)throw new Error("Invalid CAR header format");let i=_t(await e.exactly(vt,!0));e.seek(i.dataOffset-e.pos);let a=await At(e,1);return Object.assign(a,i)}function Ee(e){let t=0;return{async upTo(r){return e.subarray(t,t+Math.min(r,e.length-t))},async exactly(r,n=!1){if(r>e.length-t)throw new Error("Unexpected end of data");let o=e.subarray(t,t+r);return n&&(t+=r),o},seek(r){t+=r},get pos(){return t}}}var Tt=Ue(Ge(),1),pn=1;function It(e){let t=mt({version:pn,roots:e}),r=Tt.default.encode(t.length),n=new Uint8Array(r.length+t.length);return n.set(r,0),n.set(t,r.length),n}function yn(e){return{async setRoots(t){let r=It(t);await e.write(r)},async writeBlock(t){let{cid:r,bytes:n}=t;await e.write(new Uint8Array(Tt.default.encode(r.bytes.length+n.length))),await e.write(r.bytes),n.length&&await e.write(n)},async close(){await e.end()},version(){return pn}}}function We(){}function mn(){let e=[],t=null,r=We,n=!1,o=null,i=We,a=()=>(t||(t=new Promise(p=>{r=()=>{t=null,r=We,p()}})),t),u={write(p){e.push(p);let l=a();return i(),l},async end(){n=!0;let p=a();i(),await p}},c={async next(){let p=e.shift();return p?(e.length===0&&r(),{done:!1,value:p}):n?(r(),{done:!0,value:void 0}):(o||(o=new Promise(l=>{i=()=>(o=null,i=We,l(c.next()))})),o)}};return{writer:u,iterator:c}}var _e=class e{constructor(t,r){this._encoder=r,this._mutex=r.setRoots(t),this._ended=!1}async put(t){if(!(t.bytes instanceof Uint8Array)||!t.cid)throw new TypeError("Can only write {cid, bytes} objects");if(this._ended)throw new Error("Already closed");let r=g.asCID(t.cid);if(!r)throw new TypeError("Can only write {cid, bytes} objects");return this._mutex=this._mutex.then(()=>this._encoder.writeBlock({cid:r,bytes:t.bytes})),this._mutex}async close(){if(this._ended)throw new Error("Already closed");return await this._mutex,this._ended=!0,this._encoder.close()}version(){return this._encoder.version()}static create(t){t=ui(t);let{encoder:r,iterator:n}=wn(),o=new e(t,r),i=new je(n);return{writer:o,out:i}}static createAppender(){let{encoder:t,iterator:r}=wn();t.setRoots=()=>Promise.resolve();let n=new e([],t),o=new je(r);return{writer:n,out:o}}static async updateRootsInBytes(t,r){let n=Ee(t);await At(n);let o=It(r);if(Number(n.pos)!==o.length)throw new Error(`updateRoots() can only overwrite a header of the same length (old header is ${n.pos} bytes, new header is ${o.length} bytes)`);return t.set(o,0),t}},je=class{constructor(t){this._iterator=t}[Symbol.asyncIterator](){if(this._iterating)throw new Error("Multiple iterator not supported");return this._iterating=!0,this._iterator}};function wn(){let e=mn(),{writer:t,iterator:r}=e;return{encoder:yn(t),iterator:r}}function ui(e){if(e===void 0)return[];if(!Array.isArray(e)){let r=g.asCID(e);if(!r)throw new TypeError("roots must be a single CID or an array of CIDs");return[r]}let t=[];for(let r of e){let n=g.asCID(r);if(!n)throw new TypeError("roots must be a single CID or an array of CIDs");t.push(n)}return t}function fi(e){return e[Symbol.asyncIterator]!=null}function di(e){if(fi(e))return(async()=>{for await(let t of e);})();for(let t of e);}var gn=di;function li(e){let[t,r]=e[Symbol.asyncIterator]!=null?[e[Symbol.asyncIterator](),Symbol.asyncIterator]:[e[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>t.next(),push:o=>{n.push(o)},next:()=>n.length>0?{done:!1,value:n.shift()}:t.next(),[r](){return this}}}var xn=li;function hi(e){return e[Symbol.asyncIterator]!=null}function pi(e,t){let r=0;if(hi(e))return async function*(){for await(let c of e)yield t(c,r++)}();let n=xn(e),{value:o,done:i}=n.next();if(i===!0)return function*(){}();let a=t(o,r++);if(typeof a.then=="function")return async function*(){yield await a;for await(let c of n)yield t(c,r++)}();let u=t;return function*(){yield a;for(let c of n)yield u(c,r++)}()}var bn=pi;function Ke({enumerable:e=!0,configurable:t=!1}={}){return{enumerable:e,configurable:t,writable:!1}}function*mi(e,t){if(t!=null&&typeof t=="object")if(Array.isArray(t))for(let[r,n]of t.entries()){let o=[...e,r],i=g.asCID(n);i!=null?yield[o.join("/"),i]:typeof n=="object"&&(yield*Ct(n,o))}else{let r=g.asCID(t);r!=null?yield[e.join("/"),r]:yield*Ct(t,e)}}function*Ct(e,t){if(e==null||e instanceof Uint8Array)return;let r=g.asCID(e);r!=null&&(yield[t.join("/"),r]);for(let[n,o]of Object.entries(e)){let i=[...t,n];yield*mi(i,o)}}function*wi(e,t){if(Array.isArray(t))for(let[r,n]of t.entries()){let o=[...e,r];yield o.join("/"),typeof n=="object"&&g.asCID(n)==null&&(yield*St(n,o))}else yield*St(t,e)}function*St(e,t){if(!(e==null||typeof e!="object"))for(let[r,n]of Object.entries(e)){let o=[...t,r];yield o.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&g.asCID(n)==null&&(yield*wi(o,n))}}function gi(e,t){let r=e;for(let[n,o]of t.entries()){if(r=r[o],r==null)throw new Error(`Object has no property at ${t.slice(0,n+1).map(a=>`[${JSON.stringify(a)}]`).join("")}`);let i=g.asCID(r);if(i!=null)return{value:i,remaining:t.slice(n+1).join("/")}}return{value:r}}var Ut=class{cid;bytes;value;asBlock;constructor({cid:t,bytes:r,value:n}){if(t==null||r==null||typeof n>"u")throw new Error("Missing required argument");this.cid=t,this.bytes=r,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:Ke(),bytes:Ke(),value:Ke(),asBlock:Ke()})}links(){return Ct(this.value,[])}tree(){return St(this.value,[])}get(t="/"){return gi(this.value,t.split("/").filter(Boolean))}};function vn({bytes:e,cid:t,value:r,codec:n}){let o=r!==void 0?r:n?.decode(e);if(o===void 0)throw new Error('Missing required argument, must either provide "value" or "codec"');return new Ut({cid:t,bytes:e,value:o})}function Bt(){let e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e}var Ot=Ue(_n(),1);var Ae=class extends Error{constructor(t){super(t),this.name="TimeoutError"}},Dt=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},kn=e=>globalThis.DOMException===void 0?new Dt(e):new DOMException(e),An=e=>{let t=e.reason===void 0?kn("This operation was aborted."):e.reason;return t instanceof Error?t:kn(t)};function Mt(e,t){let{milliseconds:r,fallback:n,message:o,customTimers:i={setTimeout,clearTimeout}}=t,a,c=new Promise((p,l)=>{if(typeof r!="number"||Math.sign(r)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(t.signal){let{signal:v}=t;v.aborted&&l(An(v));let R=()=>{l(An(v))};v.addEventListener("abort",R,{once:!0}),e.finally(()=>{v.removeEventListener("abort",R)})}if(r===Number.POSITIVE_INFINITY){e.then(p,l);return}let m=new Ae;a=i.setTimeout.call(void 0,()=>{if(n){try{p(n())}catch(v){l(v)}return}typeof e.cancel=="function"&&e.cancel(),o===!1?p():o instanceof Error?l(o):(m.message=o??`Promise timed out after ${r} milliseconds`,l(m))},r),(async()=>{try{p(await e)}catch(v){l(v)}})()}).finally(()=>{c.clear()});return c.clear=()=>{i.clearTimeout.call(void 0,a),a=void 0},c}function Rt(e,t,r){let n=0,o=e.length;for(;o>0;){let i=Math.trunc(o/2),a=n+i;r(e[a],t)<=0?(n=++a,o-=i+1):o=i}return n}var Te=class{#e=[];enqueue(t,r){r={priority:0,...r};let n={priority:r.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=r.priority){this.#e.push(n);return}let o=Rt(this.#e,n,(i,a)=>a.priority-i.priority);this.#e.splice(o,0,n)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(r=>r.priority===t.priority).map(r=>r.run)}get size(){return this.#e.length}};var Ie=class extends Ot.default{#e;#s;#i=0;#h;#a;#p=0;#r;#c;#t;#y;#n=0;#u;#o;#m;timeout;constructor(t){if(super(),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Te,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#s=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#h=t.intervalCap,this.#a=t.interval,this.#t=new t.queueClass,this.#y=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#m=t.throwOnTimeout===!0,this.#o=t.autoStart===!1}get#x(){return this.#s||this.#i<this.#h}get#b(){return this.#n<this.#u}#v(){this.#n--,this.#f(),this.emit("next")}#E(){this.#g(),this.#w(),this.#c=void 0}get#_(){let t=Date.now();if(this.#r===void 0){let r=this.#p-t;if(r<0)this.#i=this.#e?this.#n:0;else return this.#c===void 0&&(this.#c=setTimeout(()=>{this.#E()},r)),!0}return!1}#f(){if(this.#t.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#o){let t=!this.#_;if(this.#x&&this.#b){let r=this.#t.dequeue();return r?(this.emit("active"),r(),t&&this.#w(),!0):!1}}return!1}#w(){this.#s||this.#r!==void 0||(this.#r=setInterval(()=>{this.#g()},this.#a),this.#p=Date.now()+this.#a)}#g(){this.#i===0&&this.#n===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#i=this.#e?this.#n:0,this.#d()}#d(){for(;this.#f(););}get concurrency(){return this.#u}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#u=t,this.#d()}async#k(t){return new Promise((r,n)=>{t.addEventListener("abort",()=>{n(t.reason)},{once:!0})})}async add(t,r={}){return r={timeout:this.timeout,throwOnTimeout:this.#m,...r},new Promise((n,o)=>{this.#t.enqueue(async()=>{this.#n++,this.#i++;try{r.signal?.throwIfAborted();let i=t({signal:r.signal});r.timeout&&(i=Mt(Promise.resolve(i),{milliseconds:r.timeout})),r.signal&&(i=Promise.race([i,this.#k(r.signal)]));let a=await i;n(a),this.emit("completed",a)}catch(i){if(i instanceof Ae&&!r.throwOnTimeout){n();return}o(i),this.emit("error",i)}finally{this.#v()}},r),this.emit("add"),this.#f()})}async addAll(t,r){return Promise.all(t.map(async n=>this.add(n,r)))}start(){return this.#o?(this.#o=!1,this.#d(),this):this}pause(){this.#o=!0}clear(){this.#t=new this.#y}async onEmpty(){this.#t.size!==0&&await this.#l("empty")}async onSizeLessThan(t){this.#t.size<t||await this.#l("next",()=>this.#t.size<t)}async onIdle(){this.#n===0&&this.#t.size===0||await this.#l("idle")}async#l(t,r){return new Promise(n=>{let o=()=>{r&&!r()||(this.off(t,o),n())};this.on(t,o)})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#n}get isPaused(){return this.#o}};var vi=1,zt=class{components;constructor(t,r){this.components=t}async import(t,r){await gn(this.components.blockstore.putMany(bn(t.blocks(),({cid:n,bytes:o})=>({cid:n,block:o})),r))}async export(t,r,n){let o=Bt(),i=Array.isArray(t)?t:[t],a=new Ie({concurrency:vi});a.on("idle",()=>{o.resolve()}),a.on("error",u=>{a.clear(),o.reject(u)});for(let u of i)a.add(async()=>{await this.#e(u,a,async(c,p)=>{n?.blockFilter?.has(c.multihash.bytes)!==!0&&(n?.blockFilter?.add(c.multihash.bytes),await r.put({cid:c,bytes:p}))},n)}).catch(()=>{});try{await o.promise}finally{await r.close()}}async*stream(t,r){let{writer:n,out:o}=_e.create(t);this.export(t,n,r).catch(()=>{});for await(let i of o)yield i}async#e(t,r,n,o){let i=await this.components.getCodec(t.code),a=await this.components.blockstore.get(t,o);await n(t,a);let u=vn({bytes:a,cid:t,codec:i});for await(let[,c]of u.links())r.add(async()=>{await this.#e(c,r,n,o)})}};function Ei(e,t={}){return new zt(e,t)}return Nn(_i);})();
|
|
2
|
+
"use strict";var HeliaCar=(()=>{var Tn=Object.create;var Se=Object.defineProperty;var In=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var Sn=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty;var ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bn=(e,t)=>{for(var r in t)Se(e,r,{get:t[r],enumerable:!0})},$t=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Cn(t))!Un.call(e,o)&&o!==r&&Se(e,o,{get:()=>t[o],enumerable:!(n=In(t,o))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?Tn(Sn(e)):{},$t(t||!e||!e.__esModule?Se(r,"default",{value:e,enumerable:!0}):r,e)),Nn=e=>$t(Se({},"__esModule",{value:!0}),e);var on=ce((ta,nn)=>{nn.exports=gt;var rn=128,qo=127,Ho=~qo,Go=Math.pow(2,31);function gt(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw gt.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=Go;)t[r++]=e&255|rn,e/=128;for(;e&Ho;)t[r++]=e&255|rn,e>>>=7;return t[r]=e|0,gt.bytes=r-n+1,t}});var cn=ce((ra,an)=>{an.exports=xt;var Wo=128,sn=127;function xt(e,n){var r=0,n=n||0,o=0,i=n,a,u=e.length;do{if(i>=u||o>49)throw xt.bytes=0,new RangeError("Could not decode varint");a=e[i++],r+=o<28?(a&sn)<<o:(a&sn)*Math.pow(2,o),o+=7}while(a>=Wo);return xt.bytes=i-n,r}});var fn=ce((na,un)=>{var jo=Math.pow(2,7),Ko=Math.pow(2,14),Yo=Math.pow(2,21),Jo=Math.pow(2,28),Xo=Math.pow(2,35),Qo=Math.pow(2,42),Zo=Math.pow(2,49),ei=Math.pow(2,56),ti=Math.pow(2,63);un.exports=function(e){return e<jo?1:e<Ko?2:e<Yo?3:e<Jo?4:e<Xo?5:e<Qo?6:e<Zo?7:e<ei?8:e<ti?9:10}});var Ge=ce((oa,dn)=>{dn.exports={encode:on(),decode:cn(),encodingLength:fn()}});var _n=ce((wc,Nt)=>{"use strict";var xi=Object.prototype.hasOwnProperty,_="~";function ke(){}Object.create&&(ke.prototype=Object.create(null),new ke().__proto__||(_=!1));function bi(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function En(e,t,r,n,o){if(typeof r!="function")throw new TypeError("The listener must be a function");var i=new bi(r,n||e,o),a=_?_+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],i]:e._events[a].push(i):(e._events[a]=i,e._eventsCount++),e}function Ye(e,t){--e._eventsCount===0?e._events=new ke:delete e._events[t]}function E(){this._events=new ke,this._eventsCount=0}E.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)xi.call(r,n)&&t.push(_?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};E.prototype.listeners=function(t){var r=_?_+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o<i;o++)a[o]=n[o].fn;return a};E.prototype.listenerCount=function(t){var r=_?_+t:t,n=this._events[r];return n?n.fn?1:n.length:0};E.prototype.emit=function(t,r,n,o,i,a){var u=_?_+t:t;if(!this._events[u])return!1;var c=this._events[u],p=arguments.length,h,y;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),p){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,o),!0;case 5:return c.fn.call(c.context,r,n,o,i),!0;case 6:return c.fn.call(c.context,r,n,o,i,a),!0}for(y=1,h=new Array(p-1);y<p;y++)h[y-1]=arguments[y];c.fn.apply(c.context,h)}else{var P=c.length,v;for(y=0;y<P;y++)switch(c[y].once&&this.removeListener(t,c[y].fn,void 0,!0),p){case 1:c[y].fn.call(c[y].context);break;case 2:c[y].fn.call(c[y].context,r);break;case 3:c[y].fn.call(c[y].context,r,n);break;case 4:c[y].fn.call(c[y].context,r,n,o);break;default:if(!h)for(v=1,h=new Array(p-1);v<p;v++)h[v-1]=arguments[v];c[y].fn.apply(c[y].context,h)}}return!0};E.prototype.on=function(t,r,n){return En(this,t,r,n,!1)};E.prototype.once=function(t,r,n){return En(this,t,r,n,!0)};E.prototype.removeListener=function(t,r,n,o){var i=_?_+t:t;if(!this._events[i])return this;if(!r)return Ye(this,i),this;var a=this._events[i];if(a.fn)a.fn===r&&(!o||a.once)&&(!n||a.context===n)&&Ye(this,i);else{for(var u=0,c=[],p=a.length;u<p;u++)(a[u].fn!==r||o&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[i]=c.length===1?c[0]:c:Ye(this,i)}return this};E.prototype.removeAllListeners=function(t){var r;return t?(r=_?_+t:t,this._events[r]&&Ye(this,r)):(this._events=new ke,this._eventsCount=0),this};E.prototype.off=E.prototype.removeListener;E.prototype.addListener=E.prototype.on;E.prefixed=_;E.EventEmitter=E;typeof Nt<"u"&&(Nt.exports=E)});var _i={};Bn(_i,{car:()=>Ei});var On=["string","number","bigint","symbol"],Dn=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Lt(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(On.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Mn(e))return"Buffer";let r=Rn(e);return r||"Object"}function Mn(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Rn(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Dn.includes(t))return t}var s=class{constructor(t,r,n){this.major=t,this.majorEncoded=t<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(t){return this.major<t.major?-1:this.major>t.major?1:0}};s.uint=new s(0,"uint",!0);s.negint=new s(1,"negint",!0);s.bytes=new s(2,"bytes",!0);s.string=new s(3,"string",!0);s.array=new s(4,"array",!1);s.map=new s(5,"map",!1);s.tag=new s(6,"tag",!1);s.float=new s(7,"float",!0);s.false=new s(7,"false",!0);s.true=new s(7,"true",!0);s.null=new s(7,"null",!0);s.undefined=new s(7,"undefined",!0);s.break=new s(7,"break",!0);var d=class{constructor(t,r,n){this.type=t,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};var X=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",zn=new TextDecoder,$n=new TextEncoder;function Be(e){return X&&globalThis.Buffer.isBuffer(e)}function Je(e){return e instanceof Uint8Array?Be(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var qt=X?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Pt(e,t,r):(e,t,r)=>r-t>64?zn.decode(e.subarray(t,r)):Pt(e,t,r),Ht=X?e=>e.length>64?globalThis.Buffer.from(e):Vt(e):e=>e.length>64?$n.encode(e):Vt(e),L=e=>Uint8Array.from(e),Q=X?(e,t,r)=>Be(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Gt=X?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),Je(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let o of e)n+o.length>r.length&&(o=o.subarray(0,r.length-n)),r.set(o,n),n+=o.length;return r},Wt=X?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function jt(e,t){if(Be(e)&&Be(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function Vt(e){let t=[],r=0;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);o<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=o&63|128):(o&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(o=65536+((o&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=o&63|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=o&63|128)}return t}function Pt(e,t,r){let n=[];for(;t<r;){let o=e[t],i=null,a=o>239?4:o>223?3:o>191?2:1;if(t+a<=r){let u,c,p,h;switch(a){case 1:o<128&&(i=o);break;case 2:u=e[t+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(i=h));break;case 3:u=e[t+1],c=e[t+2],(u&192)===128&&(c&192)===128&&(h=(o&15)<<12|(u&63)<<6|c&63,h>2047&&(h<55296||h>57343)&&(i=h));break;case 4:u=e[t+1],c=e[t+2],p=e[t+3],(u&192)===128&&(c&192)===128&&(p&192)===128&&(h=(o&15)<<18|(u&63)<<12|(c&63)<<6|p&63,h>65535&&h<1114112&&(i=h))}}i===null?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),t+=a}return Ln(n)}var Ft=4096;function Ln(e){let t=e.length;if(t<=Ft)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Ft));return r}var Vn=256,ue=class{constructor(t=Vn){this.chunkSize=t,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(t){let r=this.chunks[this.chunks.length-1];if(this.cursor+t.length<=this.maxCursor+1){let o=r.length-(this.maxCursor-this.cursor)-1;r.set(t,o)}else{if(r){let o=r.length-(this.maxCursor-this.cursor)-1;o<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,o),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=Wt(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(t,0)):(this.chunks.push(t),this.maxCursor+=t.length)}this.cursor+=t.length}toBytes(t=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];t&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=Q(n,0,this.cursor)}else r=Gt(this.chunks,this.cursor);return t&&this.reset(),r}};var l="CBOR decode error:",Xe="CBOR encode error:",fe=[];fe[23]=1;fe[24]=2;fe[25]=3;fe[26]=5;fe[27]=9;function q(e,t,r){if(e.length-t<r)throw new Error(`${l} not enough data for type`)}var x=[24,256,65536,4294967296,BigInt("18446744073709551616")];function A(e,t,r){q(e,t,1);let n=e[t];if(r.strict===!0&&n<x[0])throw new Error(`${l} integer encoded in more bytes than necessary (strict decode)`);return n}function T(e,t,r){q(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<x[1])throw new Error(`${l} integer encoded in more bytes than necessary (strict decode)`);return n}function I(e,t,r){q(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<x[2])throw new Error(`${l} integer encoded in more bytes than necessary (strict decode)`);return n}function C(e,t,r){q(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],o=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],i=(BigInt(n)<<BigInt(32))+BigInt(o);if(r.strict===!0&&i<x[3])throw new Error(`${l} integer encoded in more bytes than necessary (strict decode)`);if(i<=Number.MAX_SAFE_INTEGER)return Number(i);if(r.allowBigInt===!0)return i;throw new Error(`${l} integers outside of the safe integer range are not supported`)}function Kt(e,t,r,n){return new d(s.uint,A(e,t+1,n),2)}function Yt(e,t,r,n){return new d(s.uint,T(e,t+1,n),3)}function Jt(e,t,r,n){return new d(s.uint,I(e,t+1,n),5)}function Xt(e,t,r,n){return new d(s.uint,C(e,t+1,n),9)}function U(e,t){return b(e,0,t.value)}function b(e,t,r){if(r<x[0]){let n=Number(r);e.push([t|n])}else if(r<x[1]){let n=Number(r);e.push([t|24,n])}else if(r<x[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<x[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<x[4]){let o=[t|27,0,0,0,0,0,0,0],i=Number(n&BigInt(4294967295)),a=Number(n>>BigInt(32)&BigInt(4294967295));o[8]=i&255,i=i>>8,o[7]=i&255,i=i>>8,o[6]=i&255,i=i>>8,o[5]=i&255,o[4]=a&255,a=a>>8,o[3]=a&255,a=a>>8,o[2]=a&255,a=a>>8,o[1]=a&255,e.push(o)}else throw new Error(`${l} encountered BigInt larger than allowable range`)}}U.encodedSize=function(t){return b.encodedSize(t.value)};b.encodedSize=function(t){return t<x[0]?1:t<x[1]?2:t<x[2]?3:t<x[3]?5:9};U.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function Qt(e,t,r,n){return new d(s.negint,-1-A(e,t+1,n),2)}function Zt(e,t,r,n){return new d(s.negint,-1-T(e,t+1,n),3)}function er(e,t,r,n){return new d(s.negint,-1-I(e,t+1,n),5)}var Qe=BigInt(-1),tr=BigInt(1);function rr(e,t,r,n){let o=C(e,t+1,n);if(typeof o!="bigint"){let i=-1-o;if(i>=Number.MIN_SAFE_INTEGER)return new d(s.negint,i,9)}if(n.allowBigInt!==!0)throw new Error(`${l} integers outside of the safe integer range are not supported`);return new d(s.negint,Qe-BigInt(o),9)}function Ne(e,t){let r=t.value,n=typeof r=="bigint"?r*Qe-tr:r*-1-1;b(e,t.type.majorEncoded,n)}Ne.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*Qe-tr:r*-1-1;return n<x[0]?1:n<x[1]?2:n<x[2]?3:n<x[3]?5:9};Ne.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function de(e,t,r,n){q(e,t,r+n);let o=Q(e,t+r,t+r+n);return new d(s.bytes,o,r+n)}function nr(e,t,r,n){return de(e,t,1,r)}function or(e,t,r,n){return de(e,t,2,A(e,t+1,n))}function ir(e,t,r,n){return de(e,t,3,T(e,t+1,n))}function sr(e,t,r,n){return de(e,t,5,I(e,t+1,n))}function ar(e,t,r,n){let o=C(e,t+1,n);if(typeof o=="bigint")throw new Error(`${l} 64-bit integer bytes lengths not supported`);return de(e,t,9,o)}function Oe(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===s.string?Ht(e.value):e.value),e.encodedBytes}function Z(e,t){let r=Oe(t);b(e,t.type.majorEncoded,r.length),e.push(r)}Z.encodedSize=function(t){let r=Oe(t);return b.encodedSize(r.length)+r.length};Z.compareTokens=function(t,r){return Fn(Oe(t),Oe(r))};function Fn(e,t){return e.length<t.length?-1:e.length>t.length?1:jt(e,t)}function le(e,t,r,n,o){let i=r+n;q(e,t,i);let a=new d(s.string,qt(e,t+r,t+i),i);return o.retainStringBytes===!0&&(a.byteValue=Q(e,t+r,t+i)),a}function cr(e,t,r,n){return le(e,t,1,r,n)}function ur(e,t,r,n){return le(e,t,2,A(e,t+1,n),n)}function fr(e,t,r,n){return le(e,t,3,T(e,t+1,n),n)}function dr(e,t,r,n){return le(e,t,5,I(e,t+1,n),n)}function lr(e,t,r,n){let o=C(e,t+1,n);if(typeof o=="bigint")throw new Error(`${l} 64-bit integer string lengths not supported`);return le(e,t,9,o,n)}var hr=Z;function ee(e,t,r,n){return new d(s.array,n,r)}function pr(e,t,r,n){return ee(e,t,1,r)}function yr(e,t,r,n){return ee(e,t,2,A(e,t+1,n))}function mr(e,t,r,n){return ee(e,t,3,T(e,t+1,n))}function wr(e,t,r,n){return ee(e,t,5,I(e,t+1,n))}function gr(e,t,r,n){let o=C(e,t+1,n);if(typeof o=="bigint")throw new Error(`${l} 64-bit integer array lengths not supported`);return ee(e,t,9,o)}function xr(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${l} indefinite length items not allowed`);return ee(e,t,1,1/0)}function De(e,t){b(e,s.array.majorEncoded,t.value)}De.compareTokens=U.compareTokens;De.encodedSize=function(t){return b.encodedSize(t.value)};function te(e,t,r,n){return new d(s.map,n,r)}function br(e,t,r,n){return te(e,t,1,r)}function vr(e,t,r,n){return te(e,t,2,A(e,t+1,n))}function Er(e,t,r,n){return te(e,t,3,T(e,t+1,n))}function _r(e,t,r,n){return te(e,t,5,I(e,t+1,n))}function kr(e,t,r,n){let o=C(e,t+1,n);if(typeof o=="bigint")throw new Error(`${l} 64-bit integer map lengths not supported`);return te(e,t,9,o)}function Ar(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${l} indefinite length items not allowed`);return te(e,t,1,1/0)}function Me(e,t){b(e,s.map.majorEncoded,t.value)}Me.compareTokens=U.compareTokens;Me.encodedSize=function(t){return b.encodedSize(t.value)};function Tr(e,t,r,n){return new d(s.tag,r,1)}function Ir(e,t,r,n){return new d(s.tag,A(e,t+1,n),2)}function Cr(e,t,r,n){return new d(s.tag,T(e,t+1,n),3)}function Sr(e,t,r,n){return new d(s.tag,I(e,t+1,n),5)}function Ur(e,t,r,n){return new d(s.tag,C(e,t+1,n),9)}function Re(e,t){b(e,s.tag.majorEncoded,t.value)}Re.compareTokens=U.compareTokens;Re.encodedSize=function(t){return b.encodedSize(t.value)};var Kn=20,Yn=21,Jn=22,Xn=23;function Br(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${l} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new d(s.null,null,1):new d(s.undefined,void 0,1)}function Nr(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${l} indefinite length items not allowed`);return new d(s.break,void 0,1)}function Ze(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${l} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${l} Infinity values are not supported`)}return new d(s.float,e,t)}function Or(e,t,r,n){return Ze(et(e,t+1),3,n)}function Dr(e,t,r,n){return Ze(tt(e,t+1),5,n)}function Mr(e,t,r,n){return Ze(Lr(e,t+1),9,n)}function ze(e,t,r){let n=t.value;if(n===!1)e.push([s.float.majorEncoded|Kn]);else if(n===!0)e.push([s.float.majorEncoded|Yn]);else if(n===null)e.push([s.float.majorEncoded|Jn]);else if(n===void 0)e.push([s.float.majorEncoded|Xn]);else{let o,i=!1;(!r||r.float64!==!0)&&(zr(n),o=et(D,1),n===o||Number.isNaN(n)?(D[0]=249,e.push(D.slice(0,3)),i=!0):($r(n),o=tt(D,1),n===o&&(D[0]=250,e.push(D.slice(0,5)),i=!0))),i||(Qn(n),o=Lr(D,1),D[0]=251,e.push(D.slice(0,9)))}}ze.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){zr(n);let o=et(D,1);if(n===o||Number.isNaN(n))return 3;if($r(n),o=tt(D,1),n===o)return 5}return 9};var Rr=new ArrayBuffer(9),B=new DataView(Rr,1),D=new Uint8Array(Rr,0);function zr(e){if(e===1/0)B.setUint16(0,31744,!1);else if(e===-1/0)B.setUint16(0,64512,!1);else if(Number.isNaN(e))B.setUint16(0,32256,!1);else{B.setFloat32(0,e);let t=B.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)B.setUint16(0,31744,!1);else if(r===0)B.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let o=r-127;o<-24?B.setUint16(0,0):o<-14?B.setUint16(0,(t&2147483648)>>16|1<<24+o,!1):B.setUint16(0,(t&2147483648)>>16|o+15<<10|n>>13,!1)}}}function et(e,t){if(e.length-t<2)throw new Error(`${l} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,o=r&1023,i;return n===0?i=o*2**-24:n!==31?i=(o+1024)*2**(n-25):i=o===0?1/0:NaN,r&32768?-i:i}function $r(e){B.setFloat32(0,e,!1)}function tt(e,t){if(e.length-t<4)throw new Error(`${l} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function Qn(e){B.setFloat64(0,e,!1)}function Lr(e,t){if(e.length-t<8)throw new Error(`${l} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}ze.compareTokens=U.compareTokens;function m(e,t,r){throw new Error(`${l} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function $e(e){return()=>{throw new Error(`${l} ${e}`)}}var f=[];for(let e=0;e<=23;e++)f[e]=m;f[24]=Kt;f[25]=Yt;f[26]=Jt;f[27]=Xt;f[28]=m;f[29]=m;f[30]=m;f[31]=m;for(let e=32;e<=55;e++)f[e]=m;f[56]=Qt;f[57]=Zt;f[58]=er;f[59]=rr;f[60]=m;f[61]=m;f[62]=m;f[63]=m;for(let e=64;e<=87;e++)f[e]=nr;f[88]=or;f[89]=ir;f[90]=sr;f[91]=ar;f[92]=m;f[93]=m;f[94]=m;f[95]=$e("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)f[e]=cr;f[120]=ur;f[121]=fr;f[122]=dr;f[123]=lr;f[124]=m;f[125]=m;f[126]=m;f[127]=$e("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)f[e]=pr;f[152]=yr;f[153]=mr;f[154]=wr;f[155]=gr;f[156]=m;f[157]=m;f[158]=m;f[159]=xr;for(let e=160;e<=183;e++)f[e]=br;f[184]=vr;f[185]=Er;f[186]=_r;f[187]=kr;f[188]=m;f[189]=m;f[190]=m;f[191]=Ar;for(let e=192;e<=215;e++)f[e]=Tr;f[216]=Ir;f[217]=Cr;f[218]=Sr;f[219]=Ur;f[220]=m;f[221]=m;f[222]=m;f[223]=m;for(let e=224;e<=243;e++)f[e]=$e("simple values are not supported");f[244]=m;f[245]=m;f[246]=m;f[247]=Br;f[248]=$e("simple values are not supported");f[249]=Or;f[250]=Dr;f[251]=Mr;f[252]=m;f[253]=m;f[254]=m;f[255]=Nr;var M=[];for(let e=0;e<24;e++)M[e]=new d(s.uint,e,1);for(let e=-1;e>=-24;e--)M[31-e]=new d(s.negint,e,1);M[64]=new d(s.bytes,new Uint8Array(0),1);M[96]=new d(s.string,"",1);M[128]=new d(s.array,0,1);M[160]=new d(s.map,0,1);M[244]=new d(s.false,!1,1);M[245]=new d(s.true,!0,1);M[246]=new d(s.null,null,1);function rt(e){switch(e.type){case s.false:return L([244]);case s.true:return L([245]);case s.null:return L([246]);case s.bytes:return e.value.length?void 0:L([64]);case s.string:return e.value===""?L([96]):void 0;case s.array:return e.value===0?L([128]):void 0;case s.map:return e.value===0?L([160]):void 0;case s.uint:return e.value<24?L([Number(e.value)]):void 0;case s.negint:if(e.value>=-24)return L([31-Number(e.value)])}}var eo={float64:!1,mapSorter:ro,quickEncodeToken:rt};function ot(){let e=[];return e[s.uint.major]=U,e[s.negint.major]=Ne,e[s.bytes.major]=Z,e[s.string.major]=hr,e[s.array.major]=De,e[s.map.major]=Me,e[s.tag.major]=Re,e[s.float.major]=ze,e}var Vr=ot(),nt=new ue,Le=class e{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${Xe} object contains circular references`);return new e(r,t)}},W={null:new d(s.null,null),undefined:new d(s.undefined,void 0),true:new d(s.true,!0),false:new d(s.false,!1),emptyArray:new d(s.array,0),emptyMap:new d(s.map,0)},j={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new d(s.float,e):e>=0?new d(s.uint,e):new d(s.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new d(s.uint,e):new d(s.negint,e)},Uint8Array(e,t,r,n){return new d(s.bytes,e)},string(e,t,r,n){return new d(s.string,e)},boolean(e,t,r,n){return e?W.true:W.false},null(e,t,r,n){return W.null},undefined(e,t,r,n){return W.undefined},ArrayBuffer(e,t,r,n){return new d(s.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new d(s.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[W.emptyArray,new d(s.break)]:W.emptyArray;n=Le.createCheck(n,e);let o=[],i=0;for(let a of e)o[i++]=he(a,r,n);return r.addBreakTokens?[new d(s.array,e.length),o,new d(s.break)]:[new d(s.array,e.length),o]},Object(e,t,r,n){let o=t!=="Object",i=o?e.keys():Object.keys(e),a=o?e.size:i.length;if(!a)return r.addBreakTokens===!0?[W.emptyMap,new d(s.break)]:W.emptyMap;n=Le.createCheck(n,e);let u=[],c=0;for(let p of i)u[c++]=[he(p,r,n),he(o?e.get(p):e[p],r,n)];return to(u,r),r.addBreakTokens?[new d(s.map,a),u,new d(s.break)]:[new d(s.map,a),u]}};j.Map=j.Object;j.Buffer=j.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))j[`${e}Array`]=j.DataView;function he(e,t={},r){let n=Lt(e),o=t&&t.typeEncoders&&t.typeEncoders[n]||j[n];if(typeof o=="function"){let a=o(e,n,t,r);if(a!=null)return a}let i=j[n];if(!i)throw new Error(`${Xe} unsupported type: ${n}`);return i(e,n,t,r)}function to(e,t){t.mapSorter&&e.sort(t.mapSorter)}function ro(e,t){let r=Array.isArray(e[0])?e[0][0]:e[0],n=Array.isArray(t[0])?t[0][0]:t[0];if(r.type!==n.type)return r.type.compare(n.type);let o=r.type.major,i=Vr[o].compareTokens(r,n);return i===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),i}function Pr(e,t,r,n){if(Array.isArray(t))for(let o of t)Pr(e,o,r,n);else r[t.type.major](e,t,n)}function no(e,t,r){let n=he(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let o=r.quickEncodeToken(n);if(o)return o;let i=t[n.type.major];if(i.encodedSize){let a=i.encodedSize(n,r),u=new ue(a);if(i(u,n,r),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return Je(u.chunks[0])}}return nt.reset(),Pr(nt,n,t,r),nt.toBytes(!0)}function it(e,t){return t=Object.assign({},eo,t),no(e,Vr,t)}var oo={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Ve=class{constructor(t,r={}){this._pos=0,this.data=t,this.options=r}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let t=this.data[this._pos],r=M[t];if(r===void 0){let n=f[t];if(!n)throw new Error(`${l} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let o=t&31;r=n(this.data,this._pos,o,this.options)}return this._pos+=r.encodedLength,r}},pe=Symbol.for("DONE"),Pe=Symbol.for("BREAK");function io(e,t,r){let n=[];for(let o=0;o<e.value;o++){let i=re(t,r);if(i===Pe){if(e.value===1/0)break;throw new Error(`${l} got unexpected break to lengthed array`)}if(i===pe)throw new Error(`${l} found array but not enough entries (got ${o}, expected ${e.value})`);n[o]=i}return n}function so(e,t,r){let n=r.useMaps===!0,o=n?void 0:{},i=n?new Map:void 0;for(let a=0;a<e.value;a++){let u=re(t,r);if(u===Pe){if(e.value===1/0)break;throw new Error(`${l} got unexpected break to lengthed map`)}if(u===pe)throw new Error(`${l} found map but not enough entries (got ${a} [no key], expected ${e.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${l} non-string keys not supported (got ${typeof u})`);if(r.rejectDuplicateMapKeys===!0&&(n&&i.has(u)||!n&&u in o))throw new Error(`${l} found repeat map key "${u}"`);let c=re(t,r);if(c===pe)throw new Error(`${l} found map but not enough entries (got ${a} [no value], expected ${e.value})`);n?i.set(u,c):o[u]=c}return n?i:o}function re(e,t){if(e.done())return pe;let r=e.next();if(r.type===s.break)return Pe;if(r.type.terminal)return r.value;if(r.type===s.array)return io(r,e,t);if(r.type===s.map)return so(r,e,t);if(r.type===s.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=re(e,t);return t.tags[r.value](n)}throw new Error(`${l} tag not supported (${r.value})`)}throw new Error("unsupported")}function Fr(e,t){if(!(e instanceof Uint8Array))throw new Error(`${l} data to decode must be a Uint8Array`);t=Object.assign({},oo,t);let r=t.tokenizer||new Ve(e,t),n=re(r,t);if(n===pe)throw new Error(`${l} did not find any content to decode`);if(n===Pe)throw new Error(`${l} got unexpected break`);return[n,e.subarray(r.pos())]}function st(e,t){let[r,n]=Fr(e,t);if(n.length>0)throw new Error(`${l} too many terminals, data makes no sense`);return r}var Es=new Uint8Array(0);function qr(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}function ne(e){if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}function co(e,t){if(e.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<e.length;o++){var i=e.charAt(o),a=i.charCodeAt(0);if(r[a]!==255)throw new TypeError(i+" is ambiguous");r[a]=o}var u=e.length,c=e.charAt(0),p=Math.log(u)/Math.log(256),h=Math.log(256)/Math.log(u);function y(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var k=0,Y=0,N=0,R=w.length;N!==R&&w[N]===0;)N++,k++;for(var z=(R-N)*h+1>>>0,S=new Uint8Array(z);N!==R;){for(var $=w[N],G=0,O=z-1;($!==0||G<Y)&&O!==-1;O--,G++)$+=256*S[O]>>>0,S[O]=$%u>>>0,$=$/u>>>0;if($!==0)throw new Error("Non-zero carry");Y=G,N++}for(var F=z-Y;F!==z&&S[F]===0;)F++;for(var Ce=c.repeat(k);F<z;++F)Ce+=e.charAt(S[F]);return Ce}function P(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var k=0;if(w[k]!==" "){for(var Y=0,N=0;w[k]===c;)Y++,k++;for(var R=(w.length-k)*p+1>>>0,z=new Uint8Array(R);w[k];){var S=r[w.charCodeAt(k)];if(S===255)return;for(var $=0,G=R-1;(S!==0||$<N)&&G!==-1;G--,$++)S+=u*z[G]>>>0,z[G]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");N=$,k++}if(w[k]!==" "){for(var O=R-N;O!==R&&z[O]===0;)O++;for(var F=new Uint8Array(Y+(R-O)),Ce=Y;O!==R;)F[Ce++]=z[O++];return F}}}function v(w){var k=P(w);if(k)return k;throw new Error(`Non-${t} character`)}return{encode:y,decodeUnsafe:P,decode:v}}var uo=co,fo=uo,Gr=fo;var at=class{name;prefix;baseEncode;constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},ct=class{name;prefix;baseDecode;prefixCodePoint;constructor(t,r,n){this.name=t,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(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Wr(this,t)}},ut=class{decoders;constructor(t){this.decoders=t}or(t){return Wr(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n!=null)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Wr(e,t){return new ut({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var ft=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new at(t,r,n),this.decoder=new ct(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};function jr({name:e,prefix:t,encode:r,decode:n}){return new ft(e,t,r,n)}function oe({name:e,prefix:t,alphabet:r}){let{encode:n,decode:o}=Gr(r,e);return jr({prefix:t,name:e,encode:n,decode:i=>ne(o(i))})}function lo(e,t,r,n){let o={};for(let h=0;h<t.length;++h)o[t[h]]=h;let i=e.length;for(;e[i-1]==="=";)--i;let a=new Uint8Array(i*r/8|0),u=0,c=0,p=0;for(let h=0;h<i;++h){let y=o[e[h]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|y,u+=r,u>=8&&(u-=8,a[p++]=255&c>>u)}if(u>=r||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return a}function ho(e,t,r){let n=t[t.length-1]==="=",o=(1<<r)-1,i="",a=0,u=0;for(let c=0;c<e.length;++c)for(u=u<<8|e[c],a+=8;a>r;)a-=r,i+=t[o&u>>a];if(a!==0&&(i+=t[o&u<<r-a]),n)for(;i.length*r&7;)i+="=";return i}function V({name:e,prefix:t,bitsPerChar:r,alphabet:n}){return jr({prefix:t,name:e,encode(o){return ho(o,n,r)},decode(o){return lo(o,n,r,e)}})}var ye=V({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Cs=V({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ss=V({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Us=V({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Bs=V({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ns=V({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Os=V({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ds=V({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Ms=V({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Fe=oe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$s=oe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var H=oe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ps=oe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var po=Jr,Kr=128,yo=127,mo=~yo,wo=Math.pow(2,31);function Jr(e,t,r){t=t||[],r=r||0;for(var n=r;e>=wo;)t[r++]=e&255|Kr,e/=128;for(;e&mo;)t[r++]=e&255|Kr,e>>>=7;return t[r]=e|0,Jr.bytes=r-n+1,t}var go=dt,xo=128,Yr=127;function dt(e,n){var r=0,n=n||0,o=0,i=n,a,u=e.length;do{if(i>=u)throw dt.bytes=0,new RangeError("Could not decode varint");a=e[i++],r+=o<28?(a&Yr)<<o:(a&Yr)*Math.pow(2,o),o+=7}while(a>=xo);return dt.bytes=i-n,r}var bo=Math.pow(2,7),vo=Math.pow(2,14),Eo=Math.pow(2,21),_o=Math.pow(2,28),ko=Math.pow(2,35),Ao=Math.pow(2,42),To=Math.pow(2,49),Io=Math.pow(2,56),Co=Math.pow(2,63),So=function(e){return e<bo?1:e<vo?2:e<Eo?3:e<_o?4:e<ko?5:e<Ao?6:e<To?7:e<Io?8:e<Co?9:10},Uo={encode:po,decode:go,encodingLength:So},Bo=Uo,me=Bo;function we(e,t=0){return[me.decode(e,t),me.decode.bytes]}function ie(e,t,r=0){return me.encode(e,t,r),t}function se(e){return me.encodingLength(e)}function ht(e,t){let r=t.byteLength,n=se(e),o=n+se(r),i=new Uint8Array(o+r);return ie(e,i,0),ie(r,i,n),i.set(t,o),new ae(e,r,t,i)}function qe(e){let t=ne(e),[r,n]=we(t),[o,i]=we(t.subarray(n)),a=t.subarray(n+i);if(a.byteLength!==o)throw new Error("Incorrect length");return new ae(r,o,a,t)}function Xr(e,t){if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&qr(e.bytes,r.bytes)}}var ae=class{code;size;digest;bytes;constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}};function Qr(e,t){let{bytes:r,version:n}=e;switch(n){case 0:return Oo(r,pt(e),t??H.encoder);default:return Do(r,pt(e),t??ye.encoder)}}var Zr=new WeakMap;function pt(e){let t=Zr.get(e);if(t==null){let r=new Map;return Zr.set(e,r),r}return t}var g=class e{code;version;multihash;bytes;"/";constructor(t,r,n,o){this.code=r,this.version=t,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:t,multihash:r}=this;if(t!==xe)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Mo)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.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:t,digest:r}=this.multihash,n=ht(t,r);return e.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(t){return e.equals(this,t)}static equals(t,r){let n=r;return n!=null&&t.code===n.code&&t.version===n.version&&Xr(t.multihash,n.multihash)}toString(t){return Qr(this,t)}toJSON(){return{"/":Qr(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof e)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:o,multihash:i,bytes:a}=r;return new e(n,o,i,a??en(n,o,i.bytes))}else if(r[Ro]===!0){let{version:n,multihash:o,code:i}=r,a=qe(o);return e.create(n,i,a)}else return null}static create(t,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(t){case 0:{if(r!==xe)throw new Error(`Version 0 CID must use dag-pb (code: ${xe}) block encoding`);return new e(t,r,n,n.bytes)}case 1:{let o=en(t,r,n.bytes);return new e(t,r,n,o)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,xe,t)}static createV1(t,r){return e.create(1,t,r)}static decode(t){let[r,n]=e.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=e.inspectBytes(t),n=r.size-r.multihashSize,o=ne(t.subarray(n,n+r.multihashSize));if(o.byteLength!==r.multihashSize)throw new Error("Incorrect length");let i=o.subarray(r.multihashSize-r.digestSize),a=new ae(r.multihashCode,r.digestSize,i,o);return[r.version===0?e.createV0(a):e.createV1(r.codec,a),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[y,P]=we(t.subarray(r));return r+=P,y},o=n(),i=xe;if(o===18?(o=0,r=0):i=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let a=r,u=n(),c=n(),p=r+c,h=p-a;return{version:o,codec:i,multihashCode:u,digestSize:c,multihashSize:h,size:p}}static parse(t,r){let[n,o]=No(t,r),i=e.decode(o);if(i.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return pt(i).set(n,t),i}};function No(e,t){switch(e[0]){case"Q":{let r=t??H;return[H.prefix,r.decode(`${H.prefix}${e}`)]}case H.prefix:{let r=t??H;return[H.prefix,r.decode(e)]}case ye.prefix:{let r=t??ye;return[ye.prefix,r.decode(e)]}case Fe.prefix:{let r=t??Fe;return[Fe.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function Oo(e,t,r){let{prefix:n}=r;if(n!==H.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let o=t.get(n);if(o==null){let i=r.encode(e).slice(1);return t.set(n,i),i}else return o}function Do(e,t,r){let{prefix:n}=r,o=t.get(n);if(o==null){let i=r.encode(e);return t.set(n,i),i}else return o}var xe=112,Mo=18;function en(e,t,r){let n=se(e),o=n+se(t),i=new Uint8Array(o+r.byteLength);return ie(e,i,0),ie(t,i,n),i.set(r,o),i}var Ro=Symbol.for("@ipld/js-cid/CID");var tn=42;function zo(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function $o(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=g.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new d(s.tag,tn),new d(s.bytes,r)]}function Lo(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function Vo(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var yt={float64:!0,typeEncoders:{Object:$o,undefined:Lo,number:Vo}},Zs={...yt,typeEncoders:{...yt.typeEncoders}};function Po(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return g.decode(e.subarray(1))}var He={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};He.tags[tn]=Po;var ea={...He,tags:He.tags.slice()};var mt=e=>it(e,yt),wt=e=>st(zo(e),He);var bt=Ue(Ge(),1);var vt=40;function Et(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=bt.default.decode(e);return t.seek(bt.default.decode.bytes),r}function _t(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0;return{version:2,characteristics:[t.getBigUint64(r,!0),t.getBigUint64(r+=8,!0)],dataOffset:Number(t.getBigUint64(r+=8,!0)),dataSize:Number(t.getBigUint64(r+=8,!0)),indexOffset:Number(t.getBigUint64(r+=8,!0))}}var K={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},be={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":K.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(K.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=be["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let o=t;o<e.length;o++){let i=e[o];if(i=be["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](i),i===void 0)return;n.push(i)}return n}}return e}},Int:K.Int,CarV1HeaderOrV2Pragma:e=>{if(K.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let o=0;o<t.length;o++){let[i,a]=t[o];switch(i){case"roots":{let u=be["CarV1HeaderOrV2Pragma > roots (anon)"](e[i]);if(u===void 0)return;if(u!==a||r!==e){if(r===e){r={};for(let c=0;c<o;c++)r[t[c][0]]=t[c][1]}r.roots=u}}break;case"version":{n--;let u=be.Int(e[i]);if(u===void 0)return;if(u!==a||r!==e){if(r===e){r={};for(let c=0;c<o;c++)r[t[c][0]]=t[c][1]}r.version=u}}break;default:return}}if(!(n>0))return r}},ve={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":K.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(K.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=ve["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let o=t;o<e.length;o++){let i=e[o];if(i=ve["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](i),i===void 0)return;n.push(i)}return n}}return e}},Int:K.Int,CarV1HeaderOrV2Pragma:e=>{if(K.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let o=0;o<t.length;o++){let[i,a]=t[o];switch(i){case"roots":{let u=ve["CarV1HeaderOrV2Pragma > roots (anon)"](a);if(u===void 0)return;if(u!==a||r!==e){if(r===e){r={};for(let c=0;c<o;c++)r[t[c][0]]=t[c][1]}r.roots=u}}break;case"version":{n--;let u=ve.Int(a);if(u===void 0)return;if(u!==a||r!==e){if(r===e){r={};for(let c=0;c<o;c++)r[t[c][0]]=t[c][1]}r.version=u}}break;default:return}}if(!(n>0))return r}},kt={toTyped:be.CarV1HeaderOrV2Pragma,toRepresentation:ve.CarV1HeaderOrV2Pragma};var ya=ot();var ii=Ue(Ge(),1);var ba=[new d(s.map,2),new d(s.string,"version"),new d(s.uint,1),new d(s.string,"roots")],va=new d(s.tag,42);async function At(e,t){let r=Et(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),o=wt(n);if(kt.toTyped(o)===void 0)throw new Error("Invalid CAR header format");if(o.version!==1&&o.version!==2||t!==void 0&&o.version!==t)throw new Error(`Invalid CAR version: ${o.version}${t!==void 0?` (expected ${t})`:""}`);if(o.version===1){if(!Array.isArray(o.roots))throw new Error("Invalid CAR header format");return o}if(o.roots!==void 0)throw new Error("Invalid CAR header format");let i=_t(await e.exactly(vt,!0));e.seek(i.dataOffset-e.pos);let a=await At(e,1);return Object.assign(a,i)}function Ee(e){let t=0;return{async upTo(r){return e.subarray(t,t+Math.min(r,e.length-t))},async exactly(r,n=!1){if(r>e.length-t)throw new Error("Unexpected end of data");let o=e.subarray(t,t+r);return n&&(t+=r),o},seek(r){t+=r},get pos(){return t}}}var Tt=Ue(Ge(),1),pn=1;function It(e){let t=mt({version:pn,roots:e}),r=Tt.default.encode(t.length),n=new Uint8Array(r.length+t.length);return n.set(r,0),n.set(t,r.length),n}function yn(e){return{async setRoots(t){let r=It(t);await e.write(r)},async writeBlock(t){let{cid:r,bytes:n}=t;await e.write(new Uint8Array(Tt.default.encode(r.bytes.length+n.length))),await e.write(r.bytes),n.length&&await e.write(n)},async close(){await e.end()},version(){return pn}}}function We(){}function mn(){let e=[],t=null,r=We,n=!1,o=null,i=We,a=()=>(t||(t=new Promise(p=>{r=()=>{t=null,r=We,p()}})),t),u={write(p){e.push(p);let h=a();return i(),h},async end(){n=!0;let p=a();i(),await p}},c={async next(){let p=e.shift();return p?(e.length===0&&r(),{done:!1,value:p}):n?(r(),{done:!0,value:void 0}):(o||(o=new Promise(h=>{i=()=>(o=null,i=We,h(c.next()))})),o)}};return{writer:u,iterator:c}}var _e=class e{constructor(t,r){this._encoder=r,this._mutex=r.setRoots(t),this._ended=!1}async put(t){if(!(t.bytes instanceof Uint8Array)||!t.cid)throw new TypeError("Can only write {cid, bytes} objects");if(this._ended)throw new Error("Already closed");let r=g.asCID(t.cid);if(!r)throw new TypeError("Can only write {cid, bytes} objects");return this._mutex=this._mutex.then(()=>this._encoder.writeBlock({cid:r,bytes:t.bytes})),this._mutex}async close(){if(this._ended)throw new Error("Already closed");return await this._mutex,this._ended=!0,this._encoder.close()}version(){return this._encoder.version()}static create(t){t=ui(t);let{encoder:r,iterator:n}=wn(),o=new e(t,r),i=new je(n);return{writer:o,out:i}}static createAppender(){let{encoder:t,iterator:r}=wn();t.setRoots=()=>Promise.resolve();let n=new e([],t),o=new je(r);return{writer:n,out:o}}static async updateRootsInBytes(t,r){let n=Ee(t);await At(n);let o=It(r);if(Number(n.pos)!==o.length)throw new Error(`updateRoots() can only overwrite a header of the same length (old header is ${n.pos} bytes, new header is ${o.length} bytes)`);return t.set(o,0),t}},je=class{constructor(t){this._iterator=t}[Symbol.asyncIterator](){if(this._iterating)throw new Error("Multiple iterator not supported");return this._iterating=!0,this._iterator}};function wn(){let e=mn(),{writer:t,iterator:r}=e;return{encoder:yn(t),iterator:r}}function ui(e){if(e===void 0)return[];if(!Array.isArray(e)){let r=g.asCID(e);if(!r)throw new TypeError("roots must be a single CID or an array of CIDs");return[r]}let t=[];for(let r of e){let n=g.asCID(r);if(!n)throw new TypeError("roots must be a single CID or an array of CIDs");t.push(n)}return t}function fi(e){return e[Symbol.asyncIterator]!=null}function di(e){if(fi(e))return(async()=>{for await(let t of e);})();for(let t of e);}var gn=di;function li(e){let[t,r]=e[Symbol.asyncIterator]!=null?[e[Symbol.asyncIterator](),Symbol.asyncIterator]:[e[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>t.next(),push:o=>{n.push(o)},next:()=>n.length>0?{done:!1,value:n.shift()}:t.next(),[r](){return this}}}var xn=li;function hi(e){return e[Symbol.asyncIterator]!=null}function pi(e,t){let r=0;if(hi(e))return async function*(){for await(let c of e)yield t(c,r++)}();let n=xn(e),{value:o,done:i}=n.next();if(i===!0)return function*(){}();let a=t(o,r++);if(typeof a.then=="function")return async function*(){yield await a;for await(let c of n)yield t(c,r++)}();let u=t;return function*(){yield a;for(let c of n)yield u(c,r++)}()}var bn=pi;function Ke({enumerable:e=!0,configurable:t=!1}={}){return{enumerable:e,configurable:t,writable:!1}}function*mi(e,t){if(t!=null&&typeof t=="object")if(Array.isArray(t))for(let[r,n]of t.entries()){let o=[...e,r],i=g.asCID(n);i!=null?yield[o.join("/"),i]:typeof n=="object"&&(yield*Ct(n,o))}else{let r=g.asCID(t);r!=null?yield[e.join("/"),r]:yield*Ct(t,e)}}function*Ct(e,t){if(e==null||e instanceof Uint8Array)return;let r=g.asCID(e);r!=null&&(yield[t.join("/"),r]);for(let[n,o]of Object.entries(e)){let i=[...t,n];yield*mi(i,o)}}function*wi(e,t){if(Array.isArray(t))for(let[r,n]of t.entries()){let o=[...e,r];yield o.join("/"),typeof n=="object"&&g.asCID(n)==null&&(yield*St(n,o))}else yield*St(t,e)}function*St(e,t){if(!(e==null||typeof e!="object"))for(let[r,n]of Object.entries(e)){let o=[...t,r];yield o.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&g.asCID(n)==null&&(yield*wi(o,n))}}function gi(e,t){let r=e;for(let[n,o]of t.entries()){if(r=r[o],r==null)throw new Error(`Object has no property at ${t.slice(0,n+1).map(a=>`[${JSON.stringify(a)}]`).join("")}`);let i=g.asCID(r);if(i!=null)return{value:i,remaining:t.slice(n+1).join("/")}}return{value:r}}var Ut=class{cid;bytes;value;asBlock;constructor({cid:t,bytes:r,value:n}){if(t==null||r==null||typeof n>"u")throw new Error("Missing required argument");this.cid=t,this.bytes=r,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:Ke(),bytes:Ke(),value:Ke(),asBlock:Ke()})}links(){return Ct(this.value,[])}tree(){return St(this.value,[])}get(t="/"){return gi(this.value,t.split("/").filter(Boolean))}};function vn({bytes:e,cid:t,value:r,codec:n}){let o=r!==void 0?r:n?.decode(e);if(o===void 0)throw new Error('Missing required argument, must either provide "value" or "codec"');return new Ut({cid:t,bytes:e,value:o})}function Bt(){let e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e}var Ot=Ue(_n(),1);var Ae=class extends Error{constructor(t){super(t),this.name="TimeoutError"}},Dt=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},kn=e=>globalThis.DOMException===void 0?new Dt(e):new DOMException(e),An=e=>{let t=e.reason===void 0?kn("This operation was aborted."):e.reason;return t instanceof Error?t:kn(t)};function Mt(e,t){let{milliseconds:r,fallback:n,message:o,customTimers:i={setTimeout,clearTimeout}}=t,a,u,p=new Promise((h,y)=>{if(typeof r!="number"||Math.sign(r)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(t.signal){let{signal:v}=t;v.aborted&&y(An(v)),u=()=>{y(An(v))},v.addEventListener("abort",u,{once:!0})}if(r===Number.POSITIVE_INFINITY){e.then(h,y);return}let P=new Ae;a=i.setTimeout.call(void 0,()=>{if(n){try{h(n())}catch(v){y(v)}return}typeof e.cancel=="function"&&e.cancel(),o===!1?h():o instanceof Error?y(o):(P.message=o??`Promise timed out after ${r} milliseconds`,y(P))},r),(async()=>{try{h(await e)}catch(v){y(v)}})()}).finally(()=>{p.clear(),u&&t.signal&&t.signal.removeEventListener("abort",u)});return p.clear=()=>{i.clearTimeout.call(void 0,a),a=void 0},p}function Rt(e,t,r){let n=0,o=e.length;for(;o>0;){let i=Math.trunc(o/2),a=n+i;r(e[a],t)<=0?(n=++a,o-=i+1):o=i}return n}var Te=class{#e=[];enqueue(t,r){r={priority:0,...r};let n={priority:r.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=r.priority){this.#e.push(n);return}let o=Rt(this.#e,n,(i,a)=>a.priority-i.priority);this.#e.splice(o,0,n)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(r=>r.priority===t.priority).map(r=>r.run)}get size(){return this.#e.length}};var Ie=class extends Ot.default{#e;#s;#i=0;#h;#a;#p=0;#r;#c;#t;#y;#n=0;#u;#o;#m;timeout;constructor(t){if(super(),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Te,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#s=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#h=t.intervalCap,this.#a=t.interval,this.#t=new t.queueClass,this.#y=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#m=t.throwOnTimeout===!0,this.#o=t.autoStart===!1}get#x(){return this.#s||this.#i<this.#h}get#b(){return this.#n<this.#u}#v(){this.#n--,this.#f(),this.emit("next")}#E(){this.#g(),this.#w(),this.#c=void 0}get#_(){let t=Date.now();if(this.#r===void 0){let r=this.#p-t;if(r<0)this.#i=this.#e?this.#n:0;else return this.#c===void 0&&(this.#c=setTimeout(()=>{this.#E()},r)),!0}return!1}#f(){if(this.#t.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#o){let t=!this.#_;if(this.#x&&this.#b){let r=this.#t.dequeue();return r?(this.emit("active"),r(),t&&this.#w(),!0):!1}}return!1}#w(){this.#s||this.#r!==void 0||(this.#r=setInterval(()=>{this.#g()},this.#a),this.#p=Date.now()+this.#a)}#g(){this.#i===0&&this.#n===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#i=this.#e?this.#n:0,this.#d()}#d(){for(;this.#f(););}get concurrency(){return this.#u}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#u=t,this.#d()}async#k(t){return new Promise((r,n)=>{t.addEventListener("abort",()=>{n(t.reason)},{once:!0})})}async add(t,r={}){return r={timeout:this.timeout,throwOnTimeout:this.#m,...r},new Promise((n,o)=>{this.#t.enqueue(async()=>{this.#n++,this.#i++;try{r.signal?.throwIfAborted();let i=t({signal:r.signal});r.timeout&&(i=Mt(Promise.resolve(i),{milliseconds:r.timeout})),r.signal&&(i=Promise.race([i,this.#k(r.signal)]));let a=await i;n(a),this.emit("completed",a)}catch(i){if(i instanceof Ae&&!r.throwOnTimeout){n();return}o(i),this.emit("error",i)}finally{this.#v()}},r),this.emit("add"),this.#f()})}async addAll(t,r){return Promise.all(t.map(async n=>this.add(n,r)))}start(){return this.#o?(this.#o=!1,this.#d(),this):this}pause(){this.#o=!0}clear(){this.#t=new this.#y}async onEmpty(){this.#t.size!==0&&await this.#l("empty")}async onSizeLessThan(t){this.#t.size<t||await this.#l("next",()=>this.#t.size<t)}async onIdle(){this.#n===0&&this.#t.size===0||await this.#l("idle")}async#l(t,r){return new Promise(n=>{let o=()=>{r&&!r()||(this.off(t,o),n())};this.on(t,o)})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#n}get isPaused(){return this.#o}};var vi=1,zt=class{components;constructor(t,r){this.components=t}async import(t,r){await gn(this.components.blockstore.putMany(bn(t.blocks(),({cid:n,bytes:o})=>({cid:n,block:o})),r))}async export(t,r,n){let o=Bt(),i=Array.isArray(t)?t:[t],a=new Ie({concurrency:vi});a.on("idle",()=>{o.resolve()}),a.on("error",u=>{a.clear(),o.reject(u)});for(let u of i)a.add(async()=>{await this.#e(u,a,async(c,p)=>{n?.blockFilter?.has(c.multihash.bytes)!==!0&&(n?.blockFilter?.add(c.multihash.bytes),await r.put({cid:c,bytes:p}))},n)}).catch(()=>{});try{await o.promise}finally{await r.close()}}async*stream(t,r){let{writer:n,out:o}=_e.create(t);this.export(t,n,r).catch(()=>{});for await(let i of o)yield i}async#e(t,r,n,o){let i=await this.components.getCodec(t.code),a=await this.components.blockstore.get(t,o);await n(t,a);let u=vn({bytes:a,cid:t,codec:i});for await(let[,c]of u.links())r.add(async()=>{await this.#e(c,r,n,o)})}};function Ei(e,t={}){return new zt(e,t)}return Nn(_i);})();
|
|
3
3
|
return HeliaCar}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helia/car",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Import/export car files from Helia",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/ipfs/helia/tree/main/packages/car#readme",
|
|
@@ -39,91 +39,6 @@
|
|
|
39
39
|
"sourceType": "module"
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
-
"release": {
|
|
43
|
-
"branches": [
|
|
44
|
-
"main"
|
|
45
|
-
],
|
|
46
|
-
"plugins": [
|
|
47
|
-
[
|
|
48
|
-
"@semantic-release/commit-analyzer",
|
|
49
|
-
{
|
|
50
|
-
"preset": "conventionalcommits",
|
|
51
|
-
"releaseRules": [
|
|
52
|
-
{
|
|
53
|
-
"breaking": true,
|
|
54
|
-
"release": "major"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"revert": true,
|
|
58
|
-
"release": "patch"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"type": "feat",
|
|
62
|
-
"release": "minor"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"type": "fix",
|
|
66
|
-
"release": "patch"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"type": "docs",
|
|
70
|
-
"release": "patch"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"type": "test",
|
|
74
|
-
"release": "patch"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"type": "deps",
|
|
78
|
-
"release": "patch"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"scope": "no-release",
|
|
82
|
-
"release": false
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
}
|
|
86
|
-
],
|
|
87
|
-
[
|
|
88
|
-
"@semantic-release/release-notes-generator",
|
|
89
|
-
{
|
|
90
|
-
"preset": "conventionalcommits",
|
|
91
|
-
"presetConfig": {
|
|
92
|
-
"types": [
|
|
93
|
-
{
|
|
94
|
-
"type": "feat",
|
|
95
|
-
"section": "Features"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"type": "fix",
|
|
99
|
-
"section": "Bug Fixes"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"type": "chore",
|
|
103
|
-
"section": "Trivial Changes"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"type": "docs",
|
|
107
|
-
"section": "Documentation"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"type": "deps",
|
|
111
|
-
"section": "Dependencies"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"type": "test",
|
|
115
|
-
"section": "Tests"
|
|
116
|
-
}
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
],
|
|
121
|
-
"@semantic-release/changelog",
|
|
122
|
-
"@semantic-release/npm",
|
|
123
|
-
"@semantic-release/github",
|
|
124
|
-
"@semantic-release/git"
|
|
125
|
-
]
|
|
126
|
-
},
|
|
127
42
|
"scripts": {
|
|
128
43
|
"clean": "aegir clean",
|
|
129
44
|
"lint": "aegir lint",
|
|
@@ -136,31 +51,30 @@
|
|
|
136
51
|
"test:firefox": "aegir test -t browser -- --browser firefox",
|
|
137
52
|
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
|
|
138
53
|
"test:node": "aegir test -t node --cov",
|
|
139
|
-
"test:electron-main": "aegir test -t electron-main"
|
|
140
|
-
"release": "aegir release"
|
|
54
|
+
"test:electron-main": "aegir test -t electron-main"
|
|
141
55
|
},
|
|
142
56
|
"dependencies": {
|
|
143
|
-
"@helia/interface": "^5.
|
|
144
|
-
"@ipld/car": "^5.3.
|
|
145
|
-
"@libp2p/interface": "^2.
|
|
146
|
-
"@libp2p/utils": "^6.
|
|
147
|
-
"interface-blockstore": "^5.
|
|
148
|
-
"it-drain": "^3.0.
|
|
149
|
-
"it-map": "^3.
|
|
150
|
-
"multiformats": "^13.1
|
|
151
|
-
"p-defer": "^4.0.
|
|
57
|
+
"@helia/interface": "^5.2.0",
|
|
58
|
+
"@ipld/car": "^5.3.3",
|
|
59
|
+
"@libp2p/interface": "^2.2.1",
|
|
60
|
+
"@libp2p/utils": "^6.2.1",
|
|
61
|
+
"interface-blockstore": "^5.3.1",
|
|
62
|
+
"it-drain": "^3.0.7",
|
|
63
|
+
"it-map": "^3.1.1",
|
|
64
|
+
"multiformats": "^13.3.1",
|
|
65
|
+
"p-defer": "^4.0.1",
|
|
152
66
|
"p-queue": "^8.0.1",
|
|
153
|
-
"progress-events": "^1.0.
|
|
67
|
+
"progress-events": "^1.0.1"
|
|
154
68
|
},
|
|
155
69
|
"devDependencies": {
|
|
156
|
-
"@helia/mfs": "^4.0.
|
|
157
|
-
"@helia/unixfs": "^4.0.
|
|
158
|
-
"@ipld/dag-pb": "^4.1.
|
|
159
|
-
"aegir": "^45.0.
|
|
160
|
-
"blockstore-core": "^5.0.
|
|
161
|
-
"datastore-core": "^10.0.
|
|
162
|
-
"ipfs-unixfs-importer": "^15.
|
|
163
|
-
"it-to-buffer": "^4.0.
|
|
70
|
+
"@helia/mfs": "^4.0.2",
|
|
71
|
+
"@helia/unixfs": "^4.0.2",
|
|
72
|
+
"@ipld/dag-pb": "^4.1.3",
|
|
73
|
+
"aegir": "^45.0.6",
|
|
74
|
+
"blockstore-core": "^5.0.2",
|
|
75
|
+
"datastore-core": "^10.0.2",
|
|
76
|
+
"ipfs-unixfs-importer": "^15.3.1",
|
|
77
|
+
"it-to-buffer": "^4.0.7"
|
|
164
78
|
},
|
|
165
79
|
"sideEffects": false
|
|
166
80
|
}
|
package/LICENSE
DELETED