import{a2 as s,B as e,l as a,a3 as l}from"./nMEF9Rpo.js";const n=s(async(s,n)=>{let i,t;const o=s.params.projectId||null,r=s.params.sessionId||null,c=e(),u=a();if(o||r||c.setCurrentSession(null,null,{cwd:null,projectDisplayName:null,sessionSummary:null,isSessionAlive:!1}),o||r){let s=null,e=null,a=null,n=!1;if(r)try{n=([i,t]=l(()=>$fetch(`/api/sessions/${r}/status`)),i=await i,t(),i).alive}catch(p){}if(o){0!==u.projects.length||u.loading||([i,t]=l(()=>u.loadProjects()),await i,t());const n=u.projects.find(s=>s.name===o);if(n&&(s=n.cwd,e=n.displayName,r)){u.projectSessions[o]||([i,t]=l(()=>u.loadSessions(o)),await i,t());const e=u.projectSessions[o],n=e?.find(s=>s.id===r);n&&(a=n.summary,n.cwd&&(s=n.cwd))}}c.setCurrentSession(o,r,{cwd:s,projectDisplayName:e,sessionSummary:a,isSessionAlive:n})}c.preserveMessages=!1});export{n as default};
