@wovin/connect-nftstorage 0.0.9-RC4 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,78 +0,0 @@
1
- import{b as Ui,d as fs,e as ls,f as Bi,g as xt}from"./chunk-SOBCOB7T.min.js";var bc=Ui((AI,gc)=>{"use strict";gc.exports=ws;var mc=128,Qp=127,Zp=~Qp,ey=Math.pow(2,31);function ws(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw ws.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=ey;)t[r++]=e&255|mc,e/=128;for(;e&Zp;)t[r++]=e&255|mc,e>>>=7;return t[r]=e|0,ws.bytes=r-n+1,t}});var wc=Ui((II,_c)=>{"use strict";_c.exports=Ts;var ty=128,vc=127;function Ts(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a||i>49)throw Ts.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&vc)<<i:(o&vc)*Math.pow(2,i),i+=7}while(o>=ty);return Ts.bytes=s-n,r}});var Oc=Ui((EI,Tc)=>{"use strict";var ry=Math.pow(2,7),ny=Math.pow(2,14),iy=Math.pow(2,21),oy=Math.pow(2,28),sy=Math.pow(2,35),ay=Math.pow(2,42),uy=Math.pow(2,49),cy=Math.pow(2,56),fy=Math.pow(2,63);Tc.exports=function(e){return e<ry?1:e<ny?2:e<iy?3:e<oy?4:e<sy?5:e<ay?6:e<uy?7:e<cy?8:e<fy?9:10}});var Wi=Ui((SI,Ac)=>{"use strict";Ac.exports={encode:bc(),decode:wc(),encodingLength:Oc()}});var wp=["string","number","bigint","symbol"],Tp=["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 du(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(wp.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Op(e))return"Buffer";let r=Ap(e);return r||"Object"}function Op(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Ap(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Tp.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 an=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Ip=new TextDecoder,Ep=new TextEncoder;function ki(e){return an&&globalThis.Buffer.isBuffer(e)}function mu(e){return e instanceof Uint8Array?ki(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var gu=an?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):yu(e,t,r):(e,t,r)=>r-t>64?Ip.decode(e.subarray(t,r)):yu(e,t,r),bu=an?e=>e.length>64?globalThis.Buffer.from(e):pu(e):e=>e.length>64?Ep.encode(e):pu(e);var un=an?(e,t,r)=>ki(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),vu=an?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),mu(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},_u=an?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function wu(e,t){if(ki(e)&&ki(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 pu(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 yu(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 Sp(n)}var hu=4096;function Sp(e){let t=e.length;if(t<=hu)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=hu));return r}var xp=256,Mi=class{constructor(t=xp){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=_u(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=un(n,0,this.cursor)}else r=vu(this.chunks,this.cursor);return t&&this.reset(),r}};var ve="CBOR decode error:",ds="CBOR encode error:",Ln=[];Ln[23]=1;Ln[24]=2;Ln[25]=3;Ln[26]=5;Ln[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 it(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 ot(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 st(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 at(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 Tu(e,t,r,n){return new ce(L.uint,it(e,t+1,n),2)}function Ou(e,t,r,n){return new ce(L.uint,ot(e,t+1,n),3)}function Au(e,t,r,n){return new ce(L.uint,st(e,t+1,n),5)}function Iu(e,t,r,n){return new ce(L.uint,at(e,t+1,n),9)}function ht(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`)}}ht.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};ht.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function Eu(e,t,r,n){return new ce(L.negint,-1-it(e,t+1,n),2)}function Su(e,t,r,n){return new ce(L.negint,-1-ot(e,t+1,n),3)}function xu(e,t,r,n){return new ce(L.negint,-1-st(e,t+1,n),5)}var ps=BigInt(-1),Nu=BigInt(1);function $u(e,t,r,n){let i=at(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,ps-BigInt(i),9)}function Di(e,t){let r=t.value,n=typeof r=="bigint"?r*ps-Nu:r*-1-1;ze(e,t.type.majorEncoded,n)}Di.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*ps-Nu:r*-1-1;return n<Ke[0]?1:n<Ke[1]?2:n<Ke[2]?3:n<Ke[3]?5:9};Di.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function Fn(e,t,r,n){Xt(e,t,r+n);let i=un(e,t+r,t+r+n);return new ce(L.bytes,i,r+n)}function Cu(e,t,r,n){return Fn(e,t,1,r)}function Pu(e,t,r,n){return Fn(e,t,2,it(e,t+1,n))}function Ru(e,t,r,n){return Fn(e,t,3,ot(e,t+1,n))}function Uu(e,t,r,n){return Fn(e,t,5,st(e,t+1,n))}function Bu(e,t,r,n){let i=at(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer bytes lengths not supported`);return Fn(e,t,9,i)}function ji(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===L.string?bu(e.value):e.value),e.encodedBytes}function cn(e,t){let r=ji(t);ze(e,t.type.majorEncoded,r.length),e.push(r)}cn.encodedSize=function(t){let r=ji(t);return ze.encodedSize(r.length)+r.length};cn.compareTokens=function(t,r){return $p(ji(t),ji(r))};function $p(e,t){return e.length<t.length?-1:e.length>t.length?1:wu(e,t)}function Vn(e,t,r,n,i){let s=r+n;Xt(e,t,s);let o=new ce(L.string,gu(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=un(e,t+r,t+s)),o}function ku(e,t,r,n){return Vn(e,t,1,r,n)}function Mu(e,t,r,n){return Vn(e,t,2,it(e,t+1,n),n)}function Du(e,t,r,n){return Vn(e,t,3,ot(e,t+1,n),n)}function ju(e,t,r,n){return Vn(e,t,5,st(e,t+1,n),n)}function Lu(e,t,r,n){let i=at(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer string lengths not supported`);return Vn(e,t,9,i,n)}var Fu=cn;function fn(e,t,r,n){return new ce(L.array,n,r)}function Vu(e,t,r,n){return fn(e,t,1,r)}function Ku(e,t,r,n){return fn(e,t,2,it(e,t+1,n))}function zu(e,t,r,n){return fn(e,t,3,ot(e,t+1,n))}function qu(e,t,r,n){return fn(e,t,5,st(e,t+1,n))}function Gu(e,t,r,n){let i=at(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer array lengths not supported`);return fn(e,t,9,i)}function Hu(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 Li(e,t){ze(e,L.array.majorEncoded,t.value)}Li.compareTokens=ht.compareTokens;Li.encodedSize=function(t){return ze.encodedSize(t.value)};function ln(e,t,r,n){return new ce(L.map,n,r)}function Wu(e,t,r,n){return ln(e,t,1,r)}function Ju(e,t,r,n){return ln(e,t,2,it(e,t+1,n))}function Xu(e,t,r,n){return ln(e,t,3,ot(e,t+1,n))}function Yu(e,t,r,n){return ln(e,t,5,st(e,t+1,n))}function Qu(e,t,r,n){let i=at(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer map lengths not supported`);return ln(e,t,9,i)}function Zu(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return ln(e,t,1,1/0)}function Fi(e,t){ze(e,L.map.majorEncoded,t.value)}Fi.compareTokens=ht.compareTokens;Fi.encodedSize=function(t){return ze.encodedSize(t.value)};function ec(e,t,r,n){return new ce(L.tag,r,1)}function tc(e,t,r,n){return new ce(L.tag,it(e,t+1,n),2)}function rc(e,t,r,n){return new ce(L.tag,ot(e,t+1,n),3)}function nc(e,t,r,n){return new ce(L.tag,st(e,t+1,n),5)}function ic(e,t,r,n){return new ce(L.tag,at(e,t+1,n),9)}function Vi(e,t){ze(e,L.tag.majorEncoded,t.value)}Vi.compareTokens=ht.compareTokens;Vi.encodedSize=function(t){return ze.encodedSize(t.value)};var kp=20,Mp=21,Dp=22,jp=23;function oc(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 sc(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 ys(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 ac(e,t,r,n){return ys(hs(e,t+1),3,n)}function uc(e,t,r,n){return ys(ms(e,t+1),5,n)}function cc(e,t,r,n){return ys(pc(e,t+1),9,n)}function Ki(e,t,r){let n=t.value;if(n===!1)e.push([L.float.majorEncoded|kp]);else if(n===!0)e.push([L.float.majorEncoded|Mp]);else if(n===null)e.push([L.float.majorEncoded|Dp]);else if(n===void 0)e.push([L.float.majorEncoded|jp]);else{let i,s=!1;(!r||r.float64!==!0)&&(lc(n),i=hs(Nt,1),n===i||Number.isNaN(n)?(Nt[0]=249,e.push(Nt.slice(0,3)),s=!0):(dc(n),i=ms(Nt,1),n===i&&(Nt[0]=250,e.push(Nt.slice(0,5)),s=!0))),s||(Lp(n),i=pc(Nt,1),Nt[0]=251,e.push(Nt.slice(0,9)))}}Ki.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){lc(n);let i=hs(Nt,1);if(n===i||Number.isNaN(n))return 3;if(dc(n),i=ms(Nt,1),n===i)return 5}return 9};var fc=new ArrayBuffer(9),mt=new DataView(fc,1),Nt=new Uint8Array(fc,0);function lc(e){if(e===1/0)mt.setUint16(0,31744,!1);else if(e===-1/0)mt.setUint16(0,64512,!1);else if(Number.isNaN(e))mt.setUint16(0,32256,!1);else{mt.setFloat32(0,e);let t=mt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)mt.setUint16(0,31744,!1);else if(r===0)mt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?mt.setUint16(0,0):i<-14?mt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):mt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function hs(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 dc(e){mt.setFloat32(0,e,!1)}function ms(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 Lp(e){mt.setFloat64(0,e,!1)}function pc(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)}Ki.compareTokens=ht.compareTokens;function Oe(e,t,r){throw new Error(`${ve} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function zi(e){return()=>{throw new Error(`${ve} ${e}`)}}var ae=[];for(let e=0;e<=23;e++)ae[e]=Oe;ae[24]=Tu;ae[25]=Ou;ae[26]=Au;ae[27]=Iu;ae[28]=Oe;ae[29]=Oe;ae[30]=Oe;ae[31]=Oe;for(let e=32;e<=55;e++)ae[e]=Oe;ae[56]=Eu;ae[57]=Su;ae[58]=xu;ae[59]=$u;ae[60]=Oe;ae[61]=Oe;ae[62]=Oe;ae[63]=Oe;for(let e=64;e<=87;e++)ae[e]=Cu;ae[88]=Pu;ae[89]=Ru;ae[90]=Uu;ae[91]=Bu;ae[92]=Oe;ae[93]=Oe;ae[94]=Oe;ae[95]=zi("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ae[e]=ku;ae[120]=Mu;ae[121]=Du;ae[122]=ju;ae[123]=Lu;ae[124]=Oe;ae[125]=Oe;ae[126]=Oe;ae[127]=zi("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ae[e]=Vu;ae[152]=Ku;ae[153]=zu;ae[154]=qu;ae[155]=Gu;ae[156]=Oe;ae[157]=Oe;ae[158]=Oe;ae[159]=Hu;for(let e=160;e<=183;e++)ae[e]=Wu;ae[184]=Ju;ae[185]=Xu;ae[186]=Yu;ae[187]=Qu;ae[188]=Oe;ae[189]=Oe;ae[190]=Oe;ae[191]=Zu;for(let e=192;e<=215;e++)ae[e]=ec;ae[216]=tc;ae[217]=rc;ae[218]=nc;ae[219]=ic;ae[220]=Oe;ae[221]=Oe;ae[222]=Oe;ae[223]=Oe;for(let e=224;e<=243;e++)ae[e]=zi("simple values are not supported");ae[244]=Oe;ae[245]=Oe;ae[246]=Oe;ae[247]=oc;ae[248]=zi("simple values are not supported");ae[249]=ac;ae[250]=uc;ae[251]=cc;ae[252]=Oe;ae[253]=Oe;ae[254]=Oe;ae[255]=sc;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 gs(){let e=[];return e[L.uint.major]=ht,e[L.negint.major]=Di,e[L.bytes.major]=cn,e[L.string.major]=Fu,e[L.array.major]=Li,e[L.map.major]=Fi,e[L.tag.major]=Vi,e[L.float.major]=Ki,e}var pI=gs(),yI=new Mi,Gi=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(`${ds} object contains circular references`);return new e(r,t)}},or={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)},sr={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?or.true:or.false},null(e,t,r,n){return or.null},undefined(e,t,r,n){return or.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?[or.emptyArray,new ce(L.break)]:or.emptyArray;n=Gi.createCheck(n,e);let i=[],s=0;for(let o of e)i[s++]=qi(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?[or.emptyMap,new ce(L.break)]:or.emptyMap;n=Gi.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 Kp(a,r),r.addBreakTokens?[new ce(L.map,o),a,new ce(L.break)]:[new ce(L.map,o),a]}};sr.Map=sr.Object;sr.Buffer=sr.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))sr[`${e}Array`]=sr.DataView;function qi(e,t={},r){let n=du(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||sr[n];if(typeof i=="function"){let o=i(e,n,t,r);if(o!=null)return o}let s=sr[n];if(!s)throw new Error(`${ds} unsupported type: ${n}`);return s(e,n,t,r)}function Kp(e,t){t.mapSorter&&e.sort(t.mapSorter)}var zp={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},bs=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}},Kn=Symbol.for("DONE"),Hi=Symbol.for("BREAK");function qp(e,t,r){let n=[];for(let i=0;i<e.value;i++){let s=zn(t,r);if(s===Hi){if(e.value===1/0)break;throw new Error(`${ve} got unexpected break to lengthed array`)}if(s===Kn)throw new Error(`${ve} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=s}return n}function Gp(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=zn(t,r);if(a===Hi){if(e.value===1/0)break;throw new Error(`${ve} got unexpected break to lengthed map`)}if(a===Kn)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=zn(t,r);if(f===Kn)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 zn(e,t){if(e.done())return Kn;let r=e.next();if(r.type===L.break)return Hi;if(r.type.terminal)return r.value;if(r.type===L.array)return qp(r,e,t);if(r.type===L.map)return Gp(r,e,t);if(r.type===L.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=zn(e,t);return t.tags[r.value](n)}throw new Error(`${ve} tag not supported (${r.value})`)}throw new Error("unsupported")}function yc(e,t){if(!(e instanceof Uint8Array))throw new Error(`${ve} data to decode must be a Uint8Array`);t=Object.assign({},zp,t);let r=t.tokenizer||new bs(e,t),n=zn(r,t);if(n===Kn)throw new Error(`${ve} did not find any content to decode`);if(n===Hi)throw new Error(`${ve} got unexpected break`);return[n,e.subarray(r.pos())]}function vs(e,t){let[r,n]=yc(e,t);if(n.length>0)throw new Error(`${ve} too many terminals, data makes no sense`);return r}var Jp=42;function Xp(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return xt.decode(e.subarray(1))}var hc={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};hc.tags[Jp]=Xp;var _s=e=>vs(e,hc);var ar=fs(Wi(),1),qn={SHA2_256:18,LENGTH:32,DAG_PB:112},Os=40;function dn(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=ar.default.decode(e);return t.seek(ar.default.decode.bytes),r}function As(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 Is(e){ar.default.decode(e);let t=ar.default.decode.bytes,r=ar.default.decode(e.subarray(ar.default.decode.bytes)),n=ar.default.decode.bytes;return t+n+r}var ur={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},Gn={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":ur.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(ur.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Gn["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=Gn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:ur.Int,CarV1HeaderOrV2Pragma:e=>{if(ur.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=Gn["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=Gn.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}},Hn={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":ur.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(ur.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Hn["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=Hn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:ur.Int,CarV1HeaderOrV2Pragma:e=>{if(ur.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=Hn["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=Hn.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}},Es={toTyped:Gn.CarV1HeaderOrV2Pragma,toRepresentation:Hn.CarV1HeaderOrV2Pragma};var DI=gs();var yy=fs(Wi(),1);var KI=[new ce(L.map,2),new ce(L.string,"version"),new ce(L.uint,1),new ce(L.string,"roots")],zI=new ce(L.tag,42);async function Ss(e,t){let r=dn(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=_s(n);if(Es.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=As(await e.exactly(Os,!0));e.seek(s.dataOffset-e.pos);let o=await Ss(e,1);return Object.assign(o,s)}async function my(e){let t=await e.exactly(2,!1);if(t[0]===qn.SHA2_256&&t[1]===qn.LENGTH){let o=await e.exactly(34,!0),a=Bi(o);return xt.create(0,qn.DAG_PB,a)}let r=dn(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=dn(await e.upTo(8),e),i=await e.exactly(Is(await e.upTo(8)),!0),s=Bi(i);return xt.create(r,n,s)}async function Ic(e){let t=e.pos,r=dn(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await my(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function gy(e){let{cid:t,blockLength:r}=await Ic(e);return{bytes:await e.exactly(r,!0),cid:t}}async function by(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await Ic(e),s={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(s.blockLength),s}function cr(e){let t=(async()=>{let r=await Ss(e);if(r.version===2){let n=e.pos-r.dataOffset;e=_y(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await gy(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await by(e)}}}function Pr(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 vy(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 fr(e){let t=e[Symbol.asyncIterator]();async function r(){let n=await t.next();return n.done?null:n.value}return vy(r)}function _y(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 Wn=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 Ec(Pr(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Ec(fr(t))}};async function Ec(e){let t=cr(e),{version:r,roots:n}=await t.header();return new Wn(r,n,t.blocksIndex())}var Rr=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 Sc(Pr(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Sc(fr(t))}};async function Sc(e){let t=cr(e),r=await t.header(),n=[];for await(let i of t.blocks())n.push(i);return new Rr(r,n)}var Ji=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}},xs=class e extends Ji{[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 xc(t);return new e(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await Nc(t);return new e(r,n,i)}},Ns=class e extends Ji{[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 xc(t);return new e(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await Nc(t);return new e(r,n,i)}};async function xc(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return $c(Pr(e))}async function Nc(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return $c(fr(e))}async function $c(e){let t=cr(e),{version:r,roots:n}=await t.header();return{version:r,roots:n,iterator:t.blocks()}}var wy=fs(Wi(),1);var Cc=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 Ty=Object.create,$s=Object.defineProperty,Oy=Object.getOwnPropertyDescriptor,Pc=Object.getOwnPropertyNames,Ay=Object.getPrototypeOf,Iy=Object.prototype.hasOwnProperty,Le=(e,t)=>function(){return t||(0,e[Pc(e)[0]])((t={exports:{}}).exports,t),t.exports},Cs=(e,t)=>{for(var r in t)$s(e,r,{get:t[r],enumerable:!0})},Ey=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Pc(t))!Iy.call(e,i)&&i!==r&&$s(e,i,{get:()=>t[i],enumerable:!(n=Oy(t,i))||n.enumerable});return e},jt=(e,t,r)=>(r=e!=null?Ty(Ay(e)):{},Ey(t||!e||!e.__esModule?$s(r,"default",{value:e,enumerable:!0}):r,e));var Sy={};Cs(Sy,{code:()=>cf,decode:()=>lo,encode:()=>Zs,format:()=>Vc,name:()=>Pm,parse:()=>Um,stringify:()=>Vc});var xy=["string","number","bigint","symbol"],Ny=["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 $y(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(xy.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Cy(e))return"Buffer";let r=Py(e);return r||"Object"}function Cy(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Py(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Ny.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}`}},pn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Ry=new TextDecoder,Uy=new TextEncoder;function Qi(e){return pn&&globalThis.Buffer.isBuffer(e)}function js(e){return e instanceof Uint8Array?Qi(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var By=pn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Uc(e,t,r):(e,t,r)=>r-t>64?Ry.decode(e.subarray(t,r)):Uc(e,t,r),zc=pn?e=>e.length>64?globalThis.Buffer.from(e):Rc(e):e=>e.length>64?Uy.encode(e):Rc(e);var Ls=pn?(e,t,r)=>Qi(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),ky=pn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),js(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},My=pn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function Dy(e,t){if(Qi(e)&&Qi(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 Rc(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 Uc(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 qc(n)}var Bc=4096;function qc(e){let t=e.length;if(t<=Bc)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Bc));return r}var jy=256,Gc=class{constructor(e=jy){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=My(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=Ls(r,0,this.cursor)}else t=ky(this.chunks,this.cursor);return e&&this.reset(),t}},he="CBOR decode error:",Ur="CBOR encode error:",ei=[];ei[23]=1;ei[24]=2;ei[25]=3;ei[26]=5;ei[27]=9;function yn(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 Br(e,t,r){yn(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 kr(e,t,r){yn(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 Mr(e,t,r){yn(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 Dr(e,t,r){yn(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 Ly(e,t,r,n){return new Z(C.uint,Br(e,t+1,n),2)}function Fy(e,t,r,n){return new Z(C.uint,kr(e,t+1,n),3)}function Vy(e,t,r,n){return new Z(C.uint,Mr(e,t+1,n),5)}function Ky(e,t,r,n){return new Z(C.uint,Dr(e,t+1,n),9)}function jr(e,t){return bt(e,0,t.value)}function bt(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`)}}jr.encodedSize=function(t){return bt.encodedSize(t.value)};bt.encodedSize=function(t){return t<qe[0]?1:t<qe[1]?2:t<qe[2]?3:t<qe[3]?5:9};jr.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function zy(e,t,r,n){return new Z(C.negint,-1-Br(e,t+1,n),2)}function qy(e,t,r,n){return new Z(C.negint,-1-kr(e,t+1,n),3)}function Gy(e,t,r,n){return new Z(C.negint,-1-Mr(e,t+1,n),5)}var Fs=BigInt(-1),Hc=BigInt(1);function Hy(e,t,r,n){let i=Dr(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,Fs-BigInt(i),9)}function Vs(e,t){let r=t.value,n=typeof r=="bigint"?r*Fs-Hc:r*-1-1;bt(e,t.type.majorEncoded,n)}Vs.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*Fs-Hc:r*-1-1;return n<qe[0]?1:n<qe[1]?2:n<qe[2]?3:n<qe[3]?5:9};Vs.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function ti(e,t,r,n){yn(e,t,r+n);let i=Ls(e,t+r,t+r+n);return new Z(C.bytes,i,r+n)}function Wy(e,t,r,n){return ti(e,t,1,r)}function Jy(e,t,r,n){return ti(e,t,2,Br(e,t+1,n))}function Xy(e,t,r,n){return ti(e,t,3,kr(e,t+1,n))}function Yy(e,t,r,n){return ti(e,t,5,Mr(e,t+1,n))}function Qy(e,t,r,n){let i=Dr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer bytes lengths not supported`);return ti(e,t,9,i)}function Zi(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===C.string?zc(e.value):e.value),e.encodedBytes}function so(e,t){let r=Zi(t);bt(e,t.type.majorEncoded,r.length),e.push(r)}so.encodedSize=function(t){let r=Zi(t);return bt.encodedSize(r.length)+r.length};so.compareTokens=function(t,r){return Zy(Zi(t),Zi(r))};function Zy(e,t){return e.length<t.length?-1:e.length>t.length?1:Dy(e,t)}function ri(e,t,r,n,i){let s=r+n;yn(e,t,s);let o=new Z(C.string,By(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=Ls(e,t+r,t+s)),o}function eh(e,t,r,n){return ri(e,t,1,r,n)}function th(e,t,r,n){return ri(e,t,2,Br(e,t+1,n),n)}function rh(e,t,r,n){return ri(e,t,3,kr(e,t+1,n),n)}function nh(e,t,r,n){return ri(e,t,5,Mr(e,t+1,n),n)}function ih(e,t,r,n){let i=Dr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer string lengths not supported`);return ri(e,t,9,i,n)}var oh=so;function hn(e,t,r,n){return new Z(C.array,n,r)}function sh(e,t,r,n){return hn(e,t,1,r)}function ah(e,t,r,n){return hn(e,t,2,Br(e,t+1,n))}function uh(e,t,r,n){return hn(e,t,3,kr(e,t+1,n))}function ch(e,t,r,n){return hn(e,t,5,Mr(e,t+1,n))}function fh(e,t,r,n){let i=Dr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer array lengths not supported`);return hn(e,t,9,i)}function lh(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){bt(e,C.array.majorEncoded,t.value)}Ks.compareTokens=jr.compareTokens;Ks.encodedSize=function(t){return bt.encodedSize(t.value)};function mn(e,t,r,n){return new Z(C.map,n,r)}function dh(e,t,r,n){return mn(e,t,1,r)}function ph(e,t,r,n){return mn(e,t,2,Br(e,t+1,n))}function yh(e,t,r,n){return mn(e,t,3,kr(e,t+1,n))}function hh(e,t,r,n){return mn(e,t,5,Mr(e,t+1,n))}function mh(e,t,r,n){let i=Dr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer map lengths not supported`);return mn(e,t,9,i)}function gh(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return mn(e,t,1,1/0)}function zs(e,t){bt(e,C.map.majorEncoded,t.value)}zs.compareTokens=jr.compareTokens;zs.encodedSize=function(t){return bt.encodedSize(t.value)};function bh(e,t,r,n){return new Z(C.tag,r,1)}function vh(e,t,r,n){return new Z(C.tag,Br(e,t+1,n),2)}function _h(e,t,r,n){return new Z(C.tag,kr(e,t+1,n),3)}function wh(e,t,r,n){return new Z(C.tag,Mr(e,t+1,n),5)}function Th(e,t,r,n){return new Z(C.tag,Dr(e,t+1,n),9)}function qs(e,t){bt(e,C.tag.majorEncoded,t.value)}qs.compareTokens=jr.compareTokens;qs.encodedSize=function(t){return bt.encodedSize(t.value)};var Oh=20,Ah=21,Ih=22,Eh=23;function Sh(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 xh(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 Gs(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 Nh(e,t,r,n){return Gs(Ws(e,t+1),3,n)}function $h(e,t,r,n){return Gs(Js(e,t+1),5,n)}function Ch(e,t,r,n){return Gs(Yc(e,t+1),9,n)}function Hs(e,t,r){let n=t.value;if(n===!1)e.push([C.float.majorEncoded|Oh]);else if(n===!0)e.push([C.float.majorEncoded|Ah]);else if(n===null)e.push([C.float.majorEncoded|Ih]);else if(n===void 0)e.push([C.float.majorEncoded|Eh]);else{let i,s=!1;(!r||r.float64!==!0)&&(Jc(n),i=Ws(Pt,1),n===i||Number.isNaN(n)?(Pt[0]=249,e.push(Pt.slice(0,3)),s=!0):(Xc(n),i=Js(Pt,1),n===i&&(Pt[0]=250,e.push(Pt.slice(0,5)),s=!0))),s||(Ph(n),i=Yc(Pt,1),Pt[0]=251,e.push(Pt.slice(0,9)))}}Hs.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){Jc(n);let i=Ws(Pt,1);if(n===i||Number.isNaN(n))return 3;if(Xc(n),i=Js(Pt,1),n===i)return 5}return 9};var Wc=new ArrayBuffer(9),gt=new DataView(Wc,1),Pt=new Uint8Array(Wc,0);function Jc(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 Ws(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 Xc(e){gt.setFloat32(0,e,!1)}function Js(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 Ph(e){gt.setFloat64(0,e,!1)}function Yc(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)}Hs.compareTokens=jr.compareTokens;function Ae(e,t,r){throw new Error(`${he} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function ao(e){return()=>{throw new Error(`${he} ${e}`)}}var ue=[];for(let e=0;e<=23;e++)ue[e]=Ae;ue[24]=Ly;ue[25]=Fy;ue[26]=Vy;ue[27]=Ky;ue[28]=Ae;ue[29]=Ae;ue[30]=Ae;ue[31]=Ae;for(let e=32;e<=55;e++)ue[e]=Ae;ue[56]=zy;ue[57]=qy;ue[58]=Gy;ue[59]=Hy;ue[60]=Ae;ue[61]=Ae;ue[62]=Ae;ue[63]=Ae;for(let e=64;e<=87;e++)ue[e]=Wy;ue[88]=Jy;ue[89]=Xy;ue[90]=Yy;ue[91]=Qy;ue[92]=Ae;ue[93]=Ae;ue[94]=Ae;ue[95]=ao("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ue[e]=eh;ue[120]=th;ue[121]=rh;ue[122]=nh;ue[123]=ih;ue[124]=Ae;ue[125]=Ae;ue[126]=Ae;ue[127]=ao("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ue[e]=sh;ue[152]=ah;ue[153]=uh;ue[154]=ch;ue[155]=fh;ue[156]=Ae;ue[157]=Ae;ue[158]=Ae;ue[159]=lh;for(let e=160;e<=183;e++)ue[e]=dh;ue[184]=ph;ue[185]=yh;ue[186]=hh;ue[187]=mh;ue[188]=Ae;ue[189]=Ae;ue[190]=Ae;ue[191]=gh;for(let e=192;e<=215;e++)ue[e]=bh;ue[216]=vh;ue[217]=_h;ue[218]=wh;ue[219]=Th;ue[220]=Ae;ue[221]=Ae;ue[222]=Ae;ue[223]=Ae;for(let e=224;e<=243;e++)ue[e]=ao("simple values are not supported");ue[244]=Ae;ue[245]=Ae;ue[246]=Ae;ue[247]=Sh;ue[248]=ao("simple values are not supported");ue[249]=Nh;ue[250]=$h;ue[251]=Ch;ue[252]=Ae;ue[253]=Ae;ue[254]=Ae;ue[255]=xh;var Ft=[];for(let e=0;e<24;e++)Ft[e]=new Z(C.uint,e,1);for(let e=-1;e>=-24;e--)Ft[31-e]=new Z(C.negint,e,1);Ft[64]=new Z(C.bytes,new Uint8Array(0),1);Ft[96]=new Z(C.string,"",1);Ft[128]=new Z(C.array,0,1);Ft[160]=new Z(C.map,0,1);Ft[244]=new Z(C.false,!1,1);Ft[245]=new Z(C.true,!0,1);Ft[246]=new Z(C.null,null,1);function Xs(){let e=[];return e[C.uint.major]=jr,e[C.negint.major]=Vs,e[C.bytes.major]=so,e[C.string.major]=oh,e[C.array.major]=Ks,e[C.map.major]=zs,e[C.tag.major]=qs,e[C.float.major]=Hs,e}var NE=Xs(),Ps=new Gc,kc=class Qc{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(`${Ur} object contains circular references`);return new Qc(r,t)}},lr={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)},hr={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?lr.true:lr.false},null(e,t,r,n){return lr.null},undefined(e,t,r,n){return lr.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?[lr.emptyArray,new Z(C.break)]:lr.emptyArray;n=kc.createCheck(n,e);let i=[],s=0;for(let o of e)i[s++]=Xi(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?[lr.emptyMap,new Z(C.break)]:lr.emptyMap;n=kc.createCheck(n,e);let a=[],f=0;for(let c of s)a[f++]=[Xi(c,r,n),Xi(i?e.get(c):e[c],r,n)];return Rh(a,r),r.addBreakTokens?[new Z(C.map,o),a,new Z(C.break)]:[new Z(C.map,o),a]}};hr.Map=hr.Object;hr.Buffer=hr.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))hr[`${e}Array`]=hr.DataView;function Xi(e,t={},r){let n=$y(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||hr[n];if(typeof i=="function"){let o=i(e,n,t,r);if(o!=null)return o}let s=hr[n];if(!s)throw new Error(`${Ur} unsupported type: ${n}`);return s(e,n,t,r)}function Rh(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Zc(e,t,r,n){if(Array.isArray(t))for(let i of t)Zc(e,i,r,n);else r[t.type.major](e,t,n)}function Uh(e,t,r){let n=Xi(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 Gc(o);if(s(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return js(a.chunks[0])}}return Ps.reset(),Zc(Ps,n,t,r),Ps.toBytes(!0)}var Bh={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},kh=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=Ft[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}},Yn=Symbol.for("DONE"),uo=Symbol.for("BREAK");function Mh(e,t,r){let n=[];for(let i=0;i<e.value;i++){let s=Qn(t,r);if(s===uo){if(e.value===1/0)break;throw new Error(`${he} got unexpected break to lengthed array`)}if(s===Yn)throw new Error(`${he} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=s}return n}function Dh(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=Qn(t,r);if(a===uo){if(e.value===1/0)break;throw new Error(`${he} got unexpected break to lengthed map`)}if(a===Yn)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=Qn(t,r);if(f===Yn)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 Qn(e,t){if(e.done())return Yn;let r=e.next();if(r.type===C.break)return uo;if(r.type.terminal)return r.value;if(r.type===C.array)return Mh(r,e,t);if(r.type===C.map)return Dh(r,e,t);if(r.type===C.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Qn(e,t);return t.tags[r.value](n)}throw new Error(`${he} tag not supported (${r.value})`)}throw new Error("unsupported")}function jh(e,t){if(!(e instanceof Uint8Array))throw new Error(`${he} data to decode must be a Uint8Array`);t=Object.assign({},Bh,t);let r=t.tokenizer||new kh(e,t),n=Qn(r,t);if(n===Yn)throw new Error(`${he} did not find any content to decode`);if(n===uo)throw new Error(`${he} got unexpected break`);return[n,e.subarray(r.pos())]}function Ys(e,t){let[r,n]=jh(e,t);if(n.length>0)throw new Error(`${he} too many terminals, data makes no sense`);return r}var Lh=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(`${Ur} unsupported type: Uint8Array`)}[C.string.major](e,t){this.prefix(e);let r=zc(JSON.stringify(t.value));e.push(r.length>32?js(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(`${Ur} 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 Fh(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${Ur} 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(`${Ur} non-string map keys are not supported`);if(r<n)return-1;if(r>n)return 1;throw new Error(`${Ur} unexpected duplicate map keys, this is not supported`)}var Vh={addBreakTokens:!0,mapSorter:Fh};function Kh(e,t){return t=Object.assign({},Vh,t),Uh(e,new Lh,t)}var ef=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,qc(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 zh(e,t){return t=Object.assign({tokenizer:new ef(e,t)},t),Ys(e,t)}var $E=new Uint8Array(0),qh=(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},Qs=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 Gh(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 k(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=k(j);if(te)return te;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:k,decode:R}}var Hh=Gh,Wh=Hh,Jh=Wh,Xh=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")}},Yh=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 tf(this,e)}},Qh=class{constructor(e){this.decoders=e}or(e){return tf(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`)}},tf=(e,t)=>new Qh({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),Zh=class{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Xh(e,t,r),this.decoder=new Yh(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},rf=({name:e,prefix:t,encode:r,decode:n})=>new Zh(e,t,r,n),co=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=Jh(r,t);return rf({prefix:e,name:t,encode:n,decode:s=>Qs(i(s))})},em=(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},tm=(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},ut=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>rf({prefix:t,name:e,encode(i){return tm(i,n,r)},decode(i){return em(i,n,r,e)}}),Yi=ut({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),CE=ut({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),PE=ut({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),RE=ut({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),UE=ut({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),BE=ut({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),kE=ut({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ME=ut({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),DE=ut({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),yr=co({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),jE=co({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),nf={};Cs(nf,{Digest:()=>fo,create:()=>no,decode:()=>ni,equals:()=>sf});var rm=of,Mc=128,nm=127,im=~nm,om=Math.pow(2,31);function of(e,t,r){t=t||[],r=r||0;for(var n=r;e>=om;)t[r++]=e&255|Mc,e/=128;for(;e&im;)t[r++]=e&255|Mc,e>>>=7;return t[r]=e|0,of.bytes=r-n+1,t}var sm=Bs,am=128,Dc=127;function Bs(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a)throw Bs.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&Dc)<<i:(o&Dc)*Math.pow(2,i),i+=7}while(o>=am);return Bs.bytes=s-n,r}var um=Math.pow(2,7),cm=Math.pow(2,14),fm=Math.pow(2,21),lm=Math.pow(2,28),dm=Math.pow(2,35),pm=Math.pow(2,42),ym=Math.pow(2,49),hm=Math.pow(2,56),mm=Math.pow(2,63),gm=function(e){return e<um?1:e<cm?2:e<fm?3:e<lm?4:e<dm?5:e<pm?6:e<ym?7:e<hm?8:e<mm?9:10},bm={encode:rm,decode:sm,encodingLength:gm},vm=bm,eo=vm,ks=(e,t=0)=>[eo.decode(e,t),eo.decode.bytes],to=(e,t,r=0)=>(eo.encode(e,t,r),t),ro=e=>eo.encodingLength(e),no=(e,t)=>{let r=t.byteLength,n=ro(e),i=n+ro(r),s=new Uint8Array(i+r);return to(e,s,0),to(r,s,n),s.set(t,i),new fo(e,r,t,s)},ni=e=>{let t=Qs(e),[r,n]=ks(t),[i,s]=ks(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new fo(r,i,o,t)},sf=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&qh(e.bytes,r.bytes)}},fo=class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},jc=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return wm(r,Ms(e),t||yr.encoder);default:return Tm(r,Ms(e),t||Yi.encoder)}},Lc=new WeakMap,Ms=e=>{let t=Lc.get(e);if(t==null){let r=new Map;return Lc.set(e,r),r}return t},Rt=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!==Jn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Om)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=no(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&&sf(t.multihash,n.multihash)}toString(t){return jc(this,t)}toJSON(){return{"/":jc(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||Fc(n,i,s.bytes))}else if(r[Am]===!0){let{version:n,multihash:i,code:s}=r,o=ni(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!==Jn)throw new Error(`Version 0 CID must use dag-pb (code: ${Jn}) block encoding`);return new Je(t,r,n,n.bytes)}case 1:{let i=Fc(t,r,n.bytes);return new Je(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return Je.create(0,Jn,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=Qs(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,k]=ks(t.subarray(r));return r+=k,g},i=n(),s=Jn;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]=_m(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 Ms(s).set(n,t),s}},_m=(e,t)=>{switch(e[0]){case"Q":{let r=t||yr;return[yr.prefix,r.decode(`${yr.prefix}${e}`)]}case yr.prefix:{let r=t||yr;return[yr.prefix,r.decode(e)]}case Yi.prefix:{let r=t||Yi;return[Yi.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)]}}},wm=(e,t,r)=>{let{prefix:n}=r;if(n!==yr.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},Tm=(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},Jn=112,Om=18,Fc=(e,t,r)=>{let n=ro(e),i=n+ro(t),s=new Uint8Array(i+r.byteLength);return to(e,s,0),to(t,s,n),s.set(r,i),s},Am=Symbol.for("@ipld/js-cid/CID"),af=({name:e,code:t,encode:r})=>new Im(e,t,r),Im=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?no(this.code,t):t.then(r=>no(this.code,r))}else throw Error("Unknown type, must be binary type")}},uf=ut({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),LE=ut({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),FE=ut({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),VE=ut({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function Em(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Rt.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 io(e){let t=uf.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 io(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Sm(e){return io(new Uint8Array(e))}function xm(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function Nm(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 $m={typeEncoders:{Object:Em,Buffer:io,Uint8Array:io,Int8Array:Ct,Uint16Array:Ct,Int16Array:Ct,Uint32Array:Ct,Int32Array:Ct,Float32Array:Ct,Float64Array:Ct,Uint8ClampedArray:Ct,BigInt64Array:Ct,BigUint64Array:Ct,DataView:Ct,ArrayBuffer:Sm,undefined:xm,number:Nm}},Cm=class extends ef{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=uf.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}},Ds={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Ds.tags[42]=Rt.parse;var Pm="dag-json",cf=297,Zs=e=>Kh(e,$m),lo=e=>{let t=Object.assign(Ds,{tokenizer:new Cm(e,Ds)});return zh(e,t)},Vc=e=>Rm.decode(Zs(e)),Rm=new TextDecoder,Um=e=>lo(Bm.encode(e)),Bm=new TextEncoder;function km(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 Kc(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 Mm(e,t){km(e);let r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var Dm=e=>e instanceof Uint8Array,Rs=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Lt=(e,t)=>e<<32-t|e>>>t,jm=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!jm)throw new Error("Non little-endian hardware is not supported");function Lm(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ff(e){if(typeof e=="string"&&(e=Lm(e)),!Dm(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var Fm=class{clone(){return this._cloneInto()}},KE={}.toString;function Vm(e){let t=n=>e().update(ff(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Km(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 zm=class extends Fm{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=Rs(this.buffer)}update(e){Kc(this);let{view:t,buffer:r,blockLen:n}=this;e=ff(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=Rs(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){Kc(this),Mm(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;Km(r,n-8,BigInt(this.length*8),i),this.process(r,0);let o=Rs(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}},qm=(e,t,r)=>e&t^~e&r,Gm=(e,t,r)=>e&t^e&r^t&r,Hm=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]),dr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),pr=new Uint32Array(64),Wm=class extends zm{constructor(){super(64,32,8,!1),this.A=dr[0]|0,this.B=dr[1]|0,this.C=dr[2]|0,this.D=dr[3]|0,this.E=dr[4]|0,this.F=dr[5]|0,this.G=dr[6]|0,this.H=dr[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)pr[y]=e.getUint32(t,!1);for(let y=16;y<64;y++){let g=pr[y-15],k=pr[y-2],R=Lt(g,7)^Lt(g,18)^g>>>3,j=Lt(k,17)^Lt(k,19)^k>>>10;pr[y]=j+pr[y-7]+R+pr[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=Lt(o,6)^Lt(o,11)^Lt(o,25),k=c+g+qm(o,a,f)+Hm[y]+pr[y]|0,j=(Lt(r,2)^Lt(r,13)^Lt(r,22))+Gm(r,n,i)|0;c=f,f=a,a=o,o=s+k|0,s=i,i=n,n=r,r=k+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(){pr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Jm=Vm(()=>new Wm),Xm=Object.create,ea=Object.defineProperty,Ym=Object.getOwnPropertyDescriptor,lf=Object.getOwnPropertyNames,Qm=Object.getPrototypeOf,Zm=Object.prototype.hasOwnProperty,eg=(e,t,r)=>t in e?ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,df=(e,t)=>function(){return t||(0,e[lf(e)[0]])((t={exports:{}}).exports,t),t.exports},tg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of lf(t))!Zm.call(e,i)&&i!==r&&ea(e,i,{get:()=>t[i],enumerable:!(n=Ym(t,i))||n.enumerable});return e},pf=(e,t,r)=>(r=e!=null?Xm(Qm(e)):{},tg(t||!e||!e.__esModule?ea(r,"default",{value:e,enumerable:!0}):r,e)),mr=(e,t,r)=>(eg(e,typeof t!="symbol"?t+"":t,r),r),rg=df({"../../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}}),ng=df({"../../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]},k={key:y,value:f[y]};return a(g,k)}}}(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,k=Object.keys(f).sort(s&&s(f));for(y="",c=0;c<k.length;c++){var R=k[c],j=a(f[R]);j&&(y&&(y+=","),y+=JSON.stringify(R)+":"+j)}return o.splice(g,1),"{"+y+"}"}}(r)}}}),Zn=pf(rg(),1),ig=pf(ng(),1),yf=!1,hf=!1;Zn.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(yf=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(hf=process?.env?.LOGGER_PERF_PREFIX==="true"));var og=Object.freeze({prefix:void 0,time:yf,delta:hf,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0}),Us=[],mf=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(",")}]`}},gf=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},Xn=!1,et=class{static setup(e=et.INFO,t={}){t=Object.assign({},og,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(...k){let R=k[k.length-1];return R===n?R():(i(...k.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,ig.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(Zn.isNode)return e.bind(console);{let r=[];if(t.time||t.delta){let i=Zn.isBrowser&&navigator.userAgent.includes("Chrome")?["",et.timeStr(!!t.time,!!t.delta)]:[];r.push(...i)}return t.prefix&&(Xn?r.push(new gf("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 mf(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;mr(Se,"ERROR",2);mr(Se,"WARN",4);mr(Se,"INFO",6);mr(Se,"LOG",6);mr(Se,"DEBUG",8);mr(Se,"VERBOSE",10);mr(Se,"firstLog",0);mr(Se,"lastLog",0);Zn.isBrowser?(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Us&&Us.length){for(let t of Us)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof mf))return null;Xn||(Xn=!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 gf?(Xn||(Xn=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1})):Zn.isNode;var sg=co({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),zE=co({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),bf=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),ag=af({name:"sha2-256",code:18,encode:bf("SHA-256")}),qE=af({name:"sha2-512",code:19,encode:bf("SHA-512")}),{WARN:ug,LOG:GE,DEBUG:cg,VERBOSE:oo,ERROR:HE}=Se.setup(Se.INFO),vf=114;function _f(e,t=["cid"]){let r={};for(let[n,i]of Object.entries(e))i===void 0&&(ug(`log.${n} is undefined, which is not allowed - encoding as null`,e),i=null),t.includes(n)?oo("excluding app log",{key:n,val:i}):r[n]=i&&n==="pv"?Rt.parse(i):i;return r}function ta(e){return ra(wf(e).bytes)}function wf(e){return Tf(_f(e))}function ra(e){let t=Jm(e),r=nf.create(ag.code,t),n=Rt.create(1,cf,r);return oo("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function Tf(e){cg("[encodeBlock]",e);let t=Zs(e);return{bytes:t,cid:ra(t)}}function na(e){let t=null,r=[];try{t=Rt.parse(e)}catch(n){oo("[retrieveThread] couldn't parse pubID with default base"),r.push(n)}if(!t)try{t=Rt.parse(e,sg)}catch(n){oo("[retrieveThread] couldn't parse pubID with base36"),r.push(n)}return{cid:t,errors:r,isIpns:t&&t.code===vf}}var Yt=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 yt=m.charCodeAt($e);if(yt>=7&&yt<=13||yt===27||yt===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)&&!Dn($e))&&S(m.type)&&(h(m.unevaluatedProperties)||A(m.unevaluatedProperties))&&S(m.$id)}l.TIntersect=je;function Sr(m){return we(m,"Iterator")&&m.type==="Iterator"&&S(m.$id)&&Ve(m.items)}l.TIterator=Sr;function we(m,$e){return ir(m)&&m[e.Kind]===$e}l.TKindOf=we;function ir(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}l.TKind=ir;function xr(m){return x(m)&&i.IsString(m.const)}l.TLiteralString=xr;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,yt])=>I($e)&&Ve(yt))}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 yt=Object.getOwnPropertyNames($e.patternProperties);return yt.length===1&&w(yt[0])&&i.IsObject($e.patternProperties)&&Ve($e.patternProperties[yt[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 nn(m){return we(m,"String")&&m.type==="string"&&S(m.$id)&&E(m.minLength)&&E(m.maxLength)&&_(m.pattern)&&u(m.format)}l.TString=nn;function on(m){return we(m,"Symbol")&&m.type==="symbol"&&S(m.$id)}l.TSymbol=on;function Nr(m){return we(m,"TemplateLiteral")&&m.type==="string"&&i.IsString(m.pattern)&&m.pattern[0]==="^"&&m.pattern[m.pattern.length-1]==="$"}l.TTemplateLiteral=Nr;function Ci(m){return we(m,"This")&&S(m.$id)&&i.IsString(m.$ref)}l.TThis=Ci;function Dn(m){return i.IsObject(m)&&e.Transform in m}l.TTransform=Dn;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 Pi(m){return we(m,"Undefined")&&m.type==="undefined"&&S(m.$id)}l.TUndefined=Pi;function ss(m){return $r(m)&&m.anyOf.every($e=>xr($e)||T($e))}l.TUnionLiteral=ss;function $r(m){return we(m,"Union")&&S(m.$id)&&i.IsObject(m)&&i.IsArray(m.anyOf)&&m.anyOf.every($e=>Ve($e))}l.TUnion=$r;function sn(m){return we(m,"Uint8Array")&&m.type==="Uint8Array"&&S(m.$id)&&E(m.minByteLength)&&E(m.maxByteLength)}l.TUint8Array=sn;function Ye(m){return we(m,"Unknown")&&S(m.$id)}l.TUnknown=Ye;function Ri(m){return we(m,"Unsafe")}l.TUnsafe=Ri;function jn(m){return we(m,"Void")&&m.type==="void"&&S(m.$id)}l.TVoid=jn;function as(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}l.TReadonly=as;function us(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}l.TOptional=us;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)||Sr(m)||x(m)||ge(m)||oe(m)||pe(m)||Ee(m)||Me(m)||Xe(m)||We(m)||Jt(m)||nn(m)||on(m)||Nr(m)||Ci(m)||Fe(m)||Pi(m)||$r(m)||sn(m)||Ye(m)||Ri(m)||jn(m)||ir(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)?cs(d,p):o.TUnknown(p)?lu(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)&&Nr(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,St)=>w(Ne(p.parameters[St],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,St)=>w(Ne(p.parameters[St],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 Sr(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)?jn(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 ir(d,p){return c.True}function xr(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(xr(d),p):o.TNot(p)?Ne(d,xr(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 Nr(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 Nr(d)}function nn(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 on(d){return oe(d,0)}function Nr(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 Ci(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 Dn(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)&&on(p)||o.TFunction(d)&&nn(p)?c.True:o.TRecord(d)&&o.TString($r(d))?p[e.Hint]==="Record"?c.True:c.False:o.TRecord(d)&&o.TNumber($r(d))?oe(p,0)?c.True:c.False:c.False}function Pi(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(Dn(d.properties[Te],p.properties[Te])===c.False)return c.False}return c.True})():c.False}function ss(d,p){return P(p)?N(d,p):o.TObject(p)&&Ci(p)?c.True:o.TPromise(p)?w(Ne(d.item,p.item)):c.False}function $r(d){return e.PatternNumberExact in d.patternProperties?e.Type.Number():e.PatternStringExact in d.patternProperties?e.Type.String():I("Unknown record key pattern")}function sn(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,St]=[$r(p),sn(p)];return o.TLiteralString(d)&&o.TNumber(Te)&&w(Ne(d,St))===c.True?c.True:o.TUint8Array(d)&&o.TNumber(Te)||o.TString(d)&&o.TNumber(Te)||o.TArray(d)&&o.TNumber(Te)?Ne(d,St):o.TObject(d)?(()=>{for(let _p of Object.getOwnPropertyNames(d.properties))if(Dn(St,d.properties[_p])===c.False)return c.False;return c.True})():c.False}function Ri(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ne(sn(d),sn(p)):c.False}function jn(d,p){return o.TLiteral(d)&&i.IsString(d.const)||o.TString(d)?c.True:c.False}function as(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 us(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 yt(d,p){return P(p)?N(d,p):o.TObject(p)&&Nr(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,St)=>Ne(Te,p.items[St])===c.True)?c.True:c.False:c.False}function pp(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 yp(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TVoid(p)?gp(d,p):o.TUndefined(p)?c.True:c.False}function cs(d,p){return p.anyOf.some(Te=>Ne(d,Te)===c.True)?c.True:c.False}function hp(d,p){return d.anyOf.every(Te=>Ne(Te,p)===c.True)?c.True:c.False}function lu(d,p){return c.True}function mp(d,p){return o.TNever(p)?we(d,p):o.TIntersect(p)?_e(d,p):o.TUnion(p)?cs(d,p):o.TAny(p)?E(d,p):o.TString(p)?jn(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 gp(d,p){return o.TUndefined(d)||o.TUndefined(d)?c.True:c.False}function bp(d,p){return o.TIntersect(p)?_e(d,p):o.TUnion(p)?cs(d,p):o.TUnknown(p)?lu(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)?Sr(d,p):o.TNever(d)?ir(d,p):o.TNull(d)?le(d,p):o.TNumber(d)?ge(d,p):o.TObject(d)?Pi(d,p):o.TRecord(d)?Ri(d,p):o.TString(d)?as(d,p):o.TSymbol(d)?us(d,p):o.TTuple(d)?yt(d,p):o.TPromise(d)?ss(d,p):o.TUint8Array(d)?pp(d,p):o.TUndefined(d)?yp(d,p):o.TUnion(d)?hp(d,p):o.TUnknown(d)?mp(d,p):o.TVoid(d)?bp(d,p):I(`Unknown left type operand '${d[e.Kind]}'`)}function vp(d,p){return Ne(d,p)}l.Extends=vp})(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 k;(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})(k||(e.IndexedAccessor=k={}));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=[...M.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[...M.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=[...M.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 M;(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})(M||(e.TemplateLiteralGenerator=M={}));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 k.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([...M.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}}),gn=jt(Yt(),1),{String:fg,Optional:lg,Boolean:dg,Object:pg,Number:yg}=gn.Type,hg=fg.bind(gn.Type),mg=yg.bind(gn.Type),hS=pg.bind(gn.Type),mS=lg.bind(gn.Type),gg=dg.bind(gn.Type),gS=hg(),bS=mg(),vS=gg();function Of(e){return Array.isArray(e)?e:[e]}var bg=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 k(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=k(B,"maximumDepth"),K=k(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 M(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 M(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=M(String(I),O[I],q);ne+=N!==void 0?N:"null",ne+=","}let P=M(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=M(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 M("",Q,[])}return ee}}}),In=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 k(F){return F===null}e.IsNull=k;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)||k(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=In(),r=Fo(),n=Yt(),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 k(R,j){if(n.FormatRegistry.Has(R))throw new s(R);return n.FormatRegistry.Set(R,j),R}y.Format=k})(o||(e.TypeSystem=o={}));var a;(function(y){let g=c;function k(){g=c}y.Reset=k;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 k(W){let B=(0,t.IsObject)(W);return y.AllowArrayObject?B:B&&!(0,t.IsArray)(W)}y.IsObjectLike=k;function R(W){return k(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}}),Lo=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=Yt(),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}}),Ca=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=In(),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,M)=>BigInt(M)),f=new Float64Array(1),c=new DataView(f.buffer),y=new Uint8Array(f.buffer);function*g(U){let M=U===0?1:Math.ceil(Math.floor(Math.log2(U)+1)/8);for(let ee=0;ee<M;ee++)yield U>>8*(M-1-ee)&255}function k(U){ye(n.Array);for(let M of U)K(M)}function R(U){ye(n.Boolean),ye(U?1:0)}function j(U){ye(n.BigInt),c.setBigInt64(0,U);for(let M of y)ye(M)}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 M of y)ye(M)}function z(U){ye(n.Object);for(let M of globalThis.Object.keys(U).sort())K(M),K(U[M])}function Y(U){ye(n.String);for(let M=0;M<U.length;M++)for(let ee of g(U.charCodeAt(M)))ye(ee)}function ie(U){ye(n.Symbol),K(U.description)}function F(U){ye(n.Uint8Array);for(let M=0;M<U.length;M++)ye(U[M])}function se(U){return ye(n.Undefined)}function K(U){if((0,t.IsArray)(U))return k(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}}),Fo=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=In(),r=ml(),n=Lo(),i=Ca(),s=Yt(),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*k(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*M(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*k(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*M(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=_}}),vg=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(Fo(),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=Fo();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),r(ml(),e)}}),_g=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=In(),r=gl(),n=Lo(),i=Ca(),s=Yt(),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 k(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 M(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 k(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 M(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}}),wg=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=In(),r=Lo(),n=_g(),i=Yt(),s=class extends i.TypeBoxError{constructor(k,R,j){super("Unable to decode due to invalid value"),this.schema=k,this.value=R,this.error=j}};e.TransformDecodeCheckError=s;var o=class extends i.TypeBoxError{constructor(k,R,j){super("Unable to encode due to invalid value"),this.schema=k,this.value=R,this.error=j}};e.TransformEncodeCheckError=o;var a=class extends i.TypeBoxError{constructor(k,R,j){super(`${j instanceof Error?j.message:"Unknown error"}`),this.schema=k,this.value=R}};e.TransformDecodeError=a;var f=class extends i.TypeBoxError{constructor(k,R,j){super(`${j instanceof Error?j.message:"Unknown error"}`),this.schema=k,this.value=R}};e.TransformEncodeError=f;var c;(function(k){function R(O,q){return i.TypeGuard.TTransform(O)||M(O.items,q)}function j(O,q){return i.TypeGuard.TTransform(O)||M(O.items,q)}function te(O,q){return i.TypeGuard.TTransform(O)||M(O.returns,q)||O.parameters.some(ne=>M(ne,q))}function W(O,q){return i.TypeGuard.TTransform(O)||M(O.returns,q)||O.parameters.some(ne=>M(ne,q))}function B(O,q){return i.TypeGuard.TTransform(O)||i.TypeGuard.TTransform(O.unevaluatedProperties)||O.allOf.some(ne=>M(ne,q))}function z(O,q){return i.TypeGuard.TTransform(O)||M(O.items,q)}function Y(O,q){return i.TypeGuard.TTransform(O)||M(O.not,q)}function ie(O,q){return i.TypeGuard.TTransform(O)||Object.values(O.properties).some(ne=>M(ne,q))||i.TypeGuard.TSchema(O.additionalProperties)&&M(O.additionalProperties,q)}function F(O,q){return i.TypeGuard.TTransform(O)||M(O.item,q)}function se(O,q){let ne=Object.getOwnPropertyNames(O.patternProperties)[0],G=O.patternProperties[ne];return i.TypeGuard.TTransform(O)||M(G,q)||i.TypeGuard.TSchema(O.additionalProperties)&&i.TypeGuard.TTransform(O.additionalProperties)}function K(O,q){return i.TypeGuard.TTransform(O)?!0:M((0,r.Deref)(O,q),q)}function ye(O,q){return i.TypeGuard.TTransform(O)?!0:M((0,r.Deref)(O,q),q)}function D(O,q){return i.TypeGuard.TTransform(O)||!(0,t.IsUndefined)(O.items)&&O.items.some(ne=>M(ne,q))}function U(O,q){return i.TypeGuard.TTransform(O)||O.anyOf.some(ne=>M(ne,q))}function M(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(),M(O,q)}k.Has=Q})(c||(e.HasTransform=c={}));var y;(function(k){function R(D,U){try{return i.TypeGuard.TTransform(D)?D[i.Transform].Decode(U):U}catch(M){throw new a(D,U,M)}}function j(D,U,M){return(0,t.IsArray)(M)?R(D,M.map(ee=>K(D.items,U,ee))):R(D,M)}function te(D,U,M){if(!(0,t.IsPlainObject)(M)||(0,t.IsValueType)(M))return R(D,M);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,M);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,M){return R(D,K(D.not,U,M))}function B(D,U,M){if(!(0,t.IsPlainObject)(M))return R(D,M);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,M);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,M){if(!(0,t.IsPlainObject)(M))return R(D,M);let ee=Object.getOwnPropertyNames(D.patternProperties)[0],Q=new RegExp(ee),O=Object.getOwnPropertyNames(M).reduce((J,de)=>Q.test(de)?{...J,[de]:K(D.patternProperties[ee],U,J[de])}:J,M);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,M){let ee=(0,r.Deref)(D,U);return R(D,K(ee,U,M))}function ie(D,U,M){let ee=(0,r.Deref)(D,U);return R(D,K(ee,U,M))}function F(D,U,M){return(0,t.IsArray)(M)&&(0,t.IsArray)(D.items)?R(D,D.items.map((ee,Q)=>K(ee,U,M[Q]))):R(D,M)}function se(D,U,M){let ee=R(D,M);for(let Q of D.anyOf)if((0,n.Check)(Q,U,ee))return K(Q,U,ee);return ee}function K(D,U,M){let ee=typeof D.$id=="string"?[...U,D]:U,Q=D;switch(D[i.Kind]){case"Array":return j(Q,ee,M);case"Intersect":return te(Q,ee,M);case"Not":return W(Q,ee,M);case"Object":return B(Q,ee,M);case"Record":return z(Q,ee,M);case"Ref":return Y(Q,ee,M);case"Symbol":return R(Q,M);case"This":return ie(Q,ee,M);case"Tuple":return F(Q,ee,M);case"Union":return se(Q,ee,M);default:return R(Q,M)}}function ye(D,U,M){return K(D,U,M)}k.Decode=ye})(y||(e.DecodeTransform=y={}));var g;(function(k){function R(D,U){try{return i.TypeGuard.TTransform(D)?D[i.Transform].Encode(U):U}catch(M){throw new f(D,U,M)}}function j(D,U,M){let ee=R(D,M);return(0,t.IsArray)(ee)?ee.map(Q=>K(D.items,U,Q)):ee}function te(D,U,M){let ee=R(D,M);if(!(0,t.IsPlainObject)(M)||(0,t.IsValueType)(M))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,M){return R(D.not,R(D,M))}function B(D,U,M){let ee=R(D,M);if(!(0,t.IsPlainObject)(M))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,M){let ee=R(D,M);if(!(0,t.IsPlainObject)(M))return ee;let Q=Object.getOwnPropertyNames(D.patternProperties)[0],O=new RegExp(Q),q=Object.getOwnPropertyNames(M).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,M){let ee=(0,r.Deref)(D,U),Q=K(ee,U,M);return R(D,Q)}function ie(D,U,M){let ee=(0,r.Deref)(D,U),Q=K(ee,U,M);return R(D,Q)}function F(D,U,M){let ee=R(D,M);return(0,t.IsArray)(D.items)?D.items.map((Q,O)=>K(Q,U,ee[O])):[]}function se(D,U,M){for(let ee of D.anyOf){if(!(0,n.Check)(ee,U,M))continue;let Q=K(ee,U,M);return R(D,Q)}for(let ee of D.anyOf){let Q=K(ee,U,M);if((0,n.Check)(D,U,Q))return R(D,Q)}return R(D,M)}function K(D,U,M){let ee=typeof D.$id=="string"?[...U,D]:U,Q=D;switch(D[i.Kind]){case"Array":return j(Q,ee,M);case"Intersect":return te(Q,ee,M);case"Not":return W(Q,ee,M);case"Object":return B(Q,ee,M);case"Record":return z(Q,ee,M);case"Ref":return Y(Q,ee,M);case"This":return ie(Q,ee,M);case"Tuple":return F(Q,ee,M);case"Union":return se(Q,ee,M);default:return R(Q,M)}}function ye(D,U,M){return K(D,U,M)}k.Encode=ye})(g||(e.EncodeTransform=g={}))}}),Tg=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=wg(),r=In(),n=Fo(),i=gl(),s=Lo(),o=Ca(),a=Yt(),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 k;(function(B){function z(Y){return Y.replace(/'/g,"\\'")}B.Escape=z})(k||(k={}));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*M(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} === '${k.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*M(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=Sr("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 Sr(T){return X.language==="typescript"?`: ${T}`:""}function we(T,le,x){let ge=Pe("check",T,le,"value"),oe=je("value","any"),pe=Sr("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 ir(...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=ir;function xr(T,le=[]){let x=ir(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 nn=a.TypeRegistry.Get(We),on=oe.get(Ze);return nn(on,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=xr})(W||(e.TypeCompiler=W={}))}}),Og=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=vg();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return n.ValueErrorIterator}}),r(Tg(),e)}}),Ag={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"},Ig=Ag;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:Ig[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}var Eg={};function Pa(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Eg}var bl=Object.assign,Ao=Object.getOwnPropertyDescriptor,Kt=Object.defineProperty,bi=Object.prototype,Io=[];Object.freeze(Io);var Ra={};Object.freeze(Ra);var Sg=typeof Proxy<"u",xg=Object.toString();function vl(){Sg||fe("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function ii(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 Et(){return++H.mobxGuid}function Ua(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var vn=function(){};function De(e){return typeof e=="function"}function Kr(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Vo(e){return e!==null&&typeof e=="object"}function Mt(e){if(!Vo(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()===xg}function _l(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Ko(e,t,r){Kt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function wl(e,t,r){Kt(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 Vo(n)&&n[r]===!0}}function En(e){return e instanceof Map}function vi(e){return e instanceof Set}var Tl=typeof Object.getOwnPropertySymbols<"u";function Ng(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 bi.propertyIsEnumerable.call(e,n)})):t}var zo=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Tl?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function la(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 At(e,t){return bi.hasOwnProperty.call(e,t)}var $g=Object.getOwnPropertyDescriptors||function(t){var r={};return zo(t).forEach(function(n){r[n]=Ao(t,n)}),r};function Af(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,Rg(n.key),n)}}function Ba(e,t,r){return t&&Af(e.prototype,t),r&&Af(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tr(){return tr=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},tr.apply(this,arguments)}function Al(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,da(e,t)}function da(e,t){return da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},da(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 Cg(e,t){if(e){if(typeof e=="string")return If(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 If(e,t)}}function If(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 _n(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=Cg(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 Pg(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 Rg(e){var t=Pg(e,"string");return typeof t=="symbol"?t:String(t)}var tt=Symbol("mobx-stored-annotations");function zt(e){function t(r,n){if(_i(n))return e.decorate_20223_(r,n);Sn(r,n,e)}return Object.assign(t,e)}function Sn(e,t,r){if(At(e,tt)||Ko(e,tt,tr({},e[tt])),Eo(r)&&!At(e[tt],t)){var n=e.constructor.name+".prototype."+t.toString();fe("'"+n+"' is decorated with 'override', but no such decorated member was found on prototype.")}Ug(e,r,t),Eo(r)||(e[tt][t]=r)}function Ug(e,t,r){if(!Eo(t)&&At(e[tt],r)){var n=e.constructor.name+".prototype."+r.toString(),i=e[tt][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 Bg(e){return At(e,tt)||Ko(e,tt,tr({},e[tt])),e[tt]}function _i(e){return typeof e=="object"&&typeof e.kind=="string"}function qo(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"),wi=function(){function e(r){r===void 0&&(r="Atom@"+Et()),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 Fl(this)},t.reportChanged=function(){wt(),Vl(this),Tt()},t.toString=function(){return this.name_},e}(),ka=Ar("Atom",wi);function Il(e,t,r){t===void 0&&(t=vn),r===void 0&&(r=vn);var n=new wi(e);return t!==vn&&Jl(n,t),r!==vn&&Ai(n,r),n}function kg(e,t){return e===t}function Mg(e,t){return Ka(e,t)}function Dg(e,t){return Ka(e,t,1)}function jg(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var rt={identity:kg,structural:Mg,default:jg,shallow:Dg};function zr(e,t,r){return On(e)?e:Array.isArray(e)?ke.array(e,{name:r}):Mt(e)?ke.object(e,void 0,{name:r}):En(e)?ke.map(e,{name:r}):vi(e)?ke.set(e,{name:r}):typeof e=="function"&&!xn(e)&&!li(e)?_l(e)?Tn(e):fi(r,e):e}function Lg(e,t,r){if(e==null||Wr(e)||$n(e)||Wt(e)||Qr(e))return e;if(Array.isArray(e))return ke.array(e,{name:r,deep:!1});if(Mt(e))return ke.object(e,void 0,{name:r,deep:!1});if(En(e))return ke.map(e,{name:r,deep:!1});if(vi(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 Go(e){return e}function Fg(e,t){return On(e)&&fe("observable.struct should not be used with observable values"),Ka(e,t)?t:e}var Vg="override";function Eo(e){return e.annotationType_===Vg}function Ti(e,t){return{annotationType_:e,options_:t,make_:Kg,extend_:zg,decorate_20223_:qg}}function Kg(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(xn(r.value))return 1;var s=El(e,this,t,r,!1);return Kt(n,t,s),2}function zg(e,t,r,n){var i=El(e,this,t,r);return e.defineProperty_(t,i,n)}function qg(e,t){qo(t,["method","field"]);var r=t.kind,n=t.name,i=t.addInitializer,s=this,o=function(c){var y,g,k,R;return qr((y=(g=s.options_)==null?void 0:g.name)!=null?y:n.toString(),c,(k=(R=s.options_)==null?void 0:R.autoAction)!=null?k:!1)};if(r=="field"){i(function(){Sn(this,n,s)});return}if(r=="method"){var a;return xn(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 Gg(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),Gg(e,t,r,n);var k=n.value;if((s=t.options_)!=null&&s.bound){var R;k=k.bind((R=e.proxy_)!=null?R:e.target_)}return{value:qr((o=(a=t.options_)==null?void 0:a.name)!=null?o:r.toString(),k,(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_:Hg,extend_:Wg,decorate_20223_:Jg}}function Hg(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&&(!At(e.target_,t)||!li(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(li(r.value))return 1;var s=xl(e,this,t,r,!1,!1);return Kt(n,t,s),2}function Wg(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 Jg(e,t){var r;qo(t,["method"]);var n=t.name,i=t.addInitializer;return li(e)||(e=Tn(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 Xg(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),Xg(e,t,r,n);var o=n.value;if(li(o)||(o=Tn(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 Ma(e,t){return{annotationType_:e,options_:t,make_:Yg,extend_:Qg,decorate_20223_:Zg}}function Yg(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function Qg(e,t,r,n){return eb(e,this,t,r),e.defineComputedProperty_(t,tr({},this.options_,{get:r.get,set:r.set}),n)}function Zg(e,t){qo(t,["getter"]);var r=this,n=t.name,i=t.addInitializer;return i(function(){var s=Cn(this)[be],o=tr({},r.options_,{get:e,context:this});o.name||(o.name=s.name_+"."+n.toString()),s.values_.set(n,new Gr(o))}),function(){return this[be].getObservablePropValue_(n)}}function eb(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 Ho(e,t){return{annotationType_:e,options_:t,make_:tb,extend_:rb,decorate_20223_:nb}}function tb(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function rb(e,t,r,n){var i,s;return ib(e,this,t,r),e.defineObservableProperty_(t,r.value,(i=(s=this.options_)==null?void 0:s.enhancer)!=null?i:zr,n)}function nb(e,t){if(t.kind==="field")throw fe("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");qo(t,["accessor"]);var r=this,n=t.kind,i=t.name,s=new WeakSet;function o(a,f){var c,y,g=Cn(a)[be],k=new _r(f,(c=(y=r.options_)==null?void 0:y.enhancer)!=null?c:zr,g.name_+"."+i.toString(),!1);g.values_.set(i,k),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 ib(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 ob="true",sb=Nl();function Nl(e){return{annotationType_:ob,options_:e,make_:ab,extend_:ub,decorate_20223_:cb}}function ab(e,t,r,n){var i,s;if(r.get)return Ge.make_(e,t,r,n);if(r.set){var o=qr(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:H.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Kt(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?Tn.bound:Tn;return c.make_(e,t,r,n)}var y=(a=this.options_)!=null&&a.autoBind?fi.bound:fi;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 k;r.value=r.value.bind((k=e.proxy_)!=null?k:e.target_)}return g.make_(e,t,r,n)}function ub(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:qr(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 cb(e,t){fe("'"+this.annotationType_+"' cannot be used as a decorator")}var fb="observable",lb="observable.ref",db="observable.shallow",pb="observable.struct",$l={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze($l);function po(e){return e||$l}var pa=Ho(fb),yb=Ho(lb,{enhancer:Go}),hb=Ho(db,{enhancer:Lg}),mb=Ho(pb,{enhancer:Fg}),Cl=zt(pa);function yo(e){return e.deep===!0?zr:e.deep===!1?Go:bb(e.defaultDecorator)}function gb(e){var t;return e?(t=e.defaultDecorator)!=null?t:Nl(e):void 0}function bb(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:zr}function Pl(e,t,r){if(_i(t))return pa.decorate_20223_(e,t);if(Kr(t)){Sn(e,t,pa);return}return On(e)?e:Mt(e)?ke.object(e,t,r):Array.isArray(e)?ke.array(e,t):En(e)?ke.map(e,t):vi(e)?ke.set(e,t):typeof e=="object"&&e!==null?e:ke.box(e,t)}bl(Pl,Cl);var vb={box:function(t,r){var n=po(r);return new _r(t,yo(n),n.name,!0,n.equals)},array:function(t,r){var n=po(r);return(H.useProxies===!1||n.proxy===!1?Ov:pv)(t,yo(n),n.name)},map:function(t,r){var n=po(r);return new nd(t,yo(n),n.name)},set:function(t,r){var n=po(r);return new sd(t,yo(n),n.name)},object:function(t,r,n){return Zr(function(){return rv(H.useProxies===!1||n?.proxy===!1?Cn({},n):fv({},n),t,r)})},ref:zt(yb),shallow:zt(hb),deep:Cl,struct:zt(mb)},ke=bl(Pl,vb),Rl="computed",_b="computed.struct",ya=Ma(Rl),wb=Ma(_b,{equals:rt.structural}),Ge=function(t,r){if(_i(r))return ya.decorate_20223_(t,r);if(Kr(r))return Sn(t,r,ya);if(Mt(t))return zt(Ma(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=Mt(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new Gr(n)};Object.assign(Ge,ya);Ge.struct=zt(wb);var Ef,Sf,So=0,Tb=1,Ob=(Ef=(Sf=Ao(function(){},"name"))==null?void 0:Sf.configurable)!=null?Ef:!1,xf={value:"action",configurable:!0,writable:!1,enumerable:!1};function qr(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 Ab(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Ob&&(xf.value=e,Kt(i,"name",xf)),i}function Ab(e,t,r,n,i){var s=Ib(e,t,n,i);try{return r.apply(n,i)}catch(o){throw s.error_=o,o}finally{Eb(s)}}function Ib(e,t,r,n){var i=He()&&!!e,s=0;if(i){s=Date.now();var o=n?Array.from(n):Io;lt({type:ja,name:e,object:r,arguments:o})}var a=H.trackingDerivation,f=!t||!a;wt();var c=H.allowStateChanges;f&&(Yr(),c=Wo(!0));var y=Da(!0),g={runAsAction_:f,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:y,notifySpy_:i,startTime_:s,actionId_:Tb++,parentActionId_:So};return So=g.actionId_,g}function Eb(e){So!==e.actionId_&&fe(30),So=e.parentActionId_,e.error_!==void 0&&(H.suppressReactionErrors=!0),Jo(e.prevAllowStateChanges_),si(e.prevAllowStateReads_),Tt(),e.runAsAction_&&er(e.prevDerivation_),e.notifySpy_&&dt({time:Date.now()-e.startTime_}),H.suppressReactionErrors=!1}function Sb(e,t){var r=Wo(e);try{return t()}finally{Jo(r)}}function Wo(e){var t=H.allowStateChanges;return H.allowStateChanges=e,t}function Jo(e){H.allowStateChanges=e}var Ul,xb="create";Ul=Symbol.toPrimitive;var _r=function(e){Al(t,e);function t(n,i,s,o,a){var f;return s===void 0&&(s="ObservableValue@"+Et()),o===void 0&&(o=!0),a===void 0&&(a=rt.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()&&Hr({type:xb,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&&lt({type:Ut,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:s}),this.setNewValue_(i),o&&dt()}},r.prepareNewValue_=function(i){if(Vt(this),vt(this)){var s=_t(this,{object:this,type:Ut,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(),Bt(this)&&kt(this,{type:Ut,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:Ut,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[Ul]=function(){return this.valueOf()},t}(wi),Nb=Ar("ObservableValue",_r),Bl;Bl=Symbol.toPrimitive;var Gr=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_=It.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@"+Et(),r.set&&(this.setter_=qr(this.name_+"-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?rt.structural:rt.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Db(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_)ha(this)&&(this.warnAboutUntrackedRead_(),wt(),this.value_=this.computeValue_(!1),Tt());else if(Fl(this),ha(this)){var n=H.trackingContext;this.keepAlive_&&!n&&(H.trackingContext=this),this.trackAndCompute()&&Mb(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()&&Hr({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:n,newValue:s})),o},t.computeValue_=function(n){this.isComputing_=!0;var i=Wo(!1),s;if(n)s=kl(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 Jo(i),this.isComputing_=!1,s},t.suspend_=function(){this.keepAlive_||(ma(this),this.value_=void 0,this.isTracing_!==It.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 qt(function(){var f=s.get();if(!o||i){var c=Yr();n({observableKind:"computed",debugObjectName:s.name_,type:Ut,object:s,newValue:f,oldValue:a}),er(c)}o=!1,a=f})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==It.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[Bl]=function(){return this.valueOf()},e}(),Oi=Ar("ComputedValue",Gr),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 It;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(It||(It={}));var xo=function(t){this.cause=void 0,this.cause=t};function vo(e){return e instanceof xo}function ha(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=Da(!0),r=Yr(),n=e.observing_,i=n.length,s=0;s<i;s++){var o=n[s];if(Oi(o)){if(H.disableErrorBoundaries)o.get();else try{o.get()}catch{return er(r),si(t),!0}if(e.dependenciesState_===Ie.STALE_)return er(r),si(t),!0}}return Ml(e),er(r),si(t),!1}}}function $b(){return H.trackingDerivation!==null}function Vt(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 Cb(e){!H.allowStateReads&&H.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function kl(e,t,r){var n=Da(!0);Ml(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,Rb(e),Pb(e),si(n),s}function Pb(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 Rb(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&&jl(f,e),f.diffValue_=0}for(;i--;){var c=r[i];c.diffValue_===1&&(c.diffValue_=0,kb(c,e))}n!==Ie.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function ma(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)jl(t[r],e);e.dependenciesState_=Ie.NOT_TRACKING_}function Be(e){var t=Yr();try{return e()}finally{er(t)}}function Yr(){var e=H.trackingDerivation;return H.trackingDerivation=null,e}function er(e){H.trackingDerivation=e}function Da(e){var t=H.allowStateReads;return H.allowStateReads=e,t}function si(e){H.allowStateReads=e}function Ml(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,Dl=!1,H=function(){var e=Pa();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(){Dl||fe(35)},1),new _o)}();function Ub(){if((H.pendingReactions.length||H.inBatch||H.isRunningReactions)&&fe(36),Dl=!0,wo){var e=Pa();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),H=new _o}}function Bb(){return H}function kb(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function jl(e,t){e.observers_.delete(t),e.observers_.size===0&&Ll(e)}function Ll(e){e.isPendingUnobservation_===!1&&(e.isPendingUnobservation_=!0,H.pendingUnobservations.push(e))}function wt(){H.inBatch++}function Tt(){if(--H.inBatch===0){ql();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 Gr&&r.suspend_())}H.pendingUnobservations=[]}}function Fl(e){Cb(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&&Ll(e),!1)}function Vl(e){e.lowestObserverState_!==Ie.STALE_&&(e.lowestObserverState_=Ie.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ie.UP_TO_DATE_&&(t.isTracing_!==It.NONE&&Kl(t,e),t.onBecomeStale_()),t.dependenciesState_=Ie.STALE_}))}function Mb(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_!==It.NONE&&Kl(t,e)):t.dependenciesState_===Ie.UP_TO_DATE_&&(e.lowestObserverState_=Ie.UP_TO_DATE_)}))}function Db(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 Kl(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===It.BREAK){var r=[];zl(Xo(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 Gr?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
43
-
44
- The dependencies for this derivation are:
45
-
46
- `+r.join(`
47
- `)+`
48
- */
49
- `)()}}function zl(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 zl(n,t,r+1)})}var ci=function(){function e(r,n,i,s){r===void 0&&(r="Reaction@"+Et()),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_=It.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),ql())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){wt(),this.isScheduled_=!1;var n=H.trackingContext;if(H.trackingContext=this,ha(this)){this.isTrackPending_=!0;try{this.onInvalidate_(),this.isTrackPending_&&He()&&Hr({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}H.trackingContext=n,Tt()}},t.track=function(n){if(!this.isDisposed_){wt();var i=He(),s;i&&(s=Date.now(),lt({name:this.name_,type:"reaction"})),this.isRunning_=!0;var o=H.trackingContext;H.trackingContext=this;var a=kl(this,n,void 0);H.trackingContext=o,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&ma(this),vo(a)&&this.reportExceptionInDerivation_(a.cause),i&&dt({time:Date.now()-s}),Tt()}},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()&&Hr({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_||(wt(),ma(this),Tt()))},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),Zl(this,n)},e}(),Nf=100,ga=function(t){return t()};function ql(){H.inBatch>0||H.isRunningReactions||ga(jb)}function jb(){H.isRunningReactions=!0;for(var e=H.pendingReactions,t=0;e.length>0;){++t===Nf&&(console.error("Reaction doesn't converge to a stable state after "+Nf+" 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",ci);function Lb(e){var t=ga;ga=function(n){return e(function(){return t(n)})}}function He(){return!!H.spyListeners.length}function Hr(e){if(H.spyListeners.length)for(var t=H.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function lt(e){var t=tr({},e,{spyReportStart:!0});Hr(t)}var Fb={type:"report-end",spyReportEnd:!0};function dt(e){Hr(e?tr({},e,{type:"report-end",spyReportEnd:!0}):Fb)}function Vb(e){return H.spyListeners.push(e),Ua(function(){H.spyListeners=H.spyListeners.filter(function(t){return t!==e})})}var ja="action",Kb="action.bound",Gl="autoAction",zb="autoAction.bound",qb="<unnamed action>",ba=Ti(ja),Gb=Ti(Kb,{bound:!0}),va=Ti(Gl,{autoAction:!0}),Hb=Ti(zb,{autoAction:!0,bound:!0});function Hl(e){var t=function(n,i){if(De(n))return qr(n.name||qb,n,e);if(De(i))return qr(n,i,e);if(_i(i))return(e?va:ba).decorate_20223_(n,i);if(Kr(i))return Sn(n,i,e?va:ba);if(Kr(n))return zt(Ti(e?Gl:ja,{name:n,autoAction:e}));fe("Invalid arguments for `action`")};return t}var Ot=Hl(!1);Object.assign(Ot,ba);var fi=Hl(!0);Object.assign(fi,va);Ot.bound=zt(Gb);fi.bound=zt(Hb);function xn(e){return De(e)&&e.isMobxAction===!0}function qt(e,t){var r,n,i,s,o;t===void 0&&(t=Ra),De(e)||fe("Autorun expects a function as first argument"),xn(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@"+Et(),f=!t.scheduler&&!t.delay,c;if(f)c=new ci(a,function(){this.track(k)},t.onError,t.requiresObservable);else{var y=Wl(t),g=!1;c=new ci(a,function(){g||(g=!0,y(function(){g=!1,c.isDisposed_||c.track(k)}))},t.onError,t.requiresObservable)}function k(){e(c)}return(i=t)!=null&&(s=i.signal)!=null&&s.aborted||c.schedule_(),c.getDisposer_((o=t)==null?void 0:o.signal)}var Wb=function(t){return t()};function Wl(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Wb}function Jb(e,t,r){var n,i,s,o;r===void 0&&(r=Ra),(!De(e)||!De(t))&&fe("First and second argument to reaction should be functions"),Mt(r)||fe("Third argument of reactions should be an object");var a=(n=r.name)!=null?n:"Reaction@"+Et(),f=Ot(a,r.onError?Xb(r.onError,t):t),c=!r.scheduler&&!r.delay,y=Wl(r),g=!0,k=!1,R,j,te=r.compareStructural?rt.structural:r.equals||rt.default,W=new ci(a,function(){g||c?B():k||(k=!0,y(B))},r.onError,r.requiresObservable);function B(){if(k=!1,!W.isDisposed_){var z=!1;W.track(function(){var Y=Sb(!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 Xb(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var Yb="onBO",Qb="onBUO";function Jl(e,t,r){return Xl(Yb,e,t,r)}function Ai(e,t,r){return Xl(Qb,e,t,r)}function Xl(e,t,r,n){var i=typeof n=="function"?wr(t,r):wr(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 Zb="never",ho="always",ev="observed";function tv(e){e.isolateGlobalState===!0&&Ub();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(H.useProxies=t===ho?!0:t===Zb?!1:typeof Proxy<"u"),t==="ifavailable"&&(H.verifyProxies=!0),r!==void 0){var n=r===ho?ho:r===ev;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&&Lb(e.reactionScheduler)}function rv(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"),Mt(t)||fe("'extendObservable' only accepts plain objects as second argument"),(On(t)||On(r))&&fe("Extending an object with another observable (object) is not supported");var i=$g(t);return Zr(function(){var s=Cn(e,n)[be];zo(i).forEach(function(o){s.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function Xo(e,t){return Yl(wr(e,t))}function Yl(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=nv(e.observing_).map(Yl)),t}function nv(e){return Array.from(new Set(e))}var iv=0;function Ql(){this.message="FLOW_CANCELLED"}Ql.prototype=Object.create(Error.prototype);var ia=Sl("flow"),ov=Sl("flow.bound",{bound:!0}),Tn=Object.assign(function(t,r){if(_i(r))return ia.decorate_20223_(t,r);if(Kr(r))return Sn(t,r,ia);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=++iv,y=Ot(i+" - runid: "+c+" - init",n).apply(a,f),g,k=void 0,R=new Promise(function(j,te){var W=0;g=te;function B(ie){k=void 0;var F;try{F=Ot(i+" - runid: "+c+" - yield "+W++,y.next).call(y,ie)}catch(se){return te(se)}Y(F)}function z(ie){k=void 0;var F;try{F=Ot(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):(k=Promise.resolve(ie.value),k.then(B,z))}B(void 0)});return R.cancel=Ot(i+" - runid: "+c+" - cancel",function(){try{k&&$f(k);var j=y.return(void 0),te=Promise.resolve(j.value);te.then(vn,vn),$f(te),g(new Ql)}catch(W){g(W)}}),R};return s.isMobXFlow=!0,s},ia);Tn.bound=zt(ov);function $f(e){De(e.cancel)&&e.cancel()}function li(e){return e?.isMobXFlow===!0}function sv(e,t){return e?t!==void 0?Wt(e)||$n(e)?fe("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):Wr(e)?e[be].values_.has(t):!1:Wr(e)||!!e[be]||ka(e)||No(e)||Oi(e):!1}function On(e){return arguments.length!==1&&fe("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),sv(e)}function av(e){if(Wr(e))return e[be].ownKeys_();fe(38)}function mo(e,t,r){return e.set(t,r),r}function bn(e,t){if(e==null||typeof e!="object"||e instanceof Date||!On(e))return e;if(Nb(e)||Oi(e))return bn(e.get(),t);if(t.has(e))return t.get(e);if($n(e)){var r=mo(t,e,new Array(e.length));return e.forEach(function(o,a){r[a]=bn(o,t)}),r}if(Qr(e)){var n=mo(t,e,new Set);return e.forEach(function(o){n.add(bn(o,t))}),n}if(Wt(e)){var i=mo(t,e,new Map);return e.forEach(function(o,a){i.set(a,bn(o,t))}),i}else{var s=mo(t,e,{});return av(e).forEach(function(o){bi.propertyIsEnumerable.call(e,o)&&(s[o]=bn(e[o],t))}),s}}function wn(e,t){return t&&fe("toJS no longer supports options"),bn(e,new Map)}function Zl(){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=uv(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_===It.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?It.BREAK:It.LOG}function uv(e){switch(e.length){case 0:return H.trackingDerivation;case 1:return wr(e[0]);case 2:return wr(e[0],e[1])}}function Qt(e,t){t===void 0&&(t=void 0),wt();try{return e.apply(t)}finally{Tt()}}function Lr(e){return e[be]}var cv={has:function(t,r){return H.trackingDerivation&&ii("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),Lr(t).has_(r)},get:function(t,r){return Lr(t).get_(r)},set:function(t,r,n){var i;return Kr(r)?(Lr(t).values_.has(r)||ii("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=Lr(t).set_(r,n,!0))!=null?i:!0):!1},deleteProperty:function(t,r){var n;return ii("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Kr(r)?(n=Lr(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return ii("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=Lr(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return H.trackingDerivation&&ii("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),Lr(t).ownKeys_()},preventExtensions:function(t){fe(13)}};function fv(e,t){var r,n;return vl(),e=Cn(e,t),(n=(r=e[be]).proxy_)!=null?n:r.proxy_=new Proxy(e,cv)}function vt(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Ii(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Ua(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function _t(e,t){var r=Yr();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{er(r)}}function Bt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Ei(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Ua(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function kt(e,t){var r=Yr(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,s=n.length;i<s;i++)n[i](t);er(r)}}function Nn(e,t,r){return Zr(function(){var n,i=Cn(e,r)[be];t&&e[tt]&&fe("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(n=t)!=null||(t=Bg(e)),zo(t).forEach(function(s){return i.make_(s,t[s])})}),e}var Cf="splice",Ut="update",lv=1e4,dv={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)):At($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)}},La=function(){function e(r,n,i,s){r===void 0&&(r="ObservableArray@"+Et()),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 wi(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&&cd(n+i+1)},t.spliceWithArray_=function(n,i,s){var o=this;Vt(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),vt(this)){var f=_t(this,{object:this.proxy_,type:Cf,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<lv){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=Bt(this),f=a||o?{observableKind:"array",object:this.proxy_,type:Ut,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:s}:null;o&&lt(f),this.atom_.reportChanged(),a&&kt(this,f),o&&dt()},t.notifyArraySplice_=function(n,i,s){var o=!this.owned_&&He(),a=Bt(this),f=a||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Cf,index:n,removed:s,added:i,removedCount:s.length,addedCount:i.length}:null;o&&lt(f),this.atom_.reportChanged(),a&&kt(this,f),o&&dt()},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){Vt(this.atom_);var o=s[n];if(vt(this)){var a=_t(this,{type:Ut,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 pv(e,t,r,n){return r===void 0&&(r="ObservableArray@"+Et()),n===void 0&&(n=!1),vl(),Zr(function(){var i=new La(r,t,n,!1);wl(i.values_,be,i);var s=new Proxy(i.values_,dv);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",pt);Ce("concat",pt);Ce("flat",pt);Ce("includes",pt);Ce("indexOf",pt);Ce("join",pt);Ce("lastIndexOf",pt);Ce("slice",pt);Ce("toString",pt);Ce("toLocaleString",pt);Ce("toSorted",pt);Ce("toSpliced",pt);Ce("with",pt);Ce("every",Dt);Ce("filter",Dt);Ce("find",Dt);Ce("findIndex",Dt);Ce("findLast",Dt);Ce("findLastIndex",Dt);Ce("flatMap",Dt);Ce("forEach",Dt);Ce("map",Dt);Ce("some",Dt);Ce("toReversed",Dt);Ce("reduce",ed);Ce("reduceRight",ed);function Ce(e,t){typeof Array.prototype[e]=="function"&&($o[e]=t(e))}function pt(e){return function(){var t=this[be];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Dt(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 ed(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 yv=Ar("ObservableArrayAdministration",La);function $n(e){return Vo(e)&&yv(e[be])}var td,rd,hv={},vr="add",Co="delete";td=Symbol.iterator;rd=Symbol.toStringTag;var nd=function(){function e(r,n,i){var s=this;n===void 0&&(n=zr),i===void 0&&(i="ObservableMap@"+Et()),this.enhancer_=void 0,this.name_=void 0,this[be]=hv,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),Zr(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 _r(this.has_(n),Go,this.name_+"."+la(n)+"?",!1);this.hasMap_.set(n,o),Ai(o,function(){return i.hasMap_.delete(n)})}return s.get()},t.set=function(n,i){var s=this.has_(n);if(vt(this)){var o=_t(this,{type:s?Ut:vr,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(Vt(this.keysAtom_),vt(this)){var s=_t(this,{type:Co,object:this,name:n});if(!s)return!1}if(this.has_(n)){var o=He(),a=Bt(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:Co,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return o&&lt(f),Qt(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&&kt(this,f),o&&dt(),!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=Bt(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:Ut,object:this,oldValue:s.value_,name:n,newValue:i}:null;o&&lt(f),s.setNewValue_(i),a&&kt(this,f),o&&dt()}},t.addValue_=function(n,i){var s=this;Vt(this.keysAtom_),Qt(function(){var c,y=new _r(i,s.enhancer_,s.name_+"."+la(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=Bt(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:vr,object:this,name:n,newValue:i}:null;o&&lt(f),a&&kt(this,f),o&&dt()},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 di({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 di({next:function(){var o=i.next(),a=o.done,f=o.value;return{done:a,value:a?void 0:[f,n.get(f)]}}})},t[td]=function(){return this.entries()},t.forEach=function(n,i){for(var s=_n(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)),Qt(function(){Mt(n)?Ng(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)}):En(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;Qt(function(){Be(function(){for(var i=_n(n.keys()),s;!(s=i()).done;){var o=s.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Qt(function(){for(var s=mv(n),o=new Map,a=!1,f=_n(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 k=i.data_.get(y);o.set(y,k)}}}for(var R=_n(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)},Ba(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:rd,get:function(){return"Map"}}]),e}(),Wt=Ar("ObservableMap",nd);function mv(e){if(En(e)||Wt(e))return e;if(Array.isArray(e))return new Map(e);if(Mt(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return fe(21,e)}var id,od,gv={};id=Symbol.iterator;od=Symbol.toStringTag;var sd=function(){function e(r,n,i){var s=this;n===void 0&&(n=zr),i===void 0&&(i="ObservableSet@"+Et()),this.name_=void 0,this[be]=gv,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)},Zr(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;Qt(function(){Be(function(){for(var i=_n(n.data_.values()),s;!(s=i()).done;){var o=s.value;n.delete(o)}})})},t.forEach=function(n,i){for(var s=_n(this),o;!(o=s()).done;){var a=o.value;n.call(i,a,a,this)}},t.add=function(n){var i=this;if(Vt(this.atom_),vt(this)){var s=_t(this,{type:vr,object:this,newValue:n});if(!s)return this}if(!this.has(n)){Qt(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=He(),a=Bt(this),f=a||o?{observableKind:"set",debugObjectName:this.name_,type:vr,object:this,newValue:n}:null;o&&lt(f),a&&kt(this,f),o&&dt()}return this},t.delete=function(n){var i=this;if(vt(this)){var s=_t(this,{type:Co,object:this,oldValue:n});if(!s)return!1}if(this.has(n)){var o=He(),a=Bt(this),f=a||o?{observableKind:"set",debugObjectName:this.name_,type:Co,object:this,oldValue:n}:null;return o&&lt(f),Qt(function(){i.atom_.reportChanged(),i.data_.delete(n)}),a&&kt(this,f),o&&dt(),!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 di({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 di({next:function(){return i<s.length?{value:n.dehanceValue_(s[i++]),done:!1}:{done:!0}}})},t.replace=function(n){var i=this;return Qr(n)&&(n=new Set(n)),Qt(function(){Array.isArray(n)?(i.clear(),n.forEach(function(s){return i.add(s)})):vi(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[id]=function(){return this.values()},Ba(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:od,get:function(){return"Set"}}]),e}(),Qr=Ar("ObservableSet",sd),Pf=Object.create(null),Rf="remove",_a=function(){function e(r,n,i,s){n===void 0&&(n=new Map),s===void 0&&(s=sb),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 wi(this.name_+".keys"),this.isPlainObject_=Mt(this.target_),fd(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 Gr)return s.set(i),!0;if(vt(this)){var o=_t(this,{type:Ut,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=Bt(this),f=He(),c=a||f?{type:Ut,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:n,newValue:i}:null;f&&lt(c),s.setNewValue_(i),a&&kt(this,c),f&&dt()}return!0},t.get_=function(n){return H.trackingDerivation&&!At(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,s){return s===void 0&&(s=!1),At(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 _r(n in this.target_,Go,this.name_+"."+la(n)+"?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(kf(this,i,n),!(n in this.target_)){var s;if((s=this.target_[tt])!=null&&s[n])return;fe(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==bi;){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)}Bf(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);kf(this,s,n);var a=s.extend_(this,n,i,o);return a&&Bf(this,s,n),a},t.defineProperty_=function(n,i,s){s===void 0&&(s=!1),Vt(this.keysAtom_);try{wt();var o=this.delete_(n);if(!o)return o;if(vt(this)){var a=_t(this,{object:this.proxy_||this.target_,name:n,type:vr,newValue:i.value});if(!a)return null;var f=a.newValue;i.value!==f&&(i=tr({},i,{value:f}))}if(s){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Kt(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{Tt()}return!0},t.defineObservableProperty_=function(n,i,s,o){o===void 0&&(o=!1),Vt(this.keysAtom_);try{wt();var a=this.delete_(n);if(!a)return a;if(vt(this)){var f=_t(this,{object:this.proxy_||this.target_,name:n,type:vr,newValue:i});if(!f)return null;i=f.newValue}var c=Uf(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 Kt(this.target_,n,y);var g=new _r(i,s,this.name_+"."+n.toString(),!1);this.values_.set(n,g),this.notifyPropertyAddition_(n,g.value_)}finally{Tt()}return!0},t.defineComputedProperty_=function(n,i,s){s===void 0&&(s=!1),Vt(this.keysAtom_);try{wt();var o=this.delete_(n);if(!o)return o;if(vt(this)){var a=_t(this,{object:this.proxy_||this.target_,name:n,type:vr,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+n.toString()),i.context=this.proxy_||this.target_;var f=Uf(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 Kt(this.target_,n,c);this.values_.set(n,new Gr(i)),this.notifyPropertyAddition_(n,void 0)}finally{Tt()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),Vt(this.keysAtom_),!At(this.target_,n))return!0;if(vt(this)){var s=_t(this,{object:this.proxy_||this.target_,name:n,type:Rf});if(!s)return null}try{var o,a;wt();var f=Bt(this),c=He(),y=this.values_.get(n),g=void 0;if(!y&&(f||c)){var k;g=(k=Ao(this.target_,n))==null?void 0:k.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 _r&&(g=y.value_),Vl(y)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(a=o.get(n))==null||a.set(n in this.target_),f||c){var R={type:Rf,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:g,name:n};c&&lt(R),f&&kt(this,R),c&&dt()}}finally{Tt()}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=Bt(this),f=He();if(a||f){var c=a||f?{type:vr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;f&&lt(c),a&&kt(this,c),f&&dt()}(s=this.pendingKeys_)==null||(o=s.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),zo(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Cn(e,t){var r;if(t&&Wr(e)&&fe("Options can't be provided for already observable objects."),At(e,be))return Va(e)instanceof _a||fe("Cannot convert '"+Po(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:(Mt(e)?"ObservableObject":e.constructor.name)+"@"+Et(),i=new _a(e,new Map,String(n),gb(t));return Ko(e,be,i),e}var bv=Ar("ObservableObjectAdministration",_a);function Uf(e){return Pf[e]||(Pf[e]={get:function(){return this[be].getObservablePropValue_(e)},set:function(r){return this[be].setObservablePropValue_(e,r)}})}function Wr(e){return Vo(e)?bv(e[be]):!1}function Bf(e,t,r){var n;e.appliedAnnotations_[r]=t,(n=e.target_[tt])==null||delete n[r]}function kf(e,t,r){if(fd(t)||fe("Cannot annotate '"+e.name_+"."+r.toString()+"': Invalid annotation."),!Eo(t)&&At(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 vv=ud(0),_v=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),oa=0,ad=function(){};function wv(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}wv(ad,Array.prototype);var Fa=function(e,t,r){Al(n,e);function n(s,o,a,f){var c;return a===void 0&&(a="ObservableArray@"+Et()),f===void 0&&(f=!1),c=e.call(this)||this,Zr(function(){var y=new La(a,o,f,!0);y.proxy_=bo(c),wl(bo(c),be,y),s&&s.length&&c.spliceWithArray(0,0,s),_v&&Object.defineProperty(bo(c),"0",vv)}),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 $n(c)?c.slice():c}))},i[r]=function(){var s=this,o=0;return di({next:function(){return o<s.length?{value:s[o++],done:!1}:{done:!0,value:void 0}}})},Ba(n,[{key:"length",get:function(){return this[be].getArrayLength_()},set:function(o){this[be].setArrayLength_(o)}},{key:t,get:function(){return"Array"}}]),n}(ad,Symbol.toStringTag,Symbol.iterator);Object.entries($o).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Ko(Fa.prototype,t,r)});function ud(e){return{enumerable:!1,configurable:!0,get:function(){return this[be].get_(e)},set:function(r){this[be].set_(e,r)}}}function Tv(e){Kt(Fa.prototype,""+e,ud(e))}function cd(e){if(e>oa){for(var t=oa;t<e+100;t++)Tv(t);oa=e}}cd(1e3);function Ov(e,t,r){return new Fa(e,t,r)}function wr(e,t){if(typeof e=="object"&&e!==null){if($n(e))return t!==void 0&&fe(23),e[be].atom_;if(Qr(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,Po(e)),r}if(Wr(e)){if(!t)return fe(26);var n=e[be].values_.get(t);return n||fe(27,t,Po(e)),n}if(ka(e)||Oi(e)||No(e))return e}else if(De(e)&&No(e[be]))return e[be];fe(28)}function Va(e,t){if(e||fe(29),t!==void 0)return Va(wr(e,t));if(ka(e)||Oi(e)||No(e)||Wt(e)||Qr(e))return e;if(e[be])return e[be];fe(24,e)}function Po(e,t){var r;if(t!==void 0)r=wr(e,t);else{if(xn(e))return e.name;Wr(e)||Wt(e)||Qr(e)?r=Va(e):r=wr(e)}return r.name_}function Zr(e){var t=Yr(),r=Wo(!0);wt();try{return e()}finally{Tt(),Jo(r),er(t)}}var Mf=bi.toString;function Ka(e,t,r){return r===void 0&&(r=-1),wa(e,t,r)}function wa(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=Mf.call(e);if(o!==Mf.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=Df(e),t=Df(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(!wa(e[y],t[y],r-1,n,i))return!1}else{var g=Object.keys(e),k;if(y=g.length,Object.keys(t).length!==y)return!1;for(;y--;)if(k=g[y],!(At(t,k)&&wa(e[k],t[k],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function Df(e){return $n(e)?e.slice():En(e)||Wt(e)||vi(e)||Qr(e)?Array.from(e.entries()):e}function di(e){return e[Symbol.iterator]=Av,e}function Av(){return this}function fd(e){return e instanceof Object&&typeof e.annotationType_=="string"&&De(e.make_)&&De(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Pa();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:Vb,extras:{getDebugName:Po},$mobx:be});var ld=jt(bg(),1),DS=ld.default.configure,Jr=ld.default,sa=100,{WARN:Iv,LOG:jS,DEBUG:br,VERBOSE:ft,ERROR:LS}=Se.setup(Se.INFO);tv({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");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:Jr(n)}}`:""}`);function Ev(e,t){return Be(()=>rt.structural(e.get(),t.get()))}function Si(e,t){return rt.shallow(e.applogs,t.applogs)}function za(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(ft("queryNodesComparer",r,n,i),!rt.structural(n.variables,i.variables))return ft("[queryNodesComparer] changed vars:",r,n,i),!1;if(!Si(n.logsOfThisNode,i.logsOfThisNode))return ft("[queryNodesComparer] changed logsOfThisNode:",r,n,i),!1}return ft("[queryNodesComparer] equal:",{a:e,b:t}),!0}var Sv=0;function Zt(e,{name:t,equals:r}={}){let n=`observableArrayMap@${++Sv}{${t}}`;ft(`[${n}] create`,{fnname:e.name,fn:e,name:t,equals:r});let i,s=xv(e,a=>{i?Be(()=>(r??rt.structural)(i,a))?br(`[${n}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),br(`[${n}] updated`,{updatedItems:a,observableArr:i})):i=ke.array(a,{deep:!1,name:t,equals:r})},{name:n}),o=Ai(i,()=>{ft(`[${n}] dispose`),o(),s()});return i}function xv(e,t,{name:r}={}){br("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:r});let n=`${r}.autorunImm`,i,s=new ci(n,(...f)=>{br(`[${n}] reaction.invalidate`,f),o()});function o(){s.track(()=>{let f=sa&&performance.now();br(`[${n}] runAndTrack:`,{name:r??e.name,fn:e}),i=e(),br(`[${n}] runAndTrack =>`,i),t(i),sa&&performance.now()-f>sa&&Iv(`[${n}] took ${performance.now()-f}ms`)})}return o(),br.isEnabled&&br(`[${n}] deps of reaction`,{reaction:s,result:i,deps:Xo(s)}),()=>{ft(`[${n}] dispose`),setTimeout(()=>s.dispose())}}function nt(e,t,r=!1){if(xn(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(rt.structural(R,c)){f=j;break}if(f){let R=f.get();return ft(`[${y}] cache hit`,{untrackedArgs:c,cachedResult:R}),R}if(!s.keepAlive&&!$b())return!n&&Bb().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);ft(`[${y}] new computation`,{untrackedArgs:c});let g,k=Ge(()=>(ft(`[${y}] update->rerun`,Be(()=>({args:a})),t),ft.isDisabled||Zl(),g=t.apply(this,a)),{...s,name:y});if(ft(`[${y}] deps`,Xo(k),{untrackedArgs:c}),o.set(c,k),!s.keepAlive){let R=Ai(k,()=>{ft(`[${y}] dispose`,k),R(),o.delete(c),s.onCleanup&&s.onCleanup(g,...a),g=void 0})}return k.get()}}function Nv(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:jf,LOG:FS,DEBUG:$v,VERBOSE:VS,ERROR:gr}=Se.setup(Se.INFO,{prefix:"[thread]"});function rr(e){return e.init!==void 0}var qa=class{constructor(e,t,r,n=[]){this.name=e,this._applogs=n,this.parents=t===null?null:Of(t),this.filters=r,Be(()=>this.parents?.length===0)&&jf("[Thread] empty parents array",e),Nn(this,{applogsCids:Ge,insert:Ot,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 gr("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw gr("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw gr("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw gr("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw gr("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw gr("[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):jf("unsubscribe called for non-existent",e)}notifySubscribers(e){$v(`[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||gr("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 gr("[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 Nv(this.name)}};function Ta(e){"@babel/helpers - typeof";return Ta=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},Ta(e)}function dd(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Lf(e){dd(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Ta(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 Cv(e,t){dd(2,arguments);var r=Lf(e),n=Lf(t);return r.getTime()<n.getTime()}var Pv=typeof global=="object"&&global&&global.Object===Object&&global,pd=Pv,Rv=typeof self=="object"&&self&&self.Object===Object&&self,Uv=pd||Rv||Function("return this")(),nr=Uv,Bv=nr.Symbol,Gt=Bv,yd=Object.prototype,kv=yd.hasOwnProperty,Mv=yd.toString,oi=Gt?Gt.toStringTag:void 0;function Dv(e){var t=kv.call(e,oi),r=e[oi];try{e[oi]=void 0;var n=!0}catch{}var i=Mv.call(e);return n&&(t?e[oi]=r:delete e[oi]),i}var jv=Dv,Lv=Object.prototype,Fv=Lv.toString;function Vv(e){return Fv.call(e)}var Kv=Vv,zv="[object Null]",qv="[object Undefined]",Ff=Gt?Gt.toStringTag:void 0;function Gv(e){return e==null?e===void 0?qv:zv:Ff&&Ff in Object(e)?jv(e):Kv(e)}var Pn=Gv;function Hv(e){return e!=null&&typeof e=="object"}var An=Hv,Wv="[object Symbol]";function Jv(e){return typeof e=="symbol"||An(e)&&Pn(e)==Wv}var pi=Jv;function Xv(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 Yv=Xv,Qv=Array.isArray,Ht=Qv,Zv=1/0,Vf=Gt?Gt.prototype:void 0,Kf=Vf?Vf.toString:void 0;function hd(e){if(typeof e=="string")return e;if(Ht(e))return Yv(e,hd)+"";if(pi(e))return Kf?Kf.call(e):"";var t=e+"";return t=="0"&&1/e==-Zv?"-0":t}var e_=hd;function t_(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var yi=t_;function r_(e){return e}var md=r_,n_="[object AsyncFunction]",i_="[object Function]",o_="[object GeneratorFunction]",s_="[object Proxy]";function a_(e){if(!yi(e))return!1;var t=Pn(e);return t==i_||t==o_||t==n_||t==s_}var gd=a_,u_=nr["__core-js_shared__"],aa=u_,zf=function(){var e=/[^.]+$/.exec(aa&&aa.keys&&aa.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function c_(e){return!!zf&&zf in e}var f_=c_,l_=Function.prototype,d_=l_.toString;function p_(e){if(e!=null){try{return d_.call(e)}catch{}try{return e+""}catch{}}return""}var en=p_,y_=/[\\^$.*+?()[\]{}|]/g,h_=/^\[object .+?Constructor\]$/,m_=Function.prototype,g_=Object.prototype,b_=m_.toString,v_=g_.hasOwnProperty,__=RegExp("^"+b_.call(v_).replace(y_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function w_(e){if(!yi(e)||f_(e))return!1;var t=gd(e)?__:h_;return t.test(en(e))}var T_=w_;function O_(e,t){return e?.[t]}var A_=O_;function I_(e,t){var r=A_(e,t);return T_(r)?r:void 0}var tn=I_,E_=tn(nr,"WeakMap"),Oa=E_;function S_(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 x_=S_,N_=800,$_=16,C_=Date.now;function P_(e){var t=0,r=0;return function(){var n=C_(),i=$_-(n-r);if(r=n,i>0){if(++t>=N_)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var R_=P_;function U_(e){return function(){return e}}var B_=U_,k_=function(){try{var e=tn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ro=k_,M_=Ro?function(e,t){return Ro(e,"toString",{configurable:!0,enumerable:!1,value:B_(t),writable:!0})}:md,D_=M_,j_=R_(D_),L_=j_,F_=9007199254740991,V_=/^(?:0|[1-9]\d*)$/;function K_(e,t){var r=typeof e;return t=t??F_,!!t&&(r=="number"||r!="symbol"&&V_.test(e))&&e>-1&&e%1==0&&e<t}var Ga=K_;function z_(e,t,r){t=="__proto__"&&Ro?Ro(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var q_=z_;function G_(e,t){return e===t||e!==e&&t!==t}var Ha=G_,H_=Object.prototype,W_=H_.hasOwnProperty;function J_(e,t,r){var n=e[t];(!(W_.call(e,t)&&Ha(n,r))||r===void 0&&!(t in e))&&q_(e,t,r)}var X_=J_,qf=Math.max;function Y_(e,t,r){return t=qf(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=qf(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),x_(e,this,a)}}var Q_=Y_,Z_=9007199254740991;function ew(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Z_}var Wa=ew;function tw(e){return e!=null&&Wa(e.length)&&!gd(e)}var rw=tw,nw=Object.prototype;function iw(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||nw;return e===r}var ow=iw;function sw(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var aw=sw,uw="[object Arguments]";function cw(e){return An(e)&&Pn(e)==uw}var Gf=cw,bd=Object.prototype,fw=bd.hasOwnProperty,lw=bd.propertyIsEnumerable,dw=Gf(function(){return arguments}())?Gf:function(e){return An(e)&&fw.call(e,"callee")&&!lw.call(e,"callee")},Ja=dw;function pw(){return!1}var yw=pw,vd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hf=vd&&typeof module=="object"&&module&&!module.nodeType&&module,hw=Hf&&Hf.exports===vd,Wf=hw?nr.Buffer:void 0,mw=Wf?Wf.isBuffer:void 0,gw=mw||yw,Aa=gw,bw="[object Arguments]",vw="[object Array]",_w="[object Boolean]",ww="[object Date]",Tw="[object Error]",Ow="[object Function]",Aw="[object Map]",Iw="[object Number]",Ew="[object Object]",Sw="[object RegExp]",xw="[object Set]",Nw="[object String]",$w="[object WeakMap]",Cw="[object ArrayBuffer]",Pw="[object DataView]",Rw="[object Float32Array]",Uw="[object Float64Array]",Bw="[object Int8Array]",kw="[object Int16Array]",Mw="[object Int32Array]",Dw="[object Uint8Array]",jw="[object Uint8ClampedArray]",Lw="[object Uint16Array]",Fw="[object Uint32Array]",Re={};Re[Rw]=Re[Uw]=Re[Bw]=Re[kw]=Re[Mw]=Re[Dw]=Re[jw]=Re[Lw]=Re[Fw]=!0;Re[bw]=Re[vw]=Re[Cw]=Re[_w]=Re[Pw]=Re[ww]=Re[Tw]=Re[Ow]=Re[Aw]=Re[Iw]=Re[Ew]=Re[Sw]=Re[xw]=Re[Nw]=Re[$w]=!1;function Vw(e){return An(e)&&Wa(e.length)&&!!Re[Pn(e)]}var Kw=Vw;function zw(e){return function(t){return e(t)}}var qw=zw,_d=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ai=_d&&typeof module=="object"&&module&&!module.nodeType&&module,Gw=ai&&ai.exports===_d,ua=Gw&&pd.process,Hw=function(){try{var e=ai&&ai.require&&ai.require("util").types;return e||ua&&ua.binding&&ua.binding("util")}catch{}}(),Jf=Hw,Xf=Jf&&Jf.isTypedArray,Ww=Xf?qw(Xf):Kw,wd=Ww,Jw=Object.prototype,Xw=Jw.hasOwnProperty;function Yw(e,t){var r=Ht(e),n=!r&&Ja(e),i=!r&&!n&&Aa(e),s=!r&&!n&&!i&&wd(e),o=r||n||i||s,a=o?aw(e.length,String):[],f=a.length;for(var c in e)(t||Xw.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ga(c,f)))&&a.push(c);return a}var Qw=Yw;function Zw(e,t){return function(r){return e(t(r))}}var e0=Zw,t0=e0(Object.keys,Object),r0=t0,n0=Object.prototype,i0=n0.hasOwnProperty;function o0(e){if(!ow(e))return r0(e);var t=[];for(var r in Object(e))i0.call(e,r)&&r!="constructor"&&t.push(r);return t}var s0=o0;function a0(e){return rw(e)?Qw(e):s0(e)}var Td=a0,u0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c0=/^\w*$/;function f0(e,t){if(Ht(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||pi(e)?!0:c0.test(e)||!u0.test(e)||t!=null&&e in Object(t)}var Xa=f0,l0=tn(Object,"create"),hi=l0;function d0(){this.__data__=hi?hi(null):{},this.size=0}var p0=d0;function y0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var h0=y0,m0="__lodash_hash_undefined__",g0=Object.prototype,b0=g0.hasOwnProperty;function v0(e){var t=this.__data__;if(hi){var r=t[e];return r===m0?void 0:r}return b0.call(t,e)?t[e]:void 0}var _0=v0,w0=Object.prototype,T0=w0.hasOwnProperty;function O0(e){var t=this.__data__;return hi?t[e]!==void 0:T0.call(t,e)}var A0=O0,I0="__lodash_hash_undefined__";function E0(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=hi&&t===void 0?I0:t,this}var S0=E0;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=p0;Rn.prototype.delete=h0;Rn.prototype.get=_0;Rn.prototype.has=A0;Rn.prototype.set=S0;var Yf=Rn;function x0(){this.__data__=[],this.size=0}var N0=x0;function $0(e,t){for(var r=e.length;r--;)if(Ha(e[r][0],t))return r;return-1}var Yo=$0,C0=Array.prototype,P0=C0.splice;function R0(e){var t=this.__data__,r=Yo(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():P0.call(t,r,1),--this.size,!0}var U0=R0;function B0(e){var t=this.__data__,r=Yo(t,e);return r<0?void 0:t[r][1]}var k0=B0;function M0(e){return Yo(this.__data__,e)>-1}var D0=M0;function j0(e,t){var r=this.__data__,n=Yo(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var L0=j0;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=N0;Un.prototype.delete=U0;Un.prototype.get=k0;Un.prototype.has=D0;Un.prototype.set=L0;var Qo=Un,F0=tn(nr,"Map"),mi=F0;function V0(){this.size=0,this.__data__={hash:new Yf,map:new(mi||Qo),string:new Yf}}var K0=V0;function z0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var q0=z0;function G0(e,t){var r=e.__data__;return q0(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Zo=G0;function H0(e){var t=Zo(this,e).delete(e);return this.size-=t?1:0,t}var W0=H0;function J0(e){return Zo(this,e).get(e)}var X0=J0;function Y0(e){return Zo(this,e).has(e)}var Q0=Y0;function Z0(e,t){var r=Zo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var eT=Z0;function Bn(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])}}Bn.prototype.clear=K0;Bn.prototype.delete=W0;Bn.prototype.get=X0;Bn.prototype.has=Q0;Bn.prototype.set=eT;var es=Bn,tT="Expected a function";function Ya(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(tT);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(Ya.Cache||es),r}Ya.Cache=es;var rT=Ya,nT=500;function iT(e){var t=rT(e,function(n){return r.size===nT&&r.clear(),n}),r=t.cache;return t}var oT=iT,sT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aT=/\\(\\)?/g,uT=oT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sT,function(r,n,i,s){t.push(i?s.replace(aT,"$1"):n||r)}),t}),cT=uT;function fT(e){return e==null?"":e_(e)}var lT=fT;function dT(e,t){return Ht(e)?e:Xa(e,t)?[e]:cT(lT(e))}var ts=dT,pT=1/0;function yT(e){if(typeof e=="string"||pi(e))return e;var t=e+"";return t=="0"&&1/e==-pT?"-0":t}var xi=yT;function hT(e,t){t=ts(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 Qa=hT;function mT(e,t,r){var n=e==null?void 0:Qa(e,t);return n===void 0?r:n}var gT=mT;function bT(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Od=bT,Qf=Gt?Gt.isConcatSpreadable:void 0;function vT(e){return Ht(e)||Ja(e)||!!(Qf&&e&&e[Qf])}var _T=vT;function Ad(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=_T),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?Ad(a,t-1,r,n,i):Od(i,a):n||(i[i.length]=a)}return i}var wT=Ad;function TT(e){var t=e==null?0:e.length;return t?wT(e,1):[]}var OT=TT;function AT(e){return L_(Q_(e,void 0,OT),e+"")}var IT=AT;function ET(){this.__data__=new Qo,this.size=0}var ST=ET;function xT(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var NT=xT;function $T(e){return this.__data__.get(e)}var CT=$T;function PT(e){return this.__data__.has(e)}var RT=PT,UT=200;function BT(e,t){var r=this.__data__;if(r instanceof Qo){var n=r.__data__;if(!mi||n.length<UT-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new es(n)}return r.set(e,t),this.size=r.size,this}var kT=BT;function kn(e){var t=this.__data__=new Qo(e);this.size=t.size}kn.prototype.clear=ST;kn.prototype.delete=NT;kn.prototype.get=CT;kn.prototype.has=RT;kn.prototype.set=kT;var To=kn;function MT(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 DT=MT;function jT(){return[]}var LT=jT,FT=Object.prototype,VT=FT.propertyIsEnumerable,Zf=Object.getOwnPropertySymbols,KT=Zf?function(e){return e==null?[]:(e=Object(e),DT(Zf(e),function(t){return VT.call(e,t)}))}:LT,zT=KT;function qT(e,t,r){var n=t(e);return Ht(e)?n:Od(n,r(e))}var GT=qT;function HT(e){return GT(e,Td,zT)}var el=HT,WT=tn(nr,"DataView"),Ia=WT,JT=tn(nr,"Promise"),Ea=JT,XT=tn(nr,"Set"),Sa=XT,tl="[object Map]",YT="[object Object]",rl="[object Promise]",nl="[object Set]",il="[object WeakMap]",ol="[object DataView]",QT=en(Ia),ZT=en(mi),eO=en(Ea),tO=en(Sa),rO=en(Oa),Vr=Pn;(Ia&&Vr(new Ia(new ArrayBuffer(1)))!=ol||mi&&Vr(new mi)!=tl||Ea&&Vr(Ea.resolve())!=rl||Sa&&Vr(new Sa)!=nl||Oa&&Vr(new Oa)!=il)&&(Vr=function(e){var t=Pn(e),r=t==YT?e.constructor:void 0,n=r?en(r):"";if(n)switch(n){case QT:return ol;case ZT:return tl;case eO:return rl;case tO:return nl;case rO:return il}return t});var sl=Vr,nO=nr.Uint8Array,al=nO,iO="__lodash_hash_undefined__";function oO(e){return this.__data__.set(e,iO),this}var sO=oO;function aO(e){return this.__data__.has(e)}var uO=aO;function Uo(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new es;++t<r;)this.add(e[t])}Uo.prototype.add=Uo.prototype.push=sO;Uo.prototype.has=uO;var cO=Uo;function fO(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 lO=fO;function dO(e,t){return e.has(t)}var pO=dO,yO=1,hO=2;function mO(e,t,r,n,i,s){var o=r&yO,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,k=!0,R=r&hO?new cO: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;k=!1;break}if(R){if(!lO(t,function(B,z){if(!pO(R,z)&&(j===B||i(j,B,r,n,s)))return R.push(z)})){k=!1;break}}else if(!(j===te||i(j,te,r,n,s))){k=!1;break}}return s.delete(e),s.delete(t),k}var Id=mO;function gO(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var bO=gO;function vO(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var _O=vO,wO=1,TO=2,OO="[object Boolean]",AO="[object Date]",IO="[object Error]",EO="[object Map]",SO="[object Number]",xO="[object RegExp]",NO="[object Set]",$O="[object String]",CO="[object Symbol]",PO="[object ArrayBuffer]",RO="[object DataView]",ul=Gt?Gt.prototype:void 0,ca=ul?ul.valueOf:void 0;function UO(e,t,r,n,i,s,o){switch(r){case RO:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case PO:return!(e.byteLength!=t.byteLength||!s(new al(e),new al(t)));case OO:case AO:case SO:return Ha(+e,+t);case IO:return e.name==t.name&&e.message==t.message;case xO:case $O:return e==t+"";case EO:var a=bO;case NO:var f=n&wO;if(a||(a=_O),e.size!=t.size&&!f)return!1;var c=o.get(e);if(c)return c==t;n|=TO,o.set(e,t);var y=Id(a(e),a(t),n,i,s,o);return o.delete(e),y;case CO:if(ca)return ca.call(e)==ca.call(t)}return!1}var BO=UO,kO=1,MO=Object.prototype,DO=MO.hasOwnProperty;function jO(e,t,r,n,i,s){var o=r&kO,a=el(e),f=a.length,c=el(t),y=c.length;if(f!=y&&!o)return!1;for(var g=f;g--;){var k=a[g];if(!(o?k in t:DO.call(t,k)))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;){k=a[g];var B=e[k],z=t[k];if(n)var Y=o?n(z,B,k,t,e,s):n(B,z,k,e,t,s);if(!(Y===void 0?B===z||i(B,z,r,n,s):Y)){te=!1;break}W||(W=k=="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 LO=jO,FO=1,cl="[object Arguments]",fl="[object Array]",go="[object Object]",VO=Object.prototype,ll=VO.hasOwnProperty;function KO(e,t,r,n,i,s){var o=Ht(e),a=Ht(t),f=o?fl:sl(e),c=a?fl:sl(t);f=f==cl?go:f,c=c==cl?go:c;var y=f==go,g=c==go,k=f==c;if(k&&Aa(e)){if(!Aa(t))return!1;o=!0,y=!1}if(k&&!y)return s||(s=new To),o||wd(e)?Id(e,t,r,n,i,s):BO(e,t,f,r,n,i,s);if(!(r&FO)){var R=y&&ll.call(e,"__wrapped__"),j=g&&ll.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 k?(s||(s=new To),LO(e,t,r,n,i,s)):!1}var zO=KO;function Ed(e,t,r,n,i){return e===t?!0:e==null||t==null||!An(e)&&!An(t)?e!==e&&t!==t:zO(e,t,r,n,Ed,i)}var Sd=Ed,qO=1,GO=2;function HO(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 k=n(c,y,f,e,t,g);if(!(k===void 0?Sd(y,c,qO|GO,n,g):k))return!1}}return!0}var WO=HO;function JO(e){return e===e&&!yi(e)}var xd=JO;function XO(e){for(var t=Td(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,xd(i)]}return t}var YO=XO;function QO(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Nd=QO;function ZO(e){var t=YO(e);return t.length==1&&t[0][2]?Nd(t[0][0],t[0][1]):function(r){return r===e||WO(r,e,t)}}var eA=ZO;function tA(e,t){return e!=null&&t in Object(e)}var rA=tA;function nA(e,t,r){t=ts(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&&Wa(i)&&Ga(o,i)&&(Ht(e)||Ja(e)))}var iA=nA;function oA(e,t){return e!=null&&iA(e,t,rA)}var $d=oA,sA=1,aA=2;function uA(e,t){return Xa(e)&&xd(t)?Nd(xi(e),t):function(r){var n=gT(r,e);return n===void 0&&n===t?$d(r,e):Sd(t,n,sA|aA)}}var cA=uA;function fA(e){return function(t){return t?.[e]}}var lA=fA;function dA(e){return function(t){return Qa(t,e)}}var pA=dA;function yA(e){return Xa(e)?lA(xi(e)):pA(e)}var hA=yA;function mA(e){return typeof e=="function"?e:e==null?md:typeof e=="object"?Ht(e)?cA(e[0],e[1]):eA(e):hA(e)}var gA=mA;function bA(e,t,r,n){if(!yi(e))return e;t=ts(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=yi(y)?y:Ga(t[i+1])?[]:{})}X_(a,f,c),a=a[f]}return e}var vA=bA;function _A(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=Qa(e,o);r(a,o)&&vA(s,ts(o,e),a)}return s}var wA=_A;function TA(e,t){return wA(e,t,function(r,n){return $d(e,n)})}var OA=TA,AA=IT(function(e,t){return e==null?{}:OA(e,t)}),dl=AA,IA=4294967295,EA=IA-1,SA=Math.floor,xA=Math.min;function NA(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=pi(t),c=t===void 0;i<s;){var y=SA((i+s)/2),g=r(e[y]),k=g!==void 0,R=g===null,j=g===g,te=pi(g);if(o)var W=n||j;else c?W=j&&(n||k):a?W=j&&k&&(n||!R):f?W=j&&k&&!R&&(n||!te):R||te?W=!1:W=n?g<=t:g<t;W?i=y+1:s=y}return xA(s,EA)}var $A=NA;function CA(e,t,r){return $A(e,t,gA(r,2))}var PA=CA,{WARN:KS,LOG:zS,DEBUG:qS,VERBOSE:GS,ERROR:RA}=Se.setup(Se.INFO),Cd=(e,t,r="asc")=>r==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),Pd=(e,t,r="asc")=>Cd(e.ts,t.ts,r);function Xr(e,t="asc"){return e.sort((r,n)=>Pd(r,n,t))}var Rd=(e,t)=>Cv(new Date(e.ts),new Date(t.ts));var Ud=(e,t,r)=>rt.structural(dl(e,r),dl(t,r)),Za=e=>{let t=new Map;for(let r of e){if(!r)throw RA("falsy entry in applogs",e),new Error("falsy entry in applogs");let n=Jr(r);t.set(n,r)}return Array.from(t.values())};function Bd(e){return typeof e=="string"&&e.startsWith("?")}function kd(e){return e.slice(1)}function eu(e,t){let r={};return[Object.entries(e).reduce((i,[s,o])=>{if(Bd(o)){let a=kd(o),f=t[a];f?i[s]=f:r[s]=a}else i[s]=o;return i},{}),r]}function Md(e,t,r){let n=typeof t=="function"?t(r):Array.isArray(t)&&!Array.isArray(r)?t.includes(r):t===r;return e.startsWith("!")?!n:n}var Dd=function(t){for(var r=0,n=0,i=t.length;n<i;n++)r+=t[n];return r},pl=function(t){return Dd(t)/t.length},ct={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return ct.max(e)-ct.min(e)},midrange:function(e){return ct.range(e)/2},sum:Dd,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=ct.mean(e);return ct.mean(e.map(function(r){return Math.pow(r-t,2)}))},standardDeviation:function(e){return Math.sqrt(ct.variance(e))},meanAbsoluteDeviation:function(e){var t=ct.mean(e);return ct.mean(e.map(function(r){return Math.abs(r-t)}))},zScores:function(e){var t=ct.mean(e),r=ct.standardDeviation(e);return e.map(function(n){return(n-t)/r})}};ct.average=ct.mean;function tu(){return new Date().toISOString()}var Ue=jt(Yt(),1),jd=jt(Og(),1),Bo=e=>Ue.Type.Union([e,Ue.Type.Null()]);var Ld=/^(k51qz|baguq)[0-9a-z]{56,57}$/,UA=/^[0-9A-Fa-f]{7,8}$/g;Ue.FormatRegistry.Set("EntityID",e=>!!e.match(UA)||!!e.match(Ld));var ru=Ue.Type.String();Ue.FormatRegistry.Set("CID",e=>!!e.match(Ld));var ko=Ue.Type.String({format:"CID"}),BA=/^http([s]?):\/\/.*\..*/;Ue.FormatRegistry.Set("URL",e=>!!e.match(BA));var kA=Ue.Type.String({format:"URL"}),Fd=Ue.Type.Object({en:ru,at:Ue.Type.String(),vl:Bo(Ue.Type.Union([Ue.Type.String(),Ue.Type.Boolean(),Ue.Type.Number()])),ts:Ue.Type.String(),ag:Ue.Type.String(),pv:ko}),xa=jd.TypeCompiler.Compile(Fd);var MA=xa.Check.bind(xa),Vd=Ue.Type.Object({cid:ko,en:ru,at:Ue.Type.String(),vl:Bo(Ue.Type.Union([Ue.Type.String(),Ue.Type.Boolean(),Ue.Type.Number()])),ts:Ue.Type.String(),ag:Ue.Type.String(),pv:Bo(ko)}),Mo=jd.TypeCompiler.Compile(Vd),Kd=e=>Array.from(Mo.Errors(e)),nu=Mo.Check.bind(Mo),{WARN:zd,LOG:HS,DEBUG:DA,VERBOSE:WS,ERROR:ui}=Se.setup(Se.INFO);function qd(e,{ts:t,threadForPv:r}={}){let n=Hd(e,t??tu()),i=Wd(n,r),s=ta(i).toString();e.cid&&e.cid!==s&&zd("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:s,logWithPv:i});let o={...i,cid:s};if(!nu(o))throw ui(`Bogus Applog ${JSON.stringify(o)}`,Kd(o));return Object.freeze(o)}function Gd(e){return!!e.ts}function Hd(e,t){return Gd(e)?e:{...e,ts:t}}function Wd(e,t){if(t){let{en:r,at:n}=e,i=Tr(t,{en:r,at:n});if(i.size>1)throw ui("[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(Ud(e,s,["en","at","vl","ts","ag"]))throw ui("[withPvFrom] Same as previous:",{log:e,pv:s,thread:t});e.pv&&!o&&zd("[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 ui("[withPvFrom] no thread and no pv:",e);return e}}function Do(e){let t=()=>(Be(()=>e.length<2&&DA(`joinThreads with count=${e.length}`)),Xr(Za(e.flatMap(i=>{let s=i.applogs;if(!s)throw ui("falsy applogs of thread",i),new Error("falsy applogs of thread");return s})))),r=Be(()=>t()),n=Ot(function(i,s){return rr(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 rs(Be(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],r,n)}var{WARN:yl,LOG:JS,DEBUG:hl,VERBOSE:Fr,ERROR:jA}=Se.setup(Se.INFO),rs=class extends qa{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,Nn(this,{onParentUpdate:Ot}),this.subscribeToParents()}_parentSubscriptions=new Map;subscribeToParents(){let e=qt(()=>{this.parents.length||yl("MappedThread has no parents",this),Fr(`[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)&&Fr(`[MappedThread: ${this.name}] Skipping re-sub to parent`,r.nameAndSizeUntracked),Fr(`[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)Fr(`[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(()=>wn(e.applogs))})})}onParentUpdate(e,t){Fr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,t);let r=this._eventMapper(t,e);if(Fr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,r),rr(r))this._applogs.replace([...r.init]);else{for(let n of r.added)this._applogs.splice(PA(this._applogs,n,"ts"),0,n);if(r.removed){for(let n of r.removed)if(!this._applogs.remove(n))if(!rr(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 jA(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,n,{thread:this,event:t,mapResult:r})}}Fr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Xo(this._applogs)),this.notifySubscribers(r)}},{WARN:XS,LOG:YS,DEBUG:QS,VERBOSE:fa,ERROR:LA}=Se.setup(Se.INFO),Tr=nt("rollingFilter",function(t,r,n={}){let i=Xd(r),s=Na(i),o=ke.array(Be(()=>s(t.applogs)),{deep:!1,name:`${t.name} | ${n.name||`rollingFilter.array{${Jr(i)}}`}`}),a=g=>{let k;return rr(g)?k={init:s(g.init)}:k={added:s(g.added),removed:g.removed},fa(`rollingFilter{${t.nameAndSizeUntracked} | ${n.name?` '${n.name}'}`:""} parentUpdate`,i,g,"=>",k),k},f=new rs(`${t.name} | ${n.name||`rollingFilter{${Jr(i)}}`}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],o,a),c=Jb(()=>JSON.parse(JSON.stringify(r)),g=>{fa(`rollingFilter<${t.nameAndSizeUntracked}>${n.name?` '${n.name}'`:""} patternUpdate`,i,"=>",g),i=g,s=Na(i),f.triggerRemap()}),y=Ai(o,()=>{fa(`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})}),Jd=nt("rollingMapper",function(t,r,n={}){let i=Be(()=>r.call(null,{init:t.applogs},t));if(!rr(i))throw LA("Initial run must return init event");let s=i.init;return new rs(`${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})}),FA=nt("rollingAcc",function(t,r,n,i={}){return n=Ot(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}`:""}}`}),Xd=function(t){let r=Be(()=>Object.fromEntries(Object.entries(wn(t)).map(([n,i])=>[wn(n),wn(i)])));if(!Object.entries(r).length)throw new Error("Pattern is empty");return r};function Na(e){return t=>t.filter(r=>{for(let[n,i]of Object.entries(e)){let s=r[n.startsWith("!")?n.slice(1):n];if(!Md(n,i,s))return!1}return!0})}var VA=class{constructor(e,t,r=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=r,Nn(this,{threadOfTrail:Ge})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?Do([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},Yd=class{constructor(e){this.nodes=e,Nn(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 Zt(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return Do(Zt(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogs(){return Zt(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return Do(Zt(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:ZS,LOG:gi,DEBUG:Or,VERBOSE:xe,ERROR:jo}=Se.setup(Se.INFO,{prefix:"[q]"}),KA=nt("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 jo("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,s=Jd(t,function(o,a){let f=rr(o),c,y=[],g=f?null:[];f?(i=new Map,c=o.init):c=o.added;let k;for(let R=r?0:c.length-1;r?R<c.length:R>=0;r?R++:R--){let j=c[R],te=Jr([j.en,j.at]);if(k&&(r?k>j.ts:k<j.ts))throw jo("lastWriteWins.mapper logs not sorted:",k,r?">":"<",j.ts,{log:j,i:R,newLogs:c,inverseToOnlyReturnFirstLogs:r});k=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 Xr(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||qt(()=>{xe(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,s.applogs.length)}),s},{equals:Si,argsDebugName:e=>Qe({caller:"lastWriteWins",thread:e})}),ex=nt("withoutDeleted",function(t){if(xe(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw jo("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=Zt(()=>r.map(s=>s.en),{name:n});return xe.isDisabled||qt(()=>{xe(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),Tr(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:Si}),zA=nt("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||qt(()=>xe("query result:",wn(f))),f},{equals:za,argsDebugName:(e,t,r)=>Qe({caller:"query",thread:e,args:r?{pattern:t,startVars:r}:t})}),qA=nt("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]=eu(n,a?.variables??{});xe("[queryStep.doQuery] patternWithoutVars: ",f);let y=Tr(t,f),g=Qd(c),k=Zt(()=>{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 VA(ns.fromArray([j],Qe({caller:"QueryNode",thread:y,pattern:`${Jr(W)}@${Jr(f)}`}),!0),W,a)})},{name:Qe({caller:"doQuery.mapNodes",thread:y,pattern:n})});return xe.isEnabled&&qt(()=>xe("[queryStep.doQuery] resultNodes:",[...k])),i.debug&&gi("[queryStep] step result:",Be(()=>k.map(({variables:R,logsOfThisNode:j})=>({variables:R,thread:j.applogs})))),k}let o=Zt(()=>(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&&qt(()=>xe("[queryStep] observableResultNodes:",[...o])),new Yd(o)},{equals:za,argsDebugName:(e,t,r)=>Qe({caller:"queryStep",thread:e,pattern:r})}),tx=nt("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]=eu(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&&gi("[queryNot] node result:",f,"=>",g.applogs),g.isEmpty})}return new Yd(s)},{equals:za,argsDebugName:(e,t,r)=>Qe({caller:"queryNot",thread:e,pattern:r})}),rx=nt("filterAndMap",function(t,r,n){Or(`filterAndMap<${t.nameAndSizeUntracked}>`,r);let i=Tr(t,r);xe("[filterAndMap] filtered:",i.untrackedSize),xe.isDisabled||qt(()=>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(Qd(n))},o=Qe({thread:t,pattern:r,caller:"filterAndMap"}),a=Zt(s,{name:o});return xe.isDisabled||qt(()=>xe("[filterAndMap] mapped:",a)),a},{equals:rt.structural,argsDebugName:(e,t)=>Qe({caller:"filterAndMap",thread:e,pattern:t})}),nx=nt("queryAndMap",function(t,r,n,i={}){Or(`queryAndMap<${t.nameAndSizeUntracked}>`,{patternOrPatterns:r,variables:i,map:n});let s=Qe({thread:t,caller:"queryAndMap"}),o=zA(t,r);xe("[queryAndMap] filtered count:",o.untrackedSize);let a=Zt(()=>{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||qt(()=>xe("[queryAndMap] result:",wn(a))),a},{equals:rt.structural,argsDebugName:(e,t)=>Qe({caller:"queryAndMap",thread:e,pattern:t})}),ix=nt("queryEntity",function(t,r,n,i){Or(`queryEntity<${t.nameAndSizeUntracked}>`,n,r);let s=Tr(t,{en:n,at:HA(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:Ev,argsDebugName:(e,t,r)=>Qe({caller:"queryEntity",thread:e,args:{name:t,entityID:r}})}),ox=nt("agentsOfThread",function(t){gi(`agentsOfThread<${t.nameAndSizeUntracked}>`);let r=ke.map(),n=Ot(s=>{for(let o of rr(s)?s.init:s.added){let a=r.get(o.ag)??0;r.set(o.ag,a+1)}for(let o of!rr(s)&&s.removed||[]){let a=r.get(o.ag);if(!a||a<1)throw jo("[agentsOfThread] number is now negative",{log:o,event:s,mapped:r,prev:a});r.set(o.ag,a-1)}gi(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:s,mapped:r})});n({init:t.applogs});let i=t.subscribe(n);return Jl(r,i),r}),GA=nt("entityOverlap",function(t,r){return gi(`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 sx=nt("entityOverlapCount",function(t,r){return Ge(()=>GA(t,r).get().length)});function Qd(e){return t=>Object.entries(e).reduce((r,[n,i])=>(r[i]=t[n],r),{})}function HA(e,t){return t.map(r=>WA(e,r))}function WA(e,t){return`${e}/${t}`}var{WARN:JA,LOG:XA,DEBUG:ax,VERBOSE:YA,ERROR:Oo}=Se.setup(Se.INFO),Zd=class extends qa{constructor(e,t=[],r){super(e,null,r,t),Nn(this,{})}insert(e){let t=tu(),r=KA(this),n=e.map(i=>qd(i,{ts:t,threadForPv:r}));return this.insertRaw(n)}insertRaw(e){let t=Za(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=>!nu(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){JA("[insertRaw] skipping empty insert empty logs array");return}XA("Inserting:",e.length===1?e[0]:e,{ds:this}),Xr(e);let i=this._applogs.length&&Rd(e[0],this._applogs[this._applogs.length-1]);return this._applogs.push(...e),i&&Xr(this._applogs),this.notifySubscribers({added:e,removed:null}),this.persist(e),e}get readOnly(){return!1}},ns=class $a extends Zd{constructor(t,r,n,i){super(t,r,n),this._readOnly=i,Nn(this,{_applogs:ke.shallow})}static empty(t){return $a.fromArray([],t??"empty in-memory",!1)}static fromArray(t,r,n=!1){return new $a(r??"in-memory",t,[],n)}get readOnly(){return this._readOnly}persist(t){if(YA("[InMem.persist] no persist for",t),this.readOnly)throw Oo("[persist] called for readOnly thread")}};var QA=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}}}),ZA=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,k=s.length;do{if(y>=k||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}}}),e1=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}}}),uu=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:QA(),decode:ZA(),encodingLength:e1()}}}),t1=42;function r1(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Rt.decode(e.subarray(1))}var rp={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};rp.tags[t1]=r1;var n1=e=>Ys(e,rp),rn=jt(uu(),1),iu={SHA2_256:18,LENGTH:32,DAG_PB:112},i1=40;function is(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=rn.default.decode(e);return t.seek(rn.default.decode.bytes),r}function o1(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 s1(e){rn.default.decode(e);let t=rn.default.decode.bytes,r=rn.default.decode(e.subarray(rn.default.decode.bytes)),n=rn.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}},a1={toTyped:Ni.CarV1HeaderOrV2Pragma,toRepresentation:$i.CarV1HeaderOrV2Pragma},Yx=Xs(),Qx=jt(uu(),1),Zx=[new Z(C.map,2),new Z(C.string,"version"),new Z(C.uint,1),new Z(C.string,"roots")],eN=new Z(C.tag,42);async function np(e,t){let r=is(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=n1(n);if(a1.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=o1(await e.exactly(i1,!0));e.seek(s.dataOffset-e.pos);let o=await np(e,1);return Object.assign(o,s)}async function u1(e){let t=await e.exactly(2,!1);if(t[0]===iu.SHA2_256&&t[1]===iu.LENGTH){let o=await e.exactly(34,!0),a=ni(o);return Rt.create(0,iu.DAG_PB,a)}let r=is(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=is(await e.upTo(8),e),i=await e.exactly(s1(await e.upTo(8)),!0),s=ni(i);return Rt.create(r,n,s)}async function ip(e){let t=e.pos,r=is(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await u1(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function c1(e){let{cid:t,blockLength:r}=await ip(e);return{bytes:await e.exactly(r,!0),cid:t}}async function f1(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await ip(e),s={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(s.blockLength),s}function op(e){let t=(async()=>{let r=await np(e);if(r.version===2){let n=e.pos-r.dataOffset;e=d1(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await c1(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await f1(e)}}}function sp(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 l1(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 ap(e){let t=e[Symbol.asyncIterator]();async function r(){let n=await t.next();return n.done?null:n.value}return l1(r)}function d1(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 p1=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 ep(sp(e))}static async fromIterable(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return ep(ap(e))}};async function ep(e){let t=op(e),{version:r,roots:n}=await t.header();return new p1(r,n,t.blocksIndex())}var up=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}},tN=class su extends up{[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 cp(t);return new su(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await fp(t);return new su(r,n,i)}},rN=class au extends up{[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 cp(t);return new au(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await fp(t);return new au(r,n,i)}};async function cp(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return lp(sp(e))}async function fp(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return lp(ap(e))}async function lp(e){let t=op(e),{version:r,roots:n}=await t.header();return{version:r,roots:n,iterator:t.blocks()}}var nN=jt(uu(),1);var iN=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:y1,LOG:oN,DEBUG:ou,VERBOSE:h1,ERROR:tp}=Se.setup(Se.INFO);async function cu(e){let{roots:t,blocks:r}=await dp(e);if(!t||!r)throw tp("decodeCar is funky",{roots:t,blocks:r});t.length!==1&&y1("Unexpected roots count:",t);let n=r.get(t[0]),i;ou("root:",n,{blocks:r}),n.info?(i=r.get(n.applogs.toString()).logs,ou("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 tp("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 Rt&&(f.pv=f.pv.toV1().toString()),{...f,cid:a}}),ou("Decoded car logs:",n,{roots:t,blocks:r,applogs:s}),{applogs:s}}async function dp(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 fu(e){return async function*(){for(;;){let{done:t,value:r}=await e.read();if(h1("[car] chunk",{done:t,value:r}),t)break;yield r}}()}var{WARN:os,LOG:LN,DEBUG:Er,VERBOSE:m1,ERROR:Mn}=ls.setup(ls.DEBUG),g1=["https://ipfs.1zm.in/ipfs/CID/?format=car&dag-scope=all","https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=all","https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=all","https://ipfs.1zm.in/ipfs/CID/?format=car&dag-scope=all"];async function FN(e,{readOnly:t=!0,pinnedCID:r}={}){let{cid:n,errors:i,isIpns:s}=na(e);if(!n)throw Mn("Failed to parse pubID",e,i);Er("[retrieveThread] parsedPubID",n);let o;if(!s)Er("[retrieveThread] pubID is not IPNS - using as CID"),o=n;else if(r)Er("[retrieveThread] using pinnedCID"),o=xt.parse(r);else{if(!e)throw Mn("[retrieveThread] neither pubID nor pinnedCID provided");try{o=await b1(e),Er("Resolved pub to CID",o.toString())}catch(k){throw Mn(`Failed to resolve IPNS ${e}:`,k)}}let a=await w1(o),{applogs:f}=await cu(a),c=f.filter(k=>k instanceof Uint8Array);c.length&&os(`Found ${c.length} encrypted logs - skipping`);let y=f.filter(k=>!(k instanceof Uint8Array));Xr(y);let g=ns.fromArray(y,`preview${e&&e!==o.toString()?"-"+e:""}@${o.toString()}`,t);return{cid:o,thread:g,encryptedCount:c.length}}async function b1(e){let r=await(await fetch(`https://name.web3.storage/name/${e}`)).json();return r.value.startsWith("/ipfs/")||os("IPNS value is not '/ipfs/..':",r),xt.parse(r.value.replace("/ipfs/",""))}async function v1(e,t){let r=e.replaceAll("CID",t.toString());m1("fetching car",r);let n;try{n=await fetch(r),Er("fetched car",{url:r,response:n})}catch(i){Mn("fetching car",i)}return n}async function _1(e,t){let r;return(!e?.ok||!e?.body)&&(r=Mn(`[retrieveCar] unexpected response ${e?.statusText}`,{url:t}),os("Gateway failed:",t,r)),r=fu(e.body.getReader()),r}async function w1(e){Er("Retrieving:",e);let t=new Map,r,n=0,i=!1,s=()=>new Promise(async(a,f)=>{n++,await Promise.all(g1.map(async c=>{n>1&&(c+=`&bust=${performance.now()}`);let y=await _1(await v1(c,e),c);Er({result:y,gateway:c}),t.set(c,y),y instanceof Error||(i=!0,a(y))})),i?Er("[retrieveCar] success nonErrorResults",t.values()):n<3?s().then(a).catch(f):f(new Error("no valid results after 3 attempts"))}),o=await s();return(await T1(o,r)).car}async function T1(e,t){let r=cr(fr(e)),n=await r.header(),i=[],s=!1;try{for await(let o of r.blocks())i.push(o);s=!0}catch(o){if(Mn("Failed to read car:",o,{blocks:i,header:n}),i.length===0)throw o;os(`Returning half-baked car with ${i.length} blocks from:`,t)}return{complete:s,car:new Rr(n,i)}}export{FN as a,b1 as b,w1 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-JGH54UQF.min.js.map