@lunora/studio 1.0.0-alpha.204 → 1.0.0-alpha.205
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/{chunk-LYUT26CU.js → chunk-32XMAP7I.js} +1 -1
- package/dist/standalone/{chunk-UMWV4KF6.js → chunk-3NIVSCFL.js} +1 -1
- package/dist/standalone/{chunk-DOXF7DE6.js → chunk-53OOTSKU.js} +1 -1
- package/dist/standalone/{chunk-QS4D6XLC.js → chunk-5B55YRG6.js} +1 -1
- package/dist/standalone/{chunk-J7IEFGXR.js → chunk-5KBRKADE.js} +1 -1
- package/dist/standalone/{chunk-WB4AXOSQ.js → chunk-6O2UDVPI.js} +1 -1
- package/dist/standalone/{chunk-OY4KVXP7.js → chunk-6YJQIQGV.js} +1 -1
- package/dist/standalone/{chunk-XLET3OAZ.js → chunk-7C3VUKZ7.js} +1 -1
- package/dist/standalone/{chunk-XAHTLY3F.js → chunk-AYFSPLV2.js} +1 -1
- package/dist/standalone/{chunk-4KFFVMPQ.js → chunk-CT47Z2YM.js} +1 -1
- package/dist/standalone/{chunk-FOEV4FF3.js → chunk-CZGON7K2.js} +1 -1
- package/dist/standalone/{chunk-PFXUGPNH.js → chunk-DPBD7JKS.js} +1 -1
- package/dist/standalone/{chunk-SZVPCCV6.js → chunk-EA3X3RJE.js} +1 -1
- package/dist/standalone/{chunk-TVNTJCPI.js → chunk-FOZMWMLT.js} +1 -1
- package/dist/standalone/{chunk-BHWDWP7B.js → chunk-G77XMUYK.js} +1 -1
- package/dist/standalone/{chunk-KDUFXFIS.js → chunk-GCYJWGJH.js} +1 -1
- package/dist/standalone/{chunk-K7VS57EG.js → chunk-GS7NVFTP.js} +1 -1
- package/dist/standalone/{chunk-EGX5ONGC.js → chunk-H7T4ZK5A.js} +1 -1
- package/dist/standalone/{chunk-VIVQ3R43.js → chunk-HEWWKHPV.js} +1 -1
- package/dist/standalone/{chunk-O75MJPZ4.js → chunk-I5IZ7E6Y.js} +1 -1
- package/dist/standalone/{chunk-XH2OX7VX.js → chunk-IU4JVIC7.js} +1 -1
- package/dist/standalone/{chunk-N5CS5CRO.js → chunk-IV2NWWZ3.js} +1 -1
- package/dist/standalone/{chunk-MSSABU7C.js → chunk-JKIYK6ND.js} +1 -1
- package/dist/standalone/{chunk-U7E7R54K.js → chunk-K7ARKCTO.js} +1 -1
- package/dist/standalone/{chunk-B2VKTPMI.js → chunk-KL5R5JRZ.js} +1 -1
- package/dist/standalone/{chunk-CPTHEHNQ.js → chunk-KUCY77QV.js} +1 -1
- package/dist/standalone/{chunk-HSK4F6PG.js → chunk-L4GQYZ6E.js} +1 -1
- package/dist/standalone/{chunk-MJ5PXU7A.js → chunk-LW2ZUTWX.js} +1 -1
- package/dist/standalone/{chunk-O65LYB3X.js → chunk-ML2UMMWX.js} +1 -1
- package/dist/standalone/{chunk-4UDPAZPF.js → chunk-MZBW37SY.js} +1 -1
- package/dist/standalone/{chunk-QCS6P56O.js → chunk-NSGBWASN.js} +1 -1
- package/dist/standalone/{chunk-JDSSDFKZ.js → chunk-O27Z36G7.js} +1 -1
- package/dist/standalone/{chunk-N3UTJ3TW.js → chunk-OANQPBNV.js} +1 -1
- package/dist/standalone/{chunk-Y2AE7KIW.js → chunk-OMZJYYAT.js} +1 -1
- package/dist/standalone/{chunk-SRADQOGW.js → chunk-OO2KRQEG.js} +1 -1
- package/dist/standalone/{chunk-DIWBQ2XD.js → chunk-PEJIXS5G.js} +1 -1
- package/dist/standalone/{chunk-DEKFZBSL.js → chunk-PT6TSEYC.js} +1 -1
- package/dist/standalone/{chunk-KUXVGGQC.js → chunk-Q6J3PM4A.js} +1 -1
- package/dist/standalone/{chunk-LPPIQF3R.js → chunk-QICQ6TB3.js} +1 -1
- package/dist/standalone/{chunk-3G4ORIT3.js → chunk-QM4WYRZH.js} +1 -1
- package/dist/standalone/{chunk-ZT26IRWF.js → chunk-R3JE5NNR.js} +1 -1
- package/dist/standalone/{chunk-QNKCIXGS.js → chunk-RXP62JZU.js} +1 -1
- package/dist/standalone/{chunk-MR4WWDAU.js → chunk-SLNQW3RK.js} +1 -1
- package/dist/standalone/{chunk-OJA4I2OM.js → chunk-SUMY65GX.js} +1 -1
- package/dist/standalone/{chunk-46TTNPNB.js → chunk-TYTIWKSD.js} +1 -1
- package/dist/standalone/{chunk-TVTGUDIC.js → chunk-U4RHXW7W.js} +1 -1
- package/dist/standalone/{chunk-RQASBKDR.js → chunk-UDQRNJXZ.js} +1 -1
- package/dist/standalone/{chunk-BE3SUNHW.js → chunk-UEOWRXJ3.js} +2 -2
- package/dist/standalone/{chunk-JBXSVNJG.js → chunk-ULUHG4S6.js} +1 -1
- package/dist/standalone/{chunk-N6EGTWG5.js → chunk-VDRFSHZO.js} +1 -1
- package/dist/standalone/{chunk-6YGTF3NC.js → chunk-WGYFNRML.js} +1 -1
- package/dist/standalone/{chunk-XY5F4HVP.js → chunk-WUSVHWBV.js} +1 -1
- package/dist/standalone/{chunk-75W7QKMR.js → chunk-XDBCKWUS.js} +1 -1
- package/dist/standalone/{chunk-QXX2L4RQ.js → chunk-XEG7ZWQT.js} +1 -1
- package/dist/standalone/{chunk-XPYW3W23.js → chunk-YGRTZZRP.js} +1 -1
- package/dist/standalone/{chunk-7B5TB2IL.js → chunk-YL2TW4TP.js} +1 -1
- package/dist/standalone/{chunk-G7VH4YG3.js → chunk-YQDXU4GE.js} +1 -1
- package/dist/standalone/{chunk-TWXQVMWB.js → chunk-YSQHT7BJ.js} +1 -1
- package/dist/standalone/{chunk-GGNCX2F4.js → chunk-ZIGHJFAC.js} +2 -2
- package/dist/standalone/{chunk-FQDM7IHC.js → chunk-ZJ6QIZWP.js} +1 -1
- package/dist/standalone/{chunk-T6IRWINU.js → chunk-ZOZPS7AC.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +6 -6
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as tt}from"./chunk-K7AJEMKE.js";import{e as Be}from"./chunk-6D6Z2KXU.js";import{a as We}from"./chunk-55754F6H.js";import{b as Ve}from"./chunk-FEWMAPNI.js";import{a as z}from"./chunk-4ZEL6BYL.js";import{c as _e}from"./chunk-
|
|
1
|
+
import{a as tt}from"./chunk-K7AJEMKE.js";import{e as Be}from"./chunk-6D6Z2KXU.js";import{a as We}from"./chunk-55754F6H.js";import{b as Ve}from"./chunk-FEWMAPNI.js";import{a as z}from"./chunk-4ZEL6BYL.js";import{c as _e}from"./chunk-6YJQIQGV.js";import{f as Pe}from"./chunk-ZJ6QIZWP.js";import{a as Ye}from"./chunk-FKVZRPV5.js";import{a as T,e as Fe}from"./chunk-WUWBZPUK.js";import{d as $,f as Ge,g as Ze,l as Qe,o as Ne,p as Xe,q as et}from"./chunk-FODLDLE2.js";import{a as m,d as De,e as lt,f as it,g as ct,i as Ee}from"./chunk-YKXDMIHQ.js";var _=De(it(),1);var I=De(lt(),1);var n=De(ct(),1);var dt=Ge(z.studioFeatures),ot={analytics:!0,auth:!0,containers:!0,flags:!0,kv:!0,mail:!0,notifications:!0,payments:!0,queues:!0,scheduler:!0,storage:!0,vectors:!0,workflows:!0},mt=m(t=>{if(t===null||typeof t!="object")return ot;let e=t,s=m(a=>typeof e[a]=="boolean"?e[a]:!0,"n");return{analytics:s("analytics"),auth:s("auth"),containers:s("containers"),flags:s("flags"),kv:s("kv"),mail:s("mail"),notifications:s("notifications"),payments:s("payments"),queues:s("queues"),scheduler:s("scheduler"),storage:s("storage"),vectors:s("vectors"),workflows:s("workflows")}},"dt"),ut=m(()=>{let t=(0,_.c)(3),e=Pe(),[s,a]=(0,I.useState)(ot),r,o;return t[0]!==e?(r=m(()=>{Ne((async()=>{try{a(mt(await e.query(dt,{},Ze(""))))}catch{}})())},"a"),o=[e],t[0]=e,t[1]=r,t[2]=o):(r=t[1],o=t[2]),(0,I.useEffect)(r,o),s},"ut"),pt=m(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[0]=e):e=t[0],e},"mt"),ft=m(t=>{let e=(0,_.c)(24),{group:s}=t,a=$(),r=Be(),o;e[0]!==s.tab||e[1]!==r?(o=m(()=>{Ne(r({to:`/${s.tab}`}))},"o"),e[0]=s.tab,e[1]=r,e[2]=o):o=e[2];let l=o,i=s.bindings.length,c;e[3]!==s.label?(c=(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:s.label}),e[3]=s.label,e[4]=c):c=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)(pt,{}),e[5]=p):p=e[5];let d;e[6]!==c?(d=(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[c,p]}),e[6]=c,e[7]=d):d=e[7];let f;e[8]!==i||e[9]!==a?(f=i===1?a("1 binding"):a("{count} bindings",{count:i}),e[8]=i,e[9]=a,e[10]=f):f=e[10];let u;e[11]!==f?(u=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:f}),e[11]=f,e[12]=u):u=e[12];let h;e[13]!==i||e[14]!==s.bindings?(h=i>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.bindings.map(xt)}),e[13]=i,e[14]=s.bindings,e[15]=h):h=e[15];let g;e[16]!==d||e[17]!==u||e[18]!==h?(g=(0,n.jsxs)(Fe,{className:"flex flex-col gap-2 py-4",children:[d,u,h]}),e[16]=d,e[17]=u,e[18]=h,e[19]=g):g=e[19];let x;return e[20]!==s.testId||e[21]!==l||e[22]!==g?(x=(0,n.jsx)(T,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":s.testId,onClick:l,children:g}),e[20]=s.testId,e[21]=l,e[22]=g,e[23]=x):x=e[23],x},"ft"),at=["kv","files","vectors"],ht=m((t,e)=>[...t.filter(s=>s.tab!==e.tab),e].toSorted((s,a)=>at.indexOf(s.tab)-at.indexOf(a.tab)),"pt"),gt=m(()=>{let t=(0,_.c)(19),e=Pe(),s=ut(),a=$(),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=[],t[0]=r):r=t[0];let[o,l]=(0,I.useState)(r),i,c;if(t[1]!==e||t[2]!==s.kv||t[3]!==s.storage||t[4]!==s.vectors||t[5]!==a?(i=m(()=>{let g={cancelled:!1},x=[{enabled:s.kv,label:a("KV Namespaces"),load:m(async()=>(await e.listKvNamespaces()).map(bt),"load"),tab:"kv",testId:"home-binding-kv"},{enabled:s.storage,label:a("R2 Buckets"),load:m(()=>e.listStorageBuckets(),"load"),tab:"files",testId:"home-binding-r2"},{enabled:s.vectors,label:a("Vectorize Indexes"),load:m(async()=>(await e.listVectorIndexes()).map(yt),"load"),tab:"vectors",testId:"home-binding-vectors"}];for(let b of x)b.enabled&&Ne((async()=>{try{let v=await b.load();if(!g.cancelled){let S={bindings:v,label:b.label,tab:b.tab,testId:b.testId};l(M=>ht(M,S))}}catch{}})());return()=>{g.cancelled=!0}},"i"),c=[e,s.kv,s.storage,s.vectors,a],t[1]=e,t[2]=s.kv,t[3]=s.storage,t[4]=s.vectors,t[5]=a,t[6]=i,t[7]=c):(i=t[6],c=t[7]),(0,I.useEffect)(i,c),o.length===0)return null;let p;t[8]!==a?(p=a("Bindings"),t[8]=a,t[9]=p):p=t[9];let d;t[10]!==p?(d=(0,n.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:p}),t[10]=p,t[11]=d):d=t[11];let f;t[12]!==o?(f=o.map(vt),t[12]=o,t[13]=f):f=t[13];let u;t[14]!==f?(u=(0,n.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:f}),t[14]=f,t[15]=u):u=t[15];let h;return t[16]!==d||t[17]!==u?(h=(0,n.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[d,u]}),t[16]=d,t[17]=u,t[18]=h):h=t[18],h},"ht");function xt(t){return(0,n.jsx)(Ve,{variant:"secondary",children:t},t)}m(xt,"gt");function bt(t){return t.binding}m(bt,"xt");function yt(t){return t.name}m(yt,"bt");function vt(t){return(0,n.jsx)(ft,{group:t},t.tab)}m(vt,"yt");var Nt=[{name:"lunora_list_functions",summary:"list every query, mutation, and action with its path"},{name:"lunora_list_tables",summary:"list the schema's tables"},{name:"lunora_get_function_schema",summary:"read a function's argument JSON Schema before calling it"},{name:"lunora_run_query",summary:"run a read-only query"},{name:"lunora_run_mutation",summary:"run a mutation \u2014 writes; only when LUNORA_MCP_ALLOW_WRITES is set"},{name:"lunora_run_action",summary:"run an action \u2014 writes/effects; only when LUNORA_MCP_ALLOW_WRITES is set"}],_t=m(t=>JSON.stringify({mcpServers:{lunora:{args:["-y","@lunora/mcp"],command:"npx",env:{LUNORA_ADMIN_TOKEN:"<your-admin-token>",LUNORA_URL:t}}}},null,2),"Nt"),St=m(t=>{let e=Nt.map(s=>`- ${s.name} \u2014 ${s.summary}`).join(`
|
|
2
2
|
`);return[`You have a Lunora MCP server connected to the deployment at ${t}.`,"It exposes this backend's functions and schema so you can inspect and operate it:",e,"",`Start by calling lunora_list_functions and lunora_list_tables to learn what exists, then lunora_get_function_schema before any run call. The full HTTP API is also documented at ${t}/_lunora/admin/openapi (that endpoint needs the same admin token the MCP server is configured with).`].join(`
|
|
3
|
-
`)},"_t"),kt=1500,wt=m(()=>{let t=(0,_.c)(35),e=$(),s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=Xe(),t[0]=s):s=t[0];let a=s,[r,o]=(0,I.useState)(null),l,i;t[1]!==r?(l=m(()=>{if(r===null)return;let A=globalThis.setTimeout(()=>{o(null)},kt);return()=>{globalThis.clearTimeout(A)}},"r"),i=[r],t[1]=r,t[2]=l,t[3]=i):(l=t[2],i=t[3]),(0,I.useEffect)(l,i);let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=m((A,j)=>{et(j)&&o(A)},"c"),t[4]=c):c=t[4];let p=c,d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=m(()=>{p("config",_t(a))},"d"),t[5]=d):d=t[5];let f=d,u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m(()=>{p("prompt",St(a))},"u"),t[6]=u):u=t[6];let h=u,g;t[7]!==e?(g=e("Connect an AI agent"),t[7]=e,t[8]=g):g=t[8];let x;t[9]!==g?(x=(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:g}),t[9]=g,t[10]=x):x=t[10];let b;t[11]!==e?(b=e("Drive this deployment from an AI agent over the Model Context Protocol \u2014 it can list functions and tables, read schemas, and run read-only queries. Writes stay off unless you opt in."),t[11]=e,t[12]=b):b=t[12];let v;t[13]!==b?(v=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:b}),t[13]=b,t[14]=v):v=t[14];let S;t[15]!==x||t[16]!==v?(S=(0,n.jsxs)("div",{className:"flex flex-col gap-1.5 p-4",children:[x,v]}),t[15]=x,t[16]=v,t[17]=S):S=t[17];let M;t[18]===Symbol.for("react.memo_cache_sentinel")?(M=(0,n.jsx)("code",{className:"font-mono text-xs text-muted-foreground","data-testid":"home-connect-agent-command",children:"npx -y @lunora/mcp"}),t[18]=M):M=t[18];let k;t[19]!==r||t[20]!==e?(k=e(r==="config"?"Copied":"Copy MCP config"),t[19]=r,t[20]=e,t[21]=k):k=t[21];let y;t[22]!==k?(y=(0,n.jsx)(We,{"data-testid":"home-connect-agent-copy-config",onClick:f,size:"xs",variant:"outline",children:k}),t[22]=k,t[23]=y):y=t[23];let w;t[24]!==r||t[25]!==e?(w=e(r==="prompt"?"Copied":"Copy agent prompt"),t[24]=r,t[25]=e,t[26]=w):w=t[26];let L;t[27]!==w?(L=(0,n.jsx)(We,{"data-testid":"home-connect-agent-copy-prompt",onClick:h,size:"xs",variant:"outline",children:w}),t[27]=w,t[28]=L):L=t[28];let C;t[29]!==y||t[30]!==L?(C=(0,n.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border bg-muted/50 px-4 py-3",children:[M,(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[y,L]})]}),t[29]=y,t[30]=L,t[31]=C):C=t[31];let N;return t[32]!==S||t[33]!==C?(N=(0,n.jsxs)(T,{className:"gap-0 py-0","data-testid":"home-connect-agent",children:[S,C]}),t[32]=S,t[33]=C,t[34]=N):N=t[34],N},"kt"),Lt=(0,I.lazy)(()=>import("./chunk-LYUT26CU.js")),Ct=m((t,e)=>{if(e==null)return t("cache not enabled");let s=e.hits+e.misses;return s===0?t("no cache traffic yet"):`${Math.round(e.hits/s*100).toString()}% ${t("cache hit")}`},"wt"),He=m(t=>{if(t<1e3)return`${String(Math.round(t))}ms`;let e=t>=1e4?0:1;return`${(t/1e3).toFixed(e)}s`},"De"),It=m((t,e)=>{let s=Math.max(0,Math.round((e-t)/1e3));if(s<60)return`${String(s)}s ago`;let a=Math.round(s/60);if(a<60)return`${String(a)}m ago`;let r=Math.round(a/60);return r<24?`${String(r)}h ago`:`${String(Math.round(r/24))}d ago`},"$t"),nt=m((t,e)=>{if(t===void 0||t.length===0)return[];let s=new Map;for(let a of t)s.set(a.bucketMs,(s.get(a.bucketMs)??0)+a[e]);return[...s.entries()].toSorted(([a],[r])=>a-r).map(([,a])=>a)},"Ve"),st=m((t,e=!0)=>{if(t.length<4)return null;let s=Math.floor(t.length/2),a=t.slice(0,s).reduce((l,i)=>l+i,0),r=t.slice(s).reduce((l,i)=>l+i,0);if(a===0)return null;let o=(r-a)/a*100;return{positive:e?o>=0:o<=0,text:`${o>=0?"+":""}${o.toFixed(1)}%`}},"We"),Te=m(t=>{let e=(0,_.c)(24),{delta:s,footer:a,label:r,trend:o,unit:l,value:i}=t,c=$(),p;e[0]!==r?(p=(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[0]=r,e[1]=p):p=e[1];let d;e[2]!==i?(d=(0,n.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:i}),e[2]=i,e[3]=d):d=e[3];let f;e[4]!==l?(f=l!==void 0&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=f):f=e[5];let u;e[6]!==d||e[7]!==f?(u=(0,n.jsxs)("span",{className:"flex items-baseline gap-1.5",children:[d,f]}),e[6]=d,e[7]=f,e[8]=u):u=e[8];let h;e[9]!==o?(h=o!==void 0&&(0,n.jsx)(I.Suspense,{fallback:(0,n.jsx)("div",{"aria-hidden":"true",className:"h-8 w-28"}),children:(0,n.jsx)(Lt,{data:o})}),e[9]=o,e[10]=h):h=e[10];let g;e[11]!==u||e[12]!==h?(g=(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[u,h]}),e[11]=u,e[12]=h,e[13]=g):g=e[13];let x;e[14]!==p||e[15]!==g?(x=(0,n.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[p,g]}),e[14]=p,e[15]=g,e[16]=x):x=e[16];let b;e[17]!==s||e[18]!==a||e[19]!==c?(b=s==null?a!=null&&(0,n.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:a}):(0,n.jsxs)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px]",children:[(0,n.jsx)("span",{className:Ee("font-semibold",s.positive?"text-success":"text-destructive"),children:s.text})," ",(0,n.jsx)("span",{className:"text-muted-foreground",children:c("vs. prev.")})]}),e[17]=s,e[18]=a,e[19]=c,e[20]=b):b=e[20];let v;return e[21]!==x||e[22]!==b?(v=(0,n.jsxs)(T,{className:"justify-between gap-0 py-0",children:[x,b]}),e[21]=x,e[22]=b,e[23]=v):v=e[23],v},"Te"),Mt=m(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"m9 6 6 6-6 6"})}),t[0]=e):e=t[0],e},"At"),Ue=m(t=>{let e=(0,_.c)(7),{command:s,label:a}=t,r;e[0]!==a?(r=(0,n.jsx)("div",{className:"p-4",children:(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:a})}),e[0]=a,e[1]=r):r=e[1];let o;e[2]!==s?(o=(0,n.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5",children:(0,n.jsx)("code",{className:"font-mono text-xs text-muted-foreground",children:s})}),e[2]=s,e[3]=o):o=e[3];let l;return e[4]!==r||e[5]!==o?(l=(0,n.jsxs)(T,{className:"justify-between gap-0 py-0",children:[r,o]}),e[4]=r,e[5]=o,e[6]=l):l=e[6],l},"Be"),rt=m(t=>{let e=(0,_.c)(18),{count:s,onView:a,testId:r,title:o}=t,l=$(),i;e[0]!==o?(i=(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:o}),e[0]=o,e[1]=i):i=e[1];let c;e[2]!==s||e[3]!==l?(c=s===null?(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:l("No data yet")}):(0,n.jsx)(Ve,{variant:s>0?"destructive":"success",children:s>0?s:l("All clear")}),e[2]=s,e[3]=l,e[4]=c):c=e[4];let p;e[5]!==i||e[6]!==c?(p=(0,n.jsxs)("div",{className:"flex items-start justify-between gap-2 p-4",children:[i,c]}),e[5]=i,e[6]=c,e[7]=p):p=e[7];let d;e[8]!==l?(d=l("View"),e[8]=l,e[9]=d):d=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)(Mt,{}),e[10]=f):f=e[10];let u;e[11]!==a||e[12]!==d?(u=(0,n.jsxs)("button",{className:"flex items-center gap-1 border-t border-border bg-muted/50 px-4 py-2.5 text-[12px] font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:bg-muted",onClick:a,type:"button",children:[d,f]}),e[11]=a,e[12]=d,e[13]=u):u=e[13];let h;return e[14]!==p||e[15]!==u||e[16]!==r?(h=(0,n.jsxs)(T,{className:"justify-between gap-0 py-0","data-testid":r,children:[p,u]}),e[14]=p,e[15]=u,e[16]=r,e[17]=h):h=e[17],h},"Qe"),At=m(t=>{let e=(0,_.c)(7),{functions:s}=t,a=$(),r;if(e[0]!==s||e[1]!==a){let o=[...s].toSorted(Ot).slice(0,5),l;e[3]!==a?(l=a("Top functions"),e[3]=a,e[4]=l):l=e[4];let i;e[5]!==l?(i=(0,n.jsx)("div",{className:"border-b border-border px-4 py-3",children:(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l})}),e[5]=l,e[6]=i):i=e[6],r=(0,n.jsxs)(T,{className:"gap-0 py-0","data-testid":"home-top-functions",children:[i,o.length===0?(0,n.jsx)("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:a("No functions called yet.")}):(0,n.jsxs)("div",{className:"divide-y divide-border",children:[(0,n.jsxs)("div",{className:"grid grid-cols-[1fr_auto_auto_auto] gap-4 px-4 py-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:[(0,n.jsx)("span",{children:a("Function")}),(0,n.jsx)("span",{className:"text-end",children:a("Calls")}),(0,n.jsx)("span",{className:"w-12 text-end",children:a("Avg")}),(0,n.jsx)("span",{className:"w-8 text-end",children:a("Err")})]}),o.map(Rt)]})]}),e[0]=s,e[1]=a,e[2]=r}else r=e[2];return r},"Lt"),$t=m(t=>{let e=(0,_.c)(26),{subs:s}=t,a=$(),r;e[0]!==a?(r=a("Live connections"),e[0]=a,e[1]=r):r=e[1];let o;e[2]!==r?(o=(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[2]=r,e[3]=o):o=e[3];let l=s?.totalConnections??0,i;e[4]!==l?(i=l.toLocaleString(),e[4]=l,e[5]=i):i=e[5];let c;e[6]!==i?(c=(0,n.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:i}),e[6]=i,e[7]=c):c=e[7];let p;e[8]!==a?(p=a("sockets"),e[8]=a,e[9]=p):p=e[9];let d;e[10]!==p?(d=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:p}),e[10]=p,e[11]=d):d=e[11];let f;e[12]!==c||e[13]!==d?(f=(0,n.jsxs)("span",{className:"flex items-baseline gap-1.5",children:[c,d]}),e[12]=c,e[13]=d,e[14]=f):f=e[14];let u=s?.totalSubscriptions??0,h;e[15]!==u?(h=u.toLocaleString(),e[15]=u,e[16]=h):h=e[16];let g;e[17]!==a?(g=a("active subscriptions"),e[17]=a,e[18]=g):g=e[18];let x;e[19]!==h||e[20]!==g?(x=(0,n.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[h," ",g]}),e[19]=h,e[20]=g,e[21]=x):x=e[21];let b;return e[22]!==x||e[23]!==o||e[24]!==f?(b=(0,n.jsx)(T,{"data-testid":"home-live-connections",children:(0,n.jsxs)(Fe,{className:"flex flex-col gap-2.5 py-4",children:[o,f,x]})}),e[22]=x,e[23]=o,e[24]=f,e[25]=b):b=e[25],b},"Mt"),jt=m(t=>{let e=(0,_.c)(7),{entries:s}=t,a=$(),r;if(e[0]!==s||e[1]!==a){let o=Date.now(),l;e[3]!==a?(l=a("Recent activity"),e[3]=a,e[4]=l):l=e[4];let i;e[5]!==l?(i=(0,n.jsx)("div",{className:"border-b border-border px-4 py-3",children:(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l})}),e[5]=l,e[6]=i):i=e[6],r=(0,n.jsxs)(T,{className:"gap-0 py-0","data-testid":"home-recent-activity",children:[i,s.length===0?(0,n.jsx)("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:a("No recent activity.")}):(0,n.jsx)("ul",{className:"divide-y divide-border",children:s.slice(0,5).map(c=>(0,n.jsxs)("li",{className:"flex items-center justify-between gap-3 px-4 py-2 text-[13px]",children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-muted-foreground/40"}),(0,n.jsxs)("span",{className:"truncate text-foreground",children:[c.op,c.table!==void 0&&(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",c.table,c.id===void 0?"":`#${c.id}`]})]})]}),(0,n.jsx)("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:It(c.ts,o)})]},c.seq))})]}),e[0]=s,e[1]=a,e[2]=r}else r=e[2];return r},"It"),Tt=m(t=>{let e=t.reduce((s,a)=>s+a.calls,0);return e===0?null:t.reduce((s,a)=>s+a.totalDurationMs,0)/e},"Tt"),Yt=m(t=>{let e=(0,_.c)(149),{initialShardKey:s}=t,a=$(),r=Be(),o=s??"",l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={},e[0]=l):l=e[0];let i;e[1]!==o?(i={shardKey:o},e[1]=o,e[2]=i):i=e[2];let c=_e(z.getMetrics,l,i),p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={},e[3]=p):p=e[3];let d;e[4]!==o?(d={shardKey:o},e[4]=o,e[5]=d):d=e[5];let f=_e(z.getFunctionStats,p,d),u,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={},h={shardKey:""},e[6]=u,e[7]=h):(u=e[6],h=e[7]);let g=_e(z.getSecurityAudit,u,h),x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={},e[8]=x):x=e[8];let b;e[9]!==o?(b={shardKey:o},e[9]=o,e[10]=b):b=e[10];let v=_e(z.listSubscriptions,x,b),S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={},e[11]=S):S=e[11];let M;e[12]!==o?(M={shardKey:o},e[12]=o,e[13]=M):M=e[13];let k=_e(z.getAuditLog,S,M),y=c.data??null,w,L,C,N,A,j,D,O,R,P,B,E,q,K,V,W,F,U;if(e[14]!==k.data||e[15]!==g.data||e[16]!==y||e[17]!==c.data||e[18]!==r||e[19]!==f.data||e[20]!==v.data||e[21]!==a){N=Array.isArray(f.data?.functions)?f.data.functions:[],D=v.data??null;let Le;e[40]!==k.data?(Le=Array.isArray(k.data?.entries)?k.data.entries:[],e[40]=k.data,e[41]=Le):Le=e[41],L=Le,A=c.data===void 0||f.data===void 0?null:tt(y,N).length,j=Array.isArray(g.data?.findings)?g.data.findings.length:null;let Ce;e[42]!==r?(Ce=m(()=>{Ne(r({to:"/security"}))},"we"),e[42]=r,e[43]=Ce):Ce=e[43],U=Ce;let Ie;e[44]!==r?(Ie=m(()=>{Ne(r({to:"/insights"}))},"$e"),e[44]=r,e[45]=Ie):Ie=e[45],F=Ie;let Me=nt(y?.history,"calls"),Ae=nt(y?.history,"errors"),Je=Tt(N),$e=Math.max(0,...N.map(qt)),je;e[46]!==y||e[47]!==a?(je=y===null?void 0:Ct(a,y.cache),e[46]=y,e[47]=a,e[48]=je):je=e[48],C=je,V="flex flex-col gap-6",W="lunora-home",B="grid gap-3 sm:grid-cols-2 xl:grid-cols-4",E="home-health";let Re=st(Me),xe;e[49]!==a?(xe=a("Requests"),e[49]=a,e[50]=xe):xe=e[50];let qe=y?.requests??0,be;e[51]!==qe?(be=qe.toLocaleString(),e[51]=qe,e[52]=be):be=e[52],e[53]!==Me||e[54]!==Re||e[55]!==xe||e[56]!==be?(q=(0,n.jsx)(Te,{delta:Re,label:xe,trend:Me,value:be}),e[53]=Me,e[54]=Re,e[55]=xe,e[56]=be,e[57]=q):q=e[57];let Ke=st(Ae,!1),ye;e[58]!==a?(ye=a("Errors"),e[58]=a,e[59]=ye):ye=e[59];let ze=y?.errors??0,ve;e[60]!==ze?(ve=ze.toLocaleString(),e[60]=ze,e[61]=ve):ve=e[61],e[62]!==Ae||e[63]!==Ke||e[64]!==ye||e[65]!==ve?(K=(0,n.jsx)(Te,{delta:Ke,label:ye,trend:Ae,value:ve}),e[62]=Ae,e[63]=Ke,e[64]=ye,e[65]=ve,e[66]=K):K=e[66],w=Te,e[67]!==$e||e[68]!==a?(O=$e>0?`${a("max")} ${He($e)}`:void 0,e[67]=$e,e[68]=a,e[69]=O):O=e[69],e[70]!==a?(R=a("Avg latency"),e[70]=a,e[71]=R):R=e[71],P=Je===null?"\u2014":He(Je),e[14]=k.data,e[15]=g.data,e[16]=y,e[17]=c.data,e[18]=r,e[19]=f.data,e[20]=v.data,e[21]=a,e[22]=w,e[23]=L,e[24]=C,e[25]=N,e[26]=A,e[27]=j,e[28]=D,e[29]=O,e[30]=R,e[31]=P,e[32]=B,e[33]=E,e[34]=q,e[35]=K,e[36]=V,e[37]=W,e[38]=F,e[39]=U}else w=e[22],L=e[23],C=e[24],N=e[25],A=e[26],j=e[27],D=e[28],O=e[29],R=e[30],P=e[31],B=e[32],E=e[33],q=e[34],K=e[35],V=e[36],W=e[37],F=e[38],U=e[39];let H;e[72]!==w||e[73]!==O||e[74]!==R||e[75]!==P?(H=(0,n.jsx)(w,{footer:O,label:R,value:P}),e[72]=w,e[73]=O,e[74]=R,e[75]=P,e[76]=H):H=e[76];let J;e[77]!==a?(J=a("Database size"),e[77]=a,e[78]=J):J=e[78];let Oe=y?.databaseSize??null,Y;e[79]!==Oe?(Y=Qe(Oe),e[79]=Oe,e[80]=Y):Y=e[80];let G;e[81]!==C||e[82]!==J||e[83]!==Y?(G=(0,n.jsx)(Te,{footer:C,label:J,value:Y}),e[81]=C,e[82]=J,e[83]=Y,e[84]=G):G=e[84];let Z;e[85]!==B||e[86]!==E||e[87]!==q||e[88]!==K||e[89]!==H||e[90]!==G?(Z=(0,n.jsxs)("div",{className:B,"data-testid":E,children:[q,K,H,G]}),e[85]=B,e[86]=E,e[87]=q,e[88]=K,e[89]=H,e[90]=G,e[91]=Z):Z=e[91];let Se;e[92]===Symbol.for("react.memo_cache_sentinel")?(Se=(0,n.jsx)(gt,{}),e[92]=Se):Se=e[92];let Q;e[93]!==N?(Q=(0,n.jsx)("div",{className:"lg:col-span-2",children:(0,n.jsx)(At,{functions:N})}),e[93]=N,e[94]=Q):Q=e[94];let X;e[95]!==D?(X=(0,n.jsx)($t,{subs:D}),e[95]=D,e[96]=X):X=e[96];let ee;e[97]!==L?(ee=(0,n.jsx)(jt,{entries:L}),e[97]=L,e[98]=ee):ee=e[98];let te;e[99]!==X||e[100]!==ee?(te=(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[X,ee]}),e[99]=X,e[100]=ee,e[101]=te):te=e[101];let ae;e[102]!==Q||e[103]!==te?(ae=(0,n.jsxs)("div",{className:"grid gap-3 lg:grid-cols-3",children:[Q,te]}),e[102]=Q,e[103]=te,e[104]=ae):ae=e[104];let ne;e[105]!==a?(ne=a("Advisors"),e[105]=a,e[106]=ne):ne=e[106];let se;e[107]!==ne?(se=(0,n.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:ne}),e[107]=ne,e[108]=se):se=e[108];let re;e[109]!==A||e[110]!==j||e[111]!==a||e[112]!==F||e[113]!==U?(re=j===0&&A===0?(0,n.jsx)(Ye,{description:a("No security or performance issues detected."),icon:(0,n.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M12 3 4 6v5c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6l-8-3Z"}),(0,n.jsx)("path",{d:"m9 12 2 2 4-4"})]}),testId:"home-advisors-clear",title:a("No issues found")}):(0,n.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,n.jsx)(rt,{count:j,onView:U,testId:"home-security",title:a("Security findings")}),(0,n.jsx)(rt,{count:A,onView:F,testId:"home-performance",title:a("Performance issues")})]}),e[109]=A,e[110]=j,e[111]=a,e[112]=F,e[113]=U,e[114]=re):re=e[114];let oe;e[115]!==se||e[116]!==re?(oe=(0,n.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-advisors",children:[se,re]}),e[115]=se,e[116]=re,e[117]=oe):oe=e[117];let le;e[118]!==a?(le=a("Get connected"),e[118]=a,e[119]=le):le=e[119];let ie;e[120]!==le?(ie=(0,n.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:le}),e[120]=le,e[121]=ie):ie=e[121];let ce;e[122]!==a?(ce=a("Client SDK"),e[122]=a,e[123]=ce):ce=e[123];let de;e[124]!==ce?(de=(0,n.jsx)(Ue,{command:"npm i @lunora/client",label:ce}),e[124]=ce,e[125]=de):de=e[125];let me;e[126]!==a?(me=a("React"),e[126]=a,e[127]=me):me=e[127];let ue;e[128]!==me?(ue=(0,n.jsx)(Ue,{command:"npm i @lunora/react",label:me}),e[128]=me,e[129]=ue):ue=e[129];let pe;e[130]!==a?(pe=a("CLI"),e[130]=a,e[131]=pe):pe=e[131];let fe;e[132]!==pe?(fe=(0,n.jsx)(Ue,{command:"lunora dev",label:pe}),e[132]=pe,e[133]=fe):fe=e[133];let he;e[134]!==de||e[135]!==ue||e[136]!==fe?(he=(0,n.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[de,ue,fe]}),e[134]=de,e[135]=ue,e[136]=fe,e[137]=he):he=e[137];let ke;e[138]===Symbol.for("react.memo_cache_sentinel")?(ke=(0,n.jsx)(wt,{}),e[138]=ke):ke=e[138];let ge;e[139]!==ie||e[140]!==he?(ge=(0,n.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-get-connected",children:[ie,he,ke]}),e[139]=ie,e[140]=he,e[141]=ge):ge=e[141];let we;return e[142]!==V||e[143]!==W||e[144]!==Z||e[145]!==ae||e[146]!==oe||e[147]!==ge?(we=(0,n.jsxs)("div",{className:V,"data-testid":W,children:[Z,Se,ae,oe,ge]}),e[142]=V,e[143]=W,e[144]=Z,e[145]=ae,e[146]=oe,e[147]=ge,e[148]=we):we=e[148],we},"Yt");function Ot(t,e){return e.calls-t.calls}m(Ot,"Ot");function Rt(t){return(0,n.jsxs)("div",{className:"grid grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-4 py-2 text-[13px]",children:[(0,n.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:t.path}),(0,n.jsx)("span",{className:"text-end tabular-nums",children:t.calls.toLocaleString()}),(0,n.jsx)("span",{className:"w-12 text-end tabular-nums text-muted-foreground",children:He(t.calls>0?t.totalDurationMs/t.calls:0)}),(0,n.jsx)("span",{className:Ee("w-8 text-end tabular-nums",t.errors>0?"text-destructive":"text-muted-foreground"),children:t.errors})]},t.path)}m(Rt,"Rt");function qt(t){return t.maxDurationMs}m(qt,"Et");export{ut as a,Yt as b};
|
|
3
|
+
`)},"_t"),kt=1500,wt=m(()=>{let t=(0,_.c)(35),e=$(),s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=Xe(),t[0]=s):s=t[0];let a=s,[r,o]=(0,I.useState)(null),l,i;t[1]!==r?(l=m(()=>{if(r===null)return;let A=globalThis.setTimeout(()=>{o(null)},kt);return()=>{globalThis.clearTimeout(A)}},"r"),i=[r],t[1]=r,t[2]=l,t[3]=i):(l=t[2],i=t[3]),(0,I.useEffect)(l,i);let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=m((A,j)=>{et(j)&&o(A)},"c"),t[4]=c):c=t[4];let p=c,d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=m(()=>{p("config",_t(a))},"d"),t[5]=d):d=t[5];let f=d,u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m(()=>{p("prompt",St(a))},"u"),t[6]=u):u=t[6];let h=u,g;t[7]!==e?(g=e("Connect an AI agent"),t[7]=e,t[8]=g):g=t[8];let x;t[9]!==g?(x=(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:g}),t[9]=g,t[10]=x):x=t[10];let b;t[11]!==e?(b=e("Drive this deployment from an AI agent over the Model Context Protocol \u2014 it can list functions and tables, read schemas, and run read-only queries. Writes stay off unless you opt in."),t[11]=e,t[12]=b):b=t[12];let v;t[13]!==b?(v=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:b}),t[13]=b,t[14]=v):v=t[14];let S;t[15]!==x||t[16]!==v?(S=(0,n.jsxs)("div",{className:"flex flex-col gap-1.5 p-4",children:[x,v]}),t[15]=x,t[16]=v,t[17]=S):S=t[17];let M;t[18]===Symbol.for("react.memo_cache_sentinel")?(M=(0,n.jsx)("code",{className:"font-mono text-xs text-muted-foreground","data-testid":"home-connect-agent-command",children:"npx -y @lunora/mcp"}),t[18]=M):M=t[18];let k;t[19]!==r||t[20]!==e?(k=e(r==="config"?"Copied":"Copy MCP config"),t[19]=r,t[20]=e,t[21]=k):k=t[21];let y;t[22]!==k?(y=(0,n.jsx)(We,{"data-testid":"home-connect-agent-copy-config",onClick:f,size:"xs",variant:"outline",children:k}),t[22]=k,t[23]=y):y=t[23];let w;t[24]!==r||t[25]!==e?(w=e(r==="prompt"?"Copied":"Copy agent prompt"),t[24]=r,t[25]=e,t[26]=w):w=t[26];let L;t[27]!==w?(L=(0,n.jsx)(We,{"data-testid":"home-connect-agent-copy-prompt",onClick:h,size:"xs",variant:"outline",children:w}),t[27]=w,t[28]=L):L=t[28];let C;t[29]!==y||t[30]!==L?(C=(0,n.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border bg-muted/50 px-4 py-3",children:[M,(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[y,L]})]}),t[29]=y,t[30]=L,t[31]=C):C=t[31];let N;return t[32]!==S||t[33]!==C?(N=(0,n.jsxs)(T,{className:"gap-0 py-0","data-testid":"home-connect-agent",children:[S,C]}),t[32]=S,t[33]=C,t[34]=N):N=t[34],N},"kt"),Lt=(0,I.lazy)(()=>import("./chunk-32XMAP7I.js")),Ct=m((t,e)=>{if(e==null)return t("cache not enabled");let s=e.hits+e.misses;return s===0?t("no cache traffic yet"):`${Math.round(e.hits/s*100).toString()}% ${t("cache hit")}`},"wt"),He=m(t=>{if(t<1e3)return`${String(Math.round(t))}ms`;let e=t>=1e4?0:1;return`${(t/1e3).toFixed(e)}s`},"De"),It=m((t,e)=>{let s=Math.max(0,Math.round((e-t)/1e3));if(s<60)return`${String(s)}s ago`;let a=Math.round(s/60);if(a<60)return`${String(a)}m ago`;let r=Math.round(a/60);return r<24?`${String(r)}h ago`:`${String(Math.round(r/24))}d ago`},"$t"),nt=m((t,e)=>{if(t===void 0||t.length===0)return[];let s=new Map;for(let a of t)s.set(a.bucketMs,(s.get(a.bucketMs)??0)+a[e]);return[...s.entries()].toSorted(([a],[r])=>a-r).map(([,a])=>a)},"Ve"),st=m((t,e=!0)=>{if(t.length<4)return null;let s=Math.floor(t.length/2),a=t.slice(0,s).reduce((l,i)=>l+i,0),r=t.slice(s).reduce((l,i)=>l+i,0);if(a===0)return null;let o=(r-a)/a*100;return{positive:e?o>=0:o<=0,text:`${o>=0?"+":""}${o.toFixed(1)}%`}},"We"),Te=m(t=>{let e=(0,_.c)(24),{delta:s,footer:a,label:r,trend:o,unit:l,value:i}=t,c=$(),p;e[0]!==r?(p=(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[0]=r,e[1]=p):p=e[1];let d;e[2]!==i?(d=(0,n.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:i}),e[2]=i,e[3]=d):d=e[3];let f;e[4]!==l?(f=l!==void 0&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=f):f=e[5];let u;e[6]!==d||e[7]!==f?(u=(0,n.jsxs)("span",{className:"flex items-baseline gap-1.5",children:[d,f]}),e[6]=d,e[7]=f,e[8]=u):u=e[8];let h;e[9]!==o?(h=o!==void 0&&(0,n.jsx)(I.Suspense,{fallback:(0,n.jsx)("div",{"aria-hidden":"true",className:"h-8 w-28"}),children:(0,n.jsx)(Lt,{data:o})}),e[9]=o,e[10]=h):h=e[10];let g;e[11]!==u||e[12]!==h?(g=(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[u,h]}),e[11]=u,e[12]=h,e[13]=g):g=e[13];let x;e[14]!==p||e[15]!==g?(x=(0,n.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[p,g]}),e[14]=p,e[15]=g,e[16]=x):x=e[16];let b;e[17]!==s||e[18]!==a||e[19]!==c?(b=s==null?a!=null&&(0,n.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:a}):(0,n.jsxs)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px]",children:[(0,n.jsx)("span",{className:Ee("font-semibold",s.positive?"text-success":"text-destructive"),children:s.text})," ",(0,n.jsx)("span",{className:"text-muted-foreground",children:c("vs. prev.")})]}),e[17]=s,e[18]=a,e[19]=c,e[20]=b):b=e[20];let v;return e[21]!==x||e[22]!==b?(v=(0,n.jsxs)(T,{className:"justify-between gap-0 py-0",children:[x,b]}),e[21]=x,e[22]=b,e[23]=v):v=e[23],v},"Te"),Mt=m(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"m9 6 6 6-6 6"})}),t[0]=e):e=t[0],e},"At"),Ue=m(t=>{let e=(0,_.c)(7),{command:s,label:a}=t,r;e[0]!==a?(r=(0,n.jsx)("div",{className:"p-4",children:(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:a})}),e[0]=a,e[1]=r):r=e[1];let o;e[2]!==s?(o=(0,n.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5",children:(0,n.jsx)("code",{className:"font-mono text-xs text-muted-foreground",children:s})}),e[2]=s,e[3]=o):o=e[3];let l;return e[4]!==r||e[5]!==o?(l=(0,n.jsxs)(T,{className:"justify-between gap-0 py-0",children:[r,o]}),e[4]=r,e[5]=o,e[6]=l):l=e[6],l},"Be"),rt=m(t=>{let e=(0,_.c)(18),{count:s,onView:a,testId:r,title:o}=t,l=$(),i;e[0]!==o?(i=(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:o}),e[0]=o,e[1]=i):i=e[1];let c;e[2]!==s||e[3]!==l?(c=s===null?(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:l("No data yet")}):(0,n.jsx)(Ve,{variant:s>0?"destructive":"success",children:s>0?s:l("All clear")}),e[2]=s,e[3]=l,e[4]=c):c=e[4];let p;e[5]!==i||e[6]!==c?(p=(0,n.jsxs)("div",{className:"flex items-start justify-between gap-2 p-4",children:[i,c]}),e[5]=i,e[6]=c,e[7]=p):p=e[7];let d;e[8]!==l?(d=l("View"),e[8]=l,e[9]=d):d=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)(Mt,{}),e[10]=f):f=e[10];let u;e[11]!==a||e[12]!==d?(u=(0,n.jsxs)("button",{className:"flex items-center gap-1 border-t border-border bg-muted/50 px-4 py-2.5 text-[12px] font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:bg-muted",onClick:a,type:"button",children:[d,f]}),e[11]=a,e[12]=d,e[13]=u):u=e[13];let h;return e[14]!==p||e[15]!==u||e[16]!==r?(h=(0,n.jsxs)(T,{className:"justify-between gap-0 py-0","data-testid":r,children:[p,u]}),e[14]=p,e[15]=u,e[16]=r,e[17]=h):h=e[17],h},"Qe"),At=m(t=>{let e=(0,_.c)(7),{functions:s}=t,a=$(),r;if(e[0]!==s||e[1]!==a){let o=[...s].toSorted(Ot).slice(0,5),l;e[3]!==a?(l=a("Top functions"),e[3]=a,e[4]=l):l=e[4];let i;e[5]!==l?(i=(0,n.jsx)("div",{className:"border-b border-border px-4 py-3",children:(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l})}),e[5]=l,e[6]=i):i=e[6],r=(0,n.jsxs)(T,{className:"gap-0 py-0","data-testid":"home-top-functions",children:[i,o.length===0?(0,n.jsx)("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:a("No functions called yet.")}):(0,n.jsxs)("div",{className:"divide-y divide-border",children:[(0,n.jsxs)("div",{className:"grid grid-cols-[1fr_auto_auto_auto] gap-4 px-4 py-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:[(0,n.jsx)("span",{children:a("Function")}),(0,n.jsx)("span",{className:"text-end",children:a("Calls")}),(0,n.jsx)("span",{className:"w-12 text-end",children:a("Avg")}),(0,n.jsx)("span",{className:"w-8 text-end",children:a("Err")})]}),o.map(Rt)]})]}),e[0]=s,e[1]=a,e[2]=r}else r=e[2];return r},"Lt"),$t=m(t=>{let e=(0,_.c)(26),{subs:s}=t,a=$(),r;e[0]!==a?(r=a("Live connections"),e[0]=a,e[1]=r):r=e[1];let o;e[2]!==r?(o=(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[2]=r,e[3]=o):o=e[3];let l=s?.totalConnections??0,i;e[4]!==l?(i=l.toLocaleString(),e[4]=l,e[5]=i):i=e[5];let c;e[6]!==i?(c=(0,n.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:i}),e[6]=i,e[7]=c):c=e[7];let p;e[8]!==a?(p=a("sockets"),e[8]=a,e[9]=p):p=e[9];let d;e[10]!==p?(d=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:p}),e[10]=p,e[11]=d):d=e[11];let f;e[12]!==c||e[13]!==d?(f=(0,n.jsxs)("span",{className:"flex items-baseline gap-1.5",children:[c,d]}),e[12]=c,e[13]=d,e[14]=f):f=e[14];let u=s?.totalSubscriptions??0,h;e[15]!==u?(h=u.toLocaleString(),e[15]=u,e[16]=h):h=e[16];let g;e[17]!==a?(g=a("active subscriptions"),e[17]=a,e[18]=g):g=e[18];let x;e[19]!==h||e[20]!==g?(x=(0,n.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[h," ",g]}),e[19]=h,e[20]=g,e[21]=x):x=e[21];let b;return e[22]!==x||e[23]!==o||e[24]!==f?(b=(0,n.jsx)(T,{"data-testid":"home-live-connections",children:(0,n.jsxs)(Fe,{className:"flex flex-col gap-2.5 py-4",children:[o,f,x]})}),e[22]=x,e[23]=o,e[24]=f,e[25]=b):b=e[25],b},"Mt"),jt=m(t=>{let e=(0,_.c)(7),{entries:s}=t,a=$(),r;if(e[0]!==s||e[1]!==a){let o=Date.now(),l;e[3]!==a?(l=a("Recent activity"),e[3]=a,e[4]=l):l=e[4];let i;e[5]!==l?(i=(0,n.jsx)("div",{className:"border-b border-border px-4 py-3",children:(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l})}),e[5]=l,e[6]=i):i=e[6],r=(0,n.jsxs)(T,{className:"gap-0 py-0","data-testid":"home-recent-activity",children:[i,s.length===0?(0,n.jsx)("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:a("No recent activity.")}):(0,n.jsx)("ul",{className:"divide-y divide-border",children:s.slice(0,5).map(c=>(0,n.jsxs)("li",{className:"flex items-center justify-between gap-3 px-4 py-2 text-[13px]",children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-muted-foreground/40"}),(0,n.jsxs)("span",{className:"truncate text-foreground",children:[c.op,c.table!==void 0&&(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",c.table,c.id===void 0?"":`#${c.id}`]})]})]}),(0,n.jsx)("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:It(c.ts,o)})]},c.seq))})]}),e[0]=s,e[1]=a,e[2]=r}else r=e[2];return r},"It"),Tt=m(t=>{let e=t.reduce((s,a)=>s+a.calls,0);return e===0?null:t.reduce((s,a)=>s+a.totalDurationMs,0)/e},"Tt"),Yt=m(t=>{let e=(0,_.c)(149),{initialShardKey:s}=t,a=$(),r=Be(),o=s??"",l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={},e[0]=l):l=e[0];let i;e[1]!==o?(i={shardKey:o},e[1]=o,e[2]=i):i=e[2];let c=_e(z.getMetrics,l,i),p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={},e[3]=p):p=e[3];let d;e[4]!==o?(d={shardKey:o},e[4]=o,e[5]=d):d=e[5];let f=_e(z.getFunctionStats,p,d),u,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={},h={shardKey:""},e[6]=u,e[7]=h):(u=e[6],h=e[7]);let g=_e(z.getSecurityAudit,u,h),x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={},e[8]=x):x=e[8];let b;e[9]!==o?(b={shardKey:o},e[9]=o,e[10]=b):b=e[10];let v=_e(z.listSubscriptions,x,b),S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={},e[11]=S):S=e[11];let M;e[12]!==o?(M={shardKey:o},e[12]=o,e[13]=M):M=e[13];let k=_e(z.getAuditLog,S,M),y=c.data??null,w,L,C,N,A,j,D,O,R,P,B,E,q,K,V,W,F,U;if(e[14]!==k.data||e[15]!==g.data||e[16]!==y||e[17]!==c.data||e[18]!==r||e[19]!==f.data||e[20]!==v.data||e[21]!==a){N=Array.isArray(f.data?.functions)?f.data.functions:[],D=v.data??null;let Le;e[40]!==k.data?(Le=Array.isArray(k.data?.entries)?k.data.entries:[],e[40]=k.data,e[41]=Le):Le=e[41],L=Le,A=c.data===void 0||f.data===void 0?null:tt(y,N).length,j=Array.isArray(g.data?.findings)?g.data.findings.length:null;let Ce;e[42]!==r?(Ce=m(()=>{Ne(r({to:"/security"}))},"we"),e[42]=r,e[43]=Ce):Ce=e[43],U=Ce;let Ie;e[44]!==r?(Ie=m(()=>{Ne(r({to:"/insights"}))},"$e"),e[44]=r,e[45]=Ie):Ie=e[45],F=Ie;let Me=nt(y?.history,"calls"),Ae=nt(y?.history,"errors"),Je=Tt(N),$e=Math.max(0,...N.map(qt)),je;e[46]!==y||e[47]!==a?(je=y===null?void 0:Ct(a,y.cache),e[46]=y,e[47]=a,e[48]=je):je=e[48],C=je,V="flex flex-col gap-6",W="lunora-home",B="grid gap-3 sm:grid-cols-2 xl:grid-cols-4",E="home-health";let Re=st(Me),xe;e[49]!==a?(xe=a("Requests"),e[49]=a,e[50]=xe):xe=e[50];let qe=y?.requests??0,be;e[51]!==qe?(be=qe.toLocaleString(),e[51]=qe,e[52]=be):be=e[52],e[53]!==Me||e[54]!==Re||e[55]!==xe||e[56]!==be?(q=(0,n.jsx)(Te,{delta:Re,label:xe,trend:Me,value:be}),e[53]=Me,e[54]=Re,e[55]=xe,e[56]=be,e[57]=q):q=e[57];let Ke=st(Ae,!1),ye;e[58]!==a?(ye=a("Errors"),e[58]=a,e[59]=ye):ye=e[59];let ze=y?.errors??0,ve;e[60]!==ze?(ve=ze.toLocaleString(),e[60]=ze,e[61]=ve):ve=e[61],e[62]!==Ae||e[63]!==Ke||e[64]!==ye||e[65]!==ve?(K=(0,n.jsx)(Te,{delta:Ke,label:ye,trend:Ae,value:ve}),e[62]=Ae,e[63]=Ke,e[64]=ye,e[65]=ve,e[66]=K):K=e[66],w=Te,e[67]!==$e||e[68]!==a?(O=$e>0?`${a("max")} ${He($e)}`:void 0,e[67]=$e,e[68]=a,e[69]=O):O=e[69],e[70]!==a?(R=a("Avg latency"),e[70]=a,e[71]=R):R=e[71],P=Je===null?"\u2014":He(Je),e[14]=k.data,e[15]=g.data,e[16]=y,e[17]=c.data,e[18]=r,e[19]=f.data,e[20]=v.data,e[21]=a,e[22]=w,e[23]=L,e[24]=C,e[25]=N,e[26]=A,e[27]=j,e[28]=D,e[29]=O,e[30]=R,e[31]=P,e[32]=B,e[33]=E,e[34]=q,e[35]=K,e[36]=V,e[37]=W,e[38]=F,e[39]=U}else w=e[22],L=e[23],C=e[24],N=e[25],A=e[26],j=e[27],D=e[28],O=e[29],R=e[30],P=e[31],B=e[32],E=e[33],q=e[34],K=e[35],V=e[36],W=e[37],F=e[38],U=e[39];let H;e[72]!==w||e[73]!==O||e[74]!==R||e[75]!==P?(H=(0,n.jsx)(w,{footer:O,label:R,value:P}),e[72]=w,e[73]=O,e[74]=R,e[75]=P,e[76]=H):H=e[76];let J;e[77]!==a?(J=a("Database size"),e[77]=a,e[78]=J):J=e[78];let Oe=y?.databaseSize??null,Y;e[79]!==Oe?(Y=Qe(Oe),e[79]=Oe,e[80]=Y):Y=e[80];let G;e[81]!==C||e[82]!==J||e[83]!==Y?(G=(0,n.jsx)(Te,{footer:C,label:J,value:Y}),e[81]=C,e[82]=J,e[83]=Y,e[84]=G):G=e[84];let Z;e[85]!==B||e[86]!==E||e[87]!==q||e[88]!==K||e[89]!==H||e[90]!==G?(Z=(0,n.jsxs)("div",{className:B,"data-testid":E,children:[q,K,H,G]}),e[85]=B,e[86]=E,e[87]=q,e[88]=K,e[89]=H,e[90]=G,e[91]=Z):Z=e[91];let Se;e[92]===Symbol.for("react.memo_cache_sentinel")?(Se=(0,n.jsx)(gt,{}),e[92]=Se):Se=e[92];let Q;e[93]!==N?(Q=(0,n.jsx)("div",{className:"lg:col-span-2",children:(0,n.jsx)(At,{functions:N})}),e[93]=N,e[94]=Q):Q=e[94];let X;e[95]!==D?(X=(0,n.jsx)($t,{subs:D}),e[95]=D,e[96]=X):X=e[96];let ee;e[97]!==L?(ee=(0,n.jsx)(jt,{entries:L}),e[97]=L,e[98]=ee):ee=e[98];let te;e[99]!==X||e[100]!==ee?(te=(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[X,ee]}),e[99]=X,e[100]=ee,e[101]=te):te=e[101];let ae;e[102]!==Q||e[103]!==te?(ae=(0,n.jsxs)("div",{className:"grid gap-3 lg:grid-cols-3",children:[Q,te]}),e[102]=Q,e[103]=te,e[104]=ae):ae=e[104];let ne;e[105]!==a?(ne=a("Advisors"),e[105]=a,e[106]=ne):ne=e[106];let se;e[107]!==ne?(se=(0,n.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:ne}),e[107]=ne,e[108]=se):se=e[108];let re;e[109]!==A||e[110]!==j||e[111]!==a||e[112]!==F||e[113]!==U?(re=j===0&&A===0?(0,n.jsx)(Ye,{description:a("No security or performance issues detected."),icon:(0,n.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M12 3 4 6v5c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6l-8-3Z"}),(0,n.jsx)("path",{d:"m9 12 2 2 4-4"})]}),testId:"home-advisors-clear",title:a("No issues found")}):(0,n.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,n.jsx)(rt,{count:j,onView:U,testId:"home-security",title:a("Security findings")}),(0,n.jsx)(rt,{count:A,onView:F,testId:"home-performance",title:a("Performance issues")})]}),e[109]=A,e[110]=j,e[111]=a,e[112]=F,e[113]=U,e[114]=re):re=e[114];let oe;e[115]!==se||e[116]!==re?(oe=(0,n.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-advisors",children:[se,re]}),e[115]=se,e[116]=re,e[117]=oe):oe=e[117];let le;e[118]!==a?(le=a("Get connected"),e[118]=a,e[119]=le):le=e[119];let ie;e[120]!==le?(ie=(0,n.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:le}),e[120]=le,e[121]=ie):ie=e[121];let ce;e[122]!==a?(ce=a("Client SDK"),e[122]=a,e[123]=ce):ce=e[123];let de;e[124]!==ce?(de=(0,n.jsx)(Ue,{command:"npm i @lunora/client",label:ce}),e[124]=ce,e[125]=de):de=e[125];let me;e[126]!==a?(me=a("React"),e[126]=a,e[127]=me):me=e[127];let ue;e[128]!==me?(ue=(0,n.jsx)(Ue,{command:"npm i @lunora/react",label:me}),e[128]=me,e[129]=ue):ue=e[129];let pe;e[130]!==a?(pe=a("CLI"),e[130]=a,e[131]=pe):pe=e[131];let fe;e[132]!==pe?(fe=(0,n.jsx)(Ue,{command:"lunora dev",label:pe}),e[132]=pe,e[133]=fe):fe=e[133];let he;e[134]!==de||e[135]!==ue||e[136]!==fe?(he=(0,n.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[de,ue,fe]}),e[134]=de,e[135]=ue,e[136]=fe,e[137]=he):he=e[137];let ke;e[138]===Symbol.for("react.memo_cache_sentinel")?(ke=(0,n.jsx)(wt,{}),e[138]=ke):ke=e[138];let ge;e[139]!==ie||e[140]!==he?(ge=(0,n.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-get-connected",children:[ie,he,ke]}),e[139]=ie,e[140]=he,e[141]=ge):ge=e[141];let we;return e[142]!==V||e[143]!==W||e[144]!==Z||e[145]!==ae||e[146]!==oe||e[147]!==ge?(we=(0,n.jsxs)("div",{className:V,"data-testid":W,children:[Z,Se,ae,oe,ge]}),e[142]=V,e[143]=W,e[144]=Z,e[145]=ae,e[146]=oe,e[147]=ge,e[148]=we):we=e[148],we},"Yt");function Ot(t,e){return e.calls-t.calls}m(Ot,"Ot");function Rt(t){return(0,n.jsxs)("div",{className:"grid grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-4 py-2 text-[13px]",children:[(0,n.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:t.path}),(0,n.jsx)("span",{className:"text-end tabular-nums",children:t.calls.toLocaleString()}),(0,n.jsx)("span",{className:"w-12 text-end tabular-nums text-muted-foreground",children:He(t.calls>0?t.totalDurationMs/t.calls:0)}),(0,n.jsx)("span",{className:Ee("w-8 text-end tabular-nums",t.errors>0?"text-destructive":"text-muted-foreground"),children:t.errors})]},t.path)}m(Rt,"Rt");function qt(t){return t.maxDurationMs}m(qt,"Et");export{ut as a,Yt as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as kt,d as m}from"./chunk-BE3SUNHW.js";import{a as o,d as M,e as J,f as Tt,g as Be}from"./chunk-YKXDMIHQ.js";var D=class{static{o(this,"Subscribable")}constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var jr=class extends D{static{o(this,"FocusManager")}#e;#t;#r;constructor(){super(),this.#r=r=>{if(typeof window<"u"&&window.addEventListener){let e=o(()=>r(),"listener");return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(r){this.#r=r,this.#t?.(),this.#t=r(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(r){this.#e!==r&&(this.#e=r,this.onFocus())}onFocus(){let r=this.isFocused();this.listeners.forEach(e=>{e(r)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},re=new jr;var $r={setTimeout:o((r,e)=>setTimeout(r,e),"setTimeout"),clearTimeout:o(r=>clearTimeout(r),"clearTimeout"),setInterval:o((r,e)=>setInterval(r,e),"setInterval"),clearInterval:o(r=>clearInterval(r),"clearInterval")},Hr=class{static{o(this,"TimeoutManager")}#e=$r;#t=!1;setTimeoutProvider(r){this.#e=r}setTimeout(r,e){return this.#e.setTimeout(r,e)}clearTimeout(r){this.#e.clearTimeout(r)}setInterval(r,e){return this.#e.setInterval(r,e)}clearInterval(r){this.#e.clearInterval(r)}},U=new Hr;function Et(r){setTimeout(r,0)}o(Et,"systemSetTimeoutZero");var $e=typeof window>"u"||"Deno"in globalThis;function w(){}o(w,"noop");function Rt(r,e){return typeof r=="function"?r(e):r}o(Rt,"functionalUpdate");function ue(r){return typeof r=="number"&&r>=0&&r!==1/0}o(ue,"isValidTimeout");function Se(r,e){return Math.max(r+(e||0)-Date.now(),0)}o(Se,"timeUntilStale");function L(r,e){return typeof r=="function"?r(e):r}o(L,"resolveStaleTime");function I(r,e){return typeof r=="function"?r(e):r}o(I,"resolveQueryBoolean");function we(r,e){let{type:t="all",exact:s,fetchStatus:i,predicate:n,queryKey:a,stale:c}=r;if(a){if(s){if(e.queryHash!==he(a,e.options))return!1}else if(!j(e.queryKey,a))return!1}if(t!=="all"){let u=e.isActive();if(t==="active"&&!u||t==="inactive"&&u)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||i&&i!==e.state.fetchStatus||n&&!n(e))}o(we,"matchQuery");function Ce(r,e){let{exact:t,status:s,predicate:i,mutationKey:n}=r;if(n){if(!e.options.mutationKey)return!1;if(t){if(X(e.options.mutationKey)!==X(n))return!1}else if(!j(e.options.mutationKey,n))return!1}return!(s&&e.state.status!==s||i&&!i(e))}o(Ce,"matchMutation");function he(r,e){return(e?.queryKeyHashFn||X)(r)}o(he,"hashQueryKeyByOptions");function X(r){return JSON.stringify(r,(e,t)=>je(t)?Object.keys(t).sort().reduce((s,i)=>(s[i]=t[i],s),{}):t)}o(X,"hashKey");function j(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(r&&e&&typeof r=="object"&&typeof e=="object"){if(Array.isArray(r)&&Array.isArray(e)){for(let s=0;s<e.length;s++)if(!j(r[s],e[s]))return!1;return!0}let t=Object.keys(e);for(let s of t)if(!j(r[s],e[s]))return!1;return!0}return!1}o(j,"partialMatchKey");var zr=Object.prototype.hasOwnProperty;function He(r,e,t=0){if(r===e)return r;if(t>500)return e;let s=It(r)&&It(e);if(!s&&!(je(r)&&je(e)))return e;let n=(s?r:Object.keys(r)).length,a=s?e:Object.keys(e),c=a.length,u=s?new Array(c):{},h=0;for(let d=0;d<c;d++){let l=s?d:a[d],f=r[l],y=e[l];if(f===y){u[l]=f,(s?d<n:zr.call(r,l))&&h++;continue}if(f===null||y===null||typeof f!="object"||typeof y!="object"){u[l]=y;continue}let p=He(f,y,t+1);u[l]=p,p===f&&h++}return n===c&&h===n?r:u}o(He,"replaceEqualDeep");function ke(r,e){if(!e||Object.keys(r).length!==Object.keys(e).length)return!1;for(let t in r)if(r[t]!==e[t])return!1;return!0}o(ke,"shallowEqualObjects");function It(r){return Array.isArray(r)&&r.length===Object.keys(r).length}o(It,"isPlainArray");function je(r){if(!Ot(r))return!1;let e=r.constructor;if(e===void 0)return!0;let t=e.prototype;return!(!Ot(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(r)!==Object.prototype)}o(je,"isPlainObject");function Ot(r){return Object.prototype.toString.call(r)==="[object Object]"}o(Ot,"hasObjectPrototype");function Pt(r){return new Promise(e=>{U.setTimeout(e,r)})}o(Pt,"sleep");function de(r,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(r,e):t.structuralSharing!==!1?He(r,e):e}o(de,"replaceData");function Wr(r){return r}o(Wr,"keepPreviousData");function At(r,e,t=0){let s=[...r,e];return t&&s.length>t?s.slice(1):s}o(At,"addToEnd");function Ft(r,e,t=0){let s=[e,...r];return t&&s.length>t?s.slice(0,-1):s}o(Ft,"addToStart");var se=Symbol();function Te(r,e){return!r.queryFn&&e?.initialPromise?()=>e.initialPromise:!r.queryFn||r.queryFn===se?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}o(Te,"ensureQueryFn");function Ee(r,e){return typeof r=="function"?r(...e):!!r}o(Ee,"shouldThrowError");function Mt(r,e,t){let s=!1,i;return Object.defineProperty(r,"signal",{enumerable:!0,get:o(()=>(i??=e(),s||(s=!0,i.aborted?t():i.addEventListener("abort",t,{once:!0})),i),"get")}),r}o(Mt,"addConsumeAwareSignal");var q=(()=>{let r=o(()=>$e,"isServerFn");return{isServer(){return r()},setIsServer(e){r=e}}})();function le(){let r,e,t=new Promise((i,n)=>{r=i,e=n});t.status="pending",t.catch(()=>{});function s(i){Object.assign(t,i),delete t.resolve,delete t.reject}return o(s,"finalize"),t.resolve=i=>{s({status:"fulfilled",value:i}),r(i)},t.reject=i=>{s({status:"rejected",reason:i}),e(i)},t}o(le,"pendingThenable");var xt=Et;function Vr(){let r=[],e=0,t=o(c=>{c()},"notifyFn"),s=o(c=>{c()},"batchNotifyFn"),i=xt,n=o(c=>{e?r.push(c):i(()=>{t(c)})},"schedule"),a=o(()=>{let c=r;r=[],c.length&&i(()=>{s(()=>{c.forEach(u=>{t(u)})})})},"flush");return{batch:o(c=>{let u;e++;try{u=c()}finally{e--,e||a()}return u},"batch"),batchCalls:o(c=>(...u)=>{n(()=>{c(...u)})},"batchCalls"),schedule:n,setNotifyFunction:o(c=>{t=c},"setNotifyFunction"),setBatchNotifyFunction:o(c=>{s=c},"setBatchNotifyFunction"),setScheduler:o(c=>{i=c},"setScheduler")}}o(Vr,"createNotifyManager");var g=Vr();var Gr=class extends D{static{o(this,"OnlineManager")}#e=!0;#t;#r;constructor(){super(),this.#r=r=>{if(typeof window<"u"&&window.addEventListener){let e=o(()=>r(!0),"onlineListener"),t=o(()=>r(!1),"offlineListener");return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(r){this.#r=r,this.#t?.(),this.#t=r(this.setOnline.bind(this))}setOnline(r){this.#e!==r&&(this.#e=r,this.listeners.forEach(t=>{t(r)}))}isOnline(){return this.#e}},ie=new Gr;function Jr(r){return Math.min(1e3*2**r,3e4)}o(Jr,"defaultRetryDelay");function ze(r){return(r??"online")==="online"?ie.isOnline():!0}o(ze,"canFetch");var Ie=class extends Error{static{o(this,"CancelledError")}constructor(r){super("CancelledError"),this.revert=r?.revert,this.silent=r?.silent}};function Oe(r){let e=!1,t=0,s,i=le(),n=o(()=>i.status!=="pending","isResolved"),a=o(b=>{if(!n()){let C=new Ie(b);f(C),r.onCancel?.(C)}},"cancel"),c=o(()=>{e=!0},"cancelRetry"),u=o(()=>{e=!1},"continueRetry"),h=o(()=>re.isFocused()&&(r.networkMode==="always"||ie.isOnline())&&r.canRun(),"canContinue"),d=o(()=>ze(r.networkMode)&&r.canRun(),"canStart"),l=o(b=>{n()||(s?.(),i.resolve(b))},"resolve"),f=o(b=>{n()||(s?.(),i.reject(b))},"reject"),y=o(()=>new Promise(b=>{s=o(C=>{(n()||h())&&b(C)},"continueFn"),r.onPause?.()}).then(()=>{s=void 0,n()||r.onContinue?.()}),"pause"),p=o(()=>{if(n())return;let b,C=t===0?r.initialPromise:void 0;try{b=C??r.fn()}catch(k){b=Promise.reject(k)}Promise.resolve(b).then(l).catch(k=>{if(n())return;let T=r.retry??(q.isServer()?0:3),Q=r.retryDelay??Jr,_=typeof Q=="function"?Q(t,k):Q,G=T===!0||typeof T=="number"&&t<T||typeof T=="function"&&T(t,k);if(e||!G){f(k);return}t++,r.onFail?.(t,k),Pt(_).then(()=>h()?void 0:y()).then(()=>{e?f(k):p()})})},"run");return{promise:i,status:o(()=>i.status,"status"),cancel:a,continue:o(()=>(s?.(),i),"continue"),cancelRetry:c,continueRetry:u,canStart:d,start:o(()=>(d()?p():y().then(p),i),"start")}}o(Oe,"createRetryer");var Re=class{static{o(this,"Removable")}#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ue(this.gcTime)&&(this.#e=U.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(q.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(U.clearTimeout(this.#e),this.#e=void 0)}};function _t(r){return{onFetch:o((e,t)=>{let s=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],a=e.state.data?.pageParams||[],c={pages:[],pageParams:[]},u=0,h=o(async()=>{let d=!1,l=o(p=>{Mt(p,()=>e.signal,()=>d=!0)},"addSignalProperty"),f=Te(e.options,e.fetchOptions),y=o(async(p,b,C)=>{if(d)return Promise.reject(e.signal.reason);if(b==null&&p.pages.length)return Promise.resolve(p);let T=o(()=>{let Ke={client:e.client,queryKey:e.queryKey,pageParam:b,direction:C?"backward":"forward",meta:e.options.meta};return l(Ke),Ke},"createQueryFnContext")(),Q=await f(T),{maxPages:_}=e.options,G=C?Ft:At;return{pages:G(p.pages,Q,_),pageParams:G(p.pageParams,b,_)}},"fetchPage");if(i&&n.length){let p=i==="backward",b=p?Xr:Qt,C={pages:n,pageParams:a},k=b(s,C);c=await y(C,k,p)}else{let p=r??n.length;do{let b=u===0?a[0]??s.initialPageParam:Qt(s,c);if(u>0&&b==null)break;c=await y(c,b),u++}while(u<p)}return c},"fetchFn");e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t):e.fetchFn=h},"onFetch")}}o(_t,"infiniteQueryBehavior");function Qt(r,{pages:e,pageParams:t}){let s=e.length-1;return e.length>0?r.getNextPageParam(e[s],e,t[s],t):void 0}o(Qt,"getNextPageParam");function Xr(r,{pages:e,pageParams:t}){return e.length>0?r.getPreviousPageParam?.(e[0],e,t[0],t):void 0}o(Xr,"getPreviousPageParam");var Ut=class extends Re{static{o(this,"Query")}#e;#t;#r;#s;#n;#i;#o;#a;constructor(r){super(),this.#a=!1,this.#o=r.defaultOptions,this.setOptions(r.options),this.observers=[],this.#n=r.client,this.#s=this.#n.getQueryCache(),this.queryKey=r.queryKey,this.queryHash=r.queryHash,this.#t=Dt(this.options),this.state=r.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(r){if(this.options={...this.#o,...r},r?._type&&(this.#e=r._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Dt(this.options);e.data!==void 0&&(this.setState(Lt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(r,e){let t=de(this.state.data,r,this.options);return this.#c({data:t,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),t}setState(r){this.#c({type:"setState",state:r})}cancel(r){let e=this.#i?.promise;return this.#i?.cancel(r),e?e.then(w).catch(w):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(r=>I(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===se||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>L(r.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){return this.state.data===void 0?!0:r==="static"?!1:this.state.isInvalidated?!0:!Se(this.state.dataUpdatedAt,r)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(e=>e!==r),this.observers.length||(this.#i&&(this.#a||this.#h()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}#h(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#c({type:"invalidate"})}async fetch(r,e){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(r&&this.setOptions(r),!this.options.queryFn){let u=this.observers.find(h=>h.options.queryFn);u&&this.setOptions(u.options)}let t=new AbortController,s=o(u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:o(()=>(this.#a=!0,t.signal),"get")})},"addSignalProperty"),i=o(()=>{let u=Te(this.options,e),d=o(()=>{let l={client:this.#n,queryKey:this.queryKey,meta:this.meta};return s(l),l},"createQueryFnContext")();return this.#a=!1,this.options.persister?this.options.persister(u,d,this):u(d)},"fetchFn"),a=o(()=>{let u={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#n,state:this.state,fetchFn:i};return s(u),u},"createFetchContext")();(this.#e==="infinite"?_t(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#r=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:"fetch",meta:a.fetchOptions?.meta}),this.#i=Oe({initialPromise:e?.initialPromise,fn:a.fetchFn,onCancel:o(u=>{u instanceof Ie&&u.revert&&this.setState({...this.#r,fetchStatus:"idle"}),t.abort()},"onCancel"),onFail:o((u,h)=>{this.#c({type:"failed",failureCount:u,error:h})},"onFail"),onPause:o(()=>{this.#c({type:"pause"})},"onPause"),onContinue:o(()=>{this.#c({type:"continue"})},"onContinue"),retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:o(()=>!0,"canRun")});try{let u=await this.#i.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#s.config.onSuccess?.(u,this),this.#s.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof Ie){if(u.silent)return this.#i.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#c({type:"error",error:u}),this.#s.config.onError?.(u,this),this.#s.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#c(r){let e=o(t=>{switch(r.type){case"failed":return{...t,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...We(t.data,this.options),fetchMeta:r.meta??null};case"success":let s={...t,...Lt(r.data,r.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#r=r.manual?s:void 0,s;case"error":let i=r.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...r.state}}},"reducer");this.state=e(this.state),g.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:r})})}};function We(r,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ze(e.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}o(We,"fetchState");function Lt(r,e){return{data:r,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}o(Lt,"successState");function Dt(r){let e=typeof r.initialData=="function"?r.initialData():r.initialData,t=e!==void 0,s=t?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}o(Dt,"getDefaultState");var Ge=class extends D{static{o(this,"QueryObserver")}constructor(r,e){super(),this.options=e,this.#e=r,this.#a=null,this.#o=le(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#r=void 0;#s=void 0;#n;#i;#o;#a;#h;#c;#p;#d;#l;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),qt(this.#t,this.options)?this.#f():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ve(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ve(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#w(),this.#t.removeObserver(this)}setOptions(r){let e=this.options,t=this.#t;if(this.options=this.#e.defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof I(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),e._defaulted&&!ke(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});let s=this.hasListeners();s&&Nt(this.#t,t,this.options,e)&&this.#f(),this.updateResult(),s&&(this.#t!==t||I(this.options.enabled,this.#t)!==I(e.enabled,this.#t)||L(this.options.staleTime,this.#t)!==L(e.staleTime,this.#t))&&this.#y();let i=this.#b();s&&(this.#t!==t||I(this.options.enabled,this.#t)!==I(e.enabled,this.#t)||i!==this.#u)&&this.#v(i)}getOptimisticResult(r){let e=this.#e.getQueryCache().build(this.#e,r),t=this.createResult(e,r);return Zr(this,t)&&(this.#s=t,this.#i=this.options,this.#n=this.#t.state),t}getCurrentResult(){return this.#s}trackResult(r,e){return new Proxy(r,{get:o((t,s)=>(this.trackProp(s),e?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,s)),"get")})}trackProp(r){this.#m.add(r)}getCurrentQuery(){return this.#t}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){let e=this.#e.defaultQueryOptions(r),t=this.#e.getQueryCache().build(this.#e,e);return t.fetch().then(()=>this.createResult(t,e))}fetch(r){return this.#f({...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#f(r){this.#C();let e=this.#t.fetch(this.options,r);return r?.throwOnError||(e=e.catch(w)),e}#y(){this.#S();let r=L(this.options.staleTime,this.#t);if(q.isServer()||this.#s.isStale||!ue(r))return;let t=Se(this.#s.dataUpdatedAt,r)+1;this.#d=U.setTimeout(()=>{this.#s.isStale||this.updateResult()},t)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(r){this.#w(),this.#u=r,!(q.isServer()||I(this.options.enabled,this.#t)===!1||!ue(this.#u)||this.#u===0)&&(this.#l=U.setInterval(()=>{(this.options.refetchIntervalInBackground||re.isFocused())&&this.#f()},this.#u))}#g(){this.#y(),this.#v(this.#b())}#S(){this.#d!==void 0&&(U.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#l!==void 0&&(U.clearInterval(this.#l),this.#l=void 0)}createResult(r,e){let t=this.#t,s=this.options,i=this.#s,n=this.#n,a=this.#i,u=r!==t?r.state:this.#r,{state:h}=r,d={...h},l=!1,f;if(e._optimisticResults){let F=this.hasListeners(),ce=!F&&qt(r,e),be=F&&Nt(r,t,e,s);(ce||be)&&(d={...d,...We(h.data,r.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:p,status:b}=d;f=d.data;let C=!1;if(e.placeholderData!==void 0&&f===void 0&&b==="pending"){let F;i?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(F=i.data,C=!0):F=typeof e.placeholderData=="function"?e.placeholderData(this.#p?.state.data,this.#p):e.placeholderData,F!==void 0&&(b="success",f=de(i?.data,F,e),l=!0)}if(e.select&&f!==void 0&&!C)if(i&&f===n?.data&&e.select===this.#h)f=this.#c;else try{this.#h=e.select,f=e.select(f),f=de(i?.data,f,e),this.#c=f,this.#a=null}catch(F){this.#a=F}this.#a&&(y=this.#a,f=this.#c,p=Date.now(),b="error");let k=d.fetchStatus==="fetching",T=b==="pending",Q=b==="error",_=T&&k,G=f!==void 0,B={status:b,fetchStatus:d.fetchStatus,isPending:T,isSuccess:b==="success",isError:Q,isInitialLoading:_,isLoading:_,data:f,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:r.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:k,isRefetching:k&&!T,isLoadingError:Q&&!G,isPaused:d.fetchStatus==="paused",isPlaceholderData:l,isRefetchError:Q&&G,isStale:Je(r,e),refetch:this.refetch,promise:this.#o,isEnabled:I(e.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){let F=B.data!==void 0,ce=B.status==="error"&&!F,be=o(ge=>{ce?ge.reject(B.error):F&&ge.resolve(B.data)},"finalizeThenableIfPossible"),Ct=o(()=>{let ge=this.#o=B.promise=le();be(ge)},"recreateThenable"),ve=this.#o;switch(ve.status){case"pending":r.queryHash===t.queryHash&&be(ve);break;case"fulfilled":(ce||B.data!==ve.value)&&Ct();break;case"rejected":(!ce||B.error!==ve.reason)&&Ct();break}}return B}updateResult(){let r=this.#s,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#i=this.options,this.#n.data!==void 0&&(this.#p=this.#t),ke(e,r))return;this.#s=e;let t=o(()=>{if(!r)return!0;let{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#m.size)return!0;let n=new Set(i??this.#m);return this.options.throwOnError&&n.add("error"),Object.keys(this.#s).some(a=>{let c=a;return this.#s[c]!==r[c]&&n.has(c)})},"shouldNotifyListeners");this.#k({listeners:t()})}#C(){let r=this.#e.getQueryCache().build(this.#e,this.options);if(r===this.#t)return;let e=this.#t;this.#t=r,this.#r=r.state,this.hasListeners()&&(e?.removeObserver(this),r.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#k(r){g.batch(()=>{r.listeners&&this.listeners.forEach(e=>{e(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Yr(r,e){return I(e.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&I(e.retryOnMount,r)===!1)}o(Yr,"shouldLoadOnMount");function qt(r,e){return Yr(r,e)||r.state.data!==void 0&&Ve(r,e,e.refetchOnMount)}o(qt,"shouldFetchOnMount");function Ve(r,e,t){if(I(e.enabled,r)!==!1&&L(e.staleTime,r)!=="static"){let s=typeof t=="function"?t(r):t;return s==="always"||s!==!1&&Je(r,e)}return!1}o(Ve,"shouldFetchOn");function Nt(r,e,t,s){return(r!==e||I(s.enabled,r)===!1)&&(!t.suspense||r.state.status!=="error")&&Je(r,t)}o(Nt,"shouldFetchOptionally");function Je(r,e){return I(e.enabled,r)!==!1&&r.isStaleByTime(L(e.staleTime,r))}o(Je,"isStale");function Zr(r,e){return!ke(r.getCurrentResult(),e)}o(Zr,"shouldAssignObserverCurrentProperties");var Kt=class extends Re{static{o(this,"Mutation")}#e;#t;#r;#s;constructor(r){super(),this.#e=r.client,this.mutationId=r.mutationId,this.#r=r.mutationCache,this.#t=[],this.state=r.state||es(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){this.#t.includes(r)||(this.#t.push(r),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){this.#t=this.#t.filter(e=>e!==r),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(r){let e=o(()=>{this.#n({type:"continue"})},"onContinue"),t={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Oe({fn:o(()=>this.options.mutationFn?this.options.mutationFn(r,t):Promise.reject(new Error("No mutationFn found")),"fn"),onFail:o((n,a)=>{this.#n({type:"failed",failureCount:n,error:a})},"onFail"),onPause:o(()=>{this.#n({type:"pause"})},"onPause"),onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:o(()=>this.#r.canRun(this),"canRun")});let s=this.state.status==="pending",i=!this.#s.canStart();try{if(s)e();else{this.#n({type:"pending",variables:r,isPaused:i}),this.#r.config.onMutate&&await this.#r.config.onMutate(r,this,t);let a=await this.options.onMutate?.(r,t);a!==this.state.context&&this.#n({type:"pending",context:a,variables:r,isPaused:i})}let n=await this.#s.start();return await this.#r.config.onSuccess?.(n,r,this.state.context,this,t),await this.options.onSuccess?.(n,r,this.state.context,t),await this.#r.config.onSettled?.(n,null,this.state.variables,this.state.context,this,t),await this.options.onSettled?.(n,null,r,this.state.context,t),this.#n({type:"success",data:n}),n}catch(n){try{await this.#r.config.onError?.(n,r,this.state.context,this,t)}catch(a){Promise.reject(a)}try{await this.options.onError?.(n,r,this.state.context,t)}catch(a){Promise.reject(a)}try{await this.#r.config.onSettled?.(void 0,n,this.state.variables,this.state.context,this,t)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,n,r,this.state.context,t)}catch(a){Promise.reject(a)}throw this.#n({type:"error",error:n}),n}finally{this.#r.runNext(this)}}#n(r){let e=o(t=>{switch(r.type){case"failed":return{...t,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...t,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:r.error,failureCount:t.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}},"reducer");this.state=e(this.state),g.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(r)}),this.#r.notify({mutation:this,type:"updated",action:r})})}};function es(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}o(es,"getDefaultState");var Bt=class extends D{static{o(this,"MutationCache")}constructor(r={}){super(),this.config=r,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(r,e,t){let s=new Kt({client:r,mutationCache:this,mutationId:++this.#r,options:r.defaultMutationOptions(e),state:t});return this.add(s),s}add(r){this.#e.add(r);let e=Pe(r);if(typeof e=="string"){let t=this.#t.get(e);t?t.push(r):this.#t.set(e,[r])}this.notify({type:"added",mutation:r})}remove(r){if(this.#e.delete(r)){let e=Pe(r);if(typeof e=="string"){let t=this.#t.get(e);if(t)if(t.length>1){let s=t.indexOf(r);s!==-1&&t.splice(s,1)}else t[0]===r&&this.#t.delete(e)}}this.notify({type:"removed",mutation:r})}canRun(r){let e=Pe(r);if(typeof e=="string"){let s=this.#t.get(e)?.find(i=>i.state.status==="pending");return!s||s===r}else return!0}runNext(r){let e=Pe(r);return typeof e=="string"?this.#t.get(e)?.find(s=>s!==r&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){g.batch(()=>{this.#e.forEach(r=>{this.notify({type:"removed",mutation:r})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(r){let e={exact:!0,...r};return this.getAll().find(t=>Ce(e,t))}findAll(r={}){return this.getAll().filter(e=>Ce(r,e))}notify(r){g.batch(()=>{this.listeners.forEach(e=>{e(r)})})}resumePausedMutations(){let r=this.getAll().filter(e=>e.state.isPaused);return g.batch(()=>Promise.all(r.map(e=>e.continue().catch(w))))}};function Pe(r){return r.options.scope?.id}o(Pe,"scopeFor");var jt=class extends D{static{o(this,"QueryCache")}constructor(r={}){super(),this.config=r,this.#e=new Map}#e;build(r,e,t){let s=e.queryKey,i=e.queryHash??he(s,e),n=this.get(i);return n||(n=new Ut({client:r,queryKey:s,queryHash:i,options:r.defaultQueryOptions(e),state:t,defaultOptions:r.getQueryDefaults(s)}),this.add(n)),n}add(r){this.#e.has(r.queryHash)||(this.#e.set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){let e=this.#e.get(r.queryHash);e&&(r.destroy(),e===r&&this.#e.delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){g.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return this.#e.get(r)}getAll(){return[...this.#e.values()]}find(r){let e={exact:!0,...r};return this.getAll().find(t=>we(e,t))}findAll(r={}){let e=this.getAll();return Object.keys(r).length>0?e.filter(t=>we(r,t)):e}notify(r){g.batch(()=>{this.listeners.forEach(e=>{e(r)})})}onFocus(){g.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){g.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}};var Xe=class{static{o(this,"QueryClient")}#e;#t;#r;#s;#n;#i;#o;#a;constructor(r={}){this.#e=r.queryCache||new jt,this.#t=r.mutationCache||new Bt,this.#r=r.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=re.subscribe(async r=>{r&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=ie.subscribe(async r=>{r&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(r){return this.#e.findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return this.#t.findAll({...r,status:"pending"}).length}getQueryData(r){let e=this.defaultQueryOptions({queryKey:r});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(r){let e=this.defaultQueryOptions(r),t=this.#e.build(this,e),s=t.state.data;return s===void 0?this.fetchQuery(r):(r.revalidateIfStale&&t.isStaleByTime(L(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(r){return this.#e.findAll(r).map(({queryKey:e,state:t})=>{let s=t.data;return[e,s]})}setQueryData(r,e,t){let s=this.defaultQueryOptions({queryKey:r}),n=this.#e.get(s.queryHash)?.state.data,a=Rt(e,n);if(a!==void 0)return this.#e.build(this,s).setData(a,{...t,manual:!0})}setQueriesData(r,e,t){return g.batch(()=>this.#e.findAll(r).map(({queryKey:s})=>[s,this.setQueryData(s,e,t)]))}getQueryState(r){let e=this.defaultQueryOptions({queryKey:r});return this.#e.get(e.queryHash)?.state}removeQueries(r){let e=this.#e;g.batch(()=>{e.findAll(r).forEach(t=>{e.remove(t)})})}resetQueries(r,e){let t=this.#e;return g.batch(()=>(t.findAll(r).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...r},e)))}cancelQueries(r,e={}){let t={revert:!0,...e},s=g.batch(()=>this.#e.findAll(r).map(i=>i.cancel(t)));return Promise.all(s).then(w).catch(w)}invalidateQueries(r,e={}){return g.batch(()=>(this.#e.findAll(r).forEach(t=>{t.invalidate()}),r?.refetchType==="none"?Promise.resolve():this.refetchQueries({...r,type:r?.refetchType??r?.type??"active"},e)))}refetchQueries(r,e={}){let t={...e,cancelRefetch:e.cancelRefetch??!0},s=g.batch(()=>this.#e.findAll(r).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let n=i.fetch(void 0,t);return t.throwOnError||(n=n.catch(w)),i.state.fetchStatus==="paused"?Promise.resolve():n}));return Promise.all(s).then(w)}fetchQuery(r){let e=this.defaultQueryOptions(r);e.retry===void 0&&(e.retry=!1);let t=this.#e.build(this,e);return t.isStaleByTime(L(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(w).catch(w)}fetchInfiniteQuery(r){return r._type="infinite",this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(w).catch(w)}ensureInfiniteQueryData(r){return r._type="infinite",this.ensureQueryData(r)}resumePausedMutations(){return ie.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(r){this.#r=r}setQueryDefaults(r,e){this.#s.set(X(r),{queryKey:r,defaultOptions:e})}getQueryDefaults(r){let e=[...this.#s.values()],t={};return e.forEach(s=>{j(r,s.queryKey)&&Object.assign(t,s.defaultOptions)}),t}setMutationDefaults(r,e){this.#n.set(X(r),{mutationKey:r,defaultOptions:e})}getMutationDefaults(r){let e=[...this.#n.values()],t={};return e.forEach(s=>{j(r,s.mutationKey)&&Object.assign(t,s.defaultOptions)}),t}defaultQueryOptions(r){if(r._defaulted)return r;let e={...this.#r.queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return e.queryHash||(e.queryHash=he(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===se&&(e.enabled=!1),e}defaultMutationOptions(r){return r?._defaulted?r:{...this.#r.mutations,...r?.mutationKey&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};var $=M(J(),1);var ne=M(J(),1),$t=M(Be(),1);var fe=ne.createContext(void 0),Ye=o(r=>{let e=ne.useContext(fe);if(r)return r;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},"useQueryClient"),Ze=o(({client:r,children:e})=>(ne.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),(0,$t.jsx)(fe.Provider,{value:r,children:e})),"QueryClientProvider");var pe=M(J(),1),ts=M(Be(),1);function rs(){let r=!1;return{clearReset:o(()=>{r=!1},"clearReset"),reset:o(()=>{r=!0},"reset"),isReset:o(()=>r,"isReset")}}o(rs,"createValue");var ss=pe.createContext(rs()),Ht=o(()=>pe.useContext(ss),"useQueryErrorResetBoundary");var zt=M(J(),1);var Wt=o((r,e,t)=>{let s=t?.state.error&&typeof r.throwOnError=="function"?Ee(r.throwOnError,[t.state.error,t]):r.throwOnError;(r.suspense||r.experimental_prefetchInRender||s)&&(e.isReset()||(r.retryOnMount=!1))},"ensurePreventErrorBoundaryRetry"),Vt=o(r=>{zt.useEffect(()=>{r.clearReset()},[r])},"useClearResetErrorBoundary"),Gt=o(({result:r,errorResetBoundary:e,throwOnError:t,query:s,suspense:i})=>r.isError&&!e.isReset()&&!r.isFetching&&s&&(i&&r.data===void 0||Ee(t,[r.error,s])),"getHasError");var Ae=M(J(),1);var Jt=Ae.createContext(!1),Xt=o(()=>Ae.useContext(Jt),"useIsRestoring"),go=Jt.Provider;var Yt=o(r=>{if(r.suspense){let t=o(i=>i==="static"?i:Math.max(i??1e3,1e3),"clamp"),s=r.staleTime;r.staleTime=typeof s=="function"?(...i)=>t(s(...i)):t(s),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},"ensureSuspenseTimers"),Zt=o((r,e)=>r.isLoading&&r.isFetching&&!e,"willFetch"),er=o((r,e)=>r?.suspense&&e.isPending,"shouldSuspend"),et=o((r,e,t)=>e.fetchOptimistic(r).catch(()=>{t.clearReset()}),"fetchOptimistic");function tr(r,e,t){let s=Xt(),i=Ht(),n=Ye(t),a=n.defaultQueryOptions(r);n.getDefaultOptions().queries?._experimental_beforeQuery?.(a);let c=n.getQueryCache().get(a.queryHash),u=r.subscribed!==!1;a._optimisticResults=s?"isRestoring":u?"optimistic":void 0,Yt(a),Wt(a,i,c),Vt(i);let h=!n.getQueryCache().get(a.queryHash),[d]=$.useState(()=>new e(n,a)),l=d.getOptimisticResult(a),f=!s&&u;if($.useSyncExternalStore($.useCallback(y=>{let p=f?d.subscribe(g.batchCalls(y)):w;return d.updateResult(),p},[d,f]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setOptions(a)},[a,d]),er(a,l))throw et(a,d,i);if(Gt({result:l,errorResetBoundary:i,throwOnError:a.throwOnError,query:c,suspense:a.suspense}))throw l.error;return n.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!q.isServer()&&Zt(l,s)&&(h?et(a,d,i):c?.promise)?.catch(w).finally(()=>{d.updateResult()}),a.notifyOnChangeProps?l:d.trackResult(l)}o(tr,"useBaseQuery");function is(r,e){return tr(r,Ge,e)}o(is,"useQuery");var rr=M(Tt(),1);var Y=M(J(),1),tt=M(Be(),1);var sr=(0,Y.createContext)(null),ns=o(()=>new Xe({defaultOptions:{mutations:{retry:0},queries:{gcTime:5*6e4,retry:0,staleTime:Number.POSITIVE_INFINITY}}}),"Q"),as=o(r=>{let e=(0,rr.c)(9),{children:t,client:s,queryClient:i}=r,n=(0,Y.use)(fe),a;e[0]!==n||e[1]!==i?(a=o(()=>i??n??ns(),"o"),e[0]=n,e[1]=i,e[2]=a):a=e[2];let[c]=(0,Y.useState)(a),u=i??n??c,h;e[3]!==t||e[4]!==s?(h=(0,tt.jsx)(sr,{value:s,children:t}),e[3]=t,e[4]=s,e[5]=h):h=e[5];let d=h;if(n===u)return d;let l;return e[6]!==d||e[7]!==u?(l=(0,tt.jsx)(Ze,{client:u,children:d}),e[6]=d,e[7]=u,e[8]=l):l=e[8],l},"b"),rt=o(()=>{let r=(0,Y.use)(sr);if(!r)throw new m("INTERNAL","useLunora must be used inside <LunoraProvider />");return r},"q");var Fe=o(r=>{let e="";for(let t=0;t<r.length;t+=32768)e+=String.fromCharCode(...r.subarray(t,t+32768));return btoa(e)},"m"),os=o(r=>{let e=atob(r),t=new Uint8Array(e.length);for(let s=0;s<e.length;s+=1)t[s]=e.codePointAt(s)??0;return t},"A"),E="$lunora.wire$",Me="__proto__",ir={BigInt64Array,BigUint64Array,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array},nr={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},st=o(r=>{if(r===null||typeof r!="object")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype},"l"),O=o((r,e=0)=>{if(e>64)throw new RangeError("wire-codec: value nesting exceeds the 64-level limit");if(r===void 0)return[E,"undefined"];if(r===null)return null;let t=typeof r;if(t==="bigint")return[E,"bigint",r.toString()];if(t==="number"){let n=r;return Number.isNaN(n)?[E,"nan"]:n===1/0?[E,"inf"]:n===-1/0?[E,"-inf"]:n}if(t!=="object")return r;if(r instanceof Date)return[E,"date",O(r.getTime(),e+1)];if(r instanceof Error){let n=r,a={};for(let u of Object.keys(n)){if(n[u]===void 0)continue;let h=O(n[u],e+1);u===Me?Object.defineProperty(a,u,{configurable:!0,enumerable:!0,value:h,writable:!0}):a[u]=h}let c=[E,"error",String(n.name),String(n.message),a];return n.cause!==void 0&&c.push(O(n.cause,e+1)),c}if(r instanceof URL)return[E,"url",r.href];if(r instanceof Map)return[E,"map",[...r.entries()].map(([n,a])=>[O(n,e+1),O(a,e+1)])];if(r instanceof Set)return[E,"set",[...r].map(n=>O(n,e+1))];if(r instanceof ArrayBuffer)return[E,"bytes",Fe(new Uint8Array(r)),"ArrayBuffer"];if(ArrayBuffer.isView(r)){let n=r,a=n.constructor.name,c=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);return a==="Uint8Array"?[E,"bytes",Fe(c)]:[E,"bytes",Fe(c),a]}if(Array.isArray(r)){let n=r.map(a=>O(a,e+1));return n.length>0&&n[0]===E?[E,"arr",n]:n}if(!st(r)){let n=r.constructor?.name??"value";throw new TypeError(`wire-codec: cannot encode a ${n} over the Lunora wire \u2014 only plain objects, arrays, and the supported built-ins (Date, Error, URL, Map, Set, ArrayBuffer/typed arrays, bigint) round-trip`)}let s=r,i={};for(let n of Object.keys(s)){let a=s[n];if(a===void 0)continue;let c=O(a,e+1);n===Me?Object.defineProperty(i,n,{configurable:!0,enumerable:!0,value:c,writable:!0}):i[n]=c}return i},"b"),S=o((r,e=0)=>{if(e>64)throw new RangeError("wire-codec: value nesting exceeds the 64-level limit");if(r===null||typeof r!="object")return r;if(Array.isArray(r)){if(r[0]===E)switch(r[1]){case"-inf":return-1/0;case"arr":return r[2].map(i=>S(i,e+1));case"bigint":{let i=r[2];if(typeof i!="string"||i.length>1024||!/^-?\d+$/.test(i))throw new RangeError("wire-codec: invalid or over-long bigint (max 1024 digits)");return BigInt(i)}case"date":{let i=S(r[2],e+1);if(typeof i!="number")throw new TypeError("wire-codec: malformed date \u2014 epoch must be a number");return new Date(i)}case"map":{let i=r[2];return new Map(i.map(n=>{if(!Array.isArray(n)||n.length!==2)throw new TypeError("wire-codec: malformed map entry \u2014 expected a [key, value] pair");return[S(n[0],e+1),S(n[1],e+1)]}))}case"set":return new Set(r[2].map(i=>S(i,e+1)));case"url":{let i=r[2];if(typeof i!="string")throw new TypeError("wire-codec: malformed url \u2014 href must be a string");return new URL(i)}case"error":{let i=r[2],n=r[3];if(typeof i!="string"||typeof n!="string")throw new TypeError("wire-codec: malformed error \u2014 name and message must be strings");let a=(Object.hasOwn(nr,i)?nr[i]:void 0)??Error,c=new a(n);c.name!==i&&Object.defineProperty(c,"name",{configurable:!0,value:i,writable:!0});let u=S(r[4],e+1);if(u===null||typeof u!="object"||Array.isArray(u))throw new TypeError("wire-codec: malformed error \u2014 props must be an object");for(let h of Object.keys(u))h===Me?Object.defineProperty(c,h,{configurable:!0,enumerable:!0,value:u[h],writable:!0}):c[h]=u[h];return r.length>5&&Object.defineProperty(c,"cause",{configurable:!0,value:S(r[5],e+1),writable:!0}),c}case"bytes":{let i=r[2];if(typeof i!="string")throw new TypeError("wire-codec: malformed bytes \u2014 payload must be a base64 string");let n=os(i);if(Fe(n)!==i)throw new TypeError("wire-codec: malformed bytes \u2014 payload must be canonical padded base64");let a=r[3]??"Uint8Array";if(a==="ArrayBuffer")return n.buffer.byteLength===n.byteLength?n.buffer:n.slice().buffer;let c=Object.hasOwn(ir,a)?ir[a]:void 0;return c?new c(n.slice().buffer):n}case"inf":return 1/0;case"nan":return Number.NaN;case"undefined":return;default:return r.map(i=>S(i,e+1))}return r.map(i=>S(i,e+1))}let t=r,s={};for(let i of Object.keys(t)){let n=S(t[i],e+1);i===Me?Object.defineProperty(s,i,{configurable:!0,enumerable:!0,value:n,writable:!0}):s[i]=n}return s},"y");var P=o(r=>new Promise((e,t)=>{r.addEventListener("success",()=>{e(r.result)}),r.addEventListener("error",()=>{t(r.error??new Error("IndexedDB request failed"))})}),"c"),xe=o((r,e,t,s)=>{let i;return()=>i||(i=new Promise((n,a)=>{let c=r.open(e,t);c.addEventListener("upgradeneeded",()=>{s(c.result)}),c.addEventListener("success",()=>{n(c.result)}),c.addEventListener("error",()=>{a(c.error??new Error("IndexedDB open failed"))})}),i)},"E"),Qe=o((r,e)=>async(t,s)=>{let i=(await r()).transaction(e,t),n=await s(i.objectStore(e));return await new Promise((a,c)=>{i.addEventListener("complete",()=>{a()}),i.addEventListener("error",()=>{c(i.error??new Error("IndexedDB transaction failed"))}),i.addEventListener("abort",()=>{c(i.error??new Error("IndexedDB transaction aborted"))})}),n},"u");var Z=o((r,e,t)=>`${r}::${e}::${t??""}`,"T"),cs=500,us=o((r,e)=>{if(!Number.isInteger(r)||r<1)throw new m("INTERNAL",`${e}: maxEntries must be a positive integer, got ${String(r)}`);return r},"E");var hs="lunora-query-cache",ds="query-cache",ar="by_ts",ls=1,fs=o((r={})=>{let e=r.indexedDB??(typeof indexedDB>"u"?void 0:indexedDB);if(!e)throw new m("INTERNAL","createIndexedDbQueryCache: no IndexedDB available \u2014 pass `indexedDB` or use createInMemoryQueryCache()");let t=r.databaseName??hs,s=r.storeName??ds,i=us(r.maxEntries??cs,"createIndexedDbQueryCache"),n=xe(e,t,ls,u=>{u.objectStoreNames.contains(s)||u.createObjectStore(s,{keyPath:"key"}).createIndex(ar,"ts",{unique:!1})}),a=Qe(n,s),c=o(async u=>{let h=await P(u.count())-i;h<=0||await new Promise((d,l)=>{let f=u.index(ar).openCursor();f.addEventListener("success",()=>{let y=f.result;if(!y||h<=0){d();return}y.delete(),h-=1,y.continue()}),f.addEventListener("error",()=>{l(f.error??new Error("IndexedDB eviction failed"))})})},"y");return{clear:o(async()=>{await a("readwrite",u=>P(u.clear()))},"clear"),load:o(async()=>a("readonly",u=>P(u.getAll())),"load"),put:o(async(u,h)=>{await a("readwrite",async d=>{await P(d.put({...h,key:u})),await c(d)})},"put"),remove:o(async u=>{await a("readwrite",h=>P(h.delete(u)))},"remove")}},"N"),or=o(r=>{if(r!==!1){if(r)return r;if(!(typeof indexedDB>"u"))return fs()}},"L");var cr=o(()=>{let r=null;return{get:o(()=>r,"get"),set:o(e=>{r=e},"set")}},"r");var _e=class{static{o(this,"u")}values=new Map;subscribers=new Map;get(e){return this.values.has(e.key)?this.values.get(e.key):e.defaultValue}set(e,t){if(t===void 0){this.reset(e);return}this.values.set(e.key,t),this.notify(e.key,t)}reset(e){this.values.delete(e.key),this.notify(e.key,e.defaultValue)}clear(){this.values.clear(),this.subscribers.clear()}subscribe(e,t){let s=this.subscribers.get(e.key);return s||(s=new Set,this.subscribers.set(e.key,s)),s.add(t),()=>{s.delete(t),s.size===0&&this.subscribers.delete(e.key)}}notify(e,t){let s=this.subscribers.get(e);if(s)for(let i of s)try{i(t)}catch{}}};var ur=0,ps="lunora-bridge",ms=1e3,ys=3e3,Le=class{static{o(this,"l")}bc;tabId;heartbeatInterval;leaderTimeout;knownLeader=void 0;leader=!1;running=!1;promotionPending=!1;lastHeartbeat=0;heartbeatTimer=void 0;leaderCheckTimer=void 0;onBecomeLeader;onStopBeingLeader;onConnectionStatus;onSubscriptionData;onLeaderClaimAnswered;onSubscriptionError;onSubscriptionSettled;constructor(e={}){if(ur+=1,this.tabId=`tab_${String(ur)}_${crypto.randomUUID()}`,this.heartbeatInterval=e.heartbeatInterval??ms,this.leaderTimeout=e.leaderTimeout??ys,this.onBecomeLeader=e.onBecomeLeader,this.onStopBeingLeader=e.onStopBeingLeader,this.onConnectionStatus=e.onConnectionStatus,this.onSubscriptionData=e.onSubscriptionData,this.onLeaderClaimAnswered=e.onLeaderClaimAnswered,this.onSubscriptionError=e.onSubscriptionError,this.onSubscriptionSettled=e.onSubscriptionSettled,typeof BroadcastChannel>"u"){this.bc=void 0;return}this.bc=new BroadcastChannel(e.channelName??ps),this.bc.addEventListener("message",t=>{this.handleMessage(t.data)})}start(){if(!this.running){if(this.running=!0,this.bc===void 0){this.becomeLeader();return}this.broadcast({type:"claim-leadership",tabId:this.tabId,ts:Date.now()}),setTimeout(()=>{this.running&&this.knownLeader===void 0&&this.becomeLeader()},this.leaderTimeout),this.leaderCheckTimer=setInterval(()=>{this.checkLeaderHealth()},this.leaderTimeout),this.heartbeatTimer=setInterval(()=>{this.sendHeartbeat()},this.heartbeatInterval)}}stop(){this.running=!1,this.leader&&(this.broadcast({type:"yield-leadership",tabId:this.tabId}),this.leader=!1,this.knownLeader=void 0,this.onStopBeingLeader?.()),this.heartbeatTimer!==void 0&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0),this.leaderCheckTimer!==void 0&&(clearInterval(this.leaderCheckTimer),this.leaderCheckTimer=void 0),this.bc?.close()}isLeader(){return this.leader}promoteImmediately(){this.running&&this.becomeLeader()}get leaderTabId(){return this.knownLeader}get id(){return this.tabId}get isRunning(){return this.running}broadcastSubscriptionData(e,t,s,i,n){this.leader&&this.broadcast({type:"subscription-data",tabId:this.tabId,key:e,data:t,...s===void 0?{}:{cursor:s},...i===void 0?{}:{epoch:i},...n===void 0?{}:{identity:n}})}broadcastSubscriptionError(e,t,s){this.leader&&this.broadcast({type:"subscription-error",tabId:this.tabId,key:e,error:t,...s===void 0?{}:{identity:s}})}broadcastSubscriptionSettled(e,t,s,i,n,a){this.leader&&this.broadcast({type:"subscription-settled",tabId:this.tabId,key:e,...t===void 0?{}:{cursor:t},...s===void 0?{}:{epoch:s},...i===void 0?{}:{lastMutationId:i},...n===void 0?{}:{clientId:n},...a===void 0?{}:{identity:a}})}broadcastConnectionStatus(e,t){this.leader&&this.broadcast({type:"connection-status",tabId:this.tabId,status:e,...t===void 0?{}:{identity:t}})}broadcast(e){this.bc?.postMessage(e)}handleMessage(e){switch(e.type){case"claim-leadership":{this.handleClaimLeadership(e);break}case"connection-status":{if(this.leader||e.tabId===this.tabId)break;this.onConnectionStatus?.(e.status,e.identity);break}case"heartbeat":{this.handleHeartbeat(e);break}case"subscription-data":{if(this.leader||e.tabId===this.tabId)break;this.onSubscriptionData?.(e.key,e.data,e.cursor,e.epoch,e.identity);break}case"subscription-error":{if(this.leader||e.tabId===this.tabId)break;this.onSubscriptionError?.(e.key,e.error,e.identity);break}case"subscription-settled":{if(this.leader||e.tabId===this.tabId)break;this.onSubscriptionSettled?.(e.key,e.cursor,e.epoch,e.lastMutationId,e.clientId,e.identity);break}case"yield-leadership":{this.knownLeader===e.tabId&&(this.knownLeader=void 0,this.running&&!this.leader&&this.claimAndPromote());break}}}handleClaimLeadership(e){if(e.tabId!==this.tabId){if(this.leader){this.broadcast({type:"heartbeat",tabId:this.tabId,ts:Date.now()}),this.onLeaderClaimAnswered?.();return}this.knownLeader===void 0&&e.tabId<this.tabId&&(this.knownLeader=e.tabId,this.lastHeartbeat=e.ts)}}handleHeartbeat(e){if(e.tabId!==this.tabId){if(this.leader){this.resolveLeaderVsLeaderTieBreak(e);return}this.lastHeartbeat=e.ts,this.knownLeader=e.tabId}}resolveLeaderVsLeaderTieBreak(e){e.tabId<this.tabId?(this.leader=!1,this.knownLeader=e.tabId,this.lastHeartbeat=e.ts,this.onStopBeingLeader?.()):this.broadcast({type:"heartbeat",tabId:this.tabId,ts:Date.now()})}becomeLeader(){this.leader||(this.leader=!0,this.knownLeader=this.tabId,this.lastHeartbeat=Date.now(),this.onBecomeLeader?.(),this.broadcast({type:"heartbeat",tabId:this.tabId,ts:Date.now()}))}sendHeartbeat(){this.leader&&this.broadcast({type:"heartbeat",tabId:this.tabId,ts:Date.now()})}checkLeaderHealth(){if(!(!this.running||this.leader)){if(this.knownLeader===void 0){this.claimAndPromote();return}Date.now()-this.lastHeartbeat>this.leaderTimeout&&(this.knownLeader=void 0,this.claimAndPromote())}}claimAndPromote(){this.promotionPending||(this.promotionPending=!0,this.broadcast({type:"claim-leadership",tabId:this.tabId,ts:Date.now()}),setTimeout(()=>{this.promotionPending=!1,this.running&&this.knownLeader===void 0&&this.becomeLeader()},this.leaderTimeout))}};var it="_id",nt="_creationTime",at="page",hr="pageDelta",bs=o(r=>{if(Array.isArray(r))return r;if(st(r)&&Array.isArray(r[at]))return r[at]},"y"),vs=o(r=>{let e;for(let t of r){let s=t[nt];if(typeof s=="number"){if(e!==void 0){if(s<e)return!0;if(s>e)return!1}e=s}}return!1},"l"),gs=o((r,e)=>{let t=e[nt];if(typeof t!="number")return r.length;let s=vs(r);for(let[i,n]of r.entries()){let a=n[nt];if(typeof a=="number"&&(s?a<t:a>t))return i}return r.length},"x"),Ss=o(r=>{if(typeof r!="object"||r===null)return;let e=r[it];return typeof e=="string"?e:void 0},"A"),dr=o(r=>{if(typeof r!="object"||r===null)return!1;let e=r;return typeof e.key=="string"&&typeof e.table=="string"&&(e.op==="insert"||e.op==="update"||e.op==="delete")},"b"),ws=o((r,e)=>{let t=[];for(let u of r){if(Ss(u)===void 0)return;t.push(u)}let{key:s,op:i,row:n}=e;if(i==="delete"){let u=t.filter(h=>h[it]!==s);return u.length===t.length?[...t]:u}if(n===void 0)return;let a=[...t],c=t.findIndex(u=>u[it]===s);return c===-1?a.splice(gs(t,n),0,n):a[c]=n,a},"I"),lr=o((r,e)=>{let t=bs(r);if(t===void 0)return;let s=ws(t,e);return s===void 0||Array.isArray(r)?s:{...r,[at]:s}},"E");var uc=new Set(Object.keys(kt)),N=class extends m{static{o(this,"E")}constructor(e,t){super("INTERNAL",e,{data:t})}};var ot=o(r=>{let e=r?.data?.retryAfterMs;return typeof e=="number"&&Number.isFinite(e)?e:void 0},"u");var Cs=1024,De=o(r=>{let e=r.maxBuffer??Cs,t=[],s=[],i=!1,n,a=!1,c=o(()=>{let d=s.shift();if(!d)return!1;if(n)return d.reject(n),!0;if(t.length>0){let l=t.shift();return d.resolve({done:!1,value:l}),!0}return i?(d.resolve({done:!0,value:void 0}),!0):(s.unshift(d),!1)},"u"),u={complete(){if(!(i||n))for(i=!0;c(););},fail(d){if(!(i||n))for(n=d,t.length=0;c(););},push(d){if(!(i||n||a)){if(t.length>=e){u.fail(new m("STREAM_BACKPRESSURE",`stream buffer overflow (max=${e.toString()}); the consumer cannot keep up with the producer`));return}t.push(d),c()}}},h=o(()=>{if(!a){a=!0,i=!0,t.length=0;try{r.onCancel()}catch{}for(;c(););}},"c");return{handle:u,iterable:{cancel:h,[Symbol.asyncIterator](){return{next(){if(n)return Promise.reject(n);if(t.length>0){let d=t.shift();return Promise.resolve({done:!1,value:d})}return i?Promise.resolve({done:!0,value:void 0}):new Promise((d,l)=>{s.push({reject:l,resolve:d})})},return(){return h(),Promise.resolve({done:!0,value:void 0})}}}}}},"p");var fr=/^ /u,pr=o(r=>typeof r=="object"&&r!==null?JSON.stringify(r):String(r),"p"),ks=o(r=>{let e="",t=[];for(let s of r.split(`
|
|
1
|
+
import{a as kt,d as m}from"./chunk-UEOWRXJ3.js";import{a as o,d as M,e as J,f as Tt,g as Be}from"./chunk-YKXDMIHQ.js";var D=class{static{o(this,"Subscribable")}constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var jr=class extends D{static{o(this,"FocusManager")}#e;#t;#r;constructor(){super(),this.#r=r=>{if(typeof window<"u"&&window.addEventListener){let e=o(()=>r(),"listener");return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(r){this.#r=r,this.#t?.(),this.#t=r(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(r){this.#e!==r&&(this.#e=r,this.onFocus())}onFocus(){let r=this.isFocused();this.listeners.forEach(e=>{e(r)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},re=new jr;var $r={setTimeout:o((r,e)=>setTimeout(r,e),"setTimeout"),clearTimeout:o(r=>clearTimeout(r),"clearTimeout"),setInterval:o((r,e)=>setInterval(r,e),"setInterval"),clearInterval:o(r=>clearInterval(r),"clearInterval")},Hr=class{static{o(this,"TimeoutManager")}#e=$r;#t=!1;setTimeoutProvider(r){this.#e=r}setTimeout(r,e){return this.#e.setTimeout(r,e)}clearTimeout(r){this.#e.clearTimeout(r)}setInterval(r,e){return this.#e.setInterval(r,e)}clearInterval(r){this.#e.clearInterval(r)}},U=new Hr;function Et(r){setTimeout(r,0)}o(Et,"systemSetTimeoutZero");var $e=typeof window>"u"||"Deno"in globalThis;function w(){}o(w,"noop");function Rt(r,e){return typeof r=="function"?r(e):r}o(Rt,"functionalUpdate");function ue(r){return typeof r=="number"&&r>=0&&r!==1/0}o(ue,"isValidTimeout");function Se(r,e){return Math.max(r+(e||0)-Date.now(),0)}o(Se,"timeUntilStale");function L(r,e){return typeof r=="function"?r(e):r}o(L,"resolveStaleTime");function I(r,e){return typeof r=="function"?r(e):r}o(I,"resolveQueryBoolean");function we(r,e){let{type:t="all",exact:s,fetchStatus:i,predicate:n,queryKey:a,stale:c}=r;if(a){if(s){if(e.queryHash!==he(a,e.options))return!1}else if(!j(e.queryKey,a))return!1}if(t!=="all"){let u=e.isActive();if(t==="active"&&!u||t==="inactive"&&u)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||i&&i!==e.state.fetchStatus||n&&!n(e))}o(we,"matchQuery");function Ce(r,e){let{exact:t,status:s,predicate:i,mutationKey:n}=r;if(n){if(!e.options.mutationKey)return!1;if(t){if(X(e.options.mutationKey)!==X(n))return!1}else if(!j(e.options.mutationKey,n))return!1}return!(s&&e.state.status!==s||i&&!i(e))}o(Ce,"matchMutation");function he(r,e){return(e?.queryKeyHashFn||X)(r)}o(he,"hashQueryKeyByOptions");function X(r){return JSON.stringify(r,(e,t)=>je(t)?Object.keys(t).sort().reduce((s,i)=>(s[i]=t[i],s),{}):t)}o(X,"hashKey");function j(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(r&&e&&typeof r=="object"&&typeof e=="object"){if(Array.isArray(r)&&Array.isArray(e)){for(let s=0;s<e.length;s++)if(!j(r[s],e[s]))return!1;return!0}let t=Object.keys(e);for(let s of t)if(!j(r[s],e[s]))return!1;return!0}return!1}o(j,"partialMatchKey");var zr=Object.prototype.hasOwnProperty;function He(r,e,t=0){if(r===e)return r;if(t>500)return e;let s=It(r)&&It(e);if(!s&&!(je(r)&&je(e)))return e;let n=(s?r:Object.keys(r)).length,a=s?e:Object.keys(e),c=a.length,u=s?new Array(c):{},h=0;for(let d=0;d<c;d++){let l=s?d:a[d],f=r[l],y=e[l];if(f===y){u[l]=f,(s?d<n:zr.call(r,l))&&h++;continue}if(f===null||y===null||typeof f!="object"||typeof y!="object"){u[l]=y;continue}let p=He(f,y,t+1);u[l]=p,p===f&&h++}return n===c&&h===n?r:u}o(He,"replaceEqualDeep");function ke(r,e){if(!e||Object.keys(r).length!==Object.keys(e).length)return!1;for(let t in r)if(r[t]!==e[t])return!1;return!0}o(ke,"shallowEqualObjects");function It(r){return Array.isArray(r)&&r.length===Object.keys(r).length}o(It,"isPlainArray");function je(r){if(!Ot(r))return!1;let e=r.constructor;if(e===void 0)return!0;let t=e.prototype;return!(!Ot(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(r)!==Object.prototype)}o(je,"isPlainObject");function Ot(r){return Object.prototype.toString.call(r)==="[object Object]"}o(Ot,"hasObjectPrototype");function Pt(r){return new Promise(e=>{U.setTimeout(e,r)})}o(Pt,"sleep");function de(r,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(r,e):t.structuralSharing!==!1?He(r,e):e}o(de,"replaceData");function Wr(r){return r}o(Wr,"keepPreviousData");function At(r,e,t=0){let s=[...r,e];return t&&s.length>t?s.slice(1):s}o(At,"addToEnd");function Ft(r,e,t=0){let s=[e,...r];return t&&s.length>t?s.slice(0,-1):s}o(Ft,"addToStart");var se=Symbol();function Te(r,e){return!r.queryFn&&e?.initialPromise?()=>e.initialPromise:!r.queryFn||r.queryFn===se?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}o(Te,"ensureQueryFn");function Ee(r,e){return typeof r=="function"?r(...e):!!r}o(Ee,"shouldThrowError");function Mt(r,e,t){let s=!1,i;return Object.defineProperty(r,"signal",{enumerable:!0,get:o(()=>(i??=e(),s||(s=!0,i.aborted?t():i.addEventListener("abort",t,{once:!0})),i),"get")}),r}o(Mt,"addConsumeAwareSignal");var q=(()=>{let r=o(()=>$e,"isServerFn");return{isServer(){return r()},setIsServer(e){r=e}}})();function le(){let r,e,t=new Promise((i,n)=>{r=i,e=n});t.status="pending",t.catch(()=>{});function s(i){Object.assign(t,i),delete t.resolve,delete t.reject}return o(s,"finalize"),t.resolve=i=>{s({status:"fulfilled",value:i}),r(i)},t.reject=i=>{s({status:"rejected",reason:i}),e(i)},t}o(le,"pendingThenable");var xt=Et;function Vr(){let r=[],e=0,t=o(c=>{c()},"notifyFn"),s=o(c=>{c()},"batchNotifyFn"),i=xt,n=o(c=>{e?r.push(c):i(()=>{t(c)})},"schedule"),a=o(()=>{let c=r;r=[],c.length&&i(()=>{s(()=>{c.forEach(u=>{t(u)})})})},"flush");return{batch:o(c=>{let u;e++;try{u=c()}finally{e--,e||a()}return u},"batch"),batchCalls:o(c=>(...u)=>{n(()=>{c(...u)})},"batchCalls"),schedule:n,setNotifyFunction:o(c=>{t=c},"setNotifyFunction"),setBatchNotifyFunction:o(c=>{s=c},"setBatchNotifyFunction"),setScheduler:o(c=>{i=c},"setScheduler")}}o(Vr,"createNotifyManager");var g=Vr();var Gr=class extends D{static{o(this,"OnlineManager")}#e=!0;#t;#r;constructor(){super(),this.#r=r=>{if(typeof window<"u"&&window.addEventListener){let e=o(()=>r(!0),"onlineListener"),t=o(()=>r(!1),"offlineListener");return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(r){this.#r=r,this.#t?.(),this.#t=r(this.setOnline.bind(this))}setOnline(r){this.#e!==r&&(this.#e=r,this.listeners.forEach(t=>{t(r)}))}isOnline(){return this.#e}},ie=new Gr;function Jr(r){return Math.min(1e3*2**r,3e4)}o(Jr,"defaultRetryDelay");function ze(r){return(r??"online")==="online"?ie.isOnline():!0}o(ze,"canFetch");var Ie=class extends Error{static{o(this,"CancelledError")}constructor(r){super("CancelledError"),this.revert=r?.revert,this.silent=r?.silent}};function Oe(r){let e=!1,t=0,s,i=le(),n=o(()=>i.status!=="pending","isResolved"),a=o(b=>{if(!n()){let C=new Ie(b);f(C),r.onCancel?.(C)}},"cancel"),c=o(()=>{e=!0},"cancelRetry"),u=o(()=>{e=!1},"continueRetry"),h=o(()=>re.isFocused()&&(r.networkMode==="always"||ie.isOnline())&&r.canRun(),"canContinue"),d=o(()=>ze(r.networkMode)&&r.canRun(),"canStart"),l=o(b=>{n()||(s?.(),i.resolve(b))},"resolve"),f=o(b=>{n()||(s?.(),i.reject(b))},"reject"),y=o(()=>new Promise(b=>{s=o(C=>{(n()||h())&&b(C)},"continueFn"),r.onPause?.()}).then(()=>{s=void 0,n()||r.onContinue?.()}),"pause"),p=o(()=>{if(n())return;let b,C=t===0?r.initialPromise:void 0;try{b=C??r.fn()}catch(k){b=Promise.reject(k)}Promise.resolve(b).then(l).catch(k=>{if(n())return;let T=r.retry??(q.isServer()?0:3),Q=r.retryDelay??Jr,_=typeof Q=="function"?Q(t,k):Q,G=T===!0||typeof T=="number"&&t<T||typeof T=="function"&&T(t,k);if(e||!G){f(k);return}t++,r.onFail?.(t,k),Pt(_).then(()=>h()?void 0:y()).then(()=>{e?f(k):p()})})},"run");return{promise:i,status:o(()=>i.status,"status"),cancel:a,continue:o(()=>(s?.(),i),"continue"),cancelRetry:c,continueRetry:u,canStart:d,start:o(()=>(d()?p():y().then(p),i),"start")}}o(Oe,"createRetryer");var Re=class{static{o(this,"Removable")}#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ue(this.gcTime)&&(this.#e=U.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(q.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(U.clearTimeout(this.#e),this.#e=void 0)}};function _t(r){return{onFetch:o((e,t)=>{let s=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],a=e.state.data?.pageParams||[],c={pages:[],pageParams:[]},u=0,h=o(async()=>{let d=!1,l=o(p=>{Mt(p,()=>e.signal,()=>d=!0)},"addSignalProperty"),f=Te(e.options,e.fetchOptions),y=o(async(p,b,C)=>{if(d)return Promise.reject(e.signal.reason);if(b==null&&p.pages.length)return Promise.resolve(p);let T=o(()=>{let Ke={client:e.client,queryKey:e.queryKey,pageParam:b,direction:C?"backward":"forward",meta:e.options.meta};return l(Ke),Ke},"createQueryFnContext")(),Q=await f(T),{maxPages:_}=e.options,G=C?Ft:At;return{pages:G(p.pages,Q,_),pageParams:G(p.pageParams,b,_)}},"fetchPage");if(i&&n.length){let p=i==="backward",b=p?Xr:Qt,C={pages:n,pageParams:a},k=b(s,C);c=await y(C,k,p)}else{let p=r??n.length;do{let b=u===0?a[0]??s.initialPageParam:Qt(s,c);if(u>0&&b==null)break;c=await y(c,b),u++}while(u<p)}return c},"fetchFn");e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t):e.fetchFn=h},"onFetch")}}o(_t,"infiniteQueryBehavior");function Qt(r,{pages:e,pageParams:t}){let s=e.length-1;return e.length>0?r.getNextPageParam(e[s],e,t[s],t):void 0}o(Qt,"getNextPageParam");function Xr(r,{pages:e,pageParams:t}){return e.length>0?r.getPreviousPageParam?.(e[0],e,t[0],t):void 0}o(Xr,"getPreviousPageParam");var Ut=class extends Re{static{o(this,"Query")}#e;#t;#r;#s;#n;#i;#o;#a;constructor(r){super(),this.#a=!1,this.#o=r.defaultOptions,this.setOptions(r.options),this.observers=[],this.#n=r.client,this.#s=this.#n.getQueryCache(),this.queryKey=r.queryKey,this.queryHash=r.queryHash,this.#t=Dt(this.options),this.state=r.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(r){if(this.options={...this.#o,...r},r?._type&&(this.#e=r._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Dt(this.options);e.data!==void 0&&(this.setState(Lt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(r,e){let t=de(this.state.data,r,this.options);return this.#c({data:t,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),t}setState(r){this.#c({type:"setState",state:r})}cancel(r){let e=this.#i?.promise;return this.#i?.cancel(r),e?e.then(w).catch(w):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(r=>I(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===se||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>L(r.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){return this.state.data===void 0?!0:r==="static"?!1:this.state.isInvalidated?!0:!Se(this.state.dataUpdatedAt,r)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(e=>e!==r),this.observers.length||(this.#i&&(this.#a||this.#h()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}#h(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#c({type:"invalidate"})}async fetch(r,e){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(r&&this.setOptions(r),!this.options.queryFn){let u=this.observers.find(h=>h.options.queryFn);u&&this.setOptions(u.options)}let t=new AbortController,s=o(u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:o(()=>(this.#a=!0,t.signal),"get")})},"addSignalProperty"),i=o(()=>{let u=Te(this.options,e),d=o(()=>{let l={client:this.#n,queryKey:this.queryKey,meta:this.meta};return s(l),l},"createQueryFnContext")();return this.#a=!1,this.options.persister?this.options.persister(u,d,this):u(d)},"fetchFn"),a=o(()=>{let u={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#n,state:this.state,fetchFn:i};return s(u),u},"createFetchContext")();(this.#e==="infinite"?_t(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#r=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:"fetch",meta:a.fetchOptions?.meta}),this.#i=Oe({initialPromise:e?.initialPromise,fn:a.fetchFn,onCancel:o(u=>{u instanceof Ie&&u.revert&&this.setState({...this.#r,fetchStatus:"idle"}),t.abort()},"onCancel"),onFail:o((u,h)=>{this.#c({type:"failed",failureCount:u,error:h})},"onFail"),onPause:o(()=>{this.#c({type:"pause"})},"onPause"),onContinue:o(()=>{this.#c({type:"continue"})},"onContinue"),retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:o(()=>!0,"canRun")});try{let u=await this.#i.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#s.config.onSuccess?.(u,this),this.#s.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof Ie){if(u.silent)return this.#i.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#c({type:"error",error:u}),this.#s.config.onError?.(u,this),this.#s.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#c(r){let e=o(t=>{switch(r.type){case"failed":return{...t,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...We(t.data,this.options),fetchMeta:r.meta??null};case"success":let s={...t,...Lt(r.data,r.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#r=r.manual?s:void 0,s;case"error":let i=r.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...r.state}}},"reducer");this.state=e(this.state),g.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:r})})}};function We(r,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ze(e.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}o(We,"fetchState");function Lt(r,e){return{data:r,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}o(Lt,"successState");function Dt(r){let e=typeof r.initialData=="function"?r.initialData():r.initialData,t=e!==void 0,s=t?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}o(Dt,"getDefaultState");var Ge=class extends D{static{o(this,"QueryObserver")}constructor(r,e){super(),this.options=e,this.#e=r,this.#a=null,this.#o=le(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#r=void 0;#s=void 0;#n;#i;#o;#a;#h;#c;#p;#d;#l;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),qt(this.#t,this.options)?this.#f():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ve(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ve(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#w(),this.#t.removeObserver(this)}setOptions(r){let e=this.options,t=this.#t;if(this.options=this.#e.defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof I(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),e._defaulted&&!ke(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});let s=this.hasListeners();s&&Nt(this.#t,t,this.options,e)&&this.#f(),this.updateResult(),s&&(this.#t!==t||I(this.options.enabled,this.#t)!==I(e.enabled,this.#t)||L(this.options.staleTime,this.#t)!==L(e.staleTime,this.#t))&&this.#y();let i=this.#b();s&&(this.#t!==t||I(this.options.enabled,this.#t)!==I(e.enabled,this.#t)||i!==this.#u)&&this.#v(i)}getOptimisticResult(r){let e=this.#e.getQueryCache().build(this.#e,r),t=this.createResult(e,r);return Zr(this,t)&&(this.#s=t,this.#i=this.options,this.#n=this.#t.state),t}getCurrentResult(){return this.#s}trackResult(r,e){return new Proxy(r,{get:o((t,s)=>(this.trackProp(s),e?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,s)),"get")})}trackProp(r){this.#m.add(r)}getCurrentQuery(){return this.#t}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){let e=this.#e.defaultQueryOptions(r),t=this.#e.getQueryCache().build(this.#e,e);return t.fetch().then(()=>this.createResult(t,e))}fetch(r){return this.#f({...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#f(r){this.#C();let e=this.#t.fetch(this.options,r);return r?.throwOnError||(e=e.catch(w)),e}#y(){this.#S();let r=L(this.options.staleTime,this.#t);if(q.isServer()||this.#s.isStale||!ue(r))return;let t=Se(this.#s.dataUpdatedAt,r)+1;this.#d=U.setTimeout(()=>{this.#s.isStale||this.updateResult()},t)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(r){this.#w(),this.#u=r,!(q.isServer()||I(this.options.enabled,this.#t)===!1||!ue(this.#u)||this.#u===0)&&(this.#l=U.setInterval(()=>{(this.options.refetchIntervalInBackground||re.isFocused())&&this.#f()},this.#u))}#g(){this.#y(),this.#v(this.#b())}#S(){this.#d!==void 0&&(U.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#l!==void 0&&(U.clearInterval(this.#l),this.#l=void 0)}createResult(r,e){let t=this.#t,s=this.options,i=this.#s,n=this.#n,a=this.#i,u=r!==t?r.state:this.#r,{state:h}=r,d={...h},l=!1,f;if(e._optimisticResults){let F=this.hasListeners(),ce=!F&&qt(r,e),be=F&&Nt(r,t,e,s);(ce||be)&&(d={...d,...We(h.data,r.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:p,status:b}=d;f=d.data;let C=!1;if(e.placeholderData!==void 0&&f===void 0&&b==="pending"){let F;i?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(F=i.data,C=!0):F=typeof e.placeholderData=="function"?e.placeholderData(this.#p?.state.data,this.#p):e.placeholderData,F!==void 0&&(b="success",f=de(i?.data,F,e),l=!0)}if(e.select&&f!==void 0&&!C)if(i&&f===n?.data&&e.select===this.#h)f=this.#c;else try{this.#h=e.select,f=e.select(f),f=de(i?.data,f,e),this.#c=f,this.#a=null}catch(F){this.#a=F}this.#a&&(y=this.#a,f=this.#c,p=Date.now(),b="error");let k=d.fetchStatus==="fetching",T=b==="pending",Q=b==="error",_=T&&k,G=f!==void 0,B={status:b,fetchStatus:d.fetchStatus,isPending:T,isSuccess:b==="success",isError:Q,isInitialLoading:_,isLoading:_,data:f,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:r.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:k,isRefetching:k&&!T,isLoadingError:Q&&!G,isPaused:d.fetchStatus==="paused",isPlaceholderData:l,isRefetchError:Q&&G,isStale:Je(r,e),refetch:this.refetch,promise:this.#o,isEnabled:I(e.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){let F=B.data!==void 0,ce=B.status==="error"&&!F,be=o(ge=>{ce?ge.reject(B.error):F&&ge.resolve(B.data)},"finalizeThenableIfPossible"),Ct=o(()=>{let ge=this.#o=B.promise=le();be(ge)},"recreateThenable"),ve=this.#o;switch(ve.status){case"pending":r.queryHash===t.queryHash&&be(ve);break;case"fulfilled":(ce||B.data!==ve.value)&&Ct();break;case"rejected":(!ce||B.error!==ve.reason)&&Ct();break}}return B}updateResult(){let r=this.#s,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#i=this.options,this.#n.data!==void 0&&(this.#p=this.#t),ke(e,r))return;this.#s=e;let t=o(()=>{if(!r)return!0;let{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#m.size)return!0;let n=new Set(i??this.#m);return this.options.throwOnError&&n.add("error"),Object.keys(this.#s).some(a=>{let c=a;return this.#s[c]!==r[c]&&n.has(c)})},"shouldNotifyListeners");this.#k({listeners:t()})}#C(){let r=this.#e.getQueryCache().build(this.#e,this.options);if(r===this.#t)return;let e=this.#t;this.#t=r,this.#r=r.state,this.hasListeners()&&(e?.removeObserver(this),r.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#k(r){g.batch(()=>{r.listeners&&this.listeners.forEach(e=>{e(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Yr(r,e){return I(e.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&I(e.retryOnMount,r)===!1)}o(Yr,"shouldLoadOnMount");function qt(r,e){return Yr(r,e)||r.state.data!==void 0&&Ve(r,e,e.refetchOnMount)}o(qt,"shouldFetchOnMount");function Ve(r,e,t){if(I(e.enabled,r)!==!1&&L(e.staleTime,r)!=="static"){let s=typeof t=="function"?t(r):t;return s==="always"||s!==!1&&Je(r,e)}return!1}o(Ve,"shouldFetchOn");function Nt(r,e,t,s){return(r!==e||I(s.enabled,r)===!1)&&(!t.suspense||r.state.status!=="error")&&Je(r,t)}o(Nt,"shouldFetchOptionally");function Je(r,e){return I(e.enabled,r)!==!1&&r.isStaleByTime(L(e.staleTime,r))}o(Je,"isStale");function Zr(r,e){return!ke(r.getCurrentResult(),e)}o(Zr,"shouldAssignObserverCurrentProperties");var Kt=class extends Re{static{o(this,"Mutation")}#e;#t;#r;#s;constructor(r){super(),this.#e=r.client,this.mutationId=r.mutationId,this.#r=r.mutationCache,this.#t=[],this.state=r.state||es(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){this.#t.includes(r)||(this.#t.push(r),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){this.#t=this.#t.filter(e=>e!==r),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(r){let e=o(()=>{this.#n({type:"continue"})},"onContinue"),t={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Oe({fn:o(()=>this.options.mutationFn?this.options.mutationFn(r,t):Promise.reject(new Error("No mutationFn found")),"fn"),onFail:o((n,a)=>{this.#n({type:"failed",failureCount:n,error:a})},"onFail"),onPause:o(()=>{this.#n({type:"pause"})},"onPause"),onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:o(()=>this.#r.canRun(this),"canRun")});let s=this.state.status==="pending",i=!this.#s.canStart();try{if(s)e();else{this.#n({type:"pending",variables:r,isPaused:i}),this.#r.config.onMutate&&await this.#r.config.onMutate(r,this,t);let a=await this.options.onMutate?.(r,t);a!==this.state.context&&this.#n({type:"pending",context:a,variables:r,isPaused:i})}let n=await this.#s.start();return await this.#r.config.onSuccess?.(n,r,this.state.context,this,t),await this.options.onSuccess?.(n,r,this.state.context,t),await this.#r.config.onSettled?.(n,null,this.state.variables,this.state.context,this,t),await this.options.onSettled?.(n,null,r,this.state.context,t),this.#n({type:"success",data:n}),n}catch(n){try{await this.#r.config.onError?.(n,r,this.state.context,this,t)}catch(a){Promise.reject(a)}try{await this.options.onError?.(n,r,this.state.context,t)}catch(a){Promise.reject(a)}try{await this.#r.config.onSettled?.(void 0,n,this.state.variables,this.state.context,this,t)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,n,r,this.state.context,t)}catch(a){Promise.reject(a)}throw this.#n({type:"error",error:n}),n}finally{this.#r.runNext(this)}}#n(r){let e=o(t=>{switch(r.type){case"failed":return{...t,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...t,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:r.error,failureCount:t.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}},"reducer");this.state=e(this.state),g.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(r)}),this.#r.notify({mutation:this,type:"updated",action:r})})}};function es(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}o(es,"getDefaultState");var Bt=class extends D{static{o(this,"MutationCache")}constructor(r={}){super(),this.config=r,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(r,e,t){let s=new Kt({client:r,mutationCache:this,mutationId:++this.#r,options:r.defaultMutationOptions(e),state:t});return this.add(s),s}add(r){this.#e.add(r);let e=Pe(r);if(typeof e=="string"){let t=this.#t.get(e);t?t.push(r):this.#t.set(e,[r])}this.notify({type:"added",mutation:r})}remove(r){if(this.#e.delete(r)){let e=Pe(r);if(typeof e=="string"){let t=this.#t.get(e);if(t)if(t.length>1){let s=t.indexOf(r);s!==-1&&t.splice(s,1)}else t[0]===r&&this.#t.delete(e)}}this.notify({type:"removed",mutation:r})}canRun(r){let e=Pe(r);if(typeof e=="string"){let s=this.#t.get(e)?.find(i=>i.state.status==="pending");return!s||s===r}else return!0}runNext(r){let e=Pe(r);return typeof e=="string"?this.#t.get(e)?.find(s=>s!==r&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){g.batch(()=>{this.#e.forEach(r=>{this.notify({type:"removed",mutation:r})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(r){let e={exact:!0,...r};return this.getAll().find(t=>Ce(e,t))}findAll(r={}){return this.getAll().filter(e=>Ce(r,e))}notify(r){g.batch(()=>{this.listeners.forEach(e=>{e(r)})})}resumePausedMutations(){let r=this.getAll().filter(e=>e.state.isPaused);return g.batch(()=>Promise.all(r.map(e=>e.continue().catch(w))))}};function Pe(r){return r.options.scope?.id}o(Pe,"scopeFor");var jt=class extends D{static{o(this,"QueryCache")}constructor(r={}){super(),this.config=r,this.#e=new Map}#e;build(r,e,t){let s=e.queryKey,i=e.queryHash??he(s,e),n=this.get(i);return n||(n=new Ut({client:r,queryKey:s,queryHash:i,options:r.defaultQueryOptions(e),state:t,defaultOptions:r.getQueryDefaults(s)}),this.add(n)),n}add(r){this.#e.has(r.queryHash)||(this.#e.set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){let e=this.#e.get(r.queryHash);e&&(r.destroy(),e===r&&this.#e.delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){g.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return this.#e.get(r)}getAll(){return[...this.#e.values()]}find(r){let e={exact:!0,...r};return this.getAll().find(t=>we(e,t))}findAll(r={}){let e=this.getAll();return Object.keys(r).length>0?e.filter(t=>we(r,t)):e}notify(r){g.batch(()=>{this.listeners.forEach(e=>{e(r)})})}onFocus(){g.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){g.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}};var Xe=class{static{o(this,"QueryClient")}#e;#t;#r;#s;#n;#i;#o;#a;constructor(r={}){this.#e=r.queryCache||new jt,this.#t=r.mutationCache||new Bt,this.#r=r.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=re.subscribe(async r=>{r&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=ie.subscribe(async r=>{r&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(r){return this.#e.findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return this.#t.findAll({...r,status:"pending"}).length}getQueryData(r){let e=this.defaultQueryOptions({queryKey:r});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(r){let e=this.defaultQueryOptions(r),t=this.#e.build(this,e),s=t.state.data;return s===void 0?this.fetchQuery(r):(r.revalidateIfStale&&t.isStaleByTime(L(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(r){return this.#e.findAll(r).map(({queryKey:e,state:t})=>{let s=t.data;return[e,s]})}setQueryData(r,e,t){let s=this.defaultQueryOptions({queryKey:r}),n=this.#e.get(s.queryHash)?.state.data,a=Rt(e,n);if(a!==void 0)return this.#e.build(this,s).setData(a,{...t,manual:!0})}setQueriesData(r,e,t){return g.batch(()=>this.#e.findAll(r).map(({queryKey:s})=>[s,this.setQueryData(s,e,t)]))}getQueryState(r){let e=this.defaultQueryOptions({queryKey:r});return this.#e.get(e.queryHash)?.state}removeQueries(r){let e=this.#e;g.batch(()=>{e.findAll(r).forEach(t=>{e.remove(t)})})}resetQueries(r,e){let t=this.#e;return g.batch(()=>(t.findAll(r).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...r},e)))}cancelQueries(r,e={}){let t={revert:!0,...e},s=g.batch(()=>this.#e.findAll(r).map(i=>i.cancel(t)));return Promise.all(s).then(w).catch(w)}invalidateQueries(r,e={}){return g.batch(()=>(this.#e.findAll(r).forEach(t=>{t.invalidate()}),r?.refetchType==="none"?Promise.resolve():this.refetchQueries({...r,type:r?.refetchType??r?.type??"active"},e)))}refetchQueries(r,e={}){let t={...e,cancelRefetch:e.cancelRefetch??!0},s=g.batch(()=>this.#e.findAll(r).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let n=i.fetch(void 0,t);return t.throwOnError||(n=n.catch(w)),i.state.fetchStatus==="paused"?Promise.resolve():n}));return Promise.all(s).then(w)}fetchQuery(r){let e=this.defaultQueryOptions(r);e.retry===void 0&&(e.retry=!1);let t=this.#e.build(this,e);return t.isStaleByTime(L(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(w).catch(w)}fetchInfiniteQuery(r){return r._type="infinite",this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(w).catch(w)}ensureInfiniteQueryData(r){return r._type="infinite",this.ensureQueryData(r)}resumePausedMutations(){return ie.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(r){this.#r=r}setQueryDefaults(r,e){this.#s.set(X(r),{queryKey:r,defaultOptions:e})}getQueryDefaults(r){let e=[...this.#s.values()],t={};return e.forEach(s=>{j(r,s.queryKey)&&Object.assign(t,s.defaultOptions)}),t}setMutationDefaults(r,e){this.#n.set(X(r),{mutationKey:r,defaultOptions:e})}getMutationDefaults(r){let e=[...this.#n.values()],t={};return e.forEach(s=>{j(r,s.mutationKey)&&Object.assign(t,s.defaultOptions)}),t}defaultQueryOptions(r){if(r._defaulted)return r;let e={...this.#r.queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return e.queryHash||(e.queryHash=he(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===se&&(e.enabled=!1),e}defaultMutationOptions(r){return r?._defaulted?r:{...this.#r.mutations,...r?.mutationKey&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};var $=M(J(),1);var ne=M(J(),1),$t=M(Be(),1);var fe=ne.createContext(void 0),Ye=o(r=>{let e=ne.useContext(fe);if(r)return r;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},"useQueryClient"),Ze=o(({client:r,children:e})=>(ne.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),(0,$t.jsx)(fe.Provider,{value:r,children:e})),"QueryClientProvider");var pe=M(J(),1),ts=M(Be(),1);function rs(){let r=!1;return{clearReset:o(()=>{r=!1},"clearReset"),reset:o(()=>{r=!0},"reset"),isReset:o(()=>r,"isReset")}}o(rs,"createValue");var ss=pe.createContext(rs()),Ht=o(()=>pe.useContext(ss),"useQueryErrorResetBoundary");var zt=M(J(),1);var Wt=o((r,e,t)=>{let s=t?.state.error&&typeof r.throwOnError=="function"?Ee(r.throwOnError,[t.state.error,t]):r.throwOnError;(r.suspense||r.experimental_prefetchInRender||s)&&(e.isReset()||(r.retryOnMount=!1))},"ensurePreventErrorBoundaryRetry"),Vt=o(r=>{zt.useEffect(()=>{r.clearReset()},[r])},"useClearResetErrorBoundary"),Gt=o(({result:r,errorResetBoundary:e,throwOnError:t,query:s,suspense:i})=>r.isError&&!e.isReset()&&!r.isFetching&&s&&(i&&r.data===void 0||Ee(t,[r.error,s])),"getHasError");var Ae=M(J(),1);var Jt=Ae.createContext(!1),Xt=o(()=>Ae.useContext(Jt),"useIsRestoring"),go=Jt.Provider;var Yt=o(r=>{if(r.suspense){let t=o(i=>i==="static"?i:Math.max(i??1e3,1e3),"clamp"),s=r.staleTime;r.staleTime=typeof s=="function"?(...i)=>t(s(...i)):t(s),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},"ensureSuspenseTimers"),Zt=o((r,e)=>r.isLoading&&r.isFetching&&!e,"willFetch"),er=o((r,e)=>r?.suspense&&e.isPending,"shouldSuspend"),et=o((r,e,t)=>e.fetchOptimistic(r).catch(()=>{t.clearReset()}),"fetchOptimistic");function tr(r,e,t){let s=Xt(),i=Ht(),n=Ye(t),a=n.defaultQueryOptions(r);n.getDefaultOptions().queries?._experimental_beforeQuery?.(a);let c=n.getQueryCache().get(a.queryHash),u=r.subscribed!==!1;a._optimisticResults=s?"isRestoring":u?"optimistic":void 0,Yt(a),Wt(a,i,c),Vt(i);let h=!n.getQueryCache().get(a.queryHash),[d]=$.useState(()=>new e(n,a)),l=d.getOptimisticResult(a),f=!s&&u;if($.useSyncExternalStore($.useCallback(y=>{let p=f?d.subscribe(g.batchCalls(y)):w;return d.updateResult(),p},[d,f]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setOptions(a)},[a,d]),er(a,l))throw et(a,d,i);if(Gt({result:l,errorResetBoundary:i,throwOnError:a.throwOnError,query:c,suspense:a.suspense}))throw l.error;return n.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!q.isServer()&&Zt(l,s)&&(h?et(a,d,i):c?.promise)?.catch(w).finally(()=>{d.updateResult()}),a.notifyOnChangeProps?l:d.trackResult(l)}o(tr,"useBaseQuery");function is(r,e){return tr(r,Ge,e)}o(is,"useQuery");var rr=M(Tt(),1);var Y=M(J(),1),tt=M(Be(),1);var sr=(0,Y.createContext)(null),ns=o(()=>new Xe({defaultOptions:{mutations:{retry:0},queries:{gcTime:5*6e4,retry:0,staleTime:Number.POSITIVE_INFINITY}}}),"Q"),as=o(r=>{let e=(0,rr.c)(9),{children:t,client:s,queryClient:i}=r,n=(0,Y.use)(fe),a;e[0]!==n||e[1]!==i?(a=o(()=>i??n??ns(),"o"),e[0]=n,e[1]=i,e[2]=a):a=e[2];let[c]=(0,Y.useState)(a),u=i??n??c,h;e[3]!==t||e[4]!==s?(h=(0,tt.jsx)(sr,{value:s,children:t}),e[3]=t,e[4]=s,e[5]=h):h=e[5];let d=h;if(n===u)return d;let l;return e[6]!==d||e[7]!==u?(l=(0,tt.jsx)(Ze,{client:u,children:d}),e[6]=d,e[7]=u,e[8]=l):l=e[8],l},"b"),rt=o(()=>{let r=(0,Y.use)(sr);if(!r)throw new m("INTERNAL","useLunora must be used inside <LunoraProvider />");return r},"q");var Fe=o(r=>{let e="";for(let t=0;t<r.length;t+=32768)e+=String.fromCharCode(...r.subarray(t,t+32768));return btoa(e)},"m"),os=o(r=>{let e=atob(r),t=new Uint8Array(e.length);for(let s=0;s<e.length;s+=1)t[s]=e.codePointAt(s)??0;return t},"A"),E="$lunora.wire$",Me="__proto__",ir={BigInt64Array,BigUint64Array,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array},nr={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},st=o(r=>{if(r===null||typeof r!="object")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype},"l"),O=o((r,e=0)=>{if(e>64)throw new RangeError("wire-codec: value nesting exceeds the 64-level limit");if(r===void 0)return[E,"undefined"];if(r===null)return null;let t=typeof r;if(t==="bigint")return[E,"bigint",r.toString()];if(t==="number"){let n=r;return Number.isNaN(n)?[E,"nan"]:n===1/0?[E,"inf"]:n===-1/0?[E,"-inf"]:n}if(t!=="object")return r;if(r instanceof Date)return[E,"date",O(r.getTime(),e+1)];if(r instanceof Error){let n=r,a={};for(let u of Object.keys(n)){if(n[u]===void 0)continue;let h=O(n[u],e+1);u===Me?Object.defineProperty(a,u,{configurable:!0,enumerable:!0,value:h,writable:!0}):a[u]=h}let c=[E,"error",String(n.name),String(n.message),a];return n.cause!==void 0&&c.push(O(n.cause,e+1)),c}if(r instanceof URL)return[E,"url",r.href];if(r instanceof Map)return[E,"map",[...r.entries()].map(([n,a])=>[O(n,e+1),O(a,e+1)])];if(r instanceof Set)return[E,"set",[...r].map(n=>O(n,e+1))];if(r instanceof ArrayBuffer)return[E,"bytes",Fe(new Uint8Array(r)),"ArrayBuffer"];if(ArrayBuffer.isView(r)){let n=r,a=n.constructor.name,c=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);return a==="Uint8Array"?[E,"bytes",Fe(c)]:[E,"bytes",Fe(c),a]}if(Array.isArray(r)){let n=r.map(a=>O(a,e+1));return n.length>0&&n[0]===E?[E,"arr",n]:n}if(!st(r)){let n=r.constructor?.name??"value";throw new TypeError(`wire-codec: cannot encode a ${n} over the Lunora wire \u2014 only plain objects, arrays, and the supported built-ins (Date, Error, URL, Map, Set, ArrayBuffer/typed arrays, bigint) round-trip`)}let s=r,i={};for(let n of Object.keys(s)){let a=s[n];if(a===void 0)continue;let c=O(a,e+1);n===Me?Object.defineProperty(i,n,{configurable:!0,enumerable:!0,value:c,writable:!0}):i[n]=c}return i},"b"),S=o((r,e=0)=>{if(e>64)throw new RangeError("wire-codec: value nesting exceeds the 64-level limit");if(r===null||typeof r!="object")return r;if(Array.isArray(r)){if(r[0]===E)switch(r[1]){case"-inf":return-1/0;case"arr":return r[2].map(i=>S(i,e+1));case"bigint":{let i=r[2];if(typeof i!="string"||i.length>1024||!/^-?\d+$/.test(i))throw new RangeError("wire-codec: invalid or over-long bigint (max 1024 digits)");return BigInt(i)}case"date":{let i=S(r[2],e+1);if(typeof i!="number")throw new TypeError("wire-codec: malformed date \u2014 epoch must be a number");return new Date(i)}case"map":{let i=r[2];return new Map(i.map(n=>{if(!Array.isArray(n)||n.length!==2)throw new TypeError("wire-codec: malformed map entry \u2014 expected a [key, value] pair");return[S(n[0],e+1),S(n[1],e+1)]}))}case"set":return new Set(r[2].map(i=>S(i,e+1)));case"url":{let i=r[2];if(typeof i!="string")throw new TypeError("wire-codec: malformed url \u2014 href must be a string");return new URL(i)}case"error":{let i=r[2],n=r[3];if(typeof i!="string"||typeof n!="string")throw new TypeError("wire-codec: malformed error \u2014 name and message must be strings");let a=(Object.hasOwn(nr,i)?nr[i]:void 0)??Error,c=new a(n);c.name!==i&&Object.defineProperty(c,"name",{configurable:!0,value:i,writable:!0});let u=S(r[4],e+1);if(u===null||typeof u!="object"||Array.isArray(u))throw new TypeError("wire-codec: malformed error \u2014 props must be an object");for(let h of Object.keys(u))h===Me?Object.defineProperty(c,h,{configurable:!0,enumerable:!0,value:u[h],writable:!0}):c[h]=u[h];return r.length>5&&Object.defineProperty(c,"cause",{configurable:!0,value:S(r[5],e+1),writable:!0}),c}case"bytes":{let i=r[2];if(typeof i!="string")throw new TypeError("wire-codec: malformed bytes \u2014 payload must be a base64 string");let n=os(i);if(Fe(n)!==i)throw new TypeError("wire-codec: malformed bytes \u2014 payload must be canonical padded base64");let a=r[3]??"Uint8Array";if(a==="ArrayBuffer")return n.buffer.byteLength===n.byteLength?n.buffer:n.slice().buffer;let c=Object.hasOwn(ir,a)?ir[a]:void 0;return c?new c(n.slice().buffer):n}case"inf":return 1/0;case"nan":return Number.NaN;case"undefined":return;default:return r.map(i=>S(i,e+1))}return r.map(i=>S(i,e+1))}let t=r,s={};for(let i of Object.keys(t)){let n=S(t[i],e+1);i===Me?Object.defineProperty(s,i,{configurable:!0,enumerable:!0,value:n,writable:!0}):s[i]=n}return s},"y");var P=o(r=>new Promise((e,t)=>{r.addEventListener("success",()=>{e(r.result)}),r.addEventListener("error",()=>{t(r.error??new Error("IndexedDB request failed"))})}),"c"),xe=o((r,e,t,s)=>{let i;return()=>i||(i=new Promise((n,a)=>{let c=r.open(e,t);c.addEventListener("upgradeneeded",()=>{s(c.result)}),c.addEventListener("success",()=>{n(c.result)}),c.addEventListener("error",()=>{a(c.error??new Error("IndexedDB open failed"))})}),i)},"E"),Qe=o((r,e)=>async(t,s)=>{let i=(await r()).transaction(e,t),n=await s(i.objectStore(e));return await new Promise((a,c)=>{i.addEventListener("complete",()=>{a()}),i.addEventListener("error",()=>{c(i.error??new Error("IndexedDB transaction failed"))}),i.addEventListener("abort",()=>{c(i.error??new Error("IndexedDB transaction aborted"))})}),n},"u");var Z=o((r,e,t)=>`${r}::${e}::${t??""}`,"T"),cs=500,us=o((r,e)=>{if(!Number.isInteger(r)||r<1)throw new m("INTERNAL",`${e}: maxEntries must be a positive integer, got ${String(r)}`);return r},"E");var hs="lunora-query-cache",ds="query-cache",ar="by_ts",ls=1,fs=o((r={})=>{let e=r.indexedDB??(typeof indexedDB>"u"?void 0:indexedDB);if(!e)throw new m("INTERNAL","createIndexedDbQueryCache: no IndexedDB available \u2014 pass `indexedDB` or use createInMemoryQueryCache()");let t=r.databaseName??hs,s=r.storeName??ds,i=us(r.maxEntries??cs,"createIndexedDbQueryCache"),n=xe(e,t,ls,u=>{u.objectStoreNames.contains(s)||u.createObjectStore(s,{keyPath:"key"}).createIndex(ar,"ts",{unique:!1})}),a=Qe(n,s),c=o(async u=>{let h=await P(u.count())-i;h<=0||await new Promise((d,l)=>{let f=u.index(ar).openCursor();f.addEventListener("success",()=>{let y=f.result;if(!y||h<=0){d();return}y.delete(),h-=1,y.continue()}),f.addEventListener("error",()=>{l(f.error??new Error("IndexedDB eviction failed"))})})},"y");return{clear:o(async()=>{await a("readwrite",u=>P(u.clear()))},"clear"),load:o(async()=>a("readonly",u=>P(u.getAll())),"load"),put:o(async(u,h)=>{await a("readwrite",async d=>{await P(d.put({...h,key:u})),await c(d)})},"put"),remove:o(async u=>{await a("readwrite",h=>P(h.delete(u)))},"remove")}},"N"),or=o(r=>{if(r!==!1){if(r)return r;if(!(typeof indexedDB>"u"))return fs()}},"L");var cr=o(()=>{let r=null;return{get:o(()=>r,"get"),set:o(e=>{r=e},"set")}},"r");var _e=class{static{o(this,"u")}values=new Map;subscribers=new Map;get(e){return this.values.has(e.key)?this.values.get(e.key):e.defaultValue}set(e,t){if(t===void 0){this.reset(e);return}this.values.set(e.key,t),this.notify(e.key,t)}reset(e){this.values.delete(e.key),this.notify(e.key,e.defaultValue)}clear(){this.values.clear(),this.subscribers.clear()}subscribe(e,t){let s=this.subscribers.get(e.key);return s||(s=new Set,this.subscribers.set(e.key,s)),s.add(t),()=>{s.delete(t),s.size===0&&this.subscribers.delete(e.key)}}notify(e,t){let s=this.subscribers.get(e);if(s)for(let i of s)try{i(t)}catch{}}};var ur=0,ps="lunora-bridge",ms=1e3,ys=3e3,Le=class{static{o(this,"l")}bc;tabId;heartbeatInterval;leaderTimeout;knownLeader=void 0;leader=!1;running=!1;promotionPending=!1;lastHeartbeat=0;heartbeatTimer=void 0;leaderCheckTimer=void 0;onBecomeLeader;onStopBeingLeader;onConnectionStatus;onSubscriptionData;onLeaderClaimAnswered;onSubscriptionError;onSubscriptionSettled;constructor(e={}){if(ur+=1,this.tabId=`tab_${String(ur)}_${crypto.randomUUID()}`,this.heartbeatInterval=e.heartbeatInterval??ms,this.leaderTimeout=e.leaderTimeout??ys,this.onBecomeLeader=e.onBecomeLeader,this.onStopBeingLeader=e.onStopBeingLeader,this.onConnectionStatus=e.onConnectionStatus,this.onSubscriptionData=e.onSubscriptionData,this.onLeaderClaimAnswered=e.onLeaderClaimAnswered,this.onSubscriptionError=e.onSubscriptionError,this.onSubscriptionSettled=e.onSubscriptionSettled,typeof BroadcastChannel>"u"){this.bc=void 0;return}this.bc=new BroadcastChannel(e.channelName??ps),this.bc.addEventListener("message",t=>{this.handleMessage(t.data)})}start(){if(!this.running){if(this.running=!0,this.bc===void 0){this.becomeLeader();return}this.broadcast({type:"claim-leadership",tabId:this.tabId,ts:Date.now()}),setTimeout(()=>{this.running&&this.knownLeader===void 0&&this.becomeLeader()},this.leaderTimeout),this.leaderCheckTimer=setInterval(()=>{this.checkLeaderHealth()},this.leaderTimeout),this.heartbeatTimer=setInterval(()=>{this.sendHeartbeat()},this.heartbeatInterval)}}stop(){this.running=!1,this.leader&&(this.broadcast({type:"yield-leadership",tabId:this.tabId}),this.leader=!1,this.knownLeader=void 0,this.onStopBeingLeader?.()),this.heartbeatTimer!==void 0&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0),this.leaderCheckTimer!==void 0&&(clearInterval(this.leaderCheckTimer),this.leaderCheckTimer=void 0),this.bc?.close()}isLeader(){return this.leader}promoteImmediately(){this.running&&this.becomeLeader()}get leaderTabId(){return this.knownLeader}get id(){return this.tabId}get isRunning(){return this.running}broadcastSubscriptionData(e,t,s,i,n){this.leader&&this.broadcast({type:"subscription-data",tabId:this.tabId,key:e,data:t,...s===void 0?{}:{cursor:s},...i===void 0?{}:{epoch:i},...n===void 0?{}:{identity:n}})}broadcastSubscriptionError(e,t,s){this.leader&&this.broadcast({type:"subscription-error",tabId:this.tabId,key:e,error:t,...s===void 0?{}:{identity:s}})}broadcastSubscriptionSettled(e,t,s,i,n,a){this.leader&&this.broadcast({type:"subscription-settled",tabId:this.tabId,key:e,...t===void 0?{}:{cursor:t},...s===void 0?{}:{epoch:s},...i===void 0?{}:{lastMutationId:i},...n===void 0?{}:{clientId:n},...a===void 0?{}:{identity:a}})}broadcastConnectionStatus(e,t){this.leader&&this.broadcast({type:"connection-status",tabId:this.tabId,status:e,...t===void 0?{}:{identity:t}})}broadcast(e){this.bc?.postMessage(e)}handleMessage(e){switch(e.type){case"claim-leadership":{this.handleClaimLeadership(e);break}case"connection-status":{if(this.leader||e.tabId===this.tabId)break;this.onConnectionStatus?.(e.status,e.identity);break}case"heartbeat":{this.handleHeartbeat(e);break}case"subscription-data":{if(this.leader||e.tabId===this.tabId)break;this.onSubscriptionData?.(e.key,e.data,e.cursor,e.epoch,e.identity);break}case"subscription-error":{if(this.leader||e.tabId===this.tabId)break;this.onSubscriptionError?.(e.key,e.error,e.identity);break}case"subscription-settled":{if(this.leader||e.tabId===this.tabId)break;this.onSubscriptionSettled?.(e.key,e.cursor,e.epoch,e.lastMutationId,e.clientId,e.identity);break}case"yield-leadership":{this.knownLeader===e.tabId&&(this.knownLeader=void 0,this.running&&!this.leader&&this.claimAndPromote());break}}}handleClaimLeadership(e){if(e.tabId!==this.tabId){if(this.leader){this.broadcast({type:"heartbeat",tabId:this.tabId,ts:Date.now()}),this.onLeaderClaimAnswered?.();return}this.knownLeader===void 0&&e.tabId<this.tabId&&(this.knownLeader=e.tabId,this.lastHeartbeat=e.ts)}}handleHeartbeat(e){if(e.tabId!==this.tabId){if(this.leader){this.resolveLeaderVsLeaderTieBreak(e);return}this.lastHeartbeat=e.ts,this.knownLeader=e.tabId}}resolveLeaderVsLeaderTieBreak(e){e.tabId<this.tabId?(this.leader=!1,this.knownLeader=e.tabId,this.lastHeartbeat=e.ts,this.onStopBeingLeader?.()):this.broadcast({type:"heartbeat",tabId:this.tabId,ts:Date.now()})}becomeLeader(){this.leader||(this.leader=!0,this.knownLeader=this.tabId,this.lastHeartbeat=Date.now(),this.onBecomeLeader?.(),this.broadcast({type:"heartbeat",tabId:this.tabId,ts:Date.now()}))}sendHeartbeat(){this.leader&&this.broadcast({type:"heartbeat",tabId:this.tabId,ts:Date.now()})}checkLeaderHealth(){if(!(!this.running||this.leader)){if(this.knownLeader===void 0){this.claimAndPromote();return}Date.now()-this.lastHeartbeat>this.leaderTimeout&&(this.knownLeader=void 0,this.claimAndPromote())}}claimAndPromote(){this.promotionPending||(this.promotionPending=!0,this.broadcast({type:"claim-leadership",tabId:this.tabId,ts:Date.now()}),setTimeout(()=>{this.promotionPending=!1,this.running&&this.knownLeader===void 0&&this.becomeLeader()},this.leaderTimeout))}};var it="_id",nt="_creationTime",at="page",hr="pageDelta",bs=o(r=>{if(Array.isArray(r))return r;if(st(r)&&Array.isArray(r[at]))return r[at]},"y"),vs=o(r=>{let e;for(let t of r){let s=t[nt];if(typeof s=="number"){if(e!==void 0){if(s<e)return!0;if(s>e)return!1}e=s}}return!1},"l"),gs=o((r,e)=>{let t=e[nt];if(typeof t!="number")return r.length;let s=vs(r);for(let[i,n]of r.entries()){let a=n[nt];if(typeof a=="number"&&(s?a<t:a>t))return i}return r.length},"x"),Ss=o(r=>{if(typeof r!="object"||r===null)return;let e=r[it];return typeof e=="string"?e:void 0},"A"),dr=o(r=>{if(typeof r!="object"||r===null)return!1;let e=r;return typeof e.key=="string"&&typeof e.table=="string"&&(e.op==="insert"||e.op==="update"||e.op==="delete")},"b"),ws=o((r,e)=>{let t=[];for(let u of r){if(Ss(u)===void 0)return;t.push(u)}let{key:s,op:i,row:n}=e;if(i==="delete"){let u=t.filter(h=>h[it]!==s);return u.length===t.length?[...t]:u}if(n===void 0)return;let a=[...t],c=t.findIndex(u=>u[it]===s);return c===-1?a.splice(gs(t,n),0,n):a[c]=n,a},"I"),lr=o((r,e)=>{let t=bs(r);if(t===void 0)return;let s=ws(t,e);return s===void 0||Array.isArray(r)?s:{...r,[at]:s}},"E");var uc=new Set(Object.keys(kt)),N=class extends m{static{o(this,"E")}constructor(e,t){super("INTERNAL",e,{data:t})}};var ot=o(r=>{let e=r?.data?.retryAfterMs;return typeof e=="number"&&Number.isFinite(e)?e:void 0},"u");var Cs=1024,De=o(r=>{let e=r.maxBuffer??Cs,t=[],s=[],i=!1,n,a=!1,c=o(()=>{let d=s.shift();if(!d)return!1;if(n)return d.reject(n),!0;if(t.length>0){let l=t.shift();return d.resolve({done:!1,value:l}),!0}return i?(d.resolve({done:!0,value:void 0}),!0):(s.unshift(d),!1)},"u"),u={complete(){if(!(i||n))for(i=!0;c(););},fail(d){if(!(i||n))for(n=d,t.length=0;c(););},push(d){if(!(i||n||a)){if(t.length>=e){u.fail(new m("STREAM_BACKPRESSURE",`stream buffer overflow (max=${e.toString()}); the consumer cannot keep up with the producer`));return}t.push(d),c()}}},h=o(()=>{if(!a){a=!0,i=!0,t.length=0;try{r.onCancel()}catch{}for(;c(););}},"c");return{handle:u,iterable:{cancel:h,[Symbol.asyncIterator](){return{next(){if(n)return Promise.reject(n);if(t.length>0){let d=t.shift();return Promise.resolve({done:!1,value:d})}return i?Promise.resolve({done:!0,value:void 0}):new Promise((d,l)=>{s.push({reject:l,resolve:d})})},return(){return h(),Promise.resolve({done:!0,value:void 0})}}}}}},"p");var fr=/^ /u,pr=o(r=>typeof r=="object"&&r!==null?JSON.stringify(r):String(r),"p"),ks=o(r=>{let e="",t=[];for(let s of r.split(`
|
|
2
2
|
`))s.startsWith("event:")?e=s.slice(6).replace(fr,""):s.startsWith("data:")&&t.push(s.slice(5).replace(fr,""));return{data:t.join(`
|
|
3
3
|
`),event:e}},"S"),Ts=o((r,e,t)=>{let s=e.params??{},i=r.path.split("/").map(c=>{if(!c.startsWith(":"))return c;let u=c.slice(1),h=s[u];if(h===void 0)throw new m("HTTP_STREAM_MISSING_PARAM",`httpStream: missing path param ":${u}" for route ${r.path}`);return encodeURIComponent(pr(h))}).join("/"),n=new URLSearchParams;for(let[c,u]of Object.entries(e.searchParams??{}))u!==void 0&&n.set(c,pr(u));let a=n.toString();return`${t.endsWith("/")?t.slice(0,-1):t}${i}${a===""?"":`?${a}`}`},"T"),Es=o((r,e)=>{if(r.event==="complete")return e.complete(),!0;if(r.event==="error"){let t={};try{t=JSON.parse(r.data)}catch{}let s=typeof t.message=="string"?t.message:"stream error",i=typeof t.code=="string"?t.code:"HTTP_STREAM_ERROR";return e.fail(new m(i,s)),!0}if((r.event===""||r.event==="message")&&r.data!=="")try{e.push(S(JSON.parse(r.data)))}catch{return e.fail(new m("HTTP_STREAM_BAD_CHUNK","httpStream: malformed SSE chunk (invalid JSON)")),!0}return!1},"E"),Is=o(async(r,e)=>{let t=r.getReader(),s=new TextDecoder,i="",n=o(()=>{let a=i.indexOf(`
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as nt,b as rt}from"./chunk-
|
|
1
|
+
import{a as nt,b as rt}from"./chunk-YSQHT7BJ.js";import{c as tt}from"./chunk-BDO4YYBB.js";import{a as et}from"./chunk-SUMY65GX.js";import"./chunk-RFNGDE33.js";import"./chunk-V3CZW3JB.js";import"./chunk-MU3P2FI7.js";import"./chunk-XZMOZFE6.js";import"./chunk-YPRQLCKF.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import{a as Ze}from"./chunk-QKEJLVC5.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import"./chunk-K7ARKCTO.js";import"./chunk-5JDWLCSH.js";import"./chunk-EVTM6Q43.js";import"./chunk-PD6WIDY6.js";import{a as Xe}from"./chunk-2DX5MROH.js";import{b as Ve}from"./chunk-OGUKYRFM.js";import{c as Ke,d as Ce,e as Ee,f as Le,g as He}from"./chunk-OKG3HWSJ.js";import{W as Ye}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-225VJ77I.js";import{a as Je}from"./chunk-ULIQFBZU.js";import{a as qe}from"./chunk-4ZEL6BYL.js";import"./chunk-6YJQIQGV.js";import{f as Ie}from"./chunk-ZJ6QIZWP.js";import"./chunk-FSRSK4LY.js";import"./chunk-UEOWRXJ3.js";import"./chunk-HEAQVSNS.js";import{d as ce,f as Se,g as Ne,h as Ge,o as ue}from"./chunk-FODLDLE2.js";import{a as l,d as Be,e as St,f as Nt,g as qt,i as me}from"./chunk-YKXDMIHQ.js";var G=Be(Nt(),1);var j=Be(St(),1);var u=Be(qt(),1);var Ct="x",ot=" ",kt={'"':'"',"'":"'","[":"]","`":"`"},ct=l((s,e)=>{let n=e+2;for(;n<s.length&&s[n]!==`
|
|
2
2
|
`;)n+=1;return n},"tt"),dt=l((s,e)=>{let n=s.indexOf("*/",e+2);return n===-1?-1:n+2},"nt"),ut=l(s=>{let e=s.split(""),n=0;for(;n<s.length;){let t=s[n]??"",o=kt[t];if(t==="-"&&s[n+1]==="-"){let r=ct(s,n);e.fill(ot,n,r),n=r}else if(t==="/"&&s[n+1]==="*"){let r=dt(s,n);if(r===-1)return;e.fill(ot,n,r),n=r}else if(o!==void 0){let r=n+1;for(;r<s.length;)if(s[r]!==o)r+=1;else if(o!=="]"&&s[r+1]===o)r+=2;else break;if(r>=s.length)return;e.fill(Ct,n,r+1),n=r+1}else n+=1}for(let t=0;t<s.length;t+=1)s[t]===`
|
|
3
3
|
`&&(e[t]=`
|
|
4
4
|
`);return e.join("")},"st"),Tt=/^(?:explain\s+(?:query\s+plan\s+)?)?(?:select|with)\b/iu,Rt=/\b(?:alter|attach|create|delete|detach|drop|insert|pragma|reindex|truncate|update|vacuum)\b|\breplace\b(?!\s*\()/iu,_t=/^\w+/u,It=/;\s*$/u,Et=/\s/u,mt=l(s=>{let e=0;for(;e<s.length;){let n=s[e];if(n!==void 0&&Et.test(n))e+=1;else if(n==="-"&&s[e+1]==="-")e=ct(s,e);else if(n==="/"&&s[e+1]==="*"){let t=dt(s,e);if(t===-1)break;e=t}else break}return e},"ot"),Lt=l(s=>{let e=mt(s),n=s.slice(e).trimEnd();if(n==="")return{code:"SQL_EMPTY",message:"the query is empty"};let t=(ut(n)??n).replace(It,""),o=n.slice(0,t.length),r=t.indexOf(";");if(r!==-1)return{code:"SQL_MULTIPLE_STATEMENTS",length:1,message:"only a single statement may be run",offset:e+r};let a="the SQL editor is read-only \u2014 only SELECT / WITH / EXPLAIN queries are allowed";if(!Tt.test(o))return{code:"SQL_NOT_READONLY",length:_t.exec(o)?.[0].length??1,message:a,offset:e};let c=Rt.exec(o);if(c!==null)return{code:"SQL_NOT_READONLY",length:c[0].length,message:`${a} (\`${c[0].toUpperCase()}\` is not allowed)`,offset:e+c.index}},"Ot"),Ot=/^explain\b/iu,At=l(s=>Ot.test(s.slice(mt(s)))?s:`EXPLAIN QUERY PLAN ${s}`,"Mt"),Qe=l((s,e)=>{let n=s.trim();if(n==="")return[];let t=e+s.indexOf(n),o=Lt(n);return o?.code==="SQL_EMPTY"?[]:[o===void 0?{offset:t,sql:n}:{offset:t,rejection:o,sql:n}]},"We"),ft=l(s=>{let e=ut(s);if(e===void 0)return Qe(s,0);let n=[],t=0;for(let o=0;o<=e.length;o+=1)o!==e.length&&e[o]!==";"||(n.push(...Qe(s.slice(t,o),t)),t=o+1);return n},"lt"),Dt=["ORDER BY","GROUP BY","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN","EXPLAIN QUERY PLAN","SELECT","DISTINCT","FROM","WHERE","HAVING","LIMIT","OFFSET","JOIN","ON","AND","OR","AS","ASC","DESC","WITH","UNION","EXPLAIN"],Mt=["FROM","WHERE","ORDER BY","GROUP BY","HAVING","LIMIT","OFFSET","UNION","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN"],De=String.fromCodePoint(0),$t=new RegExp(`${De}${String.raw`(\d+)`}${De}`,"gu"),Ft=Dt.map(s=>({pattern:new RegExp(String.raw`\b${s.replaceAll(" ",String.raw`\s+`)}\b`,"giu"),replacement:s})),zt=Mt.map(s=>({pattern:new RegExp(String.raw`\s+${s.replaceAll(" ",String.raw`\s+`)}\b`,"gu"),replacement:`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Yi,b as Ve,c as Ri,d as Je,e as Zi,f as xi,k as ji}from"./chunk-N6EGTWG5.js";import"./chunk-Q4CAKBWN.js";import"./chunk-GGNCX2F4.js";import"./chunk-RLLKECZT.js";import"./chunk-YPRQLCKF.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import{a as pi}from"./chunk-QKEJLVC5.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import"./chunk-5WJXVZMZ.js";import"./chunk-EVTM6Q43.js";import"./chunk-K7AJEMKE.js";import"./chunk-6D6Z2KXU.js";import{a as Le}from"./chunk-OKG3HWSJ.js";import{W as Xi}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import{a as zy}from"./chunk-4L4WTGN5.js";import{a as Gi}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as Ke}from"./chunk-6YGTF3NC.js";import"./chunk-35DM4JJG.js";import"./chunk-4ZEL6BYL.js";import"./chunk-OY4KVXP7.js";import{a as Hi,e as qi}from"./chunk-FQDM7IHC.js";import"./chunk-FSRSK4LY.js";import{d as _i}from"./chunk-BE3SUNHW.js";import"./chunk-FKVZRPV5.js";import"./chunk-WUWBZPUK.js";import{a as Qi,d as je,p as Ci}from"./chunk-FODLDLE2.js";import{a as c,b as vn,d as fu,e as Ni,f as Ay,g as Bi,i as xe}from"./chunk-YKXDMIHQ.js";var ri=vn(w=>{"use strict";function $e(l,t){var a=l.length;l.push(t);l:for(;0<a;){var u=a-1>>>1,n=l[u];if(0<yn(n,t))l[u]=t,l[a]=n,a=u;else break l}}c($e,"push");function wl(l){return l.length===0?null:l[0]}c(wl,"peek");function hn(l){if(l.length===0)return null;var t=l[0],a=l.pop();if(a!==t){l[0]=a;l:for(var u=0,n=l.length,e=n>>>1;u<e;){var f=2*(u+1)-1,i=l[f],m=f+1,d=l[m];if(0>yn(i,a))m<n&&0>yn(d,i)?(l[u]=d,l[m]=a,u=m):(l[u]=i,l[f]=a,u=f);else if(m<n&&0>yn(d,a))l[u]=d,l[m]=a,u=m;else break l}}return t}c(hn,"pop");function yn(l,t){var a=l.sortIndex-t.sortIndex;return a!==0?a:l.id-t.id}c(yn,"compare");w.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Vi=performance,w.unstable_now=function(){return Vi.now()}):(We=Date,Li=We.now(),w.unstable_now=function(){return We.now()-Li});var Vi,We,Li,tt=[],Et=[],Ty=1,Ql=null,Sl=3,ke=!1,iu=!1,mu=!1,re=!1,Wi=typeof setTimeout=="function"?setTimeout:null,wi=typeof clearTimeout=="function"?clearTimeout:null,Ki=typeof setImmediate<"u"?setImmediate:null;function dn(l){for(var t=wl(Et);t!==null;){if(t.callback===null)hn(Et);else if(t.startTime<=l)hn(Et),t.sortIndex=t.expirationTime,$e(tt,t);else break;t=wl(Et)}}c(dn,"advanceTimers");function Ie(l){if(mu=!1,dn(l),!iu)if(wl(tt)!==null)iu=!0,oa||(oa=!0,ga());else{var t=wl(Et);t!==null&&Pe(Ie,t.startTime-l)}}c(Ie,"handleTimeout");var oa=!1,vu=-1,Fi=5,$i=-1;function ki(){return re?!0:!(w.unstable_now()-$i<Fi)}c(ki,"shouldYieldToHost");function we(){if(re=!1,oa){var l=w.unstable_now();$i=l;var t=!0;try{l:{iu=!1,mu&&(mu=!1,wi(vu),vu=-1),ke=!0;var a=Sl;try{t:{for(dn(l),Ql=wl(tt);Ql!==null&&!(Ql.expirationTime>l&&ki());){var u=Ql.callback;if(typeof u=="function"){Ql.callback=null,Sl=Ql.priorityLevel;var n=u(Ql.expirationTime<=l);if(l=w.unstable_now(),typeof n=="function"){Ql.callback=n,dn(l),t=!0;break t}Ql===wl(tt)&&hn(tt),dn(l)}else hn(tt);Ql=wl(tt)}if(Ql!==null)t=!0;else{var e=wl(Et);e!==null&&Pe(Ie,e.startTime-l),t=!1}}break l}finally{Ql=null,Sl=a,ke=!1}t=void 0}}finally{t?ga():oa=!1}}}c(we,"performWorkUntilDeadline");var ga;typeof Ki=="function"?ga=c(function(){Ki(we)},"schedulePerformWorkUntilDeadline"):typeof MessageChannel<"u"?(Fe=new MessageChannel,Ji=Fe.port2,Fe.port1.onmessage=we,ga=c(function(){Ji.postMessage(null)},"schedulePerformWorkUntilDeadline")):ga=c(function(){Wi(we,0)},"schedulePerformWorkUntilDeadline");var Fe,Ji;function Pe(l,t){vu=Wi(function(){l(w.unstable_now())},t)}c(Pe,"requestHostTimeout");w.unstable_IdlePriority=5;w.unstable_ImmediatePriority=1;w.unstable_LowPriority=4;w.unstable_NormalPriority=3;w.unstable_Profiling=null;w.unstable_UserBlockingPriority=2;w.unstable_cancelCallback=function(l){l.callback=null};w.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Fi=0<l?Math.floor(1e3/l):5};w.unstable_getCurrentPriorityLevel=function(){return Sl};w.unstable_next=function(l){switch(Sl){case 1:case 2:case 3:var t=3;break;default:t=Sl}var a=Sl;Sl=t;try{return l()}finally{Sl=a}};w.unstable_requestPaint=function(){re=!0};w.unstable_runWithPriority=function(l,t){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var a=Sl;Sl=l;try{return t()}finally{Sl=a}};w.unstable_scheduleCallback=function(l,t,a){var u=w.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?u+a:u):a=u,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,l={id:Ty++,callback:t,priorityLevel:l,startTime:a,expirationTime:n,sortIndex:-1},a>u?(l.sortIndex=a,$e(Et,l),wl(tt)===null&&l===wl(Et)&&(mu?(wi(vu),vu=-1):mu=!0,Pe(Ie,a-u))):(l.sortIndex=n,$e(tt,l),iu||ke||(iu=!0,oa||(oa=!0,ga()))),l};w.unstable_shouldYield=ki;w.unstable_wrapCallback=function(l){var t=Sl;return function(){var a=Sl;Sl=t;try{return l.apply(this,arguments)}finally{Sl=a}}}});var Pi=vn((e2,Ii)=>{"use strict";Ii.exports=ri()});var yy=vn(Re=>{"use strict";var el=Pi(),U1=Ni(),Ey=zy();function z(l){var t="https://react.dev/errors/"+l;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+l+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}c(z,"formatProdErrorMessage");function D1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}c(D1,"isValidContainer");function ku(l){var t=l,a=l;if(l.alternate)for(;t.return;)t=t.return;else{l=t;do t=l,(t.flags&4098)!==0&&(a=t.return),l=t.return;while(l)}return t.tag===3?a:null}c(ku,"getNearestMountedFiber");function _1(l){if(l.tag===13){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(_1,"getSuspenseInstanceFromFiber");function N1(l){if(l.tag===31){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(N1,"getActivityInstanceFromFiber");function l0(l){if(ku(l)!==l)throw Error(z(188))}c(l0,"assertIsMounted");function My(l){var t=l.alternate;if(!t){if(t=ku(l),t===null)throw Error(z(188));return t!==l?null:l}for(var a=l,u=t;;){var n=a.return;if(n===null)break;var e=n.alternate;if(e===null){if(u=n.return,u!==null){a=u;continue}break}if(n.child===e.child){for(e=n.child;e;){if(e===a)return l0(n),l;if(e===u)return l0(n),t;e=e.sibling}throw Error(z(188))}if(a.return!==u.return)a=n,u=e;else{for(var f=!1,i=n.child;i;){if(i===a){f=!0,a=n,u=e;break}if(i===u){f=!0,u=n,a=e;break}i=i.sibling}if(!f){for(i=e.child;i;){if(i===a){f=!0,a=e,u=n;break}if(i===u){f=!0,u=e,a=n;break}i=i.sibling}if(!f)throw Error(z(189))}}if(a.alternate!==u)throw Error(z(190))}if(a.tag!==3)throw Error(z(188));return a.stateNode.current===a?l:t}c(My,"findCurrentFiberUsingSlowPath");function H1(l){var t=l.tag;if(t===5||t===26||t===27||t===6)return l;for(l=l.child;l!==null;){if(t=H1(l),t!==null)return t;l=l.sibling}return null}c(H1,"findCurrentHostFiberImpl");var W=Object.assign,Oy=Symbol.for("react.element"),Sn=Symbol.for("react.transitional.element"),su=Symbol.for("react.portal"),Ea=Symbol.for("react.fragment"),B1=Symbol.for("react.strict_mode"),Qc=Symbol.for("react.profiler"),q1=Symbol.for("react.consumer"),mt=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Xc=Symbol.for("react.suspense"),Gc=Symbol.for("react.suspense_list"),Bf=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),Cc=Symbol.for("react.activity"),Uy=Symbol.for("react.memo_cache_sentinel"),t0=Symbol.iterator;function yu(l){return l===null||typeof l!="object"?null:(l=t0&&l[t0]||l["@@iterator"],typeof l=="function"?l:null)}c(yu,"getIteratorFn");var Dy=Symbol.for("react.client.reference");function pc(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Dy?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case Ea:return"Fragment";case Qc:return"Profiler";case B1:return"StrictMode";case Xc:return"Suspense";case Gc:return"SuspenseList";case Cc:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case su:return"Portal";case mt:return l.displayName||"Context";case q1:return(l._context.displayName||"Context")+".Consumer";case Hf:var t=l.render;return l=l.displayName,l||(l=t.displayName||t.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Bf:return t=l.displayName||null,t!==null?t:pc(l.type)||"Memo";case Mt:t=l._payload,l=l._init;try{return pc(l(t))}catch{}}return null}c(pc,"getComponentNameFromType");var zu=Array.isArray,D=U1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=Ey.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,la={pending:!1,data:null,method:null,action:null},Rc=[],Ma=-1;function Il(l){return{current:l}}c(Il,"createCursor");function il(l){0>Ma||(l.current=Rc[Ma],Rc[Ma]=null,Ma--)}c(il,"pop");function L(l,t){Ma++,Rc[Ma]=l.current,l.current=t}c(L,"push");var rl=Il(null),Cu=Il(null),Xt=Il(null),wn=Il(null);function Fn(l,t){switch(L(Xt,t),L(Cu,l),L(rl,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?i1(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=i1(t),l=rv(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}il(rl),L(rl,l)}c(Fn,"pushHostContainer");function ja(){il(rl),il(Cu),il(Xt)}c(ja,"popHostContainer");function Zc(l){l.memoizedState!==null&&L(wn,l);var t=rl.current,a=rv(t,l.type);t!==a&&(L(Cu,l),L(rl,a))}c(Zc,"pushHostContext");function $n(l){Cu.current===l&&(il(rl),il(Cu)),wn.current===l&&(il(wn),wu._currentValue=la)}c($n,"popHostContext");var lc,a0;function kt(l){if(lc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);lc=t&&t[1]||"",a0=-1<a.stack.indexOf(`
|
|
1
|
+
import{a as Yi,b as Ve,c as Ri,d as Je,e as Zi,f as xi,k as ji}from"./chunk-VDRFSHZO.js";import"./chunk-Q4CAKBWN.js";import"./chunk-ZIGHJFAC.js";import"./chunk-RLLKECZT.js";import"./chunk-YPRQLCKF.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import{a as pi}from"./chunk-QKEJLVC5.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import"./chunk-5WJXVZMZ.js";import"./chunk-EVTM6Q43.js";import"./chunk-K7AJEMKE.js";import"./chunk-6D6Z2KXU.js";import{a as Le}from"./chunk-OKG3HWSJ.js";import{W as Xi}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import{a as zy}from"./chunk-4L4WTGN5.js";import{a as Gi}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as Ke}from"./chunk-WGYFNRML.js";import"./chunk-35DM4JJG.js";import"./chunk-4ZEL6BYL.js";import"./chunk-6YJQIQGV.js";import{a as Hi,e as qi}from"./chunk-ZJ6QIZWP.js";import"./chunk-FSRSK4LY.js";import{d as _i}from"./chunk-UEOWRXJ3.js";import"./chunk-FKVZRPV5.js";import"./chunk-WUWBZPUK.js";import{a as Qi,d as je,p as Ci}from"./chunk-FODLDLE2.js";import{a as c,b as vn,d as fu,e as Ni,f as Ay,g as Bi,i as xe}from"./chunk-YKXDMIHQ.js";var ri=vn(w=>{"use strict";function $e(l,t){var a=l.length;l.push(t);l:for(;0<a;){var u=a-1>>>1,n=l[u];if(0<yn(n,t))l[u]=t,l[a]=n,a=u;else break l}}c($e,"push");function wl(l){return l.length===0?null:l[0]}c(wl,"peek");function hn(l){if(l.length===0)return null;var t=l[0],a=l.pop();if(a!==t){l[0]=a;l:for(var u=0,n=l.length,e=n>>>1;u<e;){var f=2*(u+1)-1,i=l[f],m=f+1,d=l[m];if(0>yn(i,a))m<n&&0>yn(d,i)?(l[u]=d,l[m]=a,u=m):(l[u]=i,l[f]=a,u=f);else if(m<n&&0>yn(d,a))l[u]=d,l[m]=a,u=m;else break l}}return t}c(hn,"pop");function yn(l,t){var a=l.sortIndex-t.sortIndex;return a!==0?a:l.id-t.id}c(yn,"compare");w.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Vi=performance,w.unstable_now=function(){return Vi.now()}):(We=Date,Li=We.now(),w.unstable_now=function(){return We.now()-Li});var Vi,We,Li,tt=[],Et=[],Ty=1,Ql=null,Sl=3,ke=!1,iu=!1,mu=!1,re=!1,Wi=typeof setTimeout=="function"?setTimeout:null,wi=typeof clearTimeout=="function"?clearTimeout:null,Ki=typeof setImmediate<"u"?setImmediate:null;function dn(l){for(var t=wl(Et);t!==null;){if(t.callback===null)hn(Et);else if(t.startTime<=l)hn(Et),t.sortIndex=t.expirationTime,$e(tt,t);else break;t=wl(Et)}}c(dn,"advanceTimers");function Ie(l){if(mu=!1,dn(l),!iu)if(wl(tt)!==null)iu=!0,oa||(oa=!0,ga());else{var t=wl(Et);t!==null&&Pe(Ie,t.startTime-l)}}c(Ie,"handleTimeout");var oa=!1,vu=-1,Fi=5,$i=-1;function ki(){return re?!0:!(w.unstable_now()-$i<Fi)}c(ki,"shouldYieldToHost");function we(){if(re=!1,oa){var l=w.unstable_now();$i=l;var t=!0;try{l:{iu=!1,mu&&(mu=!1,wi(vu),vu=-1),ke=!0;var a=Sl;try{t:{for(dn(l),Ql=wl(tt);Ql!==null&&!(Ql.expirationTime>l&&ki());){var u=Ql.callback;if(typeof u=="function"){Ql.callback=null,Sl=Ql.priorityLevel;var n=u(Ql.expirationTime<=l);if(l=w.unstable_now(),typeof n=="function"){Ql.callback=n,dn(l),t=!0;break t}Ql===wl(tt)&&hn(tt),dn(l)}else hn(tt);Ql=wl(tt)}if(Ql!==null)t=!0;else{var e=wl(Et);e!==null&&Pe(Ie,e.startTime-l),t=!1}}break l}finally{Ql=null,Sl=a,ke=!1}t=void 0}}finally{t?ga():oa=!1}}}c(we,"performWorkUntilDeadline");var ga;typeof Ki=="function"?ga=c(function(){Ki(we)},"schedulePerformWorkUntilDeadline"):typeof MessageChannel<"u"?(Fe=new MessageChannel,Ji=Fe.port2,Fe.port1.onmessage=we,ga=c(function(){Ji.postMessage(null)},"schedulePerformWorkUntilDeadline")):ga=c(function(){Wi(we,0)},"schedulePerformWorkUntilDeadline");var Fe,Ji;function Pe(l,t){vu=Wi(function(){l(w.unstable_now())},t)}c(Pe,"requestHostTimeout");w.unstable_IdlePriority=5;w.unstable_ImmediatePriority=1;w.unstable_LowPriority=4;w.unstable_NormalPriority=3;w.unstable_Profiling=null;w.unstable_UserBlockingPriority=2;w.unstable_cancelCallback=function(l){l.callback=null};w.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Fi=0<l?Math.floor(1e3/l):5};w.unstable_getCurrentPriorityLevel=function(){return Sl};w.unstable_next=function(l){switch(Sl){case 1:case 2:case 3:var t=3;break;default:t=Sl}var a=Sl;Sl=t;try{return l()}finally{Sl=a}};w.unstable_requestPaint=function(){re=!0};w.unstable_runWithPriority=function(l,t){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var a=Sl;Sl=l;try{return t()}finally{Sl=a}};w.unstable_scheduleCallback=function(l,t,a){var u=w.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?u+a:u):a=u,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,l={id:Ty++,callback:t,priorityLevel:l,startTime:a,expirationTime:n,sortIndex:-1},a>u?(l.sortIndex=a,$e(Et,l),wl(tt)===null&&l===wl(Et)&&(mu?(wi(vu),vu=-1):mu=!0,Pe(Ie,a-u))):(l.sortIndex=n,$e(tt,l),iu||ke||(iu=!0,oa||(oa=!0,ga()))),l};w.unstable_shouldYield=ki;w.unstable_wrapCallback=function(l){var t=Sl;return function(){var a=Sl;Sl=t;try{return l.apply(this,arguments)}finally{Sl=a}}}});var Pi=vn((e2,Ii)=>{"use strict";Ii.exports=ri()});var yy=vn(Re=>{"use strict";var el=Pi(),U1=Ni(),Ey=zy();function z(l){var t="https://react.dev/errors/"+l;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+l+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}c(z,"formatProdErrorMessage");function D1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}c(D1,"isValidContainer");function ku(l){var t=l,a=l;if(l.alternate)for(;t.return;)t=t.return;else{l=t;do t=l,(t.flags&4098)!==0&&(a=t.return),l=t.return;while(l)}return t.tag===3?a:null}c(ku,"getNearestMountedFiber");function _1(l){if(l.tag===13){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(_1,"getSuspenseInstanceFromFiber");function N1(l){if(l.tag===31){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(N1,"getActivityInstanceFromFiber");function l0(l){if(ku(l)!==l)throw Error(z(188))}c(l0,"assertIsMounted");function My(l){var t=l.alternate;if(!t){if(t=ku(l),t===null)throw Error(z(188));return t!==l?null:l}for(var a=l,u=t;;){var n=a.return;if(n===null)break;var e=n.alternate;if(e===null){if(u=n.return,u!==null){a=u;continue}break}if(n.child===e.child){for(e=n.child;e;){if(e===a)return l0(n),l;if(e===u)return l0(n),t;e=e.sibling}throw Error(z(188))}if(a.return!==u.return)a=n,u=e;else{for(var f=!1,i=n.child;i;){if(i===a){f=!0,a=n,u=e;break}if(i===u){f=!0,u=n,a=e;break}i=i.sibling}if(!f){for(i=e.child;i;){if(i===a){f=!0,a=e,u=n;break}if(i===u){f=!0,u=e,a=n;break}i=i.sibling}if(!f)throw Error(z(189))}}if(a.alternate!==u)throw Error(z(190))}if(a.tag!==3)throw Error(z(188));return a.stateNode.current===a?l:t}c(My,"findCurrentFiberUsingSlowPath");function H1(l){var t=l.tag;if(t===5||t===26||t===27||t===6)return l;for(l=l.child;l!==null;){if(t=H1(l),t!==null)return t;l=l.sibling}return null}c(H1,"findCurrentHostFiberImpl");var W=Object.assign,Oy=Symbol.for("react.element"),Sn=Symbol.for("react.transitional.element"),su=Symbol.for("react.portal"),Ea=Symbol.for("react.fragment"),B1=Symbol.for("react.strict_mode"),Qc=Symbol.for("react.profiler"),q1=Symbol.for("react.consumer"),mt=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Xc=Symbol.for("react.suspense"),Gc=Symbol.for("react.suspense_list"),Bf=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),Cc=Symbol.for("react.activity"),Uy=Symbol.for("react.memo_cache_sentinel"),t0=Symbol.iterator;function yu(l){return l===null||typeof l!="object"?null:(l=t0&&l[t0]||l["@@iterator"],typeof l=="function"?l:null)}c(yu,"getIteratorFn");var Dy=Symbol.for("react.client.reference");function pc(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Dy?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case Ea:return"Fragment";case Qc:return"Profiler";case B1:return"StrictMode";case Xc:return"Suspense";case Gc:return"SuspenseList";case Cc:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case su:return"Portal";case mt:return l.displayName||"Context";case q1:return(l._context.displayName||"Context")+".Consumer";case Hf:var t=l.render;return l=l.displayName,l||(l=t.displayName||t.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Bf:return t=l.displayName||null,t!==null?t:pc(l.type)||"Memo";case Mt:t=l._payload,l=l._init;try{return pc(l(t))}catch{}}return null}c(pc,"getComponentNameFromType");var zu=Array.isArray,D=U1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=Ey.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,la={pending:!1,data:null,method:null,action:null},Rc=[],Ma=-1;function Il(l){return{current:l}}c(Il,"createCursor");function il(l){0>Ma||(l.current=Rc[Ma],Rc[Ma]=null,Ma--)}c(il,"pop");function L(l,t){Ma++,Rc[Ma]=l.current,l.current=t}c(L,"push");var rl=Il(null),Cu=Il(null),Xt=Il(null),wn=Il(null);function Fn(l,t){switch(L(Xt,t),L(Cu,l),L(rl,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?i1(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=i1(t),l=rv(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}il(rl),L(rl,l)}c(Fn,"pushHostContainer");function ja(){il(rl),il(Cu),il(Xt)}c(ja,"popHostContainer");function Zc(l){l.memoizedState!==null&&L(wn,l);var t=rl.current,a=rv(t,l.type);t!==a&&(L(Cu,l),L(rl,a))}c(Zc,"pushHostContext");function $n(l){Cu.current===l&&(il(rl),il(Cu)),wn.current===l&&(il(wn),wu._currentValue=la)}c($n,"popHostContext");var lc,a0;function kt(l){if(lc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);lc=t&&t[1]||"",a0=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
3
|
`+lc+l+a0}c(kt,"describeBuiltInComponentFrame");var tc=!1;function ac(l,t){if(!l||tc)return"";tc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:c(function(){try{if(t){var b=c(function(){throw Error()},"Fake");if(Object.defineProperty(b.prototype,"props",{set:c(function(){throw Error()},"set")}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(g){var S=g}Reflect.construct(l,[],b)}else{try{b.call()}catch(g){S=g}l.call(b.prototype)}}else{try{throw Error()}catch(g){S=g}(b=l())&&typeof b.catch=="function"&&b.catch(function(){})}}catch(g){if(g&&S&&typeof g.stack=="string")return[g.stack,S.stack]}return[null,null]},"DetermineComponentFrameRoot")};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var e=u.DetermineComponentFrameRoot(),f=e[0],i=e[1];if(f&&i){var m=f.split(`
|
|
4
4
|
`),d=i.split(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/studio",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.205",
|
|
4
4
|
"description": "The Lunora Studio: a local admin UI for your schema, data, logs, and advisors",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin-ui",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"@hugeicons/react": "^1.1.10",
|
|
59
59
|
"@lingui/core": "^6.6.0",
|
|
60
60
|
"@lingui/message-utils": "^6.6.0",
|
|
61
|
-
"@lunora/advisor": "1.0.0-alpha.
|
|
62
|
-
"@lunora/bindings": "1.0.0-alpha.
|
|
63
|
-
"@lunora/client": "1.0.0-alpha.
|
|
64
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
65
|
-
"@lunora/react": "1.0.0-alpha.
|
|
61
|
+
"@lunora/advisor": "1.0.0-alpha.150",
|
|
62
|
+
"@lunora/bindings": "1.0.0-alpha.68",
|
|
63
|
+
"@lunora/client": "1.0.0-alpha.128",
|
|
64
|
+
"@lunora/errors": "1.0.0-alpha.41",
|
|
65
|
+
"@lunora/react": "1.0.0-alpha.134",
|
|
66
66
|
"@tanstack/react-query": "5.101.4",
|
|
67
67
|
"@tanstack/react-router": "^1.170.32",
|
|
68
68
|
"@tanstack/react-table": "^9.2.4",
|