>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(k[e])return k[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new C;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new B}return k[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}var i=this.m.subn(1),a=0;while(!i.isZero()&&0===i.andln(1))a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();f=new o(2*f*f).toRed(this);while(0!==this.pow(f,u).cmp(c))f.redIAdd(c);var h=this.pow(f,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=a;while(0!==l.cmp(s)){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;i--){for(var f=t.words[i],h=u-1;h>=0;h--){var d=f>>h&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,c++,(c===r||0===i&&0===h)&&(a=this.mul(a,n[s]),c=0,s=0)):c=0}u=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new P(e)},i(P,E),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},P.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(e,this)}).call(this,r("62e4")(e))},bb34:function(e,t,r){"use strict";var n=r("399f"),i=r("f3a3"),o=i.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=a,a.fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"===typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?o(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||o(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.validate()||o(e.validate(),"public point not validated"),e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},bb44:function(e,t,r){"use strict";var n=r("c3c0"),i=r("edc9"),o=n.rotl32,a=n.sum32,s=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function f(){if(!(this instanceof f))return new f;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,u),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],f=this.h[4],y=r,g=n,w=i,_=u,k=f,S=0;S<80;S++){var M=a(o(c(r,h(S,n,i,u),e[p[S]+t],d(S)),m[S]),f);r=f,f=u,u=o(i,10),i=n,n=M,M=a(o(c(y,h(79-S,g,w,_),e[b[S]+t],l(S)),v[S]),k),y=k,k=_,_=o(w,10),w=g,g=M}M=s(this.h[1],i,_),this.h[1]=s(this.h[2],u,k),this.h[2]=s(this.h[3],f,y),this.h[3]=s(this.h[4],r,g),this.h[4]=s(this.h[0],n,w),this.h[0]=M},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},bc82:function(e,t,r){"use strict";const{DAGLink:n,DAGNode:i}=r("8141"),{UnixFS:o}=r("9fd0"),a=r("0bb1"),s=r("3ba3"),{createHAMT:c,Bucket:u}=r("d81a");class f extends a{constructor(e,t){super(e,t),this._bucket=c({hashFn:t.hamtHashFn,bits:t.hamtBucketBits})}async put(e,t){await this._bucket.put(e,t)}get(e){return this._bucket.get(e)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(const{key:e,value:t}of this._bucket.eachLeafSeries())yield{key:e,child:t}}async*flush(e){for await(const t of h(this._bucket,e,this,this.options))yield{...t,path:this.path}}}async function*h(e,t,r,a){const c=e._children,f=[];let d=0;for(let i=0;i=0?h.subarray(0,d):h}}e.exports=r},c2f9:function(e,t,r){"use strict";var n=r("543b"),i=n.Reader,o=n.Writer,a=n.util,s=n.roots["ipfs-unixfs"]||(n.roots["ipfs-unixfs"]={});s.Data=function(){function e(e){if(this.blocksizes=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;case 3:n.filesize=e.uint64();break;case 4:if(n.blocksizes&&n.blocksizes.length||(n.blocksizes=[]),2===(7&o)){var c=e.uint32()+e.pos;while(e.pos>>0,e.filesize.high>>>0).toNumber(!0))),e.blocksizes){if(!Array.isArray(e.blocksizes))throw TypeError(".Data.blocksizes: array expected");t.blocksizes=[];for(var r=0;r>>0,e.blocksizes[r].high>>>0).toNumber(!0))}if(null!=e.hashType&&(a.Long?(t.hashType=a.Long.fromValue(e.hashType)).unsigned=!0:"string"===typeof e.hashType?t.hashType=parseInt(e.hashType,10):"number"===typeof e.hashType?t.hashType=e.hashType:"object"===typeof e.hashType&&(t.hashType=new a.LongBits(e.hashType.low>>>0,e.hashType.high>>>0).toNumber(!0))),null!=e.fanout&&(a.Long?(t.fanout=a.Long.fromValue(e.fanout)).unsigned=!0:"string"===typeof e.fanout?t.fanout=parseInt(e.fanout,10):"number"===typeof e.fanout?t.fanout=e.fanout:"object"===typeof e.fanout&&(t.fanout=new a.LongBits(e.fanout.low>>>0,e.fanout.high>>>0).toNumber(!0))),null!=e.mode&&(t.mode=e.mode>>>0),null!=e.mtime){if("object"!==typeof e.mtime)throw TypeError(".Data.mtime: object expected");t.mtime=s.UnixTime.fromObject(e.mtime)}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.blocksizes=[]),t.defaults){if(r.Type=t.enums===String?"Raw":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=a.newBuffer(r.Data))),a.Long){var n=new a.Long(0,0,!0);r.filesize=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.filesize=t.longs===String?"0":0;if(a.Long){n=new a.Long(0,0,!0);r.hashType=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.hashType=t.longs===String?"0":0;if(a.Long){n=new a.Long(0,0,!0);r.fanout=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.fanout=t.longs===String?"0":0;r.mode=0,r.mtime=null}if(null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?s.Data.DataType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?a.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),null!=e.filesize&&e.hasOwnProperty("filesize")&&("number"===typeof e.filesize?r.filesize=t.longs===String?String(e.filesize):e.filesize:r.filesize=t.longs===String?a.Long.prototype.toString.call(e.filesize):t.longs===Number?new a.LongBits(e.filesize.low>>>0,e.filesize.high>>>0).toNumber(!0):e.filesize),e.blocksizes&&e.blocksizes.length){r.blocksizes=[];for(var i=0;i>>0,e.blocksizes[i].high>>>0).toNumber(!0):e.blocksizes[i]}return null!=e.hashType&&e.hasOwnProperty("hashType")&&("number"===typeof e.hashType?r.hashType=t.longs===String?String(e.hashType):e.hashType:r.hashType=t.longs===String?a.Long.prototype.toString.call(e.hashType):t.longs===Number?new a.LongBits(e.hashType.low>>>0,e.hashType.high>>>0).toNumber(!0):e.hashType),null!=e.fanout&&e.hasOwnProperty("fanout")&&("number"===typeof e.fanout?r.fanout=t.longs===String?String(e.fanout):e.fanout:r.fanout=t.longs===String?a.Long.prototype.toString.call(e.fanout):t.longs===Number?new a.LongBits(e.fanout.low>>>0,e.fanout.high>>>0).toNumber(!0):e.fanout),null!=e.mode&&e.hasOwnProperty("mode")&&(r.mode=e.mode),null!=e.mtime&&e.hasOwnProperty("mtime")&&(r.mtime=s.UnixTime.toObject(e.mtime,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.DataType=function(){var e={},t=Object.create(e);return t[e[0]="Raw"]=0,t[e[1]="Directory"]=1,t[e[2]="File"]=2,t[e[3]="Metadata"]=3,t[e[4]="Symlink"]=4,t[e[5]="HAMTShard"]=5,t}(),e}(),s.UnixTime=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Seconds=e.int64();break;case 2:n.FractionalNanoseconds=e.fixed32();break;default:e.skipType(7&o);break}}if(!n.hasOwnProperty("Seconds"))throw a.ProtocolError("missing required 'Seconds'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.UnixTime)return e;var t=new s.UnixTime;return null!=e.Seconds&&(a.Long?(t.Seconds=a.Long.fromValue(e.Seconds)).unsigned=!1:"string"===typeof e.Seconds?t.Seconds=parseInt(e.Seconds,10):"number"===typeof e.Seconds?t.Seconds=e.Seconds:"object"===typeof e.Seconds&&(t.Seconds=new a.LongBits(e.Seconds.low>>>0,e.Seconds.high>>>0).toNumber())),null!=e.FractionalNanoseconds&&(t.FractionalNanoseconds=e.FractionalNanoseconds>>>0),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(a.Long){var n=new a.Long(0,0,!1);r.Seconds=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.Seconds=t.longs===String?"0":0;r.FractionalNanoseconds=0}return null!=e.Seconds&&e.hasOwnProperty("Seconds")&&("number"===typeof e.Seconds?r.Seconds=t.longs===String?String(e.Seconds):e.Seconds:r.Seconds=t.longs===String?a.Long.prototype.toString.call(e.Seconds):t.longs===Number?new a.LongBits(e.Seconds.low>>>0,e.Seconds.high>>>0).toNumber():e.Seconds),null!=e.FractionalNanoseconds&&e.hasOwnProperty("FractionalNanoseconds")&&(r.FractionalNanoseconds=e.FractionalNanoseconds),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),s.Metadata=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.MimeType=e.string();break;default:e.skipType(7&o);break}}return n},e.fromObject=function(e){if(e instanceof s.Metadata)return e;var t=new s.Metadata;return null!=e.MimeType&&(t.MimeType=String(e.MimeType)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.MimeType=""),null!=e.MimeType&&e.hasOwnProperty("MimeType")&&(r.MimeType=e.MimeType),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=s},c3c0:function(e,t,r){"use strict";var n=r("da3e"),i=r("3fb5");function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"===typeof e)if(t){if("hex"===t)for(e=e.replace(/[^a-z0-9]+/gi,""),e.length%2!==0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24;return t>>>0}function u(e,t){for(var r="",n=0;n>>0}return a}function l(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r}function p(e,t){return e>>>t|e<<32-t}function b(e,t){return e<>>32-t}function m(e,t){return e+t>>>0}function v(e,t,r){return e+t+r>>>0}function y(e,t,r,n){return e+t+r+n>>>0}function g(e,t,r,n,i){return e+t+r+n+i>>>0}function w(e,t,r,n){var i=e[t],o=e[t+1],a=n+o>>>0,s=(a>>0,e[t+1]=a}function _(e,t,r,n){var i=t+n>>>0,o=(i>>0}function k(e,t,r,n){var i=t+n;return i>>>0}function S(e,t,r,n,i,o,a,s){var c=0,u=t;u=u+n>>>0,c+=u>>0,c+=u>>0,c+=u>>0}function M(e,t,r,n,i,o,a,s){var c=t+n+o+s;return c>>>0}function C(e,t,r,n,i,o,a,s,c,u){var f=0,h=t;h=h+n>>>0,f+=h>>0,f+=h>>0,f+=h>>0,f+=h>>0}function x(e,t,r,n,i,o,a,s,c,u){var f=t+n+o+s+u;return f>>>0}function B(e,t,r){var n=t<<32-r|e>>>r;return n>>>0}function E(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}function P(e,t,r){return e>>>r}function A(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}t.inherits=i,t.toArray=a,t.toHex=s,t.htonl=c,t.toHex32=u,t.zero2=f,t.zero8=h,t.join32=d,t.split32=l,t.rotr32=p,t.rotl32=b,t.sum32=m,t.sum32_3=v,t.sum32_4=y,t.sum32_5=g,t.sum64=w,t.sum64_hi=_,t.sum64_lo=k,t.sum64_4_hi=S,t.sum64_4_lo=M,t.sum64_5_hi=C,t.sum64_5_lo=x,t.rotr64_hi=B,t.rotr64_lo=E,t.shr64_hi=P,t.shr64_lo=A},c449:function(e,t,r){"use strict";const n=r("354e"),i=r("675c"),o=r("5d98"),a=r("42a6"),{concat:s}=r("a828"),{toString:c}=r("eaf0"),{equals:u}=r("b2af"),f=o.nameToCode,h=Object.keys(f).reduce((e,t)=>(e[f[t]]=t,e),{}),d=Symbol.for("@ipld/js-cid/CID");class l{constructor(e,t,r,a){if(this.version,this.codec,this.multihash,Object.defineProperty(this,d,{value:!0}),l.isCID(e)){const t=e;return this.version=t.version,this.codec=t.codec,this.multihash=t.multihash,void(this.multibaseName=t.multibaseName||(0===t.version?"base58btc":"base32"))}if("string"===typeof e){const t=i.isEncoded(e);if(t){const r=i.decode(e);this.version=parseInt(r[0].toString(),16),this.codec=o.getCodec(r.slice(1)),this.multihash=o.rmPrefix(r.slice(1)),this.multibaseName=t}else this.version=0,this.codec="dag-pb",this.multihash=n.fromB58String(e),this.multibaseName="base58btc";return l.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(e instanceof Uint8Array){const t=parseInt(e[0].toString(),16);if(1===t){const r=e;this.version=t,this.codec=o.getCodec(r.slice(1)),this.multihash=o.rmPrefix(r.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";l.validateCID(this)}else this.version=e,"number"===typeof t&&(t=h[t]),this.codec=t,this.multihash=r,this.multibaseName=a||(0===e?"base58btc":"base32"),l.validateCID(this)}get bytes(){let e=this._bytes;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");{const t=o.getCodeVarint(this.codec);e=s([[1],t,this.multihash],1+t.byteLength+this.multihash.byteLength)}}Object.defineProperty(this,"_bytes",{value:e})}return e}get prefix(){const e=o.getCodeVarint(this.codec),t=n.prefix(this.multihash),r=s([[this.version],e,t],1+e.byteLength+t.byteLength);return r}get code(){return f[this.codec]}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:e,length:t}=n.decode(this.multihash);if("sha2-256"!==e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==t)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new l(0,this.codec,this.multihash)}toV1(){return new l(1,this.codec,this.multihash,this.multibaseName)}toBaseEncodedString(e=this.multibaseName){if(this.string&&0!==this.string.length&&e===this.multibaseName)return this.string;let t;if(0===this.version){if("base58btc"!==e)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");t=n.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");t=c(i.encode(e,this.bytes))}return e===this.multibaseName&&Object.defineProperty(this,"string",{value:t}),t}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(e){return this.toBaseEncodedString(e)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(e){return this.codec===e.codec&&this.version===e.version&&u(this.multihash,e.multihash)}static validateCID(e){const t=a.checkCIDComponents(e);if(t)throw new Error(t)}static isCID(e){return e instanceof l||Boolean(e&&e[d])}}l.codecs=f,e.exports=l},c486:function(e,t,r){const n=r("1c46"),{checkAndInit:i,smix:o}=r("8f3b");async function a(e,t,r,a,s,c,u,f){const{XY:h,V:d,B32:l,x:p,_X:b,B:m,tickCallback:v}=i(e,t,r,a,s,c,u);for(var y=0;y=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=o(e);return t&&0!==t.length?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(c){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a}).call(this,r("4362"))},c6f1:function(e,t,r){"use strict";var n=r("b280");function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const o=i("utf8","u",e=>{const t=new TextDecoder("utf8");return"u"+t.decode(e)},e=>{const t=new TextEncoder;return t.encode(e.substring(1))}),a=i("ascii","a",e=>{let t="a";for(let r=0;r{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r191&&i<224?a[s++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[s++]=55296+(i>>10),a[s++]=56320+(1023&i)):a[s++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0);return o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))},n.write=function(e,t,r){for(var n,i,o=r,a=0;a>6|192,t[r++]=63&n|128):55296===(64512&n)&&56320===(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},c8f6:function(e,t,r){const n=r("14ec"),i=r("3193");e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},cd91:function(e){e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},cf35:function(e,t,r){"use strict";(function(t,n){var i;e.exports=P,P.ReadableState=E;r("faa1").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=r("f12a"),s=r("b639").Buffer,c=t.Uint8Array||function(){};function u(e){return s.from(e)}function f(e){return s.isBuffer(e)||e instanceof c}var h,d=r(8);h=d&&d.debuglog?d.debuglog("stream"):function(){};var l,p,b,m=r("22ab"),v=r("9019"),y=r("05f0"),g=y.getHighWaterMark,w=r("d113").codes,_=w.ERR_INVALID_ARG_TYPE,k=w.ERR_STREAM_PUSH_AFTER_EOF,S=w.ERR_METHOD_NOT_IMPLEMENTED,M=w.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r("3fb5")(P,a);var C=v.errorOrDestroy,x=["error","close","destroy","pause","resume"];function B(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function E(e,t,n){i=i||r("5e7d"),e=e||{},"boolean"!==typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",n),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r("7d72").StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function P(e){if(i=i||r("5e7d"),!(this instanceof P))return new P(e);var t=this instanceof i;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function A(e,t,r,n,i){h("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,I(e,a);else if(i||(o=R(a,t)),o)C(e,o);else if(a.objectMode||t&&t.length>0)if("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=u(t)),n)a.endEmitted?C(e,new M):T(e,a,t,!0);else if(a.ended)C(e,new k);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?T(e,a,t,!1):U(e,a)):T(e,a,t,!1)}else n||(a.reading=!1,U(e,a));return!a.ended&&(a.length=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function j(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=L(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function I(e,t){if(h("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?D(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,N(e)))}}function D(e){var t=e._readableState;h("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(N,e))}function N(e){var t=e._readableState;h("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,G(e)}function U(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(z,e,t))}function z(e,t){while(!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function H(e){h("readable nexttick read 0"),e.read(0)}function $(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(V,e,t))}function V(e,t){h("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),G(e),t.flowing&&!t.reading&&e.read(0)}function G(e){var t=e._readableState;h("flow",t.flowing);while(t.flowing&&null!==e.read());}function W(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function K(e){var t=e._readableState;h("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(X,t,e))}function X(e,t){if(h("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function J(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?K(this):D(this),null;if(e=j(e,t),0===e&&t.ended)return 0===t.length&&K(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e0?W(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&K(this)),null!==n&&this.emit("data",n),n},P.prototype._read=function(e){C(this,new S("_read()"))},P.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,s=a?u:y;function c(e,t){h("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,l())}function u(){h("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",c);var f=F(r);e.on("drain",f);var d=!1;function l(){h("cleanup"),e.removeListener("close",m),e.removeListener("finish",v),e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",c),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",p),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f()}function p(t){h("ondata");var n=e.write(t);h("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==J(i.pipes,e))&&!d&&(h("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function b(t){h("onerror",t),y(),e.removeListener("error",b),0===o(e,"error")&&C(e,t)}function m(){e.removeListener("finish",v),y()}function v(){h("onfinish"),e.removeListener("close",m),y()}function y(){h("unpipe"),r.unpipe(e)}return r.on("data",p),B(e,"error",b),e.once("close",m),e.once("finish",v),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},P.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,h("on readable",i.length,i.reading),i.length?D(this):i.reading||n.nextTick(H,this))),r},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(q,this),r},P.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(q,this),t},P.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!e.readableListening,$(this,e)),e.paused=!1,this},P.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},P.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){if(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!==i&&void 0!==i)&&(r.objectMode||i&&i.length)){var o=t.push(i);o||(n=!0,e.pause())}})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o>6],i=0===(32&r);if(31===(31&r)){let n=r;r=0;while(128===(128&n)){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;const o=s.tag[r];return{cls:n,primitive:i,tag:r,tagStr:o}}function h(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0===(128&n))return n;const i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(let o=0;o{const s=await i();return new n(s,e,t,r,o,a)};e.exports={Rabin:n,create:o}},d113:function(e,t,r){"use strict";function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var i={};function o(e,t,r){function o(e,r,n){return"string"===typeof t?t:t(e,r,n)}r||(r=Error);var a=function(e){function t(t,r,n){return e.call(this,o(t,r,n))||this}return n(t,e),t}(r);a.prototype.name=r.name,a.prototype.code=e,i[e]=a}function a(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function s(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function c(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function u(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i;if("string"===typeof t&&s(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be",c(e," argument"))i="The ".concat(e," ").concat(n," ").concat(a(t,"type"));else{var o=u(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(a(t,"type"))}return i+=". Received type ".concat(typeof r),i}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},d17b:function(e,t,r){e.exports=r("e372").Transform},d1c8:function(e,t,r){"use strict";const n=r("3fb5");function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){let t;const r=this._reporterState,n=e instanceof o;if(t=n?e:new o(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},d3f8:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("dc74");const i=n.rfc4648({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});t.base2=i},d424:function(e,t,r){"use strict";var n=r("3fb5"),i=r("8707").Buffer,o=r("6430"),a=i.alloc(128),s=64;function c(e,t){o.call(this,"digest"),"string"===typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length1?o(i,t,r):i[0]}e.exports=i},d4dd:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("fb86"),i=r("ac1b"),o=r("dd7b"),a=r("9a44"),s=r("29f9");t.CID=n.CID,t.varint=i,t.bytes=o,t.hasher=a,t.digest=s},d70e:function(e){e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},d81a:function(e,t,r){"use strict";const n=r("42f1"),i=r("0662");function o(e){if(!e||!e.hashFn)throw new Error("please define an options.hashFn");const t={bits:e.bits||8,hash:i(e.hashFn)};return new n(t)}e.exports={createHAMT:o,Bucket:n}},d9fc:function(e,t,r){"use strict";const n=r("a037");function i(e,t="utf8"){const r=n[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return r.decoder.decode(`${r.prefix}${e}`)}e.exports=i},da12:function(e,t,r){"use strict";const n=r("bc82"),i=r("0ca7");async function o(e,t){const r=new n({root:e.root,dir:!0,parent:e.parent,parentKey:e.parentKey,path:e.path,dirty:e.dirty,flat:!1,mtime:e.mtime,mode:e.mode},t);for await(const{key:n,child:i}of e.eachChildSeries())await r.put(n,i);return r}e.exports=async function e(t,r,n,a){let s=r;r instanceof i&&r.directChildrenCount()>=n&&(s=await o(r,a));const c=s.parent;if(c){if(s!==r){if(t&&(t.parent=s),!s.parentKey)throw new Error("No parent key found");await c.put(s.parentKey,s)}return e(s,c,n,a)}return s}},da3e:function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},dc14:function(e,t,r){"use strict";(function(t,n){var i=r("966d");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){I(t,e)}}e.exports=g;var a,s=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?setImmediate:i.nextTick;g.WritableState=y;var c=Object.create(r("3a7c"));c.inherits=r("3fb5");var u={deprecate:r("b7d1")},f=r("429b"),h=r("a8f0").Buffer,d=n.Uint8Array||function(){};function l(e){return h.from(e)}function p(e){return h.isBuffer(e)||e instanceof d}var b,m=r("4681");function v(){}function y(e,t){a=a||r("b19a"),e=e||{};var n=t instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,s=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===e.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){B(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function g(e){if(a=a||r("b19a"),!b.call(g,this)&&!(this instanceof a))return new g(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),f.call(this)}function w(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}function _(e,t,r,n){var o=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"===typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(n,a),o=!1),o}function k(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=h.from(t,r)),t}function S(e,t,r,n,i,o){if(!r){var a=k(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var n=this._writableState;"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||j(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=m.destroy,g.prototype._undestroy=m.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r("4362"),r("c8ba"))},dc6f:function(e,t,r){"use strict";e.exports=o;var n=r("0c83");(o.prototype=Object.create(n.prototype)).constructor=o;var i=r("e938");function o(){n.call(this)}function a(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},o._configure()},dc74:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("6e41"),i=r("dd7b");class o{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class a{constructor(e,t,r){this.name=e,this.prefix=t,this.baseDecode=r}decode(e){if("string"!==typeof e)throw Error("Can only multibase decode strings");switch(e[0]){case this.prefix:return this.baseDecode(e.slice(1));default:throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}}or(e){const t={[this.prefix]:this,...e.decoders||{[e.prefix]:e}};return new s(t)}}class s{constructor(e){this.decoders=e}or(e){const t=e.decoders||{[e.prefix]:e};return new s({...this.decoders,...t})}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}class c{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new o(e,t,r),this.decoder=new a(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const u=({name:e,prefix:t,encode:r,decode:n})=>new c(e,t,r,n),f=({prefix:e,name:t,alphabet:r})=>{const{encode:o,decode:a}=n(r,t);return u({prefix:e,name:t,encode:o,decode:e=>i.coerce(a(e))})},h=(e,t,r,n)=>{const i={};for(let f=0;f=8&&(s-=8,a[u++]=255&c>>s)}if(s>=r||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return a},d=(e,t,r)=>{const n="="===t[t.length-1],i=(1<r)a-=r,o+=t[i&s>>a]}if(a&&(o+=t[i&s<u({prefix:t,name:e,encode(e){return d(e,n,r)},decode(t){return h(t,n,r,e)}});t.Codec=c,t.baseX=f,t.from=u,t.rfc4648=l},dd7b:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=new Uint8Array(0),i=e=>e.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),o=e=>{const t=e.match(/../g);return t?new Uint8Array(t.map(e=>parseInt(e,16))):n},a=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)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")},c=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),u=e=>(new TextEncoder).encode(e),f=e=>(new TextDecoder).decode(e);t.coerce=s,t.empty=n,t.equals=a,t.fromHex=o,t.fromString=u,t.isBinary=c,t.toHex=i,t.toString=f},decc:function(e,t){e.exports=i;var r=128,n=127;function i(e,t){var o,a=0,s=(t=t||0,0),c=t,u=e.length;do{if(c>=u||s>49)throw i.bytes=0,new RangeError("Could not decode varint");o=e[c++],a+=s<28?(o&n)<=r);return i.bytes=c-t,a}},df7c:function(e,t,r){(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e){"string"!==typeof e&&(e+="");var t,r=0,n=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){r=t+1;break}}else-1===n&&(i=!1,n=t+1);return-1===n?"":e.slice(r,n)}function i(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!n;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,n="/"===a.charAt(0))}return t=r(i(t.split("/"),(function(e){return!!e})),!n).join("/"),(n?"/":"")+t||"."},t.normalize=function(e){var n=t.isAbsolute(e),a="/"===o(e,-1);return e=r(i(e.split("/"),(function(e){return!!e})),!n).join("/"),e||n||(e="."),e&&a&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(i(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t=0;r--)if(""!==e[r])break;return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),o=n(r.split("/")),a=Math.min(i.length,o.length),s=a,c=0;c=1;--o)if(t=e.charCodeAt(o),47===t){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var r=n(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,r=0,n=-1,i=!0,o=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===n&&(i=!1,n=a+1),46===s?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){r=a+1;break}}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===r+1?"":e.slice(t,n)};var o="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,r("4362"))},e07b:function(e,t,r){var n=r("5a76"),i=r("b5ca"),o=r("69f2"),a=r("8707").Buffer,s=r("7d2a"),c=r("9f9d"),u=r("8be6"),f=a.alloc(128),h={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(e,t,r){var n=l(e),i="sha512"===e||"sha384"===e?128:64;t.length>i?t=n(t):t.length{throw new Error("unexpected block API get for "+e)},put:async()=>{throw new Error("unexpected block API put")}};t.of=async(e,t)=>{let r;t=t||{},t.onlyHash=!0,"string"===typeof e&&(e=(new TextEncoder).encode(e));for await(const{cid:o}of n([{content:e}],i,t))r=o;return""+r}},e3db:function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},e4de:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("dc74");const i=n.baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),o=n.baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});t.base58btc=i,t.base58flickr=o},e4e2:function(e,t,r){"use strict";const n=r("65a5");async function*i(e,t=1){for await(const r of n(e,t)){const e=r.map(e=>e().then(e=>({ok:!0,value:e}),e=>({ok:!1,err:e})));for(let t=0;t0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(t){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"===typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"===typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!==typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<=a;f--)c=(c<<1)+n[f];u.push(c)}for(var h=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(a=0;a=0;u--){for(var f=0;u>=0&&0===a[u];u--)f++;if(u>=0&&f++,c=c.dblp(f),u<0)break;var h=a[u];s(0!==h),c="affine"===e.type?h>0?c.mixedAdd(i[h-1>>1]):c.mixedAdd(i[-h-1>>1].neg()):h>0?c.add(i[h-1>>1]):c.add(i[-h-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){var s,c,u,f=this._wnafT1,h=this._wnafT2,d=this._wnafT3,l=0;for(s=0;s=1;s-=2){var b=s-1,m=s;if(1===f[b]&&1===f[m]){var v=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(v[1]=t[b].add(t[m]),v[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(v[1]=t[b].toJ().mixedAdd(t[m]),v[2]=t[b].add(t[m].neg())):(v[1]=t[b].toJ().mixedAdd(t[m]),v[2]=t[b].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],g=a(r[b],r[m]);for(l=Math.max(g[0].length,l),d[b]=new Array(l),d[m]=new Array(l),c=0;c=0;s--){var M=0;while(s>=0){var C=!0;for(c=0;c=0&&M++,k=k.dblp(M),s<0)break;for(c=0;c0?u=h[c][x-1>>1]:x<0&&(u=h[c][-x-1>>1].neg()),k="affine"===u.type?k.mixedAdd(u):k.add(u))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,f=new Uint8Array(c);while(i!==o){for(var h=t[i],d=0,l=c-1;(0!==h||d>>0,f[l]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");n=d,i++}var p=c-n;while(p!==c&&0===f[p])p++;for(var b=s.repeat(r);p>>0,u=new Uint8Array(o);while(e[r]){var f=t[e.charCodeAt(r)];if(255===f)return;for(var h=0,d=o-1;(0!==f||h>>0,u[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=h,r++}if(" "!==e[r]){var l=o-i;while(l!==o&&0===u[l])l++;var p=new Uint8Array(n+(o-l)),b=n;while(l!==o)p[b++]=u[l++];return p}}}function d(e){var t=h(e);if(t)return t;throw new Error("Non-base"+a+" character")}return{encode:f,decodeUnsafe:h,decode:d}}e.exports=n},f12a:function(e,t,r){e.exports=r("faa1").EventEmitter},f140:function(e,t,r){"use strict";const n=r("543b"),{PBLink:i}=r("892c"),{createDagLinkFromB58EncodedHash:o}=r("bf15"),a=e=>{const t={};return e.Data&&e.Data.byteLength>0?t.Data=e.Data:t.Data=null,e.Links&&e.Links.length>0?t.Links=e.Links.map(e=>({Hash:e.Hash.bytes,Name:e.Name,Tsize:e.Tsize})):t.Links=null,t},s=e=>u(a(e)),c=(e,t=[])=>{const r={Data:e,Links:t.map(e=>o(e))};return u(a(r))};function u(e){const t=n.Writer.create();if(null!=e.Links)for(let r=0;r(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n}function c(e,t){var r=[[],[]];e=e.clone(),t=t.clone();var n,i=0,o=0;while(e.cmpn(-i)>0||t.cmpn(-o)>0){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),0===(1&c)?a=0:(n=e.andln(7)+i&7,a=3!==n&&5!==n||2!==u?c:-c),r[0].push(a),0===(1&u)?s=0:(n=t.andln(7)+o&7,s=3!==n&&5!==n||2!==c?u:-u),r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r}function u(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}}function f(e){return"string"===typeof e?n.toArray(e,"hex"):e}function h(e){return new i(e,"hex","le")}n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=s,n.getJSF=c,n.cachedProperty=u,n.parseBytes=f,n.intFromLE=h},f460:function(e,t,r){var n=r("98e6"),i=r("8707").Buffer;function o(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){var r,a=i.alloc(0),s=0;while(a.length>>32-t}function u(e,t,r,n,i,o,a){return c(e+(t&r|~t&n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return c(e+(t&n|r&~n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return c(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return c(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,e[0],3614090360,7),o=u(o,r,n,i,e[1],3905402710,12),i=u(i,o,r,n,e[2],606105819,17),n=u(n,i,o,r,e[3],3250441966,22),r=u(r,n,i,o,e[4],4118548399,7),o=u(o,r,n,i,e[5],1200080426,12),i=u(i,o,r,n,e[6],2821735955,17),n=u(n,i,o,r,e[7],4249261313,22),r=u(r,n,i,o,e[8],1770035416,7),o=u(o,r,n,i,e[9],2336552879,12),i=u(i,o,r,n,e[10],4294925233,17),n=u(n,i,o,r,e[11],2304563134,22),r=u(r,n,i,o,e[12],1804603682,7),o=u(o,r,n,i,e[13],4254626195,12),i=u(i,o,r,n,e[14],2792965006,17),n=u(n,i,o,r,e[15],1236535329,22),r=f(r,n,i,o,e[1],4129170786,5),o=f(o,r,n,i,e[6],3225465664,9),i=f(i,o,r,n,e[11],643717713,14),n=f(n,i,o,r,e[0],3921069994,20),r=f(r,n,i,o,e[5],3593408605,5),o=f(o,r,n,i,e[10],38016083,9),i=f(i,o,r,n,e[15],3634488961,14),n=f(n,i,o,r,e[4],3889429448,20),r=f(r,n,i,o,e[9],568446438,5),o=f(o,r,n,i,e[14],3275163606,9),i=f(i,o,r,n,e[3],4107603335,14),n=f(n,i,o,r,e[8],1163531501,20),r=f(r,n,i,o,e[13],2850285829,5),o=f(o,r,n,i,e[2],4243563512,9),i=f(i,o,r,n,e[7],1735328473,14),n=f(n,i,o,r,e[12],2368359562,20),r=h(r,n,i,o,e[5],4294588738,4),o=h(o,r,n,i,e[8],2272392833,11),i=h(i,o,r,n,e[11],1839030562,16),n=h(n,i,o,r,e[14],4259657740,23),r=h(r,n,i,o,e[1],2763975236,4),o=h(o,r,n,i,e[4],1272893353,11),i=h(i,o,r,n,e[7],4139469664,16),n=h(n,i,o,r,e[10],3200236656,23),r=h(r,n,i,o,e[13],681279174,4),o=h(o,r,n,i,e[0],3936430074,11),i=h(i,o,r,n,e[3],3572445317,16),n=h(n,i,o,r,e[6],76029189,23),r=h(r,n,i,o,e[9],3654602809,4),o=h(o,r,n,i,e[12],3873151461,11),i=h(i,o,r,n,e[15],530742520,16),n=h(n,i,o,r,e[2],3299628645,23),r=d(r,n,i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},f83c:function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},fa45:function(e,t){e.exports=i;var r=128,n=127;function i(e,t){var o,a=0,s=(t=t||0,0),c=t,u=e.length;do{if(c>=u)throw i.bytes=0,new RangeError("Could not decode varint");o=e[c++],a+=s<28?(o&n)<=r);return i.bytes=c-t,a}},faa1:function(e,t,r){"use strict";var n,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};function a(e){console&&console.warn&&console.warn(e)}n=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!==e};function c(){c.init.call(this)}e.exports=c,e.exports.once=w,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var u=10;function f(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function h(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s;if(f(r),o=e._events,void 0===o?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"===typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),i=h(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function b(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?g(i):v(i,i.length)}function m(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(e,t){for(var r=new Array(t),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=i[e];if(void 0===c)return!1;if("function"===typeof c)o(c,this,t);else{var u=c.length,f=v(c,u);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():y(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(e){var t,r,n;if(r=this._events,void 0===r)return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n=0;n--)this.removeListener(e,t[n]);return this},c.prototype.listeners=function(e){return b(this,e,!0)},c.prototype.rawListeners=function(e){return b(this,e,!1)},c.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},c.prototype.listenerCount=m,c.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},fb86:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("ac1b"),i=r("29f9"),o=r("e4de"),a=r("17fb"),s=r("dd7b");class c{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:v,byteLength:v,code:m,version:m,multihash:m,bytes:m,_baseCache:v,asCID:v})}toV0(){switch(this.version){case 0:return this;default:{const{code:e,multihash:t}=this;if(e!==d)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==l)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return c.createV0(t)}}}toV1(){switch(this.version){case 0:{const{code:e,digest:t}=this.multihash,r=i.create(e,t);return c.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&i.equals(this.multihash,e.multihash)}toString(e){const{bytes:t,version:r,_baseCache:n}=this;switch(r){case 0:return f(t,n,e||o.base58btc.encoder);default:return h(t,n,e||a.base32.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return g(/^0\.0/,w),!(!e||!e[b]&&e.asCID!==e)}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof c)return e;if(null!=e&&e.asCID===e){const{version:t,code:r,multihash:n,bytes:i}=e;return new c(t,r,n,i||p(t,r,n.bytes))}if(null!=e&&!0===e[b]){const{version:t,multihash:r,code:n}=e,o=i.decode(r);return c.create(t,n,o)}return null}static create(e,t,r){if("number"!==typeof t)throw new Error("String codecs are no longer supported");switch(e){case 0:if(t!==d)throw new Error(`Version 0 CID must use dag-pb (code: ${d}) block encoding`);return new c(e,t,r,r.bytes);case 1:{const n=p(e,t,r.bytes);return new c(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return c.create(0,d,e)}static createV1(e,t){return c.create(1,e,t)}static decode(e){const[t,r]=c.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){const t=c.inspectBytes(e),r=t.size-t.multihashSize,n=s.coerce(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");const o=n.subarray(t.multihashSize-t.digestSize),a=new i.Digest(t.multihashCode,t.digestSize,o,n),u=0===t.version?c.createV0(a):c.createV1(t.codec,a);return[u,e.subarray(t.size)]}static inspectBytes(e){let t=0;const r=()=>{const[r,i]=n.decode(e.subarray(t));return t+=i,r};let i=r(),o=d;if(18===i?(i=0,t=0):1===i&&(o=r()),0!==i&&1!==i)throw new RangeError("Invalid CID version "+i);const a=t,s=r(),c=r(),u=t+c,f=u-a;return{version:i,codec:o,multihashCode:s,digestSize:c,multihashSize:f,size:u}}static parse(e,t){const[r,n]=u(e,t),i=c.decode(n);return i._baseCache.set(r,e),i}}const u=(e,t)=>{switch(e[0]){case"Q":{const r=t||o.base58btc;return[o.base58btc.prefix,r.decode(`${o.base58btc.prefix}${e}`)]}case o.base58btc.prefix:{const r=t||o.base58btc;return[o.base58btc.prefix,r.decode(e)]}case a.base32.prefix:{const r=t||a.base32;return[a.base32.prefix,r.decode(e)]}default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},f=(e,t,r)=>{const{prefix:n}=r;if(n!==o.base58btc.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);const i=t.get(n);if(null==i){const i=r.encode(e).slice(1);return t.set(n,i),i}return i},h=(e,t,r)=>{const{prefix:n}=r,i=t.get(n);if(null==i){const i=r.encode(e);return t.set(n,i),i}return i},d=112,l=18,p=(e,t,r)=>{const i=n.encodingLength(e),o=i+n.encodingLength(t),a=new Uint8Array(o+r.byteLength);return n.encodeTo(e,a,0),n.encodeTo(t,a,i),a.set(r,o),a},b=Symbol.for("@ipld/js-cid/CID"),m={writable:!1,configurable:!1,enumerable:!0},v={writable:!1,enumerable:!1,configurable:!1},y="0.0.0-dev",g=(e,t)=>{if(!e.test(y))throw new Error(t);console.warn(t)},w="CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n";t.CID=c},fbd5:function(e,t,r){"use strict";var n;function i(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var o=r("9d8a").codes,a=o.ERR_MISSING_ARGS,s=o.ERR_STREAM_DESTROYED;function c(e){if(e)throw e}function u(e){return e.setHeader&&"function"===typeof e.abort}function f(e,t,o,a){a=i(a);var c=!1;e.on("close",(function(){c=!0})),void 0===n&&(n=r("ee93")),n(e,{readable:t,writable:o},(function(e){if(e)return a(e);c=!0,a()}));var f=!1;return function(t){if(!c&&!f)return f=!0,u(e)?e.abort():"function"===typeof e.destroy?e.destroy():void a(t||new s("pipe"))}}function h(e){e()}function d(e,t){return e.pipe(t)}function l(e){return e.length?"function"!==typeof e[e.length-1]?c:e.pop():c}function p(){for(var e=arguments.length,t=new Array(e),r=0;r0;return f(e,a,s,(function(e){n||(n=e),e&&o.forEach(h),a||(o.forEach(h),i(n))}))}));return t.reduce(d)}e.exports=p},fd46:function(e,t,r){"use strict";const n=[255,254,252,248,240,224,192,128],i=[1,3,7,15,31,63,127,255];function o(e,t,r){const n=a(t,r);return(e&n)>>>t}function a(e,t){return n[e]&i[Math.min(t+e-1,7)]}e.exports=class{constructor(e){this._value=e,this._currentBytePos=e.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+8*this._currentBytePos}totalBits(){return 8*this._value.length}take(e){let t=e,r=0;while(t&&this._haveBits()){const e=this._value[this._currentBytePos],n=this._currentBitPos+1,i=Math.min(n,t),a=o(e,n-i,i);r=(r<7)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}}},fda6:function(e,t,r){var n=r("8947"),i=r("4228"),o=r("e85f");function a(){return Object.keys(o)}t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=a},fdac:function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r