@wovin/connect-nftstorage 0.0.8 → 0.0.9-RC2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,78 @@
1
+ import{b as ki,d as us,e as cs,f as fs,g as Mi,h as ot}from"./chunk-4SMICCLF.min.js";var mc=ki((xI,hc)=>{"use strict";hc.exports=_s;var yc=128,iy=127,oy=~iy,sy=Math.pow(2,31);function _s(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw _s.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=sy;)t[r++]=e&255|yc,e/=128;for(;e&oy;)t[r++]=e&255|yc,e>>>=7;return t[r]=e|0,_s.bytes=r-n+1,t}});var vc=ki((NI,bc)=>{"use strict";bc.exports=ws;var ay=128,gc=127;function ws(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a||i>49)throw ws.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&gc)<<i:(o&gc)*Math.pow(2,i),i+=7}while(o>=ay);return ws.bytes=s-n,r}});var wc=ki(($I,_c)=>{"use strict";var uy=Math.pow(2,7),cy=Math.pow(2,14),fy=Math.pow(2,21),ly=Math.pow(2,28),dy=Math.pow(2,35),py=Math.pow(2,42),yy=Math.pow(2,49),hy=Math.pow(2,56),my=Math.pow(2,63);_c.exports=function(e){return e<uy?1:e<cy?2:e<fy?3:e<ly?4:e<dy?5:e<py?6:e<yy?7:e<hy?8:e<my?9:10}});var Xi=ki((CI,Tc)=>{"use strict";Tc.exports={encode:mc(),decode:vc(),encodingLength:wc()}});var Sp=["string","number","bigint","symbol"],xp=["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 fu(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(Sp.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Np(e))return"Buffer";let r=$p(e);return r||"Object"}function Np(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function $p(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(xp.includes(t))return t}var L=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}};L.uint=new L(0,"uint",!0);L.negint=new L(1,"negint",!0);L.bytes=new L(2,"bytes",!0);L.string=new L(3,"string",!0);L.array=new L(4,"array",!1);L.map=new L(5,"map",!1);L.tag=new L(6,"tag",!1);L.float=new L(7,"float",!0);L.false=new L(7,"false",!0);L.true=new L(7,"true",!0);L.null=new L(7,"null",!0);L.undefined=new L(7,"undefined",!0);L.break=new L(7,"break",!0);var ce=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 sn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Cp=new TextDecoder,Pp=new TextEncoder;function Di(e){return sn&&globalThis.Buffer.isBuffer(e)}function yu(e){return e instanceof Uint8Array?Di(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var hu=sn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):du(e,t,r):(e,t,r)=>r-t>64?Cp.decode(e.subarray(t,r)):du(e,t,r),mu=sn?e=>e.length>64?globalThis.Buffer.from(e):lu(e):e=>e.length>64?Pp.encode(e):lu(e);var an=sn?(e,t,r)=>Di(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),gu=sn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),yu(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},bu=sn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function vu(e,t){if(Di(e)&&Di(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 lu(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}function du(e,t,r){let n=[];for(;t<r;){let i=e[t],s=null,o=i>239?4:i>223?3:i>191?2:1;if(t+o<=r){let a,f,c,y;switch(o){case 1:i<128&&(s=i);break;case 2:a=e[t+1],(a&192)===128&&(y=(i&31)<<6|a&63,y>127&&(s=y));break;case 3:a=e[t+1],f=e[t+2],(a&192)===128&&(f&192)===128&&(y=(i&15)<<12|(a&63)<<6|f&63,y>2047&&(y<55296||y>57343)&&(s=y));break;case 4:a=e[t+1],f=e[t+2],c=e[t+3],(a&192)===128&&(f&192)===128&&(c&192)===128&&(y=(i&15)<<18|(a&63)<<12|(f&63)<<6|c&63,y>65535&&y<1114112&&(s=y))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),t+=o}return Rp(n)}var pu=4096;function Rp(e){let t=e.length;if(t<=pu)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=pu));return r}var Up=256,ji=class{constructor(t=Up){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 i=r.length-(this.maxCursor-this.cursor)-1;r.set(t,i)}else{if(r){let i=r.length-(this.maxCursor-this.cursor)-1;i<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,i),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=bu(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=an(n,0,this.cursor)}else r=gu(this.chunks,this.cursor);return t&&this.reset(),r}};var ve="CBOR decode error:",ls="CBOR encode error:",Dn=[];Dn[23]=1;Dn[24]=2;Dn[25]=3;Dn[26]=5;Dn[27]=9;function Xt(e,t,r){if(e.length-t<r)throw new Error(`${ve} not enough data for type`)}var Ke=[24,256,65536,4294967296,BigInt("18446744073709551616")];function st(e,t,r){Xt(e,t,1);let n=e[t];if(r.strict===!0&&n<Ke[0])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function at(e,t,r){Xt(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Ke[1])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function ut(e,t,r){Xt(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Ke[2])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function ct(e,t,r){Xt(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&s<Ke[3])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(r.allowBigInt===!0)return s;throw new Error(`${ve} integers outside of the safe integer range are not supported`)}function _u(e,t,r,n){return new ce(L.uint,st(e,t+1,n),2)}function wu(e,t,r,n){return new ce(L.uint,at(e,t+1,n),3)}function Tu(e,t,r,n){return new ce(L.uint,ut(e,t+1,n),5)}function Ou(e,t,r,n){return new ce(L.uint,ct(e,t+1,n),9)}function mt(e,t){return ze(e,0,t.value)}function ze(e,t,r){if(r<Ke[0]){let n=Number(r);e.push([t|n])}else if(r<Ke[1]){let n=Number(r);e.push([t|24,n])}else if(r<Ke[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Ke[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<Ke[4]){let i=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),o=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,e.push(i)}else throw new Error(`${ve} encountered BigInt larger than allowable range`)}}mt.encodedSize=function(t){return ze.encodedSize(t.value)};ze.encodedSize=function(t){return t<Ke[0]?1:t<Ke[1]?2:t<Ke[2]?3:t<Ke[3]?5:9};mt.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function Au(e,t,r,n){return new ce(L.negint,-1-st(e,t+1,n),2)}function Iu(e,t,r,n){return new ce(L.negint,-1-at(e,t+1,n),3)}function Eu(e,t,r,n){return new ce(L.negint,-1-ut(e,t+1,n),5)}var ds=BigInt(-1),Su=BigInt(1);function xu(e,t,r,n){let i=ct(e,t+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new ce(L.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${ve} integers outside of the safe integer range are not supported`);return new ce(L.negint,ds-BigInt(i),9)}function Li(e,t){let r=t.value,n=typeof r=="bigint"?r*ds-Su:r*-1-1;ze(e,t.type.majorEncoded,n)}Li.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*ds-Su:r*-1-1;return n<Ke[0]?1:n<Ke[1]?2:n<Ke[2]?3:n<Ke[3]?5:9};Li.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function jn(e,t,r,n){Xt(e,t,r+n);let i=an(e,t+r,t+r+n);return new ce(L.bytes,i,r+n)}function Nu(e,t,r,n){return jn(e,t,1,r)}function $u(e,t,r,n){return jn(e,t,2,st(e,t+1,n))}function Cu(e,t,r,n){return jn(e,t,3,at(e,t+1,n))}function Pu(e,t,r,n){return jn(e,t,5,ut(e,t+1,n))}function Ru(e,t,r,n){let i=ct(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer bytes lengths not supported`);return jn(e,t,9,i)}function Fi(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===L.string?mu(e.value):e.value),e.encodedBytes}function un(e,t){let r=Fi(t);ze(e,t.type.majorEncoded,r.length),e.push(r)}un.encodedSize=function(t){let r=Fi(t);return ze.encodedSize(r.length)+r.length};un.compareTokens=function(t,r){return kp(Fi(t),Fi(r))};function kp(e,t){return e.length<t.length?-1:e.length>t.length?1:vu(e,t)}function Ln(e,t,r,n,i){let s=r+n;Xt(e,t,s);let o=new ce(L.string,hu(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=an(e,t+r,t+s)),o}function Uu(e,t,r,n){return Ln(e,t,1,r,n)}function Bu(e,t,r,n){return Ln(e,t,2,st(e,t+1,n),n)}function ku(e,t,r,n){return Ln(e,t,3,at(e,t+1,n),n)}function Mu(e,t,r,n){return Ln(e,t,5,ut(e,t+1,n),n)}function Du(e,t,r,n){let i=ct(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer string lengths not supported`);return Ln(e,t,9,i,n)}var ju=un;function cn(e,t,r,n){return new ce(L.array,n,r)}function Lu(e,t,r,n){return cn(e,t,1,r)}function Fu(e,t,r,n){return cn(e,t,2,st(e,t+1,n))}function Vu(e,t,r,n){return cn(e,t,3,at(e,t+1,n))}function Ku(e,t,r,n){return cn(e,t,5,ut(e,t+1,n))}function zu(e,t,r,n){let i=ct(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer array lengths not supported`);return cn(e,t,9,i)}function qu(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return cn(e,t,1,1/0)}function Vi(e,t){ze(e,L.array.majorEncoded,t.value)}Vi.compareTokens=mt.compareTokens;Vi.encodedSize=function(t){return ze.encodedSize(t.value)};function fn(e,t,r,n){return new ce(L.map,n,r)}function Gu(e,t,r,n){return fn(e,t,1,r)}function Hu(e,t,r,n){return fn(e,t,2,st(e,t+1,n))}function Wu(e,t,r,n){return fn(e,t,3,at(e,t+1,n))}function Ju(e,t,r,n){return fn(e,t,5,ut(e,t+1,n))}function Xu(e,t,r,n){let i=ct(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer map lengths not supported`);return fn(e,t,9,i)}function Yu(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return fn(e,t,1,1/0)}function Ki(e,t){ze(e,L.map.majorEncoded,t.value)}Ki.compareTokens=mt.compareTokens;Ki.encodedSize=function(t){return ze.encodedSize(t.value)};function Qu(e,t,r,n){return new ce(L.tag,r,1)}function Zu(e,t,r,n){return new ce(L.tag,st(e,t+1,n),2)}function ec(e,t,r,n){return new ce(L.tag,at(e,t+1,n),3)}function tc(e,t,r,n){return new ce(L.tag,ut(e,t+1,n),5)}function rc(e,t,r,n){return new ce(L.tag,ct(e,t+1,n),9)}function zi(e,t){ze(e,L.tag.majorEncoded,t.value)}zi.compareTokens=mt.compareTokens;zi.encodedSize=function(t){return ze.encodedSize(t.value)};var Vp=20,Kp=21,zp=22,qp=23;function nc(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${ve} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new ce(L.null,null,1):new ce(L.undefined,void 0,1)}function ic(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return new ce(L.break,void 0,1)}function ps(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${ve} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${ve} Infinity values are not supported`)}return new ce(L.float,e,t)}function oc(e,t,r,n){return ps(ys(e,t+1),3,n)}function sc(e,t,r,n){return ps(hs(e,t+1),5,n)}function ac(e,t,r,n){return ps(lc(e,t+1),9,n)}function qi(e,t,r){let n=t.value;if(n===!1)e.push([L.float.majorEncoded|Vp]);else if(n===!0)e.push([L.float.majorEncoded|Kp]);else if(n===null)e.push([L.float.majorEncoded|zp]);else if(n===void 0)e.push([L.float.majorEncoded|qp]);else{let i,s=!1;(!r||r.float64!==!0)&&(cc(n),i=ys(Nt,1),n===i||Number.isNaN(n)?(Nt[0]=249,e.push(Nt.slice(0,3)),s=!0):(fc(n),i=hs(Nt,1),n===i&&(Nt[0]=250,e.push(Nt.slice(0,5)),s=!0))),s||(Gp(n),i=lc(Nt,1),Nt[0]=251,e.push(Nt.slice(0,9)))}}qi.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){cc(n);let i=ys(Nt,1);if(n===i||Number.isNaN(n))return 3;if(fc(n),i=hs(Nt,1),n===i)return 5}return 9};var uc=new ArrayBuffer(9),gt=new DataView(uc,1),Nt=new Uint8Array(uc,0);function cc(e){if(e===1/0)gt.setUint16(0,31744,!1);else if(e===-1/0)gt.setUint16(0,64512,!1);else if(Number.isNaN(e))gt.setUint16(0,32256,!1);else{gt.setFloat32(0,e);let t=gt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)gt.setUint16(0,31744,!1);else if(r===0)gt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?gt.setUint16(0,0):i<-14?gt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):gt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function ys(e,t){if(e.length-t<2)throw new Error(`${ve} 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,i=r&1023,s;return n===0?s=i*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,r&32768?-s:s}function fc(e){gt.setFloat32(0,e,!1)}function hs(e,t){if(e.length-t<4)throw new Error(`${ve} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function Gp(e){gt.setFloat64(0,e,!1)}function lc(e,t){if(e.length-t<8)throw new Error(`${ve} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}qi.compareTokens=mt.compareTokens;function Oe(e,t,r){throw new Error(`${ve} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function Gi(e){return()=>{throw new Error(`${ve} ${e}`)}}var ae=[];for(let e=0;e<=23;e++)ae[e]=Oe;ae[24]=_u;ae[25]=wu;ae[26]=Tu;ae[27]=Ou;ae[28]=Oe;ae[29]=Oe;ae[30]=Oe;ae[31]=Oe;for(let e=32;e<=55;e++)ae[e]=Oe;ae[56]=Au;ae[57]=Iu;ae[58]=Eu;ae[59]=xu;ae[60]=Oe;ae[61]=Oe;ae[62]=Oe;ae[63]=Oe;for(let e=64;e<=87;e++)ae[e]=Nu;ae[88]=$u;ae[89]=Cu;ae[90]=Pu;ae[91]=Ru;ae[92]=Oe;ae[93]=Oe;ae[94]=Oe;ae[95]=Gi("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ae[e]=Uu;ae[120]=Bu;ae[121]=ku;ae[122]=Mu;ae[123]=Du;ae[124]=Oe;ae[125]=Oe;ae[126]=Oe;ae[127]=Gi("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ae[e]=Lu;ae[152]=Fu;ae[153]=Vu;ae[154]=Ku;ae[155]=zu;ae[156]=Oe;ae[157]=Oe;ae[158]=Oe;ae[159]=qu;for(let e=160;e<=183;e++)ae[e]=Gu;ae[184]=Hu;ae[185]=Wu;ae[186]=Ju;ae[187]=Xu;ae[188]=Oe;ae[189]=Oe;ae[190]=Oe;ae[191]=Yu;for(let e=192;e<=215;e++)ae[e]=Qu;ae[216]=Zu;ae[217]=ec;ae[218]=tc;ae[219]=rc;ae[220]=Oe;ae[221]=Oe;ae[222]=Oe;ae[223]=Oe;for(let e=224;e<=243;e++)ae[e]=Gi("simple values are not supported");ae[244]=Oe;ae[245]=Oe;ae[246]=Oe;ae[247]=nc;ae[248]=Gi("simple values are not supported");ae[249]=oc;ae[250]=sc;ae[251]=ac;ae[252]=Oe;ae[253]=Oe;ae[254]=Oe;ae[255]=ic;var $t=[];for(let e=0;e<24;e++)$t[e]=new ce(L.uint,e,1);for(let e=-1;e>=-24;e--)$t[31-e]=new ce(L.negint,e,1);$t[64]=new ce(L.bytes,new Uint8Array(0),1);$t[96]=new ce(L.string,"",1);$t[128]=new ce(L.array,0,1);$t[160]=new ce(L.map,0,1);$t[244]=new ce(L.false,!1,1);$t[245]=new ce(L.true,!0,1);$t[246]=new ce(L.null,null,1);function ms(){let e=[];return e[L.uint.major]=mt,e[L.negint.major]=Li,e[L.bytes.major]=un,e[L.string.major]=ju,e[L.array.major]=Vi,e[L.map.major]=Ki,e[L.tag.major]=zi,e[L.float.major]=qi,e}var gI=ms(),bI=new ji,Wi=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(`${ls} object contains circular references`);return new e(r,t)}},sr={null:new ce(L.null,null),undefined:new ce(L.undefined,void 0),true:new ce(L.true,!0),false:new ce(L.false,!1),emptyArray:new ce(L.array,0),emptyMap:new ce(L.map,0)},ar={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new ce(L.float,e):e>=0?new ce(L.uint,e):new ce(L.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new ce(L.uint,e):new ce(L.negint,e)},Uint8Array(e,t,r,n){return new ce(L.bytes,e)},string(e,t,r,n){return new ce(L.string,e)},boolean(e,t,r,n){return e?sr.true:sr.false},null(e,t,r,n){return sr.null},undefined(e,t,r,n){return sr.undefined},ArrayBuffer(e,t,r,n){return new ce(L.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new ce(L.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[sr.emptyArray,new ce(L.break)]:sr.emptyArray;n=Wi.createCheck(n,e);let i=[],s=0;for(let o of e)i[s++]=Hi(o,r,n);return r.addBreakTokens?[new ce(L.array,e.length),i,new ce(L.break)]:[new ce(L.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",s=i?e.keys():Object.keys(e),o=i?e.size:s.length;if(!o)return r.addBreakTokens===!0?[sr.emptyMap,new ce(L.break)]:sr.emptyMap;n=Wi.createCheck(n,e);let a=[],f=0;for(let c of s)a[f++]=[Hi(c,r,n),Hi(i?e.get(c):e[c],r,n)];return Jp(a,r),r.addBreakTokens?[new ce(L.map,o),a,new ce(L.break)]:[new ce(L.map,o),a]}};ar.Map=ar.Object;ar.Buffer=ar.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))ar[`${e}Array`]=ar.DataView;function Hi(e,t={},r){let n=fu(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||ar[n];if(typeof i=="function"){let o=i(e,n,t,r);if(o!=null)return o}let s=ar[n];if(!s)throw new Error(`${ls} unsupported type: ${n}`);return s(e,n,t,r)}function Jp(e,t){t.mapSorter&&e.sort(t.mapSorter)}var Xp={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},gs=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=$t[t];if(r===void 0){let n=ae[t];if(!n)throw new Error(`${ve} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let i=t&31;r=n(this.data,this._pos,i,this.options)}return this._pos+=r.encodedLength,r}},Fn=Symbol.for("DONE"),Ji=Symbol.for("BREAK");function Yp(e,t,r){let n=[];for(let i=0;i<e.value;i++){let s=Vn(t,r);if(s===Ji){if(e.value===1/0)break;throw new Error(`${ve} got unexpected break to lengthed array`)}if(s===Fn)throw new Error(`${ve} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=s}return n}function Qp(e,t,r){let n=r.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let o=0;o<e.value;o++){let a=Vn(t,r);if(a===Ji){if(e.value===1/0)break;throw new Error(`${ve} got unexpected break to lengthed map`)}if(a===Fn)throw new Error(`${ve} found map but not enough entries (got ${o} [no key], expected ${e.value})`);if(n!==!0&&typeof a!="string")throw new Error(`${ve} non-string keys not supported (got ${typeof a})`);if(r.rejectDuplicateMapKeys===!0&&(n&&s.has(a)||!n&&a in i))throw new Error(`${ve} found repeat map key "${a}"`);let f=Vn(t,r);if(f===Fn)throw new Error(`${ve} found map but not enough entries (got ${o} [no value], expected ${e.value})`);n?s.set(a,f):i[a]=f}return n?s:i}function Vn(e,t){if(e.done())return Fn;let r=e.next();if(r.type===L.break)return Ji;if(r.type.terminal)return r.value;if(r.type===L.array)return Yp(r,e,t);if(r.type===L.map)return Qp(r,e,t);if(r.type===L.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Vn(e,t);return t.tags[r.value](n)}throw new Error(`${ve} tag not supported (${r.value})`)}throw new Error("unsupported")}function dc(e,t){if(!(e instanceof Uint8Array))throw new Error(`${ve} data to decode must be a Uint8Array`);t=Object.assign({},Xp,t);let r=t.tokenizer||new gs(e,t),n=Vn(r,t);if(n===Fn)throw new Error(`${ve} did not find any content to decode`);if(n===Ji)throw new Error(`${ve} got unexpected break`);return[n,e.subarray(r.pos())]}function bs(e,t){let[r,n]=dc(e,t);if(n.length>0)throw new Error(`${ve} too many terminals, data makes no sense`);return r}var ty=42;function ry(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return ot.decode(e.subarray(1))}var pc={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};pc.tags[ty]=ry;var vs=e=>bs(e,pc);var ur=us(Xi(),1),Kn={SHA2_256:18,LENGTH:32,DAG_PB:112},Ts=40;function ln(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=ur.default.decode(e);return t.seek(ur.default.decode.bytes),r}function Os(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0;return{version:2,characteristics:[t.getBigUint64(r,!0),t.getBigUint64(r+=8,!0)],dataOffset:Number(t.getBigUint64(r+=8,!0)),dataSize:Number(t.getBigUint64(r+=8,!0)),indexOffset:Number(t.getBigUint64(r+=8,!0))}}function As(e){ur.default.decode(e);let t=ur.default.decode.bytes,r=ur.default.decode(e.subarray(ur.default.decode.bytes)),n=ur.default.decode.bytes;return t+n+r}var cr={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},zn={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":cr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(cr.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=zn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=zn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:cr.Int,CarV1HeaderOrV2Pragma:e=>{if(cr.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=zn["CarV1HeaderOrV2Pragma > roots (anon)"](e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.roots=a}}break;case"version":{n--;let a=zn.Int(e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},qn={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":cr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(cr.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=qn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=qn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:cr.Int,CarV1HeaderOrV2Pragma:e=>{if(cr.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=qn["CarV1HeaderOrV2Pragma > roots (anon)"](o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.roots=a}}break;case"version":{n--;let a=qn.Int(o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},Is={toTyped:zn.CarV1HeaderOrV2Pragma,toRepresentation:qn.CarV1HeaderOrV2Pragma};var VI=ms();var _y=us(Xi(),1);var HI=[new ce(L.map,2),new ce(L.string,"version"),new ce(L.uint,1),new ce(L.string,"roots")],WI=new ce(L.tag,42);async function Es(e,t){let r=ln(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=vs(n);if(Is.toTyped(i)===void 0)throw new Error("Invalid CAR header format");if(i.version!==1&&i.version!==2||t!==void 0&&i.version!==t)throw new Error(`Invalid CAR version: ${i.version}${t!==void 0?` (expected ${t})`:""}`);if(i.version===1){if(!Array.isArray(i.roots))throw new Error("Invalid CAR header format");return i}if(i.roots!==void 0)throw new Error("Invalid CAR header format");let s=Os(await e.exactly(Ts,!0));e.seek(s.dataOffset-e.pos);let o=await Es(e,1);return Object.assign(o,s)}async function Ty(e){let t=await e.exactly(2,!1);if(t[0]===Kn.SHA2_256&&t[1]===Kn.LENGTH){let o=await e.exactly(34,!0),a=Mi(o);return ot.create(0,Kn.DAG_PB,a)}let r=ln(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=ln(await e.upTo(8),e),i=await e.exactly(As(await e.upTo(8)),!0),s=Mi(i);return ot.create(r,n,s)}async function Oc(e){let t=e.pos,r=ln(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await Ty(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function Oy(e){let{cid:t,blockLength:r}=await Oc(e);return{bytes:await e.exactly(r,!0),cid:t}}async function Ay(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await Oc(e),s={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(s.blockLength),s}function fr(e){let t=(async()=>{let r=await Es(e);if(r.version===2){let n=e.pos-r.dataOffset;e=Ey(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await Oy(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await Ay(e)}}}function Cr(e){let t=0;return{async upTo(r){return e.subarray(t,t+Math.min(r,e.length-t))},async exactly(r,n=!1){if(r>e.length-t)throw new Error("Unexpected end of data");let i=e.subarray(t,t+r);return n&&(t+=r),i},seek(r){t+=r},get pos(){return t}}}function Iy(e){let t=0,r=0,n=0,i=new Uint8Array(0),s=async o=>{r=i.length-n;let a=[i.subarray(n)];for(;r<o;){let c=await e();if(c==null)break;r<0?c.length>r&&a.push(c.subarray(-r)):a.push(c),r+=c.length}i=new Uint8Array(a.reduce((c,y)=>c+y.length,0));let f=0;for(let c of a)i.set(c,f),f+=c.length;n=0};return{async upTo(o){return i.length-n<o&&await s(o),i.subarray(n,n+Math.min(i.length-n,o))},async exactly(o,a=!1){if(i.length-n<o&&await s(o),i.length-n<o)throw new Error("Unexpected end of data");let f=i.subarray(n,n+o);return a&&(t+=o,n+=o),f},seek(o){t+=o,n+=o},get pos(){return t}}}function lr(e){let t=e[Symbol.asyncIterator]();async function r(){let n=await t.next();return n.done?null:n.value}return Iy(r)}function Ey(e,t){let r=0;return{async upTo(n){let i=await e.upTo(n);return i.length+r>t&&(i=i.subarray(0,t-r)),i},async exactly(n,i=!1){let s=await e.exactly(n,i);if(s.length+r>t)throw new Error("Unexpected end of data");return i&&(r+=n),s},seek(n){r+=n,e.seek(n)},get pos(){return e.pos}}}var Gn=class{constructor(t,r,n){this._version=t,this._roots=r,this._iterator=n}get version(){return this._version}async getRoots(){return this._roots}[Symbol.asyncIterator](){return this._iterator}static async fromBytes(t){if(!(t instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return Ac(Cr(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Ac(lr(t))}};async function Ac(e){let t=fr(e),{version:r,roots:n}=await t.header();return new Gn(r,n,t.blocksIndex())}var Pr=class{constructor(t,r){this._header=t,this._blocks=r,this._keys=r.map(n=>n.cid.toString())}get version(){return this._header.version}async getRoots(){return this._header.roots}async has(t){return this._keys.indexOf(t.toString())>-1}async get(t){let r=this._keys.indexOf(t.toString());return r>-1?this._blocks[r]:void 0}async*blocks(){for(let t of this._blocks)yield t}async*cids(){for(let t of this._blocks)yield t.cid}static async fromBytes(t){if(!(t instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return Ic(Cr(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Ic(lr(t))}};async function Ic(e){let t=fr(e),r=await t.header(),n=[];for await(let i of t.blocks())n.push(i);return new Pr(r,n)}var Yi=class{constructor(t,r,n){this._version=t,this._roots=r,this._iterable=n,this._decoded=!1}get version(){return this._version}async getRoots(){return this._roots}},Ss=class e extends Yi{[Symbol.asyncIterator](){if(this._decoded)throw new Error("Cannot decode more than once");if(!this._iterable)throw new Error("Block iterable not found");return this._decoded=!0,this._iterable[Symbol.asyncIterator]()}static async fromBytes(t){let{version:r,roots:n,iterator:i}=await Ec(t);return new e(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await Sc(t);return new e(r,n,i)}},xs=class e extends Yi{[Symbol.asyncIterator](){if(this._decoded)throw new Error("Cannot decode more than once");if(!this._iterable)throw new Error("Block iterable not found");this._decoded=!0;let t=this._iterable[Symbol.asyncIterator]();return{async next(){let r=await t.next();return r.done?r:{done:!1,value:r.value.cid}}}}static async fromBytes(t){let{version:r,roots:n,iterator:i}=await Ec(t);return new e(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await Sc(t);return new e(r,n,i)}};async function Ec(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return xc(Cr(e))}async function Sc(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return xc(lr(e))}async function xc(e){let t=fr(e),{version:r,roots:n}=await t.header();return{version:r,roots:n,iterator:t.blocks()}}var Sy=us(Xi(),1);var Nc=class{constructor(t){this._iterator=t}[Symbol.asyncIterator](){if(this._iterating)throw new Error("Multiple iterator not supported");return this._iterating=!0,this._iterator}};var xy=Object.create,Ns=Object.defineProperty,Ny=Object.getOwnPropertyDescriptor,$c=Object.getOwnPropertyNames,$y=Object.getPrototypeOf,Cy=Object.prototype.hasOwnProperty,Le=(e,t)=>function(){return t||(0,e[$c(e)[0]])((t={exports:{}}).exports,t),t.exports},$s=(e,t)=>{for(var r in t)Ns(e,r,{get:t[r],enumerable:!0})},Py=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $c(t))!Cy.call(e,i)&&i!==r&&Ns(e,i,{get:()=>t[i],enumerable:!(n=Ny(t,i))||n.enumerable});return e},Dt=(e,t,r)=>(r=e!=null?xy($y(e)):{},Py(t||!e||!e.__esModule?Ns(r,"default",{value:e,enumerable:!0}):r,e));var Ry={};$s(Ry,{code:()=>uf,decode:()=>lo,encode:()=>Qs,format:()=>Lc,name:()=>Dm,parse:()=>Lm,stringify:()=>Lc});var Uy=["string","number","bigint","symbol"],By=["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 ky(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(Uy.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(My(e))return"Buffer";let r=Dy(e);return r||"Object"}function My(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Dy(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(By.includes(t))return t}var C=class{constructor(e,t,r){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};C.uint=new C(0,"uint",!0);C.negint=new C(1,"negint",!0);C.bytes=new C(2,"bytes",!0);C.string=new C(3,"string",!0);C.array=new C(4,"array",!1);C.map=new C(5,"map",!1);C.tag=new C(6,"tag",!1);C.float=new C(7,"float",!0);C.false=new C(7,"false",!0);C.true=new C(7,"true",!0);C.null=new C(7,"null",!0);C.undefined=new C(7,"undefined",!0);C.break=new C(7,"break",!0);var Z=class{constructor(e,t,r){this.type=e,this.value=t,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},dn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",jy=new TextDecoder,Ly=new TextEncoder;function eo(e){return dn&&globalThis.Buffer.isBuffer(e)}function Ds(e){return e instanceof Uint8Array?eo(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var Fy=dn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Pc(e,t,r):(e,t,r)=>r-t>64?jy.decode(e.subarray(t,r)):Pc(e,t,r),Vc=dn?e=>e.length>64?globalThis.Buffer.from(e):Cc(e):e=>e.length>64?Ly.encode(e):Cc(e);var js=dn?(e,t,r)=>eo(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Vy=dn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),Ds(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},Ky=dn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function zy(e,t){if(eo(e)&&eo(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 Cc(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}function Pc(e,t,r){let n=[];for(;t<r;){let i=e[t],s=null,o=i>239?4:i>223?3:i>191?2:1;if(t+o<=r){let a,f,c,y;switch(o){case 1:i<128&&(s=i);break;case 2:a=e[t+1],(a&192)===128&&(y=(i&31)<<6|a&63,y>127&&(s=y));break;case 3:a=e[t+1],f=e[t+2],(a&192)===128&&(f&192)===128&&(y=(i&15)<<12|(a&63)<<6|f&63,y>2047&&(y<55296||y>57343)&&(s=y));break;case 4:a=e[t+1],f=e[t+2],c=e[t+3],(a&192)===128&&(f&192)===128&&(c&192)===128&&(y=(i&15)<<18|(a&63)<<12|(f&63)<<6|c&63,y>65535&&y<1114112&&(s=y))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),t+=o}return Kc(n)}var Rc=4096;function Kc(e){let t=e.length;if(t<=Rc)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Rc));return r}var qy=256,zc=class{constructor(e=qy){this.chunkSize=e,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(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let n=t.length-(this.maxCursor-this.cursor)-1;t.set(e,n)}else{if(t){let n=t.length-(this.maxCursor-this.cursor)-1;n<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,n),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=Ky(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let r=this.chunks[0];e&&this.cursor>r.length/2?(t=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=js(r,0,this.cursor)}else t=Vy(this.chunks,this.cursor);return e&&this.reset(),t}},he="CBOR decode error:",Rr="CBOR encode error:",Qn=[];Qn[23]=1;Qn[24]=2;Qn[25]=3;Qn[26]=5;Qn[27]=9;function pn(e,t,r){if(e.length-t<r)throw new Error(`${he} not enough data for type`)}var qe=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Ur(e,t,r){pn(e,t,1);let n=e[t];if(r.strict===!0&&n<qe[0])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function Br(e,t,r){pn(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<qe[1])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function kr(e,t,r){pn(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<qe[2])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function Mr(e,t,r){pn(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&s<qe[3])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(r.allowBigInt===!0)return s;throw new Error(`${he} integers outside of the safe integer range are not supported`)}function Gy(e,t,r,n){return new Z(C.uint,Ur(e,t+1,n),2)}function Hy(e,t,r,n){return new Z(C.uint,Br(e,t+1,n),3)}function Wy(e,t,r,n){return new Z(C.uint,kr(e,t+1,n),5)}function Jy(e,t,r,n){return new Z(C.uint,Mr(e,t+1,n),9)}function Dr(e,t){return vt(e,0,t.value)}function vt(e,t,r){if(r<qe[0]){let n=Number(r);e.push([t|n])}else if(r<qe[1]){let n=Number(r);e.push([t|24,n])}else if(r<qe[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<qe[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<qe[4]){let i=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),o=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,e.push(i)}else throw new Error(`${he} encountered BigInt larger than allowable range`)}}Dr.encodedSize=function(t){return vt.encodedSize(t.value)};vt.encodedSize=function(t){return t<qe[0]?1:t<qe[1]?2:t<qe[2]?3:t<qe[3]?5:9};Dr.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function Xy(e,t,r,n){return new Z(C.negint,-1-Ur(e,t+1,n),2)}function Yy(e,t,r,n){return new Z(C.negint,-1-Br(e,t+1,n),3)}function Qy(e,t,r,n){return new Z(C.negint,-1-kr(e,t+1,n),5)}var Ls=BigInt(-1),qc=BigInt(1);function Zy(e,t,r,n){let i=Mr(e,t+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new Z(C.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${he} integers outside of the safe integer range are not supported`);return new Z(C.negint,Ls-BigInt(i),9)}function Fs(e,t){let r=t.value,n=typeof r=="bigint"?r*Ls-qc:r*-1-1;vt(e,t.type.majorEncoded,n)}Fs.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*Ls-qc:r*-1-1;return n<qe[0]?1:n<qe[1]?2:n<qe[2]?3:n<qe[3]?5:9};Fs.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function Zn(e,t,r,n){pn(e,t,r+n);let i=js(e,t+r,t+r+n);return new Z(C.bytes,i,r+n)}function eh(e,t,r,n){return Zn(e,t,1,r)}function th(e,t,r,n){return Zn(e,t,2,Ur(e,t+1,n))}function rh(e,t,r,n){return Zn(e,t,3,Br(e,t+1,n))}function nh(e,t,r,n){return Zn(e,t,5,kr(e,t+1,n))}function ih(e,t,r,n){let i=Mr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer bytes lengths not supported`);return Zn(e,t,9,i)}function to(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===C.string?Vc(e.value):e.value),e.encodedBytes}function ao(e,t){let r=to(t);vt(e,t.type.majorEncoded,r.length),e.push(r)}ao.encodedSize=function(t){let r=to(t);return vt.encodedSize(r.length)+r.length};ao.compareTokens=function(t,r){return oh(to(t),to(r))};function oh(e,t){return e.length<t.length?-1:e.length>t.length?1:zy(e,t)}function ei(e,t,r,n,i){let s=r+n;pn(e,t,s);let o=new Z(C.string,Fy(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=js(e,t+r,t+s)),o}function sh(e,t,r,n){return ei(e,t,1,r,n)}function ah(e,t,r,n){return ei(e,t,2,Ur(e,t+1,n),n)}function uh(e,t,r,n){return ei(e,t,3,Br(e,t+1,n),n)}function ch(e,t,r,n){return ei(e,t,5,kr(e,t+1,n),n)}function fh(e,t,r,n){let i=Mr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer string lengths not supported`);return ei(e,t,9,i,n)}var lh=ao;function yn(e,t,r,n){return new Z(C.array,n,r)}function dh(e,t,r,n){return yn(e,t,1,r)}function ph(e,t,r,n){return yn(e,t,2,Ur(e,t+1,n))}function yh(e,t,r,n){return yn(e,t,3,Br(e,t+1,n))}function hh(e,t,r,n){return yn(e,t,5,kr(e,t+1,n))}function mh(e,t,r,n){let i=Mr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer array lengths not supported`);return yn(e,t,9,i)}function gh(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return yn(e,t,1,1/0)}function Vs(e,t){vt(e,C.array.majorEncoded,t.value)}Vs.compareTokens=Dr.compareTokens;Vs.encodedSize=function(t){return vt.encodedSize(t.value)};function hn(e,t,r,n){return new Z(C.map,n,r)}function bh(e,t,r,n){return hn(e,t,1,r)}function vh(e,t,r,n){return hn(e,t,2,Ur(e,t+1,n))}function _h(e,t,r,n){return hn(e,t,3,Br(e,t+1,n))}function wh(e,t,r,n){return hn(e,t,5,kr(e,t+1,n))}function Th(e,t,r,n){let i=Mr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer map lengths not supported`);return hn(e,t,9,i)}function Oh(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return hn(e,t,1,1/0)}function Ks(e,t){vt(e,C.map.majorEncoded,t.value)}Ks.compareTokens=Dr.compareTokens;Ks.encodedSize=function(t){return vt.encodedSize(t.value)};function Ah(e,t,r,n){return new Z(C.tag,r,1)}function Ih(e,t,r,n){return new Z(C.tag,Ur(e,t+1,n),2)}function Eh(e,t,r,n){return new Z(C.tag,Br(e,t+1,n),3)}function Sh(e,t,r,n){return new Z(C.tag,kr(e,t+1,n),5)}function xh(e,t,r,n){return new Z(C.tag,Mr(e,t+1,n),9)}function zs(e,t){vt(e,C.tag.majorEncoded,t.value)}zs.compareTokens=Dr.compareTokens;zs.encodedSize=function(t){return vt.encodedSize(t.value)};var Nh=20,$h=21,Ch=22,Ph=23;function Rh(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${he} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new Z(C.null,null,1):new Z(C.undefined,void 0,1)}function Uh(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return new Z(C.break,void 0,1)}function qs(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${he} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${he} Infinity values are not supported`)}return new Z(C.float,e,t)}function Bh(e,t,r,n){return qs(Hs(e,t+1),3,n)}function kh(e,t,r,n){return qs(Ws(e,t+1),5,n)}function Mh(e,t,r,n){return qs(Jc(e,t+1),9,n)}function Gs(e,t,r){let n=t.value;if(n===!1)e.push([C.float.majorEncoded|Nh]);else if(n===!0)e.push([C.float.majorEncoded|$h]);else if(n===null)e.push([C.float.majorEncoded|Ch]);else if(n===void 0)e.push([C.float.majorEncoded|Ph]);else{let i,s=!1;(!r||r.float64!==!0)&&(Hc(n),i=Hs(Pt,1),n===i||Number.isNaN(n)?(Pt[0]=249,e.push(Pt.slice(0,3)),s=!0):(Wc(n),i=Ws(Pt,1),n===i&&(Pt[0]=250,e.push(Pt.slice(0,5)),s=!0))),s||(Dh(n),i=Jc(Pt,1),Pt[0]=251,e.push(Pt.slice(0,9)))}}Gs.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){Hc(n);let i=Hs(Pt,1);if(n===i||Number.isNaN(n))return 3;if(Wc(n),i=Ws(Pt,1),n===i)return 5}return 9};var Gc=new ArrayBuffer(9),bt=new DataView(Gc,1),Pt=new Uint8Array(Gc,0);function Hc(e){if(e===1/0)bt.setUint16(0,31744,!1);else if(e===-1/0)bt.setUint16(0,64512,!1);else if(Number.isNaN(e))bt.setUint16(0,32256,!1);else{bt.setFloat32(0,e);let t=bt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)bt.setUint16(0,31744,!1);else if(r===0)bt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?bt.setUint16(0,0):i<-14?bt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):bt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function Hs(e,t){if(e.length-t<2)throw new Error(`${he} 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,i=r&1023,s;return n===0?s=i*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,r&32768?-s:s}function Wc(e){bt.setFloat32(0,e,!1)}function Ws(e,t){if(e.length-t<4)throw new Error(`${he} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function Dh(e){bt.setFloat64(0,e,!1)}function Jc(e,t){if(e.length-t<8)throw new Error(`${he} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}Gs.compareTokens=Dr.compareTokens;function Ae(e,t,r){throw new Error(`${he} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function uo(e){return()=>{throw new Error(`${he} ${e}`)}}var ue=[];for(let e=0;e<=23;e++)ue[e]=Ae;ue[24]=Gy;ue[25]=Hy;ue[26]=Wy;ue[27]=Jy;ue[28]=Ae;ue[29]=Ae;ue[30]=Ae;ue[31]=Ae;for(let e=32;e<=55;e++)ue[e]=Ae;ue[56]=Xy;ue[57]=Yy;ue[58]=Qy;ue[59]=Zy;ue[60]=Ae;ue[61]=Ae;ue[62]=Ae;ue[63]=Ae;for(let e=64;e<=87;e++)ue[e]=eh;ue[88]=th;ue[89]=rh;ue[90]=nh;ue[91]=ih;ue[92]=Ae;ue[93]=Ae;ue[94]=Ae;ue[95]=uo("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ue[e]=sh;ue[120]=ah;ue[121]=uh;ue[122]=ch;ue[123]=fh;ue[124]=Ae;ue[125]=Ae;ue[126]=Ae;ue[127]=uo("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ue[e]=dh;ue[152]=ph;ue[153]=yh;ue[154]=hh;ue[155]=mh;ue[156]=Ae;ue[157]=Ae;ue[158]=Ae;ue[159]=gh;for(let e=160;e<=183;e++)ue[e]=bh;ue[184]=vh;ue[185]=_h;ue[186]=wh;ue[187]=Th;ue[188]=Ae;ue[189]=Ae;ue[190]=Ae;ue[191]=Oh;for(let e=192;e<=215;e++)ue[e]=Ah;ue[216]=Ih;ue[217]=Eh;ue[218]=Sh;ue[219]=xh;ue[220]=Ae;ue[221]=Ae;ue[222]=Ae;ue[223]=Ae;for(let e=224;e<=243;e++)ue[e]=uo("simple values are not supported");ue[244]=Ae;ue[245]=Ae;ue[246]=Ae;ue[247]=Rh;ue[248]=uo("simple values are not supported");ue[249]=Bh;ue[250]=kh;ue[251]=Mh;ue[252]=Ae;ue[253]=Ae;ue[254]=Ae;ue[255]=Uh;var Lt=[];for(let e=0;e<24;e++)Lt[e]=new Z(C.uint,e,1);for(let e=-1;e>=-24;e--)Lt[31-e]=new Z(C.negint,e,1);Lt[64]=new Z(C.bytes,new Uint8Array(0),1);Lt[96]=new Z(C.string,"",1);Lt[128]=new Z(C.array,0,1);Lt[160]=new Z(C.map,0,1);Lt[244]=new Z(C.false,!1,1);Lt[245]=new Z(C.true,!0,1);Lt[246]=new Z(C.null,null,1);function Js(){let e=[];return e[C.uint.major]=Dr,e[C.negint.major]=Fs,e[C.bytes.major]=ao,e[C.string.major]=lh,e[C.array.major]=Vs,e[C.map.major]=Ks,e[C.tag.major]=zs,e[C.float.major]=Gs,e}var RE=Js(),Cs=new zc,Uc=class Xc{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(`${Rr} object contains circular references`);return new Xc(r,t)}},dr={null:new Z(C.null,null),undefined:new Z(C.undefined,void 0),true:new Z(C.true,!0),false:new Z(C.false,!1),emptyArray:new Z(C.array,0),emptyMap:new Z(C.map,0)},mr={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new Z(C.float,e):e>=0?new Z(C.uint,e):new Z(C.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new Z(C.uint,e):new Z(C.negint,e)},Uint8Array(e,t,r,n){return new Z(C.bytes,e)},string(e,t,r,n){return new Z(C.string,e)},boolean(e,t,r,n){return e?dr.true:dr.false},null(e,t,r,n){return dr.null},undefined(e,t,r,n){return dr.undefined},ArrayBuffer(e,t,r,n){return new Z(C.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new Z(C.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[dr.emptyArray,new Z(C.break)]:dr.emptyArray;n=Uc.createCheck(n,e);let i=[],s=0;for(let o of e)i[s++]=Qi(o,r,n);return r.addBreakTokens?[new Z(C.array,e.length),i,new Z(C.break)]:[new Z(C.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",s=i?e.keys():Object.keys(e),o=i?e.size:s.length;if(!o)return r.addBreakTokens===!0?[dr.emptyMap,new Z(C.break)]:dr.emptyMap;n=Uc.createCheck(n,e);let a=[],f=0;for(let c of s)a[f++]=[Qi(c,r,n),Qi(i?e.get(c):e[c],r,n)];return jh(a,r),r.addBreakTokens?[new Z(C.map,o),a,new Z(C.break)]:[new Z(C.map,o),a]}};mr.Map=mr.Object;mr.Buffer=mr.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))mr[`${e}Array`]=mr.DataView;function Qi(e,t={},r){let n=ky(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||mr[n];if(typeof i=="function"){let o=i(e,n,t,r);if(o!=null)return o}let s=mr[n];if(!s)throw new Error(`${Rr} unsupported type: ${n}`);return s(e,n,t,r)}function jh(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Yc(e,t,r,n){if(Array.isArray(t))for(let i of t)Yc(e,i,r,n);else r[t.type.major](e,t,n)}function Lh(e,t,r){let n=Qi(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let i=r.quickEncodeToken(n);if(i)return i;let s=t[n.type.major];if(s.encodedSize){let o=s.encodedSize(n,r),a=new zc(o);if(s(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return Ds(a.chunks[0])}}return Cs.reset(),Yc(Cs,n,t,r),Cs.toBytes(!0)}var Fh={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Vh=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=Lt[e];if(t===void 0){let r=ue[e];if(!r)throw new Error(`${he} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let n=e&31;t=r(this.data,this._pos,n,this.options)}return this._pos+=t.encodedLength,t}},Jn=Symbol.for("DONE"),co=Symbol.for("BREAK");function Kh(e,t,r){let n=[];for(let i=0;i<e.value;i++){let s=Xn(t,r);if(s===co){if(e.value===1/0)break;throw new Error(`${he} got unexpected break to lengthed array`)}if(s===Jn)throw new Error(`${he} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=s}return n}function zh(e,t,r){let n=r.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let o=0;o<e.value;o++){let a=Xn(t,r);if(a===co){if(e.value===1/0)break;throw new Error(`${he} got unexpected break to lengthed map`)}if(a===Jn)throw new Error(`${he} found map but not enough entries (got ${o} [no key], expected ${e.value})`);if(n!==!0&&typeof a!="string")throw new Error(`${he} non-string keys not supported (got ${typeof a})`);if(r.rejectDuplicateMapKeys===!0&&(n&&s.has(a)||!n&&a in i))throw new Error(`${he} found repeat map key "${a}"`);let f=Xn(t,r);if(f===Jn)throw new Error(`${he} found map but not enough entries (got ${o} [no value], expected ${e.value})`);n?s.set(a,f):i[a]=f}return n?s:i}function Xn(e,t){if(e.done())return Jn;let r=e.next();if(r.type===C.break)return co;if(r.type.terminal)return r.value;if(r.type===C.array)return Kh(r,e,t);if(r.type===C.map)return zh(r,e,t);if(r.type===C.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Xn(e,t);return t.tags[r.value](n)}throw new Error(`${he} tag not supported (${r.value})`)}throw new Error("unsupported")}function qh(e,t){if(!(e instanceof Uint8Array))throw new Error(`${he} data to decode must be a Uint8Array`);t=Object.assign({},Fh,t);let r=t.tokenizer||new Vh(e,t),n=Xn(r,t);if(n===Jn)throw new Error(`${he} did not find any content to decode`);if(n===co)throw new Error(`${he} got unexpected break`);return[n,e.subarray(r.pos())]}function Xs(e,t){let[r,n]=qh(e,t);if(n.length>0)throw new Error(`${he} too many terminals, data makes no sense`);return r}var Gh=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===C.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===C.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[C.uint.major](e,t){this.prefix(e);let r=String(t.value),n=[];for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);e.push(n)}[C.negint.major](e,t){this[C.uint.major](e,t)}[C.bytes.major](e,t){throw new Error(`${Rr} unsupported type: Uint8Array`)}[C.string.major](e,t){this.prefix(e);let r=Vc(JSON.stringify(t.value));e.push(r.length>32?Ds(r):r)}[C.array.major](e,t){this.prefix(e),this.inRecursive.push({type:C.array,elements:0}),e.push([91])}[C.map.major](e,t){this.prefix(e),this.inRecursive.push({type:C.map,elements:0}),e.push([123])}[C.tag.major](e,t){}[C.float.major](e,t){if(t.type.name==="break"){let s=this.inRecursive.pop();if(s){if(s.type===C.array)e.push([93]);else if(s.type===C.map)e.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(t.value===void 0)throw new Error(`${Rr} unsupported type: undefined`);if(this.prefix(e),t.type.name==="true"){e.push([116,114,117,101]);return}else if(t.type.name==="false"){e.push([102,97,108,115,101]);return}else if(t.type.name==="null"){e.push([110,117,108,108]);return}let r=String(t.value),n=[],i=!1;for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s),!i&&(n[s]===46||n[s]===101||n[s]===69)&&(i=!0);i||(n.push(46),n.push(48)),e.push(n)}};function Hh(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${Rr} complex map keys are not supported`);let r=e[0],n=t[0];if(r.type!==C.string||n.type!==C.string)throw new Error(`${Rr} non-string map keys are not supported`);if(r<n)return-1;if(r>n)return 1;throw new Error(`${Rr} unexpected duplicate map keys, this is not supported`)}var Wh={addBreakTokens:!0,mapSorter:Hh};function Jh(e,t){return t=Object.assign({},Wh,t),Lh(e,new Gh,t)}var Qc=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t,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 e=this.ch();for(;e===32||e===9||e===13||e===10;)e=this.data[++this._pos]}expect(e){if(this.data.length-this._pos<e.length)throw new Error(`${he} unexpected end of input at position ${this._pos}`);for(let t=0;t<e.length;t++)if(this.data[this._pos++]!==e[t])throw new Error(`${he} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,r=!1,n=o=>{for(;!this.done();){let a=this.ch();if(o.includes(a))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,r=!0;else return new Z(C.uint,0,this._pos-e);if(n([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${he} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(r)throw new Error(`${he} unexpected token at position ${this._pos}`);r=!0,this._pos++,n([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(r=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,n([48,49,50,51,52,53,54,55,56,57]));let i=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),s=parseFloat(i);return r?new Z(C.float,s,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(s)?new Z(s>=0?C.uint:C.negint,s,this._pos-e):new Z(s>=0?C.uint:C.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${he} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,s=0;i<this.data.length&&s<65536;i++,s++){let o=this.data[i];if(o===92||o<32||o>=128)break;if(o===34){let a=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new Z(C.string,a,s)}}let e=this._pos,t=[],r=()=>{if(this._pos+4>=this.data.length)throw new Error(`${he} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let s=0;s<4;s++){let o=this.ch();if(o>=48&&o<=57)o-=48;else if(o>=97&&o<=102)o=o-97+10;else if(o>=65&&o<=70)o=o-65+10;else throw new Error(`${he} unexpected unicode escape character at position ${this._pos}`);i=i*16+o,this._pos++}return i},n=()=>{let i=this.ch(),s=null,o=i>239?4:i>223?3:i>191?2:1;if(this._pos+o>this.data.length)throw new Error(`${he} unexpected unicode sequence at position ${this._pos}`);let a,f,c,y;switch(o){case 1:i<128&&(s=i);break;case 2:a=this.data[this._pos+1],(a&192)===128&&(y=(i&31)<<6|a&63,y>127&&(s=y));break;case 3:a=this.data[this._pos+1],f=this.data[this._pos+2],(a&192)===128&&(f&192)===128&&(y=(i&15)<<12|(a&63)<<6|f&63,y>2047&&(y<55296||y>57343)&&(s=y));break;case 4:a=this.data[this._pos+1],f=this.data[this._pos+2],c=this.data[this._pos+3],(a&192)===128&&(f&192)===128&&(c&192)===128&&(y=(i&15)<<18|(a&63)<<12|(f&63)<<6|c&63,y>65535&&y<1114112&&(s=y))}s===null?(s=65533,o=1):s>65535&&(s-=65536,t.push(s>>>10&1023|55296),s=56320|s&1023),t.push(s),this._pos+=o};for(;!this.done();){let i=this.ch(),s;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${he} unexpected string termination at position ${this._pos}`);switch(s=this.ch(),this._pos++,s){case 34:case 39:case 92:case 47:t.push(s);break;case 98:t.push(8);break;case 116:t.push(9);break;case 110:t.push(10);break;case 102:t.push(12);break;case 114:t.push(13);break;case 117:t.push(r());break;default:throw new Error(`${he} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new Z(C.string,Kc(t),this._pos-e);default:if(i<32)throw new Error(`${he} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):n()}}throw new Error(`${he} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new Z(C.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new Z(C.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new Z(C.null,null,4);case 102:return this.expect([102,97,108,115,101]),new Z(C.false,!1,5);case 116:return this.expect([116,114,117,101]),new Z(C.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(`${he} 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 Z(C.break,void 0,1);if(this.ch()!==44)throw new Error(`${he} 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 Z(C.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 Z(C.break,void 0,1);if(this.ch()!==44)throw new Error(`${he} 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 Z(C.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${he} 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"),e}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${he} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function Xh(e,t){return t=Object.assign({tokenizer:new Qc(e,t)},t),Xs(e,t)}var UE=new Uint8Array(0),Yh=(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},Ys=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 Qh(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 i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=e.length,f=e.charAt(0),c=Math.log(a)/Math.log(256),y=Math.log(256)/Math.log(a);function g(j){if(j instanceof Uint8Array||(ArrayBuffer.isView(j)?j=new Uint8Array(j.buffer,j.byteOffset,j.byteLength):Array.isArray(j)&&(j=Uint8Array.from(j))),!(j instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(j.length===0)return"";for(var te=0,W=0,B=0,z=j.length;B!==z&&j[B]===0;)B++,te++;for(var Y=(z-B)*y+1>>>0,ie=new Uint8Array(Y);B!==z;){for(var F=j[B],se=0,K=Y-1;(F!==0||se<W)&&K!==-1;K--,se++)F+=256*ie[K]>>>0,ie[K]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");W=se,B++}for(var ye=Y-W;ye!==Y&&ie[ye]===0;)ye++;for(var D=f.repeat(te);ye<Y;++ye)D+=e.charAt(ie[ye]);return D}function M(j){if(typeof j!="string")throw new TypeError("Expected String");if(j.length===0)return new Uint8Array;var te=0;if(j[te]!==" "){for(var W=0,B=0;j[te]===f;)W++,te++;for(var z=(j.length-te)*c+1>>>0,Y=new Uint8Array(z);j[te];){var ie=r[j.charCodeAt(te)];if(ie===255)return;for(var F=0,se=z-1;(ie!==0||F<B)&&se!==-1;se--,F++)ie+=a*Y[se]>>>0,Y[se]=ie%256>>>0,ie=ie/256>>>0;if(ie!==0)throw new Error("Non-zero carry");B=F,te++}if(j[te]!==" "){for(var K=z-B;K!==z&&Y[K]===0;)K++;for(var ye=new Uint8Array(W+(z-K)),D=W;K!==z;)ye[D++]=Y[K++];return ye}}}function R(j){var te=M(j);if(te)return te;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:M,decode:R}}var Zh=Qh,em=Zh,tm=em,rm=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},nm=class{constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Zc(this,e)}},im=class{constructor(e){this.decoders=e}or(e){return Zc(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Zc=(e,t)=>new im({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),om=class{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new rm(e,t,r),this.decoder=new nm(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ef=({name:e,prefix:t,encode:r,decode:n})=>new om(e,t,r,n),tf=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=tm(r,t);return ef({prefix:e,name:t,encode:n,decode:s=>Ys(i(s))})},sm=(e,t,r,n)=>{let i={};for(let y=0;y<t.length;++y)i[t[y]]=y;let s=e.length;for(;e[s-1]==="=";)--s;let o=new Uint8Array(s*r/8|0),a=0,f=0,c=0;for(let y=0;y<s;++y){let g=i[e[y]];if(g===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|g,a+=r,a>=8&&(a-=8,o[c++]=255&f>>a)}if(a>=r||255&f<<8-a)throw new SyntaxError("Unexpected end of data");return o},am=(e,t,r)=>{let n=t[t.length-1]==="=",i=(1<<r)-1,s="",o=0,a=0;for(let f=0;f<e.length;++f)for(a=a<<8|e[f],o+=8;o>r;)o-=r,s+=t[i&a>>o];if(o&&(s+=t[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},ft=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>ef({prefix:t,name:e,encode(i){return am(i,n,r)},decode(i){return sm(i,n,r,e)}}),Zi=ft({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),BE=ft({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),kE=ft({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ME=ft({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),DE=ft({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),jE=ft({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),LE=ft({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),FE=ft({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),VE=ft({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),hr=tf({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),KE=tf({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),rf={};$s(rf,{Digest:()=>fo,create:()=>oo,decode:()=>ti,equals:()=>of});var um=nf,Bc=128,cm=127,fm=~cm,lm=Math.pow(2,31);function nf(e,t,r){t=t||[],r=r||0;for(var n=r;e>=lm;)t[r++]=e&255|Bc,e/=128;for(;e&fm;)t[r++]=e&255|Bc,e>>>=7;return t[r]=e|0,nf.bytes=r-n+1,t}var dm=Us,pm=128,kc=127;function Us(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a)throw Us.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&kc)<<i:(o&kc)*Math.pow(2,i),i+=7}while(o>=pm);return Us.bytes=s-n,r}var ym=Math.pow(2,7),hm=Math.pow(2,14),mm=Math.pow(2,21),gm=Math.pow(2,28),bm=Math.pow(2,35),vm=Math.pow(2,42),_m=Math.pow(2,49),wm=Math.pow(2,56),Tm=Math.pow(2,63),Om=function(e){return e<ym?1:e<hm?2:e<mm?3:e<gm?4:e<bm?5:e<vm?6:e<_m?7:e<wm?8:e<Tm?9:10},Am={encode:um,decode:dm,encodingLength:Om},Im=Am,ro=Im,Bs=(e,t=0)=>[ro.decode(e,t),ro.decode.bytes],no=(e,t,r=0)=>(ro.encode(e,t,r),t),io=e=>ro.encodingLength(e),oo=(e,t)=>{let r=t.byteLength,n=io(e),i=n+io(r),s=new Uint8Array(i+r);return no(e,s,0),no(r,s,n),s.set(t,i),new fo(e,r,t,s)},ti=e=>{let t=Ys(e),[r,n]=Bs(t),[i,s]=Bs(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new fo(r,i,o,t)},of=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&Yh(e.bytes,r.bytes)}},fo=class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},Mc=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return Sm(r,ks(e),t||hr.encoder);default:return xm(r,ks(e),t||Zi.encoder)}},Dc=new WeakMap,ks=e=>{let t=Dc.get(e);if(t==null){let r=new Map;return Dc.set(e,r),r}return t},Yt=class Je{constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}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!==Hn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Nm)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Je.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=oo(t,r);return Je.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 Je.equals(this,t)}static equals(t,r){let n=r;return n&&t.code===n.code&&t.version===n.version&&of(t.multihash,n.multihash)}toString(t){return Mc(this,t)}toJSON(){return{"/":Mc(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 Je)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new Je(n,i,s,o||jc(n,i,s.bytes))}else if(r[$m]===!0){let{version:n,multihash:i,code:s}=r,o=ti(i);return Je.create(n,s,o)}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!==Hn)throw new Error(`Version 0 CID must use dag-pb (code: ${Hn}) block encoding`);return new Je(t,r,n,n.bytes)}case 1:{let i=jc(t,r,n.bytes);return new Je(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return Je.create(0,Hn,t)}static createV1(t,r){return Je.create(1,t,r)}static decode(t){let[r,n]=Je.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=Je.inspectBytes(t),n=r.size-r.multihashSize,i=Ys(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new fo(r.multihashCode,r.digestSize,s,i);return[r.version===0?Je.createV0(o):Je.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[g,M]=Bs(t.subarray(r));return r+=M,g},i=n(),s=Hn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),f=n(),c=r+f,y=c-o;return{version:i,codec:s,multihashCode:a,digestSize:f,multihashSize:y,size:c}}static parse(t,r){let[n,i]=Em(t,r),s=Je.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return ks(s).set(n,t),s}},Em=(e,t)=>{switch(e[0]){case"Q":{let r=t||hr;return[hr.prefix,r.decode(`${hr.prefix}${e}`)]}case hr.prefix:{let r=t||hr;return[hr.prefix,r.decode(e)]}case Zi.prefix:{let r=t||Zi;return[Zi.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)]}}},Sm=(e,t,r)=>{let{prefix:n}=r;if(n!==hr.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return i},xm=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(i==null){let s=r.encode(e);return t.set(n,s),s}else return i},Hn=112,Nm=18,jc=(e,t,r)=>{let n=io(e),i=n+io(t),s=new Uint8Array(i+r.byteLength);return no(e,s,0),no(t,s,n),s.set(r,i),s},$m=Symbol.for("@ipld/js-cid/CID"),sf=({name:e,code:t,encode:r})=>new Cm(e,t,r),Cm=class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?oo(this.code,t):t.then(r=>oo(this.code,r))}else throw Error("Unknown type, must be binary type")}},af=ft({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),zE=ft({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),qE=ft({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),GE=ft({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function Pm(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Yt.asCID(e);if(!t)return null;let r=t.toString();return[new Z(C.map,1/0,1),new Z(C.string,"/",1),new Z(C.string,r,r.length),new Z(C.break,void 0,1)]}function so(e){let t=af.encode(e).slice(1);return[new Z(C.map,1/0,1),new Z(C.string,"/",1),new Z(C.map,1/0,1),new Z(C.string,"bytes",5),new Z(C.string,t,t.length),new Z(C.break,void 0,1),new Z(C.break,void 0,1)]}function Ct(e){return so(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Rm(e){return so(new Uint8Array(e))}function Um(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function Bm(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 km={typeEncoders:{Object:Pm,Buffer:so,Uint8Array:so,Int8Array:Ct,Uint16Array:Ct,Int16Array:Ct,Uint32Array:Ct,Int32Array:Ct,Float32Array:Ct,Float64Array:Ct,Uint8ClampedArray:Ct,BigInt64Array:Ct,BigUint64Array:Ct,DataView:Ct,ArrayBuffer:Rm,undefined:Um,number:Bm}},Mm=class extends Qc{constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===C.map){let t=this._next();if(t.type===C.string&&t.value==="/"){let r=this._next();if(r.type===C.string){if(this._next().type!==C.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(r),new Z(C.tag,42,0)}if(r.type===C.map){let n=this._next();if(n.type===C.string&&n.value==="bytes"){let i=this._next();if(i.type===C.string){for(let o=0;o<2;o++)if(this._next().type!==C.break)throw new Error("Invalid encoded Bytes form");let s=af.decode(`m${i.value}`);return new Z(C.bytes,s,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(r)}this.tokenBuffer.push(t)}return e}},Ms={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Ms.tags[42]=Yt.parse;var Dm="dag-json",uf=297,Qs=e=>Jh(e,km),lo=e=>{let t=Object.assign(Ms,{tokenizer:new Mm(e,Ms)});return Xh(e,t)},Lc=e=>jm.decode(Qs(e)),jm=new TextDecoder,Lm=e=>lo(Fm.encode(e)),Fm=new TextEncoder;function Vm(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 Fc(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 Km(e,t){Vm(e);let r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var zm=e=>e instanceof Uint8Array,Ps=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),jt=(e,t)=>e<<32-t|e>>>t,qm=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!qm)throw new Error("Non little-endian hardware is not supported");function Gm(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function cf(e){if(typeof e=="string"&&(e=Gm(e)),!zm(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var Hm=class{clone(){return this._cloneInto()}},HE={}.toString;function Wm(e){let t=n=>e().update(cf(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Jm(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),f=n?4:0,c=n?0:4;e.setUint32(t+f,o,n),e.setUint32(t+c,a,n)}var Xm=class extends Hm{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ps(this.buffer)}update(e){Fc(this);let{view:t,buffer:r,blockLen:n}=this;e=cf(e);let i=e.length;for(let s=0;s<i;){let o=Math.min(n-this.pos,i-s);if(o===n){let a=Ps(e);for(;n<=i-s;s+=n)this.process(a,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Fc(this),Km(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>n-s&&(this.process(r,0),s=0);for(let y=s;y<n;y++)t[y]=0;Jm(r,n-8,BigInt(this.length*8),i),this.process(r,0);let o=Ps(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let f=a/4,c=this.get();if(f>c.length)throw new Error("_sha2: outputLen bigger than state");for(let y=0;y<f;y++)o.setUint32(4*y,c[y],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return e.length=n,e.pos=o,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}},Ym=(e,t,r)=>e&t^~e&r,Qm=(e,t,r)=>e&t^e&r^t&r,Zm=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]),pr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),yr=new Uint32Array(64),eg=class extends Xm{constructor(){super(64,32,8,!1),this.A=pr[0]|0,this.B=pr[1]|0,this.C=pr[2]|0,this.D=pr[3]|0,this.E=pr[4]|0,this.F=pr[5]|0,this.G=pr[6]|0,this.H=pr[7]|0}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:o,H:a}=this;return[e,t,r,n,i,s,o,a]}set(e,t,r,n,i,s,o,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=i|0,this.F=s|0,this.G=o|0,this.H=a|0}process(e,t){for(let y=0;y<16;y++,t+=4)yr[y]=e.getUint32(t,!1);for(let y=16;y<64;y++){let g=yr[y-15],M=yr[y-2],R=jt(g,7)^jt(g,18)^g>>>3,j=jt(M,17)^jt(M,19)^M>>>10;yr[y]=j+yr[y-7]+R+yr[y-16]|0}let{A:r,B:n,C:i,D:s,E:o,F:a,G:f,H:c}=this;for(let y=0;y<64;y++){let g=jt(o,6)^jt(o,11)^jt(o,25),M=c+g+Ym(o,a,f)+Zm[y]+yr[y]|0,j=(jt(r,2)^jt(r,13)^jt(r,22))+Qm(r,n,i)|0;c=f,f=a,a=o,o=s+M|0,s=i,i=n,n=r,r=M+j|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,f=f+this.G|0,c=c+this.H|0,this.set(r,n,i,s,o,a,f,c)}roundClean(){yr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},tg=Wm(()=>new eg),rg=Object.create,Zs=Object.defineProperty,ng=Object.getOwnPropertyDescriptor,ff=Object.getOwnPropertyNames,ig=Object.getPrototypeOf,og=Object.prototype.hasOwnProperty,sg=(e,t,r)=>t in e?Zs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lf=(e,t)=>function(){return t||(0,e[ff(e)[0]])((t={exports:{}}).exports,t),t.exports},ag=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ff(t))!og.call(e,i)&&i!==r&&Zs(e,i,{get:()=>t[i],enumerable:!(n=ng(t,i))||n.enumerable});return e},df=(e,t,r)=>(r=e!=null?rg(ig(e)):{},ag(t||!e||!e.__esModule?Zs(r,"default",{value:e,enumerable:!0}):r,e)),gr=(e,t,r)=>(sg(e,typeof t!="symbol"?t+"":t,r),r),ug=lf({"../../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(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},r=typeof window<"u"&&typeof window.document<"u",n=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,i=(typeof self>"u"?"undefined":t(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",s=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),o=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";e.isBrowser=r,e.isWebWorker=i,e.isNode=n,e.isJsDom=s,e.isDeno=o}}),cg=lf({"../../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 i=typeof n.cycles=="boolean"?n.cycles:!1,s=n.cmp&&function(a){return function(f){return function(c,y){var g={key:c,value:f[c]},M={key:y,value:f[y]};return a(g,M)}}}(n.cmp),o=[];return function a(f){if(f&&f.toJSON&&typeof f.toJSON=="function"&&(f=f.toJSON()),f!==void 0){if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!="object")return JSON.stringify(f);var c,y;if(Array.isArray(f)){for(y="[",c=0;c<f.length;c++)c&&(y+=","),y+=a(f[c])||"null";return y+"]"}if(f===null)return"null";if(o.indexOf(f)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=o.push(f)-1,M=Object.keys(f).sort(s&&s(f));for(y="",c=0;c<M.length;c++){var R=M[c],j=a(f[R]);j&&(y&&(y+=","),y+=JSON.stringify(R)+":"+j)}return o.splice(g,1),"{"+y+"}"}}(r)}}}),Yn=df(ug(),1),fg=df(cg(),1),pf=!1,yf=!1;Yn.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(pf=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(yf=process?.env?.LOGGER_PERF_PREFIX==="true"));var lg=Object.freeze({prefix:void 0,time:pf,delta:yf,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0}),Rs=[],hf=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(",")}]`}},mf=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},Wn=!1,et=class{static setup(e=et.INFO,t={}){t=Object.assign({},lg,t),e>10&&console.debug("setup logger",{config:t});let r=this.wrapLog(console.debug,{...t,dim:t.dimDebugOnServer}),n=(...f)=>{window?.FORCE_DISABLE_LOGLEVEL&&r(...f)};n.isDisabled=!0,n.isEnabled=!1;let i=this.wrapLog(console.groupCollapsed,t),s=(f,c)=>{function y(...M){let R=M[M.length-1];return R===n?R():(i(...M.slice(0,-1)),(async()=>{try{let te=R();return te instanceof Promise?await te:te}finally{console.groupEnd()}})())}let g=Object.assign(c.bind({}),{isEnabled:f,isDisabled:!f,group:y,force:c});return f?g:Object.assign(n.bind({}),{isEnabled:f,isDisabled:!f,group:y,force:g})},o=s(e>=et.ERROR,this.wrapLog(console.error,t));return{ERROR:(...f)=>(o(...f),new Error((0,fg.default)(f))),WARN:s(e>=et.WARN,this.wrapLog(console.warn,t)),LOG:s(e>=et.INFO,this.wrapLog(console.log,t)),DEBUG:s(e>=et.DEBUG,this.wrapLog(console.log,{...t,dim:t.dimDebugOnServer})),VERBOSE:s(e>=et.VERBOSE,this.wrapLog(console.debug,{...t,dim:t.dimDebugOnServer}))}}static wrapLog(e,t){if(Yn.isNode)return e.bind(console);{let r=[];if(t.time||t.delta){let i=Yn.isBrowser&&navigator.userAgent.includes("Chrome")?["",et.timeStr(!!t.time,!!t.delta)]:[];r.push(...i)}return t.prefix&&(Wn?r.push(new mf("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();et.firstLog||(et.firstLog=n,et.lastLog=n);let i=new hf(n-et.firstLog,n-et.lastLog,e,t);return et.lastLog=n,r?i.toString():i}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}}}},Se=et;gr(Se,"ERROR",2);gr(Se,"WARN",4);gr(Se,"INFO",6);gr(Se,"LOG",6);gr(Se,"DEBUG",8);gr(Se,"VERBOSE",10);gr(Se,"firstLog",0);gr(Se,"lastLog",0);Yn.isBrowser?(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Rs&&Rs.length){for(let t of Rs)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof hf))return null;Wn||(Wn=!0);let t=Se.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof mf?(Wn||(Wn=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1})):Yn.isNode;var gf=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),dg=sf({name:"sha2-256",code:18,encode:gf("SHA-256")}),WE=sf({name:"sha2-512",code:19,encode:gf("SHA-512")}),{WARN:pg,LOG:JE,DEBUG:yg,VERBOSE:bf,ERROR:XE}=Se.setup(Se.INFO);function vf(e,t=["cid"]){let r={};for(let[n,i]of Object.entries(e))i===void 0&&(pg(`log.${n} is undefined, which is not allowed - encoding as null`,e),i=null),t.includes(n)?bf("excluding app log",{key:n,val:i}):r[n]=i&&n==="pv"?Yt.parse(i):i;return r}function ea(e){return ta(_f(e).bytes)}function _f(e){return wf(vf(e))}function ta(e){let t=tg(e),r=rf.create(dg.code,t),n=Yt.create(1,uf,r);return bf("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function wf(e){yg("[encodeBlock]",e);let t=Qs(e);return{bytes:t,cid:ta(t)}}var Qt=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/typebox.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.JsonType=e.JavaScriptTypeBuilder=e.JsonTypeBuilder=e.TypeBuilder=e.TypeBuilderError=e.TransformEncodeBuilder=e.TransformDecodeBuilder=e.TemplateLiteralDslParser=e.TemplateLiteralGenerator=e.TemplateLiteralGeneratorError=e.TemplateLiteralFinite=e.TemplateLiteralFiniteError=e.TemplateLiteralParser=e.TemplateLiteralParserError=e.TemplateLiteralResolver=e.TemplateLiteralPattern=e.TemplateLiteralPatternError=e.UnionResolver=e.KeyArrayResolver=e.KeyArrayResolverError=e.KeyResolver=e.ObjectMap=e.Intrinsic=e.IndexedAccessor=e.TypeClone=e.TypeExtends=e.TypeExtendsResult=e.TypeExtendsError=e.ExtendsUndefined=e.TypeGuard=e.TypeGuardUnknownTypeError=e.ValueGuard=e.FormatRegistry=e.TypeBoxError=e.TypeRegistry=e.PatternStringExact=e.PatternNumberExact=e.PatternBooleanExact=e.PatternString=e.PatternNumber=e.PatternBoolean=e.Kind=e.Hint=e.Optional=e.Readonly=e.Transform=void 0,e.Transform=Symbol.for("TypeBox.Transform"),e.Readonly=Symbol.for("TypeBox.Readonly"),e.Optional=Symbol.for("TypeBox.Optional"),e.Hint=Symbol.for("TypeBox.Hint"),e.Kind=Symbol.for("TypeBox.Kind"),e.PatternBoolean="(true|false)",e.PatternNumber="(0|[1-9][0-9]*)",e.PatternString="(.*)",e.PatternBooleanExact=`^${e.PatternBoolean}$`,e.PatternNumberExact=`^${e.PatternNumber}$`,e.PatternStringExact=`^${e.PatternString}$`;var t;(function(l){let w=new Map;function I(){return new Map(w)}l.Entries=I;function P(){return w.clear()}l.Clear=P;function N(_){return w.delete(_)}l.Delete=N;function E(_){return w.has(_)}l.Has=E;function h(_,u){w.set(_,u)}l.Set=h;function S(_){return w.get(_)}l.Get=S})(t||(e.TypeRegistry=t={}));var r=class extends Error{constructor(l){super(l)}};e.TypeBoxError=r;var n;(function(l){let w=new Map;function I(){return new Map(w)}l.Entries=I;function P(){return w.clear()}l.Clear=P;function N(_){return w.delete(_)}l.Delete=N;function E(_){return w.has(_)}l.Has=E;function h(_,u){w.set(_,u)}l.Set=h;function S(_){return w.get(_)}l.Get=S})(n||(e.FormatRegistry=n={}));var i;(function(l){function w(v){return Array.isArray(v)}l.IsArray=w;function I(v){return typeof v=="bigint"}l.IsBigInt=I;function P(v){return typeof v=="boolean"}l.IsBoolean=P;function N(v){return v instanceof globalThis.Date}l.IsDate=N;function E(v){return v===null}l.IsNull=E;function h(v){return typeof v=="number"}l.IsNumber=h;function S(v){return typeof v=="object"&&v!==null}l.IsObject=S;function _(v){return typeof v=="string"}l.IsString=_;function u(v){return v instanceof globalThis.Uint8Array}l.IsUint8Array=u;function A(v){return v===void 0}l.IsUndefined=A})(i||(e.ValueGuard=i={}));var s=class extends r{};e.TypeGuardUnknownTypeError=s;var o;(function(l){function w(m){try{return new RegExp(m),!0}catch{return!1}}function I(m){if(!i.IsString(m))return!1;for(let $e=0;$e<m.length;$e++){let ht=m.charCodeAt($e);if(ht>=7&&ht<=13||ht===27||ht===127)return!1}return!0}function P(m){return h(m)||Ve(m)}function N(m){return i.IsUndefined(m)||i.IsBigInt(m)}function E(m){return i.IsUndefined(m)||i.IsNumber(m)}function h(m){return i.IsUndefined(m)||i.IsBoolean(m)}function S(m){return i.IsUndefined(m)||i.IsString(m)}function _(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)&&w(m)}function u(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)}function A(m){return i.IsUndefined(m)||Ve(m)}function v(m){return we(m,"Any")&&S(m.$id)}l.TAny=v;function b(m){return we(m,"Array")&&m.type==="array"&&S(m.$id)&&Ve(m.items)&&E(m.minItems)&&E(m.maxItems)&&h(m.uniqueItems)&&A(m.contains)&&E(m.minContains)&&E(m.maxContains)}l.TArray=b;function $(m){return we(m,"AsyncIterator")&&m.type==="AsyncIterator"&&S(m.$id)&&Ve(m.items)}l.TAsyncIterator=$;function V(m){return we(m,"BigInt")&&m.type==="bigint"&&S(m.$id)&&N(m.exclusiveMaximum)&&N(m.exclusiveMinimum)&&N(m.maximum)&&N(m.minimum)&&N(m.multipleOf)}l.TBigInt=V;function X(m){return we(m,"Boolean")&&m.type==="boolean"&&S(m.$id)}l.TBoolean=X;function re(m){return we(m,"Constructor")&&m.type==="Constructor"&&S(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every($e=>Ve($e))&&Ve(m.returns)}l.TConstructor=re;function me(m){return we(m,"Date")&&m.type==="Date"&&S(m.$id)&&E(m.exclusiveMaximumTimestamp)&&E(m.exclusiveMinimumTimestamp)&&E(m.maximumTimestamp)&&E(m.minimumTimestamp)&&E(m.multipleOfTimestamp)}l.TDate=me;function _e(m){return we(m,"Function")&&m.type==="Function"&&S(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every($e=>Ve($e))&&Ve(m.returns)}l.TFunction=_e;function Pe(m){return we(m,"Integer")&&m.type==="integer"&&S(m.$id)&&E(m.exclusiveMaximum)&&E(m.exclusiveMinimum)&&E(m.maximum)&&E(m.minimum)&&E(m.multipleOf)}l.TInteger=Pe;function je(m){return we(m,"Intersect")&&!(i.IsString(m.type)&&m.type!=="object")&&i.IsArray(m.allOf)&&m.allOf.every($e=>Ve($e)&&!kn($e))&&S(m.type)&&(h(m.unevaluatedProperties)||A(m.unevaluatedProperties))&&S(m.$id)}l.TIntersect=je;function Er(m){return we(m,"Iterator")&&m.type==="Iterator"&&S(m.$id)&&Ve(m.items)}l.TIterator=Er;function we(m,$e){return or(m)&&m[e.Kind]===$e}l.TKindOf=we;function or(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}l.TKind=or;function Sr(m){return x(m)&&i.IsString(m.const)}l.TLiteralString=Sr;function T(m){return x(m)&&i.IsNumber(m.const)}l.TLiteralNumber=T;function le(m){return x(m)&&i.IsBoolean(m.const)}l.TLiteralBoolean=le;function x(m){return we(m,"Literal")&&S(m.$id)&&(i.IsBoolean(m.const)||i.IsNumber(m.const)||i.IsString(m.const))}l.TLiteral=x;function ge(m){return we(m,"Never")&&i.IsObject(m.not)&&Object.getOwnPropertyNames(m.not).length===0}l.TNever=ge;function oe(m){return we(m,"Not")&&Ve(m.not)}l.TNot=oe;function pe(m){return we(m,"Null")&&m.type==="null"&&S(m.$id)}l.TNull=pe;function Ee(m){return we(m,"Number")&&m.type==="number"&&S(m.$id)&&E(m.exclusiveMaximum)&&E(m.exclusiveMinimum)&&E(m.maximum)&&E(m.minimum)&&E(m.multipleOf)}l.TNumber=Ee;function Me(m){return we(m,"Object")&&m.type==="object"&&S(m.$id)&&i.IsObject(m.properties)&&P(m.additionalProperties)&&E(m.minProperties)&&E(m.maxProperties)&&Object.entries(m.properties).every(([$e,ht])=>I($e)&&Ve(ht))}l.TObject=Me;function Xe(m){return we(m,"Promise")&&m.type==="Promise"&&S(m.$id)&&Ve(m.item)}l.TPromise=Xe;function We(m){return we(m,"Record")&&m.type==="object"&&S(m.$id)&&P(m.additionalProperties)&&i.IsObject(m.patternProperties)&&($e=>{let ht=Object.getOwnPropertyNames($e.patternProperties);return ht.length===1&&w(ht[0])&&i.IsObject($e.patternProperties)&&Ve($e.patternProperties[ht[0]])})(m)}l.TRecord=We;function Ze(m){return i.IsObject(m)&&e.Hint in m&&m[e.Hint]==="Recursive"}l.TRecursive=Ze;function Jt(m){return we(m,"Ref")&&S(m.$id)&&i.IsString(m.$ref)}l.TRef=Jt;function rn(m){return we(m,"String")&&m.type==="string"&&S(m.$id)&&E(m.minLength)&&E(m.maxLength)&&_(m.pattern)&&u(m.format)}l.TString=rn;function nn(m){return we(m,"Symbol")&&m.type==="symbol"&&S(m.$id)}l.TSymbol=nn;function xr(m){return we(m,"TemplateLiteral")&&m.type==="string"&&i.IsString(m.pattern)&&m.pattern[0]==="^"&&m.pattern[m.pattern.length-1]==="$"}l.TTemplateLiteral=xr;function Ri(m){return we(m,"This")&&S(m.$id)&&i.IsString(m.$ref)}l.TThis=Ri;function kn(m){return i.IsObject(m)&&e.Transform in m}l.TTransform=kn;function Fe(m){return we(m,"Tuple")&&m.type==="array"&&S(m.$id)&&i.IsNumber(m.minItems)&&i.IsNumber(m.maxItems)&&m.minItems===m.maxItems&&(i.IsUndefined(m.items)&&i.IsUndefined(m.additionalItems)&&m.minItems===0||i.IsArray(m.items)&&m.items.every($e=>Ve($e)))}l.TTuple=Fe;function Ui(m){return we(m,"Undefined")&&m.type==="undefined"&&S(m.$id)}l.TUndefined=Ui;function is(m){return Nr(m)&&m.anyOf.every($e=>Sr($e)||T($e))}l.TUnionLiteral=is;function Nr(m){return we(m,"Union")&&S(m.$id)&&i.IsObject(m)&&i.IsArray(m.anyOf)&&m.anyOf.every($e=>Ve($e))}l.TUnion=Nr;function on(m){return we(m,"Uint8Array")&&m.type==="Uint8Array"&&S(m.$id)&&E(m.minByteLength)&&E(m.maxByteLength)}l.TUint8Array=on;function Ye(m){return we(m,"Unknown")&&S(m.$id)}l.TUnknown=Ye;function Bi(m){return we(m,"Unsafe")}l.TUnsafe=Bi;function Mn(m){return we(m,"Void")&&m.type==="void"&&S(m.$id)}l.TVoid=Mn;function os(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}l.TReadonly=os;function ss(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}l.TOptional=ss;function Ve(m){return i.IsObject(m)&&(v(m)||b(m)||X(m)||V(m)||$(m)||re(m)||me(m)||_e(m)||Pe(m)||je(m)||Er(m)||x(m)||ge(m)||oe(m)||pe(m)||Ee(m)||Me(m)||Xe(m)||We(m)||Jt(m)||rn(m)||nn(m)||xr(m)||Ri(m)||Fe(m)||Ui(m)||Nr(m)||on(m)||Ye(m)||Bi(m)||Mn(m)||or(m)&&t.Has(m[e.Kind]))}l.TSchema=Ve})(o||(e.TypeGuard=o={}));var a;(function(l){function w(I){return I[e.Kind]==="Intersect"?I.allOf.every(P=>w(P)):I[e.Kind]==="Union"?I.anyOf.some(P=>w(P)):I[e.Kind]==="Undefined"?!0:I[e.Kind]==="Not"?!w(I.not):!1}l.Check=w})(a||(e.ExtendsUndefined=a={}));var f=class extends r{};e.TypeExtendsError=f;var c;(function(l){l[l.Union=0]="Union",l[l.True=1]="True",l[l.False=2]="False"})(c||(e.TypeExtendsResult=c={}));var y;(function(l){function w(d){return d===c.False?d:c.True}function I(d){throw new f(d)}function P(d){return o.TNever(d)||o.TIntersect(d)||o.TUnion(d)||o.TUnknown(d)||o.TAny(d)}function N(d,p){return o.TNever(p)?we(d,p):o.TIntersect(p)?_e(d,p):o.TUnion(p)?as(d,p):o.TUnknown(p)?cu(d,p):o.TAny(p)?E(d,p):I("StructuralRight")}function E(d,p){return c.True}function h(d,p){return o.TIntersect(p)?_e(d,p):o.TUnion(p)&&p.anyOf.some(Te=>o.TAny(Te)||o.TUnknown(Te))?c.True:o.TUnion(p)?c.Union:o.TUnknown(p)||o.TAny(p)?c.True:c.Union}function S(d,p){return o.TUnknown(d)?c.False:o.TAny(d)?c.Union:o.TNever(d)?c.True:c.False}function _(d,p){return o.TObject(p)&&xr(p)?c.True:P(p)?N(d,p):o.TArray(p)?w(Ne(d.items,p.items)):c.False}function u(d,p){return P(p)?N(d,p):o.TAsyncIterator(p)?w(Ne(d.items,p.items)):c.False}function A(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TBigInt(p)?c.True:c.False}function v(d,p){return o.TLiteral(d)&&i.IsBoolean(d.const)||o.TBoolean(d)?c.True:c.False}function b(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TBoolean(p)?c.True:c.False}function $(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TConstructor(p)?d.parameters.length>p.parameters.length?c.False:d.parameters.every((Te,xt)=>w(Ne(p.parameters[xt],Te))===c.True)?w(Ne(d.returns,p.returns)):c.False:c.False}function V(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TDate(p)?c.True:c.False}function X(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TFunction(p)?d.parameters.length>p.parameters.length?c.False:d.parameters.every((Te,xt)=>w(Ne(p.parameters[xt],Te))===c.True)?w(Ne(d.returns,p.returns)):c.False:c.False}function re(d,p){return o.TLiteral(d)&&i.IsNumber(d.const)||o.TNumber(d)||o.TInteger(d)?c.True:c.False}function me(d,p){return o.TInteger(p)||o.TNumber(p)?c.True:P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):c.False}function _e(d,p){return p.allOf.every(Te=>Ne(d,Te)===c.True)?c.True:c.False}function Pe(d,p){return d.allOf.some(Te=>Ne(Te,p)===c.True)?c.True:c.False}function je(d,p){return P(p)?N(d,p):o.TIterator(p)?w(Ne(d.items,p.items)):c.False}function Er(d,p){return o.TLiteral(p)&&p.const===d.const?c.True:P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TString(p)?Mn(d,p):o.TNumber(p)?x(d,p):o.TInteger(p)?re(d,p):o.TBoolean(p)?v(d,p):c.False}function we(d,p){return c.False}function or(d,p){return c.True}function Sr(d){let[p,Te]=[d,0];for(;o.TNot(p);)p=p.not,Te+=1;return Te%2===0?p:e.Type.Unknown()}function T(d,p){return o.TNot(d)?Ne(Sr(d),p):o.TNot(p)?Ne(d,Sr(p)):I("Invalid fallthrough for Not")}function le(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TNull(p)?c.True:c.False}function x(d,p){return o.TLiteralNumber(d)||o.TNumber(d)||o.TInteger(d)?c.True:c.False}function ge(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TInteger(p)||o.TNumber(p)?c.True:c.False}function oe(d,p){return Object.getOwnPropertyNames(d.properties).length===p}function pe(d){return xr(d)}function Ee(d){return oe(d,0)||oe(d,1)&&"description"in d.properties&&o.TUnion(d.properties.description)&&d.properties.description.anyOf.length===2&&(o.TString(d.properties.description.anyOf[0])&&o.TUndefined(d.properties.description.anyOf[1])||o.TString(d.properties.description.anyOf[1])&&o.TUndefined(d.properties.description.anyOf[0]))}function Me(d){return oe(d,0)}function Xe(d){return oe(d,0)}function We(d){return oe(d,0)}function Ze(d){return oe(d,0)}function Jt(d){return xr(d)}function rn(d){let p=e.Type.Number();return oe(d,0)||oe(d,1)&&"length"in d.properties&&w(Ne(d.properties.length,p))===c.True}function nn(d){return oe(d,0)}function xr(d){let p=e.Type.Number();return oe(d,0)||oe(d,1)&&"length"in d.properties&&w(Ne(d.properties.length,p))===c.True}function Ri(d){let p=e.Type.Function([e.Type.Any()],e.Type.Any());return oe(d,0)||oe(d,1)&&"then"in d.properties&&w(Ne(d.properties.then,p))===c.True}function kn(d,p){return Ne(d,p)===c.False||o.TOptional(d)&&!o.TOptional(p)?c.False:c.True}function Fe(d,p){return o.TUnknown(d)?c.False:o.TAny(d)?c.Union:o.TNever(d)||o.TLiteralString(d)&&pe(p)||o.TLiteralNumber(d)&&Me(p)||o.TLiteralBoolean(d)&&Xe(p)||o.TSymbol(d)&&Ee(p)||o.TBigInt(d)&&We(p)||o.TString(d)&&pe(p)||o.TSymbol(d)&&Ee(p)||o.TNumber(d)&&Me(p)||o.TInteger(d)&&Me(p)||o.TBoolean(d)&&Xe(p)||o.TUint8Array(d)&&Jt(p)||o.TDate(d)&&Ze(p)||o.TConstructor(d)&&nn(p)||o.TFunction(d)&&rn(p)?c.True:o.TRecord(d)&&o.TString(Nr(d))?p[e.Hint]==="Record"?c.True:c.False:o.TRecord(d)&&o.TNumber(Nr(d))?oe(p,0)?c.True:c.False:c.False}function Ui(d,p){return P(p)?N(d,p):o.TRecord(p)?Ye(d,p):o.TObject(p)?(()=>{for(let Te of Object.getOwnPropertyNames(p.properties)){if(!(Te in d.properties)&&!o.TOptional(p.properties[Te]))return c.False;if(o.TOptional(p.properties[Te]))return c.True;if(kn(d.properties[Te],p.properties[Te])===c.False)return c.False}return c.True})():c.False}function is(d,p){return P(p)?N(d,p):o.TObject(p)&&Ri(p)?c.True:o.TPromise(p)?w(Ne(d.item,p.item)):c.False}function Nr(d){return e.PatternNumberExact in d.patternProperties?e.Type.Number():e.PatternStringExact in d.patternProperties?e.Type.String():I("Unknown record key pattern")}function on(d){return e.PatternNumberExact in d.patternProperties?d.patternProperties[e.PatternNumberExact]:e.PatternStringExact in d.patternProperties?d.patternProperties[e.PatternStringExact]:I("Unable to get record value schema")}function Ye(d,p){let[Te,xt]=[Nr(p),on(p)];return o.TLiteralString(d)&&o.TNumber(Te)&&w(Ne(d,xt))===c.True?c.True:o.TUint8Array(d)&&o.TNumber(Te)||o.TString(d)&&o.TNumber(Te)||o.TArray(d)&&o.TNumber(Te)?Ne(d,xt):o.TObject(d)?(()=>{for(let Ep of Object.getOwnPropertyNames(d.properties))if(kn(xt,d.properties[Ep])===c.False)return c.False;return c.True})():c.False}function Bi(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ne(on(d),on(p)):c.False}function Mn(d,p){return o.TLiteral(d)&&i.IsString(d.const)||o.TString(d)?c.True:c.False}function os(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TString(p)?c.True:c.False}function ss(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TSymbol(p)?c.True:c.False}function Ve(d,p){return o.TTemplateLiteral(d)?Ne(F.Resolve(d),p):o.TTemplateLiteral(p)?Ne(d,F.Resolve(p)):I("Invalid fallthrough for TemplateLiteral")}function m(d,p){return o.TArray(p)&&d.items!==void 0&&d.items.every(Te=>Ne(Te,p.items)===c.True)}function $e(d,p){return o.TNever(d)?c.True:o.TUnknown(d)?c.False:o.TAny(d)?c.Union:c.False}function ht(d,p){return P(p)?N(d,p):o.TObject(p)&&xr(p)||o.TArray(p)&&m(d,p)?c.True:o.TTuple(p)?i.IsUndefined(d.items)&&!i.IsUndefined(p.items)||!i.IsUndefined(d.items)&&i.IsUndefined(p.items)?c.False:i.IsUndefined(d.items)&&!i.IsUndefined(p.items)||d.items.every((Te,xt)=>Ne(Te,p.items[xt])===c.True)?c.True:c.False:c.False}function vp(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TUint8Array(p)?c.True:c.False}function _p(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TVoid(p)?Op(d,p):o.TUndefined(p)?c.True:c.False}function as(d,p){return p.anyOf.some(Te=>Ne(d,Te)===c.True)?c.True:c.False}function wp(d,p){return d.anyOf.every(Te=>Ne(Te,p)===c.True)?c.True:c.False}function cu(d,p){return c.True}function Tp(d,p){return o.TNever(p)?we(d,p):o.TIntersect(p)?_e(d,p):o.TUnion(p)?as(d,p):o.TAny(p)?E(d,p):o.TString(p)?Mn(d,p):o.TNumber(p)?x(d,p):o.TInteger(p)?re(d,p):o.TBoolean(p)?v(d,p):o.TArray(p)?S(d,p):o.TTuple(p)?$e(d,p):o.TObject(p)?Fe(d,p):o.TUnknown(p)?c.True:c.False}function Op(d,p){return o.TUndefined(d)||o.TUndefined(d)?c.True:c.False}function Ap(d,p){return o.TIntersect(p)?_e(d,p):o.TUnion(p)?as(d,p):o.TUnknown(p)?cu(d,p):o.TAny(p)?E(d,p):o.TObject(p)?Fe(d,p):o.TVoid(p)?c.True:c.False}function Ne(d,p){return o.TTemplateLiteral(d)||o.TTemplateLiteral(p)?Ve(d,p):o.TNot(d)||o.TNot(p)?T(d,p):o.TAny(d)?h(d,p):o.TArray(d)?_(d,p):o.TBigInt(d)?A(d,p):o.TBoolean(d)?b(d,p):o.TAsyncIterator(d)?u(d,p):o.TConstructor(d)?$(d,p):o.TDate(d)?V(d,p):o.TFunction(d)?X(d,p):o.TInteger(d)?me(d,p):o.TIntersect(d)?Pe(d,p):o.TIterator(d)?je(d,p):o.TLiteral(d)?Er(d,p):o.TNever(d)?or(d,p):o.TNull(d)?le(d,p):o.TNumber(d)?ge(d,p):o.TObject(d)?Ui(d,p):o.TRecord(d)?Bi(d,p):o.TString(d)?os(d,p):o.TSymbol(d)?ss(d,p):o.TTuple(d)?ht(d,p):o.TPromise(d)?is(d,p):o.TUint8Array(d)?vp(d,p):o.TUndefined(d)?_p(d,p):o.TUnion(d)?wp(d,p):o.TUnknown(d)?Tp(d,p):o.TVoid(d)?Ap(d,p):I(`Unknown left type operand '${d[e.Kind]}'`)}function Ip(d,p){return Ne(d,p)}l.Extends=Ip})(y||(e.TypeExtends=y={}));var g;(function(l){function w(_){return _.map(u=>E(u))}function I(_){return new Date(_.getTime())}function P(_){return new Uint8Array(_)}function N(_){let u=Object.getOwnPropertyNames(_).reduce((v,b)=>({...v,[b]:E(_[b])}),{}),A=Object.getOwnPropertySymbols(_).reduce((v,b)=>({...v,[b]:E(_[b])}),{});return{...u,...A}}function E(_){return i.IsArray(_)?w(_):i.IsDate(_)?I(_):i.IsUint8Array(_)?P(_):i.IsObject(_)?N(_):_}function h(_){return _.map(u=>S(u))}l.Rest=h;function S(_,u={}){return{...E(_),...u}}l.Type=S})(g||(e.TypeClone=g={}));var M;(function(l){function w($){return $.map(V=>{let{[e.Optional]:X,...re}=g.Type(V);return re})}function I($){return $.every(V=>o.TOptional(V))}function P($){return $.some(V=>o.TOptional(V))}function N($){return I($.allOf)?e.Type.Optional(e.Type.Intersect(w($.allOf))):$}function E($){return P($.anyOf)?e.Type.Optional(e.Type.Union(w($.anyOf))):$}function h($){return $[e.Kind]==="Intersect"?N($):$[e.Kind]==="Union"?E($):$}function S($,V){let X=$.allOf.reduce((re,me)=>{let _e=v(me,V);return _e[e.Kind]==="Never"?re:[...re,_e]},[]);return h(e.Type.Intersect(X))}function _($,V){let X=$.anyOf.map(re=>v(re,V));return h(e.Type.Union(X))}function u($,V){let X=$.properties[V];return i.IsUndefined(X)?e.Type.Never():e.Type.Union([X])}function A($,V){let X=$.items;if(i.IsUndefined(X))return e.Type.Never();let re=X[V];return i.IsUndefined(re)?e.Type.Never():re}function v($,V){return $[e.Kind]==="Intersect"?S($,V):$[e.Kind]==="Union"?_($,V):$[e.Kind]==="Object"?u($,V):$[e.Kind]==="Tuple"?A($,V):e.Type.Never()}function b($,V,X={}){let re=V.map(me=>v($,me.toString()));return h(e.Type.Union(re,X))}l.Resolve=b})(M||(e.IndexedAccessor=M={}));var R;(function(l){function w(A){let[v,b]=[A.slice(0,1),A.slice(1)];return`${v.toLowerCase()}${b}`}function I(A){let[v,b]=[A.slice(0,1),A.slice(1)];return`${v.toUpperCase()}${b}`}function P(A){return A.toUpperCase()}function N(A){return A.toLowerCase()}function E(A,v){let b=K.ParseExact(A.pattern);if(!D.Check(b))return{...A,pattern:h(A.pattern,v)};let X=[...k.Generate(b)].map(_e=>e.Type.Literal(_e)),re=S(X,v),me=e.Type.Union(re);return e.Type.TemplateLiteral([me])}function h(A,v){return typeof A=="string"?v==="Uncapitalize"?w(A):v==="Capitalize"?I(A):v==="Uppercase"?P(A):v==="Lowercase"?N(A):A:A.toString()}function S(A,v){if(A.length===0)return[];let[b,...$]=A;return[u(b,v),...S($,v)]}function _(A,v){return o.TTemplateLiteral(A)?E(A,v):o.TUnion(A)?e.Type.Union(S(A.anyOf,v)):o.TLiteral(A)?e.Type.Literal(h(A.const,v)):A}function u(A,v){return _(A,v)}l.Map=u})(R||(e.Intrinsic=R={}));var j;(function(l){function w(h,S){return e.Type.Intersect(h.allOf.map(_=>N(_,S)),{...h})}function I(h,S){return e.Type.Union(h.anyOf.map(_=>N(_,S)),{...h})}function P(h,S){return S(h)}function N(h,S){return h[e.Kind]==="Intersect"?w(h,S):h[e.Kind]==="Union"?I(h,S):h[e.Kind]==="Object"?P(h,S):h}function E(h,S,_){return{...N(g.Type(h),S),..._}}l.Map=E})(j||(e.ObjectMap=j={}));var te;(function(l){function w(u){return u[0]==="^"&&u[u.length-1]==="$"?u.slice(1,u.length-1):u}function I(u,A){return u.allOf.reduce((v,b)=>[...v,...h(b,A)],[])}function P(u,A){let v=u.anyOf.map(b=>h(b,A));return[...v.reduce((b,$)=>$.map(V=>v.every(X=>X.includes(V))?b.add(V):b)[0],new Set)]}function N(u,A){return Object.getOwnPropertyNames(u.properties)}function E(u,A){return A.includePatterns?Object.getOwnPropertyNames(u.patternProperties):[]}function h(u,A){return o.TIntersect(u)?I(u,A):o.TUnion(u)?P(u,A):o.TObject(u)?N(u,A):o.TRecord(u)?E(u,A):[]}function S(u,A){return[...new Set(h(u,A))]}l.ResolveKeys=S;function _(u){return`^(${S(u,{includePatterns:!0}).map(b=>`(${w(b)})`).join("|")})$`}l.ResolvePattern=_})(te||(e.KeyResolver=te={}));var W=class extends r{};e.KeyArrayResolverError=W;var B;(function(l){function w(I){return Array.isArray(I)?I:o.TUnionLiteral(I)?I.anyOf.map(P=>P.const.toString()):o.TLiteral(I)?[I.const]:o.TTemplateLiteral(I)?(()=>{let P=K.ParseExact(I.pattern);if(!D.Check(P))throw new W("Cannot resolve keys from infinite template expression");return[...k.Generate(P)]})():[]}l.Resolve=w})(B||(e.KeyArrayResolver=B={}));var z;(function(l){function*w(P){for(let N of P.anyOf)N[e.Kind]==="Union"?yield*w(N):yield N}function I(P){return e.Type.Union([...w(P)],{...P})}l.Resolve=I})(z||(e.UnionResolver=z={}));var Y=class extends r{};e.TemplateLiteralPatternError=Y;var ie;(function(l){function w(E){throw new Y(E)}function I(E){return E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P(E,h){return o.TTemplateLiteral(E)?E.pattern.slice(1,E.pattern.length-1):o.TUnion(E)?`(${E.anyOf.map(S=>P(S,h)).join("|")})`:o.TNumber(E)?`${h}${e.PatternNumber}`:o.TInteger(E)?`${h}${e.PatternNumber}`:o.TBigInt(E)?`${h}${e.PatternNumber}`:o.TString(E)?`${h}${e.PatternString}`:o.TLiteral(E)?`${h}${I(E.const.toString())}`:o.TBoolean(E)?`${h}${e.PatternBoolean}`:w(`Unexpected Kind '${E[e.Kind]}'`)}function N(E){return`^${E.map(h=>P(h,"")).join("")}$`}l.Create=N})(ie||(e.TemplateLiteralPattern=ie={}));var F;(function(l){function w(I){let P=K.ParseExact(I.pattern);if(!D.Check(P))return e.Type.String();let N=[...k.Generate(P)].map(E=>e.Type.Literal(E));return e.Type.Union(N)}l.Resolve=w})(F||(e.TemplateLiteralResolver=F={}));var se=class extends r{};e.TemplateLiteralParserError=se;var K;(function(l){function w($,V,X){return $[V]===X&&$.charCodeAt(V-1)!==92}function I($,V){return w($,V,"(")}function P($,V){return w($,V,")")}function N($,V){return w($,V,"|")}function E($){if(!(I($,0)&&P($,$.length-1)))return!1;let V=0;for(let X=0;X<$.length;X++)if(I($,X)&&(V+=1),P($,X)&&(V-=1),V===0&&X!==$.length-1)return!1;return!0}function h($){return $.slice(1,$.length-1)}function S($){let V=0;for(let X=0;X<$.length;X++)if(I($,X)&&(V+=1),P($,X)&&(V-=1),N($,X)&&V===0)return!0;return!1}function _($){for(let V=0;V<$.length;V++)if(I($,V))return!0;return!1}function u($){let[V,X]=[0,0],re=[];for(let _e=0;_e<$.length;_e++)if(I($,_e)&&(V+=1),P($,_e)&&(V-=1),N($,_e)&&V===0){let Pe=$.slice(X,_e);Pe.length>0&&re.push(v(Pe)),X=_e+1}let me=$.slice(X);return me.length>0&&re.push(v(me)),re.length===0?{type:"const",const:""}:re.length===1?re[0]:{type:"or",expr:re}}function A($){function V(me,_e){if(!I(me,_e))throw new se("TemplateLiteralParser: Index must point to open parens");let Pe=0;for(let je=_e;je<me.length;je++)if(I(me,je)&&(Pe+=1),P(me,je)&&(Pe-=1),Pe===0)return[_e,je];throw new se("TemplateLiteralParser: Unclosed group parens in expression")}function X(me,_e){for(let Pe=_e;Pe<me.length;Pe++)if(I(me,Pe))return[_e,Pe];return[_e,me.length]}let re=[];for(let me=0;me<$.length;me++)if(I($,me)){let[_e,Pe]=V($,me),je=$.slice(_e,Pe+1);re.push(v(je)),me=Pe}else{let[_e,Pe]=X($,me),je=$.slice(_e,Pe);je.length>0&&re.push(v(je)),me=Pe-1}return re.length===0?{type:"const",const:""}:re.length===1?re[0]:{type:"and",expr:re}}function v($){return E($)?v(h($)):S($)?u($):_($)?A($):{type:"const",const:$}}l.Parse=v;function b($){return v($.slice(1,$.length-1))}l.ParseExact=b})(K||(e.TemplateLiteralParser=K={}));var ye=class extends r{};e.TemplateLiteralFiniteError=ye;var D;(function(l){function w(h){throw new ye(h)}function I(h){return h.type==="or"&&h.expr.length===2&&h.expr[0].type==="const"&&h.expr[0].const==="0"&&h.expr[1].type==="const"&&h.expr[1].const==="[1-9][0-9]*"}function P(h){return h.type==="or"&&h.expr.length===2&&h.expr[0].type==="const"&&h.expr[0].const==="true"&&h.expr[1].type==="const"&&h.expr[1].const==="false"}function N(h){return h.type==="const"&&h.const===".*"}function E(h){return P(h)?!0:I(h)||N(h)?!1:h.type==="and"?h.expr.every(S=>E(S)):h.type==="or"?h.expr.every(S=>E(S)):h.type==="const"?!0:w("Unknown expression type")}l.Check=E})(D||(e.TemplateLiteralFinite=D={}));var U=class extends r{};e.TemplateLiteralGeneratorError=U;var k;(function(l){function*w(h){if(h.length===1)return yield*h[0];for(let S of h[0])for(let _ of w(h.slice(1)))yield`${S}${_}`}function*I(h){return yield*w(h.expr.map(S=>[...E(S)]))}function*P(h){for(let S of h.expr)yield*E(S)}function*N(h){return yield h.const}function*E(h){return h.type==="and"?yield*I(h):h.type==="or"?yield*P(h):h.type==="const"?yield*N(h):(()=>{throw new U("Unknown expression")})()}l.Generate=E})(k||(e.TemplateLiteralGenerator=k={}));var ee;(function(l){function*w(E){let h=E.trim().replace(/"|'/g,"");return h==="boolean"?yield e.Type.Boolean():h==="number"?yield e.Type.Number():h==="bigint"?yield e.Type.BigInt():h==="string"?yield e.Type.String():yield(()=>{let S=h.split("|").map(_=>e.Type.Literal(_.trim()));return S.length===0?e.Type.Never():S.length===1?S[0]:e.Type.Union(S)})()}function*I(E){if(E[1]!=="{"){let h=e.Type.Literal("$"),S=P(E.slice(1));return yield*[h,...S]}for(let h=2;h<E.length;h++)if(E[h]==="}"){let S=w(E.slice(2,h)),_=P(E.slice(h+1));return yield*[...S,..._]}yield e.Type.Literal(E)}function*P(E){for(let h=0;h<E.length;h++)if(E[h]==="$"){let S=e.Type.Literal(E.slice(0,h)),_=I(E.slice(h));return yield*[S,..._]}yield e.Type.Literal(E)}function N(E){return[...P(E)]}l.Parse=N})(ee||(e.TemplateLiteralDslParser=ee={}));var Q=class{constructor(l){this.schema=l}Decode(l){return new O(this.schema,l)}};e.TransformDecodeBuilder=Q;var O=class{constructor(l,w){this.schema=l,this.decode=w}Encode(l){let w=g.Type(this.schema);return o.TTransform(w)?(()=>{let N={Encode:E=>w[e.Transform].Encode(l(E)),Decode:E=>this.decode(w[e.Transform].Decode(E))};return{...w,[e.Transform]:N}})():(()=>{let I={Decode:this.decode,Encode:l};return{...w,[e.Transform]:I}})()}};e.TransformEncodeBuilder=O;var q=0,ne=class extends r{};e.TypeBuilderError=ne;var G=class{Create(l){return l}Throw(l){throw new ne(l)}Discard(l,w){return w.reduce((I,P)=>{let{[P]:N,...E}=I;return E},l)}Strict(l){return JSON.parse(JSON.stringify(l))}};e.TypeBuilder=G;var J=class extends G{ReadonlyOptional(l){return this.Readonly(this.Optional(l))}Readonly(l){return{...g.Type(l),[e.Readonly]:"Readonly"}}Optional(l){return{...g.Type(l),[e.Optional]:"Optional"}}Any(l={}){return this.Create({...l,[e.Kind]:"Any"})}Array(l,w={}){return this.Create({...w,[e.Kind]:"Array",type:"array",items:g.Type(l)})}Boolean(l={}){return this.Create({...l,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(l,w={}){return{...R.Map(g.Type(l),"Capitalize"),...w}}Composite(l,w){let I=e.Type.Intersect(l,{}),N=te.ResolveKeys(I,{includePatterns:!1}).reduce((E,h)=>({...E,[h]:e.Type.Index(I,[h])}),{});return e.Type.Object(N,w)}Enum(l,w={}){if(i.IsUndefined(l))return this.Throw("Enum undefined or empty");let I=Object.getOwnPropertyNames(l).filter(E=>isNaN(E)).map(E=>l[E]),N=[...new Set(I)].map(E=>e.Type.Literal(E));return this.Union(N,{...w,[e.Hint]:"Enum"})}Extends(l,w,I,P,N={}){switch(y.Extends(l,w)){case c.Union:return this.Union([g.Type(I,N),g.Type(P,N)]);case c.True:return g.Type(I,N);case c.False:return g.Type(P,N)}}Exclude(l,w,I={}){return o.TTemplateLiteral(l)?this.Exclude(F.Resolve(l),w,I):o.TTemplateLiteral(w)?this.Exclude(l,F.Resolve(w),I):o.TUnion(l)?(()=>{let P=l.anyOf.filter(N=>y.Extends(N,w)===c.False);return P.length===1?g.Type(P[0],I):this.Union(P,I)})():y.Extends(l,w)!==c.False?this.Never(I):g.Type(l,I)}Extract(l,w,I={}){return o.TTemplateLiteral(l)?this.Extract(F.Resolve(l),w,I):o.TTemplateLiteral(w)?this.Extract(l,F.Resolve(w),I):o.TUnion(l)?(()=>{let P=l.anyOf.filter(N=>y.Extends(N,w)!==c.False);return P.length===1?g.Type(P[0],I):this.Union(P,I)})():y.Extends(l,w)!==c.False?g.Type(l,I):this.Never(I)}Index(l,w,I={}){return o.TArray(l)&&o.TNumber(w)?g.Type(l.items,I):o.TTuple(l)&&o.TNumber(w)?(()=>{let N=(i.IsUndefined(l.items)?[]:l.items).map(E=>g.Type(E));return this.Union(N,I)})():(()=>{let P=B.Resolve(w),N=g.Type(l);return M.Resolve(N,P,I)})()}Integer(l={}){return this.Create({...l,[e.Kind]:"Integer",type:"integer"})}Intersect(l,w={}){if(l.length===0)return e.Type.Never();if(l.length===1)return g.Type(l[0],w);l.some(E=>o.TTransform(E))&&this.Throw("Cannot intersect transform types");let I=l.every(E=>o.TObject(E)),P=g.Rest(l),N=o.TSchema(w.unevaluatedProperties)?{unevaluatedProperties:g.Type(w.unevaluatedProperties)}:{};return w.unevaluatedProperties===!1||o.TSchema(w.unevaluatedProperties)||I?this.Create({...w,...N,[e.Kind]:"Intersect",type:"object",allOf:P}):this.Create({...w,...N,[e.Kind]:"Intersect",allOf:P})}KeyOf(l,w={}){return o.TRecord(l)?(()=>{let I=Object.getOwnPropertyNames(l.patternProperties)[0];return I===e.PatternNumberExact?this.Number(w):I===e.PatternStringExact?this.String(w):this.Throw("Unable to resolve key type from Record key pattern")})():o.TTuple(l)?(()=>{let P=(i.IsUndefined(l.items)?[]:l.items).map((N,E)=>e.Type.Literal(E.toString()));return this.Union(P,w)})():o.TArray(l)?this.Number(w):(()=>{let I=te.ResolveKeys(l,{includePatterns:!1});if(I.length===0)return this.Never(w);let P=I.map(N=>this.Literal(N));return this.Union(P,w)})()}Literal(l,w={}){return this.Create({...w,[e.Kind]:"Literal",const:l,type:typeof l})}Lowercase(l,w={}){return{...R.Map(g.Type(l),"Lowercase"),...w}}Never(l={}){return this.Create({...l,[e.Kind]:"Never",not:{}})}Not(l,w){return this.Create({...w,[e.Kind]:"Not",not:g.Type(l)})}Null(l={}){return this.Create({...l,[e.Kind]:"Null",type:"null"})}Number(l={}){return this.Create({...l,[e.Kind]:"Number",type:"number"})}Object(l,w={}){let I=Object.getOwnPropertyNames(l),P=I.filter(S=>o.TOptional(l[S])),N=I.filter(S=>!P.includes(S)),E=o.TSchema(w.additionalProperties)?{additionalProperties:g.Type(w.additionalProperties)}:{},h=I.reduce((S,_)=>({...S,[_]:g.Type(l[_])}),{});return N.length>0?this.Create({...w,...E,[e.Kind]:"Object",type:"object",properties:h,required:N}):this.Create({...w,...E,[e.Kind]:"Object",type:"object",properties:h})}Omit(l,w,I={}){let P=B.Resolve(w);return j.Map(this.Discard(g.Type(l),["$id",e.Transform]),N=>{i.IsArray(N.required)&&(N.required=N.required.filter(E=>!P.includes(E)),N.required.length===0&&delete N.required);for(let E of Object.getOwnPropertyNames(N.properties))P.includes(E)&&delete N.properties[E];return this.Create(N)},I)}Partial(l,w={}){return j.Map(this.Discard(g.Type(l),["$id",e.Transform]),I=>{let P=Object.getOwnPropertyNames(I.properties).reduce((N,E)=>({...N,[E]:this.Optional(I.properties[E])}),{});return this.Object(P,this.Discard(I,["required"]))},w)}Pick(l,w,I={}){let P=B.Resolve(w);return j.Map(this.Discard(g.Type(l),["$id",e.Transform]),N=>{i.IsArray(N.required)&&(N.required=N.required.filter(E=>P.includes(E)),N.required.length===0&&delete N.required);for(let E of Object.getOwnPropertyNames(N.properties))P.includes(E)||delete N.properties[E];return this.Create(N)},I)}Record(l,w,I={}){return o.TTemplateLiteral(l)?(()=>{let P=K.ParseExact(l.pattern);return D.Check(P)?this.Object([...k.Generate(P)].reduce((N,E)=>({...N,[E]:g.Type(w)}),{}),I):this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[l.pattern]:g.Type(w)}})})():o.TUnion(l)?(()=>{let P=z.Resolve(l);if(o.TUnionLiteral(P)){let N=P.anyOf.reduce((E,h)=>({...E,[h.const]:g.Type(w)}),{});return this.Object(N,{...I,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():o.TLiteral(l)?i.IsString(l.const)||i.IsNumber(l.const)?this.Object({[l.const]:g.Type(w)},I):this.Throw("Record key of type literal is not of type string or number"):o.TInteger(l)||o.TNumber(l)?this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:g.Type(w)}}):o.TString(l)?(()=>{let P=i.IsUndefined(l.pattern)?e.PatternStringExact:l.pattern;return this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[P]:g.Type(w)}})})():this.Never()}Recursive(l,w={}){i.IsUndefined(w.$id)&&(w.$id=`T${q++}`);let I=l({[e.Kind]:"This",$ref:`${w.$id}`});return I.$id=w.$id,this.Create({...w,[e.Hint]:"Recursive",...I})}Ref(l,w={}){return i.IsString(l)?this.Create({...w,[e.Kind]:"Ref",$ref:l}):(i.IsUndefined(l.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({...w,[e.Kind]:"Ref",$ref:l.$id}))}Required(l,w={}){return j.Map(this.Discard(g.Type(l),["$id",e.Transform]),I=>{let P=Object.getOwnPropertyNames(I.properties).reduce((N,E)=>({...N,[E]:this.Discard(I.properties[E],[e.Optional])}),{});return this.Object(P,I)},w)}Rest(l){return o.TTuple(l)&&!i.IsUndefined(l.items)?g.Rest(l.items):o.TIntersect(l)?g.Rest(l.allOf):o.TUnion(l)?g.Rest(l.anyOf):[]}String(l={}){return this.Create({...l,[e.Kind]:"String",type:"string"})}TemplateLiteral(l,w={}){let I=i.IsString(l)?ie.Create(ee.Parse(l)):ie.Create(l);return this.Create({...w,[e.Kind]:"TemplateLiteral",type:"string",pattern:I})}Transform(l){return new Q(l)}Tuple(l,w={}){let[I,P,N]=[!1,l.length,l.length],E=g.Rest(l),h=l.length>0?{...w,[e.Kind]:"Tuple",type:"array",items:E,additionalItems:I,minItems:P,maxItems:N}:{...w,[e.Kind]:"Tuple",type:"array",minItems:P,maxItems:N};return this.Create(h)}Uncapitalize(l,w={}){return{...R.Map(g.Type(l),"Uncapitalize"),...w}}Union(l,w={}){return o.TTemplateLiteral(l)?F.Resolve(l):(()=>{let I=l;if(I.length===0)return this.Never(w);if(I.length===1)return this.Create(g.Type(I[0],w));let P=g.Rest(I);return this.Create({...w,[e.Kind]:"Union",anyOf:P})})()}Unknown(l={}){return this.Create({...l,[e.Kind]:"Unknown"})}Unsafe(l={}){return this.Create({...l,[e.Kind]:l[e.Kind]||"Unsafe"})}Uppercase(l,w={}){return{...R.Map(g.Type(l),"Uppercase"),...w}}};e.JsonTypeBuilder=J;var de=class extends J{AsyncIterator(l,w={}){return this.Create({...w,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:g.Type(l)})}Awaited(l,w={}){let I=P=>P.length>0?(()=>{let[N,...E]=P;return[this.Awaited(N),...I(E)]})():P;return o.TIntersect(l)?e.Type.Intersect(I(l.allOf)):o.TUnion(l)?e.Type.Union(I(l.anyOf)):o.TPromise(l)?this.Awaited(l.item):g.Type(l,w)}BigInt(l={}){return this.Create({...l,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(l,w={}){return this.Tuple([...l.parameters],{...w})}Constructor(l,w,I){let[P,N]=[g.Rest(l),g.Type(w)];return this.Create({...I,[e.Kind]:"Constructor",type:"Constructor",parameters:P,returns:N})}Date(l={}){return this.Create({...l,[e.Kind]:"Date",type:"Date"})}Function(l,w,I){let[P,N]=[g.Rest(l),g.Type(w)];return this.Create({...I,[e.Kind]:"Function",type:"Function",parameters:P,returns:N})}InstanceType(l,w={}){return g.Type(l.returns,w)}Iterator(l,w={}){return this.Create({...w,[e.Kind]:"Iterator",type:"Iterator",items:g.Type(l)})}Parameters(l,w={}){return this.Tuple(l.parameters,{...w})}Promise(l,w={}){return this.Create({...w,[e.Kind]:"Promise",type:"Promise",item:g.Type(l)})}RegExp(l,w={}){let I=i.IsString(l)?l:l.source;return this.Create({...w,[e.Kind]:"String",type:"string",pattern:I})}RegEx(l,w={}){return this.RegExp(l,w)}ReturnType(l,w={}){return g.Type(l.returns,w)}Symbol(l){return this.Create({...l,[e.Kind]:"Symbol",type:"symbol"})}Undefined(l={}){return this.Create({...l,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(l={}){return this.Create({...l,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(l={}){return this.Create({...l,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=de,e.JsonType=new J,e.Type=new de}}),mn=Dt(Qt(),1),{String:hg,Optional:mg,Boolean:gg,Object:bg,Number:vg}=mn.Type,_g=hg.bind(mn.Type),wg=vg.bind(mn.Type),bS=bg.bind(mn.Type),vS=mg.bind(mn.Type),Tg=gg.bind(mn.Type),_S=_g(),wS=wg(),TS=Tg();function Tf(e){return Array.isArray(e)?e:[e]}var Og=Le({"../../../node_modules/.pnpm/safe-stable-stringify@2.4.3/node_modules/safe-stable-stringify/index.js"(e,t){"use strict";var{hasOwnProperty:r}=Object.prototype,n=W();n.configure=W,n.stringify=n,n.default=n,e.stringify=n,e.configure=W,t.exports=n;var i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function s(B){return B.length<5e3&&!i.test(B)?`"${B}"`:JSON.stringify(B)}function o(B){if(B.length>200)return B.sort();for(let z=1;z<B.length;z++){let Y=B[z],ie=z;for(;ie!==0&&B[ie-1]>Y;)B[ie]=B[ie-1],ie--;B[ie]=Y}return B}var a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function f(B){return a.call(B)!==void 0&&B.length!==0}function c(B,z,Y){B.length<Y&&(Y=B.length);let ie=z===","?"":" ",F=`"0":${ie}${B[0]}`;for(let se=1;se<Y;se++)F+=`${z}"${se}":${ie}${B[se]}`;return F}function y(B){if(r.call(B,"circularValue")){let z=B.circularValue;if(typeof z=="string")return`"${z}"`;if(z==null)return z;if(z===Error||z===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function g(B,z){let Y;if(r.call(B,z)&&(Y=B[z],typeof Y!="boolean"))throw new TypeError(`The "${z}" argument must be of type boolean`);return Y===void 0?!0:Y}function M(B,z){let Y;if(r.call(B,z)){if(Y=B[z],typeof Y!="number")throw new TypeError(`The "${z}" argument must be of type number`);if(!Number.isInteger(Y))throw new TypeError(`The "${z}" argument must be an integer`);if(Y<1)throw new RangeError(`The "${z}" argument must be >= 1`)}return Y===void 0?1/0:Y}function R(B){return B===1?"1 item":`${B} items`}function j(B){let z=new Set;for(let Y of B)(typeof Y=="string"||typeof Y=="number")&&z.add(String(Y));return z}function te(B){if(r.call(B,"strict")){let z=B.strict;if(typeof z!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(z)return Y=>{let ie=`Object can not safely be stringified. Received type ${typeof Y}`;throw typeof Y!="function"&&(ie+=` (${Y.toString()})`),new Error(ie)}}}function W(B){B={...B};let z=te(B);z&&(B.bigint===void 0&&(B.bigint=!1),"circularValue"in B||(B.circularValue=Error));let Y=y(B),ie=g(B,"bigint"),F=g(B,"deterministic"),se=M(B,"maximumDepth"),K=M(B,"maximumBreadth");function ye(Q,O,q,ne,G,J){let de=O[Q];switch(typeof de=="object"&&de!==null&&typeof de.toJSON=="function"&&(de=de.toJSON(Q)),de=ne.call(O,Q,de),typeof de){case"string":return s(de);case"object":{if(de===null)return"null";if(q.indexOf(de)!==-1)return Y;let l="",w=",",I=J;if(Array.isArray(de)){if(de.length===0)return"[]";if(se<q.length+1)return'"[Array]"';q.push(de),G!==""&&(J+=G,l+=`
3
+ ${J}`,w=`,
4
+ ${J}`);let _=Math.min(de.length,K),u=0;for(;u<_-1;u++){let v=ye(String(u),de,q,ne,G,J);l+=v!==void 0?v:"null",l+=w}let A=ye(String(u),de,q,ne,G,J);if(l+=A!==void 0?A:"null",de.length-1>K){let v=de.length-K-1;l+=`${w}"... ${R(v)} not stringified"`}return G!==""&&(l+=`
5
+ ${I}`),q.pop(),`[${l}]`}let P=Object.keys(de),N=P.length;if(N===0)return"{}";if(se<q.length+1)return'"[Object]"';let E="",h="";G!==""&&(J+=G,w=`,
6
+ ${J}`,E=" ");let S=Math.min(N,K);F&&!f(de)&&(P=o(P)),q.push(de);for(let _=0;_<S;_++){let u=P[_],A=ye(u,de,q,ne,G,J);A!==void 0&&(l+=`${h}${s(u)}:${E}${A}`,h=w)}if(N>K){let _=N-K;l+=`${h}"...":${E}"${R(_)} not stringified"`,h=w}return G!==""&&h.length>1&&(l=`
7
+ ${J}${l}
8
+ ${I}`),q.pop(),`{${l}}`}case"number":return isFinite(de)?String(de):z?z(de):"null";case"boolean":return de===!0?"true":"false";case"undefined":return;case"bigint":if(ie)return String(de);default:return z?z(de):void 0}}function D(Q,O,q,ne,G,J){switch(typeof O=="object"&&O!==null&&typeof O.toJSON=="function"&&(O=O.toJSON(Q)),typeof O){case"string":return s(O);case"object":{if(O===null)return"null";if(q.indexOf(O)!==-1)return Y;let de=J,l="",w=",";if(Array.isArray(O)){if(O.length===0)return"[]";if(se<q.length+1)return'"[Array]"';q.push(O),G!==""&&(J+=G,l+=`
9
+ ${J}`,w=`,
10
+ ${J}`);let N=Math.min(O.length,K),E=0;for(;E<N-1;E++){let S=D(String(E),O[E],q,ne,G,J);l+=S!==void 0?S:"null",l+=w}let h=D(String(E),O[E],q,ne,G,J);if(l+=h!==void 0?h:"null",O.length-1>K){let S=O.length-K-1;l+=`${w}"... ${R(S)} not stringified"`}return G!==""&&(l+=`
11
+ ${de}`),q.pop(),`[${l}]`}q.push(O);let I="";G!==""&&(J+=G,w=`,
12
+ ${J}`,I=" ");let P="";for(let N of ne){let E=D(N,O[N],q,ne,G,J);E!==void 0&&(l+=`${P}${s(N)}:${I}${E}`,P=w)}return G!==""&&P.length>1&&(l=`
13
+ ${J}${l}
14
+ ${de}`),q.pop(),`{${l}}`}case"number":return isFinite(O)?String(O):z?z(O):"null";case"boolean":return O===!0?"true":"false";case"undefined":return;case"bigint":if(ie)return String(O);default:return z?z(O):void 0}}function U(Q,O,q,ne,G){switch(typeof O){case"string":return s(O);case"object":{if(O===null)return"null";if(typeof O.toJSON=="function"){if(O=O.toJSON(Q),typeof O!="object")return U(Q,O,q,ne,G);if(O===null)return"null"}if(q.indexOf(O)!==-1)return Y;let J=G;if(Array.isArray(O)){if(O.length===0)return"[]";if(se<q.length+1)return'"[Array]"';q.push(O),G+=ne;let E=`
15
+ ${G}`,h=`,
16
+ ${G}`,S=Math.min(O.length,K),_=0;for(;_<S-1;_++){let A=U(String(_),O[_],q,ne,G);E+=A!==void 0?A:"null",E+=h}let u=U(String(_),O[_],q,ne,G);if(E+=u!==void 0?u:"null",O.length-1>K){let A=O.length-K-1;E+=`${h}"... ${R(A)} not stringified"`}return E+=`
17
+ ${J}`,q.pop(),`[${E}]`}let de=Object.keys(O),l=de.length;if(l===0)return"{}";if(se<q.length+1)return'"[Object]"';G+=ne;let w=`,
18
+ ${G}`,I="",P="",N=Math.min(l,K);f(O)&&(I+=c(O,w,K),de=de.slice(O.length),N-=O.length,P=w),F&&(de=o(de)),q.push(O);for(let E=0;E<N;E++){let h=de[E],S=U(h,O[h],q,ne,G);S!==void 0&&(I+=`${P}${s(h)}: ${S}`,P=w)}if(l>K){let E=l-K;I+=`${P}"...": "${R(E)} not stringified"`,P=w}return P!==""&&(I=`
19
+ ${G}${I}
20
+ ${J}`),q.pop(),`{${I}}`}case"number":return isFinite(O)?String(O):z?z(O):"null";case"boolean":return O===!0?"true":"false";case"undefined":return;case"bigint":if(ie)return String(O);default:return z?z(O):void 0}}function k(Q,O,q){switch(typeof O){case"string":return s(O);case"object":{if(O===null)return"null";if(typeof O.toJSON=="function"){if(O=O.toJSON(Q),typeof O!="object")return k(Q,O,q);if(O===null)return"null"}if(q.indexOf(O)!==-1)return Y;let ne="";if(Array.isArray(O)){if(O.length===0)return"[]";if(se<q.length+1)return'"[Array]"';q.push(O);let w=Math.min(O.length,K),I=0;for(;I<w-1;I++){let N=k(String(I),O[I],q);ne+=N!==void 0?N:"null",ne+=","}let P=k(String(I),O[I],q);if(ne+=P!==void 0?P:"null",O.length-1>K){let N=O.length-K-1;ne+=`,"... ${R(N)} not stringified"`}return q.pop(),`[${ne}]`}let G=Object.keys(O),J=G.length;if(J===0)return"{}";if(se<q.length+1)return'"[Object]"';let de="",l=Math.min(J,K);f(O)&&(ne+=c(O,",",K),G=G.slice(O.length),l-=O.length,de=","),F&&(G=o(G)),q.push(O);for(let w=0;w<l;w++){let I=G[w],P=k(I,O[I],q);P!==void 0&&(ne+=`${de}${s(I)}:${P}`,de=",")}if(J>K){let w=J-K;ne+=`${de}"...":"${R(w)} not stringified"`}return q.pop(),`{${ne}}`}case"number":return isFinite(O)?String(O):z?z(O):"null";case"boolean":return O===!0?"true":"false";case"undefined":return;case"bigint":if(ie)return String(O);default:return z?z(O):void 0}}function ee(Q,O,q){if(arguments.length>1){let ne="";if(typeof q=="number"?ne=" ".repeat(Math.min(q,10)):typeof q=="string"&&(ne=q.slice(0,10)),O!=null){if(typeof O=="function")return ye("",{"":Q},[],O,ne,"");if(Array.isArray(O))return D("",Q,[],j(O),ne,"")}if(ne.length!==0)return U("",Q,[],ne,"")}return k("",Q,[])}return ee}}}),An=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/guard.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IsValueType=e.IsSymbol=e.IsFunction=e.IsString=e.IsBigInt=e.IsInteger=e.IsNumber=e.IsBoolean=e.IsNull=e.IsUndefined=e.IsArray=e.IsObject=e.IsPlainObject=e.HasPropertyKey=e.IsDate=e.IsUint8Array=e.IsPromise=e.IsTypedArray=e.IsIterator=e.IsAsyncIterator=void 0;function t(F){return c(F)&&Symbol.asyncIterator in F}e.IsAsyncIterator=t;function r(F){return c(F)&&Symbol.iterator in F}e.IsIterator=r;function n(F){return ArrayBuffer.isView(F)}e.IsTypedArray=n;function i(F){return F instanceof Promise}e.IsPromise=i;function s(F){return F instanceof Uint8Array}e.IsUint8Array=s;function o(F){return F instanceof Date&&Number.isFinite(F.getTime())}e.IsDate=o;function a(F,se){return se in F}e.HasPropertyKey=a;function f(F){return c(F)&&z(F.constructor)&&F.constructor.name==="Object"}e.IsPlainObject=f;function c(F){return F!==null&&typeof F=="object"}e.IsObject=c;function y(F){return Array.isArray(F)&&!ArrayBuffer.isView(F)}e.IsArray=y;function g(F){return F===void 0}e.IsUndefined=g;function M(F){return F===null}e.IsNull=M;function R(F){return typeof F=="boolean"}e.IsBoolean=R;function j(F){return typeof F=="number"}e.IsNumber=j;function te(F){return j(F)&&Number.isInteger(F)}e.IsInteger=te;function W(F){return typeof F=="bigint"}e.IsBigInt=W;function B(F){return typeof F=="string"}e.IsString=B;function z(F){return typeof F=="function"}e.IsFunction=z;function Y(F){return typeof F=="symbol"}e.IsSymbol=Y;function ie(F){return W(F)||R(F)||M(F)||j(F)||B(F)||Y(F)||g(F)}e.IsValueType=ie}}),ml=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/system.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultErrorFunction=e.TypeSystemPolicy=e.TypeSystemErrorFunction=e.TypeSystem=e.TypeSystemDuplicateFormat=e.TypeSystemDuplicateTypeKind=void 0;var t=An(),r=Lo(),n=Qt(),i=class extends n.TypeBoxError{constructor(y){super(`Duplicate type kind '${y}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var s=class extends n.TypeBoxError{constructor(y){super(`Duplicate string format '${y}' detected`)}};e.TypeSystemDuplicateFormat=s;var o;(function(y){function g(R,j){if(n.TypeRegistry.Has(R))throw new i(R);return n.TypeRegistry.Set(R,j),(te={})=>n.Type.Unsafe({...te,[n.Kind]:R})}y.Type=g;function M(R,j){if(n.FormatRegistry.Has(R))throw new s(R);return n.FormatRegistry.Set(R,j),R}y.Format=M})(o||(e.TypeSystem=o={}));var a;(function(y){let g=c;function M(){g=c}y.Reset=M;function R(te){g=te}y.Set=R;function j(){return g}y.Get=j})(a||(e.TypeSystemErrorFunction=a={}));var f;(function(y){y.ExactOptionalPropertyTypes=!1,y.AllowArrayObject=!1,y.AllowNaN=!1,y.AllowNullVoid=!1;function g(W,B){return y.ExactOptionalPropertyTypes?B in W:W[B]!==void 0}y.IsExactOptionalProperty=g;function M(W){let B=(0,t.IsObject)(W);return y.AllowArrayObject?B:B&&!(0,t.IsArray)(W)}y.IsObjectLike=M;function R(W){return M(W)&&!(W instanceof Date)&&!(W instanceof Uint8Array)}y.IsRecordLike=R;function j(W){let B=(0,t.IsNumber)(W);return y.AllowNaN?B:B&&Number.isFinite(W)}y.IsNumberLike=j;function te(W){let B=(0,t.IsUndefined)(W);return y.AllowNullVoid?B||W===null:B}y.IsVoidLike=te})(f||(e.TypeSystemPolicy=f={}));function c(y,g){switch(g){case r.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case r.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${y.maxContains} matching values`;case r.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${y.minContains} matching values`;case r.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${y.maxItems}`;case r.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${y.minItems}`;case r.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case r.ValueErrorType.Array:return"Expected array";case r.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case r.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${y.exclusiveMaximum}`;case r.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${y.exclusiveMinimum}`;case r.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${y.maximum}`;case r.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${y.minimum}`;case r.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${y.multipleOf}`;case r.ValueErrorType.BigInt:return"Expected bigint";case r.ValueErrorType.Boolean:return"Expected boolean";case r.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${y.exclusiveMinimumTimestamp}`;case r.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${y.exclusiveMaximumTimestamp}`;case r.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${y.minimumTimestamp}`;case r.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${y.maximumTimestamp}`;case r.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${y.multipleOfTimestamp}`;case r.ValueErrorType.Date:return"Expected Date";case r.ValueErrorType.Function:return"Expected function";case r.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${y.exclusiveMaximum}`;case r.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${y.exclusiveMinimum}`;case r.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${y.maximum}`;case r.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${y.minimum}`;case r.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${y.multipleOf}`;case r.ValueErrorType.Integer:return"Expected integer";case r.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case r.ValueErrorType.Intersect:return"Expected all values to match";case r.ValueErrorType.Iterator:return"Expected Iterator";case r.ValueErrorType.Literal:return`Expected ${typeof y.const=="string"?`'${y.const}'`:y.const}`;case r.ValueErrorType.Never:return"Never";case r.ValueErrorType.Not:return"Value should not match";case r.ValueErrorType.Null:return"Expected null";case r.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${y.exclusiveMaximum}`;case r.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${y.exclusiveMinimum}`;case r.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${y.maximum}`;case r.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${y.minimum}`;case r.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${y.multipleOf}`;case r.ValueErrorType.Number:return"Expected number";case r.ValueErrorType.Object:return"Expected object";case r.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case r.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${y.maxProperties} properties`;case r.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${y.minProperties} properties`;case r.ValueErrorType.ObjectRequiredProperty:return"Required property";case r.ValueErrorType.Promise:return"Expected Promise";case r.ValueErrorType.StringFormatUnknown:return`Unknown format '${y.format}'`;case r.ValueErrorType.StringFormat:return`Expected string to match '${y.format}' format`;case r.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${y.maxLength}`;case r.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${y.minLength}`;case r.ValueErrorType.StringPattern:return`Expected string to match '${y.pattern}'`;case r.ValueErrorType.String:return"Expected string";case r.ValueErrorType.Symbol:return"Expected symbol";case r.ValueErrorType.TupleLength:return`Expected tuple to have ${y.maxItems||0} elements`;case r.ValueErrorType.Tuple:return"Expected tuple";case r.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${y.maxByteLength}`;case r.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${y.minByteLength}`;case r.ValueErrorType.Uint8Array:return"Expected Uint8Array";case r.ValueErrorType.Undefined:return"Expected undefined";case r.ValueErrorType.Union:return"Expected union value";case r.ValueErrorType.Void:return"Expected void";case r.ValueErrorType.Kind:return`Expected kind '${y[n.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=c}}),jo=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/deref.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Deref=e.TypeDereferenceError=void 0;var t=Qt(),r=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=r;function n(i,s){let o=s.findIndex(a=>a.$id===i.$ref);if(o===-1)throw new r(i);return s[o]}e.Deref=n}}),Na=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/hash.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.ByteMarker=e.ValueHashError=void 0;var t=An(),r=class extends Error{constructor(U){super("Unable to hash value"),this.value=U}};e.ValueHashError=r;var n;(function(U){U[U.Undefined=0]="Undefined",U[U.Null=1]="Null",U[U.Boolean=2]="Boolean",U[U.Number=3]="Number",U[U.String=4]="String",U[U.Object=5]="Object",U[U.Array=6]="Array",U[U.Date=7]="Date",U[U.Uint8Array=8]="Uint8Array",U[U.Symbol=9]="Symbol",U[U.BigInt=10]="BigInt"})(n||(e.ByteMarker=n={}));var i=BigInt("14695981039346656037"),[s,o]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],a=Array.from({length:256}).map((U,k)=>BigInt(k)),f=new Float64Array(1),c=new DataView(f.buffer),y=new Uint8Array(f.buffer);function*g(U){let k=U===0?1:Math.ceil(Math.floor(Math.log2(U)+1)/8);for(let ee=0;ee<k;ee++)yield U>>8*(k-1-ee)&255}function M(U){ye(n.Array);for(let k of U)K(k)}function R(U){ye(n.Boolean),ye(U?1:0)}function j(U){ye(n.BigInt),c.setBigInt64(0,U);for(let k of y)ye(k)}function te(U){ye(n.Date),K(U.getTime())}function W(U){ye(n.Null)}function B(U){ye(n.Number),c.setFloat64(0,U);for(let k of y)ye(k)}function z(U){ye(n.Object);for(let k of globalThis.Object.keys(U).sort())K(k),K(U[k])}function Y(U){ye(n.String);for(let k=0;k<U.length;k++)for(let ee of g(U.charCodeAt(k)))ye(ee)}function ie(U){ye(n.Symbol),K(U.description)}function F(U){ye(n.Uint8Array);for(let k=0;k<U.length;k++)ye(U[k])}function se(U){return ye(n.Undefined)}function K(U){if((0,t.IsArray)(U))return M(U);if((0,t.IsBoolean)(U))return R(U);if((0,t.IsBigInt)(U))return j(U);if((0,t.IsDate)(U))return te(U);if((0,t.IsNull)(U))return W(U);if((0,t.IsNumber)(U))return B(U);if((0,t.IsPlainObject)(U))return z(U);if((0,t.IsString)(U))return Y(U);if((0,t.IsSymbol)(U))return ie(U);if((0,t.IsUint8Array)(U))return F(U);if((0,t.IsUndefined)(U))return se(U);throw new r(U)}function ye(U){i=i^a[U],i=i*s%o}function D(U){return i=BigInt("14695981039346656037"),K(U),i}e.Hash=D}}),Lo=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/errors.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Errors=e.ValueErrorIterator=e.EscapeKey=e.ValueErrorsUnknownTypeError=e.ValueErrorType=void 0;var t=An(),r=ml(),n=jo(),i=Na(),s=Qt(),o;(function(u){u[u.ArrayContains=0]="ArrayContains",u[u.ArrayMaxContains=1]="ArrayMaxContains",u[u.ArrayMaxItems=2]="ArrayMaxItems",u[u.ArrayMinContains=3]="ArrayMinContains",u[u.ArrayMinItems=4]="ArrayMinItems",u[u.ArrayUniqueItems=5]="ArrayUniqueItems",u[u.Array=6]="Array",u[u.AsyncIterator=7]="AsyncIterator",u[u.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",u[u.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",u[u.BigIntMaximum=10]="BigIntMaximum",u[u.BigIntMinimum=11]="BigIntMinimum",u[u.BigIntMultipleOf=12]="BigIntMultipleOf",u[u.BigInt=13]="BigInt",u[u.Boolean=14]="Boolean",u[u.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",u[u.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",u[u.DateMaximumTimestamp=17]="DateMaximumTimestamp",u[u.DateMinimumTimestamp=18]="DateMinimumTimestamp",u[u.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",u[u.Date=20]="Date",u[u.Function=21]="Function",u[u.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",u[u.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",u[u.IntegerMaximum=24]="IntegerMaximum",u[u.IntegerMinimum=25]="IntegerMinimum",u[u.IntegerMultipleOf=26]="IntegerMultipleOf",u[u.Integer=27]="Integer",u[u.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",u[u.Intersect=29]="Intersect",u[u.Iterator=30]="Iterator",u[u.Kind=31]="Kind",u[u.Literal=32]="Literal",u[u.Never=33]="Never",u[u.Not=34]="Not",u[u.Null=35]="Null",u[u.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",u[u.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",u[u.NumberMaximum=38]="NumberMaximum",u[u.NumberMinimum=39]="NumberMinimum",u[u.NumberMultipleOf=40]="NumberMultipleOf",u[u.Number=41]="Number",u[u.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",u[u.ObjectMaxProperties=43]="ObjectMaxProperties",u[u.ObjectMinProperties=44]="ObjectMinProperties",u[u.ObjectRequiredProperty=45]="ObjectRequiredProperty",u[u.Object=46]="Object",u[u.Promise=47]="Promise",u[u.StringFormatUnknown=48]="StringFormatUnknown",u[u.StringFormat=49]="StringFormat",u[u.StringMaxLength=50]="StringMaxLength",u[u.StringMinLength=51]="StringMinLength",u[u.StringPattern=52]="StringPattern",u[u.String=53]="String",u[u.Symbol=54]="Symbol",u[u.TupleLength=55]="TupleLength",u[u.Tuple=56]="Tuple",u[u.Uint8ArrayMaxByteLength=57]="Uint8ArrayMaxByteLength",u[u.Uint8ArrayMinByteLength=58]="Uint8ArrayMinByteLength",u[u.Uint8Array=59]="Uint8Array",u[u.Undefined=60]="Undefined",u[u.Union=61]="Union",u[u.Void=62]="Void"})(o||(e.ValueErrorType=o={}));var a=class extends s.TypeBoxError{constructor(u){super("Unknown type"),this.schema=u}};e.ValueErrorsUnknownTypeError=a;function f(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=f;function c(u){return u!==void 0}var y=class{constructor(u){this.iterator=u}[Symbol.iterator](){return this.iterator}First(){let u=this.iterator.next();return u.done?void 0:u.value}};e.ValueErrorIterator=y;function g(u,A,v,b){return{type:u,schema:A,path:v,value:b,message:r.TypeSystemErrorFunction.Get()(A,u)}}function*M(u,A,v,b){}function*R(u,A,v,b){if(!(0,t.IsArray)(b))return yield g(o.Array,u,v,b);c(u.minItems)&&!(b.length>=u.minItems)&&(yield g(o.ArrayMinItems,u,v,b)),c(u.maxItems)&&!(b.length<=u.maxItems)&&(yield g(o.ArrayMaxItems,u,v,b));for(let X=0;X<b.length;X++)yield*S(u.items,A,`${v}/${X}`,b[X]);if(u.uniqueItems===!0&&!function(){let X=new Set;for(let re of b){let me=(0,i.Hash)(re);if(X.has(me))return!1;X.add(me)}return!0}()&&(yield g(o.ArrayUniqueItems,u,v,b)),!(c(u.contains)||c(u.minContains)||c(u.maxContains)))return;let $=c(u.contains)?u.contains:s.Type.Never(),V=b.reduce((X,re,me)=>S($,A,`${v}${me}`,re).next().done===!0?X+1:X,0);V===0&&(yield g(o.ArrayContains,u,v,b)),(0,t.IsNumber)(u.minContains)&&V<u.minContains&&(yield g(o.ArrayMinContains,u,v,b)),(0,t.IsNumber)(u.maxContains)&&V>u.maxContains&&(yield g(o.ArrayMaxContains,u,v,b))}function*j(u,A,v,b){(0,t.IsAsyncIterator)(b)||(yield g(o.AsyncIterator,u,v,b))}function*te(u,A,v,b){if(!(0,t.IsBigInt)(b))return yield g(o.BigInt,u,v,b);c(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(o.BigIntExclusiveMaximum,u,v,b)),c(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(o.BigIntExclusiveMinimum,u,v,b)),c(u.maximum)&&!(b<=u.maximum)&&(yield g(o.BigIntMaximum,u,v,b)),c(u.minimum)&&!(b>=u.minimum)&&(yield g(o.BigIntMinimum,u,v,b)),c(u.multipleOf)&&b%u.multipleOf!==BigInt(0)&&(yield g(o.BigIntMultipleOf,u,v,b))}function*W(u,A,v,b){(0,t.IsBoolean)(b)||(yield g(o.Boolean,u,v,b))}function*B(u,A,v,b){yield*S(u.returns,A,v,b.prototype)}function*z(u,A,v,b){if(!(0,t.IsDate)(b))return yield g(o.Date,u,v,b);c(u.exclusiveMaximumTimestamp)&&!(b.getTime()<u.exclusiveMaximumTimestamp)&&(yield g(o.DateExclusiveMaximumTimestamp,u,v,b)),c(u.exclusiveMinimumTimestamp)&&!(b.getTime()>u.exclusiveMinimumTimestamp)&&(yield g(o.DateExclusiveMinimumTimestamp,u,v,b)),c(u.maximumTimestamp)&&!(b.getTime()<=u.maximumTimestamp)&&(yield g(o.DateMaximumTimestamp,u,v,b)),c(u.minimumTimestamp)&&!(b.getTime()>=u.minimumTimestamp)&&(yield g(o.DateMinimumTimestamp,u,v,b)),c(u.multipleOfTimestamp)&&b.getTime()%u.multipleOfTimestamp!==0&&(yield g(o.DateMultipleOfTimestamp,u,v,b))}function*Y(u,A,v,b){(0,t.IsFunction)(b)||(yield g(o.Function,u,v,b))}function*ie(u,A,v,b){if(!(0,t.IsInteger)(b))return yield g(o.Integer,u,v,b);c(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(o.IntegerExclusiveMaximum,u,v,b)),c(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(o.IntegerExclusiveMinimum,u,v,b)),c(u.maximum)&&!(b<=u.maximum)&&(yield g(o.IntegerMaximum,u,v,b)),c(u.minimum)&&!(b>=u.minimum)&&(yield g(o.IntegerMinimum,u,v,b)),c(u.multipleOf)&&b%u.multipleOf!==0&&(yield g(o.IntegerMultipleOf,u,v,b))}function*F(u,A,v,b){for(let $ of u.allOf){let V=S($,A,v,b).next();V.done||(yield g(o.Intersect,u,v,b),yield V.value)}if(u.unevaluatedProperties===!1){let $=new RegExp(s.KeyResolver.ResolvePattern(u));for(let V of Object.getOwnPropertyNames(b))$.test(V)||(yield g(o.IntersectUnevaluatedProperties,u,`${v}/${V}`,b))}if(typeof u.unevaluatedProperties=="object"){let $=new RegExp(s.KeyResolver.ResolvePattern(u));for(let V of Object.getOwnPropertyNames(b))if(!$.test(V)){let X=S(u.unevaluatedProperties,A,`${v}/${V}`,b[V]).next();X.done||(yield X.value)}}}function*se(u,A,v,b){(0,t.IsIterator)(b)||(yield g(o.Iterator,u,v,b))}function*K(u,A,v,b){b!==u.const&&(yield g(o.Literal,u,v,b))}function*ye(u,A,v,b){yield g(o.Never,u,v,b)}function*D(u,A,v,b){S(u.not,A,v,b).next().done===!0&&(yield g(o.Not,u,v,b))}function*U(u,A,v,b){(0,t.IsNull)(b)||(yield g(o.Null,u,v,b))}function*k(u,A,v,b){if(!r.TypeSystemPolicy.IsNumberLike(b))return yield g(o.Number,u,v,b);c(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(o.NumberExclusiveMaximum,u,v,b)),c(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(o.NumberExclusiveMinimum,u,v,b)),c(u.maximum)&&!(b<=u.maximum)&&(yield g(o.NumberMaximum,u,v,b)),c(u.minimum)&&!(b>=u.minimum)&&(yield g(o.NumberMinimum,u,v,b)),c(u.multipleOf)&&b%u.multipleOf!==0&&(yield g(o.NumberMultipleOf,u,v,b))}function*ee(u,A,v,b){if(!r.TypeSystemPolicy.IsObjectLike(b))return yield g(o.Object,u,v,b);c(u.minProperties)&&!(Object.getOwnPropertyNames(b).length>=u.minProperties)&&(yield g(o.ObjectMinProperties,u,v,b)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(b).length<=u.maxProperties)&&(yield g(o.ObjectMaxProperties,u,v,b));let $=Array.isArray(u.required)?u.required:[],V=Object.getOwnPropertyNames(u.properties),X=Object.getOwnPropertyNames(b);for(let re of $)X.includes(re)||(yield g(o.ObjectRequiredProperty,u.properties[re],`${v}/${f(re)}`,void 0));if(u.additionalProperties===!1)for(let re of X)V.includes(re)||(yield g(o.ObjectAdditionalProperties,u,`${v}/${f(re)}`,b[re]));if(typeof u.additionalProperties=="object")for(let re of X)V.includes(re)||(yield*S(u.additionalProperties,A,`${v}/${f(re)}`,b[re]));for(let re of V){let me=u.properties[re];u.required&&u.required.includes(re)?(yield*S(me,A,`${v}/${f(re)}`,b[re]),s.ExtendsUndefined.Check(u)&&!(re in b)&&(yield g(o.ObjectRequiredProperty,me,`${v}/${f(re)}`,void 0))):r.TypeSystemPolicy.IsExactOptionalProperty(b,re)&&(yield*S(me,A,`${v}/${f(re)}`,b[re]))}}function*Q(u,A,v,b){(0,t.IsPromise)(b)||(yield g(o.Promise,u,v,b))}function*O(u,A,v,b){if(!r.TypeSystemPolicy.IsRecordLike(b))return yield g(o.Object,u,v,b);c(u.minProperties)&&!(Object.getOwnPropertyNames(b).length>=u.minProperties)&&(yield g(o.ObjectMinProperties,u,v,b)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(b).length<=u.maxProperties)&&(yield g(o.ObjectMaxProperties,u,v,b));let[$,V]=Object.entries(u.patternProperties)[0],X=new RegExp($);for(let[re,me]of Object.entries(b))X.test(re)&&(yield*S(V,A,`${v}/${f(re)}`,me));if(typeof u.additionalProperties=="object")for(let[re,me]of Object.entries(b))X.test(re)||(yield*S(u.additionalProperties,A,`${v}/${f(re)}`,me));if(u.additionalProperties===!1){for(let[re,me]of Object.entries(b))if(!X.test(re))return yield g(o.ObjectAdditionalProperties,u,`${v}/${f(re)}`,me)}}function*q(u,A,v,b){yield*S((0,n.Deref)(u,A),A,v,b)}function*ne(u,A,v,b){if(!(0,t.IsString)(b))return yield g(o.String,u,v,b);c(u.minLength)&&!(b.length>=u.minLength)&&(yield g(o.StringMinLength,u,v,b)),c(u.maxLength)&&!(b.length<=u.maxLength)&&(yield g(o.StringMaxLength,u,v,b)),(0,t.IsString)(u.pattern)&&(new RegExp(u.pattern).test(b)||(yield g(o.StringPattern,u,v,b))),(0,t.IsString)(u.format)&&(s.FormatRegistry.Has(u.format)?s.FormatRegistry.Get(u.format)(b)||(yield g(o.StringFormat,u,v,b)):yield g(o.StringFormatUnknown,u,v,b))}function*G(u,A,v,b){(0,t.IsSymbol)(b)||(yield g(o.Symbol,u,v,b))}function*J(u,A,v,b){if(!(0,t.IsString)(b))return yield g(o.String,u,v,b);new RegExp(u.pattern).test(b)||(yield g(o.StringPattern,u,v,b))}function*de(u,A,v,b){yield*S((0,n.Deref)(u,A),A,v,b)}function*l(u,A,v,b){if(!(0,t.IsArray)(b))return yield g(o.Tuple,u,v,b);if(u.items===void 0&&b.length!==0)return yield g(o.TupleLength,u,v,b);if(b.length!==u.maxItems)return yield g(o.TupleLength,u,v,b);if(u.items)for(let $=0;$<u.items.length;$++)yield*S(u.items[$],A,`${v}/${$}`,b[$])}function*w(u,A,v,b){(0,t.IsUndefined)(b)||(yield g(o.Undefined,u,v,b))}function*I(u,A,v,b){let $=0;for(let V of u.anyOf){let X=[...S(V,A,v,b)];if(X.length===0)return;$+=X.length}$>0&&(yield g(o.Union,u,v,b))}function*P(u,A,v,b){if(!(0,t.IsUint8Array)(b))return yield g(o.Uint8Array,u,v,b);c(u.maxByteLength)&&!(b.length<=u.maxByteLength)&&(yield g(o.Uint8ArrayMaxByteLength,u,v,b)),c(u.minByteLength)&&!(b.length>=u.minByteLength)&&(yield g(o.Uint8ArrayMinByteLength,u,v,b))}function*N(u,A,v,b){}function*E(u,A,v,b){r.TypeSystemPolicy.IsVoidLike(b)||(yield g(o.Void,u,v,b))}function*h(u,A,v,b){s.TypeRegistry.Get(u[s.Kind])(u,b)||(yield g(o.Kind,u,v,b))}function*S(u,A,v,b){let $=c(u.$id)?[...A,u]:A,V=u;switch(V[s.Kind]){case"Any":return yield*M(V,$,v,b);case"Array":return yield*R(V,$,v,b);case"AsyncIterator":return yield*j(V,$,v,b);case"BigInt":return yield*te(V,$,v,b);case"Boolean":return yield*W(V,$,v,b);case"Constructor":return yield*B(V,$,v,b);case"Date":return yield*z(V,$,v,b);case"Function":return yield*Y(V,$,v,b);case"Integer":return yield*ie(V,$,v,b);case"Intersect":return yield*F(V,$,v,b);case"Iterator":return yield*se(V,$,v,b);case"Literal":return yield*K(V,$,v,b);case"Never":return yield*ye(V,$,v,b);case"Not":return yield*D(V,$,v,b);case"Null":return yield*U(V,$,v,b);case"Number":return yield*k(V,$,v,b);case"Object":return yield*ee(V,$,v,b);case"Promise":return yield*Q(V,$,v,b);case"Record":return yield*O(V,$,v,b);case"Ref":return yield*q(V,$,v,b);case"String":return yield*ne(V,$,v,b);case"Symbol":return yield*G(V,$,v,b);case"TemplateLiteral":return yield*J(V,$,v,b);case"This":return yield*de(V,$,v,b);case"Tuple":return yield*l(V,$,v,b);case"Undefined":return yield*w(V,$,v,b);case"Union":return yield*I(V,$,v,b);case"Uint8Array":return yield*P(V,$,v,b);case"Unknown":return yield*N(V,$,v,b);case"Void":return yield*E(V,$,v,b);default:if(!s.TypeRegistry.Has(V[s.Kind]))throw new a(u);return yield*h(V,$,v,b)}}function _(...u){let A=u.length===3?S(u[0],u[1],"",u[2]):S(u[0],[],"",u[1]);return new y(A)}e.Errors=_}}),Ag=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=e&&e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Lo(),e)}}),gl=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var f=Object.getOwnPropertyDescriptor(s,o);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,f)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorType=void 0;var n=Lo();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),r(ml(),e)}}),Ig=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/check.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Check=e.ValueCheckUnknownTypeError=void 0;var t=An(),r=gl(),n=jo(),i=Na(),s=Qt(),o=class extends s.TypeBoxError{constructor(h){super("Unknown type"),this.schema=h}};e.ValueCheckUnknownTypeError=o;function a(h){return h[s.Kind]==="Any"||h[s.Kind]==="Unknown"}function f(h){return h!==void 0}function c(h,S,_){return!0}function y(h,S,_){if(!(0,t.IsArray)(_)||f(h.minItems)&&!(_.length>=h.minItems)||f(h.maxItems)&&!(_.length<=h.maxItems)||!_.every(v=>N(h.items,S,v))||h.uniqueItems===!0&&!function(){let v=new Set;for(let b of _){let $=(0,i.Hash)(b);if(v.has($))return!1;v.add($)}return!0}())return!1;if(!(f(h.contains)||(0,t.IsNumber)(h.minContains)||(0,t.IsNumber)(h.maxContains)))return!0;let u=f(h.contains)?h.contains:s.Type.Never(),A=_.reduce((v,b)=>N(u,S,b)?v+1:v,0);return!(A===0||(0,t.IsNumber)(h.minContains)&&A<h.minContains||(0,t.IsNumber)(h.maxContains)&&A>h.maxContains)}function g(h,S,_){return(0,t.IsAsyncIterator)(_)}function M(h,S,_){return!(!(0,t.IsBigInt)(_)||f(h.exclusiveMaximum)&&!(_<h.exclusiveMaximum)||f(h.exclusiveMinimum)&&!(_>h.exclusiveMinimum)||f(h.maximum)&&!(_<=h.maximum)||f(h.minimum)&&!(_>=h.minimum)||f(h.multipleOf)&&_%h.multipleOf!==BigInt(0))}function R(h,S,_){return(0,t.IsBoolean)(_)}function j(h,S,_){return N(h.returns,S,_.prototype)}function te(h,S,_){return!(!(0,t.IsDate)(_)||f(h.exclusiveMaximumTimestamp)&&!(_.getTime()<h.exclusiveMaximumTimestamp)||f(h.exclusiveMinimumTimestamp)&&!(_.getTime()>h.exclusiveMinimumTimestamp)||f(h.maximumTimestamp)&&!(_.getTime()<=h.maximumTimestamp)||f(h.minimumTimestamp)&&!(_.getTime()>=h.minimumTimestamp)||f(h.multipleOfTimestamp)&&_.getTime()%h.multipleOfTimestamp!==0)}function W(h,S,_){return(0,t.IsFunction)(_)}function B(h,S,_){return!(!(0,t.IsInteger)(_)||f(h.exclusiveMaximum)&&!(_<h.exclusiveMaximum)||f(h.exclusiveMinimum)&&!(_>h.exclusiveMinimum)||f(h.maximum)&&!(_<=h.maximum)||f(h.minimum)&&!(_>=h.minimum)||f(h.multipleOf)&&_%h.multipleOf!==0)}function z(h,S,_){let u=h.allOf.every(A=>N(A,S,_));if(h.unevaluatedProperties===!1){let A=new RegExp(s.KeyResolver.ResolvePattern(h)),v=Object.getOwnPropertyNames(_).every(b=>A.test(b));return u&&v}else if(s.TypeGuard.TSchema(h.unevaluatedProperties)){let A=new RegExp(s.KeyResolver.ResolvePattern(h)),v=Object.getOwnPropertyNames(_).every(b=>A.test(b)||N(h.unevaluatedProperties,S,_[b]));return u&&v}else return u}function Y(h,S,_){return(0,t.IsIterator)(_)}function ie(h,S,_){return _===h.const}function F(h,S,_){return!1}function se(h,S,_){return!N(h.not,S,_)}function K(h,S,_){return(0,t.IsNull)(_)}function ye(h,S,_){return!(!r.TypeSystemPolicy.IsNumberLike(_)||f(h.exclusiveMaximum)&&!(_<h.exclusiveMaximum)||f(h.exclusiveMinimum)&&!(_>h.exclusiveMinimum)||f(h.minimum)&&!(_>=h.minimum)||f(h.maximum)&&!(_<=h.maximum)||f(h.multipleOf)&&_%h.multipleOf!==0)}function D(h,S,_){if(!r.TypeSystemPolicy.IsObjectLike(_)||f(h.minProperties)&&!(Object.getOwnPropertyNames(_).length>=h.minProperties)||f(h.maxProperties)&&!(Object.getOwnPropertyNames(_).length<=h.maxProperties))return!1;let u=Object.getOwnPropertyNames(h.properties);for(let A of u){let v=h.properties[A];if(h.required&&h.required.includes(A)){if(!N(v,S,_[A])||(s.ExtendsUndefined.Check(v)||a(v))&&!(A in _))return!1}else if(r.TypeSystemPolicy.IsExactOptionalProperty(_,A)&&!N(v,S,_[A]))return!1}if(h.additionalProperties===!1){let A=Object.getOwnPropertyNames(_);return h.required&&h.required.length===u.length&&A.length===u.length?!0:A.every(v=>u.includes(v))}else return typeof h.additionalProperties=="object"?Object.getOwnPropertyNames(_).every(v=>u.includes(v)||N(h.additionalProperties,S,_[v])):!0}function U(h,S,_){return(0,t.IsPromise)(_)}function k(h,S,_){if(!r.TypeSystemPolicy.IsRecordLike(_)||f(h.minProperties)&&!(Object.getOwnPropertyNames(_).length>=h.minProperties)||f(h.maxProperties)&&!(Object.getOwnPropertyNames(_).length<=h.maxProperties))return!1;let[u,A]=Object.entries(h.patternProperties)[0],v=new RegExp(u),b=Object.entries(_).every(([X,re])=>v.test(X)?N(A,S,re):!0),$=typeof h.additionalProperties=="object"?Object.entries(_).every(([X,re])=>v.test(X)?!0:N(h.additionalProperties,S,re)):!0,V=h.additionalProperties===!1?Object.getOwnPropertyNames(_).every(X=>v.test(X)):!0;return b&&$&&V}function ee(h,S,_){return N((0,n.Deref)(h,S),S,_)}function Q(h,S,_){return!(0,t.IsString)(_)||f(h.minLength)&&!(_.length>=h.minLength)||f(h.maxLength)&&!(_.length<=h.maxLength)||f(h.pattern)&&!new RegExp(h.pattern).test(_)?!1:f(h.format)?s.FormatRegistry.Has(h.format)?s.FormatRegistry.Get(h.format)(_):!1:!0}function O(h,S,_){return(0,t.IsSymbol)(_)}function q(h,S,_){return(0,t.IsString)(_)&&new RegExp(h.pattern).test(_)}function ne(h,S,_){return N((0,n.Deref)(h,S),S,_)}function G(h,S,_){if(!(0,t.IsArray)(_)||h.items===void 0&&_.length!==0||_.length!==h.maxItems)return!1;if(!h.items)return!0;for(let u=0;u<h.items.length;u++)if(!N(h.items[u],S,_[u]))return!1;return!0}function J(h,S,_){return(0,t.IsUndefined)(_)}function de(h,S,_){return h.anyOf.some(u=>N(u,S,_))}function l(h,S,_){return!(!(0,t.IsUint8Array)(_)||f(h.maxByteLength)&&!(_.length<=h.maxByteLength)||f(h.minByteLength)&&!(_.length>=h.minByteLength))}function w(h,S,_){return!0}function I(h,S,_){return r.TypeSystemPolicy.IsVoidLike(_)}function P(h,S,_){return s.TypeRegistry.Has(h[s.Kind])?s.TypeRegistry.Get(h[s.Kind])(h,_):!1}function N(h,S,_){let u=f(h.$id)?[...S,h]:S,A=h;switch(A[s.Kind]){case"Any":return c(A,u,_);case"Array":return y(A,u,_);case"AsyncIterator":return g(A,u,_);case"BigInt":return M(A,u,_);case"Boolean":return R(A,u,_);case"Constructor":return j(A,u,_);case"Date":return te(A,u,_);case"Function":return W(A,u,_);case"Integer":return B(A,u,_);case"Intersect":return z(A,u,_);case"Iterator":return Y(A,u,_);case"Literal":return ie(A,u,_);case"Never":return F(A,u,_);case"Not":return se(A,u,_);case"Null":return K(A,u,_);case"Number":return ye(A,u,_);case"Object":return D(A,u,_);case"Promise":return U(A,u,_);case"Record":return k(A,u,_);case"Ref":return ee(A,u,_);case"String":return Q(A,u,_);case"Symbol":return O(A,u,_);case"TemplateLiteral":return q(A,u,_);case"This":return ne(A,u,_);case"Tuple":return G(A,u,_);case"Undefined":return J(A,u,_);case"Union":return de(A,u,_);case"Uint8Array":return l(A,u,_);case"Unknown":return w(A,u,_);case"Void":return I(A,u,_);default:if(!s.TypeRegistry.Has(A[s.Kind]))throw new o(A);return P(A,u,_)}}function E(...h){return h.length===3?N(h[0],h[1],h[2]):N(h[0],[],h[1])}e.Check=E}}),Eg=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/transform.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EncodeTransform=e.DecodeTransform=e.HasTransform=e.TransformEncodeError=e.TransformDecodeError=e.TransformEncodeCheckError=e.TransformDecodeCheckError=void 0;var t=An(),r=jo(),n=Ig(),i=Qt(),s=class extends i.TypeBoxError{constructor(M,R,j){super("Unable to decode due to invalid value"),this.schema=M,this.value=R,this.error=j}};e.TransformDecodeCheckError=s;var o=class extends i.TypeBoxError{constructor(M,R,j){super("Unable to encode due to invalid value"),this.schema=M,this.value=R,this.error=j}};e.TransformEncodeCheckError=o;var a=class extends i.TypeBoxError{constructor(M,R,j){super(`${j instanceof Error?j.message:"Unknown error"}`),this.schema=M,this.value=R}};e.TransformDecodeError=a;var f=class extends i.TypeBoxError{constructor(M,R,j){super(`${j instanceof Error?j.message:"Unknown error"}`),this.schema=M,this.value=R}};e.TransformEncodeError=f;var c;(function(M){function R(O,q){return i.TypeGuard.TTransform(O)||k(O.items,q)}function j(O,q){return i.TypeGuard.TTransform(O)||k(O.items,q)}function te(O,q){return i.TypeGuard.TTransform(O)||k(O.returns,q)||O.parameters.some(ne=>k(ne,q))}function W(O,q){return i.TypeGuard.TTransform(O)||k(O.returns,q)||O.parameters.some(ne=>k(ne,q))}function B(O,q){return i.TypeGuard.TTransform(O)||i.TypeGuard.TTransform(O.unevaluatedProperties)||O.allOf.some(ne=>k(ne,q))}function z(O,q){return i.TypeGuard.TTransform(O)||k(O.items,q)}function Y(O,q){return i.TypeGuard.TTransform(O)||k(O.not,q)}function ie(O,q){return i.TypeGuard.TTransform(O)||Object.values(O.properties).some(ne=>k(ne,q))||i.TypeGuard.TSchema(O.additionalProperties)&&k(O.additionalProperties,q)}function F(O,q){return i.TypeGuard.TTransform(O)||k(O.item,q)}function se(O,q){let ne=Object.getOwnPropertyNames(O.patternProperties)[0],G=O.patternProperties[ne];return i.TypeGuard.TTransform(O)||k(G,q)||i.TypeGuard.TSchema(O.additionalProperties)&&i.TypeGuard.TTransform(O.additionalProperties)}function K(O,q){return i.TypeGuard.TTransform(O)?!0:k((0,r.Deref)(O,q),q)}function ye(O,q){return i.TypeGuard.TTransform(O)?!0:k((0,r.Deref)(O,q),q)}function D(O,q){return i.TypeGuard.TTransform(O)||!(0,t.IsUndefined)(O.items)&&O.items.some(ne=>k(ne,q))}function U(O,q){return i.TypeGuard.TTransform(O)||O.anyOf.some(ne=>k(ne,q))}function k(O,q){let ne=(0,t.IsString)(O.$id)?[...q,O]:q,G=O;if(O.$id&&ee.has(O.$id))return!1;switch(O.$id&&ee.add(O.$id),O[i.Kind]){case"Array":return R(G,ne);case"AsyncIterator":return j(G,ne);case"Constructor":return te(G,ne);case"Function":return W(G,ne);case"Intersect":return B(G,ne);case"Iterator":return z(G,ne);case"Not":return Y(G,ne);case"Object":return ie(G,ne);case"Promise":return F(G,ne);case"Record":return se(G,ne);case"Ref":return K(G,ne);case"This":return ye(G,ne);case"Tuple":return D(G,ne);case"Union":return U(G,ne);default:return i.TypeGuard.TTransform(O)}}let ee=new Set;function Q(O,q){return ee.clear(),k(O,q)}M.Has=Q})(c||(e.HasTransform=c={}));var y;(function(M){function R(D,U){try{return i.TypeGuard.TTransform(D)?D[i.Transform].Decode(U):U}catch(k){throw new a(D,U,k)}}function j(D,U,k){return(0,t.IsArray)(k)?R(D,k.map(ee=>K(D.items,U,ee))):R(D,k)}function te(D,U,k){if(!(0,t.IsPlainObject)(k)||(0,t.IsValueType)(k))return R(D,k);let ee=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),Q=ee.reduce((G,J)=>J in G?{...G,[J]:K(i.IndexedAccessor.Resolve(D,[J]),U,G[J])}:G,k);if(!i.TypeGuard.TTransform(D.unevaluatedProperties))return R(D,Q);let O=Object.getOwnPropertyNames(Q),q=D.unevaluatedProperties,ne=O.reduce((G,J)=>ee.includes(J)?G:{...G,[J]:R(q,G[J])},Q);return R(D,ne)}function W(D,U,k){return R(D,K(D.not,U,k))}function B(D,U,k){if(!(0,t.IsPlainObject)(k))return R(D,k);let ee=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),Q=ee.reduce((G,J)=>J in G?{...G,[J]:K(D.properties[J],U,G[J])}:G,k);if(!i.TypeGuard.TSchema(D.additionalProperties))return R(D,Q);let O=Object.getOwnPropertyNames(Q),q=D.additionalProperties,ne=O.reduce((G,J)=>ee.includes(J)?G:{...G,[J]:R(q,G[J])},Q);return R(D,ne)}function z(D,U,k){if(!(0,t.IsPlainObject)(k))return R(D,k);let ee=Object.getOwnPropertyNames(D.patternProperties)[0],Q=new RegExp(ee),O=Object.getOwnPropertyNames(k).reduce((J,de)=>Q.test(de)?{...J,[de]:K(D.patternProperties[ee],U,J[de])}:J,k);if(!i.TypeGuard.TSchema(D.additionalProperties))return R(D,O);let q=Object.getOwnPropertyNames(O),ne=D.additionalProperties,G=q.reduce((J,de)=>Q.test(de)?J:{...J,[de]:R(ne,J[de])},O);return R(D,G)}function Y(D,U,k){let ee=(0,r.Deref)(D,U);return R(D,K(ee,U,k))}function ie(D,U,k){let ee=(0,r.Deref)(D,U);return R(D,K(ee,U,k))}function F(D,U,k){return(0,t.IsArray)(k)&&(0,t.IsArray)(D.items)?R(D,D.items.map((ee,Q)=>K(ee,U,k[Q]))):R(D,k)}function se(D,U,k){let ee=R(D,k);for(let Q of D.anyOf)if((0,n.Check)(Q,U,ee))return K(Q,U,ee);return ee}function K(D,U,k){let ee=typeof D.$id=="string"?[...U,D]:U,Q=D;switch(D[i.Kind]){case"Array":return j(Q,ee,k);case"Intersect":return te(Q,ee,k);case"Not":return W(Q,ee,k);case"Object":return B(Q,ee,k);case"Record":return z(Q,ee,k);case"Ref":return Y(Q,ee,k);case"Symbol":return R(Q,k);case"This":return ie(Q,ee,k);case"Tuple":return F(Q,ee,k);case"Union":return se(Q,ee,k);default:return R(Q,k)}}function ye(D,U,k){return K(D,U,k)}M.Decode=ye})(y||(e.DecodeTransform=y={}));var g;(function(M){function R(D,U){try{return i.TypeGuard.TTransform(D)?D[i.Transform].Encode(U):U}catch(k){throw new f(D,U,k)}}function j(D,U,k){let ee=R(D,k);return(0,t.IsArray)(ee)?ee.map(Q=>K(D.items,U,Q)):ee}function te(D,U,k){let ee=R(D,k);if(!(0,t.IsPlainObject)(k)||(0,t.IsValueType)(k))return ee;let Q=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),O=Q.reduce((G,J)=>J in ee?{...G,[J]:K(i.IndexedAccessor.Resolve(D,[J]),U,G[J])}:G,ee);if(!i.TypeGuard.TTransform(D.unevaluatedProperties))return R(D,O);let q=Object.getOwnPropertyNames(O),ne=D.unevaluatedProperties;return q.reduce((G,J)=>Q.includes(J)?G:{...G,[J]:R(ne,G[J])},O)}function W(D,U,k){return R(D.not,R(D,k))}function B(D,U,k){let ee=R(D,k);if(!(0,t.IsPlainObject)(k))return ee;let Q=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),O=Q.reduce((G,J)=>J in G?{...G,[J]:K(D.properties[J],U,G[J])}:G,ee);if(!i.TypeGuard.TSchema(D.additionalProperties))return O;let q=Object.getOwnPropertyNames(O),ne=D.additionalProperties;return q.reduce((G,J)=>Q.includes(J)?G:{...G,[J]:R(ne,G[J])},O)}function z(D,U,k){let ee=R(D,k);if(!(0,t.IsPlainObject)(k))return ee;let Q=Object.getOwnPropertyNames(D.patternProperties)[0],O=new RegExp(Q),q=Object.getOwnPropertyNames(k).reduce((J,de)=>O.test(de)?{...J,[de]:K(D.patternProperties[Q],U,J[de])}:J,ee);if(!i.TypeGuard.TSchema(D.additionalProperties))return R(D,q);let ne=Object.getOwnPropertyNames(q),G=D.additionalProperties;return ne.reduce((J,de)=>O.test(de)?J:{...J,[de]:R(G,J[de])},q)}function Y(D,U,k){let ee=(0,r.Deref)(D,U),Q=K(ee,U,k);return R(D,Q)}function ie(D,U,k){let ee=(0,r.Deref)(D,U),Q=K(ee,U,k);return R(D,Q)}function F(D,U,k){let ee=R(D,k);return(0,t.IsArray)(D.items)?D.items.map((Q,O)=>K(Q,U,ee[O])):[]}function se(D,U,k){for(let ee of D.anyOf){if(!(0,n.Check)(ee,U,k))continue;let Q=K(ee,U,k);return R(D,Q)}for(let ee of D.anyOf){let Q=K(ee,U,k);if((0,n.Check)(D,U,Q))return R(D,Q)}return R(D,k)}function K(D,U,k){let ee=typeof D.$id=="string"?[...U,D]:U,Q=D;switch(D[i.Kind]){case"Array":return j(Q,ee,k);case"Intersect":return te(Q,ee,k);case"Not":return W(Q,ee,k);case"Object":return B(Q,ee,k);case"Record":return z(Q,ee,k);case"Ref":return Y(Q,ee,k);case"This":return ie(Q,ee,k);case"Tuple":return F(Q,ee,k);case"Union":return se(Q,ee,k);default:return R(Q,k)}}function ye(D,U,k){return K(D,U,k)}M.Encode=ye})(g||(e.EncodeTransform=g={}))}}),Sg=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/compiler.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeCompiler=e.Policy=e.TypeCompilerTypeGuardError=e.TypeCompilerUnknownTypeError=e.TypeCheck=void 0;var t=Eg(),r=An(),n=Lo(),i=gl(),s=jo(),o=Na(),a=Qt(),f=class{constructor(B,z,Y,ie){this.schema=B,this.references=z,this.checkFunc=Y,this.code=ie,this.hasTransform=t.HasTransform.Has(B,z)}Code(){return this.code}Errors(B){return(0,n.Errors)(this.schema,this.references,B)}Check(B){return this.checkFunc(B)}Decode(B){if(!this.checkFunc(B))throw new t.TransformDecodeCheckError(this.schema,B,this.Errors(B).First());return this.hasTransform?t.DecodeTransform.Decode(this.schema,this.references,B):B}Encode(B){let z=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,B):B;if(!this.checkFunc(z))throw new t.TransformEncodeCheckError(this.schema,B,this.Errors(B).First());return z}};e.TypeCheck=f;var c;(function(B){function z(se){return se===36}B.DollarSign=z;function Y(se){return se===95}B.IsUnderscore=Y;function ie(se){return se>=65&&se<=90||se>=97&&se<=122}B.IsAlpha=ie;function F(se){return se>=48&&se<=57}B.IsNumeric=F})(c||(c={}));var y;(function(B){function z(se){return se.length===0?!1:c.IsNumeric(se.charCodeAt(0))}function Y(se){if(z(se))return!1;for(let K=0;K<se.length;K++){let ye=se.charCodeAt(K);if(!(c.IsAlpha(ye)||c.IsNumeric(ye)||c.DollarSign(ye)||c.IsUnderscore(ye)))return!1}return!0}function ie(se){return se.replace(/'/g,"\\'")}function F(se,K){return Y(K)?`${se}.${K}`:`${se}['${ie(K)}']`}B.Encode=F})(y||(y={}));var g;(function(B){function z(Y){let ie=[];for(let F=0;F<Y.length;F++){let se=Y.charCodeAt(F);c.IsNumeric(se)||c.IsAlpha(se)?ie.push(Y.charAt(F)):ie.push(`_${se}_`)}return ie.join("").replace(/__/g,"_")}B.Encode=z})(g||(g={}));var M;(function(B){function z(Y){return Y.replace(/'/g,"\\'")}B.Escape=z})(M||(M={}));var R=class extends a.TypeBoxError{constructor(B){super("Unknown type"),this.schema=B}};e.TypeCompilerUnknownTypeError=R;var j=class extends a.TypeBoxError{constructor(B){super("Preflight validation check failed to guard for the given schema"),this.schema=B}};e.TypeCompilerTypeGuardError=j;var te;(function(B){function z(K,ye,D){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${ye}' in ${K} ? ${D} : true)`:`(${y.Encode(K,ye)} !== undefined ? ${D} : true)`}B.IsExactOptionalProperty=z;function Y(K){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${K} === 'object' && ${K} !== null)`:`(typeof ${K} === 'object' && ${K} !== null && !Array.isArray(${K}))`}B.IsObjectLike=Y;function ie(K){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${K} === 'object' && ${K} !== null && !(${K} instanceof Date) && !(${K} instanceof Uint8Array))`:`(typeof ${K} === 'object' && ${K} !== null && !Array.isArray(${K}) && !(${K} instanceof Date) && !(${K} instanceof Uint8Array))`}B.IsRecordLike=ie;function F(K){return i.TypeSystemPolicy.AllowNaN?`typeof ${K} === 'number'`:`(typeof ${K} === 'number' && Number.isFinite(${K}))`}B.IsNumberLike=F;function se(K){return i.TypeSystemPolicy.AllowNullVoid?`(${K} === undefined || ${K} === null)`:`${K} === undefined`}B.IsVoidLike=se})(te||(e.Policy=te={}));var W;(function(B){function z(T){return T[a.Kind]==="Any"||T[a.Kind]==="Unknown"}function*Y(T,le,x){yield"true"}function*ie(T,le,x){yield`Array.isArray(${x})`;let[ge,oe]=[je("value","any"),je("acc","number")];(0,r.IsNumber)(T.maxItems)&&(yield`${x}.length <= ${T.maxItems}`),(0,r.IsNumber)(T.minItems)&&(yield`${x}.length >= ${T.minItems}`);let pe=re(T.items,le,"value");if(yield`${x}.every((${ge}) => ${pe})`,a.TypeGuard.TSchema(T.contains)||(0,r.IsNumber)(T.minContains)||(0,r.IsNumber)(T.maxContains)){let Ee=a.TypeGuard.TSchema(T.contains)?T.contains:a.Type.Never(),Me=re(Ee,le,"value"),Xe=(0,r.IsNumber)(T.minContains)?[`(count >= ${T.minContains})`]:[],We=(0,r.IsNumber)(T.maxContains)?[`(count <= ${T.maxContains})`]:[],Ze=`const count = value.reduce((${oe}, ${ge}) => ${Me} ? acc + 1 : acc, 0)`,Jt=["(count > 0)",...Xe,...We].join(" && ");yield`((${ge}) => { ${Ze}; return ${Jt}})(${x})`}T.uniqueItems===!0&&(yield`((${ge}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${x})`)}function*F(T,le,x){yield`(typeof value === 'object' && Symbol.asyncIterator in ${x})`}function*se(T,le,x){yield`(typeof ${x} === 'bigint')`,(0,r.IsBigInt)(T.exclusiveMaximum)&&(yield`${x} < BigInt(${T.exclusiveMaximum})`),(0,r.IsBigInt)(T.exclusiveMinimum)&&(yield`${x} > BigInt(${T.exclusiveMinimum})`),(0,r.IsBigInt)(T.maximum)&&(yield`${x} <= BigInt(${T.maximum})`),(0,r.IsBigInt)(T.minimum)&&(yield`${x} >= BigInt(${T.minimum})`),(0,r.IsBigInt)(T.multipleOf)&&(yield`(${x} % BigInt(${T.multipleOf})) === 0`)}function*K(T,le,x){yield`(typeof ${x} === 'boolean')`}function*ye(T,le,x){yield*V(T.returns,le,`${x}.prototype`)}function*D(T,le,x){yield`(${x} instanceof Date) && Number.isFinite(${x}.getTime())`,(0,r.IsNumber)(T.exclusiveMaximumTimestamp)&&(yield`${x}.getTime() < ${T.exclusiveMaximumTimestamp}`),(0,r.IsNumber)(T.exclusiveMinimumTimestamp)&&(yield`${x}.getTime() > ${T.exclusiveMinimumTimestamp}`),(0,r.IsNumber)(T.maximumTimestamp)&&(yield`${x}.getTime() <= ${T.maximumTimestamp}`),(0,r.IsNumber)(T.minimumTimestamp)&&(yield`${x}.getTime() >= ${T.minimumTimestamp}`),(0,r.IsNumber)(T.multipleOfTimestamp)&&(yield`(${x}.getTime() % ${T.multipleOfTimestamp}) === 0`)}function*U(T,le,x){yield`(typeof ${x} === 'function')`}function*k(T,le,x){yield`(typeof ${x} === 'number' && Number.isInteger(${x}))`,(0,r.IsNumber)(T.exclusiveMaximum)&&(yield`${x} < ${T.exclusiveMaximum}`),(0,r.IsNumber)(T.exclusiveMinimum)&&(yield`${x} > ${T.exclusiveMinimum}`),(0,r.IsNumber)(T.maximum)&&(yield`${x} <= ${T.maximum}`),(0,r.IsNumber)(T.minimum)&&(yield`${x} >= ${T.minimum}`),(0,r.IsNumber)(T.multipleOf)&&(yield`(${x} % ${T.multipleOf}) === 0`)}function*ee(T,le,x){let ge=T.allOf.map(oe=>re(oe,le,x)).join(" && ");if(T.unevaluatedProperties===!1){let oe=_e(`${new RegExp(a.KeyResolver.ResolvePattern(T))};`),pe=`Object.getOwnPropertyNames(${x}).every(key => ${oe}.test(key))`;yield`(${ge} && ${pe})`}else if(a.TypeGuard.TSchema(T.unevaluatedProperties)){let oe=_e(`${new RegExp(a.KeyResolver.ResolvePattern(T))};`),pe=`Object.getOwnPropertyNames(${x}).every(key => ${oe}.test(key) || ${re(T.unevaluatedProperties,le,`${x}[key]`)})`;yield`(${ge} && ${pe})`}else yield`(${ge})`}function*Q(T,le,x){yield`(typeof value === 'object' && Symbol.iterator in ${x})`}function*O(T,le,x){typeof T.const=="number"||typeof T.const=="boolean"?yield`(${x} === ${T.const})`:yield`(${x} === '${M.Escape(T.const)}')`}function*q(T,le,x){yield"false"}function*ne(T,le,x){yield`(!${re(T.not,le,x)})`}function*G(T,le,x){yield`(${x} === null)`}function*J(T,le,x){yield te.IsNumberLike(x),(0,r.IsNumber)(T.exclusiveMaximum)&&(yield`${x} < ${T.exclusiveMaximum}`),(0,r.IsNumber)(T.exclusiveMinimum)&&(yield`${x} > ${T.exclusiveMinimum}`),(0,r.IsNumber)(T.maximum)&&(yield`${x} <= ${T.maximum}`),(0,r.IsNumber)(T.minimum)&&(yield`${x} >= ${T.minimum}`),(0,r.IsNumber)(T.multipleOf)&&(yield`(${x} % ${T.multipleOf}) === 0`)}function*de(T,le,x){yield te.IsObjectLike(x),(0,r.IsNumber)(T.minProperties)&&(yield`Object.getOwnPropertyNames(${x}).length >= ${T.minProperties}`),(0,r.IsNumber)(T.maxProperties)&&(yield`Object.getOwnPropertyNames(${x}).length <= ${T.maxProperties}`);let ge=Object.getOwnPropertyNames(T.properties);for(let oe of ge){let pe=y.Encode(x,oe),Ee=T.properties[oe];if(T.required&&T.required.includes(oe))yield*V(Ee,le,pe),(a.ExtendsUndefined.Check(Ee)||z(Ee))&&(yield`('${oe}' in ${x})`);else{let Me=re(Ee,le,pe);yield te.IsExactOptionalProperty(x,oe,Me)}}if(T.additionalProperties===!1)if(T.required&&T.required.length===ge.length)yield`Object.getOwnPropertyNames(${x}).length === ${ge.length}`;else{let oe=`[${ge.map(pe=>`'${pe}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${x}).every(key => ${oe}.includes(key))`}if(typeof T.additionalProperties=="object"){let oe=re(T.additionalProperties,le,`${x}[key]`),pe=`[${ge.map(Ee=>`'${Ee}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${x}).every(key => ${pe}.includes(key) || ${oe}))`}}function*l(T,le,x){yield`(typeof value === 'object' && typeof ${x}.then === 'function')`}function*w(T,le,x){yield te.IsRecordLike(x),(0,r.IsNumber)(T.minProperties)&&(yield`Object.getOwnPropertyNames(${x}).length >= ${T.minProperties}`),(0,r.IsNumber)(T.maxProperties)&&(yield`Object.getOwnPropertyNames(${x}).length <= ${T.maxProperties}`);let[ge,oe]=Object.entries(T.patternProperties)[0],pe=_e(`${new RegExp(ge)}`),Ee=re(oe,le,"value"),Me=a.TypeGuard.TSchema(T.additionalProperties)?re(T.additionalProperties,le,x):T.additionalProperties===!1?"false":"true",Xe=`(${pe}.test(key) ? ${Ee} : ${Me})`;yield`(Object.entries(${x}).every(([key, value]) => ${Xe}))`}function*I(T,le,x){let ge=(0,s.Deref)(T,le);if(X.functions.has(T.$ref))return yield`${me(T.$ref)}(${x})`;yield*V(ge,le,x)}function*P(T,le,x){yield`(typeof ${x} === 'string')`,(0,r.IsNumber)(T.maxLength)&&(yield`${x}.length <= ${T.maxLength}`),(0,r.IsNumber)(T.minLength)&&(yield`${x}.length >= ${T.minLength}`),T.pattern!==void 0&&(yield`${_e(`${new RegExp(T.pattern)};`)}.test(${x})`),T.format!==void 0&&(yield`format('${T.format}', ${x})`)}function*N(T,le,x){yield`(typeof ${x} === 'symbol')`}function*E(T,le,x){yield`(typeof ${x} === 'string')`,yield`${_e(`${new RegExp(T.pattern)};`)}.test(${x})`}function*h(T,le,x){yield`${me(T.$ref)}(${x})`}function*S(T,le,x){if(yield`Array.isArray(${x})`,T.items===void 0)return yield`${x}.length === 0`;yield`(${x}.length === ${T.maxItems})`;for(let ge=0;ge<T.items.length;ge++)yield`${re(T.items[ge],le,`${x}[${ge}]`)}`}function*_(T,le,x){yield`${x} === undefined`}function*u(T,le,x){yield`(${T.anyOf.map(oe=>re(oe,le,x)).join(" || ")})`}function*A(T,le,x){yield`${x} instanceof Uint8Array`,(0,r.IsNumber)(T.maxByteLength)&&(yield`(${x}.length <= ${T.maxByteLength})`),(0,r.IsNumber)(T.minByteLength)&&(yield`(${x}.length >= ${T.minByteLength})`)}function*v(T,le,x){yield"true"}function*b(T,le,x){yield te.IsVoidLike(x)}function*$(T,le,x){let ge=X.instances.size;X.instances.set(ge,T),yield`kind('${T[a.Kind]}', ${ge}, ${x})`}function*V(T,le,x,ge=!0){let oe=(0,r.IsString)(T.$id)?[...le,T]:le,pe=T;if(ge&&(0,r.IsString)(T.$id)){let Ee=me(T.$id);if(X.functions.has(Ee))return yield`${Ee}(${x})`;{let Me=Pe(Ee,T,le,"value",!1);return X.functions.set(Ee,Me),yield`${Ee}(${x})`}}switch(pe[a.Kind]){case"Any":return yield*Y(pe,oe,x);case"Array":return yield*ie(pe,oe,x);case"AsyncIterator":return yield*F(pe,oe,x);case"BigInt":return yield*se(pe,oe,x);case"Boolean":return yield*K(pe,oe,x);case"Constructor":return yield*ye(pe,oe,x);case"Date":return yield*D(pe,oe,x);case"Function":return yield*U(pe,oe,x);case"Integer":return yield*k(pe,oe,x);case"Intersect":return yield*ee(pe,oe,x);case"Iterator":return yield*Q(pe,oe,x);case"Literal":return yield*O(pe,oe,x);case"Never":return yield*q(pe,oe,x);case"Not":return yield*ne(pe,oe,x);case"Null":return yield*G(pe,oe,x);case"Number":return yield*J(pe,oe,x);case"Object":return yield*de(pe,oe,x);case"Promise":return yield*l(pe,oe,x);case"Record":return yield*w(pe,oe,x);case"Ref":return yield*I(pe,oe,x);case"String":return yield*P(pe,oe,x);case"Symbol":return yield*N(pe,oe,x);case"TemplateLiteral":return yield*E(pe,oe,x);case"This":return yield*h(pe,oe,x);case"Tuple":return yield*S(pe,oe,x);case"Undefined":return yield*_(pe,oe,x);case"Union":return yield*u(pe,oe,x);case"Uint8Array":return yield*A(pe,oe,x);case"Unknown":return yield*v(pe,oe,x);case"Void":return yield*b(pe,oe,x);default:if(!a.TypeRegistry.Has(pe[a.Kind]))throw new R(T);return yield*$(pe,oe,x)}}let X={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function re(T,le,x,ge=!0){return`(${[...V(T,le,x,ge)].join(" && ")})`}function me(T){return`check_${g.Encode(T)}`}function _e(T){let le=`local_${X.variables.size}`;return X.variables.set(le,`const ${le} = ${T}`),le}function Pe(T,le,x,ge,oe=!0){let[pe,Ee]=[`
21
+ `,Ze=>"".padStart(Ze," ")],Me=je("value","any"),Xe=Er("boolean"),We=[...V(le,x,ge,oe)].map(Ze=>`${Ee(4)}${Ze}`).join(` &&${pe}`);return`function ${T}(${Me})${Xe} {${pe}${Ee(2)}return (${pe}${We}${pe}${Ee(2)})
22
+ }`}function je(T,le){let x=X.language==="typescript"?`: ${le}`:"";return`${T}${x}`}function Er(T){return X.language==="typescript"?`: ${T}`:""}function we(T,le,x){let ge=Pe("check",T,le,"value"),oe=je("value","any"),pe=Er("boolean"),Ee=[...X.functions.values()],Me=[...X.variables.values()],Xe=(0,r.IsString)(T.$id)?`return function check(${oe})${pe} {
23
+ return ${me(T.$id)}(value)
24
+ }`:`return ${ge}`;return[...Me,...Ee,Xe].join(`
25
+ `)}function or(...T){let le={language:"javascript"},[x,ge,oe]=T.length===2&&(0,r.IsArray)(T[1])?[T[0],T[1],le]:T.length===2&&!(0,r.IsArray)(T[1])?[T[0],[],T[1]]:T.length===3?[T[0],T[1],T[2]]:T.length===1?[T[0],[],le]:[null,[],le];if(X.language=oe.language,X.variables.clear(),X.functions.clear(),X.instances.clear(),!a.TypeGuard.TSchema(x))throw new j(x);for(let pe of ge)if(!a.TypeGuard.TSchema(pe))throw new j(pe);return we(x,ge,oe)}B.Code=or;function Sr(T,le=[]){let x=or(T,le,{language:"javascript"}),ge=globalThis.Function("kind","format","hash",x),oe=new Map(X.instances);function pe(We,Ze,Jt){if(!a.TypeRegistry.Has(We)||!oe.has(Ze))return!1;let rn=a.TypeRegistry.Get(We),nn=oe.get(Ze);return rn(nn,Jt)}function Ee(We,Ze){return a.FormatRegistry.Has(We)?a.FormatRegistry.Get(We)(Ze):!1}function Me(We){return(0,o.Hash)(We)}let Xe=ge(pe,Ee,Me);return new f(T,le,Xe,x)}B.Compile=Sr})(W||(e.TypeCompiler=W={}))}}),xg=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var f=Object.getOwnPropertyDescriptor(s,o);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,f)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorIterator=e.ValueErrorType=void 0;var n=Ag();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return n.ValueErrorIterator}}),r(Sg(),e)}}),Ng={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,r){return"Cannot apply '"+t+"' to '"+r.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(t,r){return"[mobx.array] Index out of bounds, "+t+" is larger than "+r},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(t){return"Cannot initialize from classes that inherit from Map: "+t.constructor.name},20:function(t){return"Cannot initialize map from "+t},21:function(t){return"Cannot convert to map from '"+t+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(t){return"Cannot obtain administration from "+t},25:function(t,r){return"the entry '"+t+"' does not exist in the observable map '"+r+"'"},26:"please specify a property",27:function(t,r){return"no observable property '"+t.toString()+"' found on the observable object '"+r+"'"},28:function(t){return"Cannot obtain atom from "+t},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(t,r){return"Cycle detected in computation "+t+": "+r},33:function(t){return"The setter of computed value '"+t+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(t){return"[ComputedValue '"+t+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(t){return"[mobx] `observableArray."+t+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+t+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},$g=Ng;function fe(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=typeof e=="string"?e:$g[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}var Cg={};function $a(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Cg}var bl=Object.assign,Ao=Object.getOwnPropertyDescriptor,Vt=Object.defineProperty,gi=Object.prototype,Io=[];Object.freeze(Io);var Ca={};Object.freeze(Ca);var Pg=typeof Proxy<"u",Rg=Object.toString();function vl(){Pg||fe("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function ri(e){H.verifyProxies&&fe("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function St(){return++H.mobxGuid}function Pa(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var bn=function(){};function De(e){return typeof e=="function"}function Vr(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Fo(e){return e!==null&&typeof e=="object"}function kt(e){if(!Fo(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===Rg}function _l(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Vo(e,t,r){Vt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function wl(e,t,r){Vt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function Ar(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Fo(n)&&n[r]===!0}}function In(e){return e instanceof Map}function bi(e){return e instanceof Set}var Tl=typeof Object.getOwnPropertySymbols<"u";function Ug(e){var t=Object.keys(e);if(!Tl)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return gi.propertyIsEnumerable.call(e,n)})):t}var Ko=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Tl?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function ca(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Ol(e){return e===null?null:typeof e=="object"?""+e:e}function It(e,t){return gi.hasOwnProperty.call(e,t)}var Bg=Object.getOwnPropertyDescriptors||function(t){var r={};return Ko(t).forEach(function(n){r[n]=Ao(t,n)}),r};function Of(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Dg(n.key),n)}}function Ra(e,t,r){return t&&Of(e.prototype,t),r&&Of(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rr(){return rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rr.apply(this,arguments)}function Al(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,fa(e,t)}function fa(e,t){return fa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fa(e,t)}function bo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kg(e,t){if(e){if(typeof e=="string")return Af(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Af(e,t)}}function Af(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vn(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=kg(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mg(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dg(e){var t=Mg(e,"string");return typeof t=="symbol"?t:String(t)}var rt=Symbol("mobx-stored-annotations");function Kt(e){function t(r,n){if(vi(n))return e.decorate_20223_(r,n);En(r,n,e)}return Object.assign(t,e)}function En(e,t,r){if(It(e,rt)||Vo(e,rt,rr({},e[rt])),Eo(r)&&!It(e[rt],t)){var n=e.constructor.name+".prototype."+t.toString();fe("'"+n+"' is decorated with 'override', but no such decorated member was found on prototype.")}jg(e,r,t),Eo(r)||(e[rt][t]=r)}function jg(e,t,r){if(!Eo(t)&&It(e[rt],r)){var n=e.constructor.name+".prototype."+r.toString(),i=e[rt][r].annotationType_,s=t.annotationType_;fe("Cannot apply '@"+s+"' to '"+n+"':"+(`
27
+ The field is already decorated with '@`+i+"'.")+`
28
+ Re-decorating fields is not allowed.
29
+ Use '@override' decorator for methods overridden by subclass.`)}}function Lg(e){return It(e,rt)||Vo(e,rt,rr({},e[rt])),e[rt]}function vi(e){return typeof e=="object"&&typeof e.kind=="string"}function zo(e,t){t.includes(e.kind)||fe("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var be=Symbol("mobx administration"),_i=function(){function e(r){r===void 0&&(r="Atom@"+St()),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ie.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return Vl(this)},t.reportChanged=function(){Tt(),Kl(this),Ot()},t.toString=function(){return this.name_},e}(),Ua=Ar("Atom",_i);function Il(e,t,r){t===void 0&&(t=bn),r===void 0&&(r=bn);var n=new _i(e);return t!==bn&&Ql(n,t),r!==bn&&Oi(n,r),n}function Fg(e,t){return e===t}function Vg(e,t){return Fa(e,t)}function Kg(e,t){return Fa(e,t,1)}function zg(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var nt={identity:Fg,structural:Vg,default:zg,shallow:Kg};function Kr(e,t,r){return Tn(e)?e:Array.isArray(e)?ke.array(e,{name:r}):kt(e)?ke.object(e,void 0,{name:r}):In(e)?ke.map(e,{name:r}):bi(e)?ke.set(e,{name:r}):typeof e=="function"&&!Sn(e)&&!ci(e)?_l(e)?wn(e):ui(r,e):e}function qg(e,t,r){if(e==null||Hr(e)||Nn(e)||Wt(e)||Yr(e))return e;if(Array.isArray(e))return ke.array(e,{name:r,deep:!1});if(kt(e))return ke.object(e,void 0,{name:r,deep:!1});if(In(e))return ke.map(e,{name:r,deep:!1});if(bi(e))return ke.set(e,{name:r,deep:!1});fe("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function qo(e){return e}function Gg(e,t){return Tn(e)&&fe("observable.struct should not be used with observable values"),Fa(e,t)?t:e}var Hg="override";function Eo(e){return e.annotationType_===Hg}function wi(e,t){return{annotationType_:e,options_:t,make_:Wg,extend_:Jg,decorate_20223_:Xg}}function Wg(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(Sn(r.value))return 1;var s=El(e,this,t,r,!1);return Vt(n,t,s),2}function Jg(e,t,r,n){var i=El(e,this,t,r);return e.defineProperty_(t,i,n)}function Xg(e,t){zo(t,["method","field"]);var r=t.kind,n=t.name,i=t.addInitializer,s=this,o=function(c){var y,g,M,R;return zr((y=(g=s.options_)==null?void 0:g.name)!=null?y:n.toString(),c,(M=(R=s.options_)==null?void 0:R.autoAction)!=null?M:!1)};if(r=="field"){i(function(){En(this,n,s)});return}if(r=="method"){var a;return Sn(e)||(e=o(e)),(a=this.options_)!=null&&a.bound&&i(function(){var f=this,c=f[n].bind(f);c.isMobxAction=!0,f[n]=c}),e}fe("Cannot apply '"+s.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
30
+ '`+s.annotationType_+"' can only be used on properties with a function value."))}function Yg(e,t,r,n){var i=t.annotationType_,s=n.value;De(s)||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
31
+ '`+i+"' can only be used on properties with a function value."))}function El(e,t,r,n,i){var s,o,a,f,c,y,g;i===void 0&&(i=H.safeDescriptors),Yg(e,t,r,n);var M=n.value;if((s=t.options_)!=null&&s.bound){var R;M=M.bind((R=e.proxy_)!=null?R:e.target_)}return{value:zr((o=(a=t.options_)==null?void 0:a.name)!=null?o:r.toString(),M,(f=(c=t.options_)==null?void 0:c.autoAction)!=null?f:!1,(y=t.options_)!=null&&y.bound?(g=e.proxy_)!=null?g:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Sl(e,t){return{annotationType_:e,options_:t,make_:Qg,extend_:Zg,decorate_20223_:eb}}function Qg(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!It(e.target_,t)||!ci(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(ci(r.value))return 1;var s=xl(e,this,t,r,!1,!1);return Vt(n,t,s),2}function Zg(e,t,r,n){var i,s=xl(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,s,n)}function eb(e,t){var r;zo(t,["method"]);var n=t.name,i=t.addInitializer;return ci(e)||(e=wn(e)),(r=this.options_)!=null&&r.bound&&i(function(){var s=this,o=s[n].bind(s);o.isMobXFlow=!0,s[n]=o}),e}function tb(e,t,r,n){var i=t.annotationType_,s=n.value;De(s)||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
32
+ '`+i+"' can only be used on properties with a generator function value."))}function xl(e,t,r,n,i,s){s===void 0&&(s=H.safeDescriptors),tb(e,t,r,n);var o=n.value;if(ci(o)||(o=wn(o)),i){var a;o=o.bind((a=e.proxy_)!=null?a:e.target_),o.isMobXFlow=!0}return{value:o,configurable:s?e.isPlainObject_:!0,enumerable:!1,writable:!s}}function Ba(e,t){return{annotationType_:e,options_:t,make_:rb,extend_:nb,decorate_20223_:ib}}function rb(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function nb(e,t,r,n){return ob(e,this,t,r),e.defineComputedProperty_(t,rr({},this.options_,{get:r.get,set:r.set}),n)}function ib(e,t){zo(t,["getter"]);var r=this,n=t.name,i=t.addInitializer;return i(function(){var s=$n(this)[be],o=rr({},r.options_,{get:e,context:this});o.name||(o.name=s.name_+"."+n.toString()),s.values_.set(n,new qr(o))}),function(){return this[be].getObservablePropValue_(n)}}function ob(e,t,r,n){var i=t.annotationType_,s=n.get;s||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
33
+ '`+i+"' can only be used on getter(+setter) properties."))}function Go(e,t){return{annotationType_:e,options_:t,make_:sb,extend_:ab,decorate_20223_:ub}}function sb(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function ab(e,t,r,n){var i,s;return cb(e,this,t,r),e.defineObservableProperty_(t,r.value,(i=(s=this.options_)==null?void 0:s.enhancer)!=null?i:Kr,n)}function ub(e,t){if(t.kind==="field")throw fe("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");zo(t,["accessor"]);var r=this,n=t.kind,i=t.name,s=new WeakSet;function o(a,f){var c,y,g=$n(a)[be],M=new wr(f,(c=(y=r.options_)==null?void 0:y.enhancer)!=null?c:Kr,g.name_+"."+i.toString(),!1);g.values_.set(i,M),s.add(a)}if(n=="accessor")return{get:function(){return s.has(this)||o(this,e.get.call(this)),this[be].getObservablePropValue_(i)},set:function(f){return s.has(this)||o(this,f),this[be].setObservablePropValue_(i,f)},init:function(f){return s.has(this)||o(this,f),f}}}function cb(e,t,r,n){var i=t.annotationType_;"value"in n||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
34
+ '`+i+"' cannot be used on getter/setter properties"))}var fb="true",lb=Nl();function Nl(e){return{annotationType_:fb,options_:e,make_:db,extend_:pb,decorate_20223_:yb}}function db(e,t,r,n){var i,s;if(r.get)return Ge.make_(e,t,r,n);if(r.set){var o=zr(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:H.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Vt(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var a;if(_l(r.value)){var f,c=(f=this.options_)!=null&&f.autoBind?wn.bound:wn;return c.make_(e,t,r,n)}var y=(a=this.options_)!=null&&a.autoBind?ui.bound:ui;return y.make_(e,t,r,n)}var g=((i=this.options_)==null?void 0:i.deep)===!1?ke.ref:ke;if(typeof r.value=="function"&&(s=this.options_)!=null&&s.autoBind){var M;r.value=r.value.bind((M=e.proxy_)!=null?M:e.target_)}return g.make_(e,t,r,n)}function pb(e,t,r,n){var i,s;if(r.get)return Ge.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:H.safeDescriptors?e.isPlainObject_:!0,set:zr(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var a=((s=this.options_)==null?void 0:s.deep)===!1?ke.ref:ke;return a.extend_(e,t,r,n)}function yb(e,t){fe("'"+this.annotationType_+"' cannot be used as a decorator")}var hb="observable",mb="observable.ref",gb="observable.shallow",bb="observable.struct",$l={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze($l);function po(e){return e||$l}var la=Go(hb),vb=Go(mb,{enhancer:qo}),_b=Go(gb,{enhancer:qg}),wb=Go(bb,{enhancer:Gg}),Cl=Kt(la);function yo(e){return e.deep===!0?Kr:e.deep===!1?qo:Ob(e.defaultDecorator)}function Tb(e){var t;return e?(t=e.defaultDecorator)!=null?t:Nl(e):void 0}function Ob(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Kr}function Pl(e,t,r){if(vi(t))return la.decorate_20223_(e,t);if(Vr(t)){En(e,t,la);return}return Tn(e)?e:kt(e)?ke.object(e,t,r):Array.isArray(e)?ke.array(e,t):In(e)?ke.map(e,t):bi(e)?ke.set(e,t):typeof e=="object"&&e!==null?e:ke.box(e,t)}bl(Pl,Cl);var Ab={box:function(t,r){var n=po(r);return new wr(t,yo(n),n.name,!0,n.equals)},array:function(t,r){var n=po(r);return(H.useProxies===!1||n.proxy===!1?Nv:vv)(t,yo(n),n.name)},map:function(t,r){var n=po(r);return new ad(t,yo(n),n.name)},set:function(t,r){var n=po(r);return new fd(t,yo(n),n.name)},object:function(t,r,n){return Qr(function(){return av(H.useProxies===!1||n?.proxy===!1?$n({},n):mv({},n),t,r)})},ref:Kt(vb),shallow:Kt(_b),deep:Cl,struct:Kt(wb)},ke=bl(Pl,Ab),Rl="computed",Ib="computed.struct",da=Ba(Rl),Eb=Ba(Ib,{equals:nt.structural}),Ge=function(t,r){if(vi(r))return da.decorate_20223_(t,r);if(Vr(r))return En(t,r,da);if(kt(t))return Kt(Ba(Rl,t));De(t)||fe("First argument to `computed` should be an expression."),De(r)&&fe("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var n=kt(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new qr(n)};Object.assign(Ge,da);Ge.struct=Kt(Eb);var If,Ef,So=0,Sb=1,xb=(If=(Ef=Ao(function(){},"name"))==null?void 0:Ef.configurable)!=null?If:!1,Sf={value:"action",configurable:!0,writable:!1,enumerable:!1};function zr(e,t,r,n){r===void 0&&(r=!1),De(t)||fe("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&fe("actions should have valid names, got: '"+e+"'");function i(){return Ul(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},xb&&(Sf.value=e,Vt(i,"name",Sf)),i}function Ul(e,t,r,n,i){var s=Nb(e,t,n,i);try{return r.apply(n,i)}catch(o){throw s.error_=o,o}finally{$b(s)}}function Nb(e,t,r,n){var i=He()&&!!e,s=0;if(i){s=Date.now();var o=n?Array.from(n):Io;dt({type:Ma,name:e,object:r,arguments:o})}var a=H.trackingDerivation,f=!t||!a;Tt();var c=H.allowStateChanges;f&&(Xr(),c=Ho(!0));var y=ka(!0),g={runAsAction_:f,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:y,notifySpy_:i,startTime_:s,actionId_:Sb++,parentActionId_:So};return So=g.actionId_,g}function $b(e){So!==e.actionId_&&fe(30),So=e.parentActionId_,e.error_!==void 0&&(H.suppressReactionErrors=!0),Wo(e.prevAllowStateChanges_),ii(e.prevAllowStateReads_),Ot(),e.runAsAction_&&tr(e.prevDerivation_),e.notifySpy_&&pt({time:Date.now()-e.startTime_}),H.suppressReactionErrors=!1}function Cb(e,t){var r=Ho(e);try{return t()}finally{Wo(r)}}function Ho(e){var t=H.allowStateChanges;return H.allowStateChanges=e,t}function Wo(e){H.allowStateChanges=e}var Bl,Pb="create";Bl=Symbol.toPrimitive;var wr=function(e){Al(t,e);function t(n,i,s,o,a){var f;return s===void 0&&(s="ObservableValue@"+St()),o===void 0&&(o=!0),a===void 0&&(a=nt.default),f=e.call(this,s)||this,f.enhancer=void 0,f.name_=void 0,f.equals=void 0,f.hasUnreportedChange_=!1,f.interceptors_=void 0,f.changeListeners_=void 0,f.value_=void 0,f.dehancer=void 0,f.enhancer=i,f.name_=s,f.equals=a,f.value_=i(n,void 0,s),o&&He()&&Gr({type:Pb,object:bo(f),observableKind:"value",debugObjectName:f.name_,newValue:""+f.value_}),f}var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){var s=this.value_;if(i=this.prepareNewValue_(i),i!==H.UNCHANGED){var o=He();o&&dt({type:Rt,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:s}),this.setNewValue_(i),o&&pt()}},r.prepareNewValue_=function(i){if(Ft(this),_t(this)){var s=wt(this,{object:this,type:Rt,newValue:i});if(!s)return H.UNCHANGED;i=s.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?H.UNCHANGED:i},r.setNewValue_=function(i){var s=this.value_;this.value_=i,this.reportChanged(),Ut(this)&&Bt(this,{type:Rt,object:this,newValue:i,oldValue:s})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Ii(this,i)},r.observe_=function(i,s){return s&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Rt,newValue:this.value_,oldValue:void 0}),Ei(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Ol(this.get())},r[Bl]=function(){return this.valueOf()},t}(_i),Rb=Ar("ObservableValue",wr),kl;kl=Symbol.toPrimitive;var qr=function(){function e(r){this.dependenciesState_=Ie.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ie.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new xo(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Et.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||fe(31),this.derivation=r.get,this.name_=r.name||"ComputedValue@"+St(),r.set&&(this.setter_=zr(this.name_+"-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?nt.structural:nt.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){zb(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing_&&fe(32,this.name_,this.derivation),H.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)pa(this)&&(this.warnAboutUntrackedRead_(),Tt(),this.value_=this.computeValue_(!1),Ot());else if(Vl(this),pa(this)){var n=H.trackingContext;this.keepAlive_&&!n&&(H.trackingContext=this),this.trackAndCompute()&&Kb(this),H.trackingContext=n}var i=this.value_;if(vo(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter_&&fe(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter_=!1}}else fe(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===Ie.NOT_TRACKING_,s=this.computeValue_(!0),o=i||vo(n)||vo(s)||!this.equals_(n,s);return o&&(this.value_=s,He()&&Gr({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:n,newValue:s})),o},t.computeValue_=function(n){this.isComputing_=!0;var i=Ho(!1),s;if(n)s=Ml(this,this.derivation,this.scope_);else if(H.disableErrorBoundaries===!0)s=this.derivation.call(this.scope_);else try{s=this.derivation.call(this.scope_)}catch(o){s=new xo(o)}return Wo(i),this.isComputing_=!1,s},t.suspend_=function(){this.keepAlive_||(ya(this),this.value_=void 0,this.isTracing_!==Et.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(n,i){var s=this,o=!0,a=void 0;return zt(function(){var f=s.get();if(!o||i){var c=Xr();n({observableKind:"computed",debugObjectName:s.name_,type:Rt,object:s,newValue:f,oldValue:a}),tr(c)}o=!1,a=f})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==Et.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:H.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute.")},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Ol(this.get())},t[kl]=function(){return this.valueOf()},e}(),Ti=Ar("ComputedValue",qr),Ie;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Ie||(Ie={}));var Et;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Et||(Et={}));var xo=function(t){this.cause=void 0,this.cause=t};function vo(e){return e instanceof xo}function pa(e){switch(e.dependenciesState_){case Ie.UP_TO_DATE_:return!1;case Ie.NOT_TRACKING_:case Ie.STALE_:return!0;case Ie.POSSIBLY_STALE_:{for(var t=ka(!0),r=Xr(),n=e.observing_,i=n.length,s=0;s<i;s++){var o=n[s];if(Ti(o)){if(H.disableErrorBoundaries)o.get();else try{o.get()}catch{return tr(r),ii(t),!0}if(e.dependenciesState_===Ie.STALE_)return tr(r),ii(t),!0}}return Dl(e),tr(r),ii(t),!1}}}function Ub(){return H.trackingDerivation!==null}function Ft(e){var t=e.observers_.size>0;!H.allowStateChanges&&(t||H.enforceActions==="always")&&console.warn("[MobX] "+(H.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}function Bb(e){!H.allowStateReads&&H.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Ml(e,t,r){var n=ka(!0);Dl(e),e.newObserving_=new Array(e.observing_.length+100),e.unboundDepsCount_=0,e.runId_=++H.runId;var i=H.trackingDerivation;H.trackingDerivation=e,H.inBatch++;var s;if(H.disableErrorBoundaries===!0)s=t.call(r);else try{s=t.call(r)}catch(o){s=new xo(o)}return H.inBatch--,H.trackingDerivation=i,Mb(e),kb(e),ii(n),s}function kb(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:H.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function Mb(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=Ie.UP_TO_DATE_,i=0,s=e.unboundDepsCount_,o=0;o<s;o++){var a=r[o];a.diffValue_===0&&(a.diffValue_=1,i!==o&&(r[i]=a),i++),a.dependenciesState_>n&&(n=a.dependenciesState_)}for(r.length=i,e.newObserving_=null,s=t.length;s--;){var f=t[s];f.diffValue_===0&&Ll(f,e),f.diffValue_=0}for(;i--;){var c=r[i];c.diffValue_===1&&(c.diffValue_=0,Vb(c,e))}n!==Ie.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function ya(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)Ll(t[r],e);e.dependenciesState_=Ie.NOT_TRACKING_}function Be(e){var t=Xr();try{return e()}finally{tr(t)}}function Xr(){var e=H.trackingDerivation;return H.trackingDerivation=null,e}function tr(e){H.trackingDerivation=e}function ka(e){var t=H.allowStateReads;return H.allowStateReads=e,t}function ii(e){H.allowStateReads=e}function Dl(e){if(e.dependenciesState_!==Ie.UP_TO_DATE_){e.dependenciesState_=Ie.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Ie.UP_TO_DATE_}}var _o=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},wo=!0,jl=!1,H=function(){var e=$a();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(wo=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new _o().version&&(wo=!1),wo?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new _o):(setTimeout(function(){jl||fe(35)},1),new _o)}();function Db(){if((H.pendingReactions.length||H.inBatch||H.isRunningReactions)&&fe(36),jl=!0,wo){var e=$a();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),H=new _o}}function jb(){return H}function Lb(e){return e.observers_&&e.observers_.size>0}function Fb(e){return e.observers_}function Vb(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Ll(e,t){e.observers_.delete(t),e.observers_.size===0&&Fl(e)}function Fl(e){e.isPendingUnobservation_===!1&&(e.isPendingUnobservation_=!0,H.pendingUnobservations.push(e))}function Tt(){H.inBatch++}function Ot(){if(--H.inBatch===0){Gl();for(var e=H.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation_=!1,r.observers_.size===0&&(r.isBeingObserved_&&(r.isBeingObserved_=!1,r.onBUO()),r instanceof qr&&r.suspend_())}H.pendingUnobservations=[]}}function Vl(e){Bb(e);var t=H.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved_&&H.trackingContext&&(e.isBeingObserved_=!0,e.onBO())),e.isBeingObserved_):(e.observers_.size===0&&H.inBatch>0&&Fl(e),!1)}function Kl(e){e.lowestObserverState_!==Ie.STALE_&&(e.lowestObserverState_=Ie.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ie.UP_TO_DATE_&&(t.isTracing_!==Et.NONE&&zl(t,e),t.onBecomeStale_()),t.dependenciesState_=Ie.STALE_}))}function Kb(e){e.lowestObserverState_!==Ie.STALE_&&(e.lowestObserverState_=Ie.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ie.POSSIBLY_STALE_?(t.dependenciesState_=Ie.STALE_,t.isTracing_!==Et.NONE&&zl(t,e)):t.dependenciesState_===Ie.UP_TO_DATE_&&(e.lowestObserverState_=Ie.UP_TO_DATE_)}))}function zb(e){e.lowestObserverState_===Ie.UP_TO_DATE_&&(e.lowestObserverState_=Ie.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ie.UP_TO_DATE_&&(t.dependenciesState_=Ie.POSSIBLY_STALE_,t.onBecomeStale_())}))}function zl(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===Et.BREAK){var r=[];ql(Ai(e),r,1),new Function(`debugger;
35
+ /*
36
+ Tracing '`+e.name_+`'
37
+
38
+ You are entering this break point because derivation '`+e.name_+"' is being traced and '"+t.name_+`' is now forcing it to update.
39
+ Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
40
+ The stackframe you are looking for is at least ~6-8 stack-frames up.
41
+
42
+ `+(e instanceof qr?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
43
+
44
+ The dependencies for this derivation are:
45
+
46
+ `+r.join(`
47
+ `)+`
48
+ */
49
+ `)()}}function ql(e,t,r){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(r-1)+e.name),e.dependencies&&e.dependencies.forEach(function(n){return ql(n,t,r+1)})}var ai=function(){function e(r,n,i,s){r===void 0&&(r="Reaction@"+St()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Ie.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=Et.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=s}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,H.pendingReactions.push(this),Gl())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){Tt(),this.isScheduled_=!1;var n=H.trackingContext;if(H.trackingContext=this,pa(this)){this.isTrackPending_=!0;try{this.onInvalidate_(),this.isTrackPending_&&He()&&Gr({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}H.trackingContext=n,Ot()}},t.track=function(n){if(!this.isDisposed_){Tt();var i=He(),s;i&&(s=Date.now(),dt({name:this.name_,type:"reaction"})),this.isRunning_=!0;var o=H.trackingContext;H.trackingContext=this;var a=Ml(this,n,void 0);H.trackingContext=o,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&ya(this),vo(a)&&this.reportExceptionInDerivation_(a.cause),i&&pt({time:Date.now()-s}),Ot()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(H.disableErrorBoundaries)throw n;var s="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";H.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(s,n),He()&&Gr({type:"error",name:this.name_,message:s,error:""+n}),H.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(Tt(),ya(this),Ot()))},t.getDisposer_=function(n){var i=this,s=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",s),s[be]=this,s},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){n===void 0&&(n=!1),nd(this,n)},e}(),xf=100,ha=function(t){return t()};function Gl(){H.inBatch>0||H.isRunningReactions||ha(qb)}function qb(){H.isRunningReactions=!0;for(var e=H.pendingReactions,t=0;e.length>0;){++t===xf&&(console.error("Reaction doesn't converge to a stable state after "+xf+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}H.isRunningReactions=!1}var No=Ar("Reaction",ai);function Gb(e){var t=ha;ha=function(n){return e(function(){return t(n)})}}function He(){return!!H.spyListeners.length}function Gr(e){if(H.spyListeners.length)for(var t=H.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function dt(e){var t=rr({},e,{spyReportStart:!0});Gr(t)}var Hb={type:"report-end",spyReportEnd:!0};function pt(e){Gr(e?rr({},e,{type:"report-end",spyReportEnd:!0}):Hb)}function Hl(e){return H.spyListeners.push(e),Pa(function(){H.spyListeners=H.spyListeners.filter(function(t){return t!==e})})}var Ma="action",Wb="action.bound",Wl="autoAction",Jb="autoAction.bound",Jl="<unnamed action>",ma=wi(Ma),Xb=wi(Wb,{bound:!0}),ga=wi(Wl,{autoAction:!0}),Yb=wi(Jb,{autoAction:!0,bound:!0});function Xl(e){var t=function(n,i){if(De(n))return zr(n.name||Jl,n,e);if(De(i))return zr(n,i,e);if(vi(i))return(e?ga:ma).decorate_20223_(n,i);if(Vr(i))return En(n,i,e?ga:ma);if(Vr(n))return Kt(wi(e?Wl:Ma,{name:n,autoAction:e}));fe("Invalid arguments for `action`")};return t}var At=Xl(!1);Object.assign(At,ma);var ui=Xl(!0);Object.assign(ui,ga);At.bound=Kt(Xb);ui.bound=Kt(Yb);function Qb(e){return Ul(e.name||Jl,!1,e,this,void 0)}function Sn(e){return De(e)&&e.isMobxAction===!0}function zt(e,t){var r,n,i,s,o;t===void 0&&(t=Ca),De(e)||fe("Autorun expects a function as first argument"),Sn(e)&&fe("Autorun does not accept actions since actions are untrackable");var a=(r=(n=t)==null?void 0:n.name)!=null?r:e.name||"Autorun@"+St(),f=!t.scheduler&&!t.delay,c;if(f)c=new ai(a,function(){this.track(M)},t.onError,t.requiresObservable);else{var y=Yl(t),g=!1;c=new ai(a,function(){g||(g=!0,y(function(){g=!1,c.isDisposed_||c.track(M)}))},t.onError,t.requiresObservable)}function M(){e(c)}return(i=t)!=null&&(s=i.signal)!=null&&s.aborted||c.schedule_(),c.getDisposer_((o=t)==null?void 0:o.signal)}var Zb=function(t){return t()};function Yl(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Zb}function ev(e,t,r){var n,i,s,o;r===void 0&&(r=Ca),(!De(e)||!De(t))&&fe("First and second argument to reaction should be functions"),kt(r)||fe("Third argument of reactions should be an object");var a=(n=r.name)!=null?n:"Reaction@"+St(),f=At(a,r.onError?tv(r.onError,t):t),c=!r.scheduler&&!r.delay,y=Yl(r),g=!0,M=!1,R,j,te=r.compareStructural?nt.structural:r.equals||nt.default,W=new ai(a,function(){g||c?B():M||(M=!0,y(B))},r.onError,r.requiresObservable);function B(){if(M=!1,!W.isDisposed_){var z=!1;W.track(function(){var Y=Cb(!1,function(){return e(W)});z=g||!te(R,Y),j=R,R=Y}),(g&&r.fireImmediately||!g&&z)&&f(R,j,W),g=!1}}return(i=r)!=null&&(s=i.signal)!=null&&s.aborted||W.schedule_(),W.getDisposer_((o=r)==null?void 0:o.signal)}function tv(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var rv="onBO",nv="onBUO";function Ql(e,t,r){return Zl(rv,e,t,r)}function Oi(e,t,r){return Zl(nv,e,t,r)}function Zl(e,t,r,n){var i=typeof n=="function"?qt(t,r):qt(t),s=De(n)?n:r,o=e+"L";return i[o]?i[o].add(s):i[o]=new Set([s]),function(){var a=i[o];a&&(a.delete(s),a.size===0&&delete i[o])}}var iv="never",ho="always",ov="observed";function sv(e){e.isolateGlobalState===!0&&Db();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(H.useProxies=t===ho?!0:t===iv?!1:typeof Proxy<"u"),t==="ifavailable"&&(H.verifyProxies=!0),r!==void 0){var n=r===ho?ho:r===ov;H.enforceActions=n,H.allowStateChanges=!(n===!0||n===ho)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(H[i]=!!e[i])}),H.allowStateReads=!H.observableRequiresReaction,H.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&Gb(e.reactionScheduler)}function av(e,t,r,n){arguments.length>4&&fe("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&fe("'extendObservable' expects an object as first argument"),Wt(e)&&fe("'extendObservable' should not be used on maps, use map.merge instead"),kt(t)||fe("'extendObservable' only accepts plain objects as second argument"),(Tn(t)||Tn(r))&&fe("Extending an object with another observable (object) is not supported");var i=Bg(t);return Qr(function(){var s=$n(e,n)[be];Ko(i).forEach(function(o){s.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function Ai(e,t){return ed(qt(e,t))}function ed(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=cv(e.observing_).map(ed)),t}function uv(e,t){return td(qt(e,t))}function td(e){var t={name:e.name_};return Lb(e)&&(t.observers=Array.from(Fb(e)).map(td)),t}function cv(e){return Array.from(new Set(e))}var fv=0;function rd(){this.message="FLOW_CANCELLED"}rd.prototype=Object.create(Error.prototype);var ra=Sl("flow"),lv=Sl("flow.bound",{bound:!0}),wn=Object.assign(function(t,r){if(vi(r))return ra.decorate_20223_(t,r);if(Vr(r))return En(t,r,ra);arguments.length!==1&&fe("Flow expects single argument with generator function");var n=t,i=n.name||"<unnamed flow>",s=function(){var a=this,f=arguments,c=++fv,y=At(i+" - runid: "+c+" - init",n).apply(a,f),g,M=void 0,R=new Promise(function(j,te){var W=0;g=te;function B(ie){M=void 0;var F;try{F=At(i+" - runid: "+c+" - yield "+W++,y.next).call(y,ie)}catch(se){return te(se)}Y(F)}function z(ie){M=void 0;var F;try{F=At(i+" - runid: "+c+" - yield "+W++,y.throw).call(y,ie)}catch(se){return te(se)}Y(F)}function Y(ie){if(De(ie?.then)){ie.then(Y,te);return}return ie.done?j(ie.value):(M=Promise.resolve(ie.value),M.then(B,z))}B(void 0)});return R.cancel=At(i+" - runid: "+c+" - cancel",function(){try{M&&Nf(M);var j=y.return(void 0),te=Promise.resolve(j.value);te.then(bn,bn),Nf(te),g(new rd)}catch(W){g(W)}}),R};return s.isMobXFlow=!0,s},ra);wn.bound=Kt(lv);function Nf(e){De(e.cancel)&&e.cancel()}function ci(e){return e?.isMobXFlow===!0}function dv(e,t){return e?t!==void 0?Wt(e)||Nn(e)?fe("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):Hr(e)?e[be].values_.has(t):!1:Hr(e)||!!e[be]||Ua(e)||No(e)||Ti(e):!1}function Tn(e){return arguments.length!==1&&fe("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),dv(e)}function pv(e){if(Hr(e))return e[be].ownKeys_();fe(38)}function mo(e,t,r){return e.set(t,r),r}function gn(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Tn(e))return e;if(Rb(e)||Ti(e))return gn(e.get(),t);if(t.has(e))return t.get(e);if(Nn(e)){var r=mo(t,e,new Array(e.length));return e.forEach(function(o,a){r[a]=gn(o,t)}),r}if(Yr(e)){var n=mo(t,e,new Set);return e.forEach(function(o){n.add(gn(o,t))}),n}if(Wt(e)){var i=mo(t,e,new Map);return e.forEach(function(o,a){i.set(a,gn(o,t))}),i}else{var s=mo(t,e,{});return pv(e).forEach(function(o){gi.propertyIsEnumerable.call(e,o)&&(s[o]=gn(e[o],t))}),s}}function _n(e,t){return t&&fe("toJS no longer supports options"),gn(e,new Map)}function nd(){for(var e=!1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[r.length-1]=="boolean"&&(e=r.pop());var i=yv(r);if(!i)return fe("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");i.isTracing_===Et.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?Et.BREAK:Et.LOG}function yv(e){switch(e.length){case 0:return H.trackingDerivation;case 1:return qt(e[0]);case 2:return qt(e[0],e[1])}}function Zt(e,t){t===void 0&&(t=void 0),Tt();try{return e.apply(t)}finally{Ot()}}function jr(e){return e[be]}var hv={has:function(t,r){return H.trackingDerivation&&ri("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),jr(t).has_(r)},get:function(t,r){return jr(t).get_(r)},set:function(t,r,n){var i;return Vr(r)?(jr(t).values_.has(r)||ri("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=jr(t).set_(r,n,!0))!=null?i:!0):!1},deleteProperty:function(t,r){var n;return ri("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Vr(r)?(n=jr(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return ri("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=jr(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return H.trackingDerivation&&ri("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),jr(t).ownKeys_()},preventExtensions:function(t){fe(13)}};function mv(e,t){var r,n;return vl(),e=$n(e,t),(n=(r=e[be]).proxy_)!=null?n:r.proxy_=new Proxy(e,hv)}function _t(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Ii(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Pa(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function wt(e,t){var r=Xr();try{for(var n=[].concat(e.interceptors_||[]),i=0,s=n.length;i<s&&(t=n[i](t),t&&!t.type&&fe(14),!!t);i++);return t}finally{tr(r)}}function Ut(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Ei(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Pa(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Bt(e,t){var r=Xr(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,s=n.length;i<s;i++)n[i](t);tr(r)}}function xn(e,t,r){return Qr(function(){var n,i=$n(e,r)[be];t&&e[rt]&&fe("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(n=t)!=null||(t=Lg(e)),Ko(t).forEach(function(s){return i.make_(s,t[s])})}),e}var $f="splice",Rt="update",gv=1e4,bv={get:function(t,r){var n=t[be];return r===be?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):It($o,r)?$o[r]:t[r]},set:function(t,r,n){var i=t[be];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){fe(15)}},Da=function(){function e(r,n,i,s){r===void 0&&(r="ObservableArray@"+St()),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=s,this.atom_=new _i(r),this.enhancer_=function(o,a){return n(o,a,r+"[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return Ii(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Ei(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&fe("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var s=new Array(n-i),o=0;o<n-i;o++)s[o]=void 0;this.spliceWithArray_(i,0,s)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&fe(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&pd(n+i+1)},t.spliceWithArray_=function(n,i,s){var o=this;Ft(this.atom_);var a=this.values_.length;if(n===void 0?n=0:n>a?n=a:n<0&&(n=Math.max(0,a+n)),arguments.length===1?i=a-n:i==null?i=0:i=Math.max(0,Math.min(i,a-n)),s===void 0&&(s=Io),_t(this)){var f=wt(this,{object:this.proxy_,type:$f,index:n,removedCount:i,added:s});if(!f)return Io;i=f.removedCount,s=f.added}s=s.length===0?s:s.map(function(g){return o.enhancer_(g,void 0)}),this.legacyMode_;var c=s.length-i;this.updateArrayLength_(a,c);var y=this.spliceItemsIntoValues_(n,i,s);return(i!==0||s.length!==0)&&this.notifyArraySplice_(n,s,y),this.dehanceValues_(y)},t.spliceItemsIntoValues_=function(n,i,s){if(s.length<gv){var o;return(o=this.values_).splice.apply(o,[n,i].concat(s))}else{var a=this.values_.slice(n,n+i),f=this.values_.slice(n+i);this.values_.length+=s.length-i;for(var c=0;c<s.length;c++)this.values_[n+c]=s[c];for(var y=0;y<f.length;y++)this.values_[n+s.length+y]=f[y];return a}},t.notifyArrayChildUpdate_=function(n,i,s){var o=!this.owned_&&He(),a=Ut(this),f=a||o?{observableKind:"array",object:this.proxy_,type:Rt,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:s}:null;o&&dt(f),this.atom_.reportChanged(),a&&Bt(this,f),o&&pt()},t.notifyArraySplice_=function(n,i,s){var o=!this.owned_&&He(),a=Ut(this),f=a||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:$f,index:n,removed:s,added:i,removedCount:s.length,addedCount:i.length}:null;o&&dt(f),this.atom_.reportChanged(),a&&Bt(this,f),o&&pt()},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx.array] Attempt to read an array index ("+n+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX");return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var s=this.values_;if(this.legacyMode_&&n>s.length&&fe(17,n,s.length),n<s.length){Ft(this.atom_);var o=s[n];if(_t(this)){var a=wt(this,{type:Rt,object:this.proxy_,index:n,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,o);var f=i!==o;f&&(s[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var c=new Array(n+1-s.length),y=0;y<c.length-1;y++)c[y]=void 0;c[c.length-1]=i,this.spliceWithArray_(s.length,0,c)}},e}();function vv(e,t,r,n){return r===void 0&&(r="ObservableArray@"+St()),n===void 0&&(n=!1),vl(),Qr(function(){var i=new Da(r,t,n,!1);wl(i.values_,be,i);var s=new Proxy(i.values_,bv);return i.proxy_=s,e&&e.length&&i.spliceWithArray_(0,0,e),s})}var $o={clear:function(){return this.splice(0)},replace:function(t){var r=this[be];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];var o=this[be];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[be].spliceWithArray_(t,r,n)},push:function(){for(var t=this[be],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[be].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[be],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return H.trackingDerivation&&fe(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){H.trackingDerivation&&fe(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[be],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Ce("at",yt);Ce("concat",yt);Ce("flat",yt);Ce("includes",yt);Ce("indexOf",yt);Ce("join",yt);Ce("lastIndexOf",yt);Ce("slice",yt);Ce("toString",yt);Ce("toLocaleString",yt);Ce("toSorted",yt);Ce("toSpliced",yt);Ce("with",yt);Ce("every",Mt);Ce("filter",Mt);Ce("find",Mt);Ce("findIndex",Mt);Ce("findLast",Mt);Ce("findLastIndex",Mt);Ce("flatMap",Mt);Ce("forEach",Mt);Ce("map",Mt);Ce("some",Mt);Ce("toReversed",Mt);Ce("reduce",id);Ce("reduceRight",id);function Ce(e,t){typeof Array.prototype[e]=="function"&&($o[e]=t(e))}function yt(e){return function(){var t=this[be];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Mt(e){return function(t,r){var n=this,i=this[be];i.atom_.reportObserved();var s=i.dehanceValues_(i.values_);return s[e](function(o,a){return t.call(r,o,a,n)})}}function id(e){return function(){var t=this,r=this[be];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(s,o,a){return i(s,o,a,t)},n[e].apply(n,arguments)}}var _v=Ar("ObservableArrayAdministration",Da);function Nn(e){return Fo(e)&&_v(e[be])}var od,sd,wv={},_r="add",Co="delete";od=Symbol.iterator;sd=Symbol.toStringTag;var ad=function(){function e(r,n,i){var s=this;n===void 0&&(n=Kr),i===void 0&&(i="ObservableMap@"+St()),this.enhancer_=void 0,this.name_=void 0,this[be]=wv,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,De(Map)||fe(18),Qr(function(){s.keysAtom_=Il(s.name_+".keys()"),s.data_=new Map,s.hasMap_=new Map,r&&s.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!H.trackingDerivation)return this.has_(n);var s=this.hasMap_.get(n);if(!s){var o=s=new wr(this.has_(n),qo,this.name_+"."+ca(n)+"?",!1);this.hasMap_.set(n,o),Oi(o,function(){return i.hasMap_.delete(n)})}return s.get()},t.set=function(n,i){var s=this.has_(n);if(_t(this)){var o=wt(this,{type:s?Rt:_r,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return s?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(Ft(this.keysAtom_),_t(this)){var s=wt(this,{type:Co,object:this,name:n});if(!s)return!1}if(this.has_(n)){var o=He(),a=Ut(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:Co,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return o&&dt(f),Zt(function(){var c;i.keysAtom_.reportChanged(),(c=i.hasMap_.get(n))==null||c.setNewValue_(!1);var y=i.data_.get(n);y.setNewValue_(void 0),i.data_.delete(n)}),a&&Bt(this,f),o&&pt(),!0}return!1},t.updateValue_=function(n,i){var s=this.data_.get(n);if(i=s.prepareNewValue_(i),i!==H.UNCHANGED){var o=He(),a=Ut(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:Rt,object:this,oldValue:s.value_,name:n,newValue:i}:null;o&&dt(f),s.setNewValue_(i),a&&Bt(this,f),o&&pt()}},t.addValue_=function(n,i){var s=this;Ft(this.keysAtom_),Zt(function(){var c,y=new wr(i,s.enhancer_,s.name_+"."+ca(n),!1);s.data_.set(n,y),i=y.value_,(c=s.hasMap_.get(n))==null||c.setNewValue_(!0),s.keysAtom_.reportChanged()});var o=He(),a=Ut(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:_r,object:this,name:n,newValue:i}:null;o&&dt(f),a&&Bt(this,f),o&&pt()},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return li({next:function(){var o=i.next(),a=o.done,f=o.value;return{done:a,value:a?void 0:n.get(f)}}})},t.entries=function(){var n=this,i=this.keys();return li({next:function(){var o=i.next(),a=o.done,f=o.value;return{done:a,value:a?void 0:[f,n.get(f)]}}})},t[od]=function(){return this.entries()},t.forEach=function(n,i){for(var s=vn(this),o;!(o=s()).done;){var a=o.value,f=a[0],c=a[1];n.call(i,c,f,this)}},t.merge=function(n){var i=this;return Wt(n)&&(n=new Map(n)),Zt(function(){kt(n)?Ug(n).forEach(function(s){return i.set(s,n[s])}):Array.isArray(n)?n.forEach(function(s){var o=s[0],a=s[1];return i.set(o,a)}):In(n)?(n.constructor!==Map&&fe(19,n),n.forEach(function(s,o){return i.set(o,s)})):n!=null&&fe(20,n)}),this},t.clear=function(){var n=this;Zt(function(){Be(function(){for(var i=vn(n.keys()),s;!(s=i()).done;){var o=s.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Zt(function(){for(var s=Tv(n),o=new Map,a=!1,f=vn(i.data_.keys()),c;!(c=f()).done;){var y=c.value;if(!s.has(y)){var g=i.delete(y);if(g)a=!0;else{var M=i.data_.get(y);o.set(y,M)}}}for(var R=vn(s.entries()),j;!(j=R()).done;){var te=j.value,W=te[0],B=te[1],z=i.data_.has(W);if(i.set(W,B),i.data_.has(W)){var Y=i.data_.get(W);o.set(W,Y),z||(a=!0)}}if(!a)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var ie=i.data_.keys(),F=o.keys(),se=ie.next(),K=F.next();!se.done;){if(se.value!==K.value){i.keysAtom_.reportChanged();break}se=ie.next(),K=F.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support fireImmediately=true in combination with maps."),Ei(this,n)},t.intercept_=function(n){return Ii(this,n)},Ra(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:sd,get:function(){return"Map"}}]),e}(),Wt=Ar("ObservableMap",ad);function Tv(e){if(In(e)||Wt(e))return e;if(Array.isArray(e))return new Map(e);if(kt(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return fe(21,e)}var ud,cd,Ov={};ud=Symbol.iterator;cd=Symbol.toStringTag;var fd=function(){function e(r,n,i){var s=this;n===void 0&&(n=Kr),i===void 0&&(i="ObservableSet@"+St()),this.name_=void 0,this[be]=Ov,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,De(Set)||fe(22),this.enhancer_=function(o,a){return n(o,a,i)},Qr(function(){s.atom_=Il(s.name_),r&&s.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;Zt(function(){Be(function(){for(var i=vn(n.data_.values()),s;!(s=i()).done;){var o=s.value;n.delete(o)}})})},t.forEach=function(n,i){for(var s=vn(this),o;!(o=s()).done;){var a=o.value;n.call(i,a,a,this)}},t.add=function(n){var i=this;if(Ft(this.atom_),_t(this)){var s=wt(this,{type:_r,object:this,newValue:n});if(!s)return this}if(!this.has(n)){Zt(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=He(),a=Ut(this),f=a||o?{observableKind:"set",debugObjectName:this.name_,type:_r,object:this,newValue:n}:null;o&&dt(f),a&&Bt(this,f),o&&pt()}return this},t.delete=function(n){var i=this;if(_t(this)){var s=wt(this,{type:Co,object:this,oldValue:n});if(!s)return!1}if(this.has(n)){var o=He(),a=Ut(this),f=a||o?{observableKind:"set",debugObjectName:this.name_,type:Co,object:this,oldValue:n}:null;return o&&dt(f),Zt(function(){i.atom_.reportChanged(),i.data_.delete(n)}),a&&Bt(this,f),o&&pt(),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=0,i=Array.from(this.keys()),s=Array.from(this.values());return li({next:function(){var a=n;return n+=1,a<s.length?{value:[i[a],s[a]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=0,s=Array.from(this.data_.values());return li({next:function(){return i<s.length?{value:n.dehanceValue_(s[i++]),done:!1}:{done:!0}}})},t.replace=function(n){var i=this;return Yr(n)&&(n=new Set(n)),Zt(function(){Array.isArray(n)?(i.clear(),n.forEach(function(s){return i.add(s)})):bi(n)?(i.clear(),n.forEach(function(s){return i.add(s)})):n!=null&&fe("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support fireImmediately=true in combination with sets."),Ei(this,n)},t.intercept_=function(n){return Ii(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[ud]=function(){return this.values()},Ra(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:cd,get:function(){return"Set"}}]),e}(),Yr=Ar("ObservableSet",fd),Cf=Object.create(null),Pf="remove",ba=function(){function e(r,n,i,s){n===void 0&&(n=new Map),s===void 0&&(s=lb),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=s,this.keysAtom_=new _i(this.name_+".keys"),this.isPlainObject_=kt(this.target_),yd(this.defaultAnnotation_)||fe("defaultAnnotation must be valid annotation"),this.appliedAnnotations_={}}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var s=this.values_.get(n);if(s instanceof qr)return s.set(i),!0;if(_t(this)){var o=wt(this,{type:Rt,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=s.prepareNewValue_(i),i!==H.UNCHANGED){var a=Ut(this),f=He(),c=a||f?{type:Rt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:n,newValue:i}:null;f&&dt(c),s.setNewValue_(i),a&&Bt(this,c),f&&pt()}return!0},t.get_=function(n){return H.trackingDerivation&&!It(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,s){return s===void 0&&(s=!1),It(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):s?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,s)},t.has_=function(n){if(!H.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new wr(n in this.target_,qo,this.name_+"."+ca(n)+"?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(Bf(this,i,n),!(n in this.target_)){var s;if((s=this.target_[rt])!=null&&s[n])return;fe(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==gi;){var a=Ao(o,n);if(a){var f=i.make_(this,n,a,o);if(f===0)return;if(f===1)break}o=Object.getPrototypeOf(o)}Uf(this,i,n)}},t.extend_=function(n,i,s,o){if(o===void 0&&(o=!1),s===!0&&(s=this.defaultAnnotation_),s===!1)return this.defineProperty_(n,i,o);Bf(this,s,n);var a=s.extend_(this,n,i,o);return a&&Uf(this,s,n),a},t.defineProperty_=function(n,i,s){s===void 0&&(s=!1),Ft(this.keysAtom_);try{Tt();var o=this.delete_(n);if(!o)return o;if(_t(this)){var a=wt(this,{object:this.proxy_||this.target_,name:n,type:_r,newValue:i.value});if(!a)return null;var f=a.newValue;i.value!==f&&(i=rr({},i,{value:f}))}if(s){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Vt(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{Ot()}return!0},t.defineObservableProperty_=function(n,i,s,o){o===void 0&&(o=!1),Ft(this.keysAtom_);try{Tt();var a=this.delete_(n);if(!a)return a;if(_t(this)){var f=wt(this,{object:this.proxy_||this.target_,name:n,type:_r,newValue:i});if(!f)return null;i=f.newValue}var c=Rf(n),y={configurable:H.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,n,y))return!1}else Vt(this.target_,n,y);var g=new wr(i,s,this.name_+"."+n.toString(),!1);this.values_.set(n,g),this.notifyPropertyAddition_(n,g.value_)}finally{Ot()}return!0},t.defineComputedProperty_=function(n,i,s){s===void 0&&(s=!1),Ft(this.keysAtom_);try{Tt();var o=this.delete_(n);if(!o)return o;if(_t(this)){var a=wt(this,{object:this.proxy_||this.target_,name:n,type:_r,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+n.toString()),i.context=this.proxy_||this.target_;var f=Rf(n),c={configurable:H.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:f.get,set:f.set};if(s){if(!Reflect.defineProperty(this.target_,n,c))return!1}else Vt(this.target_,n,c);this.values_.set(n,new qr(i)),this.notifyPropertyAddition_(n,void 0)}finally{Ot()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),Ft(this.keysAtom_),!It(this.target_,n))return!0;if(_t(this)){var s=wt(this,{object:this.proxy_||this.target_,name:n,type:Pf});if(!s)return null}try{var o,a;Tt();var f=Ut(this),c=He(),y=this.values_.get(n),g=void 0;if(!y&&(f||c)){var M;g=(M=Ao(this.target_,n))==null?void 0:M.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(delete this.appliedAnnotations_[n],y&&(this.values_.delete(n),y instanceof wr&&(g=y.value_),Kl(y)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(a=o.get(n))==null||a.set(n in this.target_),f||c){var R={type:Pf,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:g,name:n};c&&dt(R),f&&Bt(this,R),c&&pt()}}finally{Ot()}return!0},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support the fire immediately property for observable objects."),Ei(this,n)},t.intercept_=function(n){return Ii(this,n)},t.notifyPropertyAddition_=function(n,i){var s,o,a=Ut(this),f=He();if(a||f){var c=a||f?{type:_r,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;f&&dt(c),a&&Bt(this,c),f&&pt()}(s=this.pendingKeys_)==null||(o=s.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Ko(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function $n(e,t){var r;if(t&&Hr(e)&&fe("Options can't be provided for already observable objects."),It(e,be))return La(e)instanceof ba||fe("Cannot convert '"+fi(e)+`' into observable object:
50
+ The target is already observable of different type.
51
+ Extending builtins is not supported.`),e;Object.isExtensible(e)||fe("Cannot make the designated object observable; it is not extensible");var n=(r=t?.name)!=null?r:(kt(e)?"ObservableObject":e.constructor.name)+"@"+St(),i=new ba(e,new Map,String(n),Tb(t));return Vo(e,be,i),e}var Av=Ar("ObservableObjectAdministration",ba);function Rf(e){return Cf[e]||(Cf[e]={get:function(){return this[be].getObservablePropValue_(e)},set:function(r){return this[be].setObservablePropValue_(e,r)}})}function Hr(e){return Fo(e)?Av(e[be]):!1}function Uf(e,t,r){var n;e.appliedAnnotations_[r]=t,(n=e.target_[rt])==null||delete n[r]}function Bf(e,t,r){if(yd(t)||fe("Cannot annotate '"+e.name_+"."+r.toString()+"': Invalid annotation."),!Eo(t)&&It(e.appliedAnnotations_,r)){var n=e.name_+"."+r.toString(),i=e.appliedAnnotations_[r].annotationType_,s=t.annotationType_;fe("Cannot apply '"+s+"' to '"+n+"':"+(`
52
+ The field is already annotated with '`+i+"'.")+`
53
+ Re-annotating fields is not allowed.
54
+ Use 'override' annotation for methods overridden by subclass.`)}}var Iv=dd(0),Ev=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),na=0,ld=function(){};function Sv(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Sv(ld,Array.prototype);var ja=function(e,t,r){Al(n,e);function n(s,o,a,f){var c;return a===void 0&&(a="ObservableArray@"+St()),f===void 0&&(f=!1),c=e.call(this)||this,Qr(function(){var y=new Da(a,o,f,!0);y.proxy_=bo(c),wl(bo(c),be,y),s&&s.length&&c.spliceWithArray(0,0,s),Ev&&Object.defineProperty(bo(c),"0",Iv)}),c}var i=n.prototype;return i.concat=function(){this[be].atom_.reportObserved();for(var o=arguments.length,a=new Array(o),f=0;f<o;f++)a[f]=arguments[f];return Array.prototype.concat.apply(this.slice(),a.map(function(c){return Nn(c)?c.slice():c}))},i[r]=function(){var s=this,o=0;return li({next:function(){return o<s.length?{value:s[o++],done:!1}:{done:!0,value:void 0}}})},Ra(n,[{key:"length",get:function(){return this[be].getArrayLength_()},set:function(o){this[be].setArrayLength_(o)}},{key:t,get:function(){return"Array"}}]),n}(ld,Symbol.toStringTag,Symbol.iterator);Object.entries($o).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Vo(ja.prototype,t,r)});function dd(e){return{enumerable:!1,configurable:!0,get:function(){return this[be].get_(e)},set:function(r){this[be].set_(e,r)}}}function xv(e){Vt(ja.prototype,""+e,dd(e))}function pd(e){if(e>na){for(var t=na;t<e+100;t++)xv(t);na=e}}pd(1e3);function Nv(e,t,r){return new ja(e,t,r)}function qt(e,t){if(typeof e=="object"&&e!==null){if(Nn(e))return t!==void 0&&fe(23),e[be].atom_;if(Yr(e))return e.atom_;if(Wt(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||fe(25,t,fi(e)),r}if(Hr(e)){if(!t)return fe(26);var n=e[be].values_.get(t);return n||fe(27,t,fi(e)),n}if(Ua(e)||Ti(e)||No(e))return e}else if(De(e)&&No(e[be]))return e[be];fe(28)}function La(e,t){if(e||fe(29),t!==void 0)return La(qt(e,t));if(Ua(e)||Ti(e)||No(e)||Wt(e)||Yr(e))return e;if(e[be])return e[be];fe(24,e)}function fi(e,t){var r;if(t!==void 0)r=qt(e,t);else{if(Sn(e))return e.name;Hr(e)||Wt(e)||Yr(e)?r=La(e):r=qt(e)}return r.name_}function Qr(e){var t=Xr(),r=Ho(!0);Tt();try{return e()}finally{Ot(),Wo(r),tr(t)}}var kf=gi.toString;function Fa(e,t,r){return r===void 0&&(r=-1),va(e,t,r)}function va(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var s=typeof e;if(s!=="function"&&s!=="object"&&typeof t!="object")return!1;var o=kf.call(e);if(o!==kf.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=Mf(e),t=Mf(t);var a=o==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var f=e.constructor,c=t.constructor;if(f!==c&&!(De(f)&&f instanceof f&&De(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var y=n.length;y--;)if(n[y]===e)return i[y]===t;if(n.push(e),i.push(t),a){if(y=e.length,y!==t.length)return!1;for(;y--;)if(!va(e[y],t[y],r-1,n,i))return!1}else{var g=Object.keys(e),M;if(y=g.length,Object.keys(t).length!==y)return!1;for(;y--;)if(M=g[y],!(It(t,M)&&va(e[M],t[M],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function Mf(e){return Nn(e)?e.slice():In(e)||Wt(e)||bi(e)||Yr(e)?Array.from(e.entries()):e}function li(e){return e[Symbol.iterator]=$v,e}function $v(){return this}function yd(e){return e instanceof Object&&typeof e.annotationType_=="string"&&De(e.make_)&&De(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=$a();typeof t[e]>"u"&&fe("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Hl,extras:{getDebugName:fi},$mobx:be});var hd=Dt(Og(),1),FS=hd.default.configure,Wr=hd.default,ia=100,{WARN:Cv,LOG:VS,DEBUG:vr,VERBOSE:tt,ERROR:KS}=Se.setup(Se.INFO);sv({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var Pv=()=>window.disableSpy=Hl(e=>{tt("[mobx]",e)});typeof window=="object"&&(window.getDependencyTree=Ai,window.getObserverTree=uv,window.getAtom=qt,window.getDebugName=fi,window.enableSpy=Pv);var Qe=({caller:e,thread:t,pattern:r,args:n})=>(n=n||r,`${Be(()=>t?.name?t.name+" | ":"")}${e??"caller?"}${n?`{${typeof n=="string"?n:Wr(n)}}`:""}`);function Rv(e,t){return Be(()=>nt.structural(e.get(),t.get()))}function Si(e,t){return nt.shallow(e.applogs,t.applogs)}function Va(e,t){if(e.size!==t.size)return!1;for(let r=0;r<e.size;r++){let n=e.nodes[r],i=t.nodes[r];if(tt("queryNodesComparer",r,n,i),!nt.structural(n.variables,i.variables))return tt("[queryNodesComparer] changed vars:",r,n,i),!1;if(!Si(n.logsOfThisNode,i.logsOfThisNode))return tt("[queryNodesComparer] changed logsOfThisNode:",r,n,i),!1}return tt("[queryNodesComparer] equal:",{a:e,b:t}),!0}var Uv=0;function er(e,{name:t,equals:r}={}){let n=`observableArrayMap@${++Uv}{${t}}`;tt(`[${n}] create`,{fnname:e.name,fn:e,name:t,equals:r});let i,s=Bv(e,a=>i=ke.array(a,{deep:!1,name:t,equals:r}),a=>{Be(()=>(r??nt.structural)(i,a))?vr(`[${n}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),vr(`[${n}] updated`,{updatedItems:a,observableArr:i}))},{name:n}),o=Oi(i,()=>{tt(`[${n}] dispose`),o(),s()});return i}function Bv(e,t,r,{name:n}={}){vr("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:n});let i=`${n}.autorunImm`,s,o=new ai(i,(...c)=>{vr(`[${i}] reaction.invalidate`,c),a(),Qb(()=>{r(s)})});function a(){o.track(()=>{let c=ia&&performance.now();vr(`[${i}] runAndTrack:`,{name:n??e.name,fn:e}),s=e(),vr(`[${i}] runAndTrack =>`,s),ia&&performance.now()-c>ia&&Cv(`[${i}] took ${performance.now()-c}ms`)})}return a(),t(s),vr.isEnabled&&vr(`[${i}] deps of reaction`,{reaction:o,result:s,deps:Ai(o)}),()=>{tt(`[${i}] dispose`),setTimeout(()=>o.dispose())}}function it(e,t,r=!1){if(Sn(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let n=!1,i=0,s=typeof r=="boolean"?{keepAlive:r}:r,o=new Map;return function(...a){let f,c=Be(()=>a),y=`computedFnDeepCompare(${e||t.name}#${++i})${s.argsDebugName?`{${s.argsDebugName(...a)}}`:""}`;for(let[R,j]of o.entries())if(nt.structural(R,c)){f=j;break}if(f){let R=f.get();return tt(`[${y}] cache hit`,{untrackedArgs:c,cachedResult:R}),R}if(!s.keepAlive&&!Ub())return!n&&jb().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),n=!0),t.apply(this,a);tt(`[${y}] new computation`,{untrackedArgs:c});let g,M=Ge(()=>(tt(`[${y}] update->rerun`,Be(()=>({args:a})),t),tt.isDisabled||nd(),g=t.apply(this,a)),{...s,name:y});if(tt(`[${y}] deps`,Ai(M),{untrackedArgs:c}),o.set(c,M),!s.keepAlive){let R=Oi(M,()=>{tt(`[${y}] dispose`,M),R(),o.delete(c),s.onCleanup&&s.onCleanup(g,...a),g=void 0})}return M.get()}}function kv(e){let t=0,r="",n=0;for(let i=0;i<e.length;i++){let s=e[i];s==="("?r+=s+`
55
+ `+" ".repeat(++t):s===")"?r+=`
56
+ `+" ".repeat(--t)+s:s===","&&n===0?r+=s+`
57
+ `+" ".repeat(t):s==="{"&&n===0?(n++,r+=s+`
58
+ `+" ".repeat(t+1)):s==="}"&&n===1?(n--,r+=`
59
+ `+" ".repeat(t)+s):s==="{"&&n>0?(n++,r+=s):(s==="}"&&n>1&&n--,r+=s)}return r}var{WARN:Df,LOG:zS,DEBUG:Mv,VERBOSE:qS,ERROR:br}=Se.setup(Se.INFO,{prefix:"[thread]"});function nr(e){return e.init!==void 0}var Ka=class{constructor(e,t,r,n=[]){this.name=e,this._applogs=n,this.parents=t===null?null:Tf(t),this.filters=r,Be(()=>this.parents?.length===0)&&Df("[Thread] empty parents array",e),xn(this,{applogsCids:Ge,insert:At,size:Ge,isEmpty:Ge,firstLog:Ge,latestLog:Ge},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw br("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw br("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw br("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw br("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw br("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw br("[Thread] insertRaw() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insertRaw(e)}subscribe(e){return this._subscribers.push(e),this.unsubscribe.bind(this,e)}unsubscribe(e){let t=this._subscribers.indexOf(e);t!==-1?this._subscribers.splice(t,1):Df("unsubscribe called for non-existent",e)}notifySubscribers(e){Mv(`[thread: ${this.name}] notifying`,this._subscribers.length,"subscribers of",{...e,subs:this._subscribers});for(let t of this._subscribers)t(e)}get applogs(){return this._applogs}get applogsCids(){return this._applogs.map(e=>e.cid)}map(e){return this.applogs.map||br("applogs arr?!",this.applogs),this.applogs.map(e)}get firstLog(){return this.applogs[0]}get latestLog(){return this.applogs[this.applogs.length-1]}hasApplog(e,t){if(t)return this.applogs.includes(e);if(!e.cid)throw br("[hasApplogs] applog without CID:",e);return this.hasApplogCid(e.cid)}hasApplogCid(e){return this.applogsCids.includes(e)}hasApplogWithDiffTs(e){return this.applogs.find(t=>t.en===e.en&&t.at===e.at&&t.vl===e.vl&&t.ag===e.ag)}get isEmpty(){return this.size===0}get size(){return this.applogs.length}get untrackedSize(){return Be(()=>this.size)}get nameAndSizeUntracked(){return Be(()=>`${this.name} (${this.size})`)}get prettyName(){return kv(this.name)}};function _a(e){"@babel/helpers - typeof";return _a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_a(e)}function md(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function jf(e){md(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||_a(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Dv(e,t){md(2,arguments);var r=jf(e),n=jf(t);return r.getTime()<n.getTime()}var jv=typeof global=="object"&&global&&global.Object===Object&&global,gd=jv,Lv=typeof self=="object"&&self&&self.Object===Object&&self,Fv=gd||Lv||Function("return this")(),ir=Fv,Vv=ir.Symbol,Gt=Vv,bd=Object.prototype,Kv=bd.hasOwnProperty,zv=bd.toString,ni=Gt?Gt.toStringTag:void 0;function qv(e){var t=Kv.call(e,ni),r=e[ni];try{e[ni]=void 0;var n=!0}catch{}var i=zv.call(e);return n&&(t?e[ni]=r:delete e[ni]),i}var Gv=qv,Hv=Object.prototype,Wv=Hv.toString;function Jv(e){return Wv.call(e)}var Xv=Jv,Yv="[object Null]",Qv="[object Undefined]",Lf=Gt?Gt.toStringTag:void 0;function Zv(e){return e==null?e===void 0?Qv:Yv:Lf&&Lf in Object(e)?Gv(e):Xv(e)}var Cn=Zv;function e_(e){return e!=null&&typeof e=="object"}var On=e_,t_="[object Symbol]";function r_(e){return typeof e=="symbol"||On(e)&&Cn(e)==t_}var di=r_;function n_(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var i_=n_,o_=Array.isArray,Ht=o_,s_=1/0,Ff=Gt?Gt.prototype:void 0,Vf=Ff?Ff.toString:void 0;function vd(e){if(typeof e=="string")return e;if(Ht(e))return i_(e,vd)+"";if(di(e))return Vf?Vf.call(e):"";var t=e+"";return t=="0"&&1/e==-s_?"-0":t}var a_=vd;function u_(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pi=u_;function c_(e){return e}var _d=c_,f_="[object AsyncFunction]",l_="[object Function]",d_="[object GeneratorFunction]",p_="[object Proxy]";function y_(e){if(!pi(e))return!1;var t=Cn(e);return t==l_||t==d_||t==f_||t==p_}var wd=y_,h_=ir["__core-js_shared__"],oa=h_,Kf=function(){var e=/[^.]+$/.exec(oa&&oa.keys&&oa.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function m_(e){return!!Kf&&Kf in e}var g_=m_,b_=Function.prototype,v_=b_.toString;function __(e){if(e!=null){try{return v_.call(e)}catch{}try{return e+""}catch{}}return""}var Zr=__,w_=/[\\^$.*+?()[\]{}|]/g,T_=/^\[object .+?Constructor\]$/,O_=Function.prototype,A_=Object.prototype,I_=O_.toString,E_=A_.hasOwnProperty,S_=RegExp("^"+I_.call(E_).replace(w_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function x_(e){if(!pi(e)||g_(e))return!1;var t=wd(e)?S_:T_;return t.test(Zr(e))}var N_=x_;function $_(e,t){return e?.[t]}var C_=$_;function P_(e,t){var r=C_(e,t);return N_(r)?r:void 0}var en=P_,R_=en(ir,"WeakMap"),wa=R_;function U_(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var B_=U_,k_=800,M_=16,D_=Date.now;function j_(e){var t=0,r=0;return function(){var n=D_(),i=M_-(n-r);if(r=n,i>0){if(++t>=k_)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var L_=j_;function F_(e){return function(){return e}}var V_=F_,K_=function(){try{var e=en(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Po=K_,z_=Po?function(e,t){return Po(e,"toString",{configurable:!0,enumerable:!1,value:V_(t),writable:!0})}:_d,q_=z_,G_=L_(q_),H_=G_,W_=9007199254740991,J_=/^(?:0|[1-9]\d*)$/;function X_(e,t){var r=typeof e;return t=t??W_,!!t&&(r=="number"||r!="symbol"&&J_.test(e))&&e>-1&&e%1==0&&e<t}var za=X_;function Y_(e,t,r){t=="__proto__"&&Po?Po(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Q_=Y_;function Z_(e,t){return e===t||e!==e&&t!==t}var qa=Z_,ew=Object.prototype,tw=ew.hasOwnProperty;function rw(e,t,r){var n=e[t];(!(tw.call(e,t)&&qa(n,r))||r===void 0&&!(t in e))&&Q_(e,t,r)}var nw=rw,zf=Math.max;function iw(e,t,r){return t=zf(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=zf(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=r(o),B_(e,this,a)}}var ow=iw,sw=9007199254740991;function aw(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=sw}var Ga=aw;function uw(e){return e!=null&&Ga(e.length)&&!wd(e)}var cw=uw,fw=Object.prototype;function lw(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fw;return e===r}var dw=lw;function pw(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var yw=pw,hw="[object Arguments]";function mw(e){return On(e)&&Cn(e)==hw}var qf=mw,Td=Object.prototype,gw=Td.hasOwnProperty,bw=Td.propertyIsEnumerable,vw=qf(function(){return arguments}())?qf:function(e){return On(e)&&gw.call(e,"callee")&&!bw.call(e,"callee")},Ha=vw;function _w(){return!1}var ww=_w,Od=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gf=Od&&typeof module=="object"&&module&&!module.nodeType&&module,Tw=Gf&&Gf.exports===Od,Hf=Tw?ir.Buffer:void 0,Ow=Hf?Hf.isBuffer:void 0,Aw=Ow||ww,Ta=Aw,Iw="[object Arguments]",Ew="[object Array]",Sw="[object Boolean]",xw="[object Date]",Nw="[object Error]",$w="[object Function]",Cw="[object Map]",Pw="[object Number]",Rw="[object Object]",Uw="[object RegExp]",Bw="[object Set]",kw="[object String]",Mw="[object WeakMap]",Dw="[object ArrayBuffer]",jw="[object DataView]",Lw="[object Float32Array]",Fw="[object Float64Array]",Vw="[object Int8Array]",Kw="[object Int16Array]",zw="[object Int32Array]",qw="[object Uint8Array]",Gw="[object Uint8ClampedArray]",Hw="[object Uint16Array]",Ww="[object Uint32Array]",Re={};Re[Lw]=Re[Fw]=Re[Vw]=Re[Kw]=Re[zw]=Re[qw]=Re[Gw]=Re[Hw]=Re[Ww]=!0;Re[Iw]=Re[Ew]=Re[Dw]=Re[Sw]=Re[jw]=Re[xw]=Re[Nw]=Re[$w]=Re[Cw]=Re[Pw]=Re[Rw]=Re[Uw]=Re[Bw]=Re[kw]=Re[Mw]=!1;function Jw(e){return On(e)&&Ga(e.length)&&!!Re[Cn(e)]}var Xw=Jw;function Yw(e){return function(t){return e(t)}}var Qw=Yw,Ad=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oi=Ad&&typeof module=="object"&&module&&!module.nodeType&&module,Zw=oi&&oi.exports===Ad,sa=Zw&&gd.process,e0=function(){try{var e=oi&&oi.require&&oi.require("util").types;return e||sa&&sa.binding&&sa.binding("util")}catch{}}(),Wf=e0,Jf=Wf&&Wf.isTypedArray,t0=Jf?Qw(Jf):Xw,Id=t0,r0=Object.prototype,n0=r0.hasOwnProperty;function i0(e,t){var r=Ht(e),n=!r&&Ha(e),i=!r&&!n&&Ta(e),s=!r&&!n&&!i&&Id(e),o=r||n||i||s,a=o?yw(e.length,String):[],f=a.length;for(var c in e)(t||n0.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||za(c,f)))&&a.push(c);return a}var o0=i0;function s0(e,t){return function(r){return e(t(r))}}var a0=s0,u0=a0(Object.keys,Object),c0=u0,f0=Object.prototype,l0=f0.hasOwnProperty;function d0(e){if(!dw(e))return c0(e);var t=[];for(var r in Object(e))l0.call(e,r)&&r!="constructor"&&t.push(r);return t}var p0=d0;function y0(e){return cw(e)?o0(e):p0(e)}var Ed=y0,h0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,m0=/^\w*$/;function g0(e,t){if(Ht(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||di(e)?!0:m0.test(e)||!h0.test(e)||t!=null&&e in Object(t)}var Wa=g0,b0=en(Object,"create"),yi=b0;function v0(){this.__data__=yi?yi(null):{},this.size=0}var _0=v0;function w0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var T0=w0,O0="__lodash_hash_undefined__",A0=Object.prototype,I0=A0.hasOwnProperty;function E0(e){var t=this.__data__;if(yi){var r=t[e];return r===O0?void 0:r}return I0.call(t,e)?t[e]:void 0}var S0=E0,x0=Object.prototype,N0=x0.hasOwnProperty;function $0(e){var t=this.__data__;return yi?t[e]!==void 0:N0.call(t,e)}var C0=$0,P0="__lodash_hash_undefined__";function R0(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=yi&&t===void 0?P0:t,this}var U0=R0;function Pn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Pn.prototype.clear=_0;Pn.prototype.delete=T0;Pn.prototype.get=S0;Pn.prototype.has=C0;Pn.prototype.set=U0;var Xf=Pn;function B0(){this.__data__=[],this.size=0}var k0=B0;function M0(e,t){for(var r=e.length;r--;)if(qa(e[r][0],t))return r;return-1}var Jo=M0,D0=Array.prototype,j0=D0.splice;function L0(e){var t=this.__data__,r=Jo(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():j0.call(t,r,1),--this.size,!0}var F0=L0;function V0(e){var t=this.__data__,r=Jo(t,e);return r<0?void 0:t[r][1]}var K0=V0;function z0(e){return Jo(this.__data__,e)>-1}var q0=z0;function G0(e,t){var r=this.__data__,n=Jo(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var H0=G0;function Rn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Rn.prototype.clear=k0;Rn.prototype.delete=F0;Rn.prototype.get=K0;Rn.prototype.has=q0;Rn.prototype.set=H0;var Xo=Rn,W0=en(ir,"Map"),hi=W0;function J0(){this.size=0,this.__data__={hash:new Xf,map:new(hi||Xo),string:new Xf}}var X0=J0;function Y0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Q0=Y0;function Z0(e,t){var r=e.__data__;return Q0(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Yo=Z0;function eT(e){var t=Yo(this,e).delete(e);return this.size-=t?1:0,t}var tT=eT;function rT(e){return Yo(this,e).get(e)}var nT=rT;function iT(e){return Yo(this,e).has(e)}var oT=iT;function sT(e,t){var r=Yo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var aT=sT;function Un(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Un.prototype.clear=X0;Un.prototype.delete=tT;Un.prototype.get=nT;Un.prototype.has=oT;Un.prototype.set=aT;var Qo=Un,uT="Expected a function";function Ja(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(uT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(Ja.Cache||Qo),r}Ja.Cache=Qo;var cT=Ja,fT=500;function lT(e){var t=cT(e,function(n){return r.size===fT&&r.clear(),n}),r=t.cache;return t}var dT=lT,pT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yT=/\\(\\)?/g,hT=dT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(pT,function(r,n,i,s){t.push(i?s.replace(yT,"$1"):n||r)}),t}),mT=hT;function gT(e){return e==null?"":a_(e)}var bT=gT;function vT(e,t){return Ht(e)?e:Wa(e,t)?[e]:mT(bT(e))}var Zo=vT,_T=1/0;function wT(e){if(typeof e=="string"||di(e))return e;var t=e+"";return t=="0"&&1/e==-_T?"-0":t}var xi=wT;function TT(e,t){t=Zo(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[xi(t[r++])];return r&&r==n?e:void 0}var Xa=TT;function OT(e,t,r){var n=e==null?void 0:Xa(e,t);return n===void 0?r:n}var AT=OT;function IT(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Sd=IT,Yf=Gt?Gt.isConcatSpreadable:void 0;function ET(e){return Ht(e)||Ha(e)||!!(Yf&&e&&e[Yf])}var ST=ET;function xd(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=ST),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?xd(a,t-1,r,n,i):Sd(i,a):n||(i[i.length]=a)}return i}var xT=xd;function NT(e){var t=e==null?0:e.length;return t?xT(e,1):[]}var $T=NT;function CT(e){return H_(ow(e,void 0,$T),e+"")}var PT=CT;function RT(){this.__data__=new Xo,this.size=0}var UT=RT;function BT(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var kT=BT;function MT(e){return this.__data__.get(e)}var DT=MT;function jT(e){return this.__data__.has(e)}var LT=jT,FT=200;function VT(e,t){var r=this.__data__;if(r instanceof Xo){var n=r.__data__;if(!hi||n.length<FT-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Qo(n)}return r.set(e,t),this.size=r.size,this}var KT=VT;function Bn(e){var t=this.__data__=new Xo(e);this.size=t.size}Bn.prototype.clear=UT;Bn.prototype.delete=kT;Bn.prototype.get=DT;Bn.prototype.has=LT;Bn.prototype.set=KT;var To=Bn;function zT(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}var qT=zT;function GT(){return[]}var HT=GT,WT=Object.prototype,JT=WT.propertyIsEnumerable,Qf=Object.getOwnPropertySymbols,XT=Qf?function(e){return e==null?[]:(e=Object(e),qT(Qf(e),function(t){return JT.call(e,t)}))}:HT,YT=XT;function QT(e,t,r){var n=t(e);return Ht(e)?n:Sd(n,r(e))}var ZT=QT;function eO(e){return ZT(e,Ed,YT)}var Zf=eO,tO=en(ir,"DataView"),Oa=tO,rO=en(ir,"Promise"),Aa=rO,nO=en(ir,"Set"),Ia=nO,el="[object Map]",iO="[object Object]",tl="[object Promise]",rl="[object Set]",nl="[object WeakMap]",il="[object DataView]",oO=Zr(Oa),sO=Zr(hi),aO=Zr(Aa),uO=Zr(Ia),cO=Zr(wa),Fr=Cn;(Oa&&Fr(new Oa(new ArrayBuffer(1)))!=il||hi&&Fr(new hi)!=el||Aa&&Fr(Aa.resolve())!=tl||Ia&&Fr(new Ia)!=rl||wa&&Fr(new wa)!=nl)&&(Fr=function(e){var t=Cn(e),r=t==iO?e.constructor:void 0,n=r?Zr(r):"";if(n)switch(n){case oO:return il;case sO:return el;case aO:return tl;case uO:return rl;case cO:return nl}return t});var ol=Fr,fO=ir.Uint8Array,sl=fO,lO="__lodash_hash_undefined__";function dO(e){return this.__data__.set(e,lO),this}var pO=dO;function yO(e){return this.__data__.has(e)}var hO=yO;function Ro(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Qo;++t<r;)this.add(e[t])}Ro.prototype.add=Ro.prototype.push=pO;Ro.prototype.has=hO;var mO=Ro;function gO(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var bO=gO;function vO(e,t){return e.has(t)}var _O=vO,wO=1,TO=2;function OO(e,t,r,n,i,s){var o=r&wO,a=e.length,f=t.length;if(a!=f&&!(o&&f>a))return!1;var c=s.get(e),y=s.get(t);if(c&&y)return c==t&&y==e;var g=-1,M=!0,R=r&TO?new mO:void 0;for(s.set(e,t),s.set(t,e);++g<a;){var j=e[g],te=t[g];if(n)var W=o?n(te,j,g,t,e,s):n(j,te,g,e,t,s);if(W!==void 0){if(W)continue;M=!1;break}if(R){if(!bO(t,function(B,z){if(!_O(R,z)&&(j===B||i(j,B,r,n,s)))return R.push(z)})){M=!1;break}}else if(!(j===te||i(j,te,r,n,s))){M=!1;break}}return s.delete(e),s.delete(t),M}var Nd=OO;function AO(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var IO=AO;function EO(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var SO=EO,xO=1,NO=2,$O="[object Boolean]",CO="[object Date]",PO="[object Error]",RO="[object Map]",UO="[object Number]",BO="[object RegExp]",kO="[object Set]",MO="[object String]",DO="[object Symbol]",jO="[object ArrayBuffer]",LO="[object DataView]",al=Gt?Gt.prototype:void 0,aa=al?al.valueOf:void 0;function FO(e,t,r,n,i,s,o){switch(r){case LO:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case jO:return!(e.byteLength!=t.byteLength||!s(new sl(e),new sl(t)));case $O:case CO:case UO:return qa(+e,+t);case PO:return e.name==t.name&&e.message==t.message;case BO:case MO:return e==t+"";case RO:var a=IO;case kO:var f=n&xO;if(a||(a=SO),e.size!=t.size&&!f)return!1;var c=o.get(e);if(c)return c==t;n|=NO,o.set(e,t);var y=Nd(a(e),a(t),n,i,s,o);return o.delete(e),y;case DO:if(aa)return aa.call(e)==aa.call(t)}return!1}var VO=FO,KO=1,zO=Object.prototype,qO=zO.hasOwnProperty;function GO(e,t,r,n,i,s){var o=r&KO,a=Zf(e),f=a.length,c=Zf(t),y=c.length;if(f!=y&&!o)return!1;for(var g=f;g--;){var M=a[g];if(!(o?M in t:qO.call(t,M)))return!1}var R=s.get(e),j=s.get(t);if(R&&j)return R==t&&j==e;var te=!0;s.set(e,t),s.set(t,e);for(var W=o;++g<f;){M=a[g];var B=e[M],z=t[M];if(n)var Y=o?n(z,B,M,t,e,s):n(B,z,M,e,t,s);if(!(Y===void 0?B===z||i(B,z,r,n,s):Y)){te=!1;break}W||(W=M=="constructor")}if(te&&!W){var ie=e.constructor,F=t.constructor;ie!=F&&"constructor"in e&&"constructor"in t&&!(typeof ie=="function"&&ie instanceof ie&&typeof F=="function"&&F instanceof F)&&(te=!1)}return s.delete(e),s.delete(t),te}var HO=GO,WO=1,ul="[object Arguments]",cl="[object Array]",go="[object Object]",JO=Object.prototype,fl=JO.hasOwnProperty;function XO(e,t,r,n,i,s){var o=Ht(e),a=Ht(t),f=o?cl:ol(e),c=a?cl:ol(t);f=f==ul?go:f,c=c==ul?go:c;var y=f==go,g=c==go,M=f==c;if(M&&Ta(e)){if(!Ta(t))return!1;o=!0,y=!1}if(M&&!y)return s||(s=new To),o||Id(e)?Nd(e,t,r,n,i,s):VO(e,t,f,r,n,i,s);if(!(r&WO)){var R=y&&fl.call(e,"__wrapped__"),j=g&&fl.call(t,"__wrapped__");if(R||j){var te=R?e.value():e,W=j?t.value():t;return s||(s=new To),i(te,W,r,n,s)}}return M?(s||(s=new To),HO(e,t,r,n,i,s)):!1}var YO=XO;function $d(e,t,r,n,i){return e===t?!0:e==null||t==null||!On(e)&&!On(t)?e!==e&&t!==t:YO(e,t,r,n,$d,i)}var Cd=$d,QO=1,ZO=2;function eA(e,t,r,n){var i=r.length,s=i,o=!n;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var f=a[0],c=e[f],y=a[1];if(o&&a[2]){if(c===void 0&&!(f in e))return!1}else{var g=new To;if(n)var M=n(c,y,f,e,t,g);if(!(M===void 0?Cd(y,c,QO|ZO,n,g):M))return!1}}return!0}var tA=eA;function rA(e){return e===e&&!pi(e)}var Pd=rA;function nA(e){for(var t=Ed(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Pd(i)]}return t}var iA=nA;function oA(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Rd=oA;function sA(e){var t=iA(e);return t.length==1&&t[0][2]?Rd(t[0][0],t[0][1]):function(r){return r===e||tA(r,e,t)}}var aA=sA;function uA(e,t){return e!=null&&t in Object(e)}var cA=uA;function fA(e,t,r){t=Zo(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=xi(t[n]);if(!(s=e!=null&&r(e,o)))break;e=e[o]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&Ga(i)&&za(o,i)&&(Ht(e)||Ha(e)))}var lA=fA;function dA(e,t){return e!=null&&lA(e,t,cA)}var Ud=dA,pA=1,yA=2;function hA(e,t){return Wa(e)&&Pd(t)?Rd(xi(e),t):function(r){var n=AT(r,e);return n===void 0&&n===t?Ud(r,e):Cd(t,n,pA|yA)}}var mA=hA;function gA(e){return function(t){return t?.[e]}}var bA=gA;function vA(e){return function(t){return Xa(t,e)}}var _A=vA;function wA(e){return Wa(e)?bA(xi(e)):_A(e)}var TA=wA;function OA(e){return typeof e=="function"?e:e==null?_d:typeof e=="object"?Ht(e)?mA(e[0],e[1]):aA(e):TA(e)}var AA=OA;function IA(e,t,r,n){if(!pi(e))return e;t=Zo(t,e);for(var i=-1,s=t.length,o=s-1,a=e;a!=null&&++i<s;){var f=xi(t[i]),c=r;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=o){var y=a[f];c=n?n(y,f,a):void 0,c===void 0&&(c=pi(y)?y:za(t[i+1])?[]:{})}nw(a,f,c),a=a[f]}return e}var EA=IA;function SA(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=Xa(e,o);r(a,o)&&EA(s,Zo(o,e),a)}return s}var xA=SA;function NA(e,t){return xA(e,t,function(r,n){return Ud(e,n)})}var $A=NA,CA=PT(function(e,t){return e==null?{}:$A(e,t)}),ll=CA,PA=4294967295,RA=PA-1,UA=Math.floor,BA=Math.min;function kA(e,t,r,n){var i=0,s=e==null?0:e.length;if(s===0)return 0;t=r(t);for(var o=t!==t,a=t===null,f=di(t),c=t===void 0;i<s;){var y=UA((i+s)/2),g=r(e[y]),M=g!==void 0,R=g===null,j=g===g,te=di(g);if(o)var W=n||j;else c?W=j&&(n||M):a?W=j&&M&&(n||!R):f?W=j&&M&&!R&&(n||!te):R||te?W=!1:W=n?g<=t:g<t;W?i=y+1:s=y}return BA(s,RA)}var MA=kA;function DA(e,t,r){return MA(e,t,AA(r,2))}var jA=DA,{WARN:GS,LOG:HS,DEBUG:WS,VERBOSE:dl,ERROR:LA}=Se.setup(Se.INFO),Bd=(e,t,r="asc")=>r==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),kd=(e,t,r="asc")=>Bd(e.ts,t.ts,r);function Jr(e,t="asc"){return e.sort((r,n)=>kd(r,n,t))}var Md=(e,t)=>Dv(new Date(e.ts),new Date(t.ts));var Dd=(e,t,r)=>nt.structural(ll(e,r),ll(t,r)),Ya=e=>{let t=new Map;for(let r of e){if(!r)throw LA("falsy entry in applogs",e),new Error("falsy entry in applogs");let n=Wr(r);t.set(n,r)}return Array.from(t.values())};function jd(e){return typeof e=="string"&&e.startsWith("?")}function Ld(e){return e.slice(1)}function Qa(e,t){let r={};return[Object.entries(e).reduce((i,[s,o])=>{if(jd(o)){let a=Ld(o),f=t[a];f?i[s]=f:r[s]=a}else i[s]=o;return i},{}),r]}function Fd(e,t,r){dl("[matchPartStatic]",e,t,t===r?"===":"!==",r);let n=typeof t=="function"?t(r):Array.isArray(t)&&!Array.isArray(r)?t.includes(r):t===r;return dl("[matchPartStatic] =>",e.startsWith("!")?"!":"",n),e.startsWith("!")?!n:n}var Vd=function(t){for(var r=0,n=0,i=t.length;n<i;n++)r+=t[n];return r},pl=function(t){return Vd(t)/t.length},lt={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return lt.max(e)-lt.min(e)},midrange:function(e){return lt.range(e)/2},sum:Vd,mean:pl,average:pl,median:function(e){e.sort(function(r,n){return r-n});var t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2},modes:function(e){if(!e.length)return[];var t={},r=0,n=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>r?(n=[i],r=t[i]):t[i]===r&&(n.push(i),r=t[i])}),n},variance:function(e){var t=lt.mean(e);return lt.mean(e.map(function(r){return Math.pow(r-t,2)}))},standardDeviation:function(e){return Math.sqrt(lt.variance(e))},meanAbsoluteDeviation:function(e){var t=lt.mean(e);return lt.mean(e.map(function(r){return Math.abs(r-t)}))},zScores:function(e){var t=lt.mean(e),r=lt.standardDeviation(e);return e.map(function(n){return(n-t)/r})}};lt.average=lt.mean;function Za(){return new Date().toISOString()}var Ue=Dt(Qt(),1),Kd=Dt(xg(),1),Uo=e=>Ue.Type.Union([e,Ue.Type.Null()]);var zd=/^(k51qz|baguq)[0-9a-z]{56,57}$/,FA=/^[0-9A-Fa-f]{7,8}$/g;Ue.FormatRegistry.Set("EntityID",e=>!!e.match(FA)||!!e.match(zd));var eu=Ue.Type.String();Ue.FormatRegistry.Set("CID",e=>!!e.match(zd));var Bo=Ue.Type.String({format:"CID"}),VA=/^http([s]?):\/\/.*\..*/;Ue.FormatRegistry.Set("URL",e=>!!e.match(VA));var KA=Ue.Type.String({format:"URL"}),qd=Ue.Type.Object({en:eu,at:Ue.Type.String(),vl:Uo(Ue.Type.Union([Ue.Type.String(),Ue.Type.Boolean(),Ue.Type.Number()])),ts:Ue.Type.String(),ag:Ue.Type.String(),pv:Bo}),Ea=Kd.TypeCompiler.Compile(qd);var zA=Ea.Check.bind(Ea),Gd=Ue.Type.Object({cid:Bo,en:eu,at:Ue.Type.String(),vl:Uo(Ue.Type.Union([Ue.Type.String(),Ue.Type.Boolean(),Ue.Type.Number()])),ts:Ue.Type.String(),ag:Ue.Type.String(),pv:Uo(Bo)}),ko=Kd.TypeCompiler.Compile(Gd),Hd=e=>Array.from(ko.Errors(e)),tu=ko.Check.bind(ko),{WARN:Wd,LOG:JS,DEBUG:qA,VERBOSE:XS,ERROR:si}=Se.setup(Se.INFO);function Jd(e,{ts:t,threadForPv:r}={}){let n=Yd(e,t??Za()),i=Qd(n,r),s=ea(i).toString();e.cid&&e.cid!==s&&Wd("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:s,logWithPv:i});let o={...i,cid:s};if(!tu(o))throw si(`Bogus Applog ${JSON.stringify(o)}`,Hd(o));return Object.freeze(o)}function Xd(e){return!!e.ts}function Yd(e,t){return Xd(e)?e:{...e,ts:t}}function Qd(e,t){if(t){let{en:r,at:n}=e,i=Tr(t,{en:r,at:n});if(i.size>1)throw si("[withPvFrom] unexpected previous count:",i.size,{log:e,prevLogs:i,thread:t});let s=i.isEmpty?null:i.applogs[0],o=s?.cid===e.pv;if(Dd(e,s,["en","at","vl","ts","ag"]))throw si("[withPvFrom] Same as previous:",{log:e,pv:s,thread:t});e.pv&&!o&&Wd("[withPvFrom] different than pre-set pv:",{queriedPv:s,logPv:e.pv});let a=(e.pv!==void 0?e.pv:s?.cid)??null;return{...e,pv:a}}else{if(e.pv===void 0)throw si("[withPvFrom] no thread and no pv:",e);return e}}function Mo(e){let t=()=>(Be(()=>e.length<2&&qA(`joinThreads with count=${e.length}`)),Jr(Ya(e.flatMap(i=>{let s=i.applogs;if(!s)throw si("falsy applogs of thread",i),new Error("falsy applogs of thread");return s})))),r=Be(()=>t()),n=At(function(i,s){return nr(i)?{init:Be(()=>t())}:{added:i.added.filter(o=>!this.hasApplog(o,!0)),removed:i.added.filter(o=>!this.parents.some(a=>a===s?!1:a.hasApplog(o,!0)))}});return new es(Be(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],r,n)}var{WARN:yl,LOG:YS,DEBUG:hl,VERBOSE:Lr,ERROR:GA}=Se.setup(Se.INFO),es=class extends Ka{constructor(e,t,r,n,i){super(e,t,r,ke.array([...n],{deep:!1,name:`${e}.array`})),this.name=e,this._initialLogs=n,this._eventMapper=i,xn(this,{onParentUpdate:At}),this.subscribeToParents()}_parentSubscriptions=new Map;subscribeToParents(){let e=zt(()=>{this.parents.length||yl("MappedThread has no parents",this),Lr(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(r=>r.name));let t=new Set([...this._parentSubscriptions.keys()]);for(let r of this.parents){t.delete(r)&&Lr(`[MappedThread: ${this.name}] Skipping re-sub to parent`,r.nameAndSizeUntracked),Lr(`[MappedThread: ${this.name}] sub to new parent`,r.nameAndSizeUntracked);let i=this.onParentUpdate.bind(this,r),s=r.subscribe(i);this._parentSubscriptions.set(r,s)}for(let r of t)Lr(`[MappedThread: ${this.name}] un-subscribing from old parent`,r.nameAndSizeUntracked),this._parentSubscriptions.get(r)(),this._parentSubscriptions.delete(r)})}triggerRemap(){hl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&yl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(e=>{this.onParentUpdate(e,{init:Be(()=>_n(e.applogs))})})}onParentUpdate(e,t){Lr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,t);let r=this._eventMapper(t,e);if(Lr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,r),nr(r))this._applogs.replace([...r.init]);else{for(let n of r.added)this._applogs.splice(jA(this._applogs,n,"ts"),0,n);if(r.removed){for(let n of r.removed)if(!this._applogs.remove(n))if(!nr(t)&&t.removed?.includes(n))hl("Ignoring remove event for non-existent because it was part of parent event's removed",n,t);else throw GA(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,n,{thread:this,event:t,mapResult:r})}}Lr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Ai(this._applogs)),this.notifySubscribers(r)}},{WARN:QS,LOG:ZS,DEBUG:ex,VERBOSE:ua,ERROR:HA}=Se.setup(Se.INFO),Tr=it("rollingFilter",function(t,r,n={}){let i=ep(r),s=Sa(i),o=ke.array(Be(()=>s(t.applogs)),{deep:!1,name:`${t.name} | ${n.name||`rollingFilter.array{${Wr(i)}}`}`}),a=g=>{let M;return nr(g)?M={init:s(g.init)}:M={added:s(g.added),removed:g.removed},ua(`rollingFilter{${t.nameAndSizeUntracked} | ${n.name?` '${n.name}'}`:""} parentUpdate`,i,g,"=>",M),M},f=new es(`${t.name} | ${n.name||`rollingFilter{${Wr(i)}}`}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],o,a),c=ev(()=>JSON.parse(JSON.stringify(r)),g=>{ua(`rollingFilter<${t.nameAndSizeUntracked}>${n.name?` '${n.name}'`:""} patternUpdate`,i,"=>",g),i=g,s=Sa(i),f.triggerRemap()}),y=Oi(o,()=>{ua(`rollingFilter<${Be(()=>t.name)}>${n.name?` '${n.name}'`:""} unobserve`,i),c(),y()});return f},{equals:Si,argsDebugName:(e,t,r)=>Qe({caller:"rollingFilter",thread:e,pattern:t,args:r})}),Zd=it("rollingMapper",function(t,r,n={}){let i=Be(()=>r.call(null,{init:t.applogs},t));if(!nr(i))throw HA("Initial run must return init event");let s=i.init;return new es(`${t.name} | ${n.name||"rollingMapper"}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],s,r)},{equals:Si,argsDebugName:(e,t,r)=>Qe({caller:"rollingMapper",thread:e,args:r})}),WA=it("rollingAcc",function(t,r,n,i={}){return n=At(n),n({init:t.applogs},r),t.subscribe(s=>{n(s,r)}),r},{argsDebugName:(e,t,r,n)=>`rollingAcc{${e.nameAndSizeUntracked}${n?.name?` | ${n?.name}`:""}}`}),ep=function(t){let r=Be(()=>Object.fromEntries(Object.entries(_n(t)).map(([n,i])=>[_n(n),_n(i)])));if(!Object.entries(r).length)throw new Error("Pattern is empty");return r};function Sa(e){return t=>t.filter(r=>{for(let[n,i]of Object.entries(e)){let s=r[n.startsWith("!")?n.slice(1):n];if(!Fd(n,i,s))return!1}return!0})}var JA=class{constructor(e,t,r=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=r,xn(this,{threadOfTrail:Ge})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?Mo([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},tp=class{constructor(e){this.nodes=e,xn(this,{threadOfAllTrails:Ge,size:Ge,isEmpty:Ge})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Be(()=>this.records.length)}get records(){return er(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return Mo(er(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogs(){return er(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return Mo(er(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:tx,LOG:mi,DEBUG:Or,VERBOSE:xe,ERROR:Do}=Se.setup(Se.INFO,{prefix:"[q]"}),XA=it("lastWriteWins",function(t,{inverseToOnlyReturnFirstLogs:r,tolerateAlreadyFiltered:n}={}){if(xe(`lastWriteWins${r?".inversed":""} < ${t.nameAndSizeUntracked} > initializing`),t.filters.includes("lastWriteWins")){if(n)return Or("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),t;throw Do("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,s=Zd(t,function(o,a){let f=nr(o),c,y=[],g=f?null:[];f?(i=new Map,c=o.init):c=o.added;let M;for(let R=r?0:c.length-1;r?R<c.length:R>=0;r?R++:R--){let j=c[R],te=Wr([j.en,j.at]);if(M&&(r?M>j.ts:M<j.ts))throw Do("lastWriteWins.mapper logs not sorted:",M,r?">":"<",j.ts,{log:j,i:R,newLogs:c,inverseToOnlyReturnFirstLogs:r});M=j.ts;let W=i.get(te);(!W||(r?W.ts>j.ts:W.ts<j.ts))&&(W&&!f&&g.push(W),y.push(j),i.set(te,j))}return Jr(y),xe.isDisabled||xe(`lastWriteWins${r?".inversed":""}<${t.nameAndSizeUntracked}> mapped event`,f?{...Object.fromEntries(Object.entries(o).map(([R,j])=>[R,j?.length])),toAdd:y.length,toRemove:g}:{...o,toAdd:y,toRemove:g}),f?{init:y}:{added:y,removed:g}},{name:`lastWriteWins${r?".inversed":""}`,extraFilterName:"lastWriteWins"});return xe.isDisabled||zt(()=>{xe(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,s.applogs.length)}),s},{equals:Si,argsDebugName:e=>Qe({caller:"lastWriteWins",thread:e})}),rx=it("withoutDeleted",function(t){if(xe(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw Do("thread already filtered withoutDeleted:",t.filters,{name:t.name});let r=Tr(t,{at:["isDeleted","relation/isDeleted","block/isDeleted"],vl:!0},{name:"isDeleted"});xe(`withoutDeleted<${t.nameAndSizeUntracked}> deletionLogs:`,Be(()=>[...r.applogs]));let n=Qe({caller:"allDeletedEntities",thread:t}),i=er(()=>r.map(s=>s.en),{name:n});return xe.isDisabled||zt(()=>{xe(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),Tr(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:Si}),YA=it("query",function e(t,r,n={},i={}){Or(`query<${t.nameAndSizeUntracked}>:`,r);let s=Array.isArray(r)?r:[r],o;if(s.length===1)o=null;else{let c=s.slice(0,-1);o=e(t,c,n,i)}let a=s[s.length-1],f=QA(t,o,a,i);return xe.isDisabled||zt(()=>xe("query result:",_n(f))),f},{equals:Va,argsDebugName:(e,t,r)=>Qe({caller:"query",thread:e,args:r?{pattern:t,startVars:r}:t})}),QA=it("queryStep",function(t,r,n,i={}){if(Or(`queryStep<${t.nameAndSizeUntracked}> with`,r?.untrackedSize??"all","nodes, pattern:",n),!Object.entries(n).length)throw new Error("Pattern is empty");function s(a){let[f,c]=Qa(n,a?.variables??{});xe("[queryStep.doQuery] patternWithoutVars: ",f);let y=Tr(t,f),g=rp(c),M=er(()=>{let R=y.map(j=>({log:j,vars:g(j)}));return xe.isEnabled&&xe("[queryStep.doQuery] step node:",a?.variables," =>",R,"from:",Be(()=>y.applogs)),R.map(({log:j,vars:te})=>{let W=Object.assign({},a?.variables,te);return new JA(ts.fromArray([j],Qe({caller:"QueryNode",thread:y,pattern:`${Wr(W)}@${Wr(f)}`}),!0),W,a)})},{name:Qe({caller:"doQuery.mapNodes",thread:y,pattern:n})});return xe.isEnabled&&zt(()=>xe("[queryStep.doQuery] resultNodes:",[...M])),i.debug&&mi("[queryStep] step result:",Be(()=>M.map(({variables:R,logsOfThisNode:j})=>({variables:R,thread:j.applogs})))),M}let o=er(()=>(Or(`[queryStep] Running with ${r?.nodes?.length} input nodes:`),r?[...r.nodes.flatMap(s)]:[...s(null)]),{name:Qe({caller:"queryStep",thread:t,pattern:n})});return xe.isEnabled&&zt(()=>xe("[queryStep] observableResultNodes:",[...o])),new tp(o)},{equals:Va,argsDebugName:(e,t,r)=>Qe({caller:"queryStep",thread:e,pattern:r})}),nx=it("queryNot",function(t,r,n,i={}){let s=r.nodes;Or(`queryNot<${t.nameAndSizeUntracked}> from: ${s.length} nodes`);let o=Array.isArray(n)?n:[n];for(let a of o){if(!Object.entries(n).length)throw new Error("Pattern is empty");s=s.filter(({variables:f})=>{let[c,y]=Qa(a,f??{});xe("[queryNot] patternWithoutVars: ",c);let g=Tr(t,c);return xe("[queryNot] step node:",f," =>",g.size,"applogs"),xe.isDisabled||xe("[queryNot] step node:",f," => empty?",Be(()=>g.applogs)),i.debug&&mi("[queryNot] node result:",f,"=>",g.applogs),g.isEmpty})}return new tp(s)},{equals:Va,argsDebugName:(e,t,r)=>Qe({caller:"queryNot",thread:e,pattern:r})}),ix=it("filterAndMap",function(t,r,n){Or(`filterAndMap<${t.nameAndSizeUntracked}>`,r);let i=Tr(t,r);xe("[filterAndMap] filtered:",i.untrackedSize),xe.isDisabled||zt(()=>xe("[filterAndMap] filtered:",i.applogs));let s=function(){return typeof n=="function"?i.map(n):typeof n=="string"?i.map(c=>c[n]):i.map(rp(n))},o=Qe({thread:t,pattern:r,caller:"filterAndMap"}),a=er(s,{name:o});return xe.isDisabled||zt(()=>xe("[filterAndMap] mapped:",a)),a},{equals:nt.structural,argsDebugName:(e,t)=>Qe({caller:"filterAndMap",thread:e,pattern:t})}),ox=it("queryAndMap",function(t,r,n,i={}){Or(`queryAndMap<${t.nameAndSizeUntracked}>`,{patternOrPatterns:r,variables:i,map:n});let s=Qe({thread:t,caller:"queryAndMap"}),o=YA(t,r);xe("[queryAndMap] filtered count:",o.untrackedSize);let a=er(()=>{if(typeof n=="function")return o.records.map(n);if(typeof n=="string")return o.records.map(f=>f[n]);throw new Error("what's this map param about?")},{name:s});return xe.isDisabled||zt(()=>xe("[queryAndMap] result:",_n(a))),a},{equals:nt.structural,argsDebugName:(e,t)=>Qe({caller:"queryAndMap",thread:e,pattern:t})}),sx=it("queryEntity",function(t,r,n,i){Or(`queryEntity<${t.nameAndSizeUntracked}>`,n,r);let s=Tr(t,{en:n,at:e1(r,i)});return xe("queryEntity applogs:",s.applogs),Ge(()=>s.isEmpty?null:Object.fromEntries(s.map(({at:o,vl:a})=>[o.slice(r.length+1),a])))},{equals:Rv,argsDebugName:(e,t,r)=>Qe({caller:"queryEntity",thread:e,args:{name:t,entityID:r}})}),ax=it("agentsOfThread",function(t){mi(`agentsOfThread<${t.nameAndSizeUntracked}>`);let r=ke.map(),n=At(s=>{for(let o of nr(s)?s.init:s.added){let a=r.get(o.ag)??0;r.set(o.ag,a+1)}for(let o of!nr(s)&&s.removed||[]){let a=r.get(o.ag);if(!a||a<1)throw Do("[agentsOfThread] number is now negative",{log:o,event:s,mapped:r,prev:a});r.set(o.ag,a-1)}mi(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:s,mapped:r})});n({init:t.applogs});let i=t.subscribe(n);return Ql(r,i),r}),ZA=it("entityOverlap",function(t,r){return mi(`entityOverlap<${t.nameAndSizeUntracked}, ${r.nameAndSizeUntracked}>`),Ge(()=>{let n=new Set(t.map(s=>s.en)),i=new Set(r.map(s=>s.en));return[...n].filter(s=>i.has(s))})});var ux=it("entityOverlapCount",function(t,r){return Ge(()=>ZA(t,r).get().length)});function rp(e){return t=>Object.entries(e).reduce((r,[n,i])=>(r[i]=t[n],r),{})}function e1(e,t){return t.map(r=>t1(e,r))}function t1(e,t){return`${e}/${t}`}var{WARN:r1,LOG:n1,DEBUG:cx,VERBOSE:i1,ERROR:Oo}=Se.setup(Se.INFO),np=class extends Ka{constructor(e,t=[],r){super(e,null,r,t),xn(this,{})}insert(e){let t=Za(),r=XA(this),n=e.map(i=>Jd(i,{ts:t,threadForPv:r}));return this.insertRaw(n)}insertRaw(e){let t=Ya(e);if(t.length!==e.length)throw Oo(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});let r=e.filter(s=>!tu(s));if(r.length)throw Oo(`[insertRaw] bogus applogs passed: ${r.length}`,{bogus:r});let n=e.filter(s=>this.hasApplog(s,!1));if(n.length)throw Oo(`[insertRaw] already existing applogs passed: ${n.length}`,{existing:n});if(!e.length){r1("[insertRaw] skipping empty insert empty logs array");return}n1("Inserting:",e.length===1?e[0]:e,{ds:this}),Jr(e);let i=this._applogs.length&&Md(e[0],this._applogs[this._applogs.length-1]);return this._applogs.push(...e),i&&Jr(this._applogs),this.notifySubscribers({added:e,removed:null}),this.persist(e),e}get readOnly(){return!1}},ts=class xa extends np{constructor(t,r,n,i){super(t,r,n),this._readOnly=i,xn(this,{_applogs:ke.shallow})}static empty(t){return xa.fromArray([],t??"empty in-memory",!1)}static fromArray(t,r,n=!1){return new xa(r??"in-memory",t,[],n)}get readOnly(){return this._readOnly}persist(t){if(i1("[InMem.persist] no persist for",t),this.readOnly)throw Oo("[persist] called for readOnly thread")}};var o1=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){"use strict";t.exports=o;var r=128,n=127,i=~n,s=Math.pow(2,31);function o(a,f,c){if(Number.MAX_SAFE_INTEGER&&a>Number.MAX_SAFE_INTEGER)throw o.bytes=0,new RangeError("Could not encode varint");f=f||[],c=c||0;for(var y=c;a>=s;)f[c++]=a&255|r,a/=128;for(;a&i;)f[c++]=a&255|r,a>>>=7;return f[c]=a|0,o.bytes=c-y+1,f}}}),s1=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){"use strict";t.exports=i;var r=128,n=127;function i(s,f){var a=0,f=f||0,c=0,y=f,g,M=s.length;do{if(y>=M||c>49)throw i.bytes=0,new RangeError("Could not decode varint");g=s[y++],a+=c<28?(g&n)<<c:(g&n)*Math.pow(2,c),c+=7}while(g>=r);return i.bytes=y-f,a}}}),a1=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){"use strict";var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),s=Math.pow(2,28),o=Math.pow(2,35),a=Math.pow(2,42),f=Math.pow(2,49),c=Math.pow(2,56),y=Math.pow(2,63);t.exports=function(g){return g<r?1:g<n?2:g<i?3:g<s?4:g<o?5:g<a?6:g<f?7:g<c?8:g<y?9:10}}}),su=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:o1(),decode:s1(),encodingLength:a1()}}}),u1=42;function c1(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Yt.decode(e.subarray(1))}var sp={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};sp.tags[u1]=c1;var f1=e=>Xs(e,sp),tn=Dt(su(),1),ru={SHA2_256:18,LENGTH:32,DAG_PB:112},l1=40;function rs(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=tn.default.decode(e);return t.seek(tn.default.decode.bytes),r}function d1(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0;return{version:2,characteristics:[t.getBigUint64(r,!0),t.getBigUint64(r+=8,!0)],dataOffset:Number(t.getBigUint64(r+=8,!0)),dataSize:Number(t.getBigUint64(r+=8,!0)),indexOffset:Number(t.getBigUint64(r+=8,!0))}}function p1(e){tn.default.decode(e);let t=tn.default.decode.bytes,r=tn.default.decode(e.subarray(tn.default.decode.bytes)),n=tn.default.decode.bytes;return t+n+r}var Ir={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},Ni={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Ir.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Ir.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Ni["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=Ni["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:Ir.Int,CarV1HeaderOrV2Pragma:e=>{if(Ir.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=Ni["CarV1HeaderOrV2Pragma > roots (anon)"](e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.roots=a}}break;case"version":{n--;let a=Ni.Int(e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},$i={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Ir.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Ir.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=$i["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=$i["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:Ir.Int,CarV1HeaderOrV2Pragma:e=>{if(Ir.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=$i["CarV1HeaderOrV2Pragma > roots (anon)"](o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.roots=a}}break;case"version":{n--;let a=$i.Int(o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},y1={toTyped:Ni.CarV1HeaderOrV2Pragma,toRepresentation:$i.CarV1HeaderOrV2Pragma},Zx=Js(),eN=Dt(su(),1),tN=[new Z(C.map,2),new Z(C.string,"version"),new Z(C.uint,1),new Z(C.string,"roots")],rN=new Z(C.tag,42);async function ap(e,t){let r=rs(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=f1(n);if(y1.toTyped(i)===void 0)throw new Error("Invalid CAR header format");if(i.version!==1&&i.version!==2||t!==void 0&&i.version!==t)throw new Error(`Invalid CAR version: ${i.version}${t!==void 0?` (expected ${t})`:""}`);if(i.version===1){if(!Array.isArray(i.roots))throw new Error("Invalid CAR header format");return i}if(i.roots!==void 0)throw new Error("Invalid CAR header format");let s=d1(await e.exactly(l1,!0));e.seek(s.dataOffset-e.pos);let o=await ap(e,1);return Object.assign(o,s)}async function h1(e){let t=await e.exactly(2,!1);if(t[0]===ru.SHA2_256&&t[1]===ru.LENGTH){let o=await e.exactly(34,!0),a=ti(o);return Yt.create(0,ru.DAG_PB,a)}let r=rs(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=rs(await e.upTo(8),e),i=await e.exactly(p1(await e.upTo(8)),!0),s=ti(i);return Yt.create(r,n,s)}async function up(e){let t=e.pos,r=rs(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await h1(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function m1(e){let{cid:t,blockLength:r}=await up(e);return{bytes:await e.exactly(r,!0),cid:t}}async function g1(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await up(e),s={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(s.blockLength),s}function cp(e){let t=(async()=>{let r=await ap(e);if(r.version===2){let n=e.pos-r.dataOffset;e=v1(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await m1(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await g1(e)}}}function fp(e){let t=0;return{async upTo(r){return e.subarray(t,t+Math.min(r,e.length-t))},async exactly(r,n=!1){if(r>e.length-t)throw new Error("Unexpected end of data");let i=e.subarray(t,t+r);return n&&(t+=r),i},seek(r){t+=r},get pos(){return t}}}function b1(e){let t=0,r=0,n=0,i=new Uint8Array(0),s=async o=>{r=i.length-n;let a=[i.subarray(n)];for(;r<o;){let c=await e();if(c==null)break;r<0?c.length>r&&a.push(c.subarray(-r)):a.push(c),r+=c.length}i=new Uint8Array(a.reduce((c,y)=>c+y.length,0));let f=0;for(let c of a)i.set(c,f),f+=c.length;n=0};return{async upTo(o){return i.length-n<o&&await s(o),i.subarray(n,n+Math.min(i.length-n,o))},async exactly(o,a=!1){if(i.length-n<o&&await s(o),i.length-n<o)throw new Error("Unexpected end of data");let f=i.subarray(n,n+o);return a&&(t+=o,n+=o),f},seek(o){t+=o,n+=o},get pos(){return t}}}function lp(e){let t=e[Symbol.asyncIterator]();async function r(){let n=await t.next();return n.done?null:n.value}return b1(r)}function v1(e,t){let r=0;return{async upTo(n){let i=await e.upTo(n);return i.length+r>t&&(i=i.subarray(0,t-r)),i},async exactly(n,i=!1){let s=await e.exactly(n,i);if(s.length+r>t)throw new Error("Unexpected end of data");return i&&(r+=n),s},seek(n){r+=n,e.seek(n)},get pos(){return e.pos}}}var _1=class{constructor(e,t,r){this._version=e,this._roots=t,this._iterator=r}get version(){return this._version}async getRoots(){return this._roots}[Symbol.asyncIterator](){return this._iterator}static async fromBytes(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return ip(fp(e))}static async fromIterable(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return ip(lp(e))}};async function ip(e){let t=cp(e),{version:r,roots:n}=await t.header();return new _1(r,n,t.blocksIndex())}var dp=class{constructor(e,t,r){this._version=e,this._roots=t,this._iterable=r,this._decoded=!1}get version(){return this._version}async getRoots(){return this._roots}},nN=class iu extends dp{[Symbol.asyncIterator](){if(this._decoded)throw new Error("Cannot decode more than once");if(!this._iterable)throw new Error("Block iterable not found");return this._decoded=!0,this._iterable[Symbol.asyncIterator]()}static async fromBytes(t){let{version:r,roots:n,iterator:i}=await pp(t);return new iu(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await yp(t);return new iu(r,n,i)}},iN=class ou extends dp{[Symbol.asyncIterator](){if(this._decoded)throw new Error("Cannot decode more than once");if(!this._iterable)throw new Error("Block iterable not found");this._decoded=!0;let t=this._iterable[Symbol.asyncIterator]();return{async next(){let r=await t.next();return r.done?r:{done:!1,value:r.value.cid}}}}static async fromBytes(t){let{version:r,roots:n,iterator:i}=await pp(t);return new ou(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await yp(t);return new ou(r,n,i)}};async function pp(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return hp(fp(e))}async function yp(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return hp(lp(e))}async function hp(e){let t=cp(e),{version:r,roots:n}=await t.header();return{version:r,roots:n,iterator:t.blocks()}}var oN=Dt(su(),1);var sN=class{constructor(e){this._iterator=e}[Symbol.asyncIterator](){if(this._iterating)throw new Error("Multiple iterator not supported");return this._iterating=!0,this._iterator}};var{WARN:w1,LOG:aN,DEBUG:nu,VERBOSE:uN,ERROR:op}=Se.setup(Se.INFO);async function au(e){let{roots:t,blocks:r}=await mp(e);if(!t||!r)throw op("decodeCar is funky",{roots:t,blocks:r});t.length!==1&&w1("Unexpected roots count:",t);let n=r.get(t[0]),i;nu("root:",n,{blocks:r}),n.info?(i=r.get(n.applogs.toString()).logs,nu("new format - infoLogs",r.get(n.info.toString()))):i=n.applogs;let s;return s=i.map(o=>{let a=o.toV1?o.toV1().toString():o["/"],f=r.get(a);if(!f)throw op("Could not find applog CID in Car file:",a,{root:n,blocks:r}),new Error(`Could not find applog CID in Car file: ${a.toString()}`);return f.pv instanceof Yt&&(f.pv=f.pv.toV1().toString()),{...f,cid:a}}),nu("Decoded car logs:",n,{roots:t,blocks:r,applogs:s}),{applogs:s}}async function mp(e){let t=(await e.getRoots()).map(n=>n.toV1().toString()),r=new Map;for await(let{cid:n,bytes:i}of e.blocks())r.set(n.toV1().toString(),lo(i));return{roots:t,blocks:r}}function uu(e){return async function*(){for(;;){let{done:t,value:r}=await e.read();if(t)break;yield r}}()}var gp=fs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),RN=fs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var{WARN:ns,LOG:qN,DEBUG:Ci,VERBOSE:bp,ERROR:Pi}=cs.setup(cs.DEBUG),T1=114,O1=["https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=all","https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=all"];async function GN(e,{readOnly:t=!0,pinnedCID:r}={}){let n,i=[];try{n=ot.parse(e)}catch(g){bp("[retrieveThread] couldn't parse pubID with default base"),i.push(g)}if(!n)try{n=ot.parse(e,gp)}catch(g){bp("[retrieveThread] couldn't parse pubID with default base"),i.push(g)}if(!n)throw Pi("Failed to parse pubID",e,i);Ci("[retrieveThread] parsedPubID",n);let s;if(n.code!==T1)Ci("[retrieveThread] pubID is not IPNS - using as CID"),s=n;else if(r)Ci("[retrieveThread] using pinnedCID"),s=ot.parse(r);else{if(!e)throw Pi("[retrieveThread] neither pubID nor pinnedCID provided");try{s=await A1(e),Ci("Resolved pub to CID",s.toString())}catch(g){throw Pi(`Failed to resolve IPNS ${e}:`,g)}}let o=await I1(s),{applogs:a}=await au(o),f=a.filter(g=>g instanceof Uint8Array);f.length&&ns(`Found ${f.length} encrypted logs - skipping`);let c=a.filter(g=>!(g instanceof Uint8Array));Jr(c);let y=ts.fromArray(c,`preview${e&&e!==s.toString()?"-"+e:""}@${s.toString()}`,t);return{cid:s,thread:y,encryptedCount:f.length}}async function A1(e){let r=await(await fetch(`https://name.web3.storage/name/${e}`)).json();return r.value.startsWith("/ipfs/")||ns("IPNS value is not '/ipfs/..':",r),ot.parse(r.value.replace("/ipfs/",""))}async function I1(e){Ci("Retrieving:",e);let t;for(let r of O1){let n=r.replaceAll("CID",e.toString()),i=await fetch(n);(!i?.ok||!i?.body)&&(t=Pi(`[retrieveCar] unexpected response ${i?.statusText}`,{url:n}),ns("Gateway failed:",n,t)),t=uu(i.body.getReader())}if(t instanceof Error)throw t;return(await E1(t)).car}async function E1(e){let t=fr(lr(e)),r=await t.header(),n=[],i=!1;try{for await(let s of t.blocks())n.push(s);i=!0}catch(s){if(Pi("Failed to read car:",s,{blocks:n,header:r}),n.length===0)throw s;ns(`Returning half-baked car with ${n.length} blocks`)}return{complete:i,car:new Pr(r,n)}}export{GN as a,A1 as b,I1 as c};
60
+ /*! Bundled license information:
61
+
62
+ @noble/hashes/esm/utils.js:
63
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
64
+ */
65
+ /*! Bundled license information:
66
+
67
+ lodash-es/lodash.js:
68
+ (**
69
+ * @license
70
+ * Lodash (Custom Build) <https://lodash.com/>
71
+ * Build: `lodash modularize exports="es" -o ./`
72
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
73
+ * Released under MIT license <https://lodash.com/license>
74
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
75
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
76
+ *)
77
+ */
78
+ //# sourceMappingURL=chunk-7X62O6KC.min.js.map