import{h as n,d as c,e as i,f as u,q as a,g as s}from"./index-CHN8jahE.js";const o=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],p=n("file",o);const l=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],j=n("folder",l);const y=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],q=n("rotate-ccw",y);function v(e){const t={};return e?.page!=null&&(t.page=String(e.page)),e?.limit!=null&&(t.limit=String(e.limit)),e?.includeArchived&&(t.includeArchived="true"),c({queryKey:a.projects.list(e),queryFn:()=>s.get("/projects",{params:t})})}function f(e){return c({queryKey:a.projects.detail(e),queryFn:()=>s.get(`/projects/${e}`),enabled:!!e})}function h(){const e=i();return u({mutationFn:t=>s.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:a.projects.all})}})}function K(){const e=i();return u({mutationFn:({id:t,...r})=>s.put(`/projects/${t}`,r),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:a.projects.all}),e.invalidateQueries({queryKey:a.projects.detail(r.id)})}})}function Q(){const e=i();return u({mutationFn:({id:t,deleteRepo:r})=>s.post(`/projects/${t}/archive`,{deleteRepo:r??!1}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:a.projects.all}),e.invalidateQueries({queryKey:a.projects.detail(r.id)}),e.invalidateQueries({queryKey:a.tasks.all}),e.invalidateQueries({queryKey:a.workspaces.all})}})}function k(){const e=i();return u({mutationFn:({id:t,repoPath:r})=>s.post(`/projects/${t}/restore`,r?{repoPath:r}:{}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:a.projects.all}),e.invalidateQueries({queryKey:a.projects.detail(r.id)}),e.invalidateQueries({queryKey:a.tasks.all}),e.invalidateQueries({queryKey:a.workspaces.all})}})}export{j as F,q as R,p as a,K as b,Q as c,k as d,f as e,h as f,v as u};
