@wovin/core 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/applog/applog-helpers.d.ts +5 -6
- package/dist/applog/applog-helpers.d.ts.map +1 -1
- package/dist/applog/applog-utils.d.ts +2 -1
- package/dist/applog/applog-utils.d.ts.map +1 -1
- package/dist/applog/datom-types.d.ts +34 -2
- package/dist/applog/datom-types.d.ts.map +1 -1
- package/dist/applog.min.js +90 -1
- package/dist/chunk-2J7BWXZ3.min.js +4373 -0
- package/dist/{chunk-G3GOAFHU.min.js.map → chunk-2J7BWXZ3.min.js.map} +1 -1
- package/dist/chunk-5MMGBK2U.min.js +1 -0
- package/dist/chunk-5MMGBK2U.min.js.map +1 -0
- package/dist/chunk-6BFNER6K.min.js +120 -0
- package/dist/chunk-6BFNER6K.min.js.map +1 -0
- package/dist/chunk-KRQZ6V4Y.min.js +36 -0
- package/dist/chunk-KRQZ6V4Y.min.js.map +1 -0
- package/dist/chunk-N4QMZPZF.min.js +10844 -0
- package/dist/chunk-N4QMZPZF.min.js.map +1 -0
- package/dist/chunk-ORHJN4G2.min.js +1425 -0
- package/dist/chunk-ORHJN4G2.min.js.map +1 -0
- package/dist/chunk-PTGUFZ3Q.min.js +1555 -0
- package/dist/chunk-PTGUFZ3Q.min.js.map +1 -0
- package/dist/chunk-YOCP7FGE.min.js +66 -0
- package/dist/chunk-YOCP7FGE.min.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.min.js +252 -1
- package/dist/index.min.js.map +1 -1
- package/dist/ipfs/car.d.ts +2 -0
- package/dist/ipfs/car.d.ts.map +1 -1
- package/dist/ipfs.min.js +32 -1
- package/dist/mobx/mobx-utils.d.ts +19 -11
- package/dist/mobx/mobx-utils.d.ts.map +1 -1
- package/dist/pubsub.min.js +21 -1
- package/dist/query/basic.d.ts +16 -31
- package/dist/query/basic.d.ts.map +1 -1
- package/dist/query/divergences.d.ts +2 -2
- package/dist/query/divergences.d.ts.map +1 -1
- package/dist/query/query-steps.d.ts +4 -0
- package/dist/query/query-steps.d.ts.map +1 -0
- package/dist/query/types.d.ts +29 -0
- package/dist/query/types.d.ts.map +1 -0
- package/dist/query.d.ts +1 -0
- package/dist/query.d.ts.map +1 -1
- package/dist/query.min.js +71 -1
- package/dist/thread/basic.d.ts +12 -6
- package/dist/thread/basic.d.ts.map +1 -1
- package/dist/thread/filters.d.ts +10 -6
- package/dist/thread/filters.d.ts.map +1 -1
- package/dist/thread/mapped.d.ts +3 -4
- package/dist/thread/mapped.d.ts.map +1 -1
- package/dist/thread/writeable.d.ts +3 -2
- package/dist/thread/writeable.d.ts.map +1 -1
- package/dist/thread.min.js +37 -1
- package/dist/types/typescript-utils.d.ts +6 -2
- package/dist/types/typescript-utils.d.ts.map +1 -1
- package/dist/types.min.js +30 -1
- package/package.json +83 -83
- package/dist/chunk-5Q6PAAMY.min.js +0 -2
- package/dist/chunk-5Q6PAAMY.min.js.map +0 -1
- package/dist/chunk-BR5DELY4.min.js +0 -2
- package/dist/chunk-BR5DELY4.min.js.map +0 -1
- package/dist/chunk-D6REGRIL.min.js +0 -2
- package/dist/chunk-D6REGRIL.min.js.map +0 -1
- package/dist/chunk-G3GOAFHU.min.js +0 -8
- package/dist/chunk-IVEP7DZW.min.js +0 -45
- package/dist/chunk-IVEP7DZW.min.js.map +0 -1
- package/dist/chunk-J5PGGKKW.min.js +0 -2
- package/dist/chunk-J5PGGKKW.min.js.map +0 -1
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var un=Object.create;var qe=Object.defineProperty;var dn=Object.getOwnPropertyDescriptor;var pn=Object.getOwnPropertyNames;var hn=Object.getPrototypeOf,ln=Object.prototype.hasOwnProperty;var ii=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ot=(e,t)=>{for(var r in t)qe(e,r,{get:t[r],enumerable:!0})},mn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of pn(t))!ln.call(e,o)&&o!==r&&qe(e,o,{get:()=>t[o],enumerable:!(n=dn(t,o))||n.enumerable});return e};var si=(e,t,r)=>(r=e!=null?un(hn(e)):{},mn(t||!e||!e.__esModule?qe(r,"default",{value:e,enumerable:!0}):r,e));var _t={};Ot(_t,{code:()=>Et,decode:()=>Jr,encode:()=>Pe,format:()=>Io,name:()=>Bo,parse:()=>To,stringify:()=>Io});var xn=["string","number","bigint","symbol"],yn=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Nt(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(xn.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(gn(e))return"Buffer";let r=wn(e);return r||"Object"}function gn(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function wn(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(yn.includes(t))return t}var s=class{constructor(t,r,n){this.major=t,this.majorEncoded=t<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(t){return this.major<t.major?-1:this.major>t.major?1:0}};s.uint=new s(0,"uint",!0);s.negint=new s(1,"negint",!0);s.bytes=new s(2,"bytes",!0);s.string=new s(3,"string",!0);s.array=new s(4,"array",!1);s.map=new s(5,"map",!1);s.tag=new s(6,"tag",!1);s.float=new s(7,"float",!0);s.false=new s(7,"false",!0);s.true=new s(7,"true",!0);s.null=new s(7,"null",!0);s.undefined=new s(7,"undefined",!0);s.break=new s(7,"break",!0);var f=class{constructor(t,r,n){this.type=t,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};var ne=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",bn=new TextDecoder,En=new TextEncoder;function Be(e){return ne&&globalThis.Buffer.isBuffer(e)}function le(e){return e instanceof Uint8Array?Be(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var Lt=ne?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Dt(e,t,r):(e,t,r)=>r-t>64?bn.decode(e.subarray(t,r)):Dt(e,t,r),Ie=ne?e=>e.length>64?globalThis.Buffer.from(e):$t(e):e=>e.length>64?En.encode(e):$t(e),V=e=>Uint8Array.from(e),oe=ne?(e,t,r)=>Be(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Mt=ne?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),le(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let o of e)n+o.length>r.length&&(o=o.subarray(0,r.length-n)),r.set(o,n),n+=o.length;return r},Rt=ne?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function jt(e,t){if(Be(e)&&Be(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function $t(e){let t=[],r=0;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);o<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=o&63|128):(o&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(o=65536+((o&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=o&63|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=o&63|128)}return t}function Dt(e,t,r){let n=[];for(;t<r;){let o=e[t],i=null,a=o>239?4:o>223?3:o>191?2:1;if(t+a<=r){let c,u,m,h;switch(a){case 1:o<128&&(i=o);break;case 2:c=e[t+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(i=h));break;case 3:c=e[t+1],u=e[t+2],(c&192)===128&&(u&192)===128&&(h=(o&15)<<12|(c&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(i=h));break;case 4:c=e[t+1],u=e[t+2],m=e[t+3],(c&192)===128&&(u&192)===128&&(m&192)===128&&(h=(o&15)<<18|(c&63)<<12|(u&63)<<6|m&63,h>65535&&h<1114112&&(i=h))}}i===null?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),t+=a}return Je(n)}var Ft=4096;function Je(e){let t=e.length;if(t<=Ft)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Ft));return r}var _n=256,me=class{constructor(t=_n){this.chunkSize=t,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(t){let r=this.chunks[this.chunks.length-1];if(this.cursor+t.length<=this.maxCursor+1){let o=r.length-(this.maxCursor-this.cursor)-1;r.set(t,o)}else{if(r){let o=r.length-(this.maxCursor-this.cursor)-1;o<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,o),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=Rt(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(t,0)):(this.chunks.push(t),this.maxCursor+=t.length)}this.cursor+=t.length}toBytes(t=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];t&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=oe(n,0,this.cursor)}else r=Mt(this.chunks,this.cursor);return t&&this.reset(),r}};var p="CBOR decode error:",W="CBOR encode error:",xe=[];xe[23]=1;xe[24]=2;xe[25]=3;xe[26]=5;xe[27]=9;function q(e,t,r){if(e.length-t<r)throw new Error(`${p} not enough data for type`)}var b=[24,256,65536,4294967296,BigInt("18446744073709551616")];function S(e,t,r){q(e,t,1);let n=e[t];if(r.strict===!0&&n<b[0])throw new Error(`${p} integer encoded in more bytes than necessary (strict decode)`);return n}function U(e,t,r){q(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<b[1])throw new Error(`${p} integer encoded in more bytes than necessary (strict decode)`);return n}function B(e,t,r){q(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<b[2])throw new Error(`${p} integer encoded in more bytes than necessary (strict decode)`);return n}function I(e,t,r){q(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],o=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],i=(BigInt(n)<<BigInt(32))+BigInt(o);if(r.strict===!0&&i<b[3])throw new Error(`${p} integer encoded in more bytes than necessary (strict decode)`);if(i<=Number.MAX_SAFE_INTEGER)return Number(i);if(r.allowBigInt===!0)return i;throw new Error(`${p} integers outside of the safe integer range are not supported`)}function Pt(e,t,r,n){return new f(s.uint,S(e,t+1,n),2)}function zt(e,t,r,n){return new f(s.uint,U(e,t+1,n),3)}function Vt(e,t,r,n){return new f(s.uint,B(e,t+1,n),5)}function Gt(e,t,r,n){return new f(s.uint,I(e,t+1,n),9)}function T(e,t){return E(e,0,t.value)}function E(e,t,r){if(r<b[0]){let n=Number(r);e.push([t|n])}else if(r<b[1]){let n=Number(r);e.push([t|24,n])}else if(r<b[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<b[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<b[4]){let o=[t|27,0,0,0,0,0,0,0],i=Number(n&BigInt(4294967295)),a=Number(n>>BigInt(32)&BigInt(4294967295));o[8]=i&255,i=i>>8,o[7]=i&255,i=i>>8,o[6]=i&255,i=i>>8,o[5]=i&255,o[4]=a&255,a=a>>8,o[3]=a&255,a=a>>8,o[2]=a&255,a=a>>8,o[1]=a&255,e.push(o)}else throw new Error(`${p} encountered BigInt larger than allowable range`)}}T.encodedSize=function(t){return E.encodedSize(t.value)};E.encodedSize=function(t){return t<b[0]?1:t<b[1]?2:t<b[2]?3:t<b[3]?5:9};T.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function Wt(e,t,r,n){return new f(s.negint,-1-S(e,t+1,n),2)}function qt(e,t,r,n){return new f(s.negint,-1-U(e,t+1,n),3)}function Jt(e,t,r,n){return new f(s.negint,-1-B(e,t+1,n),5)}var He=BigInt(-1),Ht=BigInt(1);function Xt(e,t,r,n){let o=I(e,t+1,n);if(typeof o!="bigint"){let i=-1-o;if(i>=Number.MIN_SAFE_INTEGER)return new f(s.negint,i,9)}if(n.allowBigInt!==!0)throw new Error(`${p} integers outside of the safe integer range are not supported`);return new f(s.negint,He-BigInt(o),9)}function Ce(e,t){let r=t.value,n=typeof r=="bigint"?r*He-Ht:r*-1-1;E(e,t.type.majorEncoded,n)}Ce.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*He-Ht:r*-1-1;return n<b[0]?1:n<b[1]?2:n<b[2]?3:n<b[3]?5:9};Ce.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function ye(e,t,r,n){q(e,t,r+n);let o=oe(e,t+r,t+r+n);return new f(s.bytes,o,r+n)}function Kt(e,t,r,n){return ye(e,t,1,r)}function Qt(e,t,r,n){return ye(e,t,2,S(e,t+1,n))}function Zt(e,t,r,n){return ye(e,t,3,U(e,t+1,n))}function Yt(e,t,r,n){return ye(e,t,5,B(e,t+1,n))}function er(e,t,r,n){let o=I(e,t+1,n);if(typeof o=="bigint")throw new Error(`${p} 64-bit integer bytes lengths not supported`);return ye(e,t,9,o)}function Te(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===s.string?Ie(e.value):e.value),e.encodedBytes}function ie(e,t){let r=Te(t);E(e,t.type.majorEncoded,r.length),e.push(r)}ie.encodedSize=function(t){let r=Te(t);return E.encodedSize(r.length)+r.length};ie.compareTokens=function(t,r){return kn(Te(t),Te(r))};function kn(e,t){return e.length<t.length?-1:e.length>t.length?1:jt(e,t)}function ge(e,t,r,n,o){let i=r+n;q(e,t,i);let a=new f(s.string,Lt(e,t+r,t+i),i);return o.retainStringBytes===!0&&(a.byteValue=oe(e,t+r,t+i)),a}function tr(e,t,r,n){return ge(e,t,1,r,n)}function rr(e,t,r,n){return ge(e,t,2,S(e,t+1,n),n)}function nr(e,t,r,n){return ge(e,t,3,U(e,t+1,n),n)}function or(e,t,r,n){return ge(e,t,5,B(e,t+1,n),n)}function ir(e,t,r,n){let o=I(e,t+1,n);if(typeof o=="bigint")throw new Error(`${p} 64-bit integer string lengths not supported`);return ge(e,t,9,o,n)}var sr=ie;function se(e,t,r,n){return new f(s.array,n,r)}function ar(e,t,r,n){return se(e,t,1,r)}function cr(e,t,r,n){return se(e,t,2,S(e,t+1,n))}function fr(e,t,r,n){return se(e,t,3,U(e,t+1,n))}function ur(e,t,r,n){return se(e,t,5,B(e,t+1,n))}function dr(e,t,r,n){let o=I(e,t+1,n);if(typeof o=="bigint")throw new Error(`${p} 64-bit integer array lengths not supported`);return se(e,t,9,o)}function pr(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${p} indefinite length items not allowed`);return se(e,t,1,1/0)}function Oe(e,t){E(e,s.array.majorEncoded,t.value)}Oe.compareTokens=T.compareTokens;Oe.encodedSize=function(t){return E.encodedSize(t.value)};function ae(e,t,r,n){return new f(s.map,n,r)}function hr(e,t,r,n){return ae(e,t,1,r)}function lr(e,t,r,n){return ae(e,t,2,S(e,t+1,n))}function mr(e,t,r,n){return ae(e,t,3,U(e,t+1,n))}function xr(e,t,r,n){return ae(e,t,5,B(e,t+1,n))}function yr(e,t,r,n){let o=I(e,t+1,n);if(typeof o=="bigint")throw new Error(`${p} 64-bit integer map lengths not supported`);return ae(e,t,9,o)}function gr(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${p} indefinite length items not allowed`);return ae(e,t,1,1/0)}function Ne(e,t){E(e,s.map.majorEncoded,t.value)}Ne.compareTokens=T.compareTokens;Ne.encodedSize=function(t){return E.encodedSize(t.value)};function wr(e,t,r,n){return new f(s.tag,r,1)}function br(e,t,r,n){return new f(s.tag,S(e,t+1,n),2)}function Er(e,t,r,n){return new f(s.tag,U(e,t+1,n),3)}function _r(e,t,r,n){return new f(s.tag,B(e,t+1,n),5)}function vr(e,t,r,n){return new f(s.tag,I(e,t+1,n),9)}function $e(e,t){E(e,s.tag.majorEncoded,t.value)}$e.compareTokens=T.compareTokens;$e.encodedSize=function(t){return E.encodedSize(t.value)};var Cn=20,Tn=21,On=22,Nn=23;function kr(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${p} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new f(s.null,null,1):new f(s.undefined,void 0,1)}function Ar(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${p} indefinite length items not allowed`);return new f(s.break,void 0,1)}function Xe(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${p} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${p} Infinity values are not supported`)}return new f(s.float,e,t)}function Sr(e,t,r,n){return Xe(Ke(e,t+1),3,n)}function Ur(e,t,r,n){return Xe(Qe(e,t+1),5,n)}function Br(e,t,r,n){return Xe(Or(e,t+1),9,n)}function De(e,t,r){let n=t.value;if(n===!1)e.push([s.float.majorEncoded|Cn]);else if(n===!0)e.push([s.float.majorEncoded|Tn]);else if(n===null)e.push([s.float.majorEncoded|On]);else if(n===void 0)e.push([s.float.majorEncoded|Nn]);else{let o,i=!1;(!r||r.float64!==!0)&&(Cr(n),o=Ke(F,1),n===o||Number.isNaN(n)?(F[0]=249,e.push(F.slice(0,3)),i=!0):(Tr(n),o=Qe(F,1),n===o&&(F[0]=250,e.push(F.slice(0,5)),i=!0))),i||($n(n),o=Or(F,1),F[0]=251,e.push(F.slice(0,9)))}}De.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Cr(n);let o=Ke(F,1);if(n===o||Number.isNaN(n))return 3;if(Tr(n),o=Qe(F,1),n===o)return 5}return 9};var Ir=new ArrayBuffer(9),O=new DataView(Ir,1),F=new Uint8Array(Ir,0);function Cr(e){if(e===1/0)O.setUint16(0,31744,!1);else if(e===-1/0)O.setUint16(0,64512,!1);else if(Number.isNaN(e))O.setUint16(0,32256,!1);else{O.setFloat32(0,e);let t=O.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)O.setUint16(0,31744,!1);else if(r===0)O.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let o=r-127;o<-24?O.setUint16(0,0):o<-14?O.setUint16(0,(t&2147483648)>>16|1<<24+o,!1):O.setUint16(0,(t&2147483648)>>16|o+15<<10|n>>13,!1)}}}function Ke(e,t){if(e.length-t<2)throw new Error(`${p} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,o=r&1023,i;return n===0?i=o*2**-24:n!==31?i=(o+1024)*2**(n-25):i=o===0?1/0:NaN,r&32768?-i:i}function Tr(e){O.setFloat32(0,e,!1)}function Qe(e,t){if(e.length-t<4)throw new Error(`${p} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function $n(e){O.setFloat64(0,e,!1)}function Or(e,t){if(e.length-t<8)throw new Error(`${p} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}De.compareTokens=T.compareTokens;function y(e,t,r){throw new Error(`${p} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function Fe(e){return()=>{throw new Error(`${p} ${e}`)}}var d=[];for(let e=0;e<=23;e++)d[e]=y;d[24]=Pt;d[25]=zt;d[26]=Vt;d[27]=Gt;d[28]=y;d[29]=y;d[30]=y;d[31]=y;for(let e=32;e<=55;e++)d[e]=y;d[56]=Wt;d[57]=qt;d[58]=Jt;d[59]=Xt;d[60]=y;d[61]=y;d[62]=y;d[63]=y;for(let e=64;e<=87;e++)d[e]=Kt;d[88]=Qt;d[89]=Zt;d[90]=Yt;d[91]=er;d[92]=y;d[93]=y;d[94]=y;d[95]=Fe("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)d[e]=tr;d[120]=rr;d[121]=nr;d[122]=or;d[123]=ir;d[124]=y;d[125]=y;d[126]=y;d[127]=Fe("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)d[e]=ar;d[152]=cr;d[153]=fr;d[154]=ur;d[155]=dr;d[156]=y;d[157]=y;d[158]=y;d[159]=pr;for(let e=160;e<=183;e++)d[e]=hr;d[184]=lr;d[185]=mr;d[186]=xr;d[187]=yr;d[188]=y;d[189]=y;d[190]=y;d[191]=gr;for(let e=192;e<=215;e++)d[e]=wr;d[216]=br;d[217]=Er;d[218]=_r;d[219]=vr;d[220]=y;d[221]=y;d[222]=y;d[223]=y;for(let e=224;e<=243;e++)d[e]=Fe("simple values are not supported");d[244]=y;d[245]=y;d[246]=y;d[247]=kr;d[248]=Fe("simple values are not supported");d[249]=Sr;d[250]=Ur;d[251]=Br;d[252]=y;d[253]=y;d[254]=y;d[255]=Ar;var L=[];for(let e=0;e<24;e++)L[e]=new f(s.uint,e,1);for(let e=-1;e>=-24;e--)L[31-e]=new f(s.negint,e,1);L[64]=new f(s.bytes,new Uint8Array(0),1);L[96]=new f(s.string,"",1);L[128]=new f(s.array,0,1);L[160]=new f(s.map,0,1);L[244]=new f(s.false,!1,1);L[245]=new f(s.true,!0,1);L[246]=new f(s.null,null,1);function Nr(e){switch(e.type){case s.false:return V([244]);case s.true:return V([245]);case s.null:return V([246]);case s.bytes:return e.value.length?void 0:V([64]);case s.string:return e.value===""?V([96]):void 0;case s.array:return e.value===0?V([128]):void 0;case s.map:return e.value===0?V([160]):void 0;case s.uint:return e.value<24?V([Number(e.value)]):void 0;case s.negint:if(e.value>=-24)return V([31-Number(e.value)])}}var Fn={float64:!1,mapSorter:Rn,quickEncodeToken:Nr};function Ln(){let e=[];return e[s.uint.major]=T,e[s.negint.major]=Ce,e[s.bytes.major]=ie,e[s.string.major]=sr,e[s.array.major]=Oe,e[s.map.major]=Ne,e[s.tag.major]=$e,e[s.float.major]=De,e}var $r=Ln(),Ze=new me,Me=class e{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${W} object contains circular references`);return new e(r,t)}},X={null:new f(s.null,null),undefined:new f(s.undefined,void 0),true:new f(s.true,!0),false:new f(s.false,!1),emptyArray:new f(s.array,0),emptyMap:new f(s.map,0)},K={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new f(s.float,e):e>=0?new f(s.uint,e):new f(s.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new f(s.uint,e):new f(s.negint,e)},Uint8Array(e,t,r,n){return new f(s.bytes,e)},string(e,t,r,n){return new f(s.string,e)},boolean(e,t,r,n){return e?X.true:X.false},null(e,t,r,n){return X.null},undefined(e,t,r,n){return X.undefined},ArrayBuffer(e,t,r,n){return new f(s.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new f(s.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[X.emptyArray,new f(s.break)]:X.emptyArray;n=Me.createCheck(n,e);let o=[],i=0;for(let a of e)o[i++]=Le(a,r,n);return r.addBreakTokens?[new f(s.array,e.length),o,new f(s.break)]:[new f(s.array,e.length),o]},Object(e,t,r,n){let o=t!=="Object",i=o?e.keys():Object.keys(e),a=o?e.size:i.length;if(!a)return r.addBreakTokens===!0?[X.emptyMap,new f(s.break)]:X.emptyMap;n=Me.createCheck(n,e);let c=[],u=0;for(let m of i)c[u++]=[Le(m,r,n),Le(o?e.get(m):e[m],r,n)];return Mn(c,r),r.addBreakTokens?[new f(s.map,a),c,new f(s.break)]:[new f(s.map,a),c]}};K.Map=K.Object;K.Buffer=K.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))K[`${e}Array`]=K.DataView;function Le(e,t={},r){let n=Nt(e),o=t&&t.typeEncoders&&t.typeEncoders[n]||K[n];if(typeof o=="function"){let a=o(e,n,t,r);if(a!=null)return a}let i=K[n];if(!i)throw new Error(`${W} unsupported type: ${n}`);return i(e,n,t,r)}function Mn(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Rn(e,t){let r=Array.isArray(e[0])?e[0][0]:e[0],n=Array.isArray(t[0])?t[0][0]:t[0];if(r.type!==n.type)return r.type.compare(n.type);let o=r.type.major,i=$r[o].compareTokens(r,n);return i===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),i}function Dr(e,t,r,n){if(Array.isArray(t))for(let o of t)Dr(e,o,r,n);else r[t.type.major](e,t,n)}function Ye(e,t,r){let n=Le(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let o=r.quickEncodeToken(n);if(o)return o;let i=t[n.type.major];if(i.encodedSize){let a=i.encodedSize(n,r),c=new me(a);if(i(c,n,r),c.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return le(c.chunks[0])}}return Ze.reset(),Dr(Ze,n,t,r),Ze.toBytes(!0)}function jn(e,t){return t=Object.assign({},Fn,t),Ye(e,$r,t)}var Pn={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},et=class{constructor(t,r={}){this._pos=0,this.data=t,this.options=r}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let t=this.data[this._pos],r=L[t];if(r===void 0){let n=d[t];if(!n)throw new Error(`${p} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let o=t&31;r=n(this.data,this._pos,o,this.options)}return this._pos+=r.encodedLength,r}},we=Symbol.for("DONE"),Re=Symbol.for("BREAK");function zn(e,t,r){let n=[];for(let o=0;o<e.value;o++){let i=be(t,r);if(i===Re){if(e.value===1/0)break;throw new Error(`${p} got unexpected break to lengthed array`)}if(i===we)throw new Error(`${p} found array but not enough entries (got ${o}, expected ${e.value})`);n[o]=i}return n}function Vn(e,t,r){let n=r.useMaps===!0,o=n?void 0:{},i=n?new Map:void 0;for(let a=0;a<e.value;a++){let c=be(t,r);if(c===Re){if(e.value===1/0)break;throw new Error(`${p} got unexpected break to lengthed map`)}if(c===we)throw new Error(`${p} found map but not enough entries (got ${a} [no key], expected ${e.value})`);if(n!==!0&&typeof c!="string")throw new Error(`${p} non-string keys not supported (got ${typeof c})`);if(r.rejectDuplicateMapKeys===!0&&(n&&i.has(c)||!n&&c in o))throw new Error(`${p} found repeat map key "${c}"`);let u=be(t,r);if(u===we)throw new Error(`${p} found map but not enough entries (got ${a} [no value], expected ${e.value})`);n?i.set(c,u):o[c]=u}return n?i:o}function be(e,t){if(e.done())return we;let r=e.next();if(r.type===s.break)return Re;if(r.type.terminal)return r.value;if(r.type===s.array)return zn(r,e,t);if(r.type===s.map)return Vn(r,e,t);if(r.type===s.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=be(e,t);return t.tags[r.value](n)}throw new Error(`${p} tag not supported (${r.value})`)}throw new Error("unsupported")}function tt(e,t){if(!(e instanceof Uint8Array))throw new Error(`${p} data to decode must be a Uint8Array`);t=Object.assign({},Pn,t);let r=t.tokenizer||new et(e,t),n=be(r,t);if(n===we)throw new Error(`${p} did not find any content to decode`);if(n===Re)throw new Error(`${p} got unexpected break`);return[n,e.subarray(r.pos())]}function rt(e,t){let[r,n]=tt(e,t);if(n.length>0)throw new Error(`${p} too many terminals, data makes no sense`);return r}var nt=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(t){let r=this.inRecursive[this.inRecursive.length-1];r&&(r.type===s.array&&(r.elements++,r.elements!==1&&t.push([44])),r.type===s.map&&(r.elements++,r.elements!==1&&(r.elements%2===1?t.push([44]):t.push([58]))))}[s.uint.major](t,r){this.prefix(t);let n=String(r.value),o=[];for(let i=0;i<n.length;i++)o[i]=n.charCodeAt(i);t.push(o)}[s.negint.major](t,r){this[s.uint.major](t,r)}[s.bytes.major](t,r){throw new Error(`${W} unsupported type: Uint8Array`)}[s.string.major](t,r){this.prefix(t);let n=Ie(JSON.stringify(r.value));t.push(n.length>32?le(n):n)}[s.array.major](t,r){this.prefix(t),this.inRecursive.push({type:s.array,elements:0}),t.push([91])}[s.map.major](t,r){this.prefix(t),this.inRecursive.push({type:s.map,elements:0}),t.push([123])}[s.tag.major](t,r){}[s.float.major](t,r){if(r.type.name==="break"){let a=this.inRecursive.pop();if(a){if(a.type===s.array)t.push([93]);else if(a.type===s.map)t.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(r.value===void 0)throw new Error(`${W} unsupported type: undefined`);if(this.prefix(t),r.type.name==="true"){t.push([116,114,117,101]);return}else if(r.type.name==="false"){t.push([102,97,108,115,101]);return}else if(r.type.name==="null"){t.push([110,117,108,108]);return}let n=String(r.value),o=[],i=!1;for(let a=0;a<n.length;a++)o[a]=n.charCodeAt(a),!i&&(o[a]===46||o[a]===101||o[a]===69)&&(i=!0);i||(o.push(46),o.push(48)),t.push(o)}};function Gn(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${W} complex map keys are not supported`);let r=e[0],n=t[0];if(r.type!==s.string||n.type!==s.string)throw new Error(`${W} non-string map keys are not supported`);if(r<n)return-1;if(r>n)return 1;throw new Error(`${W} unexpected duplicate map keys, this is not supported`)}var Wn={addBreakTokens:!0,mapSorter:Gn};function ot(e,t){return t=Object.assign({},Wn,t),Ye(e,new nt,t)}var ce=class{constructor(t,r={}){this._pos=0,this.data=t,this.options=r,this.modeStack=["value"],this.lastToken=""}pos(){return this._pos}done(){return this._pos>=this.data.length}ch(){return this.data[this._pos]}currentMode(){return this.modeStack[this.modeStack.length-1]}skipWhitespace(){let t=this.ch();for(;t===32||t===9||t===13||t===10;)t=this.data[++this._pos]}expect(t){if(this.data.length-this._pos<t.length)throw new Error(`${p} unexpected end of input at position ${this._pos}`);for(let r=0;r<t.length;r++)if(this.data[this._pos++]!==t[r])throw new Error(`${p} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...t)}'`)}parseNumber(){let t=this._pos,r=!1,n=!1,o=c=>{for(;!this.done();){let u=this.ch();if(c.includes(u))this._pos++;else break}};if(this.ch()===45&&(r=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,n=!0;else return new f(s.uint,0,this._pos-t);if(o([48,49,50,51,52,53,54,55,56,57]),r&&this._pos===t+1)throw new Error(`${p} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(n)throw new Error(`${p} unexpected token at position ${this._pos}`);n=!0,this._pos++,o([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(n=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,o([48,49,50,51,52,53,54,55,56,57]));let i=String.fromCharCode.apply(null,this.data.subarray(t,this._pos)),a=parseFloat(i);return n?new f(s.float,a,this._pos-t):this.options.allowBigInt!==!0||Number.isSafeInteger(a)?new f(a>=0?s.uint:s.negint,a,this._pos-t):new f(a>=0?s.uint:s.negint,BigInt(i),this._pos-t)}parseString(){if(this.ch()!==34)throw new Error(`${p} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,a=0;i<this.data.length&&a<65536;i++,a++){let c=this.data[i];if(c===92||c<32||c>=128)break;if(c===34){let u=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new f(s.string,u,a)}}let t=this._pos,r=[],n=()=>{if(this._pos+4>=this.data.length)throw new Error(`${p} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let a=0;a<4;a++){let c=this.ch();if(c>=48&&c<=57)c-=48;else if(c>=97&&c<=102)c=c-97+10;else if(c>=65&&c<=70)c=c-65+10;else throw new Error(`${p} unexpected unicode escape character at position ${this._pos}`);i=i*16+c,this._pos++}return i},o=()=>{let i=this.ch(),a=null,c=i>239?4:i>223?3:i>191?2:1;if(this._pos+c>this.data.length)throw new Error(`${p} unexpected unicode sequence at position ${this._pos}`);let u,m,h,l;switch(c){case 1:i<128&&(a=i);break;case 2:u=this.data[this._pos+1],(u&192)===128&&(l=(i&31)<<6|u&63,l>127&&(a=l));break;case 3:u=this.data[this._pos+1],m=this.data[this._pos+2],(u&192)===128&&(m&192)===128&&(l=(i&15)<<12|(u&63)<<6|m&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:u=this.data[this._pos+1],m=this.data[this._pos+2],h=this.data[this._pos+3],(u&192)===128&&(m&192)===128&&(h&192)===128&&(l=(i&15)<<18|(u&63)<<12|(m&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}a===null?(a=65533,c=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),this._pos+=c};for(;!this.done();){let i=this.ch(),a;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${p} unexpected string termination at position ${this._pos}`);switch(a=this.ch(),this._pos++,a){case 34:case 39:case 92:case 47:r.push(a);break;case 98:r.push(8);break;case 116:r.push(9);break;case 110:r.push(10);break;case 102:r.push(12);break;case 114:r.push(13);break;case 117:r.push(n());break;default:throw new Error(`${p} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new f(s.string,Je(r),this._pos-t);default:if(i<32)throw new Error(`${p} invalid control character at position ${this._pos}`);i<128?(r.push(i),this._pos++):o()}}throw new Error(`${p} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new f(s.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new f(s.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new f(s.null,null,4);case 102:return this.expect([102,97,108,115,101]),new f(s.false,!1,5);case 116:return this.expect([116,114,117,101]),new f(s.true,!0,4);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:throw new Error(`${p} unexpected character at position ${this._pos}`)}}next(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue();case"array-value":{if(this.modeStack.pop(),this.ch()===93)return this._pos++,this.skipWhitespace(),new f(s.break,void 0,1);if(this.ch()!==44)throw new Error(`${p} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()}case"array-start":return this.modeStack.pop(),this.ch()===93?(this._pos++,this.skipWhitespace(),new f(s.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue());case"obj-key":if(this.ch()===125)return this.modeStack.pop(),this._pos++,this.skipWhitespace(),new f(s.break,void 0,1);if(this.ch()!==44)throw new Error(`${p} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`);this._pos++,this.skipWhitespace();case"obj-start":{if(this.modeStack.pop(),this.ch()===125)return this._pos++,this.skipWhitespace(),new f(s.break,void 0,1);let t=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${p} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("obj-value"),t}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${p} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function it(e,t){return t=Object.assign({tokenizer:new ce(e,t)},t),rt(e,t)}var ws=new Uint8Array(0);var Fr=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},fe=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};function Jn(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),a=i.charCodeAt(0);if(r[a]!==255)throw new TypeError(i+" is ambiguous");r[a]=o}var c=e.length,u=e.charAt(0),m=Math.log(c)/Math.log(256),h=Math.log(256)/Math.log(c);function l(x){if(x instanceof Uint8Array||(ArrayBuffer.isView(x)?x=new Uint8Array(x.buffer,x.byteOffset,x.byteLength):Array.isArray(x)&&(x=Uint8Array.from(x))),!(x instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(x.length===0)return"";for(var g=0,ee=0,$=0,j=x.length;$!==j&&x[$]===0;)$++,g++;for(var P=(j-$)*h+1>>>0,C=new Uint8Array(P);$!==j;){for(var z=x[$],H=0,D=P-1;(z!==0||H<ee)&&D!==-1;D--,H++)z+=256*C[D]>>>0,C[D]=z%c>>>0,z=z/c>>>0;if(z!==0)throw new Error("Non-zero carry");ee=H,$++}for(var G=P-ee;G!==P&&C[G]===0;)G++;for(var Ue=u.repeat(g);G<P;++G)Ue+=e.charAt(C[G]);return Ue}function w(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var g=0;if(x[g]!==" "){for(var ee=0,$=0;x[g]===u;)ee++,g++;for(var j=(x.length-g)*m+1>>>0,P=new Uint8Array(j);x[g];){var C=r[x.charCodeAt(g)];if(C===255)return;for(var z=0,H=j-1;(C!==0||z<$)&&H!==-1;H--,z++)C+=c*P[H]>>>0,P[H]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");$=z,g++}if(x[g]!==" "){for(var D=j-$;D!==j&&P[D]===0;)D++;for(var G=new Uint8Array(ee+(j-D)),Ue=ee;D!==j;)G[Ue++]=P[D++];return G}}}function v(x){var g=w(x);if(g)return g;throw new Error(`Non-${t} character`)}return{encode:l,decodeUnsafe:w,decode:v}}var Hn=Jn,Xn=Hn,Mr=Xn;var st=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},at=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Rr(this,t)}},ct=class{constructor(t){this.decoders=t}or(t){return Rr(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Rr=(e,t)=>new ct({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),ft=class{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new st(t,r,n),this.decoder=new at(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},jr=({name:e,prefix:t,encode:r,decode:n})=>new ft(e,t,r,n),ut=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:o}=Mr(r,t);return jr({prefix:e,name:t,encode:n,decode:i=>fe(o(i))})},Kn=(e,t,r,n)=>{let o={};for(let h=0;h<t.length;++h)o[t[h]]=h;let i=e.length;for(;e[i-1]==="=";)--i;let a=new Uint8Array(i*r/8|0),c=0,u=0,m=0;for(let h=0;h<i;++h){let l=o[e[h]];if(l===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<r|l,c+=r,c>=8&&(c-=8,a[m++]=255&u>>c)}if(c>=r||255&u<<8-c)throw new SyntaxError("Unexpected end of data");return a},Qn=(e,t,r)=>{let n=t[t.length-1]==="=",o=(1<<r)-1,i="",a=0,c=0;for(let u=0;u<e.length;++u)for(c=c<<8|e[u],a+=8;a>r;)a-=r,i+=t[o&c>>a];if(a&&(i+=t[o&c<<r-a]),n)for(;i.length*r&7;)i+="=";return i},k=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>jr({prefix:t,name:e,encode(o){return Qn(o,n,r)},decode(o){return Kn(o,n,r,e)}});var Ee=k({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),As=k({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ss=k({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Us=k({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Bs=k({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Is=k({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Cs=k({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ts=k({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Os=k({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var J=ut({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ds=ut({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var he={};Ot(he,{Digest:()=>re,create:()=>pe,decode:()=>ht,equals:()=>lt});var Zn=Vr,Pr=128,Yn=127,eo=~Yn,to=Math.pow(2,31);function Vr(e,t,r){t=t||[],r=r||0;for(var n=r;e>=to;)t[r++]=e&255|Pr,e/=128;for(;e&eo;)t[r++]=e&255|Pr,e>>>=7;return t[r]=e|0,Vr.bytes=r-n+1,t}var ro=dt,no=128,zr=127;function dt(e,n){var r=0,n=n||0,o=0,i=n,a,c=e.length;do{if(i>=c)throw dt.bytes=0,new RangeError("Could not decode varint");a=e[i++],r+=o<28?(a&zr)<<o:(a&zr)*Math.pow(2,o),o+=7}while(a>=no);return dt.bytes=i-n,r}var oo=Math.pow(2,7),io=Math.pow(2,14),so=Math.pow(2,21),ao=Math.pow(2,28),co=Math.pow(2,35),fo=Math.pow(2,42),uo=Math.pow(2,49),po=Math.pow(2,56),ho=Math.pow(2,63),lo=function(e){return e<oo?1:e<io?2:e<so?3:e<ao?4:e<co?5:e<fo?6:e<uo?7:e<po?8:e<ho?9:10},mo={encode:Zn,decode:ro,encodingLength:lo},xo=mo,_e=xo;var ve=(e,t=0)=>[_e.decode(e,t),_e.decode.bytes],ue=(e,t,r=0)=>(_e.encode(e,t,r),t),de=e=>_e.encodingLength(e);var pe=(e,t)=>{let r=t.byteLength,n=de(e),o=n+de(r),i=new Uint8Array(o+r);return ue(e,i,0),ue(r,i,n),i.set(t,o),new re(e,r,t,i)},ht=e=>{let t=fe(e),[r,n]=ve(t),[o,i]=ve(t.subarray(n)),a=t.subarray(n+i);if(a.byteLength!==o)throw new Error("Incorrect length");return new re(r,o,a,t)},lt=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&Fr(e.bytes,r.bytes)}},re=class{constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}};var Gr=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return go(r,mt(e),t||J.encoder);default:return wo(r,mt(e),t||Ee.encoder)}};var Wr=new WeakMap,mt=e=>{let t=Wr.get(e);if(t==null){let r=new Map;return Wr.set(e,r),r}return t},_=class e{constructor(t,r,n,o){this.code=r,this.version=t,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==ke)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==bo)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=pe(t,r);return e.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return e.equals(this,t)}static equals(t,r){let n=r;return n&&t.code===n.code&&t.version===n.version&<(t.multihash,n.multihash)}toString(t){return Gr(this,t)}toJSON(){return{"/":Gr(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof e)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:o,multihash:i,bytes:a}=r;return new e(n,o,i,a||qr(n,o,i.bytes))}else if(r[Eo]===!0){let{version:n,multihash:o,code:i}=r,a=ht(o);return e.create(n,i,a)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==ke)throw new Error(`Version 0 CID must use dag-pb (code: ${ke}) block encoding`);return new e(t,r,n,n.bytes)}case 1:{let o=qr(t,r,n.bytes);return new e(t,r,n,o)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,ke,t)}static createV1(t,r){return e.create(1,t,r)}static decode(t){let[r,n]=e.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=e.inspectBytes(t),n=r.size-r.multihashSize,o=fe(t.subarray(n,n+r.multihashSize));if(o.byteLength!==r.multihashSize)throw new Error("Incorrect length");let i=o.subarray(r.multihashSize-r.digestSize),a=new re(r.multihashCode,r.digestSize,i,o);return[r.version===0?e.createV0(a):e.createV1(r.codec,a),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[l,w]=ve(t.subarray(r));return r+=w,l},o=n(),i=ke;if(o===18?(o=0,r=0):i=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let a=r,c=n(),u=n(),m=r+u,h=m-a;return{version:o,codec:i,multihashCode:c,digestSize:u,multihashSize:h,size:m}}static parse(t,r){let[n,o]=yo(t,r),i=e.decode(o);if(i.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return mt(i).set(n,t),i}},yo=(e,t)=>{switch(e[0]){case"Q":{let r=t||J;return[J.prefix,r.decode(`${J.prefix}${e}`)]}case J.prefix:{let r=t||J;return[J.prefix,r.decode(e)]}case Ee.prefix:{let r=t||Ee;return[Ee.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},go=(e,t,r)=>{let{prefix:n}=r;if(n!==J.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let o=t.get(n);if(o==null){let i=r.encode(e).slice(1);return t.set(n,i),i}else return o},wo=(e,t,r)=>{let{prefix:n}=r,o=t.get(n);if(o==null){let i=r.encode(e);return t.set(n,i),i}else return o},ke=112,bo=18,qr=(e,t,r)=>{let n=de(e),o=n+de(t),i=new Uint8Array(o+r.byteLength);return ue(e,i,0),ue(t,i,n),i.set(r,o),i},Eo=Symbol.for("@ipld/js-cid/CID");var yt=({name:e,code:t,encode:r})=>new xt(e,t,r),xt=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?pe(this.code,r):r.then(n=>pe(this.code,n))}else throw Error("Unknown type, must be binary type")}};var gt=k({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Xs=k({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ks=k({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Qs=k({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function vo(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=_.asCID(e);if(!t)return null;let r=t.toString();return[new f(s.map,1/0,1),new f(s.string,"/",1),new f(s.string,r,r.length),new f(s.break,void 0,1)]}function je(e){let t=gt.encode(e).slice(1);return[new f(s.map,1/0,1),new f(s.string,"/",1),new f(s.map,1/0,1),new f(s.string,"bytes",5),new f(s.string,t,t.length),new f(s.break,void 0,1),new f(s.break,void 0,1)]}function M(e){return je(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function ko(e){return je(new Uint8Array(e))}function Ao(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function So(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var Uo={typeEncoders:{Object:vo,Buffer:je,Uint8Array:je,Int8Array:M,Uint16Array:M,Int16Array:M,Uint32Array:M,Int32Array:M,Float32Array:M,Float64Array:M,Uint8ClampedArray:M,BigInt64Array:M,BigUint64Array:M,DataView:M,ArrayBuffer:ko,undefined:Ao,number:So}},wt=class extends ce{constructor(t,r){super(t,r),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let t=this._next();if(t.type===s.map){let r=this._next();if(r.type===s.string&&r.value==="/"){let n=this._next();if(n.type===s.string){if(this._next().type!==s.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(n),new f(s.tag,42,0)}if(n.type===s.map){let o=this._next();if(o.type===s.string&&o.value==="bytes"){let i=this._next();if(i.type===s.string){for(let c=0;c<2;c++)if(this._next().type!==s.break)throw new Error("Invalid encoded Bytes form");let a=gt.decode(`m${i.value}`);return new f(s.bytes,a,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(o)}this.tokenBuffer.push(n)}this.tokenBuffer.push(r)}return t}},bt={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};bt.tags[42]=_.parse;var Bo="dag-json",Et=297,Pe=e=>ot(e,Uo),Jr=e=>{let t=Object.assign(bt,{tokenizer:new wt(e,bt)});return it(e,t)},Io=e=>Co.decode(Pe(e));var Co=new TextDecoder,To=e=>Jr(Oo.encode(e)),Oo=new TextEncoder;function No(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function vt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Hr(e,t){No(e);let r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var $o=e=>e instanceof Uint8Array;var Ve=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),R=(e,t)=>e<<32-t|e>>>t,Do=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Do)throw new Error("Non little-endian hardware is not supported");function Fo(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function kt(e){if(typeof e=="string"&&(e=Fo(e)),!$o(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var ze=class{clone(){return this._cloneInto()}},na={}.toString;function Xr(e){let t=n=>e().update(kt(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Lo(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),i=BigInt(4294967295),a=Number(r>>o&i),c=Number(r&i),u=n?4:0,m=n?0:4;e.setUint32(t+u,a,n),e.setUint32(t+m,c,n)}var Ge=class extends ze{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ve(this.buffer)}update(t){vt(this);let{view:r,buffer:n,blockLen:o}=this;t=kt(t);let i=t.length;for(let a=0;a<i;){let c=Math.min(o-this.pos,i-a);if(c===o){let u=Ve(t);for(;o<=i-a;a+=o)this.process(u,a);continue}n.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){vt(this),Hr(t,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:i}=this,{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let l=a;l<o;l++)r[l]=0;Lo(n,o-8,BigInt(this.length*8),i),this.process(n,0);let c=Ve(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let m=u/4,h=this.get();if(m>h.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<m;l++)c.setUint32(4*l,h[l],i)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:i,destroyed:a,pos:c}=this;return t.length=o,t.pos=c,t.finished=i,t.destroyed=a,o%r&&t.buffer.set(n),t}};var Mo=(e,t,r)=>e&t^~e&r,Ro=(e,t,r)=>e&t^e&r^t&r,jo=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Q=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Z=new Uint32Array(64),At=class extends Ge{constructor(){super(64,32,8,!1),this.A=Q[0]|0,this.B=Q[1]|0,this.C=Q[2]|0,this.D=Q[3]|0,this.E=Q[4]|0,this.F=Q[5]|0,this.G=Q[6]|0,this.H=Q[7]|0}get(){let{A:t,B:r,C:n,D:o,E:i,F:a,G:c,H:u}=this;return[t,r,n,o,i,a,c,u]}set(t,r,n,o,i,a,c,u){this.A=t|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=c|0,this.H=u|0}process(t,r){for(let l=0;l<16;l++,r+=4)Z[l]=t.getUint32(r,!1);for(let l=16;l<64;l++){let w=Z[l-15],v=Z[l-2],x=R(w,7)^R(w,18)^w>>>3,g=R(v,17)^R(v,19)^v>>>10;Z[l]=g+Z[l-7]+x+Z[l-16]|0}let{A:n,B:o,C:i,D:a,E:c,F:u,G:m,H:h}=this;for(let l=0;l<64;l++){let w=R(c,6)^R(c,11)^R(c,25),v=h+w+Mo(c,u,m)+jo[l]+Z[l]|0,g=(R(n,2)^R(n,13)^R(n,22))+Ro(n,o,i)|0;h=m,m=u,u=c,c=a+v|0,a=i,i=o,o=n,n=v+g|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,c=c+this.E|0,u=u+this.F|0,m=m+this.G|0,h=h+this.H|0,this.set(n,o,i,a,c,u,m,h)}roundClean(){Z.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Kr=Xr(()=>new At);var Po=Object.create,Ut=Object.defineProperty,zo=Object.getOwnPropertyDescriptor,Qr=Object.getOwnPropertyNames,Vo=Object.getPrototypeOf,Go=Object.prototype.hasOwnProperty,Wo=(e,t,r)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zr=(e,t)=>function(){return t||(0,e[Qr(e)[0]])((t={exports:{}}).exports,t),t.exports},qo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qr(t))!Go.call(e,o)&&o!==r&&Ut(e,o,{get:()=>t[o],enumerable:!(n=zo(t,o))||n.enumerable});return e},Yr=(e,t,r)=>(r=e!=null?Po(Vo(e)):{},qo(t||!e||!e.__esModule?Ut(r,"default",{value:e,enumerable:!0}):r,e)),Y=(e,t,r)=>(Wo(e,typeof t!="symbol"?t+"":t,r),r),Jo=Zr({"../../node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=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":t(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",i=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";e.isBrowser=r,e.isWebWorker=o,e.isNode=n,e.isJsDom=i,e.isDeno=a}}),Ho=Zr({"../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(e,t){"use strict";t.exports=function(r,n){n||(n={}),typeof n=="function"&&(n={cmp:n});var o=typeof n.cycles=="boolean"?n.cycles:!1,i=n.cmp&&function(c){return function(u){return function(m,h){var l={key:m,value:u[m]},w={key:h,value:u[h]};return c(l,w)}}}(n.cmp),a=[];return function c(u){if(u&&u.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u!==void 0){if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);var m,h;if(Array.isArray(u)){for(h="[",m=0;m<u.length;m++)m&&(h+=","),h+=c(u[m])||"null";return h+"]"}if(u===null)return"null";if(a.indexOf(u)!==-1){if(o)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var l=a.push(u)-1,w=Object.keys(u).sort(i&&i(u));for(h="",m=0;m<w.length;m++){var v=w[m],x=c(u[v]);x&&(h&&(h+=","),h+=JSON.stringify(v)+":"+x)}return a.splice(l,1),"{"+h+"}"}}(r)}}}),Se=Yr(Jo(),1),Xo=Yr(Ho(),1),en=!1,tn=!1;Se.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(en=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(tn=process?.env?.LOGGER_PERF_PREFIX==="true"));var Ko=Object.freeze({prefix:void 0,time:en,delta:tn,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0}),St=[],rn=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,r,n){Object.assign(this,{sinceFirst:e,sinceLast:t,time:r,delta:n})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<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?t:null,this.delta?r:null].join(",")}]`}},nn=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},Ae=!1,A=class{static setup(e=A.INFO,t={}){t=Object.assign({},Ko,t),e>10&&console.debug("setup logger",{config:t});let r=this.wrapLog(console.debug,{...t,dim:t.dimDebugOnServer}),n=(...u)=>{window?.FORCE_DISABLE_LOGLEVEL&&r(...u)};n.isDisabled=!0,n.isEnabled=!1;let o=this.wrapLog(console.groupCollapsed,t),i=(u,m)=>{function h(...w){let v=w[w.length-1];return v===n?v():(o(...w.slice(0,-1)),(async()=>{try{let g=v();return g instanceof Promise?await g:g}finally{console.groupEnd()}})())}let l=Object.assign(m.bind({}),{isEnabled:u,isDisabled:!u,group:h,force:m});return u?l:Object.assign(n.bind({}),{isEnabled:u,isDisabled:!u,group:h,force:l})},a=i(e>=A.ERROR,this.wrapLog(console.error,t));return{ERROR:(...u)=>(a(...u),new Error((0,Xo.default)(u))),WARN:i(e>=A.WARN,this.wrapLog(console.warn,t)),LOG:i(e>=A.INFO,this.wrapLog(console.log,t)),DEBUG:i(e>=A.DEBUG,this.wrapLog(console.log,{...t,dim:t.dimDebugOnServer})),VERBOSE:i(e>=A.VERBOSE,this.wrapLog(console.debug,{...t,dim:t.dimDebugOnServer}))}}static wrapLog(e,t){if(Se.isNode)return e.bind(console);{let r=[];if(t.time||t.delta){let o=Se.isBrowser&&navigator.userAgent.includes("Chrome")?["",A.timeStr(!!t.time,!!t.delta)]:[];r.push(...o)}return t.prefix&&(Ae?r.push(new nn("dim",t.prefix)):r.push(t.prefix)),e.bind(console,...r)}}static timeStr(e,t,r=0){if(!performance.now)return;let n=performance.now();A.firstLog||(A.firstLog=n,A.lastLog=n);let o=new rn(n-A.firstLog,n-A.lastLog,e,t);return A.lastLog=n,r?o.toString():o}static getOriginFromStack(e){let t=!1;for(let r of e.split(`
|
|
2
|
-
`)){let n=r.match(/^\s+at\s+(.*)/);if(n){if(t)return n[1].trim().replace(__dirname,"");t=!0}}}},N=A;Y(N,"ERROR",2);Y(N,"WARN",4);Y(N,"INFO",6);Y(N,"LOG",6);Y(N,"DEBUG",8);Y(N,"VERBOSE",10);Y(N,"firstLog",0);Y(N,"lastLog",0);Se.isBrowser?(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(St&&St.length){for(let t of St)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof rn))return null;Ae||(Ae=!0);let t=N.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof nn?(Ae||(Ae=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1})):Se.isNode;function We({enumerable:e=!0,configurable:t=!1}={}){return{enumerable:e,configurable:t,writable:!1}}function*Qo(e,t){if(t!=null&&typeof t=="object")if(Array.isArray(t))for(let[r,n]of t.entries()){let o=[...e,r],i=_.asCID(n);i?yield[o.join("/"),i]:typeof n=="object"&&(yield*Bt(n,o))}else{let r=_.asCID(t);r?yield[e.join("/"),r]:yield*Bt(t,e)}}function*Bt(e,t){if(e==null||e instanceof Uint8Array)return;let r=_.asCID(e);r&&(yield[t.join("/"),r]);for(let[n,o]of Object.entries(e)){let i=[...t,n];yield*Qo(i,o)}}function*Zo(e,t){if(Array.isArray(t))for(let[r,n]of t.entries()){let o=[...e,r];yield o.join("/"),typeof n=="object"&&!_.asCID(n)&&(yield*It(n,o))}else yield*It(t,e)}function*It(e,t){if(!(e==null||typeof e!="object"))for(let[r,n]of Object.entries(e)){let o=[...t,r];yield o.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!_.asCID(n)&&(yield*Zo(o,n))}}function Yo(e,t){let r=e;for(let[n,o]of t.entries()){if(r=r[o],r==null)throw new Error(`Object has no property at ${t.slice(0,n+1).map(a=>`[${JSON.stringify(a)}]`).join("")}`);let i=_.asCID(r);if(i)return{value:i,remaining:t.slice(n+1).join("/")}}return{value:r}}var Ct=class{constructor({cid:t,bytes:r,value:n}){if(!t||!r||typeof n>"u")throw new Error("Missing required argument");this.cid=t,this.bytes=r,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:We(),bytes:We(),value:We(),asBlock:We()})}links(){return Bt(this.value,[])}tree(){return It(this.value,[])}get(t="/"){return Yo(this.value,t.split("/").filter(Boolean))}};async function on({value:e,codec:t,hasher:r}){if(typeof e>"u")throw new Error('Missing required argument "value"');if(!t||!r)throw new Error("Missing required argument: codec or hasher");let n=t.encode(e),o=await r.digest(n),i=_.create(1,t.code,o);return new Ct({value:e,bytes:n,cid:i})}var sn=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Tt=yt({name:"sha2-256",code:18,encode:sn("SHA-256")}),ga=yt({name:"sha2-512",code:19,encode:sn("SHA-512")});var{WARN:ei,LOG:Aa,DEBUG:ti,VERBOSE:an,ERROR:ri}=N.setup(N.INFO);function ni(e,t=["cid"]){let r={};for(let[n,o]of Object.entries(e))o===void 0&&(ei(`log.${n} is undefined, which is not allowed - encoding as null`,e),o=null),t.includes(n)?an("excluding app log",{key:n,val:o}):r[n]=o&&n==="pv"?_.parse(o):o;return r}function Sa(e){return cn(oi(e).bytes)}function oi(e){return fn(ni(e))}function cn(e){let t=Kr(e),r=he.create(Tt.code,t),n=_.create(1,Et,r);return an("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function fn(e){ti("[encodeBlock]",e);let t=Pe(e);return{bytes:t,cid:cn(t)}}async function Ua(e){let t=await on({value:e,codec:_t,hasher:Tt}),r=fn(e);return r.cid.toString()!==t.cid.toString()&&ri("[encodeBlockOriginal] sync cid mismatch",{jsonObject:e,encoded:t,syncVariant:r}),t}export{ii as a,si as b,N as c,s as d,f as e,Ln as f,jn as g,rt as h,ht as i,_ as j,Jr as k,ni as l,Sa as m,oi as n,cn as o,fn as p,Ua as q};
|
|
3
|
-
/*! Bundled license information:
|
|
4
|
-
|
|
5
|
-
@noble/hashes/esm/utils.js:
|
|
6
|
-
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
7
|
-
*/
|
|
8
|
-
//# sourceMappingURL=chunk-G3GOAFHU.min.js.map
|