import{t as e}from"./react-9ZmE0_ty.js";import{a as t,t as n}from"./panel-store-BETELS-N.js";var r=e()(()=>({tabs:[],activeTabId:null,tabHistory:[],currentProject:null,switchProject:e=>{n.getState().switchProject(e),i()},openTab:e=>{let t=n.getState().openTab(e);return i(),t},closeTab:e=>{n.getState().closeTab(e),i()},setActiveTab:e=>{n.getState().setActiveTab(e),i()},updateTab:(e,t)=>{n.getState().updateTab(e,t),i()},openNewFile:()=>{let e=n.getState(),r=t(e.panels),a=e.openTab({type:`editor`,title:`Untitled-${r}`,projectId:null,metadata:{isUntitled:!0,untitledNumber:r},closable:!0});return i(),a}}));function i(){let e=n.getState(),t=e.panels[e.focusedPanelId];r.setState({tabs:t?.tabs??[],activeTabId:t?.activeTabId??null,tabHistory:t?.tabHistory??[],currentProject:e.currentProject})}n.subscribe(()=>i());export{r as t};