import{u as g,_ as k,a as w,n as C}from"./BDdw0euO.js";import{g as b,h as $,i as y,j as N,o as B,d as I,b as e,w as o,a as R,k as S,l as T,m as n}from"./BAy_whwk.js";import{_ as U,a as D}from"./CjWwlDPP.js";import{u as q,_ as E,a as V}from"./DoNvPlqr.js";import"./DYfrkrYL.js";const z={class:"flex h-screen min-h-0 flex-1 min-w-0"},M={class:"flex items-center gap-2"},L=b({__name:"index",setup(O){const c=$(),u=y(),{togglePanel:i}=q(),{loaded:l,refreshProjects:_,getProject:p,pendingProjectId:d}=g(),t=n(()=>C(c.params.projectId)),m=n(()=>p(t.value)),s=n(()=>{if(!t.value)return"Offline";if(d.value===t.value)return"Starting";switch(m.value?.status){case"running":return"Running";case"stopped":return"Stopped";case"error":return"Error";default:return"Checking"}}),f=async()=>{t.value&&await u.push(`/projects/${t.value}`)};return N(()=>{l.value||_()}),(W,A)=>{const h=w,a=k,r=S,v=U,j=E,x=D,P=V;return B(),I("div",z,[e(x,{id:"project-shell",class:"min-h-0 min-w-0 flex-1",ui:{root:"!p-0",body:"!p-0 sm:!p-0 !gap-0 sm:!gap-0"}},{header:o(()=>[e(v,{title:t.value??"Project",icon:"i-lucide-folder-git-2"},{right:o(()=>[R("div",M,[e(a,{text:`RPC ${s.value}`},{default:o(()=>[e(h,{status:s.value,pulse:"",padded:""},null,8,["status"])]),_:1},8,["text"]),e(a,{text:"New thread"},{default:o(()=>[e(r,{icon:"i-lucide-plus",color:"primary",variant:"soft",square:"",onClick:f})]),_:1}),e(a,{text:"Previous threads"},{default:o(()=>[e(r,{icon:"i-lucide-history",color:"neutral",variant:"outline",square:"",onClick:T(i)},null,8,["onClick"])]),_:1})])]),_:1},8,["title"])]),body:o(()=>[e(j,{"project-id":t.value??"",class:"min-h-0 flex-1"},null,8,["project-id"])]),_:1}),e(P,{"project-id":t.value},null,8,["project-id"])])}}});export{L as default};
