ipfs-unixfs
Advanced tools
Comparing version 11.0.1 to 11.0.2
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.IpfsUnixfs = factory()}(typeof self !== 'undefined' ? self : this, function () { | ||
"use strict";var IpfsUnixfs=(()=>{var ue=Object.create;var C=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var fe=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var y=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),he=(r,t)=>{for(var e in t)C(r,e,{get:t[e],enumerable:!0})},ct=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ce(t))!le.call(r,n)&&n!==e&&C(r,n,{get:()=>t[n],enumerable:!(i=ae(t,n))||i.enumerable});return r};var D=(r,t,e)=>(e=r!=null?ue(fe(r)):{},ct(t||!r||!r.__esModule?C(e,"default",{value:r,enumerable:!0}):e,r)),de=r=>ct(C({},"__esModule",{value:!0}),r);var ht=y((De,lt)=>{"use strict";function ft(r,t){for(let e in t)Object.defineProperty(r,e,{value:t[e],enumerable:!0,configurable:!0});return r}function pe(r,t,e){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");e||(e={}),typeof t=="object"&&(e=t,t=""),t&&(e.code=t);try{return ft(r,e)}catch{e.message=r.message,e.stack=r.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(r)),ft(new n,e)}}lt.exports=pe});var pt=y((Me,dt)=>{"use strict";dt.exports=ye;function ye(r,t){for(var e=new Array(arguments.length-1),i=0,n=2,o=!0;n<arguments.length;)e[i++]=arguments[n++];return new Promise(function(c,s){e[i]=function(l){if(o)if(o=!1,l)s(l);else{for(var m=new Array(arguments.length-1),x=0;x<m.length;)m[x++]=arguments[x];c.apply(null,m)}};try{r.apply(t||null,e)}catch(a){o&&(o=!1,s(a))}})}});var _t=y(gt=>{"use strict";var H=gt;H.length=function(t){var e=t.length;if(!e)return 0;for(var i=0;--e%4>1&&t.charAt(e)==="=";)++i;return Math.ceil(t.length*3)/4-i};var M=new Array(64),mt=new Array(123);for(_=0;_<64;)mt[M[_]=_<26?_+65:_<52?_+71:_<62?_-4:_-59|43]=_++;var _;H.encode=function(t,e,i){for(var n=null,o=[],u=0,c=0,s;e<i;){var a=t[e++];switch(c){case 0:o[u++]=M[a>>2],s=(a&3)<<4,c=1;break;case 1:o[u++]=M[s|a>>4],s=(a&15)<<2,c=2;break;case 2:o[u++]=M[s|a>>6],o[u++]=M[a&63],c=0;break}u>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),u=0)}return c&&(o[u++]=M[s],o[u++]=61,c===1&&(o[u++]=61)),n?(u&&n.push(String.fromCharCode.apply(String,o.slice(0,u))),n.join("")):String.fromCharCode.apply(String,o.slice(0,u))};var yt="invalid encoding";H.decode=function(t,e,i){for(var n=i,o=0,u,c=0;c<t.length;){var s=t.charCodeAt(c++);if(s===61&&o>1)break;if((s=mt[s])===void 0)throw Error(yt);switch(o){case 0:u=s,o=1;break;case 1:e[i++]=u<<2|(s&48)>>4,u=s,o=2;break;case 2:e[i++]=(u&15)<<4|(s&60)>>2,u=s,o=3;break;case 3:e[i++]=(u&3)<<6|s,o=0;break}}if(o===1)throw Error(yt);return i-n};H.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var bt=y((Te,wt)=>{"use strict";wt.exports=q;function q(){this._listeners={}}q.prototype.on=function(t,e,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:i||this}),this};q.prototype.off=function(t,e){if(t===void 0)this._listeners={};else if(e===void 0)this._listeners[t]=[];else for(var i=this._listeners[t],n=0;n<i.length;)i[n].fn===e?i.splice(n,1):++n;return this};q.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var i=[],n=1;n<arguments.length;)i.push(arguments[n++]);for(n=0;n<e.length;)e[n].fn.apply(e[n++].ctx,i)}return this}});var Ft=y((ze,At)=>{"use strict";At.exports=kt(kt);function kt(r){return typeof Float32Array<"u"?function(){var t=new Float32Array([-0]),e=new Uint8Array(t.buffer),i=e[3]===128;function n(s,a,l){t[0]=s,a[l]=e[0],a[l+1]=e[1],a[l+2]=e[2],a[l+3]=e[3]}function o(s,a,l){t[0]=s,a[l]=e[3],a[l+1]=e[2],a[l+2]=e[1],a[l+3]=e[0]}r.writeFloatLE=i?n:o,r.writeFloatBE=i?o:n;function u(s,a){return e[0]=s[a],e[1]=s[a+1],e[2]=s[a+2],e[3]=s[a+3],t[0]}function c(s,a){return e[3]=s[a],e[2]=s[a+1],e[1]=s[a+2],e[0]=s[a+3],t[0]}r.readFloatLE=i?u:c,r.readFloatBE=i?c:u}():function(){function t(i,n,o,u){var c=n<0?1:0;if(c&&(n=-n),n===0)i(1/n>0?0:2147483648,o,u);else if(isNaN(n))i(2143289344,o,u);else if(n>34028234663852886e22)i((c<<31|2139095040)>>>0,o,u);else if(n<11754943508222875e-54)i((c<<31|Math.round(n/1401298464324817e-60))>>>0,o,u);else{var s=Math.floor(Math.log(n)/Math.LN2),a=Math.round(n*Math.pow(2,-s)*8388608)&8388607;i((c<<31|s+127<<23|a)>>>0,o,u)}}r.writeFloatLE=t.bind(null,Bt),r.writeFloatBE=t.bind(null,Et);function e(i,n,o){var u=i(n,o),c=(u>>31)*2+1,s=u>>>23&255,a=u&8388607;return s===255?a?NaN:c*(1/0):s===0?c*1401298464324817e-60*a:c*Math.pow(2,s-150)*(a+8388608)}r.readFloatLE=e.bind(null,St),r.readFloatBE=e.bind(null,xt)}(),typeof Float64Array<"u"?function(){var t=new Float64Array([-0]),e=new Uint8Array(t.buffer),i=e[7]===128;function n(s,a,l){t[0]=s,a[l]=e[0],a[l+1]=e[1],a[l+2]=e[2],a[l+3]=e[3],a[l+4]=e[4],a[l+5]=e[5],a[l+6]=e[6],a[l+7]=e[7]}function o(s,a,l){t[0]=s,a[l]=e[7],a[l+1]=e[6],a[l+2]=e[5],a[l+3]=e[4],a[l+4]=e[3],a[l+5]=e[2],a[l+6]=e[1],a[l+7]=e[0]}r.writeDoubleLE=i?n:o,r.writeDoubleBE=i?o:n;function u(s,a){return e[0]=s[a],e[1]=s[a+1],e[2]=s[a+2],e[3]=s[a+3],e[4]=s[a+4],e[5]=s[a+5],e[6]=s[a+6],e[7]=s[a+7],t[0]}function c(s,a){return e[7]=s[a],e[6]=s[a+1],e[5]=s[a+2],e[4]=s[a+3],e[3]=s[a+4],e[2]=s[a+5],e[1]=s[a+6],e[0]=s[a+7],t[0]}r.readDoubleLE=i?u:c,r.readDoubleBE=i?c:u}():function(){function t(i,n,o,u,c,s){var a=u<0?1:0;if(a&&(u=-u),u===0)i(0,c,s+n),i(1/u>0?0:2147483648,c,s+o);else if(isNaN(u))i(0,c,s+n),i(2146959360,c,s+o);else if(u>17976931348623157e292)i(0,c,s+n),i((a<<31|2146435072)>>>0,c,s+o);else{var l;if(u<22250738585072014e-324)l=u/5e-324,i(l>>>0,c,s+n),i((a<<31|l/4294967296)>>>0,c,s+o);else{var m=Math.floor(Math.log(u)/Math.LN2);m===1024&&(m=1023),l=u*Math.pow(2,-m),i(l*4503599627370496>>>0,c,s+n),i((a<<31|m+1023<<20|l*1048576&1048575)>>>0,c,s+o)}}}r.writeDoubleLE=t.bind(null,Bt,0,4),r.writeDoubleBE=t.bind(null,Et,4,0);function e(i,n,o,u,c){var s=i(u,c+n),a=i(u,c+o),l=(a>>31)*2+1,m=a>>>20&2047,x=4294967296*(a&1048575)+s;return m===2047?x?NaN:l*(1/0):m===0?l*5e-324*x:l*Math.pow(2,m-1075)*(x+4503599627370496)}r.readDoubleLE=e.bind(null,St,0,4),r.readDoubleBE=e.bind(null,xt,4,0)}(),r}function Bt(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}function Et(r,t,e){t[e]=r>>>24,t[e+1]=r>>>16&255,t[e+2]=r>>>8&255,t[e+3]=r&255}function St(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24)>>>0}function xt(r,t){return(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3])>>>0}});var Lt=y((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var Mt=y(Dt=>{"use strict";var $=Dt;$.length=function(t){for(var e=0,i=0,n=0;n<t.length;++n)i=t.charCodeAt(n),i<128?e+=1:i<2048?e+=2:(i&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e};$.read=function(t,e,i){var n=i-e;if(n<1)return"";for(var o=null,u=[],c=0,s;e<i;)s=t[e++],s<128?u[c++]=s:s>191&&s<224?u[c++]=(s&31)<<6|t[e++]&63:s>239&&s<365?(s=((s&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,u[c++]=55296+(s>>10),u[c++]=56320+(s&1023)):u[c++]=(s&15)<<12|(t[e++]&63)<<6|t[e++]&63,c>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,u)),c=0);return o?(c&&o.push(String.fromCharCode.apply(String,u.slice(0,c))),o.join("")):String.fromCharCode.apply(String,u.slice(0,c))};$.write=function(t,e,i){for(var n=i,o,u,c=0;c<t.length;++c)o=t.charCodeAt(c),o<128?e[i++]=o:o<2048?(e[i++]=o>>6|192,e[i++]=o&63|128):(o&64512)===55296&&((u=t.charCodeAt(c+1))&64512)===56320?(o=65536+((o&1023)<<10)+(u&1023),++c,e[i++]=o>>18|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128,e[i++]=o&63|128):(e[i++]=o>>12|224,e[i++]=o>>6&63|128,e[i++]=o&63|128);return i-n}});var Tt=y((Ie,vt)=>{"use strict";vt.exports=me;function me(r,t,e){var i=e||8192,n=i>>>1,o=null,u=i;return function(s){if(s<1||s>n)return r(s);u+s>i&&(o=r(i),u=0);var a=t.call(o,u,u+=s);return u&7&&(u=(u|7)+1),a}}});var Nt=y((Re,zt)=>{"use strict";zt.exports=p;var T=F();function p(r,t){this.lo=r>>>0,this.hi=t>>>0}var A=p.zero=new p(0,0);A.toNumber=function(){return 0};A.zzEncode=A.zzDecode=function(){return this};A.length=function(){return 1};var ge=p.zeroHash="\0\0\0\0\0\0\0\0";p.fromNumber=function(t){if(t===0)return A;var e=t<0;e&&(t=-t);var i=t>>>0,n=(t-i)/4294967296>>>0;return e&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new p(i,n)};p.from=function(t){if(typeof t=="number")return p.fromNumber(t);if(T.isString(t))if(T.Long)t=T.Long.fromString(t);else return p.fromNumber(parseInt(t,10));return t.low||t.high?new p(t.low>>>0,t.high>>>0):A};p.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=~this.lo+1>>>0,i=~this.hi>>>0;return e||(i=i+1>>>0),-(e+i*4294967296)}return this.lo+this.hi*4294967296};p.prototype.toLong=function(t){return T.Long?new T.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}};var E=String.prototype.charCodeAt;p.fromHash=function(t){return t===ge?A:new p((E.call(t,0)|E.call(t,1)<<8|E.call(t,2)<<16|E.call(t,3)<<24)>>>0,(E.call(t,4)|E.call(t,5)<<8|E.call(t,6)<<16|E.call(t,7)<<24)>>>0)};p.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};p.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};p.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};p.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?e===0?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:i<128?9:10}});var F=y(j=>{"use strict";var f=j;f.asPromise=pt();f.base64=_t();f.EventEmitter=bt();f.float=Ft();f.inquire=Lt();f.utf8=Mt();f.pool=Tt();f.LongBits=Nt();f.isNode=!!(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);f.global=f.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||j;f.emptyArray=Object.freeze?Object.freeze([]):[];f.emptyObject=Object.freeze?Object.freeze({}):{};f.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};f.isString=function(t){return typeof t=="string"||t instanceof String};f.isObject=function(t){return t&&typeof t=="object"};f.isset=f.isSet=function(t,e){var i=t[e];return i!=null&&t.hasOwnProperty(e)?typeof i!="object"||(Array.isArray(i)?i.length:Object.keys(i).length)>0:!1};f.Buffer=function(){try{var r=f.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();f._Buffer_from=null;f._Buffer_allocUnsafe=null;f.newBuffer=function(t){return typeof t=="number"?f.Buffer?f._Buffer_allocUnsafe(t):new f.Array(t):f.Buffer?f._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)};f.Array=typeof Uint8Array<"u"?Uint8Array:Array;f.Long=f.global.dcodeIO&&f.global.dcodeIO.Long||f.global.Long||f.inquire("long");f.key2Re=/^true|false|0|1$/;f.key32Re=/^-?(?:0|[1-9][0-9]*)$/;f.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;f.longToHash=function(t){return t?f.LongBits.from(t).toHash():f.LongBits.zeroHash};f.longFromHash=function(t,e){var i=f.LongBits.fromHash(t);return f.Long?f.Long.fromBits(i.lo,i.hi,e):i.toNumber(!!e)};function It(r,t,e){for(var i=Object.keys(t),n=0;n<i.length;++n)(r[i[n]]===void 0||!e)&&(r[i[n]]=t[i[n]]);return r}f.merge=It;f.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)};function Rt(r){function t(e,i){if(!(this instanceof t))return new t(e,i);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:new Error().stack||""}),i&&It(this,i)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}f.newError=Rt;f.ProtocolError=Rt("ProtocolError");f.oneOfGetter=function(t){for(var e={},i=0;i<t.length;++i)e[t[i]]=1;return function(){for(var n=Object.keys(this),o=n.length-1;o>-1;--o)if(e[n[o]]===1&&this[n[o]]!==void 0&&this[n[o]]!==null)return n[o]}};f.oneOfSetter=function(t){return function(e){for(var i=0;i<t.length;++i)t[i]!==e&&delete this[t[i]]}};f.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};f._configure=function(){var r=f.Buffer;if(!r){f._Buffer_from=f._Buffer_allocUnsafe=null;return}f._Buffer_from=r.from!==Uint8Array.from&&r.from||function(e,i){return new r(e,i)},f._Buffer_allocUnsafe=r.allocUnsafe||function(e){return new r(e)}}});var V=y((Ce,Pt)=>{"use strict";Pt.exports=d;var k=F(),J,Ht=k.LongBits,_e=k.utf8;function w(r,t){return RangeError("index out of range: "+r.pos+" + "+(t||1)+" > "+r.len)}function d(r){this.buf=r,this.pos=0,this.len=r.length}var Ot=typeof Uint8Array<"u"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new d(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new d(t);throw Error("illegal buffer")},qt=function(){return k.Buffer?function(e){return(d.create=function(n){return k.Buffer.isBuffer(n)?new J(n):Ot(n)})(e)}:Ot};d.create=qt();d.prototype._slice=k.Array.prototype.subarray||k.Array.prototype.slice;d.prototype.uint32=function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,w(this,10);return t}}();d.prototype.int32=function(){return this.uint32()|0};d.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function Z(){var r=new Ht(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw w(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,r}if(this.len-this.pos>4){for(;t<5;++t)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;t<5;++t){if(this.pos>=this.len)throw w(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}d.prototype.bool=function(){return this.uint32()!==0};function P(r,t){return(r[t-4]|r[t-3]<<8|r[t-2]<<16|r[t-1]<<24)>>>0}d.prototype.fixed32=function(){if(this.pos+4>this.len)throw w(this,4);return P(this.buf,this.pos+=4)};d.prototype.sfixed32=function(){if(this.pos+4>this.len)throw w(this,4);return P(this.buf,this.pos+=4)|0};function Ct(){if(this.pos+8>this.len)throw w(this,8);return new Ht(P(this.buf,this.pos+=4),P(this.buf,this.pos+=4))}d.prototype.float=function(){if(this.pos+4>this.len)throw w(this,4);var t=k.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};d.prototype.double=function(){if(this.pos+8>this.len)throw w(this,4);var t=k.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};d.prototype.bytes=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw w(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,i):e===i?new this.buf.constructor(0):this._slice.call(this.buf,e,i)};d.prototype.string=function(){var t=this.bytes();return _e.read(t,0,t.length)};d.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw w(this,t);this.pos+=t}else do if(this.pos>=this.len)throw w(this);while(this.buf[this.pos++]&128);return this};d.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};d._configure=function(r){J=r,d.create=qt(),J._configure();var t=k.Long?"toLong":"toNumber";k.merge(d.prototype,{int64:function(){return Z.call(this)[t](!1)},uint64:function(){return Z.call(this)[t](!0)},sint64:function(){return Z.call(this).zzDecode()[t](!1)},fixed64:function(){return Ct.call(this)[t](!0)},sfixed64:function(){return Ct.call(this)[t](!1)}})}});var $t=y((He,Gt)=>{"use strict";Gt.exports=L;var Ut=V();(L.prototype=Object.create(Ut.prototype)).constructor=L;var Wt=F();function L(r){Ut.call(this,r)}L._configure=function(){Wt.Buffer&&(L.prototype._slice=Wt.Buffer.prototype.slice)};L.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};L._configure()});var rt=y((qe,Vt)=>{"use strict";Vt.exports=h;var g=F(),X,W=g.LongBits,jt=g.base64,Zt=g.utf8;function z(r,t,e){this.fn=r,this.len=t,this.next=void 0,this.val=e}function Q(){}function we(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function h(){this.len=0,this.head=new z(Q,0,0),this.tail=this.head,this.states=null}var Jt=function(){return g.Buffer?function(){return(h.create=function(){return new X})()}:function(){return new h}};h.create=Jt();h.alloc=function(t){return new g.Array(t)};g.Array!==Array&&(h.alloc=g.pool(h.alloc,g.Array.prototype.subarray));h.prototype._push=function(t,e,i){return this.tail=this.tail.next=new z(t,e,i),this.len+=e,this};function Y(r,t,e){t[e]=r&255}function be(r,t,e){for(;r>127;)t[e++]=r&127|128,r>>>=7;t[e]=r}function tt(r,t){this.len=r,this.next=void 0,this.val=t}tt.prototype=Object.create(z.prototype);tt.prototype.fn=be;h.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new tt((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};h.prototype.int32=function(t){return t<0?this._push(et,10,W.fromNumber(t)):this.uint32(t)};h.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function et(r,t,e){for(;r.hi;)t[e++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)t[e++]=r.lo&127|128,r.lo=r.lo>>>7;t[e++]=r.lo}h.prototype.uint64=function(t){var e=W.from(t);return this._push(et,e.length(),e)};h.prototype.int64=h.prototype.uint64;h.prototype.sint64=function(t){var e=W.from(t).zzEncode();return this._push(et,e.length(),e)};h.prototype.bool=function(t){return this._push(Y,1,t?1:0)};function K(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}h.prototype.fixed32=function(t){return this._push(K,4,t>>>0)};h.prototype.sfixed32=h.prototype.fixed32;h.prototype.fixed64=function(t){var e=W.from(t);return this._push(K,4,e.lo)._push(K,4,e.hi)};h.prototype.sfixed64=h.prototype.fixed64;h.prototype.float=function(t){return this._push(g.float.writeFloatLE,4,t)};h.prototype.double=function(t){return this._push(g.float.writeDoubleLE,8,t)};var ke=g.Array.prototype.set?function(t,e,i){e.set(t,i)}:function(t,e,i){for(var n=0;n<t.length;++n)e[i+n]=t[n]};h.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(Y,1,0);if(g.isString(t)){var i=h.alloc(e=jt.length(t));jt.decode(t,i,0),t=i}return this.uint32(e)._push(ke,e,t)};h.prototype.string=function(t){var e=Zt.length(t);return e?this.uint32(e)._push(Zt.write,e,t):this._push(Y,1,0)};h.prototype.fork=function(){return this.states=new we(this),this.head=this.tail=new z(Q,0,0),this.len=0,this};h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new z(Q,0,0),this.len=0),this};h.prototype.ldelim=function(){var t=this.head,e=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=e,this.len+=i),this};h.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,e,i),i+=t.len,t=t.next;return e};h._configure=function(r){X=r,h.create=Jt(),X._configure()}});var Qt=y((Pe,Kt)=>{"use strict";Kt.exports=B;var Xt=rt();(B.prototype=Object.create(Xt.prototype)).constructor=B;var S=F();function B(){Xt.call(this)}B._configure=function(){B.alloc=S._Buffer_allocUnsafe,B.writeBytesBuffer=S.Buffer&&S.Buffer.prototype instanceof Uint8Array&&S.Buffer.prototype.set.name==="set"?function(t,e,i){e.set(t,i)}:function(t,e,i){if(t.copy)t.copy(e,i,0,t.length);else for(var n=0;n<t.length;)e[i++]=t[n++]}};B.prototype.bytes=function(t){S.isString(t)&&(t=S._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(B.writeBytesBuffer,e,t),this};function Be(r,t,e){r.length<40?S.utf8.write(r,t,e):t.utf8Write?t.utf8Write(r,e):t.write(r,e)}B.prototype.string=function(t){var e=S.Buffer.byteLength(t);return this.uint32(e),e&&this._push(Be,e,t),this};B._configure()});var Fe={};he(Fe,{UnixFS:()=>O});var at=D(ht(),1);var it=D(V(),1),Yt=D($t(),1),te=D(F(),1),nt=D(rt(),1),ee=D(Qt(),1);function Ee(){te.default._configure(),it.default._configure(Yt.default),nt.default._configure(ee.default)}Ee();var re=["uint64","int64","sint64","fixed64","sfixed64"];function Se(r){for(let t of re){if(r[t]==null)continue;let e=r[t];r[t]=function(){return BigInt(e.call(this).toString())}}return r}function ot(r){return Se(new it.default(r))}function xe(r){for(let t of re){if(r[t]==null)continue;let e=r[t];r[t]=function(i){return e.call(this,i.toString())}}return r}function st(){return xe(nt.default.create())}function N(r,t){let e=ot(r instanceof Uint8Array?r:r.subarray());return t.decode(e)}function I(r,t){let e=st();return t.encode(r,e,{lengthDelimited:!1}),e.finish()}var v;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(v||(v={}));function U(r,t,e,i){return{name:r,type:t,encode:e,decode:i}}function ut(r){function t(n){if(r[n.toString()]==null)throw new Error("Invalid enum value");return r[n]}let e=function(o,u){let c=t(o);u.int32(c)},i=function(o){let u=o.int32();return t(u)};return U("enum",v.VARINT,e,i)}function R(r,t){return U("message",v.LENGTH_DELIMITED,r,t)}var b;(function(r){let t;(function(n){n.Raw="Raw",n.Directory="Directory",n.File="File",n.Metadata="Metadata",n.Symlink="Symlink",n.HAMTShard="HAMTShard"})(t=r.DataType||(r.DataType={}));let e;(function(n){n[n.Raw=0]="Raw",n[n.Directory=1]="Directory",n[n.File=2]="File",n[n.Metadata=3]="Metadata",n[n.Symlink=4]="Symlink",n[n.HAMTShard=5]="HAMTShard"})(e||(e={})),function(n){n.codec=()=>ut(e)}(t=r.DataType||(r.DataType={}));let i;r.codec=()=>(i==null&&(i=R((n,o,u={})=>{if(u.lengthDelimited!==!1&&o.fork(),n.Type!=null&&(o.uint32(8),r.DataType.codec().encode(n.Type,o)),n.Data!=null&&(o.uint32(18),o.bytes(n.Data)),n.filesize!=null&&(o.uint32(24),o.uint64(n.filesize)),n.blocksizes!=null)for(let c of n.blocksizes)o.uint32(32),o.uint64(c);n.hashType!=null&&(o.uint32(40),o.uint64(n.hashType)),n.fanout!=null&&(o.uint32(48),o.uint64(n.fanout)),n.mode!=null&&(o.uint32(56),o.uint32(n.mode)),n.mtime!=null&&(o.uint32(66),G.codec().encode(n.mtime,o)),u.lengthDelimited!==!1&&o.ldelim()},(n,o)=>{let u={blocksizes:[]},c=o==null?n.len:n.pos+o;for(;n.pos<c;){let s=n.uint32();switch(s>>>3){case 1:u.Type=r.DataType.codec().decode(n);break;case 2:u.Data=n.bytes();break;case 3:u.filesize=n.uint64();break;case 4:u.blocksizes.push(n.uint64());break;case 5:u.hashType=n.uint64();break;case 6:u.fanout=n.uint64();break;case 7:u.mode=n.uint32();break;case 8:u.mtime=G.codec().decode(n,n.uint32());break;default:n.skipType(s&7);break}}return u})),i),r.encode=n=>I(n,r.codec()),r.decode=n=>N(n,r.codec())})(b||(b={}));var G;(function(r){let t;r.codec=()=>(t==null&&(t=R((e,i,n={})=>{n.lengthDelimited!==!1&&i.fork(),e.Seconds!=null&&(i.uint32(8),i.int64(e.Seconds)),e.FractionalNanoseconds!=null&&(i.uint32(21),i.fixed32(e.FractionalNanoseconds)),n.lengthDelimited!==!1&&i.ldelim()},(e,i)=>{let n={},o=i==null?e.len:e.pos+i;for(;e.pos<o;){let u=e.uint32();switch(u>>>3){case 1:n.Seconds=e.int64();break;case 2:n.FractionalNanoseconds=e.fixed32();break;default:e.skipType(u&7);break}}return n})),t),r.encode=e=>I(e,r.codec()),r.decode=e=>N(e,r.codec())})(G||(G={}));var ie;(function(r){let t;r.codec=()=>(t==null&&(t=R((e,i,n={})=>{n.lengthDelimited!==!1&&i.fork(),e.MimeType!=null&&(i.uint32(10),i.string(e.MimeType)),n.lengthDelimited!==!1&&i.ldelim()},(e,i)=>{let n={},o=i==null?e.len:e.pos+i;for(;e.pos<o;){let u=e.uint32();switch(u>>>3){case 1:n.MimeType=e.string();break;default:e.skipType(u&7);break}}return n})),t),r.encode=e=>I(e,r.codec()),r.decode=e=>N(e,r.codec())})(ie||(ie={}));var ne={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},Ae=["directory","hamt-sharded-directory"],oe=parseInt("0644",8),se=parseInt("0755",8),O=class{static unmarshal(t){let e=b.decode(t),i=new O({type:ne[e.Type!=null?e.Type.toString():"File"],data:e.Data,blockSizes:e.blocksizes,mode:e.mode,mtime:e.mtime!=null?{secs:e.mtime.Seconds??0n,nsecs:e.mtime.FractionalNanoseconds}:void 0});return i._originalMode=e.mode??0,i}type;data;blockSizes;hashType;fanout;mtime;_mode;_originalMode;constructor(t={type:"file"}){let{type:e,data:i,blockSizes:n,hashType:o,fanout:u,mtime:c,mode:s}=t;if(e!=null&&!Object.values(ne).includes(e))throw(0,at.default)(new Error("Type: "+e+" is not valid"),"ERR_INVALID_TYPE");this.type=e??"file",this.data=i,this.hashType=o,this.fanout=u,this.blockSizes=n??[],this._originalMode=0,this.mode=s,this.mtime=c}set mode(t){t==null?this._mode=this.isDirectory()?se:oe:this._mode=t&4095}get mode(){return this._mode}isDirectory(){return Ae.includes(this.type)}addBlockSize(t){this.blockSizes.push(t)}removeBlockSize(t){this.blockSizes.splice(t,1)}fileSize(){if(this.isDirectory())return 0n;let t=0n;return this.blockSizes.forEach(e=>{t+=e}),this.data!=null&&(t+=BigInt(this.data.length)),t}marshal(){let t;switch(this.type){case"raw":t=b.DataType.Raw;break;case"directory":t=b.DataType.Directory;break;case"file":t=b.DataType.File;break;case"metadata":t=b.DataType.Metadata;break;case"symlink":t=b.DataType.Symlink;break;case"hamt-sharded-directory":t=b.DataType.HAMTShard;break;default:throw(0,at.default)(new Error(`Type: ${t} is not valid`),"ERR_INVALID_TYPE")}let e=this.data;(this.data==null||this.data.length===0)&&(e=void 0);let i;this.mode!=null&&(i=this._originalMode&4294963200|(this.mode??0),i===oe&&!this.isDirectory()&&(i=void 0),i===se&&this.isDirectory()&&(i=void 0));let n;return this.mtime!=null&&(n={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),b.encode({Type:t,Data:e,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:i,mtime:n})}};return de(Fe);})(); | ||
"use strict";var IpfsUnixfs=(()=>{var ue=Object.create;var O=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var fe=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var y=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),he=(r,t)=>{for(var e in t)O(r,e,{get:t[e],enumerable:!0})},ct=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ce(t))!le.call(r,n)&&n!==e&&O(r,n,{get:()=>t[n],enumerable:!(i=ae(t,n))||i.enumerable});return r};var D=(r,t,e)=>(e=r!=null?ue(fe(r)):{},ct(t||!r||!r.__esModule?O(e,"default",{value:r,enumerable:!0}):e,r)),de=r=>ct(O({},"__esModule",{value:!0}),r);var ht=y((De,lt)=>{"use strict";function ft(r,t){for(let e in t)Object.defineProperty(r,e,{value:t[e],enumerable:!0,configurable:!0});return r}function pe(r,t,e){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");e||(e={}),typeof t=="object"&&(e=t,t=""),t&&(e.code=t);try{return ft(r,e)}catch{e.message=r.message,e.stack=r.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(r)),ft(new n,e)}}lt.exports=pe});var pt=y((Me,dt)=>{"use strict";dt.exports=ye;function ye(r,t){for(var e=new Array(arguments.length-1),i=0,n=2,o=!0;n<arguments.length;)e[i++]=arguments[n++];return new Promise(function(c,s){e[i]=function(l){if(o)if(o=!1,l)s(l);else{for(var m=new Array(arguments.length-1),x=0;x<m.length;)m[x++]=arguments[x];c.apply(null,m)}};try{r.apply(t||null,e)}catch(a){o&&(o=!1,s(a))}})}});var _t=y(gt=>{"use strict";var C=gt;C.length=function(t){var e=t.length;if(!e)return 0;for(var i=0;--e%4>1&&t.charAt(e)==="=";)++i;return Math.ceil(t.length*3)/4-i};var M=new Array(64),mt=new Array(123);for(_=0;_<64;)mt[M[_]=_<26?_+65:_<52?_+71:_<62?_-4:_-59|43]=_++;var _;C.encode=function(t,e,i){for(var n=null,o=[],u=0,c=0,s;e<i;){var a=t[e++];switch(c){case 0:o[u++]=M[a>>2],s=(a&3)<<4,c=1;break;case 1:o[u++]=M[s|a>>4],s=(a&15)<<2,c=2;break;case 2:o[u++]=M[s|a>>6],o[u++]=M[a&63],c=0;break}u>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),u=0)}return c&&(o[u++]=M[s],o[u++]=61,c===1&&(o[u++]=61)),n?(u&&n.push(String.fromCharCode.apply(String,o.slice(0,u))),n.join("")):String.fromCharCode.apply(String,o.slice(0,u))};var yt="invalid encoding";C.decode=function(t,e,i){for(var n=i,o=0,u,c=0;c<t.length;){var s=t.charCodeAt(c++);if(s===61&&o>1)break;if((s=mt[s])===void 0)throw Error(yt);switch(o){case 0:u=s,o=1;break;case 1:e[i++]=u<<2|(s&48)>>4,u=s,o=2;break;case 2:e[i++]=(u&15)<<4|(s&60)>>2,u=s,o=3;break;case 3:e[i++]=(u&3)<<6|s,o=0;break}}if(o===1)throw Error(yt);return i-n};C.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var bt=y((Te,wt)=>{"use strict";wt.exports=H;function H(){this._listeners={}}H.prototype.on=function(t,e,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:i||this}),this};H.prototype.off=function(t,e){if(t===void 0)this._listeners={};else if(e===void 0)this._listeners[t]=[];else for(var i=this._listeners[t],n=0;n<i.length;)i[n].fn===e?i.splice(n,1):++n;return this};H.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var i=[],n=1;n<arguments.length;)i.push(arguments[n++]);for(n=0;n<e.length;)e[n].fn.apply(e[n++].ctx,i)}return this}});var Ft=y((ze,At)=>{"use strict";At.exports=kt(kt);function kt(r){return typeof Float32Array<"u"?function(){var t=new Float32Array([-0]),e=new Uint8Array(t.buffer),i=e[3]===128;function n(s,a,l){t[0]=s,a[l]=e[0],a[l+1]=e[1],a[l+2]=e[2],a[l+3]=e[3]}function o(s,a,l){t[0]=s,a[l]=e[3],a[l+1]=e[2],a[l+2]=e[1],a[l+3]=e[0]}r.writeFloatLE=i?n:o,r.writeFloatBE=i?o:n;function u(s,a){return e[0]=s[a],e[1]=s[a+1],e[2]=s[a+2],e[3]=s[a+3],t[0]}function c(s,a){return e[3]=s[a],e[2]=s[a+1],e[1]=s[a+2],e[0]=s[a+3],t[0]}r.readFloatLE=i?u:c,r.readFloatBE=i?c:u}():function(){function t(i,n,o,u){var c=n<0?1:0;if(c&&(n=-n),n===0)i(1/n>0?0:2147483648,o,u);else if(isNaN(n))i(2143289344,o,u);else if(n>34028234663852886e22)i((c<<31|2139095040)>>>0,o,u);else if(n<11754943508222875e-54)i((c<<31|Math.round(n/1401298464324817e-60))>>>0,o,u);else{var s=Math.floor(Math.log(n)/Math.LN2),a=Math.round(n*Math.pow(2,-s)*8388608)&8388607;i((c<<31|s+127<<23|a)>>>0,o,u)}}r.writeFloatLE=t.bind(null,Bt),r.writeFloatBE=t.bind(null,Et);function e(i,n,o){var u=i(n,o),c=(u>>31)*2+1,s=u>>>23&255,a=u&8388607;return s===255?a?NaN:c*(1/0):s===0?c*1401298464324817e-60*a:c*Math.pow(2,s-150)*(a+8388608)}r.readFloatLE=e.bind(null,St),r.readFloatBE=e.bind(null,xt)}(),typeof Float64Array<"u"?function(){var t=new Float64Array([-0]),e=new Uint8Array(t.buffer),i=e[7]===128;function n(s,a,l){t[0]=s,a[l]=e[0],a[l+1]=e[1],a[l+2]=e[2],a[l+3]=e[3],a[l+4]=e[4],a[l+5]=e[5],a[l+6]=e[6],a[l+7]=e[7]}function o(s,a,l){t[0]=s,a[l]=e[7],a[l+1]=e[6],a[l+2]=e[5],a[l+3]=e[4],a[l+4]=e[3],a[l+5]=e[2],a[l+6]=e[1],a[l+7]=e[0]}r.writeDoubleLE=i?n:o,r.writeDoubleBE=i?o:n;function u(s,a){return e[0]=s[a],e[1]=s[a+1],e[2]=s[a+2],e[3]=s[a+3],e[4]=s[a+4],e[5]=s[a+5],e[6]=s[a+6],e[7]=s[a+7],t[0]}function c(s,a){return e[7]=s[a],e[6]=s[a+1],e[5]=s[a+2],e[4]=s[a+3],e[3]=s[a+4],e[2]=s[a+5],e[1]=s[a+6],e[0]=s[a+7],t[0]}r.readDoubleLE=i?u:c,r.readDoubleBE=i?c:u}():function(){function t(i,n,o,u,c,s){var a=u<0?1:0;if(a&&(u=-u),u===0)i(0,c,s+n),i(1/u>0?0:2147483648,c,s+o);else if(isNaN(u))i(0,c,s+n),i(2146959360,c,s+o);else if(u>17976931348623157e292)i(0,c,s+n),i((a<<31|2146435072)>>>0,c,s+o);else{var l;if(u<22250738585072014e-324)l=u/5e-324,i(l>>>0,c,s+n),i((a<<31|l/4294967296)>>>0,c,s+o);else{var m=Math.floor(Math.log(u)/Math.LN2);m===1024&&(m=1023),l=u*Math.pow(2,-m),i(l*4503599627370496>>>0,c,s+n),i((a<<31|m+1023<<20|l*1048576&1048575)>>>0,c,s+o)}}}r.writeDoubleLE=t.bind(null,Bt,0,4),r.writeDoubleBE=t.bind(null,Et,4,0);function e(i,n,o,u,c){var s=i(u,c+n),a=i(u,c+o),l=(a>>31)*2+1,m=a>>>20&2047,x=4294967296*(a&1048575)+s;return m===2047?x?NaN:l*(1/0):m===0?l*5e-324*x:l*Math.pow(2,m-1075)*(x+4503599627370496)}r.readDoubleLE=e.bind(null,St,0,4),r.readDoubleBE=e.bind(null,xt,4,0)}(),r}function Bt(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}function Et(r,t,e){t[e]=r>>>24,t[e+1]=r>>>16&255,t[e+2]=r>>>8&255,t[e+3]=r&255}function St(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24)>>>0}function xt(r,t){return(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3])>>>0}});var Lt=y((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var Mt=y(Dt=>{"use strict";var G=Dt;G.length=function(t){for(var e=0,i=0,n=0;n<t.length;++n)i=t.charCodeAt(n),i<128?e+=1:i<2048?e+=2:(i&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e};G.read=function(t,e,i){var n=i-e;if(n<1)return"";for(var o=null,u=[],c=0,s;e<i;)s=t[e++],s<128?u[c++]=s:s>191&&s<224?u[c++]=(s&31)<<6|t[e++]&63:s>239&&s<365?(s=((s&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,u[c++]=55296+(s>>10),u[c++]=56320+(s&1023)):u[c++]=(s&15)<<12|(t[e++]&63)<<6|t[e++]&63,c>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,u)),c=0);return o?(c&&o.push(String.fromCharCode.apply(String,u.slice(0,c))),o.join("")):String.fromCharCode.apply(String,u.slice(0,c))};G.write=function(t,e,i){for(var n=i,o,u,c=0;c<t.length;++c)o=t.charCodeAt(c),o<128?e[i++]=o:o<2048?(e[i++]=o>>6|192,e[i++]=o&63|128):(o&64512)===55296&&((u=t.charCodeAt(c+1))&64512)===56320?(o=65536+((o&1023)<<10)+(u&1023),++c,e[i++]=o>>18|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128,e[i++]=o&63|128):(e[i++]=o>>12|224,e[i++]=o>>6&63|128,e[i++]=o&63|128);return i-n}});var Tt=y((Ie,vt)=>{"use strict";vt.exports=me;function me(r,t,e){var i=e||8192,n=i>>>1,o=null,u=i;return function(s){if(s<1||s>n)return r(s);u+s>i&&(o=r(i),u=0);var a=t.call(o,u,u+=s);return u&7&&(u=(u|7)+1),a}}});var Nt=y((Re,zt)=>{"use strict";zt.exports=p;var T=F();function p(r,t){this.lo=r>>>0,this.hi=t>>>0}var A=p.zero=new p(0,0);A.toNumber=function(){return 0};A.zzEncode=A.zzDecode=function(){return this};A.length=function(){return 1};var ge=p.zeroHash="\0\0\0\0\0\0\0\0";p.fromNumber=function(t){if(t===0)return A;var e=t<0;e&&(t=-t);var i=t>>>0,n=(t-i)/4294967296>>>0;return e&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new p(i,n)};p.from=function(t){if(typeof t=="number")return p.fromNumber(t);if(T.isString(t))if(T.Long)t=T.Long.fromString(t);else return p.fromNumber(parseInt(t,10));return t.low||t.high?new p(t.low>>>0,t.high>>>0):A};p.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=~this.lo+1>>>0,i=~this.hi>>>0;return e||(i=i+1>>>0),-(e+i*4294967296)}return this.lo+this.hi*4294967296};p.prototype.toLong=function(t){return T.Long?new T.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}};var E=String.prototype.charCodeAt;p.fromHash=function(t){return t===ge?A:new p((E.call(t,0)|E.call(t,1)<<8|E.call(t,2)<<16|E.call(t,3)<<24)>>>0,(E.call(t,4)|E.call(t,5)<<8|E.call(t,6)<<16|E.call(t,7)<<24)>>>0)};p.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};p.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};p.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};p.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?e===0?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:i<128?9:10}});var F=y($=>{"use strict";var f=$;f.asPromise=pt();f.base64=_t();f.EventEmitter=bt();f.float=Ft();f.inquire=Lt();f.utf8=Mt();f.pool=Tt();f.LongBits=Nt();f.isNode=!!(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);f.global=f.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||$;f.emptyArray=Object.freeze?Object.freeze([]):[];f.emptyObject=Object.freeze?Object.freeze({}):{};f.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};f.isString=function(t){return typeof t=="string"||t instanceof String};f.isObject=function(t){return t&&typeof t=="object"};f.isset=f.isSet=function(t,e){var i=t[e];return i!=null&&t.hasOwnProperty(e)?typeof i!="object"||(Array.isArray(i)?i.length:Object.keys(i).length)>0:!1};f.Buffer=function(){try{var r=f.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();f._Buffer_from=null;f._Buffer_allocUnsafe=null;f.newBuffer=function(t){return typeof t=="number"?f.Buffer?f._Buffer_allocUnsafe(t):new f.Array(t):f.Buffer?f._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)};f.Array=typeof Uint8Array<"u"?Uint8Array:Array;f.Long=f.global.dcodeIO&&f.global.dcodeIO.Long||f.global.Long||f.inquire("long");f.key2Re=/^true|false|0|1$/;f.key32Re=/^-?(?:0|[1-9][0-9]*)$/;f.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;f.longToHash=function(t){return t?f.LongBits.from(t).toHash():f.LongBits.zeroHash};f.longFromHash=function(t,e){var i=f.LongBits.fromHash(t);return f.Long?f.Long.fromBits(i.lo,i.hi,e):i.toNumber(!!e)};function It(r,t,e){for(var i=Object.keys(t),n=0;n<i.length;++n)(r[i[n]]===void 0||!e)&&(r[i[n]]=t[i[n]]);return r}f.merge=It;f.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)};function Rt(r){function t(e,i){if(!(this instanceof t))return new t(e,i);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:new Error().stack||""}),i&&It(this,i)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}f.newError=Rt;f.ProtocolError=Rt("ProtocolError");f.oneOfGetter=function(t){for(var e={},i=0;i<t.length;++i)e[t[i]]=1;return function(){for(var n=Object.keys(this),o=n.length-1;o>-1;--o)if(e[n[o]]===1&&this[n[o]]!==void 0&&this[n[o]]!==null)return n[o]}};f.oneOfSetter=function(t){return function(e){for(var i=0;i<t.length;++i)t[i]!==e&&delete this[t[i]]}};f.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};f._configure=function(){var r=f.Buffer;if(!r){f._Buffer_from=f._Buffer_allocUnsafe=null;return}f._Buffer_from=r.from!==Uint8Array.from&&r.from||function(e,i){return new r(e,i)},f._Buffer_allocUnsafe=r.allocUnsafe||function(e){return new r(e)}}});var J=y((Ce,Pt)=>{"use strict";Pt.exports=d;var w=F(),Z,Ht=w.LongBits,_e=w.utf8;function b(r,t){return RangeError("index out of range: "+r.pos+" + "+(t||1)+" > "+r.len)}function d(r){this.buf=r,this.pos=0,this.len=r.length}var Ot=typeof Uint8Array<"u"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new d(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new d(t);throw Error("illegal buffer")},qt=function(){return w.Buffer?function(e){return(d.create=function(n){return w.Buffer.isBuffer(n)?new Z(n):Ot(n)})(e)}:Ot};d.create=qt();d.prototype._slice=w.Array.prototype.subarray||w.Array.prototype.slice;d.prototype.uint32=function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,b(this,10);return t}}();d.prototype.int32=function(){return this.uint32()|0};d.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function j(){var r=new Ht(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw b(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,r}if(this.len-this.pos>4){for(;t<5;++t)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;t<5;++t){if(this.pos>=this.len)throw b(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}d.prototype.bool=function(){return this.uint32()!==0};function q(r,t){return(r[t-4]|r[t-3]<<8|r[t-2]<<16|r[t-1]<<24)>>>0}d.prototype.fixed32=function(){if(this.pos+4>this.len)throw b(this,4);return q(this.buf,this.pos+=4)};d.prototype.sfixed32=function(){if(this.pos+4>this.len)throw b(this,4);return q(this.buf,this.pos+=4)|0};function Ct(){if(this.pos+8>this.len)throw b(this,8);return new Ht(q(this.buf,this.pos+=4),q(this.buf,this.pos+=4))}d.prototype.float=function(){if(this.pos+4>this.len)throw b(this,4);var t=w.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};d.prototype.double=function(){if(this.pos+8>this.len)throw b(this,4);var t=w.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};d.prototype.bytes=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw b(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(e,i);if(e===i){var n=w.Buffer;return n?n.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,e,i)};d.prototype.string=function(){var t=this.bytes();return _e.read(t,0,t.length)};d.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw b(this,t);this.pos+=t}else do if(this.pos>=this.len)throw b(this);while(this.buf[this.pos++]&128);return this};d.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};d._configure=function(r){Z=r,d.create=qt(),Z._configure();var t=w.Long?"toLong":"toNumber";w.merge(d.prototype,{int64:function(){return j.call(this)[t](!1)},uint64:function(){return j.call(this)[t](!0)},sint64:function(){return j.call(this).zzDecode()[t](!1)},fixed64:function(){return Ct.call(this)[t](!0)},sfixed64:function(){return Ct.call(this)[t](!1)}})}});var $t=y((He,Gt)=>{"use strict";Gt.exports=L;var Wt=J();(L.prototype=Object.create(Wt.prototype)).constructor=L;var Ut=F();function L(r){Wt.call(this,r)}L._configure=function(){Ut.Buffer&&(L.prototype._slice=Ut.Buffer.prototype.slice)};L.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};L._configure()});var et=y((qe,Vt)=>{"use strict";Vt.exports=h;var g=F(),V,P=g.LongBits,jt=g.base64,Zt=g.utf8;function z(r,t,e){this.fn=r,this.len=t,this.next=void 0,this.val=e}function K(){}function we(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function h(){this.len=0,this.head=new z(K,0,0),this.tail=this.head,this.states=null}var Jt=function(){return g.Buffer?function(){return(h.create=function(){return new V})()}:function(){return new h}};h.create=Jt();h.alloc=function(t){return new g.Array(t)};g.Array!==Array&&(h.alloc=g.pool(h.alloc,g.Array.prototype.subarray));h.prototype._push=function(t,e,i){return this.tail=this.tail.next=new z(t,e,i),this.len+=e,this};function Q(r,t,e){t[e]=r&255}function be(r,t,e){for(;r>127;)t[e++]=r&127|128,r>>>=7;t[e]=r}function Y(r,t){this.len=r,this.next=void 0,this.val=t}Y.prototype=Object.create(z.prototype);Y.prototype.fn=be;h.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new Y((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};h.prototype.int32=function(t){return t<0?this._push(tt,10,P.fromNumber(t)):this.uint32(t)};h.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function tt(r,t,e){for(;r.hi;)t[e++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)t[e++]=r.lo&127|128,r.lo=r.lo>>>7;t[e++]=r.lo}h.prototype.uint64=function(t){var e=P.from(t);return this._push(tt,e.length(),e)};h.prototype.int64=h.prototype.uint64;h.prototype.sint64=function(t){var e=P.from(t).zzEncode();return this._push(tt,e.length(),e)};h.prototype.bool=function(t){return this._push(Q,1,t?1:0)};function X(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}h.prototype.fixed32=function(t){return this._push(X,4,t>>>0)};h.prototype.sfixed32=h.prototype.fixed32;h.prototype.fixed64=function(t){var e=P.from(t);return this._push(X,4,e.lo)._push(X,4,e.hi)};h.prototype.sfixed64=h.prototype.fixed64;h.prototype.float=function(t){return this._push(g.float.writeFloatLE,4,t)};h.prototype.double=function(t){return this._push(g.float.writeDoubleLE,8,t)};var ke=g.Array.prototype.set?function(t,e,i){e.set(t,i)}:function(t,e,i){for(var n=0;n<t.length;++n)e[i+n]=t[n]};h.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(Q,1,0);if(g.isString(t)){var i=h.alloc(e=jt.length(t));jt.decode(t,i,0),t=i}return this.uint32(e)._push(ke,e,t)};h.prototype.string=function(t){var e=Zt.length(t);return e?this.uint32(e)._push(Zt.write,e,t):this._push(Q,1,0)};h.prototype.fork=function(){return this.states=new we(this),this.head=this.tail=new z(K,0,0),this.len=0,this};h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new z(K,0,0),this.len=0),this};h.prototype.ldelim=function(){var t=this.head,e=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=e,this.len+=i),this};h.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,e,i),i+=t.len,t=t.next;return e};h._configure=function(r){V=r,h.create=Jt(),V._configure()}});var Qt=y((Pe,Kt)=>{"use strict";Kt.exports=B;var Xt=et();(B.prototype=Object.create(Xt.prototype)).constructor=B;var S=F();function B(){Xt.call(this)}B._configure=function(){B.alloc=S._Buffer_allocUnsafe,B.writeBytesBuffer=S.Buffer&&S.Buffer.prototype instanceof Uint8Array&&S.Buffer.prototype.set.name==="set"?function(t,e,i){e.set(t,i)}:function(t,e,i){if(t.copy)t.copy(e,i,0,t.length);else for(var n=0;n<t.length;)e[i++]=t[n++]}};B.prototype.bytes=function(t){S.isString(t)&&(t=S._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(B.writeBytesBuffer,e,t),this};function Be(r,t,e){r.length<40?S.utf8.write(r,t,e):t.utf8Write?t.utf8Write(r,e):t.write(r,e)}B.prototype.string=function(t){var e=S.Buffer.byteLength(t);return this.uint32(e),e&&this._push(Be,e,t),this};B._configure()});var Fe={};he(Fe,{UnixFS:()=>at});var ut=D(ht(),1);var rt=D(J(),1),Yt=D($t(),1),te=D(F(),1),it=D(et(),1),ee=D(Qt(),1);function Ee(){te.default._configure(),rt.default._configure(Yt.default),it.default._configure(ee.default)}Ee();var re=["uint64","int64","sint64","fixed64","sfixed64"];function Se(r){for(let t of re){if(r[t]==null)continue;let e=r[t];r[t]=function(){return BigInt(e.call(this).toString())}}return r}function nt(r){return Se(new rt.default(r))}function xe(r){for(let t of re){if(r[t]==null)continue;let e=r[t];r[t]=function(i){return e.call(this,i.toString())}}return r}function ot(){return xe(it.default.create())}function N(r,t){let e=nt(r instanceof Uint8Array?r:r.subarray());return t.decode(e)}function I(r,t){let e=ot();return t.encode(r,e,{lengthDelimited:!1}),e.finish()}var v;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(v||(v={}));function U(r,t,e,i){return{name:r,type:t,encode:e,decode:i}}function st(r){function t(n){if(r[n.toString()]==null)throw new Error("Invalid enum value");return r[n]}let e=function(o,u){let c=t(o);u.int32(c)},i=function(o){let u=o.int32();return t(u)};return U("enum",v.VARINT,e,i)}function R(r,t){return U("message",v.LENGTH_DELIMITED,r,t)}var k;(function(r){let t;(function(n){n.Raw="Raw",n.Directory="Directory",n.File="File",n.Metadata="Metadata",n.Symlink="Symlink",n.HAMTShard="HAMTShard"})(t=r.DataType||(r.DataType={}));let e;(function(n){n[n.Raw=0]="Raw",n[n.Directory=1]="Directory",n[n.File=2]="File",n[n.Metadata=3]="Metadata",n[n.Symlink=4]="Symlink",n[n.HAMTShard=5]="HAMTShard"})(e||(e={})),function(n){n.codec=()=>st(e)}(t=r.DataType||(r.DataType={}));let i;r.codec=()=>(i==null&&(i=R((n,o,u={})=>{if(u.lengthDelimited!==!1&&o.fork(),n.Type!=null&&(o.uint32(8),r.DataType.codec().encode(n.Type,o)),n.Data!=null&&(o.uint32(18),o.bytes(n.Data)),n.filesize!=null&&(o.uint32(24),o.uint64(n.filesize)),n.blocksizes!=null)for(let c of n.blocksizes)o.uint32(32),o.uint64(c);n.hashType!=null&&(o.uint32(40),o.uint64(n.hashType)),n.fanout!=null&&(o.uint32(48),o.uint64(n.fanout)),n.mode!=null&&(o.uint32(56),o.uint32(n.mode)),n.mtime!=null&&(o.uint32(66),W.codec().encode(n.mtime,o)),u.lengthDelimited!==!1&&o.ldelim()},(n,o)=>{let u={blocksizes:[]},c=o==null?n.len:n.pos+o;for(;n.pos<c;){let s=n.uint32();switch(s>>>3){case 1:u.Type=r.DataType.codec().decode(n);break;case 2:u.Data=n.bytes();break;case 3:u.filesize=n.uint64();break;case 4:u.blocksizes.push(n.uint64());break;case 5:u.hashType=n.uint64();break;case 6:u.fanout=n.uint64();break;case 7:u.mode=n.uint32();break;case 8:u.mtime=W.codec().decode(n,n.uint32());break;default:n.skipType(s&7);break}}return u})),i),r.encode=n=>I(n,r.codec()),r.decode=n=>N(n,r.codec())})(k||(k={}));var W;(function(r){let t;r.codec=()=>(t==null&&(t=R((e,i,n={})=>{n.lengthDelimited!==!1&&i.fork(),e.Seconds!=null&&(i.uint32(8),i.int64(e.Seconds)),e.FractionalNanoseconds!=null&&(i.uint32(21),i.fixed32(e.FractionalNanoseconds)),n.lengthDelimited!==!1&&i.ldelim()},(e,i)=>{let n={},o=i==null?e.len:e.pos+i;for(;e.pos<o;){let u=e.uint32();switch(u>>>3){case 1:n.Seconds=e.int64();break;case 2:n.FractionalNanoseconds=e.fixed32();break;default:e.skipType(u&7);break}}return n})),t),r.encode=e=>I(e,r.codec()),r.decode=e=>N(e,r.codec())})(W||(W={}));var ie;(function(r){let t;r.codec=()=>(t==null&&(t=R((e,i,n={})=>{n.lengthDelimited!==!1&&i.fork(),e.MimeType!=null&&(i.uint32(10),i.string(e.MimeType)),n.lengthDelimited!==!1&&i.ldelim()},(e,i)=>{let n={},o=i==null?e.len:e.pos+i;for(;e.pos<o;){let u=e.uint32();switch(u>>>3){case 1:n.MimeType=e.string();break;default:e.skipType(u&7);break}}return n})),t),r.encode=e=>I(e,r.codec()),r.decode=e=>N(e,r.codec())})(ie||(ie={}));var ne={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},Ae=["directory","hamt-sharded-directory"],oe=parseInt("0644",8),se=parseInt("0755",8),at=class r{static unmarshal(t){let e=k.decode(t),i=new r({type:ne[e.Type!=null?e.Type.toString():"File"],data:e.Data,blockSizes:e.blocksizes,mode:e.mode,mtime:e.mtime!=null?{secs:e.mtime.Seconds??0n,nsecs:e.mtime.FractionalNanoseconds}:void 0});return i._originalMode=e.mode??0,i}type;data;blockSizes;hashType;fanout;mtime;_mode;_originalMode;constructor(t={type:"file"}){let{type:e,data:i,blockSizes:n,hashType:o,fanout:u,mtime:c,mode:s}=t;if(e!=null&&!Object.values(ne).includes(e))throw(0,ut.default)(new Error("Type: "+e+" is not valid"),"ERR_INVALID_TYPE");this.type=e??"file",this.data=i,this.hashType=o,this.fanout=u,this.blockSizes=n??[],this._originalMode=0,this.mode=s,this.mtime=c}set mode(t){t==null?this._mode=this.isDirectory()?se:oe:this._mode=t&4095}get mode(){return this._mode}isDirectory(){return Ae.includes(this.type)}addBlockSize(t){this.blockSizes.push(t)}removeBlockSize(t){this.blockSizes.splice(t,1)}fileSize(){if(this.isDirectory())return 0n;let t=0n;return this.blockSizes.forEach(e=>{t+=e}),this.data!=null&&(t+=BigInt(this.data.length)),t}marshal(){let t;switch(this.type){case"raw":t=k.DataType.Raw;break;case"directory":t=k.DataType.Directory;break;case"file":t=k.DataType.File;break;case"metadata":t=k.DataType.Metadata;break;case"symlink":t=k.DataType.Symlink;break;case"hamt-sharded-directory":t=k.DataType.HAMTShard;break;default:throw(0,ut.default)(new Error(`Type: ${t} is not valid`),"ERR_INVALID_TYPE")}let e=this.data;(this.data==null||this.data.length===0)&&(e=void 0);let i;this.mode!=null&&(i=this._originalMode&4294963200|(this.mode??0),i===oe&&!this.isDirectory()&&(i=void 0),i===se&&this.isDirectory()&&(i=void 0));let n;return this.mtime!=null&&(n={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),k.encode({Type:t,Data:e,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:i,mtime:n})}};return de(Fe);})(); | ||
return IpfsUnixfs})); |
{ | ||
"name": "ipfs-unixfs", | ||
"version": "11.0.1", | ||
"version": "11.0.2", | ||
"description": "JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a MerkleDAG)", | ||
@@ -147,3 +147,3 @@ "license": "Apache-2.0 OR MIT", | ||
"devDependencies": { | ||
"aegir": "^39.0.6", | ||
"aegir": "^40.0.11", | ||
"protons": "^7.0.2", | ||
@@ -150,0 +150,0 @@ "uint8arrays": "^4.0.2" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78224
15
970