@wovin/connect-nftstorage 0.0.8 → 0.0.9-RC2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  var ve=Object.create;var V=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var Ee=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var dt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var ut=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lt=(t,e)=>{for(var r in e)V(t,r,{get:e[r],enumerable:!0})},Se=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of xe(e))!Oe.call(t,o)&&o!==r&&V(t,o,{get:()=>e[o],enumerable:!(n=me(e,o))||n.enumerable});return t};var pt=(t,e,r)=>(r=t!=null?ve(Ee(t)):{},Se(e||!t||!t.__esModule?V(r,"default",{value:t,enumerable:!0}):r,t));var _e=Object.create,$=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,Z=Object.getOwnPropertyNames,Ae=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Ce=(t,e,r)=>e in t?$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,H=(t,e)=>function(){return e||(0,t[Z(t)[0]])((e={exports:{}}).exports,e),e.exports},Ne=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Z(e))!De.call(t,o)&&o!==r&&$(t,o,{get:()=>e[o],enumerable:!(n=Le(e,o))||n.enumerable});return t},Y=(t,e,r)=>(r=t!=null?_e(Ae(t)):{},Ne(e||!t||!t.__esModule?$(r,"default",{value:t,enumerable:!0}):r,t)),D=(t,e,r)=>(Ce(t,typeof e!="symbol"?e+"":e,r),r),Fe=H({"../../node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},r=typeof window<"u"&&typeof window.document<"u",n=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,o=(typeof self>"u"?"undefined":e(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",s=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),a=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";t.isBrowser=r,t.isWebWorker=o,t.isNode=n,t.isJsDom=s,t.isDeno=a}}),Re=H({"../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(t,e){"use strict";e.exports=function(r,n){n||(n={}),typeof n=="function"&&(n={cmp:n});var o=typeof n.cycles=="boolean"?n.cycles:!1,s=n.cmp&&function(c){return function(i){return function(u,d){var h={key:u,value:i[u]},b={key:d,value:i[d]};return c(h,b)}}}(n.cmp),a=[];return function c(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i!==void 0){if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);var u,d;if(Array.isArray(i)){for(d="[",u=0;u<i.length;u++)u&&(d+=","),d+=c(i[u])||"null";return d+"]"}if(i===null)return"null";if(a.indexOf(i)!==-1){if(o)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var h=a.push(i)-1,b=Object.keys(i).sort(s&&s(i));for(d="",u=0;u<b.length;u++){var L=b[u],f=c(i[L]);f&&(d&&(d+=","),d+=JSON.stringify(L)+":"+f)}return a.splice(h,1),"{"+d+"}"}}(r)}}}),z=Y(Fe(),1),Ie=Y(Re(),1),ee=!1,te=!1;z.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(ee=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(te=process?.env?.LOGGER_PERF_PREFIX==="true"));var Ue=Object.freeze({prefix:void 0,time:ee,delta:te,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0}),G=[],re=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(t,e,r,n){Object.assign(this,{sinceFirst:t,sinceLast:e,time:r,delta:n})}toString(){let t=this.sinceFirst*.001,e=t.toFixed(t<5?2:1),r=this.sinceLast<1e3?`${this.sinceLast.toFixed(0)}`.padStart(5," "):`${`${(this.sinceLast*.001).toFixed(this.sinceLast<1e4?1:0)}`.padStart(4," ")}s`;return`[${[this.time?e:null,this.delta?r:null].join(",")}]`}},ne=class{constructor(t,e){Object.assign(this,{style:t,string:e})}},U=!1,p=class{static setup(t=p.INFO,e={}){e=Object.assign({},Ue,e),t>10&&console.debug("setup logger",{config:e});let r=this.wrapLog(console.debug,{...e,dim:e.dimDebugOnServer}),n=(...i)=>{window?.FORCE_DISABLE_LOGLEVEL&&r(...i)};n.isDisabled=!0,n.isEnabled=!1;let o=this.wrapLog(console.groupCollapsed,e),s=(i,u)=>{function d(...b){let L=b[b.length-1];return L===n?L():(o(...b.slice(0,-1)),(async()=>{try{let l=L();return l instanceof Promise?await l:l}finally{console.groupEnd()}})())}let h=Object.assign(u.bind({}),{isEnabled:i,isDisabled:!i,group:d,force:u});return i?h:Object.assign(n.bind({}),{isEnabled:i,isDisabled:!i,group:d,force:h})},a=s(t>=p.ERROR,this.wrapLog(console.error,e));return{ERROR:(...i)=>(a(...i),new Error((0,Ie.default)(i))),WARN:s(t>=p.WARN,this.wrapLog(console.warn,e)),LOG:s(t>=p.INFO,this.wrapLog(console.log,e)),DEBUG:s(t>=p.DEBUG,this.wrapLog(console.log,{...e,dim:e.dimDebugOnServer})),VERBOSE:s(t>=p.VERBOSE,this.wrapLog(console.debug,{...e,dim:e.dimDebugOnServer}))}}static wrapLog(t,e){if(z.isNode)return t.bind(console);{let r=[];if(e.time||e.delta){let o=z.isBrowser&&navigator.userAgent.includes("Chrome")?["",p.timeStr(!!e.time,!!e.delta)]:[];r.push(...o)}return e.prefix&&(U?r.push(new ne("dim",e.prefix)):r.push(e.prefix)),t.bind(console,...r)}}static timeStr(t,e,r=0){if(!performance.now)return;let n=performance.now();p.firstLog||(p.firstLog=n,p.lastLog=n);let o=new re(n-p.firstLog,n-p.lastLog,t,e);return p.lastLog=n,r?o.toString():o}static getOriginFromStack(t){let e=!1;for(let r of t.split(`
2
- `)){let n=r.match(/^\s+at\s+(.*)/);if(n){if(e)return n[1].trim().replace(__dirname,"");e=!0}}}},S=p;D(S,"ERROR",2);D(S,"WARN",4);D(S,"INFO",6);D(S,"LOG",6);D(S,"DEBUG",8);D(S,"VERBOSE",10);D(S,"firstLog",0);D(S,"lastLog",0);z.isBrowser?(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:t=>{if(G&&G.length){for(let e of G)if(e.match(t))return["span",{},e.format(t)]}return null},hasBody:()=>!0},{header:t=>{if(!(t instanceof re))return null;U||(U=!0);let e=S.timeStr(t.time,t.delta);return["span",{style:"font-weight: light; color: grey"},e?.toString()]},hasBody:()=>!1},{header:t=>t instanceof ne?(U||(U=!0),["span",{style:"font-weight: light; color: grey; "},t.string]):null,hasBody:()=>!1})):z.isNode;function ze(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<t.length;o++){var s=t.charAt(o),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=o}var c=t.length,i=t.charAt(0),u=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function h(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var l=0,C=0,g=0,v=f.length;g!==v&&f[g]===0;)g++,l++;for(var m=(v-g)*d+1>>>0,w=new Uint8Array(m);g!==v;){for(var x=f[g],A=0,y=m-1;(x!==0||A<C)&&y!==-1;y--,A++)x+=256*w[y]>>>0,w[y]=x%c>>>0,x=x/c>>>0;if(x!==0)throw new Error("Non-zero carry");C=A,g++}for(var O=m-C;O!==m&&w[O]===0;)O++;for(var j=i.repeat(l);O<m;++O)j+=t.charAt(w[O]);return j}function b(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var l=0;if(f[l]!==" "){for(var C=0,g=0;f[l]===i;)C++,l++;for(var v=(f.length-l)*u+1>>>0,m=new Uint8Array(v);f[l];){var w=r[f.charCodeAt(l)];if(w===255)return;for(var x=0,A=v-1;(w!==0||x<g)&&A!==-1;A--,x++)w+=c*m[A]>>>0,m[A]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");g=x,l++}if(f[l]!==" "){for(var y=v-g;y!==v&&m[y]===0;)y++;for(var O=new Uint8Array(C+(v-y)),j=C;y!==v;)O[j++]=m[y++];return O}}}function L(f){var l=b(f);if(l)return l;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:b,decode:L}}var Be=ze,Me=Be,oe=Me;var mt=new Uint8Array(0);var se=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},N=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var k=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},J=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return ie(this,e)}},q=class{constructor(e){this.decoders=e}or(e){return ie(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},ie=(t,e)=>new q({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),W=class{constructor(e,r,n,o){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new k(e,r,n),this.decoder=new J(e,r,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ae=({name:t,prefix:e,encode:r,decode:n})=>new W(t,e,r,n),X=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:o}=oe(r,e);return ae({prefix:t,name:e,encode:n,decode:s=>N(o(s))})},Pe=(t,e,r,n)=>{let o={};for(let d=0;d<e.length;++d)o[e[d]]=d;let s=t.length;for(;t[s-1]==="=";)--s;let a=new Uint8Array(s*r/8|0),c=0,i=0,u=0;for(let d=0;d<s;++d){let h=o[t[d]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);i=i<<r|h,c+=r,c>=8&&(c-=8,a[u++]=255&i>>c)}if(c>=r||255&i<<8-c)throw new SyntaxError("Unexpected end of data");return a},Te=(t,e,r)=>{let n=e[e.length-1]==="=",o=(1<<r)-1,s="",a=0,c=0;for(let i=0;i<t.length;++i)for(c=c<<8|t[i],a+=8;a>r;)a-=r,s+=e[o&c>>a];if(a&&(s+=e[o&c<<r-a]),n)for(;s.length*r&7;)s+="=";return s},E=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>ae({prefix:e,name:t,encode(o){return Te(o,n,r)},decode(o){return Pe(o,n,r,t)}});var B=E({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Lt=E({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),At=E({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Dt=E({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ct=E({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Nt=E({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ft=E({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Rt=E({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),It=E({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var _=X({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Bt=X({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var je=de,ce=128,Ve=127,Ge=~Ve,$e=Math.pow(2,31);function de(t,e,r){e=e||[],r=r||0;for(var n=r;t>=$e;)e[r++]=t&255|ce,t/=128;for(;t&Ge;)e[r++]=t&255|ce,t>>>=7;return e[r]=t|0,de.bytes=r-n+1,e}var ke=Q,Je=128,fe=127;function Q(t,n){var r=0,n=n||0,o=0,s=n,a,c=t.length;do{if(s>=c)throw Q.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=o<28?(a&fe)<<o:(a&fe)*Math.pow(2,o),o+=7}while(a>=Je);return Q.bytes=s-n,r}var qe=Math.pow(2,7),We=Math.pow(2,14),Xe=Math.pow(2,21),Qe=Math.pow(2,28),Ke=Math.pow(2,35),Ze=Math.pow(2,42),He=Math.pow(2,49),Ye=Math.pow(2,56),et=Math.pow(2,63),tt=function(t){return t<qe?1:t<We?2:t<Xe?3:t<Qe?4:t<Ke?5:t<Ze?6:t<He?7:t<Ye?8:t<et?9:10},rt={encode:je,decode:ke,encodingLength:tt},nt=rt,M=nt;var P=(t,e=0)=>[M.decode(t,e),M.decode.bytes],F=(t,e,r=0)=>(M.encode(t,e,r),e),R=t=>M.encodingLength(t);var le=(t,e)=>{let r=e.byteLength,n=R(t),o=n+R(r),s=new Uint8Array(o+r);return F(t,s,0),F(r,s,n),s.set(e,o),new I(t,r,e,s)},pe=t=>{let e=N(t),[r,n]=P(e),[o,s]=P(e.subarray(n)),a=e.subarray(n+s);if(a.byteLength!==o)throw new Error("Incorrect length");return new I(r,o,a,e)},he=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&se(t.bytes,r.bytes)}},I=class{constructor(e,r,n,o){this.code=e,this.size=r,this.digest=n,this.bytes=o}};var be=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return it(r,K(t),e||_.encoder);default:return at(r,K(t),e||B.encoder)}};var we=new WeakMap,K=t=>{let e=we.get(t);if(e==null){let r=new Map;return we.set(t,r),r}return e},ge=class t{constructor(e,r,n,o){this.code=r,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==T)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==ct)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=le(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&he(e.multihash,n.multihash)}toString(e){return be(this,e)}toJSON(){return{"/":be(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:o,multihash:s,bytes:a}=r;return new t(n,o,s,a||ye(n,o,s.bytes))}else if(r[ft]===!0){let{version:n,multihash:o,code:s}=r,a=pe(o);return t.create(n,s,a)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==T)throw new Error(`Version 0 CID must use dag-pb (code: ${T}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let o=ye(e,r,n.bytes);return new t(e,r,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,T,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,o=N(e.subarray(n,n+r.multihashSize));if(o.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=o.subarray(r.multihashSize-r.digestSize),a=new I(r.multihashCode,r.digestSize,s,o);return[r.version===0?t.createV0(a):t.createV1(r.codec,a),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,b]=P(e.subarray(r));return r+=b,h},o=n(),s=T;if(o===18?(o=0,r=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let a=r,c=n(),i=n(),u=r+i,d=u-a;return{version:o,codec:s,multihashCode:c,digestSize:i,multihashSize:d,size:u}}static parse(e,r){let[n,o]=st(e,r),s=t.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return K(s).set(n,e),s}},st=(t,e)=>{switch(t[0]){case"Q":{let r=e||_;return[_.prefix,r.decode(`${_.prefix}${t}`)]}case _.prefix:{let r=e||_;return[_.prefix,r.decode(t)]}case B.prefix:{let r=e||B;return[B.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},it=(t,e,r)=>{let{prefix:n}=r;if(n!==_.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let o=e.get(n);if(o==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return o},at=(t,e,r)=>{let{prefix:n}=r,o=e.get(n);if(o==null){let s=r.encode(t);return e.set(n,s),s}else return o},T=112,ct=18,ye=(t,e,r)=>{let n=R(t),o=n+R(e),s=new Uint8Array(o+r.byteLength);return F(t,s,0),F(e,s,n),s.set(r,o),s},ft=Symbol.for("@ipld/js-cid/CID");export{dt as a,ut as b,lt as c,pt as d,S as e,pe as f,ge as g};
3
- //# sourceMappingURL=chunk-SOBCOB7T.min.js.map
2
+ `)){let n=r.match(/^\s+at\s+(.*)/);if(n){if(e)return n[1].trim().replace(__dirname,"");e=!0}}}},S=p;D(S,"ERROR",2);D(S,"WARN",4);D(S,"INFO",6);D(S,"LOG",6);D(S,"DEBUG",8);D(S,"VERBOSE",10);D(S,"firstLog",0);D(S,"lastLog",0);z.isBrowser?(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:t=>{if(G&&G.length){for(let e of G)if(e.match(t))return["span",{},e.format(t)]}return null},hasBody:()=>!0},{header:t=>{if(!(t instanceof re))return null;U||(U=!0);let e=S.timeStr(t.time,t.delta);return["span",{style:"font-weight: light; color: grey"},e?.toString()]},hasBody:()=>!1},{header:t=>t instanceof ne?(U||(U=!0),["span",{style:"font-weight: light; color: grey; "},t.string]):null,hasBody:()=>!1})):z.isNode;function ze(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<t.length;o++){var s=t.charAt(o),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=o}var c=t.length,i=t.charAt(0),u=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function h(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var l=0,C=0,g=0,v=f.length;g!==v&&f[g]===0;)g++,l++;for(var m=(v-g)*d+1>>>0,w=new Uint8Array(m);g!==v;){for(var x=f[g],A=0,y=m-1;(x!==0||A<C)&&y!==-1;y--,A++)x+=256*w[y]>>>0,w[y]=x%c>>>0,x=x/c>>>0;if(x!==0)throw new Error("Non-zero carry");C=A,g++}for(var O=m-C;O!==m&&w[O]===0;)O++;for(var j=i.repeat(l);O<m;++O)j+=t.charAt(w[O]);return j}function b(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var l=0;if(f[l]!==" "){for(var C=0,g=0;f[l]===i;)C++,l++;for(var v=(f.length-l)*u+1>>>0,m=new Uint8Array(v);f[l];){var w=r[f.charCodeAt(l)];if(w===255)return;for(var x=0,A=v-1;(w!==0||x<g)&&A!==-1;A--,x++)w+=c*m[A]>>>0,m[A]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");g=x,l++}if(f[l]!==" "){for(var y=v-g;y!==v&&m[y]===0;)y++;for(var O=new Uint8Array(C+(v-y)),j=C;y!==v;)O[j++]=m[y++];return O}}}function L(f){var l=b(f);if(l)return l;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:b,decode:L}}var Be=ze,Me=Be,oe=Me;var mt=new Uint8Array(0);var se=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},N=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var k=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},J=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return ie(this,e)}},q=class{constructor(e){this.decoders=e}or(e){return ie(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},ie=(t,e)=>new q({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),W=class{constructor(e,r,n,o){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new k(e,r,n),this.decoder=new J(e,r,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ae=({name:t,prefix:e,encode:r,decode:n})=>new W(t,e,r,n),X=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:o}=oe(r,e);return ae({prefix:t,name:e,encode:n,decode:s=>N(o(s))})},Pe=(t,e,r,n)=>{let o={};for(let d=0;d<e.length;++d)o[e[d]]=d;let s=t.length;for(;t[s-1]==="=";)--s;let a=new Uint8Array(s*r/8|0),c=0,i=0,u=0;for(let d=0;d<s;++d){let h=o[t[d]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);i=i<<r|h,c+=r,c>=8&&(c-=8,a[u++]=255&i>>c)}if(c>=r||255&i<<8-c)throw new SyntaxError("Unexpected end of data");return a},Te=(t,e,r)=>{let n=e[e.length-1]==="=",o=(1<<r)-1,s="",a=0,c=0;for(let i=0;i<t.length;++i)for(c=c<<8|t[i],a+=8;a>r;)a-=r,s+=e[o&c>>a];if(a&&(s+=e[o&c<<r-a]),n)for(;s.length*r&7;)s+="=";return s},E=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>ae({prefix:e,name:t,encode(o){return Te(o,n,r)},decode(o){return Pe(o,n,r,t)}});var B=E({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Lt=E({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),At=E({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Dt=E({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ct=E({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Nt=E({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ft=E({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Rt=E({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),It=E({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var _=X({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Bt=X({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var je=de,ce=128,Ve=127,Ge=~Ve,$e=Math.pow(2,31);function de(t,e,r){e=e||[],r=r||0;for(var n=r;t>=$e;)e[r++]=t&255|ce,t/=128;for(;t&Ge;)e[r++]=t&255|ce,t>>>=7;return e[r]=t|0,de.bytes=r-n+1,e}var ke=Q,Je=128,fe=127;function Q(t,n){var r=0,n=n||0,o=0,s=n,a,c=t.length;do{if(s>=c)throw Q.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=o<28?(a&fe)<<o:(a&fe)*Math.pow(2,o),o+=7}while(a>=Je);return Q.bytes=s-n,r}var qe=Math.pow(2,7),We=Math.pow(2,14),Xe=Math.pow(2,21),Qe=Math.pow(2,28),Ke=Math.pow(2,35),Ze=Math.pow(2,42),He=Math.pow(2,49),Ye=Math.pow(2,56),et=Math.pow(2,63),tt=function(t){return t<qe?1:t<We?2:t<Xe?3:t<Qe?4:t<Ke?5:t<Ze?6:t<He?7:t<Ye?8:t<et?9:10},rt={encode:je,decode:ke,encodingLength:tt},nt=rt,M=nt;var P=(t,e=0)=>[M.decode(t,e),M.decode.bytes],F=(t,e,r=0)=>(M.encode(t,e,r),e),R=t=>M.encodingLength(t);var le=(t,e)=>{let r=e.byteLength,n=R(t),o=n+R(r),s=new Uint8Array(o+r);return F(t,s,0),F(r,s,n),s.set(e,o),new I(t,r,e,s)},pe=t=>{let e=N(t),[r,n]=P(e),[o,s]=P(e.subarray(n)),a=e.subarray(n+s);if(a.byteLength!==o)throw new Error("Incorrect length");return new I(r,o,a,e)},he=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&se(t.bytes,r.bytes)}},I=class{constructor(e,r,n,o){this.code=e,this.size=r,this.digest=n,this.bytes=o}};var be=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return it(r,K(t),e||_.encoder);default:return at(r,K(t),e||B.encoder)}};var we=new WeakMap,K=t=>{let e=we.get(t);if(e==null){let r=new Map;return we.set(t,r),r}return e},ge=class t{constructor(e,r,n,o){this.code=r,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==T)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==ct)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=le(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&he(e.multihash,n.multihash)}toString(e){return be(this,e)}toJSON(){return{"/":be(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:o,multihash:s,bytes:a}=r;return new t(n,o,s,a||ye(n,o,s.bytes))}else if(r[ft]===!0){let{version:n,multihash:o,code:s}=r,a=pe(o);return t.create(n,s,a)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==T)throw new Error(`Version 0 CID must use dag-pb (code: ${T}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let o=ye(e,r,n.bytes);return new t(e,r,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,T,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,o=N(e.subarray(n,n+r.multihashSize));if(o.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=o.subarray(r.multihashSize-r.digestSize),a=new I(r.multihashCode,r.digestSize,s,o);return[r.version===0?t.createV0(a):t.createV1(r.codec,a),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,b]=P(e.subarray(r));return r+=b,h},o=n(),s=T;if(o===18?(o=0,r=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let a=r,c=n(),i=n(),u=r+i,d=u-a;return{version:o,codec:s,multihashCode:c,digestSize:i,multihashSize:d,size:u}}static parse(e,r){let[n,o]=st(e,r),s=t.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return K(s).set(n,e),s}},st=(t,e)=>{switch(t[0]){case"Q":{let r=e||_;return[_.prefix,r.decode(`${_.prefix}${t}`)]}case _.prefix:{let r=e||_;return[_.prefix,r.decode(t)]}case B.prefix:{let r=e||B;return[B.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},it=(t,e,r)=>{let{prefix:n}=r;if(n!==_.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let o=e.get(n);if(o==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return o},at=(t,e,r)=>{let{prefix:n}=r,o=e.get(n);if(o==null){let s=r.encode(t);return e.set(n,s),s}else return o},T=112,ct=18,ye=(t,e,r)=>{let n=R(t),o=n+R(e),s=new Uint8Array(o+r.byteLength);return F(t,s,0),F(e,s,n),s.set(r,o),s},ft=Symbol.for("@ipld/js-cid/CID");export{dt as a,ut as b,lt as c,pt as d,S as e,X as f,pe as g,ge as h};
3
+ //# sourceMappingURL=chunk-4SMICCLF.min.js.map