@wovin/core 0.0.1-RC9 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/applog/applog-helpers.d.ts +23 -0
- package/dist/applog/applog-helpers.d.ts.map +1 -0
- package/dist/applog/applog-utils.d.ts +41 -0
- package/dist/applog/applog-utils.d.ts.map +1 -0
- package/dist/applog/datom-types.d.ts +84 -0
- package/dist/applog/datom-types.d.ts.map +1 -0
- package/dist/applog.d.ts +4 -70
- package/dist/applog.d.ts.map +1 -0
- package/dist/applog.min.js +2 -0
- package/dist/chunk-5R2ELTEJ.min.js +40 -0
- package/dist/chunk-5R2ELTEJ.min.js.map +1 -0
- package/dist/chunk-7IDQIMQO.min.js +1 -0
- package/dist/chunk-F3MRAJXL.min.js +2 -0
- package/dist/{types.js.map → chunk-F3MRAJXL.min.js.map} +1 -1
- package/dist/chunk-HHXZXKNM.min.js +7 -0
- package/dist/chunk-HHXZXKNM.min.js.map +1 -0
- package/dist/chunk-KESATLM4.min.js +8 -0
- package/dist/chunk-KESATLM4.min.js.map +1 -0
- package/dist/chunk-LECZSORU.min.js +2 -0
- package/dist/chunk-LECZSORU.min.js.map +1 -0
- package/dist/chunk-NGPPHX5A.min.js +2 -0
- package/dist/chunk-NGPPHX5A.min.js.map +1 -0
- package/dist/chunk-PL6CNZTW.min.js +2 -0
- package/dist/chunk-PL6CNZTW.min.js.map +1 -0
- package/dist/chunk-RPPZKO5L.min.js +1 -0
- package/dist/index.d.ts +8 -12
- package/dist/index.d.ts.map +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/dist/ipfs/car.d.ts +15 -0
- package/dist/ipfs/car.d.ts.map +1 -0
- package/dist/ipfs/ipfs-utils.d.ts +17 -0
- package/dist/ipfs/ipfs-utils.d.ts.map +1 -0
- package/dist/ipfs.d.ts +3 -36
- package/dist/ipfs.d.ts.map +1 -0
- package/dist/ipfs.min.js +2 -0
- package/dist/mobx/mobx-utils.d.ts +67 -0
- package/dist/mobx/mobx-utils.d.ts.map +1 -0
- package/dist/pubsub/connector.d.ts +7 -0
- package/dist/pubsub/connector.d.ts.map +1 -0
- package/dist/pubsub/publication.d.ts +6 -0
- package/dist/pubsub/publication.d.ts.map +1 -0
- package/dist/{pubsub.d.cts → pubsub/pubsub-types.d.ts} +7 -12
- package/dist/pubsub/pubsub-types.d.ts.map +1 -0
- package/dist/pubsub.d.ts +4 -41
- package/dist/pubsub.d.ts.map +1 -0
- package/dist/pubsub.min.js +2 -0
- package/dist/query/basic.d.ts +65 -0
- package/dist/query/basic.d.ts.map +1 -0
- package/dist/query/divergences.d.ts +12 -0
- package/dist/query/divergences.d.ts.map +1 -0
- package/dist/query/matchers.d.ts +4 -0
- package/dist/query/matchers.d.ts.map +1 -0
- package/dist/query.d.ts +5 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.min.js +2 -0
- package/dist/query.min.js.map +1 -0
- package/dist/stream/basic.d.ts +34 -0
- package/dist/stream/basic.d.ts.map +1 -0
- package/dist/stream/filters.d.ts +38 -0
- package/dist/stream/filters.d.ts.map +1 -0
- package/dist/{mapped-8h8bwRuM.d.ts → stream/mapped.d.ts} +5 -6
- package/dist/stream/mapped.d.ts.map +1 -0
- package/dist/{writeable-0WbsIiQn.d.cts → stream/writeable.d.ts} +7 -6
- package/dist/stream/writeable.d.ts.map +1 -0
- package/dist/stream.d.ts +5 -44
- package/dist/stream.d.ts.map +1 -0
- package/dist/stream.min.js +2 -0
- package/dist/stream.min.js.map +1 -0
- package/dist/types/typescript-utils.d.ts +33 -0
- package/dist/types/typescript-utils.d.ts.map +1 -0
- package/dist/types.d.ts +2 -4
- package/dist/types.d.ts.map +1 -0
- package/dist/types.min.js +2 -0
- package/dist/types.min.js.map +1 -0
- package/dist/utils.d.ts +1 -2
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.min.js +1 -0
- package/dist/utils.min.js.map +1 -0
- package/package.json +80 -46
- package/dist/applog.cjs +0 -85
- package/dist/applog.cjs.map +0 -1
- package/dist/applog.d.cts +0 -70
- package/dist/applog.js +0 -85
- package/dist/chunk-F3FYYIAV.js +0 -11
- package/dist/chunk-GT5X2WN4.cjs +0 -59
- package/dist/chunk-GT5X2WN4.cjs.map +0 -1
- package/dist/chunk-JSAJQXI2.cjs +0 -577
- package/dist/chunk-JSAJQXI2.cjs.map +0 -1
- package/dist/chunk-KDR7QXOQ.js +0 -56
- package/dist/chunk-KDR7QXOQ.js.map +0 -1
- package/dist/chunk-KGTU6PJ3.js +0 -577
- package/dist/chunk-KGTU6PJ3.js.map +0 -1
- package/dist/chunk-KHY3SRML.js +0 -768
- package/dist/chunk-KHY3SRML.js.map +0 -1
- package/dist/chunk-OOC3HK3E.cjs +0 -56
- package/dist/chunk-OOC3HK3E.cjs.map +0 -1
- package/dist/chunk-QXNFGJ5R.js +0 -59
- package/dist/chunk-QXNFGJ5R.js.map +0 -1
- package/dist/chunk-UOPZAYFM.cjs +0 -11
- package/dist/chunk-UOPZAYFM.cjs.map +0 -1
- package/dist/chunk-ZPOYKHY6.cjs +0 -768
- package/dist/chunk-ZPOYKHY6.cjs.map +0 -1
- package/dist/index.cjs +0 -87
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -12
- package/dist/index.js +0 -87
- package/dist/index.js.map +0 -1
- package/dist/ipfs.cjs +0 -28
- package/dist/ipfs.cjs.map +0 -1
- package/dist/ipfs.d.cts +0 -36
- package/dist/ipfs.js +0 -28
- package/dist/mapped-mkKwhQgZ.d.cts +0 -20
- package/dist/pubsub.cjs +0 -14
- package/dist/pubsub.cjs.map +0 -1
- package/dist/pubsub.js +0 -14
- package/dist/pubsub.js.map +0 -1
- package/dist/queries.cjs +0 -112
- package/dist/queries.cjs.map +0 -1
- package/dist/queries.d.cts +0 -141
- package/dist/queries.d.ts +0 -141
- package/dist/queries.js +0 -112
- package/dist/queries.js.map +0 -1
- package/dist/stream.cjs +0 -37
- package/dist/stream.cjs.map +0 -1
- package/dist/stream.d.cts +0 -44
- package/dist/stream.js +0 -37
- package/dist/types-A9kYLtyU.d.cts +0 -153
- package/dist/types-A9kYLtyU.d.ts +0 -153
- package/dist/types.cjs +0 -46
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.cts +0 -4
- package/dist/types.js +0 -46
- package/dist/utils.cjs +0 -1
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.d.cts +0 -2
- package/dist/utils.js +0 -1
- package/dist/writeable-r_920qCb.d.ts +0 -16
- /package/dist/{applog.js.map → applog.min.js.map} +0 -0
- /package/dist/{chunk-F3FYYIAV.js.map → chunk-7IDQIMQO.min.js.map} +0 -0
- /package/dist/{ipfs.js.map → chunk-RPPZKO5L.min.js.map} +0 -0
- /package/dist/{stream.js.map → ipfs.min.js.map} +0 -0
- /package/dist/{utils.js.map → pubsub.min.js.map} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var dn=Object.create;var Ie=Object.defineProperty;var pn=Object.getOwnPropertyDescriptor;var hn=Object.getOwnPropertyNames;var ln=Object.getPrototypeOf,mn=Object.prototype.hasOwnProperty;var xn=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ai=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Nt=(e,t)=>{for(var r in t)Ie(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of hn(t))!mn.call(e,o)&&o!==r&&Ie(e,o,{get:()=>t[o],enumerable:!(n=pn(t,o))||n.enumerable});return e};var ci=(e,t,r)=>(r=e!=null?dn(ln(e)):{},yn(t||!e||!e.__esModule?Ie(r,"default",{value:e,enumerable:!0}):r,e));var le=(e,t,r)=>(xn(e,typeof t!="symbol"?t+"":t,r),r);var vt={};Nt(vt,{code:()=>_t,decode:()=>Hr,encode:()=>Ve,format:()=>To,name:()=>Co,parse:()=>No,stringify:()=>To});var gn=["string","number","bigint","symbol"],wn=["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 $t(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(gn.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(bn(e))return"Buffer";let r=En(e);return r||"Object"}function bn(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function En(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(wn.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",_n=new TextDecoder,vn=new TextEncoder;function Ce(e){return ne&&globalThis.Buffer.isBuffer(e)}function me(e){return e instanceof Uint8Array?Ce(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var Mt=ne?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Ft(e,t,r):(e,t,r)=>r-t>64?_n.decode(e.subarray(t,r)):Ft(e,t,r),Te=ne?e=>e.length>64?globalThis.Buffer.from(e):Dt(e):e=>e.length>64?vn.encode(e):Dt(e),V=e=>Uint8Array.from(e),oe=ne?(e,t,r)=>Ce(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Rt=ne?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),me(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},jt=ne?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function Pt(e,t){if(Ce(e)&&Ce(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 Dt(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 Ft(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 He(n)}var Lt=4096;function He(e){let t=e.length;if(t<=Lt)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Lt));return r}var kn=256,xe=class{constructor(t=kn){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=jt(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=Rt(this.chunks,this.cursor);return t&&this.reset(),r}};var p="CBOR decode error:",W="CBOR encode error:",ye=[];ye[23]=1;ye[24]=2;ye[25]=3;ye[26]=5;ye[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 zt(e,t,r,n){return new f(s.uint,S(e,t+1,n),2)}function Vt(e,t,r,n){return new f(s.uint,U(e,t+1,n),3)}function Gt(e,t,r,n){return new f(s.uint,B(e,t+1,n),5)}function Wt(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 qt(e,t,r,n){return new f(s.negint,-1-S(e,t+1,n),2)}function Jt(e,t,r,n){return new f(s.negint,-1-U(e,t+1,n),3)}function Ht(e,t,r,n){return new f(s.negint,-1-B(e,t+1,n),5)}var Xe=BigInt(-1),Xt=BigInt(1);function Kt(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,Xe-BigInt(o),9)}function Oe(e,t){let r=t.value,n=typeof r=="bigint"?r*Xe-Xt:r*-1-1;E(e,t.type.majorEncoded,n)}Oe.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*Xe-Xt:r*-1-1;return n<b[0]?1:n<b[1]?2:n<b[2]?3:n<b[3]?5:9};Oe.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function ge(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 Qt(e,t,r,n){return ge(e,t,1,r)}function Zt(e,t,r,n){return ge(e,t,2,S(e,t+1,n))}function Yt(e,t,r,n){return ge(e,t,3,U(e,t+1,n))}function er(e,t,r,n){return ge(e,t,5,B(e,t+1,n))}function tr(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 ge(e,t,9,o)}function Ne(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===s.string?Te(e.value):e.value),e.encodedBytes}function ie(e,t){let r=Ne(t);E(e,t.type.majorEncoded,r.length),e.push(r)}ie.encodedSize=function(t){let r=Ne(t);return E.encodedSize(r.length)+r.length};ie.compareTokens=function(t,r){return Sn(Ne(t),Ne(r))};function Sn(e,t){return e.length<t.length?-1:e.length>t.length?1:Pt(e,t)}function we(e,t,r,n,o){let i=r+n;q(e,t,i);let a=new f(s.string,Mt(e,t+r,t+i),i);return o.retainStringBytes===!0&&(a.byteValue=oe(e,t+r,t+i)),a}function rr(e,t,r,n){return we(e,t,1,r,n)}function nr(e,t,r,n){return we(e,t,2,S(e,t+1,n),n)}function or(e,t,r,n){return we(e,t,3,U(e,t+1,n),n)}function ir(e,t,r,n){return we(e,t,5,B(e,t+1,n),n)}function sr(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 we(e,t,9,o,n)}var ar=ie;function se(e,t,r,n){return new f(s.array,n,r)}function cr(e,t,r,n){return se(e,t,1,r)}function fr(e,t,r,n){return se(e,t,2,S(e,t+1,n))}function ur(e,t,r,n){return se(e,t,3,U(e,t+1,n))}function dr(e,t,r,n){return se(e,t,5,B(e,t+1,n))}function pr(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 hr(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 $e(e,t){E(e,s.array.majorEncoded,t.value)}$e.compareTokens=T.compareTokens;$e.encodedSize=function(t){return E.encodedSize(t.value)};function ae(e,t,r,n){return new f(s.map,n,r)}function lr(e,t,r,n){return ae(e,t,1,r)}function mr(e,t,r,n){return ae(e,t,2,S(e,t+1,n))}function xr(e,t,r,n){return ae(e,t,3,U(e,t+1,n))}function yr(e,t,r,n){return ae(e,t,5,B(e,t+1,n))}function gr(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 wr(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 De(e,t){E(e,s.map.majorEncoded,t.value)}De.compareTokens=T.compareTokens;De.encodedSize=function(t){return E.encodedSize(t.value)};function br(e,t,r,n){return new f(s.tag,r,1)}function Er(e,t,r,n){return new f(s.tag,S(e,t+1,n),2)}function _r(e,t,r,n){return new f(s.tag,U(e,t+1,n),3)}function vr(e,t,r,n){return new f(s.tag,B(e,t+1,n),5)}function kr(e,t,r,n){return new f(s.tag,I(e,t+1,n),9)}function Fe(e,t){E(e,s.tag.majorEncoded,t.value)}Fe.compareTokens=T.compareTokens;Fe.encodedSize=function(t){return E.encodedSize(t.value)};var On=20,Nn=21,$n=22,Dn=23;function Ar(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 Sr(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 Ke(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 Ur(e,t,r,n){return Ke(Qe(e,t+1),3,n)}function Br(e,t,r,n){return Ke(Ze(e,t+1),5,n)}function Ir(e,t,r,n){return Ke(Nr(e,t+1),9,n)}function Le(e,t,r){let n=t.value;if(n===!1)e.push([s.float.majorEncoded|On]);else if(n===!0)e.push([s.float.majorEncoded|Nn]);else if(n===null)e.push([s.float.majorEncoded|$n]);else if(n===void 0)e.push([s.float.majorEncoded|Dn]);else{let o,i=!1;(!r||r.float64!==!0)&&(Tr(n),o=Qe(F,1),n===o||Number.isNaN(n)?(F[0]=249,e.push(F.slice(0,3)),i=!0):(Or(n),o=Ze(F,1),n===o&&(F[0]=250,e.push(F.slice(0,5)),i=!0))),i||(Fn(n),o=Nr(F,1),F[0]=251,e.push(F.slice(0,9)))}}Le.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){Tr(n);let o=Qe(F,1);if(n===o||Number.isNaN(n))return 3;if(Or(n),o=Ze(F,1),n===o)return 5}return 9};var Cr=new ArrayBuffer(9),O=new DataView(Cr,1),F=new Uint8Array(Cr,0);function Tr(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 Qe(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 Or(e){O.setFloat32(0,e,!1)}function Ze(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 Fn(e){O.setFloat64(0,e,!1)}function Nr(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)}Le.compareTokens=T.compareTokens;function y(e,t,r){throw new Error(`${p} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function Me(e){return()=>{throw new Error(`${p} ${e}`)}}var d=[];for(let e=0;e<=23;e++)d[e]=y;d[24]=zt;d[25]=Vt;d[26]=Gt;d[27]=Wt;d[28]=y;d[29]=y;d[30]=y;d[31]=y;for(let e=32;e<=55;e++)d[e]=y;d[56]=qt;d[57]=Jt;d[58]=Ht;d[59]=Kt;d[60]=y;d[61]=y;d[62]=y;d[63]=y;for(let e=64;e<=87;e++)d[e]=Qt;d[88]=Zt;d[89]=Yt;d[90]=er;d[91]=tr;d[92]=y;d[93]=y;d[94]=y;d[95]=Me("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)d[e]=rr;d[120]=nr;d[121]=or;d[122]=ir;d[123]=sr;d[124]=y;d[125]=y;d[126]=y;d[127]=Me("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)d[e]=cr;d[152]=fr;d[153]=ur;d[154]=dr;d[155]=pr;d[156]=y;d[157]=y;d[158]=y;d[159]=hr;for(let e=160;e<=183;e++)d[e]=lr;d[184]=mr;d[185]=xr;d[186]=yr;d[187]=gr;d[188]=y;d[189]=y;d[190]=y;d[191]=wr;for(let e=192;e<=215;e++)d[e]=br;d[216]=Er;d[217]=_r;d[218]=vr;d[219]=kr;d[220]=y;d[221]=y;d[222]=y;d[223]=y;for(let e=224;e<=243;e++)d[e]=Me("simple values are not supported");d[244]=y;d[245]=y;d[246]=y;d[247]=Ar;d[248]=Me("simple values are not supported");d[249]=Ur;d[250]=Br;d[251]=Ir;d[252]=y;d[253]=y;d[254]=y;d[255]=Sr;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 $r(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 Mn={float64:!1,mapSorter:Pn,quickEncodeToken:$r};function Rn(){let e=[];return e[s.uint.major]=T,e[s.negint.major]=Oe,e[s.bytes.major]=ie,e[s.string.major]=ar,e[s.array.major]=$e,e[s.map.major]=De,e[s.tag.major]=Fe,e[s.float.major]=Le,e}var Dr=Rn(),Ye=new xe,je=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=je.createCheck(n,e);let o=[],i=0;for(let a of e)o[i++]=Re(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=je.createCheck(n,e);let c=[],u=0;for(let m of i)c[u++]=[Re(m,r,n),Re(o?e.get(m):e[m],r,n)];return jn(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 Re(e,t={},r){let n=$t(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 jn(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Pn(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=Dr[o].compareTokens(r,n);return i===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),i}function Fr(e,t,r,n){if(Array.isArray(t))for(let o of t)Fr(e,o,r,n);else r[t.type.major](e,t,n)}function et(e,t,r){let n=Re(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 xe(a);if(i(c,n,r),c.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return me(c.chunks[0])}}return Ye.reset(),Fr(Ye,n,t,r),Ye.toBytes(!0)}function zn(e,t){return t=Object.assign({},Mn,t),et(e,Dr,t)}var Vn={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},tt=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}},be=Symbol.for("DONE"),Pe=Symbol.for("BREAK");function Gn(e,t,r){let n=[];for(let o=0;o<e.value;o++){let i=Ee(t,r);if(i===Pe){if(e.value===1/0)break;throw new Error(`${p} got unexpected break to lengthed array`)}if(i===be)throw new Error(`${p} found array but not enough entries (got ${o}, expected ${e.value})`);n[o]=i}return n}function Wn(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=Ee(t,r);if(c===Pe){if(e.value===1/0)break;throw new Error(`${p} got unexpected break to lengthed map`)}if(c===be)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=Ee(t,r);if(u===be)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 Ee(e,t){if(e.done())return be;let r=e.next();if(r.type===s.break)return Pe;if(r.type.terminal)return r.value;if(r.type===s.array)return Gn(r,e,t);if(r.type===s.map)return Wn(r,e,t);if(r.type===s.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Ee(e,t);return t.tags[r.value](n)}throw new Error(`${p} tag not supported (${r.value})`)}throw new Error("unsupported")}function rt(e,t){if(!(e instanceof Uint8Array))throw new Error(`${p} data to decode must be a Uint8Array`);t=Object.assign({},Vn,t);let r=t.tokenizer||new tt(e,t),n=Ee(r,t);if(n===be)throw new Error(`${p} did not find any content to decode`);if(n===Pe)throw new Error(`${p} got unexpected break`);return[n,e.subarray(r.pos())]}function nt(e,t){let[r,n]=rt(e,t);if(n.length>0)throw new Error(`${p} too many terminals, data makes no sense`);return r}var ot=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=Te(JSON.stringify(r.value));t.push(n.length>32?me(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 qn(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 Jn={addBreakTokens:!0,mapSorter:qn};function it(e,t){return t=Object.assign({},Jn,t),et(e,new ot,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,He(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 st(e,t){return t=Object.assign({tokenizer:new ce(e,t)},t),nt(e,t)}var Es=new Uint8Array(0);var Lr=(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 Xn(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 Be=u.repeat(g);G<P;++G)Be+=e.charAt(C[G]);return Be}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)),Be=ee;D!==j;)G[Be++]=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 Kn=Xn,Qn=Kn,Rr=Qn;var at=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")}},ct=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 jr(this,t)}},ft=class{constructor(t){this.decoders=t}or(t){return jr(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`)}},jr=(e,t)=>new ft({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),ut=class{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new at(t,r,n),this.decoder=new ct(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},Pr=({name:e,prefix:t,encode:r,decode:n})=>new ut(e,t,r,n),dt=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:o}=Rr(r,t);return Pr({prefix:e,name:t,encode:n,decode:i=>fe(o(i))})},Zn=(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},Yn=(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})=>Pr({prefix:t,name:e,encode(o){return Yn(o,n,r)},decode(o){return Zn(o,n,r,e)}});var _e=k({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Us=k({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Bs=k({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Is=k({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Cs=k({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ts=k({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Os=k({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ns=k({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),$s=k({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var J=dt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ls=dt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var he={};Nt(he,{Digest:()=>re,create:()=>pe,decode:()=>lt,equals:()=>mt});var eo=Gr,zr=128,to=127,ro=~to,no=Math.pow(2,31);function Gr(e,t,r){t=t||[],r=r||0;for(var n=r;e>=no;)t[r++]=e&255|zr,e/=128;for(;e&ro;)t[r++]=e&255|zr,e>>>=7;return t[r]=e|0,Gr.bytes=r-n+1,t}var oo=pt,io=128,Vr=127;function pt(e,n){var r=0,n=n||0,o=0,i=n,a,c=e.length;do{if(i>=c)throw pt.bytes=0,new RangeError("Could not decode varint");a=e[i++],r+=o<28?(a&Vr)<<o:(a&Vr)*Math.pow(2,o),o+=7}while(a>=io);return pt.bytes=i-n,r}var so=Math.pow(2,7),ao=Math.pow(2,14),co=Math.pow(2,21),fo=Math.pow(2,28),uo=Math.pow(2,35),po=Math.pow(2,42),ho=Math.pow(2,49),lo=Math.pow(2,56),mo=Math.pow(2,63),xo=function(e){return e<so?1:e<ao?2:e<co?3:e<fo?4:e<uo?5:e<po?6:e<ho?7:e<lo?8:e<mo?9:10},yo={encode:eo,decode:oo,encodingLength:xo},go=yo,ve=go;var ke=(e,t=0)=>[ve.decode(e,t),ve.decode.bytes],ue=(e,t,r=0)=>(ve.encode(e,t,r),t),de=e=>ve.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)},lt=e=>{let t=fe(e),[r,n]=ke(t),[o,i]=ke(t.subarray(n)),a=t.subarray(n+i);if(a.byteLength!==o)throw new Error("Incorrect length");return new re(r,o,a,t)},mt=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&Lr(e.bytes,r.bytes)}},re=class{constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}};var Wr=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return bo(r,xt(e),t||J.encoder);default:return Eo(r,xt(e),t||_e.encoder)}};var qr=new WeakMap,xt=e=>{let t=qr.get(e);if(t==null){let r=new Map;return qr.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!==Ae)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==_o)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&&mt(t.multihash,n.multihash)}toString(t){return Wr(this,t)}toJSON(){return{"/":Wr(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||Jr(n,o,i.bytes))}else if(r[vo]===!0){let{version:n,multihash:o,code:i}=r,a=lt(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!==Ae)throw new Error(`Version 0 CID must use dag-pb (code: ${Ae}) block encoding`);return new e(t,r,n,n.bytes)}case 1:{let o=Jr(t,r,n.bytes);return new e(t,r,n,o)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,Ae,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]=ke(t.subarray(r));return r+=w,l},o=n(),i=Ae;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]=wo(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 xt(i).set(n,t),i}},wo=(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 _e.prefix:{let r=t||_e;return[_e.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)]}}},bo=(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},Eo=(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},Ae=112,_o=18,Jr=(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},vo=Symbol.for("@ipld/js-cid/CID");var gt=({name:e,code:t,encode:r})=>new yt(e,t,r),yt=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 wt=k({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Qs=k({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Zs=k({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ys=k({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function Ao(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 ze(e){let t=wt.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 ze(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function So(e){return ze(new Uint8Array(e))}function Uo(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function Bo(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 Io={typeEncoders:{Object:Ao,Buffer:ze,Uint8Array:ze,Int8Array:M,Uint16Array:M,Int16Array:M,Uint32Array:M,Int32Array:M,Float32Array:M,Float64Array:M,Uint8ClampedArray:M,BigInt64Array:M,BigUint64Array:M,DataView:M,ArrayBuffer:So,undefined:Uo,number:Bo}},bt=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=wt.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}},Et={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Et.tags[42]=_.parse;var Co="dag-json",_t=297,Ve=e=>it(e,Io),Hr=e=>{let t=Object.assign(Et,{tokenizer:new bt(e,Et)});return st(e,t)},To=e=>Oo.decode(Ve(e));var Oo=new TextDecoder,No=e=>Hr($o.encode(e)),$o=new TextEncoder;function Do(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 kt(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 Xr(e,t){Do(e);let r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var Fo=e=>e instanceof Uint8Array;var We=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),R=(e,t)=>e<<32-t|e>>>t,Lo=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Lo)throw new Error("Non little-endian hardware is not supported");function Mo(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function At(e){if(typeof e=="string"&&(e=Mo(e)),!Fo(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var Ge=class{clone(){return this._cloneInto()}},ia={}.toString;function Kr(e){let t=n=>e().update(At(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Ro(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 qe=class extends Ge{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=We(this.buffer)}update(t){kt(this);let{view:r,buffer:n,blockLen:o}=this;t=At(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=We(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){kt(this),Xr(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;Ro(n,o-8,BigInt(this.length*8),i),this.process(n,0);let c=We(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 jo=(e,t,r)=>e&t^~e&r,Po=(e,t,r)=>e&t^e&r^t&r,zo=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),St=class extends qe{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+jo(c,u,m)+zo[l]+Z[l]|0,g=(R(n,2)^R(n,13)^R(n,22))+Po(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 Qr=Kr(()=>new St);var Vo=Object.create,Bt=Object.defineProperty,Go=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyNames,Wo=Object.getPrototypeOf,qo=Object.prototype.hasOwnProperty,Jo=(e,t,r)=>t in e?Bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yr=(e,t)=>function(){return t||(0,e[Zr(e)[0]])((t={exports:{}}).exports,t),t.exports},Ho=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zr(t))!qo.call(e,o)&&o!==r&&Bt(e,o,{get:()=>t[o],enumerable:!(n=Go(t,o))||n.enumerable});return e},en=(e,t,r)=>(r=e!=null?Vo(Wo(e)):{},Ho(t||!e||!e.__esModule?Bt(r,"default",{value:e,enumerable:!0}):r,e)),Y=(e,t,r)=>(Jo(e,typeof t!="symbol"?t+"":t,r),r),Xo=Yr({"../../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}}),Ko=Yr({"../../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)}}}),Ue=en(Xo(),1),Qo=en(Ko(),1),tn=!1,rn=!1;Ue.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(tn=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(rn=process?.env?.LOGGER_PERF_PREFIX==="true"));var Zo=Object.freeze({prefix:void 0,time:tn,delta:rn,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0}),Ut=[],nn=class{constructor(e,t,r,n){le(this,"sinceFirst",0);le(this,"sinceLast",0);le(this,"time",!1);le(this,"delta",!1);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(",")}]`}},on=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},Se=!1,A=class{static setup(e=A.INFO,t={}){t=Object.assign({},Zo,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,Qo.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(Ue.isNode)return e.bind(console);{let r=[];if(t.time||t.delta){let o=Ue.isBrowser&&navigator.userAgent.includes("Chrome")?["",A.timeStr(!!t.time,!!t.delta)]:[];r.push(...o)}return t.prefix&&(Se?r.push(new on("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 nn(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);Ue.isBrowser?(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Ut&&Ut.length){for(let t of Ut)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof nn))return null;Se||(Se=!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 on?(Se||(Se=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1})):Ue.isNode;function Je({enumerable:e=!0,configurable:t=!1}={}){return{enumerable:e,configurable:t,writable:!1}}function*Yo(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*It(n,o))}else{let r=_.asCID(t);r?yield[e.join("/"),r]:yield*It(t,e)}}function*It(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*Yo(i,o)}}function*ei(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*Ct(n,o))}else yield*Ct(t,e)}function*Ct(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*ei(o,n))}}function ti(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 Tt=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:Je(),bytes:Je(),value:Je(),asBlock:Je()})}links(){return It(this.value,[])}tree(){return Ct(this.value,[])}get(t="/"){return ti(this.value,t.split("/").filter(Boolean))}};async function sn({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 Tt({value:e,bytes:n,cid:i})}var an=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Ot=gt({name:"sha2-256",code:18,encode:an("SHA-256")}),Ea=gt({name:"sha2-512",code:19,encode:an("SHA-512")});var{WARN:ri,LOG:Ba,DEBUG:ni,VERBOSE:cn,ERROR:oi}=N.setup(N.INFO);function ii(e,t=["cid"]){let r={};for(let[n,o]of Object.entries(e))o===void 0&&(ri(`log.${n} is undefined, which is not allowed - encoding as null`,e),o=null),t.includes(n)?cn("excluding app log",{key:n,val:o}):r[n]=o&&n==="pv"?_.parse(o):o;return r}function Ia(e){return fn(si(e).bytes)}function si(e){return un(ii(e))}function fn(e){let t=Qr(e),r=he.create(Ot.code,t),n=_.create(1,_t,r);return cn("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function un(e){ni("[encodeBlock]",e);let t=Ve(e);return{bytes:t,cid:fn(t)}}async function Ca(e){let t=await sn({value:e,codec:vt,hasher:Ot}),r=un(e);return r.cid.toString()!==t.cid.toString()&&oi("[encodeBlockOriginal] sync cid mismatch",{jsonObject:e,encoded:t,syncVariant:r}),t}export{ai as a,ci as b,le as c,N as d,s as e,f,Rn as g,zn as h,nt as i,lt as j,_ as k,Hr as l,ii as m,Ia as n,si as o,fn as p,un as q,Ca as r};
|
|
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-KESATLM4.min.js.map
|