@tickernelz/paperclip-pro-ui 2026.1023.1 → 2026.1024.0

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.
Files changed (87) hide show
  1. package/dist/assets/AgentAvatar-CXBfQ6pz.js +1 -0
  2. package/dist/assets/Agents.production-B5XXJ2wN.js +2 -0
  3. package/dist/assets/BreadcrumbContext-CmzhWkn9.js +1 -0
  4. package/dist/assets/CompanyActivity.production-1GZhq-K5.js +1 -0
  5. package/dist/assets/{CompanyExport-iwRD6Ak0.js → CompanyExport-CNu_xL_7.js} +3 -3
  6. package/dist/assets/{CompanySkills.production-BNQwI1_u.js → CompanySkills.production-YrmJa9Vy.js} +2 -2
  7. package/dist/assets/EmptyState-B6HqDhhl.js +1 -0
  8. package/dist/assets/{MarkdownBody-Cweo3KGi.js → MarkdownBody-DXX_MrOZ.js} +5 -5
  9. package/dist/assets/{MarkdownEditor-B6u1nGzv.js → MarkdownEditor-C0MQKETk.js} +16 -16
  10. package/dist/assets/OrgChart.production-3TDu-rpn.js +1 -0
  11. package/dist/assets/{PageSkeleton-Bxzx6LdM.js → PageSkeleton-CzsquFSq.js} +1 -1
  12. package/dist/assets/RoutineDetail.production-Dbg7SxCr.js +1 -0
  13. package/dist/assets/{RoutineRunVariablesDialog-BTO1cGhY.js → RoutineRunVariablesDialog-R9R_pIYM.js} +2 -2
  14. package/dist/assets/Routines.production-wYPaLAXL.js +1 -0
  15. package/dist/assets/StatusIcon-D50dDCBL.js +1 -0
  16. package/dist/assets/Terminal-ByJxc__B.js +1 -0
  17. package/dist/assets/ToastContext-Dj6kHjBt.js +1 -0
  18. package/dist/assets/access-BP0uIEvm.js +1 -0
  19. package/dist/assets/agent-avatar-url-CKjwadh7.js +1 -0
  20. package/dist/assets/agents-BnTeL72d.js +15 -0
  21. package/dist/assets/{alert-dialog-CqvHCY2y.js → alert-dialog-BVgYDfs5.js} +1 -1
  22. package/dist/assets/arrow-right-yI8KLv06.js +1 -0
  23. package/dist/assets/arrow-up-DoquRvt-.js +1 -0
  24. package/dist/assets/{badge-6KBG4DJ9.js → badge-CZKC9uUT.js} +1 -1
  25. package/dist/assets/bot-DqtgSgxB.js +1 -0
  26. package/dist/assets/{card-Bz65aUPI.js → card-CLrZE3zB.js} +1 -1
  27. package/dist/assets/{check-C7890FPo.js → check-B8hWCPEY.js} +1 -1
  28. package/dist/assets/checkbox-9ullTWTl.js +1 -0
  29. package/dist/assets/chevron-down-CdGqWSzz.js +1 -0
  30. package/dist/assets/clipboard-D6M0E1wp.js +1 -0
  31. package/dist/assets/company-members-Duugb3uG.js +1 -0
  32. package/dist/assets/createLucideIcon-DwVwDVEQ.js +134 -0
  33. package/dist/assets/{definition-BHM7rMPG.js → definition-cSCCeU7R.js} +1 -1
  34. package/dist/assets/dist-94psnYQg.js +1 -0
  35. package/dist/assets/dist-BLg9eYEC.js +1 -0
  36. package/dist/assets/dist-DGt1Bt7m.js +1 -0
  37. package/dist/assets/dist-OejlA9DH.js +1 -0
  38. package/dist/assets/dropdown-menu-ByiK1BlD.js +1 -0
  39. package/dist/assets/environments-BQaMNey_.js +1 -0
  40. package/dist/assets/{external-link-DggAY2Qs.js → external-link-0PKOUbZP.js} +1 -1
  41. package/dist/assets/{file-text-BWHzh5pq.js → file-text-Daxr7tUE.js} +1 -1
  42. package/dist/assets/{health-I-sCu61_.js → health-Dm97GTVw.js} +1 -1
  43. package/dist/assets/{heartbeats-DTwjV2kl.js → heartbeats-CZVMH9s8.js} +1 -1
  44. package/dist/assets/{index-jaWIjVIN.css → index-BJUeQIKY.css} +1 -1
  45. package/dist/assets/{index-D4-wU1bZ.js → index-Bzln5Ksp.js} +346 -199
  46. package/dist/assets/{input-ConoHcjz.js → input-rJVxQSgj.js} +1 -1
  47. package/dist/assets/instanceSettings-DuE48Bn5.js +1 -0
  48. package/dist/assets/label-CvkHqiK_.js +5 -0
  49. package/dist/assets/{mention-chips--Lp_ENqh.js → mention-chips-BkED6NiN.js} +9 -9
  50. package/dist/assets/{rotate-ccw-BUHfDFfI.js → rotate-ccw-sgBZvjSw.js} +1 -1
  51. package/dist/assets/save-V2f8XCvd.js +1 -0
  52. package/dist/assets/{select-C35A5IGs.js → select-XFvlcP6w.js} +1 -1
  53. package/dist/assets/sheet-BNPM7z3e.js +1 -0
  54. package/dist/assets/{skeleton-5VMhNzFs.js → skeleton-BmxbZVmQ.js} +1 -1
  55. package/dist/assets/{tabs-BNIJaxKM.js → tabs-BC_ScIgQ.js} +1 -1
  56. package/dist/assets/use-adapter-capabilities-FfDsq8WI.js +1 -0
  57. package/dist/assets/useHiddenSettings-Dobu8_xG.js +1 -0
  58. package/dist/assets/usePrefersReducedMotion-CkujTZ1k.js +1 -0
  59. package/dist/assets/x-XhYFJqIj.js +1 -0
  60. package/dist/index.html +50 -40
  61. package/dist/sw.js +1 -1
  62. package/package.json +1 -1
  63. package/dist/assets/AgentAvatar-CpQ88dwV.js +0 -1
  64. package/dist/assets/Agents.production-BbnOCG3N.js +0 -2
  65. package/dist/assets/BreadcrumbContext-c2KosyR8.js +0 -15
  66. package/dist/assets/CompanyActivity.production-tn4aIPJ7.js +0 -1
  67. package/dist/assets/EmptyState-DN8b4Qse.js +0 -1
  68. package/dist/assets/OrgChart.production-BJK4TNBI.js +0 -1
  69. package/dist/assets/RoutineDetail.production-DqgQQico.js +0 -1
  70. package/dist/assets/Routines.production-DQ5PjoiB.js +0 -1
  71. package/dist/assets/StatusIcon-BE5kFgZJ.js +0 -1
  72. package/dist/assets/ToastContext-FzmhiqZ4.js +0 -1
  73. package/dist/assets/agent-avatar-url-B_lUFC64.js +0 -134
  74. package/dist/assets/arrow-right-D3mUepq9.js +0 -1
  75. package/dist/assets/bot-Da_kJHpD.js +0 -1
  76. package/dist/assets/checkbox-Ds_3QqBB.js +0 -1
  77. package/dist/assets/clipboard-C4aDsmO8.js +0 -1
  78. package/dist/assets/company-members-BznLwAUd.js +0 -1
  79. package/dist/assets/dist-BXR8yTPD.js +0 -1
  80. package/dist/assets/dist-C4Rm-j8X.js +0 -1
  81. package/dist/assets/dist-CXUn2R-_.js +0 -1
  82. package/dist/assets/environments-B_qPdIBY.js +0 -1
  83. package/dist/assets/label-xpLcJrPL.js +0 -5
  84. package/dist/assets/sheet-TOBEGi0m.js +0 -1
  85. package/dist/assets/use-adapter-capabilities-KPGiuHeG.js +0 -1
  86. package/dist/assets/use-copy-action-DnjVh8kP.js +0 -1
  87. package/dist/assets/useHiddenSettings-CeQYvKer.js +0 -1
@@ -0,0 +1 @@
1
+ var ks=Object.defineProperty;var t=(n,c)=>ks(n,"name",{value:c,configurable:!0});import{i as as}from"./rolldown-runtime-ZpX3ckPj.js";import{$i as A,Fa as Ps,I as As,Ma as Ms,Na as Ds,Qi as S,ot as Ts,pt as m}from"./createLucideIcon-DwVwDVEQ.js";import{Lt as ze,Mt as Ge,Nn as qs,Pt as We,an as Ks,nn as Ye,s as Es,st as Us,t as Os}from"./agents-BnTeL72d.js";import{b as ls,v as He,y as Je}from"./label-CvkHqiK_.js";import{Ft as Ls,It as Qs,Mt as Bs,Nr as ee,Nt as Vs,Rr as $s,V as zs,jt as Gs,r as Ws,t as Ys,wt as Xe,x as he}from"./RoutineRunVariablesDialog-R9R_pIYM.js";import{t as Ze}from"./AgentAvatar-CXBfQ6pz.js";import{a as Hs,r as Js}from"./checkbox-9ullTWTl.js";import{l as J,t as Xs}from"./MarkdownEditor-C0MQKETk.js";import{n as es,t as Zs}from"./tabs-BC_ScIgQ.js";import{h as et}from"./StatusIcon-D50dDCBL.js";import{t as st}from"./check-B8hWCPEY.js";import{t as tt}from"./chevron-down-CdGqWSzz.js";import{r as cs}from"./clipboard-D6M0E1wp.js";import{a as X,c as je,l as ye,n as ve,r as be}from"./select-XFvlcP6w.js";import{n as nt,r as F,s as Z}from"./BreadcrumbContext-CmzhWkn9.js";import{t as rt}from"./heartbeats-CZVMH9s8.js";import{a as it}from"./ToastContext-Dj6kHjBt.js";import{t as ot}from"./access-BP0uIEvm.js";import{i as at}from"./company-members-Duugb3uG.js";import{r as lt,t as ct}from"./card-CLrZE3zB.js";import{t as we}from"./EmptyState-B6HqDhhl.js";import{t as dt}from"./PageSkeleton-CzsquFSq.js";import{$ as ut,$t as mt,G as pt,J as ft,K as gt,Q as xt,X as ht,Xt as jt,Y as yt,Z as vt,dt as bt,en as wt,et as Nt,ft as M,nt as It,q as Rt,tt as Ct,ut as _t}from"./index-Bzln5Ksp.js";var l=as(Ps(),1),s=as(Ds(),1),St=["coalesce_if_active","always_enqueue","skip_if_active"],Ft=["skip_missed","enqueue_missed_with_cap"],kt={coalesce_if_active:"If a run is already active, keep just one follow-up run queued.",always_enqueue:"Queue every trigger occurrence, even if the routine is already running.",skip_if_active:"Drop new trigger occurrences while a run is still active."},Pt={skip_missed:"Ignore windows that were missed while the scheduler or routine was paused.",enqueue_missed_with_cap:"Catch up missed schedule windows after recovery; sub-hourly schedules are combined into one catch-up run, slower schedules replay each missed window up to a cap."};function ss(n){n&&(n.style.height="auto",n.style.height=`${n.scrollHeight}px`)}t(ss,"autoResizeTextarea");var At="__built_in_routines",ts={sortField:"title",sortDir:"asc",groupBy:"folder",collapsedGroups:[]};function ns(n){try{const c=localStorage.getItem(n);if(c)return{...ts,...JSON.parse(c)}}catch{}return{...ts}}t(ns,"getRoutineViewState");function Mt(n,c){localStorage.setItem(n,JSON.stringify(c))}t(Mt,"saveRoutineViewState");function q(n){if(!n)return Number.NEGATIVE_INFINITY;const c=new Date(n).getTime();return Number.isFinite(c)?c:Number.NEGATIVE_INFINITY}t(q,"timestampValue");function rs(n,c){return(n??"").localeCompare(c??"",void 0,{sensitivity:"base"})}t(rs,"compareNullableText");function Dt(n){return{...n,description:n.description.trim()||null,projectId:n.projectId||null,folderId:n.folderId||null,assigneeAgentId:n.assigneeAgentId||null}}t(Dt,"buildRoutineMutationPayload");function Tt(n,c,d,b,g){if(c==="none")return[{key:"__all",label:null,items:n}];if(c==="folder"){const i=he(n,o=>o.folderId??"__unfiled");return Object.keys(i).sort((o,j)=>{if(o==="__unfiled"||j==="__unfiled")return o===j?0:o==="__unfiled"?1:-1;const w=g.get(o),I=g.get(j),O=(Number.isFinite(w?.position)?w.position:Number.POSITIVE_INFINITY)-(Number.isFinite(I?.position)?I.position:Number.POSITIVE_INFINITY);return O!==0?O:(w?.name??"Unknown folder").localeCompare(I?.name??"Unknown folder",void 0,{sensitivity:"base"})||o.localeCompare(j)}).map(o=>({key:o,label:o==="__unfiled"?"Unfiled":g.get(o)?.name??"Unknown folder",items:i[o]}))}if(c==="project"){const i=he(n,o=>o.projectId??"__no_project");return Object.keys(i).sort((o,j)=>{const w=o==="__no_project"?"No project":d.get(o)?.name??"Unknown project",I=j==="__no_project"?"No project":d.get(j)?.name??"Unknown project";return w.localeCompare(I)}).map(o=>({key:o,label:o==="__no_project"?"No project":d.get(o)?.name??"Unknown project",items:i[o]}))}const x=he(n,i=>i.assigneeAgentId??"__unassigned");return Object.keys(x).sort((i,o)=>{const j=i==="__unassigned"?"Unassigned":b.get(i)?.name??"Unknown agent",w=o==="__unassigned"?"Unassigned":b.get(o)?.name??"Unknown agent";return j.localeCompare(w)}).map(i=>({key:i,label:i==="__unassigned"?"Unassigned":b.get(i)?.name??"Unknown agent",items:x[i]}))}t(Tt,"buildRoutineGroups");function is(n){return n.originKind==="built_in_agent_bundle"}t(is,"isBuiltInRoutine");function qt(n,c,d,b,g){const x=n.filter(is),i=Tt(n.filter(o=>!is(o)),c,d,b,g).filter(o=>o.items.length>0).map(o=>x.length>0&&c==="none"&&o.key==="__all"?{...o,label:"Custom routines"}:o);return x.length===0?i:[...i,{key:At,label:"Built-in routines",items:x}]}t(qt,"buildRoutineSections");function Kt(n,c,d){const b=d==="asc"?1:-1;return[...n].sort((g,x)=>{let i=0;return c==="title"?i=rs(g.title,x.title):c==="created"?i=q(g.createdAt)-q(x.createdAt):c==="lastRun"?i=q(g.lastRun?.triggeredAt??g.lastTriggeredAt)-q(x.lastRun?.triggeredAt??x.lastTriggeredAt):i=q(g.updatedAt)-q(x.updatedAt),i!==0?i*b:rs(g.title,x.title)})}t(Kt,"sortRoutines");function os(n){return n==="runs"?"/routines?tab=runs":"/routines"}t(os,"buildRoutinesTabHref");function Et({label:n,count:c,isOpen:d}){return(0,s.jsxs)("div",{className:`flex items-center gap-2 rounded-lg border border-border px-3 py-2${d?" mb-1":""}`,children:[(0,s.jsxs)(ls,{className:"flex items-center gap-1.5",children:[(0,s.jsx)(cs,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform [[data-state=open]>&]:rotate-90"}),(0,s.jsx)("span",{className:"text-sm font-semibold uppercase tracking-wide",children:n})]}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:c})]})}t(Et,"RoutineSectionHeader");function un(){const{selectedCompanyId:n}=Ts(),{setBreadcrumbs:c}=nt(),d=Ms(),b=Es(),[g,x]=qs(),{pushToast:i}=it(),o=(0,l.useRef)(null),j=(0,l.useRef)(null),w=(0,l.useRef)(null),I=(0,l.useRef)(null),[O,K]=(0,l.useState)(!1),[se,L]=(0,l.useState)(null),[Q,te]=(0,l.useState)(null),[ds,Ne]=(0,l.useState)(!1),[ne,re]=(0,l.useState)(!1),[B,V]=(0,l.useState)([]),[Ie,Re]=(0,l.useState)([]),[us,Ce]=(0,l.useState)(null),[ms,_e]=(0,l.useState)(null),[k,ie]=(0,l.useState)(null),[$,z]=(0,l.useState)(!1),[Se,oe]=(0,l.useState)(!1),P=g.get("tab")==="runs"?"runs":"routines",[p,R]=(0,l.useState)({title:"",description:"",projectId:"",folderId:null,assigneeAgentId:"",priority:"medium",concurrencyPolicy:"coalesce_if_active",catchUpPolicy:"skip_missed",variables:[]}),G=n?`paperclip:routines-view:${n}`:"paperclip:routines-view",[u,Fe]=(0,l.useState)(()=>ns(G)),f=Ct(g.get("folder"));(0,l.useEffect)(()=>{c([{label:"Routines"}])},[c]),(0,l.useEffect)(()=>{Fe(ns(G))},[G]);const{data:ke,isLoading:ps,error:ae}=A({queryKey:m.routines.list(n),queryFn:t(()=>J.list(n),"queryFn"),enabled:!!n}),{data:h,isLoading:Pe}=A({queryKey:m.folders.list(n,"routine"),queryFn:t(()=>M.list(n,"routine"),"queryFn"),enabled:!!n&&P==="routines"}),{data:C}=A({queryKey:m.agents.list(n),queryFn:t(()=>Os.list(n),"queryFn"),enabled:!!n}),{data:_}=A({queryKey:m.projects.list(n,{includeArchived:!0}),queryFn:t(()=>et.list(n,{includeArchived:!0}),"queryFn"),enabled:!!n}),{data:Ae}=A({queryKey:m.access.companyUserDirectory(n),queryFn:t(()=>ot.listUserDirectory(n),"queryFn"),enabled:!!n}),{data:le,isLoading:fs,error:gs}=A({queryKey:[...m.issues.list(n),"routine-executions"],queryFn:t(()=>Ye.list(n,{originKind:"routine_execution"}),"queryFn"),enabled:!!n&&P==="runs"}),Me=m.liveRuns(n),ce=wt({companyId:n,resourceKey:"live-runs",queryKey:Me,enabled:!!n&&P==="runs",refetchInterval:!1,leaderOnly:!0}),{data:de,dataUpdatedAt:xs}=A({queryKey:Me,queryFn:t(()=>rt.liveRunsForCompany(n),"queryFn"),enabled:ce.enabled,refetchInterval:ce.refetchInterval});mt(ce,de,xs),(0,l.useEffect)(()=>{ss(j.current)},[p.title,$]);const hs=(0,l.useMemo)(()=>at({agents:C,projects:(_??[]).filter(e=>!e.archivedAt),members:Ae?.users}),[C,Ae?.users,_]),N=S({mutationFn:t(()=>J.create(n,Dt(p)),"mutationFn"),onSuccess:t(async e=>{R({title:"",description:"",projectId:"",folderId:null,assigneeAgentId:"",priority:"medium",concurrencyPolicy:"coalesce_if_active",catchUpPolicy:"skip_missed",variables:[]}),z(!1),oe(!1),await d.invalidateQueries({queryKey:m.routines.list(n)}),i({title:"Routine created",body:e.assigneeAgentId?"Add the first trigger to turn it into a live workflow.":"Draft saved. Add a default agent before enabling automation.",tone:"success"}),b(`/routines/${e.id}?tab=triggers`)},"onSuccess")}),De=S({mutationFn:t(e=>M.create(n,{kind:"routine",...e}),"mutationFn"),onSuccess:t(async e=>{if(K(!1),L(null),await d.invalidateQueries({queryKey:m.folders.list(n,"routine")}),Ie.length>0){const r=Ie;Re([]);try{await Promise.all(r.map(a=>M.moveItem(n,{kind:"routine",itemId:a,folderId:e.id}))),await Promise.all([d.invalidateQueries({queryKey:m.routines.list(n)}),d.invalidateQueries({queryKey:m.folders.list(n,"routine")})])}catch(a){i({title:"Folder created, move failed",body:a instanceof Error?a.message:"Paperclip could not move the selected routines.",tone:"error"});return}}else Y(e.id);i({title:"Folder created",body:e.name,tone:"success"})},"onSuccess"),onError:t(e=>{i({title:"Failed to save folder",body:e instanceof Error?e.message:"Paperclip could not save the folder.",tone:"error"})},"onError")}),ue=S({mutationFn:t(({folderId:e,payload:r})=>M.update(n,e,r),"mutationFn"),onSuccess:t(async()=>{K(!1),L(null),await d.invalidateQueries({queryKey:m.folders.list(n,"routine")})},"onSuccess"),onError:t(e=>{i({title:"Folder save failed",body:e instanceof Error?e.message:"Paperclip could not update the folder.",tone:"error"})},"onError")}),Te=S({mutationFn:t(e=>M.delete(n,e),"mutationFn"),onSuccess:t(async(e,r)=>{f===r&&Y("all"),te(null),await Promise.all([d.invalidateQueries({queryKey:m.routines.list(n)}),d.invalidateQueries({queryKey:m.folders.list(n,"routine")})]),i({title:"Folder deleted",body:"Items moved to Unfiled.",tone:"success"})},"onSuccess"),onError:t(e=>{i({title:"Folder delete failed",body:e instanceof Error?e.message:"Paperclip could not delete the folder.",tone:"error"})},"onError")}),qe=S({mutationFn:t(({itemId:e,folderId:r})=>M.moveItem(n,{kind:"routine",itemId:e,folderId:r}),"mutationFn"),onSuccess:t(async()=>{await Promise.all([d.invalidateQueries({queryKey:m.routines.list(n)}),d.invalidateQueries({queryKey:m.folders.list(n,"routine")})])},"onSuccess"),onError:t(e=>{i({title:"Move failed",body:e instanceof Error?e.message:"Paperclip could not move the routine.",tone:"error"})},"onError")}),js=S({mutationFn:t(({id:e,data:r})=>Ye.update(e,r),"mutationFn"),onSuccess:t(async()=>{await d.invalidateQueries({queryKey:[...m.issues.list(n),"routine-executions"]})},"onSuccess")}),Ke=S({mutationFn:t(({id:e,status:r})=>J.update(e,{status:r}),"mutationFn"),onMutate:t(({id:e})=>{_e(e)},"onMutate"),onSuccess:t(async(e,r)=>{await Promise.all([d.invalidateQueries({queryKey:m.routines.list(n)}),d.invalidateQueries({queryKey:m.routines.detail(r.id)})])},"onSuccess"),onSettled:t(()=>{_e(null)},"onSettled"),onError:t(e=>{i({title:"Failed to update routine",body:e instanceof Error?e.message:"Paperclip could not update the routine.",tone:"error"})},"onError")}),Ee=S({mutationFn:t(({id:e,data:r})=>J.run(e,{...r?.variables&&Object.keys(r.variables).length>0?{variables:r.variables}:{},...r?.assigneeAgentId!==void 0?{assigneeAgentId:r.assigneeAgentId}:{},...r?.projectId!==void 0?{projectId:r.projectId}:{},...r?.executionWorkspaceId!==void 0?{executionWorkspaceId:r.executionWorkspaceId}:{},...r?.executionWorkspacePreference!==void 0?{executionWorkspacePreference:r.executionWorkspacePreference}:{},...r?.executionWorkspaceSettings!==void 0?{executionWorkspaceSettings:r.executionWorkspaceSettings}:{}}),"mutationFn"),onMutate:t(({id:e})=>{Ce(e)},"onMutate"),onSuccess:t(async(e,{id:r})=>{ie(null),await Promise.all([d.invalidateQueries({queryKey:m.routines.list(n)}),d.invalidateQueries({queryKey:m.routines.detail(r)})])},"onSuccess"),onSettled:t(()=>{Ce(null)},"onSettled"),onError:t(e=>{i({title:"Routine run failed",body:e instanceof Error?e.message:"Paperclip could not start the routine run.",tone:"error"})},"onError")}),me=(0,l.useMemo)(()=>Vs(),[$]),ys=(0,l.useMemo)(()=>Gs(),[$]),vs=(0,l.useMemo)(()=>Ls((C??[]).filter(e=>e.status!=="terminated"),me).map(e=>({id:e.id,label:e.name,searchText:`${e.name} ${e.role} ${e.title??""}`})),[C,me]),bs=(0,l.useMemo)(()=>(_??[]).filter(e=>!e.archivedAt).map(e=>({id:e.id,label:e.name,searchText:e.description??""})),[_]),E=(0,l.useMemo)(()=>new Map((C??[]).map(e=>[e.id,e])),[C]),U=(0,l.useMemo)(()=>new Map((_??[]).map(e=>[e.id,e])),[_]),Ue=(0,l.useMemo)(()=>new Map((h?.folders??[]).map(e=>[e.id,e])),[h]),ws=(0,l.useMemo)(()=>zs(de,le),[de,le]),y=(0,l.useMemo)(()=>(ke??[]).filter(e=>e.status!=="archived"),[ke]),Oe=(0,l.useMemo)(()=>u.groupBy!=="folder"||f==="all"?y:f==="unfiled"?y.filter(e=>!e.folderId):y.filter(e=>e.folderId===f),[f,u.groupBy,y]),pe=(0,l.useMemo)(()=>{if(!h)return h;const e=new Map;let r=0;for(const a of y)a.folderId?e.set(a.folderId,(e.get(a.folderId)??0)+1):r+=1;return{...h,allCount:y.length,unfiledCount:r,folders:h.folders.map(a=>({...a,itemCount:e.get(a.id)??0}))}},[h,y]),D=(0,l.useMemo)(()=>Kt(Oe,u.sortField,u.sortDir),[Oe,u.sortDir,u.sortField]),Ns=(0,l.useMemo)(()=>qt(D,u.groupBy,U,E,Ue),[E,Ue,U,u.groupBy,D]),Is=(0,l.useMemo)(()=>Ks("Recent Runs",os("runs"),"issues"),[]),Le=p.assigneeAgentId?E.get(p.assigneeAgentId)??null:null,Qe=p.projectId?U.get(p.projectId)??null:null,Be=It(h?.folders??[],f),W=(h?.folders.length??0)>0,fe=P==="routines"&&u.groupBy==="folder"&&W;function ge(e){Fe(r=>{const a={...r,...e};return Mt(G,a),a})}t(ge,"updateRoutineView");function Ve(e){const r=e==="runs"?"runs":"routines";(0,l.startTransition)(()=>{b(os(r))})}t(Ve,"handleTabChange");function Y(e){x(r=>{const a=new URLSearchParams(r),v=Nt(e);return v?a.set("folder",v):a.delete("folder"),a})}t(Y,"setFolderSelection");function T(e=[]){Re(e),L(null),K(!0)}t(T,"openCreateFolder");function $e(){R(e=>({...e,folderId:f==="all"||f==="unfiled"?null:f})),z(!0)}t($e,"openCreateRoutine");async function Rs(e){const r=B;if(r.length!==0)try{await Promise.all(r.map(a=>M.moveItem(n,{kind:"routine",itemId:a,folderId:e}))),V([]),re(!1),await Promise.all([d.invalidateQueries({queryKey:m.routines.list(n)}),d.invalidateQueries({queryKey:m.folders.list(n,"routine")})]),i({title:"Routines moved",body:`${r.length} routine${r.length===1?"":"s"} filed.`,tone:"success"})}catch(a){i({title:"Failed to move routines",body:a instanceof Error?a.message:"Paperclip could not move the selected routines.",tone:"error"})}}t(Rs,"moveSelectedRoutines");function Cs(e){ie(e)}t(Cs,"handleRunNow");function _s(e,r){if(!r&&!e.assigneeAgentId){i({title:"Default agent required",body:"Set a default agent before enabling routine automation.",tone:"warn"});return}Ke.mutate({id:e.id,status:bt(e.status,!r)})}t(_s,"handleToggleEnabled");function Ss(e){Ke.mutate({id:e.id,status:e.status==="archived"?"active":"archived"})}return t(Ss,"handleToggleArchived"),n?ps?(0,s.jsx)(dt,{variant:"issues-list"}):(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Routines"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Recurring work definitions that materialize into auditable execution tasks."})]}),(0,s.jsxs)(F,{onClick:$e,children:[(0,s.jsx)(Z,{className:"mr-2 h-4 w-4"}),"Create routine"]})]}),(0,s.jsxs)(Zs,{value:P,onValueChange:Ve,children:[(0,s.jsx)(jt,{align:"start",value:P,onValueChange:Ve,items:[{value:"routines",label:"Routines"},{value:"runs",label:"Recent Runs"}]}),(0,s.jsxs)(es,{value:"routines",className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:[y.length," routine",y.length===1?"":"s"]}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsxs)(Ge,{children:[(0,s.jsx)(ze,{asChild:!0,children:(0,s.jsxs)(F,{variant:"ghost",size:"sm",className:"text-xs",title:"Sort",children:[(0,s.jsx)($s,{className:"h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Sort"})]})}),(0,s.jsx)(We,{align:"end",className:"w-44 p-0",children:(0,s.jsx)("div",{className:"p-2 space-y-0.5",children:[["updated","Updated"],["created","Created"],["lastRun","Last run"],["title","Title"]].map(([e,r])=>(0,s.jsxs)("button",{className:`flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm ${u.sortField===e?"bg-accent/50 text-foreground":"text-muted-foreground hover:bg-accent/50"}`,onClick:t(()=>{ge(u.sortField===e?{sortDir:u.sortDir==="asc"?"desc":"asc"}:{sortField:e,sortDir:e==="title"?"asc":"desc"})},"onClick"),children:[(0,s.jsx)("span",{children:r}),u.sortField===e?(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:u.sortDir==="asc"?"Asc":"Desc"}):null]},e))})})]}),(0,s.jsxs)(Ge,{children:[(0,s.jsx)(ze,{asChild:!0,children:(0,s.jsxs)(F,{variant:"ghost",size:"sm",className:"text-xs",title:"Group",children:[(0,s.jsx)(Us,{className:"h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Group"})]})}),(0,s.jsx)(We,{align:"end",className:"w-44 p-0",children:(0,s.jsx)("div",{className:"p-2 space-y-0.5",children:[["folder","Folder"],["project","Project"],["assignee","Agent"],["none","None"]].map(([e,r])=>(0,s.jsxs)("button",{className:`flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm ${u.groupBy===e?"bg-accent/50 text-foreground":"text-muted-foreground hover:bg-accent/50"}`,onClick:t(()=>ge({groupBy:e,collapsedGroups:[]}),"onClick"),children:[(0,s.jsx)("span",{children:r}),u.groupBy===e?(0,s.jsx)(st,{className:"h-3.5 w-3.5"}):null]},e))})})]}),u.groupBy==="folder"&&!W?(0,s.jsxs)(F,{variant:"outline",size:"sm",onClick:t(()=>T(),"onClick"),children:[(0,s.jsx)(Z,{className:"mr-2 h-3.5 w-3.5"}),"New folder"]}):null,fe?(0,s.jsx)(F,{variant:"ghost",size:"sm",className:"text-xs",onClick:t(()=>re(e=>!e),"onClick"),children:ne?"Done":"Select"}):null]})]}),u.groupBy==="folder"?(0,s.jsx)("div",{className:"md:hidden",children:(0,s.jsx)(ft,{result:pe,selection:f,allLabel:"All routines",onClick:t(()=>Ne(!0),"onClick")})}):null]}),(0,s.jsx)(es,{value:"runs",children:(0,s.jsx)(Ws,{issues:le??[],isLoading:fs,error:gs,agents:C,projects:_,liveIssueIds:ws,viewStateKey:"paperclip:routine-recent-runs-view",issueLinkState:Is,onUpdateIssue:t((e,r)=>js.mutate({id:e,data:r}),"onUpdateIssue")})})]}),(0,s.jsx)(Js,{open:$,onOpenChange:t(e=>{N.isPending||z(e)},"onOpenChange"),children:(0,s.jsxs)(Hs,{showCloseButton:!1,className:"flex max-h-(--sz-calc-18) max-w-3xl flex-col gap-0 overflow-hidden p-0",children:[(0,s.jsxs)("div",{className:"shrink-0 flex flex-wrap items-center justify-between gap-3 border-b border-border/60 px-5 py-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground",children:"New routine"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Define the recurring work first. Default project and agent are optional for draft routines."})]}),(0,s.jsx)(F,{variant:"ghost",size:"sm",onClick:t(()=>{z(!1),oe(!1)},"onClick"),disabled:N.isPending,children:"Cancel"})]}),(0,s.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[(0,s.jsx)("div",{className:"px-5 pt-5 pb-3",children:(0,s.jsx)("textarea",{ref:j,className:"w-full resize-none overflow-hidden bg-transparent text-xl font-semibold outline-none placeholder:text-muted-foreground/50",placeholder:"Routine title",rows:1,value:p.title,onChange:t(e=>{R(r=>({...r,title:e.target.value})),ss(e.target)},"onChange"),onKeyDown:t(e=>{if(e.key==="Enter"&&!e.metaKey&&!e.ctrlKey&&!e.nativeEvent.isComposing){e.preventDefault(),o.current?.focus();return}e.key==="Tab"&&!e.shiftKey&&(e.preventDefault(),p.assigneeAgentId?p.projectId?o.current?.focus():I.current?.focus():w.current?.focus())},"onKeyDown"),autoFocus:!0})}),(0,s.jsx)("div",{className:"px-5 pb-3",children:(0,s.jsx)("div",{className:"overflow-x-auto overscroll-x-contain",children:(0,s.jsxs)("div",{className:"inline-flex min-w-full flex-wrap items-center gap-2 text-sm text-muted-foreground sm:min-w-max sm:flex-nowrap",children:[(0,s.jsx)("span",{children:"For"}),(0,s.jsx)(Xe,{ref:w,value:p.assigneeAgentId,options:vs,recentOptionIds:me,placeholder:"Responsible",noneLabel:"No responsible",searchPlaceholder:"Search responsible...",emptyMessage:"No responsible found.",onChange:t(e=>{e&&Qs(e),R(r=>({...r,assigneeAgentId:e}))},"onChange"),onConfirm:t(()=>{p.projectId?o.current?.focus():I.current?.focus()},"onConfirm"),renderTriggerValue:t(e=>e?Le?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ze,{agent:Le,size:16,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)("span",{className:"truncate",children:e.label})]}):(0,s.jsx)("span",{className:"truncate",children:e.label}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"Responsible"}),"renderTriggerValue"),renderOption:t(e=>{if(!e.id)return(0,s.jsx)("span",{className:"truncate",children:e.label});const r=E.get(e.id);return(0,s.jsxs)(s.Fragment,{children:[r?(0,s.jsx)(Ze,{agent:r,size:16,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):null,(0,s.jsx)("span",{className:"truncate",children:e.label})]})},"renderOption")}),(0,s.jsx)("span",{children:"in"}),(0,s.jsx)(Xe,{ref:I,value:p.projectId,options:bs,recentOptionIds:ys,placeholder:"Project",noneLabel:"No project",searchPlaceholder:"Search projects...",emptyMessage:"No projects found.",onChange:t(e=>{e&&Bs(e),R(r=>({...r,projectId:e}))},"onChange"),onConfirm:t(()=>o.current?.focus(),"onConfirm"),renderTriggerValue:t(e=>e&&Qe?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:Qe.color??"var(--project-none)"}}),(0,s.jsx)("span",{className:"truncate",children:e.label})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"Project"}),"renderTriggerValue"),renderOption:t(e=>{if(!e.id)return(0,s.jsx)("span",{className:"truncate",children:e.label});const r=U.get(e.id);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:r?.color??"var(--project-none)"}}),(0,s.jsx)("span",{className:"truncate",children:e.label})]})},"renderOption")}),(0,s.jsx)("span",{children:"filed in"}),(0,s.jsxs)(ve,{value:p.folderId??"__unfiled",onValueChange:t(e=>R(r=>({...r,folderId:e==="__unfiled"?null:e})),"onValueChange"),children:[(0,s.jsx)(je,{className:"h-8 w-auto min-w-32 border-0 bg-muted/50 px-2 shadow-none",children:(0,s.jsx)(ye,{})}),(0,s.jsxs)(be,{children:[(0,s.jsx)(X,{value:"__unfiled",children:"Unfiled"}),(h?.folders??[]).map(e=>(0,s.jsx)(X,{value:e.id,children:e.name},e.id))]})]})]})})}),(0,s.jsx)("div",{className:"border-t border-border/60 px-5 py-4",children:(0,s.jsx)(Xs,{ref:o,value:p.description,onChange:t(e=>R(r=>({...r,description:e})),"onChange"),placeholder:"Add instructions...",bordered:!1,contentClassName:"min-h-(--sz-160px) text-sm text-muted-foreground",mentions:hs,onSubmit:t(()=>{!N.isPending&&p.title.trim()&&p.projectId&&p.assigneeAgentId&&N.mutate()},"onSubmit")})}),(0,s.jsx)("div",{className:"border-t border-border/60 px-5 py-3",children:(0,s.jsxs)(He,{open:Se,onOpenChange:oe,children:[(0,s.jsxs)(ls,{className:"flex w-full items-center justify-between text-left",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Advanced delivery settings"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Keep policy controls secondary to the work definition."})]}),Se?(0,s.jsx)(tt,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(cs,{className:"h-4 w-4 text-muted-foreground"})]}),(0,s.jsx)(Je,{className:"pt-3",children:(0,s.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground",children:"Concurrency"}),(0,s.jsxs)(ve,{value:p.concurrencyPolicy,onValueChange:t(e=>R(r=>({...r,concurrencyPolicy:e})),"onValueChange"),children:[(0,s.jsx)(je,{children:(0,s.jsx)(ye,{})}),(0,s.jsx)(be,{children:St.map(e=>(0,s.jsx)(X,{value:e,children:e.replaceAll("_"," ")},e))})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:kt[p.concurrencyPolicy]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground",children:"Catch-up"}),(0,s.jsxs)(ve,{value:p.catchUpPolicy,onValueChange:t(e=>R(r=>({...r,catchUpPolicy:e})),"onValueChange"),children:[(0,s.jsx)(je,{children:(0,s.jsx)(ye,{})}),(0,s.jsx)(be,{children:Ft.map(e=>(0,s.jsx)(X,{value:e,children:e.replaceAll("_"," ")},e))})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:Pt[p.catchUpPolicy]})]})]})})]})})]}),(0,s.jsxs)("div",{className:"shrink-0 flex flex-col gap-3 border-t border-border/60 px-5 py-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:"After creation, Paperclip takes you straight to trigger setup. Draft routines stay paused until you add a default agent."}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:items-end",children:[(0,s.jsxs)(F,{onClick:t(()=>N.mutate(),"onClick"),disabled:N.isPending||!p.title.trim(),children:[(0,s.jsx)(Z,{className:"mr-2 h-4 w-4"}),N.isPending?"Creating...":"Create routine"]}),N.isError?(0,s.jsx)("p",{className:"text-sm text-destructive",children:N.error instanceof Error?N.error.message:"Failed to create routine"}):null]})]})]})}),ae?(0,s.jsx)(ct,{children:(0,s.jsx)(lt,{className:"pt-6 text-sm text-destructive",children:ae instanceof Error?ae.message:"Failed to load routines"})}):null,P==="routines"?(0,s.jsxs)("div",{className:As(fe&&"flex gap-4"),children:[fe?(0,s.jsx)(ht,{result:pe,selection:f,allLabel:"All routines",itemLabelPlural:"routines",loading:Pe,onSelect:Y,onCreate:t(()=>T(),"onCreate"),onRename:t((e,r)=>ue.mutate({folderId:e.id,payload:{name:r}}),"onRename"),onEdit:t(e=>{L(e),K(!0)},"onEdit"),onDelete:te}):null,(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[u.groupBy==="folder"&&W?(0,s.jsx)("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f==="all"?(0,s.jsx)(Ut,{label:"All routines",count:D.length}):(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-sm",children:[(0,s.jsx)(vt,{color:Be?.color}),(0,s.jsx)("span",{className:"truncate font-medium",children:f==="unfiled"?"Unfiled":Be?.name??"Folder"}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[D.length," routine",D.length===1?"":"s"]})]})}):null,u.groupBy==="folder"&&!W&&!Pe&&y.length>0?(0,s.jsx)(pt,{storageKey:`paperclip:routines-folder-nudge:${n??"none"}`,itemLabelPlural:"routines",onCreateFolder:t(()=>T(),"onCreateFolder")}):null,ne?(0,s.jsx)(gt,{selectedCount:B.length,folders:h?.folders??[],onMove:t(e=>{Rs(e)},"onMove"),onCreateAndMove:t(()=>T(B),"onCreateAndMove"),onClear:t(()=>V([]),"onClear"),onDone:t(()=>{re(!1),V([])},"onDone")}):null,y.length===0?(0,s.jsx)("div",{className:"py-12",children:(0,s.jsx)(we,{icon:ee,message:"No active routines. Use Create routine to define the first recurring workflow."})}):D.length===0?(0,s.jsxs)("div",{className:"py-12",children:[(0,s.jsx)(we,{icon:ee,message:f==="all"?"No routines match this view.":"This folder is empty."}),f!=="all"?(0,s.jsx)("div",{className:"mt-3 flex justify-center",children:(0,s.jsxs)(F,{size:"sm",onClick:$e,children:[(0,s.jsx)(Z,{className:"mr-2 h-3.5 w-3.5"}),"New routine in this folder"]})}):null]}):(0,s.jsx)("div",{className:"flex flex-col gap-3",children:Ns.map(e=>{const r=!u.collapsedGroups.includes(e.key);return(0,s.jsxs)(He,{open:r,onOpenChange:t(a=>{ge({collapsedGroups:a?u.collapsedGroups.filter(v=>v!==e.key):[...u.collapsedGroups,e.key]})},"onOpenChange"),children:[e.label?(0,s.jsx)(Et,{label:e.label,count:e.items.length,isOpen:r}):null,(0,s.jsx)(Je,{children:e.items.map(a=>(0,s.jsx)(_t,{routine:a,projectById:U,agentById:E,runningRoutineId:us,statusMutationRoutineId:ms,href:`/routines/${a.id}`,runNowButton:!0,divider:!1,onRunNow:Cs,onToggleEnabled:_s,onToggleArchived:Ss,selectMode:ne,selected:B.includes(a.id),onSelectChange:t((v,xe)=>{V(H=>xe?Array.from(new Set([...H,v.id])):H.filter(Fs=>Fs!==v.id))},"onSelectChange"),extraMenuItems:(0,s.jsx)(ut,{folders:h?.folders??[],currentFolderId:a.folderId??null,onMove:t(v=>{const xe=a.folderId??null;qe.mutate({itemId:a.id,folderId:v}),i({title:"Routine moved",body:v?`Moved "${a.title}" to ${h?.folders.find(H=>H.id===v)?.name??"folder"}.`:`Moved "${a.title}" to Unfiled.`,tone:"success",action:{label:"Undo",onClick:t(()=>qe.mutate({itemId:a.id,folderId:xe}),"onClick")}})},"onMove"),onCreateAndMove:t(()=>T([a.id]),"onCreateAndMove")})},a.id))})]},e.key)})})]})]}):null,(0,s.jsx)(yt,{open:O,kind:"routine",folder:se,pending:De.isPending||ue.isPending,onOpenChange:K,onSubmit:t(e=>{se?ue.mutate({folderId:se.id,payload:e}):De.mutate(e)},"onSubmit")}),(0,s.jsx)(Rt,{open:Q!==null,folder:Q,itemLabelPlural:"routines",pending:Te.isPending,onOpenChange:t(e=>{e||te(null)},"onOpenChange"),onConfirm:t(()=>{Q&&Te.mutate(Q.id)},"onConfirm")}),(0,s.jsx)(xt,{open:ds,onOpenChange:Ne,result:pe,selection:f,allLabel:"All routines",itemLabelPlural:"Routines",onSelect:Y,onCreate:t(()=>T(),"onCreate")}),(0,s.jsx)(Ys,{open:k!==null,onOpenChange:t(e=>{e||ie(null)},"onOpenChange"),companyId:n,routineName:k?.title??null,agents:C??[],projects:_??[],defaultProjectId:k?.projectId??null,defaultAssigneeAgentId:k?.assigneeAgentId??null,variables:k?.variables??[],isPending:Ee.isPending,onSubmit:t(e=>{k&&Ee.mutate({id:k.id,data:e})},"onSubmit")})]}):(0,s.jsx)(we,{icon:ee,message:"Select a company to view routines."})}t(un,"Routines");function Ut({label:n,count:c}){return(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-sm",children:[(0,s.jsx)(ee,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("span",{className:"truncate font-medium",children:n}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[c," routine",c===1?"":"s"]})]})}t(Ut,"FolderIconHeader");export{un as Routines};
@@ -0,0 +1 @@
1
+ var G=Object.defineProperty;var n=(e,r)=>G(e,"name",{value:r,configurable:!0});import{i as _}from"./rolldown-runtime-ZpX3ckPj.js";import{Fa as A,I as b,Na as W,t as i,zi as c}from"./createLucideIcon-DwVwDVEQ.js";import{Et as v,Lt as H,Mt as V,Pt as F,Tt as C,wt as w,x as Y}from"./agents-BnTeL72d.js";import{c as j,r as J}from"./BreadcrumbContext-CmzhWkn9.js";import{a as $,n as B}from"./usePrefersReducedMotion-CkujTZ1k.js";import{r as I}from"./badge-CZKC9uUT.js";var L={name:"archive",size:24,node:[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]};L.node;var S=i(L),O={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};O.node;var R=i(O),E={name:"cloud-off",size:24,node:[["path",{d:"M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057",key:"1uxyv8"}],["path",{d:"M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78",key:"99tcn7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};E.node;var K=i(E),q={name:"git-merge",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]};q.node;var X=i(q),M={name:"git-pull-request",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]};M.node;var Q=i(M),U={name:"octagon-alert",size:24,node:[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],aliases:["alert-octagon"]};U.node;var Z=i(U);function x(e={}){return{workspaceCommandId:e.workspaceCommandId??null,runtimeServiceId:e.runtimeServiceId??null,serviceIndex:e.serviceIndex??null}}n(x,"sanitizeWorkspaceRuntimeControlTarget");function ee(e,r){return r?`${e}${e.includes("?")?"&":"?"}companyId=${encodeURIComponent(r)}`:e}n(ee,"withCompanyScope");function o(e,r,t=""){return ee(`/projects/${encodeURIComponent(e)}${t}`,r)}n(o,"projectPath");var $e={repositoryOptions:n(e=>c.get(`/companies/${e}/project-repositories`),"repositoryOptions"),setRepositories:n((e,r)=>c.put(o(e,void 0,"/repositories"),{repositoryIds:r}),"setRepositories"),list:n((e,r={})=>{const t=new URLSearchParams;r.includeArchived&&t.set("includeArchived","true");const a=t.toString();return c.get("/companies/"+encodeURIComponent(e)+"/projects"+(a?"?"+a:""))},"list"),get:n((e,r)=>c.get(o(e,r)),"get"),create:n((e,r)=>c.post(`/companies/${e}/projects`,r),"create"),update:n((e,r,t)=>c.patch(o(e,t),r),"update"),listAccessMembers:n((e,r)=>c.get(o(e,r,"/access-members")),"listAccessMembers"),addAccessMember:n((e,r,t)=>c.post(o(e,t,"/access-members"),r),"addAccessMember"),removeAccessMember:n((e,r,t)=>c.delete(o(e,t,`/access-members/${encodeURIComponent(r)}`)),"removeAccessMember"),listWorkspaces:n((e,r)=>c.get(o(e,r,"/workspaces")),"listWorkspaces"),createWorkspace:n((e,r,t)=>c.post(o(e,t,"/workspaces"),r),"createWorkspace"),updateWorkspace:n((e,r,t,a)=>c.patch(o(e,a,`/workspaces/${encodeURIComponent(r)}`),t),"updateWorkspace"),controlWorkspaceRuntimeServices:n((e,r,t,a,l={})=>c.post(o(e,a,`/workspaces/${encodeURIComponent(r)}/runtime-services/${t}`),x(l)),"controlWorkspaceRuntimeServices"),controlWorkspaceCommands:n((e,r,t,a,l={})=>c.post(o(e,a,`/workspaces/${encodeURIComponent(r)}/runtime-commands/${t}`),x(l)),"controlWorkspaceCommands"),removeWorkspace:n((e,r,t)=>c.delete(o(e,t,`/workspaces/${encodeURIComponent(r)}`)),"removeWorkspace"),remove:n((e,r)=>c.delete(o(e,r)),"remove")};function Be(e){if(!e)return null;let r;try{r=new URL(e.trim())}catch{return null}if(r.protocol!=="http:"&&r.protocol!=="https:"||r.username||r.password)return null;const t=r.protocol==="https:"?"https":"http",a=r.pathname||"/";return`${t}://${r.host.toLowerCase()}${a}`}n(Be,"normalizeExternalObjectHref");var re=i("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),te={unknown:C,open:w,waiting:$,running:I,succeeded:v,failed:R,blocked:Z,closed:j,archived:S,auth_required:B,unreachable:K},ne=C;function Ie(e){return te[e]??ne}n(Ie,"externalObjectIconForCategory");var ae={archive:S,check:v,"check-circle":v,circle:j,"circle-dot":w,clock:$,github:re,"git-merge":X,"git-pull-request":Q,key:B,loader:I,"x-circle":R};function Le(e){return e?ae[e]??null:null}n(Le,"externalObjectIconForKey");var ce={unknown:"Not yet resolved",open:"Open",waiting:"Waiting",running:"Running",succeeded:"Succeeded",failed:"Failed",blocked:"Blocked",closed:"Closed",archived:"Archived",auth_required:"Authorization required",unreachable:"Unreachable"};function oe(e){return ce[e]??e.replace(/_/g," ")}n(oe,"externalObjectCategoryLabel");var se={unknown:"Not yet refreshed",fresh:"Fresh",stale:"Stale",auth_required:"Requires auth",unreachable:"Unreachable"};function ie(e){return se[e]??e.replace(/_/g," ")}n(ie,"externalObjectLivenessLabel");function Se(e){const r=e.statusLabel?.trim();if(r)return r;const t=e.providerKey==="url"&&e.objectType==="link",a=!!(e.providerKey&&e.objectType);return e.statusCategory==="unknown"&&a&&!t?e.liveness==="fresh"?"Status unavailable":ie(e.liveness):oe(e.statusCategory)}n(Se,"externalObjectDisplayStatusLabel");var N={muted:0,neutral:1,success:2,info:3,warning:4,danger:5};function le(e){return e?N[e]??0:0}n(le,"externalObjectToneSeverity");var ue={github:"GitHub",github_pull_request:"GitHub",github_issue:"GitHub",hubspot:"HubSpot",linear:"Linear",jira:"Jira",notion:"Notion",asana:"Asana"};function de(e){if(!e)return"External";const r=ue[e];return r||e.split(/[._-]/).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}n(de,"externalObjectProviderLabel");var pe={pull_request:"pull request",issue:"issue",deployment:"deployment",workflow_run:"workflow run",ticket:"ticket",lead:"lead",url_link:"URL"};function me(e){return e?pe[e]??e.replace(/_/g," "):"object"}n(me,"externalObjectTypeLabel");function Oe(e,r,t){const a=t?.trim();return a||(e==="url"&&r==="link"?"URL":`${de(e)} ${me(r)}`)}n(Oe,"externalObjectDisplayLabel");function he(e){if(!e)return null;const r=e.highestSeverity;return!r||le(r)<=N.muted?null:r}n(he,"dominantExternalObjectTone");function Re(e){if(!e)return 0;const r=he(e);return r?e.objects.filter(t=>t.statusTone===r).length:0}n(Re,"externalObjectDominantCount");var fe=_(A(),1),s=_(W(),1),ve=["backlog","todo","in_progress","in_review","done","cancelled","blocked"];function m(e){return e.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}n(m,"statusLabel");function ke(e){if(!e||e.state==="none")return"Blocked";if(e.reason==="active_child"){const r=e.coveredBlockerCount;return r===1&&e.sampleBlockerIdentifier?`Blocked · waiting on active sub-task ${e.sampleBlockerIdentifier}`:r===1?"Blocked · waiting on 1 active sub-task":`Blocked · waiting on ${r} active sub-tasks`}if(e.reason==="active_dependency"){const r=e.coveredBlockerCount;return r===1&&e.sampleBlockerIdentifier?`Blocked · covered by active dependency ${e.sampleBlockerIdentifier}`:r===1?"Blocked · covered by 1 active dependency":`Blocked · covered by ${r} active dependencies`}if(e.reason==="stalled_review"){const r=e.stalledBlockerCount,t=e.sampleStalledBlockerIdentifier??e.sampleBlockerIdentifier;return r===1&&t?`Blocked · review stalled on ${t}`:r===1?"Blocked · review stalled with no clear next step":`Blocked · ${r} reviews stalled with no clear next step`}if(e.reason==="attention_required"){const r=e.attentionBlockerCount||e.unresolvedBlockerCount,t=`${r} ${r===1?"blocker needs":"blockers need"} attention`,a=e.coveredBlockerCount;return a>0?`Blocked · ${t}; ${a} covered by active work`:`Blocked · ${t}`}return"Blocked"}n(ke,"blockedAttentionLabel");function ge({status:e,externalConversationState:r,blockerAttention:t,onChange:a,className:l,glyphContainerClassName:k,showLabel:h,size:z="md"}){const[D,g]=(0,fe.useState)(!1),d=e==="in_review"&&r==="waiting"?"idle":e,T=e==="blocked"&&t?.state==="covered",f=e==="blocked"?ke(t):m(d),y=(0,s.jsx)(Y,{status:T?"in_queue":d,size:z,className:b(a&&!h&&"cursor-pointer",l),title:f}),p=k?(0,s.jsx)("span",{className:k,"data-status-glyph-container":"true",children:y}):y;if(!a)return h?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[p,(0,s.jsx)("span",{className:"text-sm",children:m(d)})]}):p;const P=h?(0,s.jsxs)("button",{type:"button","aria-label":`Change status (current: ${f})`,className:"inline-flex min-h-5 items-center gap-1.5 cursor-pointer hover:bg-accent/50 rounded px-1 -mx-1 py-0.5 transition-colors",children:[p,(0,s.jsx)("span",{className:"text-sm",children:m(d)})]}):(0,s.jsx)("button",{type:"button","data-slot":"icon-button","aria-label":`Change status (current: ${f})`,className:"inline-flex cursor-pointer items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-ring",children:p});return(0,s.jsxs)(V,{open:D,onOpenChange:g,children:[(0,s.jsx)(H,{asChild:!0,children:P}),(0,s.jsx)(F,{className:"w-40 p-1",align:"start",children:ve.map(u=>(0,s.jsxs)(J,{variant:"ghost",size:"sm",className:b("w-full justify-start gap-2 text-xs",u===e&&"bg-accent"),onClick:n(()=>{a(u),g(!1)},"onClick"),children:[(0,s.jsx)(ge,{status:u,size:"lg"}),m(u)]},u))})]})}n(ge,"StatusIcon");export{Z as _,Se as a,R as b,Le as c,le as d,me as f,x as g,$e as h,Oe as i,ie as l,Be as m,he as n,Re as o,re as p,oe as r,Ie as s,ge as t,de as u,Q as v,S as x,X as y};
@@ -0,0 +1 @@
1
+ var ne=Object.defineProperty;var n=(s,i)=>ne(s,"name",{value:i,configurable:!0});import{i as G}from"./rolldown-runtime-ZpX3ckPj.js";import{$i as E,Fa as ae,I as P,Ma as re,Na as ie,Qi as R,ot as oe,pt as $,t as le}from"./createLucideIcon-DwVwDVEQ.js";import{a as ce,i as H,p as de,r as ue,t as me}from"./dropdown-menu-ByiK1BlD.js";import{n as pe,r as v,s as J}from"./BreadcrumbContext-CmzhWkn9.js";import{t as fe}from"./x-XhYFJqIj.js";import{t as xe}from"./input-rJVxQSgj.js";import{t as he}from"./access-BP0uIEvm.js";import{t as ge}from"./environments-BQaMNey_.js";import{_t as D,c as be,gt as ye,ht as je,mt as _,o as ve,pn as X,pt as Se,s as we,un as L}from"./index-Bzln5Ksp.js";var V={name:"columns-2",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],aliases:["columns"]};V.node;var Ne=le(V),u=G(ae(),1),t=G(ie(),1),h=2;function W(s){return`paperclip:terminal-layout:v1:${s}`}n(W,"layoutKey");function q(s){return`paperclip:terminal-titles:v1:${s}`}n(q,"titlesKey");function U(s){try{return JSON.parse(window.localStorage.getItem(s)??"null")}catch{return null}}n(U,"readJson");function T(s,i){try{window.localStorage.setItem(s,JSON.stringify(i))}catch{return}}n(T,"writeJson");function Ce(s){const i=U(W(s)),c=Array.isArray(i?.panes)?i.panes.filter(o=>typeof o=="string").slice(0,h):[];return{panes:c,focused:typeof i?.focused=="number"&&i.focused>=0&&i.focused<c.length?i.focused:0}}n(Ce,"readLayout");function ke(s){const i=U(q(s));return!i||typeof i!="object"||Array.isArray(i)?{}:Object.fromEntries(Object.entries(i).filter(c=>typeof c[1]=="string"))}n(ke,"readTitles");function Me(s,i){const c=new Set(i.map(m=>m.id)),o=s.panes.filter((m,S)=>c.has(m)&&s.panes.indexOf(m)===S);return o.length===0&&i.length>0&&o.push(i[0].id),{panes:o,focused:Math.min(s.focused,Math.max(0,o.length-1))}}n(Me,"reconcileLayout");function ze(s,i){return s.focused===i.focused&&s.panes.length===i.panes.length&&s.panes.every((c,o)=>c===i.panes[o])}n(ze,"sameLayout");function Ae({companyId:s}){const i=re(),c=je.sessions(s),[o,m]=(0,u.useState)(()=>Ce(s)),[S,K]=(0,u.useState)(()=>ke(s)),[f,g]=(0,u.useState)(null),[F,b]=(0,u.useState)(null),Y=E({queryKey:$.access.currentBoardAccess,queryFn:n(()=>he.getCurrentBoardAccess(),"queryFn")}),w=ye(Y.data),p=E({queryKey:c,queryFn:n(()=>_.list(s),"queryFn")}),N=E({queryKey:$.environments.list(s),queryFn:n(()=>ge.list(s),"queryFn"),enabled:p.isSuccess}),x=(0,u.useMemo)(()=>p.data??[],[p.data]),O=(0,u.useMemo)(()=>(N.data??[]).filter(e=>e.driver==="ssh"),[N.data]);(0,u.useEffect)(()=>{p.isSuccess&&m(e=>{const a=Me(e,x);return ze(e,a)?e:a})},[x,p.isSuccess]),(0,u.useEffect)(()=>{T(W(s),o)},[s,o]);const C=(0,u.useCallback)(e=>{i.setQueryData(c,(a=[])=>a.some(r=>r.id===e.id)?a.map(r=>r.id===e.id?e:r):[...a,e])},[i,c]),k=(0,u.useCallback)((e,a)=>{m(r=>{const l=r.panes.indexOf(e);if(l>=0)return{...r,focused:l};const d=a??r.focused,j=[...r.panes];return d>=j.length?j.push(e):j[d]=e,{panes:j.slice(0,h),focused:Math.min(d,1)}})},[]),M=R({mutationFn:n(e=>_.create(s,e.body),"mutationFn"),onSuccess:n((e,a)=>{b(null),C(e),k(e.id,a.pane)},"onSuccess"),onError:n(e=>b(D(e,"Could not open a terminal session.")),"onError")}),z=R({mutationFn:n(e=>_.remove(s,e),"mutationFn"),onSuccess:n((e,a)=>{b(null),i.setQueryData(c,(r=[])=>r.filter(l=>l.id!==a)),m(r=>{const l=r.panes.filter(d=>d!==a);return{panes:l,focused:Math.min(r.focused,Math.max(0,l.length-1))}}),K(r=>{if(!(a in r))return r;const{[a]:l,...d}=r;return T(q(s),d),d})},"onSuccess"),onError:n(e=>b(D(e,"Could not close the terminal session.")),"onError")}),A=n(e=>M.mutate({body:{kind:"local"},pane:e}),"createLocal"),Z=n((e,a)=>M.mutate({body:{kind:"ssh",environmentId:e,title:a}}),"createSsh"),I=n(()=>{if(o.panes.length>=h){const a=o.panes[o.focused]??o.panes[0];m({panes:[a],focused:0});return}const e=x.find(a=>!o.panes.includes(a.id));e?k(e.id,o.panes.length):w&&A(o.panes.length)},"toggleSplit"),ee=n(e=>S[e.id]??e.title,"titleOf"),Q=n(()=>{if(!f)return;const e=f.value.trim();K(a=>{const{[f.id]:r,...l}=a,d=e?{...l,[f.id]:e}:l;return T(q(s),d),d}),g(null)},"commitRename"),te=n(e=>{e.key==="Enter"?(e.preventDefault(),Q()):e.key==="Escape"&&(e.preventDefault(),g(null))},"onRenameKeyDown");if(p.isLoading)return(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:"Loading terminal sessions…"});if(p.isError)return(0,t.jsxs)("div",{className:"flex h-full min-h-(--sz-60vh) flex-col items-center justify-center gap-2 p-6 text-center","data-testid":"terminal-access-error",children:[(0,t.jsx)(L,{className:"size-6 text-muted-foreground","aria-hidden":!0}),(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Terminal unavailable"}),(0,t.jsx)("p",{className:"max-w-md text-sm text-muted-foreground",children:D(p.error,"Terminal sessions could not be loaded.")})]});const se=o.panes[o.focused]??null,B=new Map(x.map(e=>[e.id,e])),y=M.isPending;return(0,t.jsxs)("div",{className:"flex h-full min-h-(--sz-60vh) flex-col overflow-hidden rounded-md border border-border","data-testid":"terminal-workspace",children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-2 py-1",children:[(0,t.jsx)("div",{role:"tablist","aria-label":"Terminal sessions",className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto",children:x.map(e=>{const a=e.id===se,r=o.panes.includes(e.id),l=ee(e);return(0,t.jsxs)("div",{className:P("group flex shrink-0 items-center gap-1 rounded-md border px-2 py-1 text-xs",a?"border-ring bg-accent text-foreground":r?"border-border text-foreground":"border-transparent text-muted-foreground hover:bg-accent"),children:[e.kind==="ssh"?(0,t.jsx)(X,{className:"size-3","aria-hidden":!0}):(0,t.jsx)(L,{className:"size-3","aria-hidden":!0}),f?.id===e.id?(0,t.jsx)(xe,{autoFocus:!0,value:f.value,"aria-label":"Session title",onChange:n(d=>g({id:e.id,value:d.target.value}),"onChange"),onKeyDown:te,onBlur:Q,className:"h-6 w-32 px-1 text-xs md:text-xs"}):(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":a,title:"Double-click to rename",className:"max-w-48 truncate outline-none focus-visible:underline",onClick:n(()=>k(e.id),"onClick"),onDoubleClick:n(()=>g({id:e.id,value:l}),"onDoubleClick"),children:[l,e.status==="exited"?(0,t.jsx)("span",{className:"ml-1 text-muted-foreground",children:"(ended)"}):null]}),(0,t.jsx)("button",{type:"button","aria-label":`Close ${l}`,className:"rounded-sm text-muted-foreground hover:text-foreground",disabled:z.isPending&&z.variables===e.id,onClick:n(()=>z.mutate(e.id),"onClick"),children:(0,t.jsx)(fe,{className:"size-3","aria-hidden":!0})})]},e.id)})}),w?(0,t.jsxs)(v,{type:"button",variant:"ghost",size:"xs",onClick:n(()=>A(),"onClick"),disabled:y,children:[(0,t.jsx)(J,{"aria-hidden":!0}),"Local"]}):null,(0,t.jsxs)(me,{children:[(0,t.jsx)(de,{asChild:!0,children:(0,t.jsxs)(v,{type:"button",variant:"ghost",size:"xs",disabled:y,children:[(0,t.jsx)(X,{"aria-hidden":!0}),"SSH"]})}),(0,t.jsxs)(ue,{align:"end",children:[(0,t.jsx)(ce,{children:"SSH environments"}),O.length===0?(0,t.jsx)(H,{disabled:!0,children:N.isLoading?"Loading…":"No SSH environments"}):O.map(e=>(0,t.jsx)(H,{onSelect:n(()=>Z(e.id,e.name),"onSelect"),children:e.name},e.id))]})]}),(0,t.jsx)(v,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o.panes.length>=h?"Close split":"Split terminal","aria-pressed":o.panes.length>=h,onClick:I,disabled:y||o.panes.length===0,children:(0,t.jsx)(Ne,{"aria-hidden":!0})})]}),F?(0,t.jsx)("p",{className:"shrink-0 border-b border-border px-3 py-1 text-xs text-destructive",role:"alert",children:F}):null,o.panes.length===0?(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[(0,t.jsx)(L,{className:"size-6 text-muted-foreground","aria-hidden":!0}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No terminal sessions yet."}),w?(0,t.jsxs)(v,{type:"button",variant:"outline",size:"sm",onClick:n(()=>A(),"onClick"),disabled:y,children:[(0,t.jsx)(J,{"aria-hidden":!0}),"New local terminal"]}):(0,t.jsx)("p",{className:"max-w-md text-xs text-muted-foreground",children:"A shell on this host needs instance admin access. Open an SSH terminal to a registered environment instead."})]}):(0,t.jsx)(be,{className:"min-h-0 flex-1",children:o.panes.map((e,a)=>(0,t.jsxs)(u.Fragment,{children:[a>0?(0,t.jsx)(ve,{}):null,(0,t.jsx)(we,{id:`terminal-pane-${a}`,minSize:"20%",children:(0,t.jsx)("div",{className:P("h-full min-h-0",o.panes.length>1&&a===o.focused&&"ring-1 ring-inset ring-ring"),onFocusCapture:n(()=>m(r=>r.focused===a?r:{...r,focused:a}),"onFocusCapture"),onMouseDown:n(()=>m(r=>r.focused===a?r:{...r,focused:a}),"onMouseDown"),"data-testid":`terminal-pane-${a}`,children:(0,t.jsx)(Se,{companyId:s,sessionId:e,active:a===o.focused,onSessionChange:n(r=>{B.has(r.id)&&C(r)},"onSessionChange"),onExit:n(r=>{const l=B.get(e);l&&C({...l,status:"exited",exitCode:r.exitCode})},"onExit")})})})]},e))})]})}n(Ae,"TerminalWorkspace");function Be(){const{selectedCompanyId:s}=oe(),{setBreadcrumbs:i}=pe();return(0,u.useEffect)(()=>{i([{label:"Terminal"}])},[i]),s?(0,t.jsx)(Ae,{companyId:s},s):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a company to open a terminal."})}n(Be,"Terminal");export{Be as Terminal};
@@ -0,0 +1 @@
1
+ var D=Object.defineProperty;var s=(e,n)=>D(e,"name",{value:n,configurable:!0});import{i as C}from"./rolldown-runtime-ZpX3ckPj.js";import{Fa as y,Na as P}from"./createLucideIcon-DwVwDVEQ.js";var o=C(y(),1),b=C(P(),1),k={info:4e3,success:3500,warn:8e3,error:1e4},$=1500,N=15e3,O=5,g=3500,j=2e4,_=(0,o.createContext)(null),w=(0,o.createContext)(null);function L(e,n){const i=k[n];return typeof e!="number"||!Number.isFinite(e)?i:Math.max($,Math.min(N,Math.floor(e)))}s(L,"normalizeTtl");function R(){return`toast_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}s(R,"generateToastId");function q({children:e}){const[n,i]=(0,o.useState)([]),a=(0,o.useRef)(new Map),l=(0,o.useRef)(new Map),f=(0,o.useCallback)(t=>{const r=a.current.get(t);r!==void 0&&(window.clearTimeout(r),a.current.delete(t))},[]),d=(0,o.useCallback)(t=>{f(t),i(r=>r.filter(u=>u.id!==t))},[f]),M=(0,o.useCallback)(()=>{for(const t of a.current.values())window.clearTimeout(t);a.current.clear(),i([])},[]),v=(0,o.useCallback)(t=>{const r=Date.now(),u=t.tone??"info",x=L(t.ttlMs,u),h=t.dedupeKey??t.id??`${u}|${t.title}|${t.body??""}|${t.action?.href??""}`;for(const[T,m]of l.current.entries())r-m>j&&l.current.delete(T);const S=l.current.get(h);if(S&&r-S<g)return null;l.current.set(h,r);const c=t.id??R();f(c),i(T=>[{id:c,title:t.title,body:t.body,tone:u,ttlMs:x,action:t.action,actor:t.actor,createdAt:r},...T.filter(m=>m.id!==c)].slice(0,O));const E=window.setTimeout(()=>{d(c)},x);return a.current.set(c,E),c},[f,d]);(0,o.useEffect)(()=>()=>{for(const t of a.current.values())window.clearTimeout(t);a.current.clear()},[]);const A=(0,o.useMemo)(()=>({pushToast:v,dismissToast:d,clearToasts:M}),[v,d,M]);return(0,b.jsx)(w.Provider,{value:A,children:(0,b.jsx)(_.Provider,{value:n,children:e})})}s(q,"ToastProvider");function p(){const e=(0,o.useContext)(_);if(!e)throw new Error("useToastState must be used within a ToastProvider");return e}s(p,"useToastState");function F(){const e=(0,o.useContext)(w);if(!e)throw new Error("useToastActions must be used within a ToastProvider");return e}s(F,"useToastActions");function K(){return(0,o.useContext)(w)}s(K,"useOptionalToastActions");function W(){return(0,o.useContext)(_)}s(W,"useOptionalToastState");function z(){const e=p(),n=F();return(0,o.useMemo)(()=>({toasts:e,...n}),[e,n])}s(z,"useToast");export{F as a,z as i,K as n,p as o,W as r,q as t};
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var s=(e,t)=>n(e,"name",{value:t,configurable:!0});import{zi as i}from"./createLucideIcon-DwVwDVEQ.js";function o(e){const t=new URLSearchParams;e.state&&t.set("state",e.state),e.limit&&t.set("limit",String(e.limit)),e.offset&&t.set("offset",String(e.offset));const a=t.toString();return a?`?${a}`:""}s(o,"buildInviteListQuery");var m={createCompanyInvite:s((e,t={})=>i.post(`/companies/${e}/invites`,t),"createCompanyInvite"),createOpenClawInvitePrompt:s((e,t={})=>i.post(`/companies/${e}/openclaw/invite-prompt`,t),"createOpenClawInvitePrompt"),getInvite:s(e=>i.get(`/invites/${e}`),"getInvite"),getInviteOnboarding:s(e=>i.get(`/invites/${e}/onboarding`),"getInviteOnboarding"),acceptInvite:s((e,t)=>i.post(`/invites/${e}/accept`,t),"acceptInvite"),listInvites:s((e,t={})=>i.get(`/companies/${e}/invites${o(t)}`),"listInvites"),revokeInvite:s(e=>i.post(`/invites/${e}/revoke`,{}),"revokeInvite"),listJoinRequests:s((e,t="pending_approval",a)=>i.get(`/companies/${e}/join-requests?status=${t}${a?`&requestType=${a}`:""}`),"listJoinRequests"),listMembers:s(e=>i.get(`/companies/${e}/members`),"listMembers"),listUserDirectory:s(e=>i.get(`/companies/${e}/user-directory`),"listUserDirectory"),updateMember:s((e,t,a)=>i.patch(`/companies/${e}/members/${t}`,a),"updateMember"),updateMemberPermissions:s((e,t,a)=>i.patch(`/companies/${e}/members/${t}/permissions`,a),"updateMemberPermissions"),updateMemberAccess:s((e,t,a)=>i.patch(`/companies/${e}/members/${t}/role-and-grants`,a),"updateMemberAccess"),archiveMember:s((e,t,a={})=>i.post(`/companies/${e}/members/${t}/archive`,a),"archiveMember"),approveJoinRequest:s((e,t)=>i.post(`/companies/${e}/join-requests/${t}/approve`,{}),"approveJoinRequest"),rejectJoinRequest:s((e,t)=>i.post(`/companies/${e}/join-requests/${t}/reject`,{}),"rejectJoinRequest"),claimJoinRequestApiKey:s((e,t)=>i.post(`/join-requests/${e}/claim-api-key`,{claimSecret:t}),"claimJoinRequestApiKey"),getBoardClaimStatus:s((e,t)=>i.get(`/board-claim/${e}?code=${encodeURIComponent(t)}`),"getBoardClaimStatus"),claimBoard:s((e,t)=>i.post(`/board-claim/${e}/claim`,{code:t}),"claimBoard"),claimBootstrapAdmin:s(()=>i.post("/bootstrap/claim",{}),"claimBootstrapAdmin"),getCliAuthChallenge:s((e,t)=>i.get(`/cli-auth/challenges/${e}?token=${encodeURIComponent(t)}`),"getCliAuthChallenge"),approveCliAuthChallenge:s((e,t)=>i.post(`/cli-auth/challenges/${e}/approve`,{token:t}),"approveCliAuthChallenge"),cancelCliAuthChallenge:s((e,t)=>i.post(`/cli-auth/challenges/${e}/cancel`,{token:t}),"cancelCliAuthChallenge"),searchAdminUsers:s(e=>i.get(`/admin/users?query=${encodeURIComponent(e)}`),"searchAdminUsers"),promoteInstanceAdmin:s(e=>i.post(`/admin/users/${e}/promote-instance-admin`,{}),"promoteInstanceAdmin"),demoteInstanceAdmin:s(e=>i.post(`/admin/users/${e}/demote-instance-admin`,{}),"demoteInstanceAdmin"),getUserCompanyAccess:s(e=>i.get(`/admin/users/${e}/company-access`),"getUserCompanyAccess"),setUserCompanyAccess:s((e,t)=>i.put(`/admin/users/${e}/company-access`,{companyIds:t}),"setUserCompanyAccess"),getCurrentBoardAccess:s(()=>i.get("/cli-auth/me"),"getCurrentBoardAccess")};export{m as t};
@@ -0,0 +1 @@
1
+ var D=Object.defineProperty;var l=(i,e)=>D(i,"name",{value:e,configurable:!0});import{i as O}from"./rolldown-runtime-ZpX3ckPj.js";import{C as I,E as N,Fa as T,Na as L,O as w,S as z,_ as V,a as Z,c as G,d as H,f as q,i as K,l as $,m as B,n as k,o as y,p as U,r as J,t as Q,v as M,x as m,y as W}from"./createLucideIcon-DwVwDVEQ.js";var c=O(T(),1),p=O(L(),1),X=Object.defineProperty,d=l((i,e)=>X(i,"name",{value:e,configurable:!0}),"__name"),A="Popover",[j,he]=z(A,[y]),x=y(),[Y,v]=j(A),ee=d(i=>{const{__scopePopover:e,children:a,open:t,defaultOpen:n,onOpenChange:o,modal:r=!1}=i,s=x(e),u=c.useRef(null),[h,f]=c.useState(!1),[_,P]=W({prop:t,defaultProp:n??!1,onChange:o,caller:A});return(0,p.jsx)(Z,{...s,children:(0,p.jsx)(Y,{scope:e,contentId:V(),triggerRef:u,open:_,onOpenChange:P,onOpenToggle:c.useCallback(()=>P(g=>!g),[P]),hasCustomAnchor:h,onCustomAnchorAdd:c.useCallback(()=>f(!0),[]),onCustomAnchorRemove:c.useCallback(()=>f(!1),[]),modal:r,children:a})})},"Popover"),oe="PopoverAnchor",re=c.forwardRef(d(l(function(e,a){const{__scopePopover:t,...n}=e,o=v(oe,t),r=x(t),{onCustomAnchorAdd:s,onCustomAnchorRemove:u}=o;return c.useEffect(()=>(s(),()=>u()),[s,u]),(0,p.jsx)(k,{...r,...n,ref:a})},"PopoverAnchor2"),"PopoverAnchor")),te="PopoverTrigger",ne=c.forwardRef(d(l(function(e,a){const{__scopePopover:t,...n}=e,o=v(te,t),r=x(t),s=w(a,o.triggerRef),u=(0,p.jsx)(I.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":R(o.open),...n,ref:s,onClick:m(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?u:(0,p.jsx)(k,{asChild:!0,...r,children:u})},"PopoverTrigger2"),"PopoverTrigger")),E="PopoverPortal",[ae,se]=j(E,{forceMount:void 0}),ce=d(i=>{const{__scopePopover:e,forceMount:a,children:t,container:n}=i,o=v(E,e);return(0,p.jsx)(ae,{scope:e,forceMount:a,children:(0,p.jsx)(M,{present:a||o.open,children:(0,p.jsx)(q,{asChild:!0,container:n,children:t})})})},"PopoverPortal"),C="PopoverContent",pe=c.forwardRef(d(l(function(e,a){const t=se(C,e.__scopePopover),{forceMount:n=t.forceMount,...o}=e,r=v(C,e.__scopePopover);return(0,p.jsx)(M,{present:n||r.open,children:r.modal?(0,p.jsx)(ue,{...o,ref:a}):(0,p.jsx)(le,{...o,ref:a})})},"PopoverContent2"),"PopoverContent")),ie=N("PopoverContent.RemoveScroll"),ue=c.forwardRef(d(l(function(e,a){const t=v(C,e.__scopePopover),n=c.useRef(null),o=w(a,n),r=c.useRef(!1);return c.useEffect(()=>{const s=n.current;if(s)return G(s)},[]),(0,p.jsx)($,{as:ie,allowPinchZoom:!0,children:(0,p.jsx)(b,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:m(e.onCloseAutoFocus,s=>{s.preventDefault(),r.current||t.triggerRef.current?.focus()}),onPointerDownOutside:m(e.onPointerDownOutside,s=>{const u=s.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,f=u.button===2||h;r.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:m(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal2"),"PopoverContentModal")),le=c.forwardRef(d(l(function(e,a){const t=v(C,e.__scopePopover),n=c.useRef(!1),o=c.useRef(!1);return(0,p.jsx)(b,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l(r=>{e.onCloseAutoFocus?.(r),r.defaultPrevented||(n.current||t.triggerRef.current?.focus(),r.preventDefault()),n.current=!1,o.current=!1},"onCloseAutoFocus"),onInteractOutside:l(r=>{e.onInteractOutside?.(r),r.defaultPrevented||(n.current=!0,r.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=r.target;t.triggerRef.current?.contains(s)&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&o.current&&r.preventDefault()},"onInteractOutside")})},"PopoverContentNonModal2"),"PopoverContentNonModal")),b=c.forwardRef(d(l(function(e,a){const{__scopePopover:t,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:r,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:_,...P}=e,g=v(C,t),F=x(t);return H(),(0,p.jsx)(U,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:r,children:(0,p.jsx)(B,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:_,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:f,onDismiss:l(()=>g.onOpenChange(!1),"onDismiss"),deferPointerDownOutside:!0,children:(0,p.jsx)(K,{"data-state":R(g.open),role:"dialog",id:g.contentId,...F,...P,ref:a,style:{...P.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl2"),"PopoverContentImpl")),de=c.forwardRef(d(l(function(e,a){const{__scopePopover:t,...n}=e,o=x(t);return(0,p.jsx)(J,{...o,...n,ref:a})},"PopoverArrow2"),"PopoverArrow"));function R(i){return i?"open":"closed"}l(R,"getState");d(R,"getState");var ge=ee,Ce=re,xe=ne,me=ce,_e=pe,Ae=de,S={name:"boxes",size:24,node:[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]};S.node;var Re=Q(S);export{pe as a,ge as c,_e as i,xe as l,Ce as n,ne as o,Ae as r,me as s,Re as t};
@@ -0,0 +1,15 @@
1
+ var Dn=Object.defineProperty;var a=(e,t)=>Dn(e,"name",{value:t,configurable:!0});import{i as Ut}from"./rolldown-runtime-ZpX3ckPj.js";import{$i as Ln,Bi as Mn,Fa as Pn,I as Q,Ma as Tn,Na as Un,Oi as On,Ri as Ot,Vi as Nn,br as jn,ot as Bn,pt as de,t as I,xr as st,zi as c}from"./createLucideIcon-DwVwDVEQ.js";import{t as Fn}from"./preload-helper-CceJXRIF.js";import{c as zn,i as qn,l as Hn,n as Wn,s as Vn,t as Kn}from"./agent-avatar-url-CKjwadh7.js";import{c as it,o as Qn}from"./BreadcrumbContext-CmzhWkn9.js";var l=Ut(Pn(),1),We=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Nt=/^[\\/]{2}/;function Jn(e,t){return t+e.replace(/\\/g,"/")}a(Jn,"normalizeProtocolRelativeUrl");var lt="popstate";function ut(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}a(ut,"isLocation");function Gn(e={}){function t(n,o){let s=o.state?.masked,{pathname:i,search:u,hash:d}=s||n.location;return Oe("",{pathname:i,search:u,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}a(t,"createBrowserLocation");function r(n,o){return typeof o=="string"?o:K(o)}return a(r,"createBrowserHref"),Zn(t,r,null,e)}a(Gn,"createBrowserHistory");function $(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}a($,"invariant");function P(e,t){if(!e)try{throw new Error(t)}catch{}}a(P,"warning");function Yn(){return Math.random().toString(36).substring(2,10)}a(Yn,"createKey");function ct(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}a(ct,"getHistoryState");function Oe(e,t,r=null,n,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?te(t):t,state:r,key:t&&t.key||n||Yn(),mask:o}}a(Oe,"createLocation");function K({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}a(K,"createPath");function te(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}a(te,"parsePath");function Zn(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,u="POP",d=null,f=p();f==null&&(f=0,i.replaceState({...i.state,idx:f},""));function p(){return(i.state||{idx:null}).idx}a(p,"getIndex");function m(){u="POP";let h=p(),b=h==null?null:h-f;f=h,d&&d({action:u,location:y.location,delta:b})}a(m,"handlePop");function g(h,b){u="PUSH";let x=ut(h)?h:Oe(y.location,h,b);r&&r(x,h),f=p()+1;let w=ct(x,f),_=y.createHref(x.mask||x);try{i.pushState(w,"",_)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;o.location.assign(_)}s&&d&&d({action:u,location:y.location,delta:1})}a(g,"push");function v(h,b){u="REPLACE";let x=ut(h)?h:Oe(y.location,h,b);r&&r(x,h),f=p();let w=ct(x,f),_=y.createHref(x.mask||x);i.replaceState(w,"",_),s&&d&&d({action:u,location:y.location,delta:0})}a(v,"replace2");function k(h){return Xn(o,h)}a(k,"createURL");let y={get action(){return u},get location(){return e(o,i)},listen(h){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(lt,m),d=h,()=>{o.removeEventListener(lt,m),d=null}},createHref(h){return t(o,h)},createURL:k,encodeLocation(h){let b=k(h);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:g,replace:v,go(h){return i.go(h)}};return y}a(Zn,"getUrlBasedHistory");function Xn(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),$(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:K(t);return o=o.replace(/ $/,"%20"),!r&&Nt.test(o)&&(o=n+o),new URL(o,n)}a(Xn,"createBrowserURLImpl");var ea;ea=new WeakMap;function jt(e,t,r="/"){return Bt(e,t,r,!1)}a(jt,"matchRoutes");function Bt(e,t,r,n,o){let s=q((typeof t=="string"?te(t):t).pathname||"/",r);if(s==null)return null;let i=o??ra(e),u=null,d=ma(s);for(let f=0;u==null&&f<i.length;++f)u=fa(i[f],d,n);return u}a(Bt,"matchRoutesImpl");function ta(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],loaderData:t[r.id],handle:r.handle}}a(ta,"convertRouteMatchToUiMatch");function ra(e){let t=Ft(e);return na(t),t}a(ra,"flattenAndRankRoutes");function Ft(e,t=[],r=[],n="",o=!1){let s=a((i,u,d=o,f)=>{let p={relativePath:f===void 0?i.path||"":f,caseSensitive:i.caseSensitive===!0,childrenIndex:u,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(n)&&d)return;$(p.relativePath.startsWith(n),`Absolute route path "${p.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(n.length)}let m=j([n,p.relativePath]),g=r.concat(p);i.children&&i.children.length>0&&($(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),Ft(i.children,t,g,m,d)),!(i.path==null&&!i.index)&&t.push({path:m,score:ca(m,i.index),routesMeta:g.map((v,k)=>{let[y,h]=Ht(v.relativePath,v.caseSensitive,k===g.length-1);return{...v,matcher:y,compiledParams:h}})})},"flattenRoute");return e.forEach((i,u)=>{if(i.path===""||!i.path?.includes("?"))s(i,u);else for(let d of zt(i.path))s(i,u,!0,d)}),t}a(Ft,"flattenRoutes");function zt(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return o?[s,""]:[s];let i=zt(n.join("/")),u=[];return u.push(...i.map(d=>d===""?s:[s,d].join("/"))),o&&u.push(...i),u.map(d=>e.startsWith("/")&&d===""?"/":d)}a(zt,"explodeOptionalSegments");function na(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:da(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}a(na,"rankRouteBranches");var aa=/^:[\w-]+$/,oa=3,sa=2,ia=1,la=10,ua=-2,dt=a(e=>e==="*","isSplat");function ca(e,t){let r=e.split("/"),n=r.length;return r.some(dt)&&(n+=ua),t&&(n+=sa),r.filter(o=>!dt(o)).reduce((o,s)=>o+(aa.test(s)?oa:s===""?ia:la),n)}a(ca,"computeScore");function da(e,t){return e.length===t.length&&e.slice(0,-1).every((r,n)=>r===t[n])?e[e.length-1]-t[t.length-1]:0}a(da,"compareIndexes");function fa(e,t,r=!1){let{routesMeta:n}=e,o={},s="/",i=[];for(let u=0;u<n.length;++u){let d=n[u],f=u===n.length-1,p=s==="/"?t:t.slice(s.length)||"/",m={path:d.relativePath,caseSensitive:d.caseSensitive,end:f},g=d.matcher&&d.compiledParams?qt(m,p,d.matcher,d.compiledParams):xe(m,p),v=d.route;if(!g&&f&&r&&!n[n.length-1].route.index&&(g=xe({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!g)return null;Object.assign(o,g.params),i.push({params:o,pathname:j([s,g.pathname]),pathnameBase:ga(j([s,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(s=j([s,g.pathnameBase]))}return i}a(fa,"matchRouteBranch");function xe(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Ht(e.path,e.caseSensitive,e.end);return qt(e,t,r,n)}a(xe,"matchPath");function qt(e,t,r,n){let o=t.match(r);if(!o)return null;let s=o[0],i=X(s,1),u=o.slice(1);return{params:n.reduce((d,{paramName:f,isOptional:p},m)=>{if(f==="*"){let v=u[m]||"";i=X(s.slice(0,s.length-v.length),1)}const g=u[m];return p&&!g?d[f]=void 0:d[f]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:i,pattern:e}}a(qt,"matchPathImpl");function Ht(e,t=!1,r=!0){P(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,i,u,d,f)=>{if(n.push({paramName:i,isOptional:u!=null}),u){let p=f.charAt(d+s.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}a(Ht,"compilePath");function ma(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return P(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}a(ma,"decodePath");function q(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}a(q,"stripBasename");function pa(e,t="/"){let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?te(e):e,s;return r?(r=Wt(r),r.startsWith("/")||r.startsWith("\\")?s=ft(r.substring(1),"/"):s=ft(r,t)):s=t,{pathname:s,search:ya(n),hash:va(o)}}a(pa,"resolvePath");function ft(e,t){let r=X(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}a(ft,"resolvePathname");function Me(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}a(Me,"getInvalidPathError");function ha(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}a(ha,"getPathContributingMatches");function Ve(e){let t=ha(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}a(Ve,"getResolveToMatches");function Se(e,t,r,n=!1){let o;typeof e=="string"?o=te(e):(o={...e},$(!o.pathname||!o.pathname.includes("?"),Me("?","pathname","search",o)),$(!o.pathname||!o.pathname.includes("#"),Me("#","pathname","hash",o)),$(!o.search||!o.search.includes("#"),Me("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,u;if(i==null)u=r;else{let m=t.length-1;if(!n&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),m-=1;o.pathname=g.join("/")}u=m>=0?t[m]:"/"}let d=pa(o,u),f=i&&i!=="/"&&i.endsWith("/"),p=(s||i===".")&&r.endsWith("/");return!d.pathname.endsWith("/")&&(f||p)&&(d.pathname+="/"),d}a(Se,"resolveTo$1");var Wt=a(e=>e.replace(/[\\/]{2,}/g,"/"),"removeDoubleSlashes"),j=a(e=>Wt(e.join("/")),"joinPaths");function X(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}a(X,"removeTrailingSlash");var ga=a(e=>X(e).replace(/^\/*/,"/"),"normalizePathname"),ya=a(e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,"normalizeSearch"),va=a(e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,"normalizeHash"),ka=class{static{a(this,"ErrorResponseImpl")}constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Vt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}a(Vt,"isRouteErrorResponse");function ba(e){return j(e.map(t=>t.route.path).filter(Boolean))||"/"}a(ba,"getRoutePattern");var Kt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qt(e,t){let r=e;if(typeof r!="string"||!We.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,o=!1;if(Kt)try{let s=new URL(window.location.href),i=Nt.test(r)?new URL(Jn(r,s.protocol)):new URL(r),u=q(i.pathname,t);i.origin===s.origin&&u!=null?r=u+i.search+i.hash:o=!0}catch{P(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:o,to:r}}a(Qt,"parseToInfo");var Ni=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),mt=new URL("http://localhost");function Ke(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),mt)}catch{return mt}}a(Ke,"getNavigatorCurrentUrl");function Pe(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}a(Pe,"isSameOrigin");function xa(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}a(xa,"isExplicitUrl");function Qe(e,t,r,n){let o=null;try{o=e==null?null:new URL(e,r)}catch{}let s=new URL(t,r),i=o!=null&&!Pe(o,r),u=!Pe(s,r);if(n==="reject"){if(i||u)throw new Error("External navigation is not allowed")}else if(u&&(o==null||!xa(e,o)||!Pe(o,s)))throw new Error("External navigation is not allowed")}a(Qe,"validateNavigationTarget");var Jt=["POST","PUT","PATCH","DELETE"],ji=new Set(Jt),wa=["GET",...Jt],Bi=new Set(wa),Ia,Ra,Sa,Ea;Ia=new WeakMap;Ra=new WeakMap;Sa=new WeakMap;Ea=new WeakMap;var Ca=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function $a(e){try{return Ca.includes(new URL(e).protocol)}catch{return!1}}a($a,"hasInvalidProtocol");var re=l.createContext(null);re.displayName="DataRouter";var fe=l.createContext(null);fe.displayName="DataRouterState";var Gt=l.createContext(!1);function Yt(){return l.useContext(Gt)}a(Yt,"useIsRSCRouterContext");var Zt=l.createContext({isTransitioning:!1});Zt.displayName="ViewTransition";var _a=l.createContext(new Map);_a.displayName="Fetchers";var Ne=l.createContext(null);Ne.displayName="Await";var L=l.createContext(null);L.displayName="Navigation";var ne=l.createContext(null);ne.displayName="Location";var O=l.createContext({outlet:null,matches:[],isDataRoute:!1});O.displayName="Route";var Je=l.createContext(null);Je.displayName="RouteError";var Xt="REACT_ROUTER_ERROR",Aa="REDIRECT",Da="ROUTE_ERROR_RESPONSE";function La(e){if(e.startsWith(`${Xt}:${Aa}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}a(La,"decodeRedirectErrorDigest");function Ma(e){if(e.startsWith(`${Xt}:${Da}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new ka(t.status,t.statusText,t.data)}catch{}}a(Ma,"decodeRouteErrorResponseDigest");function Pa(e,{relative:t}={}){$(ae(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=l.useContext(L),{hash:o,pathname:s,search:i}=me(e,{relative:t}),u=s;return r!=="/"&&(u=s==="/"?r:j([r,s])),n.createHref({pathname:u,search:i,hash:o})}a(Pa,"useHref");function ae(){return l.useContext(ne)!=null}a(ae,"useInRouterContext");function T(){return $(ae(),"useLocation() may be used only in the context of a <Router> component."),l.useContext(ne).location}a(T,"useLocation");function Fi(){return l.useContext(ne).navigationType}a(Fi,"useNavigationType");var er="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function tr(e){l.useContext(L).static||l.useLayoutEffect(e)}a(tr,"useIsomorphicLayoutEffect");function Ee(){let{isDataRoute:e}=l.useContext(O);return e?Ga():Ta()}a(Ee,"useNavigate$1");function Ta(){$(ae(),"useNavigate() may be used only in the context of a <Router> component.");let e=l.useContext(re),{basename:t,navigator:r}=l.useContext(L),{matches:n}=l.useContext(O),{pathname:o}=T(),s=JSON.stringify(Ve(n)),i=l.useRef(!1);return tr(()=>{i.current=!0}),l.useCallback((u,d={})=>{if(P(i.current,er),!i.current)return;if(typeof u=="number"){r.go(u);return}let f=Se(u,JSON.parse(s),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:j([t,f.pathname])),Qe(typeof u=="string"?u:K(u),r.createHref(f),Ke(r),"reject"),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,s,o,e])}a(Ta,"useNavigateUnstable");var Ua=l.createContext(null);function Oa(e){let t=l.useContext(O).outlet;return l.useMemo(()=>t&&l.createElement(Ua.Provider,{value:e},t),[t,e])}a(Oa,"useOutlet");function Na(){let{matches:e}=l.useContext(O);return e[e.length-1]?.params??{}}a(Na,"useParams");function me(e,{relative:t}={}){let{matches:r}=l.useContext(O),{pathname:n}=T(),o=JSON.stringify(Ve(r));return l.useMemo(()=>Se(e,JSON.parse(o),n,t==="path"),[e,o,n,t])}a(me,"useResolvedPath");function ja(e,t){return rr(e,t)}a(ja,"useRoutes");function rr(e,t,r){$(ae(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=l.useContext(L),{matches:o}=l.useContext(O),s=o[o.length-1],i=s?s.params:{},u=s?s.pathname:"/",d=s?s.pathnameBase:"/",f=s&&s.route;{let h=f&&f.path||"";or(u,!f||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${h}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
+
3
+ Please change the parent <Route path="${h}"> to <Route path="${h==="/"?"*":`${h}/*`}">.`)}let p=T(),m;if(t){let h=typeof t=="string"?te(t):t;$(d==="/"||h.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${h.pathname}" was given in the \`location\` prop.`),m=h}else m=p;let g=m.pathname||"/",v=g;if(d!=="/"){let h=d.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(h.length).join("/")}let k=r&&r.state.matches.length?r.state.matches.map(h=>Object.assign(h,{route:r.manifest[h.route.id]||h.route})):jt(e,{pathname:v});P(f||k!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),P(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=Ha(k&&k.map(h=>Object.assign({},h,{params:Object.assign({},i,h.params),pathname:j([d,n.encodeLocation?n.encodeLocation(h.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?d:j([d,n.encodeLocation?n.encodeLocation(h.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathnameBase])})),o,r);return t&&y?l.createElement(ne.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...m},navigationType:"POP"}},y):y}a(rr,"useRoutesImpl");function Ba(){let e=Ja(),t=Vt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},s={padding:"2px 4px",backgroundColor:n},i=null;return i=l.createElement(l.Fragment,null,l.createElement("p",null,"💿 Hey developer 👋"),l.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",l.createElement("code",{style:s},"ErrorBoundary")," or"," ",l.createElement("code",{style:s},"errorElement")," prop on your route.")),l.createElement(l.Fragment,null,l.createElement("h2",null,"Unexpected Application Error!"),l.createElement("h3",{style:{fontStyle:"italic"}},t),r?l.createElement("pre",{style:o},r):null,i)}a(Ba,"DefaultErrorComponent");var Fa=l.createElement(Ba,null),nr=class extends l.Component{static{a(this,"RenderErrorBoundary")}constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=Ma(e.digest);r&&(e=r)}let t=e!==void 0?l.createElement(O.Provider,{value:this.props.routeContext},l.createElement(Je.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?l.createElement(za,{error:e},t):t}};nr.contextType=Gt;var Te=new WeakMap;function za({children:e,error:t}){let{basename:r,navigator:n}=l.useContext(L);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=La(t.digest);if(o){let s=Te.get(t);if(s)throw s;let i=Qt(o.location,r),u=i.absoluteURL||i.to;if(Qe(o.location,u,Ke(n),"allow-explicit"),$a(u))throw new Error("Invalid redirect location");if(Kt&&!Te.get(t))if(i.isExternal||o.reloadDocument)window.location.href=u;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:o.replace}));throw Te.set(t,d),d}return l.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}a(za,"RSCErrorHandler");function qa({routeContext:e,match:t,children:r}){let n=l.useContext(re);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),l.createElement(O.Provider,{value:e},r)}a(qa,"RenderedRoute");function Ha(e,t=[],r){let n=r?.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=n?.errors;if(s!=null){let p=o.findIndex(m=>m.route.id&&s?.[m.route.id]!==void 0);$(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,p+1))}let i=!1,u=-1;if(r&&n){i=n.renderFallback;for(let p=0;p<o.length;p++){let m=o[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=p),m.route.id){let{loaderData:g,errors:v}=n,k=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||k){r.isStatic&&(i=!0),u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}}let d=r?.onError,f=n&&d?(p,m)=>{d(p,{location:n.location,params:n.matches?.[0]?.params??{},pattern:ba(n.matches),errorInfo:m})}:void 0;return o.reduceRight((p,m,g)=>{let v,k=!1,y=null,h=null;n&&(v=s&&m.route.id?s[m.route.id]:void 0,y=m.route.errorElement||Fa,i&&(u<0&&g===0?(or("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,h=null):u===g&&(k=!0,h=m.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,g+1)),x=a(()=>{let w;return v?w=y:k?w=h:m.route.Component?w=l.createElement(m.route.Component,null):m.route.element?w=m.route.element:w=p,l.createElement(qa,{match:m,routeContext:{outlet:p,matches:b,isDataRoute:n!=null},children:w})},"getChildren");return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?l.createElement(nr,{location:n.location,revalidation:n.revalidation,component:y,error:v,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0},onError:f}):x()},null)}a(Ha,"_renderMatches");function Ge(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}a(Ge,"getDataRouterConsoleError");function Wa(e){let t=l.useContext(re);return $(t,Ge(e)),t}a(Wa,"useDataRouterContext");function Ye(e){let t=l.useContext(fe);return $(t,Ge(e)),t}a(Ye,"useDataRouterState");function Va(e){let t=l.useContext(O);return $(t,Ge(e)),t}a(Va,"useRouteContext");function Ze(e){let t=Va(e),r=t.matches[t.matches.length-1];return $(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}a(Ze,"useCurrentRouteId");function Ka(){return Ze("useRouteId")}a(Ka,"useRouteId");function Qa(){let e=Ye("useNavigation");return l.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}a(Qa,"useNavigation");function ar(){let{matches:e,loaderData:t}=Ye("useMatches");return l.useMemo(()=>e.map(r=>ta(r,t)),[e,t])}a(ar,"useMatches");function Ja(){let e=l.useContext(Je),t=Ye("useRouteError"),r=Ze("useRouteError");return e!==void 0?e:t.errors?.[r]}a(Ja,"useRouteError");function Ga(){let{router:e}=Wa("useNavigate"),t=Ze("useNavigate"),r=l.useRef(!1);return tr(()=>{r.current=!0}),l.useCallback(async(n,o={})=>{P(r.current,er),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}a(Ga,"useNavigateStable");var pt={};function or(e,t,r){!t&&!pt[e]&&(pt[e]=!0,P(!1,r))}a(or,"warningOnce");var ht={};function Ya(e,t){!e&&!ht[t]&&(ht[t]=!0)}a(Ya,"warnOnce");var zi=l.memo(Za);function Za({routes:e,manifest:t,future:r,state:n,isStatic:o,onError:s}){return rr(e,void 0,{manifest:t,state:n,isStatic:o,onError:s,future:r})}a(Za,"DataRoutes2");function Xa({to:e,replace:t,state:r,relative:n}){$(ae(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:s}=l.useContext(L);P(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=l.useContext(O),{pathname:u}=T(),d=Ee(),f=Se(e,Ve(i),u,n==="path");Qe(typeof e=="string"?e:K(e),s.createHref(f),Ke(s),"reject");let p=JSON.stringify(f);return l.useEffect(()=>{d(JSON.parse(p),{replace:t,state:r,relative:n})},[d,p,n,t,r]),null}a(Xa,"Navigate$1");function qi(e){return Oa(e.context)}a(qi,"Outlet");function eo(e){$(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}a(eo,"Route");function sr({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:s=!1,useTransitions:i}){$(!ae(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=l.useMemo(()=>({basename:u,navigator:o,static:s,useTransitions:i,future:{}}),[u,o,s,i]);typeof r=="string"&&(r=te(r));let{pathname:f="/",search:p="",hash:m="",state:g=null,key:v="default",mask:k}=r,y=l.useMemo(()=>{let h=q(f,u);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:v,mask:k},navigationType:n}},[u,f,p,m,g,v,n,k]);return P(y!=null,`<Router basename="${u}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:l.createElement(L.Provider,{value:d},l.createElement(ne.Provider,{children:t,value:y}))}a(sr,"Router");function Hi({children:e,location:t}){return ja(je(e),t)}a(Hi,"Routes");var Wi=class extends l.Component{static{a(this,"AwaitErrorBoundary")}constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,o=0;if(!(r instanceof Promise))o=1,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:a(()=>!0,"get")}),Object.defineProperty(n,"_data",{get:a(()=>r,"get")});else if(this.state.error){o=2;let s=this.state.error;n=Promise.reject().catch(()=>{}),Object.defineProperty(n,"_tracked",{get:a(()=>!0,"get")}),Object.defineProperty(n,"_error",{get:a(()=>s,"get")})}else r._tracked?(n=r,o="_error"in n?2:"_data"in n?1:0):(o=0,Object.defineProperty(r,"_tracked",{get:a(()=>!0,"get")}),n=r.then(s=>Object.defineProperty(r,"_data",{get:a(()=>s,"get")}),s=>{this.props.onError?.(s),Object.defineProperty(r,"_error",{get:a(()=>s,"get")})}));if(o===2&&!t)throw n._error;if(o===2)return l.createElement(Ne.Provider,{value:n,children:t});if(o===1)return l.createElement(Ne.Provider,{value:n,children:e});throw n}};function je(e,t=[]){let r=[];return l.Children.forEach(e,(n,o)=>{if(!l.isValidElement(n))return;let s=[...t,o];if(n.type===l.Fragment){r.push.apply(r,je(n.props.children,s));return}$(n.type===eo,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$(!n.props.index||!n.props.children,"An index route cannot have child routes.");let i={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=je(n.props.children,s)),r.push(i)}),r}a(je,"createRoutesFromChildren");var ke="get",be="application/x-www-form-urlencoded";function Ce(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}a(Ce,"isHtmlElement");function to(e){return Ce(e)&&e.tagName.toLowerCase()==="button"}a(to,"isButtonElement");function ro(e){return Ce(e)&&e.tagName.toLowerCase()==="form"}a(ro,"isFormElement");function no(e){return Ce(e)&&e.tagName.toLowerCase()==="input"}a(no,"isInputElement");function ao(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}a(ao,"isModifiedEvent");function oo(e,t){return e.button===0&&(!t||t==="_self")&&!ao(e)}a(oo,"shouldProcessLinkClick");function Be(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}a(Be,"createSearchParams");function so(e,t){let r=Be(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}a(so,"getSearchParamsForLocation");var ge=null;function io(){if(ge===null)try{new FormData(document.createElement("form"),0),ge=!1}catch{ge=!0}return ge}a(io,"isFormDataSubmitterSupported");var lo=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ue(e){return e!=null&&!lo.has(e)?(P(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${be}"`),null):e}a(Ue,"getFormEncType");function uo(e,t){let r,n,o,s,i;if(ro(e)){let u=e.getAttribute("action");n=u?q(u,t):null,r=e.getAttribute("method")||ke,o=Ue(e.getAttribute("enctype"))||be,s=new FormData(e)}else if(to(e)||no(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||u.getAttribute("action");if(n=d?q(d,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||ke,o=Ue(e.getAttribute("formenctype"))||Ue(u.getAttribute("enctype"))||be,s=new FormData(u,e),!io()){let{name:f,type:p,value:m}=e;if(p==="image"){let g=f?`${f}.`:"";s.append(`${g}x`,"0"),s.append(`${g}y`,"0")}else f&&s.append(f,m)}}else{if(Ce(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ke,n=null,o=be,i=e}return s&&o==="text/plain"&&(i=s,s=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:s,body:i}}a(uo,"getFormSubmissionInfo");var Vi=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),co={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},fo=/[&><\u2028\u2029]/g;function gt(e){return e.replace(fo,t=>co[t])}a(gt,"escapeHtml");function $e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}a($e,"invariant2");function ir(e,t,r,n){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${n}`:o.pathname=`${o.pathname}.${n}`:o.pathname==="/"?o.pathname=`_root.${n}`:t&&q(o.pathname,t)==="/"?o.pathname=`${X(t)}/_root.${n}`:o.pathname=`${X(o.pathname)}.${n}`,o}a(ir,"singleFetchUrl");async function mo(e,t){if(e.id in t)return t[e.id];try{let r=await Fn(()=>import(e.module),[]);return t[e.id]=r,r}catch{return window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}a(mo,"loadRouteModule");function po(e){return e!=null&&typeof e.page=="string"}a(po,"isPageLinkDescriptor");function ho(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}a(ho,"isHtmlLinkDescriptor");async function go(e,t,r){return ko((await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let s=await mo(o,r);return s.links?s.links():[]}return[]}))).flat(1).filter(ho).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}a(go,"getKeyedPrefetchLinks");function yt(e,t,r,n,o,s){let i=a((d,f)=>r[f]?d.route.id!==r[f].route.id:!0,"isNew"),u=a((d,f)=>r[f].pathname!==d.pathname||r[f].route.path?.endsWith("*")&&r[f].params["*"]!==d.params["*"],"matchPathChanged");return s==="assets"?t.filter((d,f)=>i(d,f)||u(d,f)):s==="data"?t.filter((d,f)=>{let p=n.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(i(d,f)||u(d,f))return!0;if(d.route.shouldRevalidate){let m=d.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}a(yt,"getNewMatchesForLinks");function lr(e,t,{includeHydrateFallback:r}={}){return yo(e.map(n=>{let o=t.routes[n.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}a(lr,"getModuleLinkHrefs");function yo(e){return[...new Set(e)]}a(yo,"dedupeHrefs");function vo(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}a(vo,"sortKeys");function ko(e,t){let r=new Set,n=new Set(t);return e.reduce((o,s)=>{if(t&&!po(s)&&s.as==="script"&&s.href&&n.has(s.href))return o;let i=JSON.stringify(vo(s));return r.has(i)||(r.add(i),o.push({key:i,link:s})),o},[])}a(ko,"dedupeLinkDescriptors");function bo(e,t){return e.mode==="lazy"&&t===!0}a(bo,"isFogOfWarEnabled");function xo({sri:e,...t},r){let n=new Set(r.state.matches.map(u=>u.route.id)),o=r.state.location.pathname.split("/").filter(Boolean),s=["/"];for(o.pop();o.length>0;)s.push(`/${o.join("/")}`),o.pop();s.forEach(u=>{let d=Bt(r.routes,u,r.basename||"/",!1,r.branches);d&&d.forEach(f=>n.add(f.route.id))});let i=[...n].reduce((u,d)=>Object.assign(u,{[d]:t.routes[d]}),{});return{...t,routes:i,sri:e?!0:void 0}}a(xo,"getPartialManifest");function _e(){let e=l.useContext(re);return $e(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}a(_e,"useDataRouterContext2");function ur(){let e=l.useContext(fe);return $e(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}a(ur,"useDataRouterStateContext");var Ae=l.createContext(void 0);Ae.displayName="FrameworkContext";function J(){let e=l.useContext(Ae);return $e(e,"You must render this element inside a <HydratedRouter> element"),e}a(J,"useFrameworkContext");function wo(e,t){let r=l.useContext(Ae),[n,o]=l.useState(!1),[s,i]=l.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:f,onMouseLeave:p,onTouchStart:m}=t,g=l.useRef(null);l.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let y=a(b=>{b.forEach(x=>{i(x.isIntersecting)})},"callback"),h=new IntersectionObserver(y,{threshold:.5});return g.current&&h.observe(g.current),()=>{h.disconnect()}}},[e]),l.useEffect(()=>{if(n){let y=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(y)}}},[n]);let v=a(()=>{o(!0)},"setIntent"),k=a(()=>{o(!1),i(!1)},"cancelIntent");return r?e!=="intent"?[s,g,{}]:[s,g,{onFocus:ie(u,v),onBlur:ie(d,k),onMouseEnter:ie(f,v),onMouseLeave:ie(p,k),onTouchStart:ie(m,v)}]:[!1,g,{}]}a(wo,"usePrefetchBehavior");function ie(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}a(ie,"composeEventHandlers");function Io(e,t,r){if(r&&!we)return[e[0]];if(t){let n=e.findIndex(o=>t[o.route.id]!==void 0);return e.slice(0,n+1)}return e}a(Io,"getActiveMatches");function Ro({page:e,...t}){let r=Yt(),{nonce:n}=J(),{router:o}=_e(),s=l.useMemo(()=>jt(o.routes,e,o.basename),[o.routes,e,o.basename]);return s?(t.nonce==null&&n&&(t={...t,nonce:n}),r?l.createElement(Eo,{page:e,matches:s,...t}):l.createElement(Co,{page:e,matches:s,...t})):null}a(Ro,"PrefetchPageLinks");function So(e){let{manifest:t,routeModules:r}=J(),[n,o]=l.useState([]);return l.useEffect(()=>{let s=!1;return go(e,t,r).then(i=>{s||o(i)}),()=>{s=!0}},[e,t,r]),n}a(So,"useKeyedPrefetchLinks");function Eo({page:e,matches:t,...r}){let n=T(),{future:o}=J(),{basename:s}=_e(),i=l.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let u=ir(e,s,o.v8_trailingSlashAwareDataRequests,"rsc"),d=!1,f=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?d=!0:f.push(p.route.id);return d&&f.length>0&&u.searchParams.set("_routes",f.join(",")),[u.pathname+u.search]},[s,o.v8_trailingSlashAwareDataRequests,e,n,t]);return l.createElement(l.Fragment,null,i.map(u=>l.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...r})))}a(Eo,"RSCPrefetchPageLinksImpl");function Co({page:e,matches:t,...r}){let n=T(),{future:o,manifest:s,routeModules:i}=J(),{basename:u}=_e(),{loaderData:d,matches:f}=ur(),p=l.useMemo(()=>yt(e,t,f,s,n,"data"),[e,t,f,s,n]),m=l.useMemo(()=>yt(e,t,f,s,n,"assets"),[e,t,f,s,n]),g=l.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let y=new Set,h=!1;if(t.forEach(x=>{let w=s.routes[x.route.id];!w||!w.hasLoader||(!p.some(_=>_.route.id===x.route.id)&&x.route.id in d&&i[x.route.id]?.shouldRevalidate||w.hasClientLoader?h=!0:y.add(x.route.id))}),y.size===0)return[];let b=ir(e,u,o.v8_trailingSlashAwareDataRequests,"data");return h&&y.size>0&&b.searchParams.set("_routes",t.filter(x=>y.has(x.route.id)).map(x=>x.route.id).join(",")),[b.pathname+b.search]},[u,o.v8_trailingSlashAwareDataRequests,d,n,s,p,t,e,i]),v=l.useMemo(()=>lr(m,s),[m,s]),k=So(m);return l.createElement(l.Fragment,null,g.map(y=>l.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...r})),v.map(y=>l.createElement("link",{key:y,rel:"modulepreload",href:y,...r})),k.map(({key:y,link:h})=>l.createElement("link",{key:y,nonce:r.nonce,...h,crossOrigin:h.crossOrigin??r.crossOrigin})))}a(Co,"PrefetchPageLinksImpl");var we=!1;function $o(){we=!0}a($o,"setIsHydrated");function _o(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:o,routeDiscovery:s,ssr:i,nonce:u}=J(),{router:d,static:f,staticContext:p}=_e(),{matches:m}=ur(),g=Yt(),v=bo(s,i);e.nonce==null&&u&&(e={...e,nonce:u}),o&&(o.didRenderScripts=!0);let k=Io(m,null,n);l.useEffect(()=>{$o()},[]);let y=l.useMemo(()=>{if(g)return null;let x=p?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",w=f?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${v?"":`import ${JSON.stringify(t.url)}`};
4
+ ${k.map((_,E)=>{let A=`route${E}`,M=t.routes[_.route.id];$e(M,`Route ${_.route.id} not found in manifest`);let{clientActionModule:N,clientLoaderModule:D,clientMiddlewareModule:B,hydrateFallbackModule:G,module:U}=M,H=[...N?[{module:N,varName:`${A}_clientAction`}]:[],...D?[{module:D,varName:`${A}_clientLoader`}]:[],...B?[{module:B,varName:`${A}_clientMiddleware`}]:[],...G?[{module:G,varName:`${A}_HydrateFallback`}]:[],{module:U,varName:`${A}_main`}];return H.length===1?`import * as ${A} from ${JSON.stringify(U)};`:[H.map(F=>`import * as ${F.varName} from "${F.module}";`).join(`
5
+ `),`const ${A} = {${H.map(F=>`...${F.varName}`).join(",")}};`].join(`
6
+ `)}).join(`
7
+ `)}
8
+ ${v?`window.__reactRouterManifest = ${JSON.stringify(xo(t,d),null,2)};`:""}
9
+ window.__reactRouterRouteModules = {${k.map((_,E)=>`${JSON.stringify(_.route.id)}:route${E}`).join(",")}};
10
+
11
+ import(${JSON.stringify(t.entry.module)});`:" ";return l.createElement(l.Fragment,null,l.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:x},type:void 0}),l.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:w},type:"module",async:!0}))},[]),h=we||g?[]:[...new Set(t.entry.imports.concat(lr(k,t,{includeHydrateFallback:!0})))],b=typeof t.sri=="object"?t.sri:{};return Ya(!g,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),we||g?null:l.createElement(l.Fragment,null,typeof t.sri=="object"?l.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:b})}}):null,v?null:l.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:b[t.url],nonce:e.nonce,suppressHydrationWarning:!0}),l.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:b[t.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),h.map(x=>l.createElement("link",{key:x,rel:"modulepreload",href:x,crossOrigin:e.crossOrigin,integrity:b[x],nonce:e.nonce,suppressHydrationWarning:!0})),y)}a(_o,"Scripts");function Ao(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}a(Ao,"mergeRefs");var Ki=class extends l.Component{static{a(this,"RemixErrorBoundary")}constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?l.createElement(Do,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Do({error:e,isOutsideRemixApp:t}){let{nonce:r}=J(),n=l.createElement("script",{nonce:r,dangerouslySetInnerHTML:{__html:`
12
+ console.log(
13
+ "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
14
+ );
15
+ `}});if(Vt(e))return l.createElement(vt,{title:"Unhandled Thrown Response!"},l.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),n);let o;if(e instanceof Error)o=e;else{let s=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);o=new Error(s)}return l.createElement(vt,{title:"Application Error!",isOutsideRemixApp:t},l.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),l.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},o.stack),n)}a(Do,"RemixRootDefaultErrorBoundary");function vt({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:o}=J();return o.root?.Layout&&!r?n:l.createElement("html",{lang:"en"},l.createElement("head",null,l.createElement("meta",{charSet:"utf-8"}),l.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),l.createElement("title",null,e)),l.createElement("body",null,l.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?l.createElement(_o,null):null)))}a(vt,"BoundaryShell");var Lo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Lo&&(window.__reactRouterVersion="7.18.4")}catch{}function Qi({basename:e,children:t,useTransitions:r,window:n}){let o=l.useRef();o.current==null&&(o.current=Gn({window:n,v5Compat:!0}));let s=o.current,[i,u]=l.useState({action:s.action,location:s.location}),d=l.useCallback(f=>{r===!1?u(f):l.startTransition(()=>u(f))},[r]);return l.useLayoutEffect(()=>s.listen(d),[s,d]),l.createElement(sr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:s,useTransitions:r})}a(Qi,"BrowserRouter");function Mo({basename:e,children:t,history:r,useTransitions:n}){let[o,s]=l.useState({action:r.action,location:r.location}),i=l.useCallback(u=>{n===!1?s(u):l.startTransition(()=>s(u))},[n]);return l.useLayoutEffect(()=>r.listen(i),[r,i]),l.createElement(sr,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:r,useTransitions:n})}a(Mo,"HistoryRouter");Mo.displayName="unstable_HistoryRouter";var pe=l.forwardRef(a(function({onClick:t,discover:r="render",prefetch:n="none",relative:o,reloadDocument:s,replace:i,mask:u,state:d,target:f,to:p,preventScrollReset:m,viewTransition:g,defaultShouldRevalidate:v,...k},y){let{basename:h,navigator:b,useTransitions:x}=l.useContext(L),w=typeof p=="string"&&We.test(p),_=Qt(p,h);p=_.to;let E=Pa(p,{relative:o}),A=T(),M=null;if(u){let z=Se(u,[],A.mask?A.mask.pathname:"/",!0);h!=="/"&&(z.pathname=z.pathname==="/"?h:j([h,z.pathname])),M=b.createHref(z)}let[N,D,B]=wo(n,k),G=Oo(p,{replace:i,mask:u,state:d,target:f,preventScrollReset:m,relative:o,viewTransition:g,defaultShouldRevalidate:v,useTransitions:x});function U(z){t&&t(z),z.defaultPrevented||G(z)}a(U,"handleClick");let H=!(_.isExternal||s),F=l.createElement("a",{...k,...B,href:(H?M:void 0)||_.absoluteURL||E,onClick:H?U:t,ref:Ao(y,D),target:f,"data-discover":!w&&r==="render"?"true":void 0});return N&&!w?l.createElement(l.Fragment,null,F,l.createElement(Ro,{page:E})):F},"LinkWithRef"));pe.displayName="Link";var cr=l.forwardRef(a(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:o=!1,style:s,to:i,viewTransition:u,children:d,...f},p){let m=me(i,{relative:f.relative}),g=T(),v=l.useContext(fe),{navigator:k,basename:y}=l.useContext(L),h=v!=null&&Ho(m)&&u===!0,b=k.encodeLocation?k.encodeLocation(m).pathname:m.pathname,x=g.pathname,w=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(x=x.toLowerCase(),w=w?w.toLowerCase():null,b=b.toLowerCase()),w&&y&&(w=q(w,y)||w);const _=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let E=x===b||!o&&x.startsWith(b)&&x.charAt(_)==="/",A=w!=null&&(w===b||!o&&w.startsWith(b)&&w.charAt(b.length)==="/"),M={isActive:E,isPending:A,isTransitioning:h},N=E?t:void 0,D;typeof n=="function"?D=n(M):D=[n,E?"active":null,A?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let B=typeof s=="function"?s(M):s;return l.createElement(pe,{...f,"aria-current":N,className:D,ref:p,style:B,to:i,viewTransition:u},typeof d=="function"?d(M):d)},"NavLinkWithRef"));cr.displayName="NavLink";var Po=l.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:s,method:i=ke,action:u,onSubmit:d,relative:f,preventScrollReset:p,viewTransition:m,defaultShouldRevalidate:g,...v},k)=>{let{useTransitions:y}=l.useContext(L),h=Bo(),b=Fo(u,{relative:f}),x=i.toLowerCase()==="get"?"get":"post",w=typeof u=="string"&&We.test(u),_=a(E=>{if(d&&d(E),E.defaultPrevented)return;E.preventDefault();let A=E.nativeEvent.submitter,M=A?.getAttribute("formmethod")||i,N=a(()=>h(A||E.currentTarget,{fetcherKey:t,method:M,navigate:r,replace:o,state:s,relative:f,preventScrollReset:p,viewTransition:m,defaultShouldRevalidate:g}),"doSubmit");y&&r!==!1?l.startTransition(()=>N()):N()},"submitHandler");return l.createElement("form",{ref:k,method:x,action:b,onSubmit:n?d:_,...v,"data-discover":!w&&e==="render"?"true":void 0})});Po.displayName="Form";function To({getKey:e,storageKey:t,...r}){let n=l.useContext(Ae),{basename:o}=l.useContext(L),s=T(),i=ar();zo({getKey:e,storageKey:t});let u=l.useMemo(()=>{if(!n||!e)return null;let f=ze(s,i,o,e);return f!==s.key?f:null},[]);if(!n||n.isSpaMode)return null;let d=((f,p)=>{if(!window.history.state||!window.history.state.key){let m=Math.random().toString(32).slice(2);window.history.replaceState({key:m},"")}try{let m=JSON.parse(sessionStorage.getItem(f)||"{}")[p||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch{sessionStorage.removeItem(f)}}).toString();return r.nonce==null&&n?.nonce&&(r.nonce=n.nonce),l.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${d})(${gt(JSON.stringify(t||Fe))}, ${gt(JSON.stringify(u))})`}})}a(To,"ScrollRestoration");To.displayName="ScrollRestoration";function dr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}a(dr,"getDataRouterConsoleError2");function Xe(e){let t=l.useContext(re);return $(t,dr(e)),t}a(Xe,"useDataRouterContext3");function Uo(e){let t=l.useContext(fe);return $(t,dr(e)),t}a(Uo,"useDataRouterState2");function Oo(e,{target:t,replace:r,mask:n,state:o,preventScrollReset:s,relative:i,viewTransition:u,defaultShouldRevalidate:d,useTransitions:f}={}){let p=Ee(),m=T(),g=me(e,{relative:i});return l.useCallback(v=>{if(oo(v,t)){v.preventDefault();let k=r!==void 0?r:K(m)===K(g),y=a(()=>p(e,{replace:k,mask:n,state:o,preventScrollReset:s,relative:i,viewTransition:u,defaultShouldRevalidate:d}),"doNavigate");f?l.startTransition(()=>y()):y()}},[m,p,g,r,n,o,t,e,s,i,u,d,f])}a(Oo,"useLinkClickHandler");function Ji(e){P(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=l.useRef(Be(e)),r=l.useRef(!1),n=T(),o=l.useMemo(()=>so(n.search,r.current?null:t.current),[n.search]),s=Ee();return[o,l.useCallback((i,u)=>{const d=Be(typeof i=="function"?i(new URLSearchParams(o)):i);r.current=!0,s("?"+d,u)},[s,o])]}a(Ji,"useSearchParams");var No=0,jo=a(()=>`__${String(++No)}__`,"getUniqueFetcherId");function Bo(){let{router:e}=Xe("useSubmit"),{basename:t}=l.useContext(L),r=Ka(),n=e.fetch,o=e.navigate;return l.useCallback(async(s,i={})=>{let{action:u,method:d,encType:f,formData:p,body:m}=uo(s,t);if(i.navigate===!1){let g=i.fetcherKey||jo();await n(g,r,i.action||u,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:m,formMethod:i.method||d,formEncType:i.encType||f,flushSync:i.flushSync})}else await o(i.action||u,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:m,formMethod:i.method||d,formEncType:i.encType||f,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,o,t,r])}a(Bo,"useSubmit");function Fo(e,{relative:t}={}){let{basename:r}=l.useContext(L),n=l.useContext(O);$(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),s={...me(e||".",{relative:t})},i=T();if(e==null){s.search=i.search;let u=new URLSearchParams(s.search),d=u.getAll("index");if(d.some(f=>f==="")){u.delete("index"),d.filter(p=>p).forEach(p=>u.append("index",p));let f=u.toString();s.search=f?`?${f}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:j([r,s.pathname])),K(s)}a(Fo,"useFormAction");var Fe="react-router-scroll-positions",ye={};function ze(e,t,r,n){let o=null;return n&&(r!=="/"?o=n({...e,pathname:q(e.pathname,r)||e.pathname},t):o=n(e,t)),o==null&&(o=e.key),o}a(ze,"getScrollRestorationKey");function zo({getKey:e,storageKey:t}={}){let{router:r}=Xe("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:o}=Uo("useScrollRestoration"),{basename:s}=l.useContext(L),i=T(),u=ar(),d=Qa();l.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),qo(l.useCallback(()=>{if(d.state==="idle"){let f=ze(i,u,s,e);ye[f]=window.scrollY}try{sessionStorage.setItem(t||Fe,JSON.stringify(ye))}catch(f){P(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${f}).`)}window.history.scrollRestoration="auto"},[d.state,e,s,i,u,t])),typeof document<"u"&&(l.useLayoutEffect(()=>{try{let f=sessionStorage.getItem(t||Fe);f&&(ye=JSON.parse(f))}catch{}},[t]),l.useLayoutEffect(()=>{let f=r?.enableScrollRestoration(ye,()=>window.scrollY,e?(p,m)=>ze(p,m,s,e):void 0);return()=>f&&f()},[r,s,e]),l.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let f=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(f){f.scrollIntoView();return}}}catch{P(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}o!==!0&&window.scrollTo(0,0)}},[i,n,o]))}a(zo,"useScrollRestoration");function Gi(e,t){let{capture:r}=t||{};l.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("beforeunload",e,n),()=>{window.removeEventListener("beforeunload",e,n)}},[e,r])}a(Gi,"useBeforeUnload");function qo(e,t){let{capture:r}=t||{};l.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}a(qo,"usePageHide");function Ho(e,{relative:t}={}){let r=l.useContext(Zt);$(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Xe("useViewTransitionState"),o=me(e,{relative:t});if(!r.isTransitioning)return!1;let s=q(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=q(r.nextLocation.pathname,n)||r.nextLocation.pathname;return xe(o.pathname,i)!=null||xe(o.pathname,s)!=null}a(Ho,"useViewTransitionState");var kt=60,qe=3600,Ie=24*qe,bt=7*Ie,xt=30*Ie;function Wo(e){const t=Date.now(),r=new Date(e).getTime(),n=Math.round((t-r)/1e3);return n<kt?"just now":n<qe?`${Math.floor(n/kt)}m ago`:n<Ie?`${Math.floor(n/qe)}h ago`:n<bt?`${Math.floor(n/Ie)}d ago`:n<xt?`${Math.floor(n/bt)}w ago`:`${Math.floor(n/xt)}mo ago`}a(Wo,"timeAgo");var Vo=[{label:"My work",views:[{key:"mine",label:"Mine",surface:"inbox",inboxTab:"mine",hint:"Assigned to you or waiting on you"},{key:"unread",label:"Unread",surface:"inbox",inboxTab:"unread",hint:"Tasks you touched with new activity"},{key:"blocked",label:"Blocked",surface:"inbox",inboxTab:"blocked",hint:"Blocked tasks, grouped by blocker"},{key:"recent",label:"Recent",surface:"inbox",inboxTab:"recent",hint:"Everything you touched lately"},{key:"everything",label:"Everything",surface:"inbox",inboxTab:"all",hint:"Tasks, approvals, failed runs and join requests"}]},{label:"Organization",views:[{key:"all",label:"All tasks",surface:"issues",statuses:[],hint:"Every task in the organization"},{key:"active",label:"Active",surface:"issues",statuses:["todo","in_progress","in_review","blocked"],hint:"Open tasks, running or not"},{key:"backlog",label:"Backlog",surface:"issues",statuses:["backlog"],hint:"Not started yet"},{key:"done",label:"Done",surface:"issues",statuses:["done","cancelled"],hint:"Completed and cancelled"}]}],fr=new Map(Vo.flatMap(e=>e.views.map(t=>[t.key,t]))),mr="mine",Ko="view",Qo="paperclip:tasks:last-view";function Jo(e){return typeof e=="string"&&fr.has(e)}a(Jo,"isTaskViewKey");function pr(e){return fr.get(e)}a(pr,"taskView");function et(e){return Jo(e)?e:null}a(et,"normalizeTaskViewKey");var wt={mine:"mine",unread:"unread",blocked:"blocked",recent:"recent",all:"everything"};function Yi(e){return e&&e in wt?wt[e]:mr}a(Yi,"taskViewForInboxTab");function Zi(){try{return et(window.localStorage.getItem("paperclip:tasks:last-view"))??"mine"}catch{return mr}}a(Zi,"loadLastTaskView");function Xi(e){try{window.localStorage.setItem(Qo,e)}catch{}}a(Xi,"saveLastTaskView");var el=["assignee","workspace","participantAgentId","q"];function tl(e,t,r){const n=et(e);return t&&(!n||pr(n).surface==="inbox")?"all":n??r}a(tl,"resolveInitialTaskView");var hr="from",gr="fromHref",yr="paperclip:issue-detail-breadcrumb:";function vr(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.label=="string"&&typeof t.href=="string"}a(vr,"isIssueDetailBreadcrumb");function kr(e){return e==="issues"||e==="inbox"}a(kr,"isIssueDetailSource");function br(e){if(typeof e!="object"||e===null)return!1;const t=e,r=t.originKind===void 0||typeof t.originKind=="string",n=t.originId===void 0||t.originId===null||typeof t.originId=="string",o=t.blockerAttention===void 0||typeof t.blockerAttention=="object"&&t.blockerAttention!==null;return typeof t.id=="string"&&(t.identifier===null||typeof t.identifier=="string")&&typeof t.title=="string"&&typeof t.status=="string"&&o&&typeof t.priority=="string"&&(t.projectId===null||typeof t.projectId=="string")&&(t.projectName===null||typeof t.projectName=="string")&&r&&n}a(br,"isIssueDetailHeaderSeed");function Go(e){return{id:e.id,identifier:e.identifier??null,title:e.title,status:e.status,blockerAttention:e.blockerAttention,priority:e.priority,projectId:e.projectId??null,projectName:e.project?.name??null,originKind:e.originKind,originId:e.originId??null}}a(Go,"createIssueDetailHeaderSeed");function xr(e,t){const r=Go(t);return typeof e!="object"||e===null?{issueDetailHeaderSeed:r}:{...e,issueDetailHeaderSeed:r}}a(xr,"withIssueDetailHeaderSeed");function Yo(e){if(typeof e!="object"||e===null)return null;const t=e.issueDetailHeaderSeed;return br(t)?t:null}a(Yo,"readIssueDetailHeaderSeed");function Zo(e){if(!e)return null;const t=new URLSearchParams(e).get(hr);return kr(t)?t:null}a(Zo,"readIssueDetailSourceFromSearch");function Xo(e){if(!e)return null;const t=new URLSearchParams(e).get(gr);return t&&t.startsWith("/")?t:null}a(Xo,"readIssueDetailBreadcrumbHrefFromSearch");function es(e){const t=e.slice(e.indexOf("?")+1);if(!e.includes("?"))return!1;const r=new URLSearchParams(t).get(Ko),n=et(r);return n!==null&&pr(n).surface==="inbox"}a(es,"isInboxBackedTaskViewHref");function wr(e,t){return kr(e?.issueDetailSource)?e.issueDetailSource:t?t.href.includes("/inbox")||es(t.href)||t.label==="Inbox"?"inbox":t.label==="Tasks"||t.href.includes("/issues")?"issues":null:null}a(wr,"inferIssueDetailSource");function It(e){return e==="inbox"?{label:"Inbox",href:"/inbox"}:{label:"Tasks",href:"/issues"}}a(It,"breadcrumbForSource");function rl(e,t,r){return{issueDetailBreadcrumb:{label:e,href:t},issueDetailSource:r}}a(rl,"createIssueDetailLocationState");function nl(e){return typeof e!="object"||e===null?{issueDetailInboxQuickArchiveArmed:!0}:{...e,issueDetailInboxQuickArchiveArmed:!0}}a(nl,"armIssueDetailInboxQuickArchive");function ts(e){if(typeof window>"u"||!window.sessionStorage)return null;const t=window.sessionStorage.getItem(`${yr}${e}`);if(!t)return null;try{const r=JSON.parse(t),n=vr(r.issueDetailBreadcrumb)?r.issueDetailBreadcrumb:null,o=wr(r,n);if(!n||!o)return null;const s=br(r.issueDetailHeaderSeed)?r.issueDetailHeaderSeed:void 0;return{issueDetailBreadcrumb:n,issueDetailSource:o,issueDetailInboxQuickArchiveArmed:r.issueDetailInboxQuickArchiveArmed===!0,issueDetailHeaderSeed:s}}catch{return null}}a(ts,"readStoredIssueDetailLocationState");function Ir(e,t){if(typeof e=="object"&&e!==null){const o=e.issueDetailBreadcrumb;if(vr(o)){const s=wr(e,o);if(!s)return null;const i=Yo(e)??void 0;return{issueDetailBreadcrumb:o,issueDetailSource:s,issueDetailInboxQuickArchiveArmed:e.issueDetailInboxQuickArchiveArmed===!0,issueDetailHeaderSeed:i}}}const r=Zo(t),n=Xo(t);return r?{issueDetailBreadcrumb:n?{...It(r),href:n}:It(r),issueDetailSource:r,issueDetailInboxQuickArchiveArmed:!1}:null}a(Ir,"normalizeIssueDetailLocationState");function al(e,t,r){if(typeof window>"u"||!window.sessionStorage)return;const n=Ir(t,r);n&&window.sessionStorage.setItem(`${yr}${e}`,JSON.stringify(n))}a(al,"rememberIssueDetailLocationState");function rs(e){return`/issues/${e}`}a(rs,"createIssueDetailPath");function ol(e){if(!e)return!1;const t=new URLSearchParams(e);return t.has(hr)||t.has(gr)}a(ol,"hasLegacyIssueDetailQuery");function ns(e,t,r){const n=Ir(t,r);return n||(e?ts(e):null)}a(ns,"readIssueDetailLocationState");function sl(e,t,r){return ns(e,t,r)?.issueDetailBreadcrumb??null}a(sl,"readIssueDetailBreadcrumb");var Rt=class extends Error{static{a(this,"CommentSubmissionUnknownError")}constructor(){super("We couldn’t confirm whether this comment was saved. Review the conversation before starting another draft."),this.name="CommentSubmissionUnknownError"}};function St(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e,r=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;return typeof t.id=="string"&&r.test(t.id)&&typeof t.issueId=="string"&&r.test(t.issueId)&&typeof t.body=="string"}a(St,"hasCommentReceipt");async function Et(e,t){try{const r=await e;if(!t(r))throw new Rt;return r}catch(r){throw r instanceof Ot&&r.status<500?r:new Rt}}a(Et,"confirmedCommentResponse");function Ct(e){const t=new URLSearchParams;return e?.attention&&t.set("attention",e.attention),e?.status&&t.set("status",e.status),e?.priority&&t.set("priority",e.priority),e?.projectId&&t.set("projectId",e.projectId),e?.parentId&&t.set("parentId",e.parentId),e?.assigneeAgentId&&t.set("assigneeAgentId",e.assigneeAgentId),e?.participantAgentId&&t.set("participantAgentId",e.participantAgentId),e?.assigneeUserId&&t.set("assigneeUserId",e.assigneeUserId),e?.touchedByUserId&&t.set("touchedByUserId",e.touchedByUserId),e?.inboxArchivedByUserId&&t.set("inboxArchivedByUserId",e.inboxArchivedByUserId),e?.unreadForUserId&&t.set("unreadForUserId",e.unreadForUserId),e?.labelId&&t.set("labelId",e.labelId),e?.createdByAgentId&&t.set("createdByAgentId",e.createdByAgentId),e?.createdByUserId&&t.set("createdByUserId",e.createdByUserId),e?.updatedSince&&t.set("updatedSince",e.updatedSince),e?.workspaceId&&t.set("workspaceId",e.workspaceId),e?.executionWorkspaceId&&t.set("executionWorkspaceId",e.executionWorkspaceId),e?.originKind&&t.set("originKind",e.originKind),e?.originKindPrefix&&t.set("originKindPrefix",e.originKindPrefix),e?.originId&&t.set("originId",e.originId),e?.descendantOf&&t.set("descendantOf",e.descendantOf),e?.createdFromIssueId&&t.set("createdFromIssueId",e.createdFromIssueId),e?.includeRoutineExecutions&&t.set("includeRoutineExecutions","true"),e?.includeBlockedBy&&t.set("includeBlockedBy","true"),e?.includeBlockedInboxAttention&&t.set("includeBlockedInboxAttention","true"),e?.includeLiveDescendantSummary&&t.set("includeLiveDescendantSummary","true"),e?.hasPlanDocument!==void 0&&t.set("hasPlanDocument",e.hasPlanDocument?"true":"false"),e?.q&&t.set("q",e.q),e?.limit&&t.set("limit",String(e.limit)),e?.offset!==void 0&&t.set("offset",String(e.offset)),e?.sortField&&t.set("sortField",e.sortField),e?.sortDir&&t.set("sortDir",e.sortDir),e?.afterId&&t.set("afterId",e.afterId),t}a(Ct,"issueListSearchParams");var Z={listAll:a(async(e,t,r)=>{const o=new Map;let s;for(;;){const i=await Z.list(e,{...t,limit:500,sortField:"id",sortDir:"asc",afterId:s},r);for(const u of i)o.set(u.id,u);if(i.length<500)return[...o.values()];s=i[i.length-1].id}},"listAll"),list:a((e,t,r)=>{const n=Ct(t).toString(),o=`/companies/${e}/issues${n?`?${n}`:""}`;return r?c.get(o,r):c.get(o)},"list"),listCompact:a((e,t,r)=>{const n=Ct(t);n.set("view","compact");const o=`/companies/${e}/issues?${n.toString()}`;return r?c.get(o,r):c.get(o)},"listCompact"),count:a((e,t)=>{const r=new URLSearchParams;return r.set("attention",t.attention),t.status&&r.set("status",t.status),t.assigneeAgentId&&r.set("assigneeAgentId",t.assigneeAgentId),t.assigneeUserId&&r.set("assigneeUserId",t.assigneeUserId),t.projectId&&r.set("projectId",t.projectId),t.labelId&&r.set("labelId",t.labelId),t.q&&r.set("q",t.q),c.get(`/companies/${e}/issues/count?${r.toString()}`)},"count"),listLabels:a(e=>c.get(`/companies/${e}/labels`),"listLabels"),createLabel:a((e,t)=>c.post(`/companies/${e}/labels`,t),"createLabel"),deleteLabel:a(e=>c.delete(`/labels/${e}`),"deleteLabel"),get:a((e,t)=>t?c.get(`/issues/${e}`,t):c.get(`/issues/${e}`),"get"),refs:a((e,t)=>c.get(`/companies/${e}/issues/refs?ids=${encodeURIComponent(t.join(","))}`),"refs"),getRunnerGoal:a((e,t)=>{const r=t?`?agentId=${encodeURIComponent(t)}`:"";return c.get(`/issues/${e}/runner-goal${r}`)},"getRunnerGoal"),actOnRunnerGoal:a((e,t)=>c.post(`/issues/${e}/runner-goal/actions`,t),"actOnRunnerGoal"),getModelOverride:a(e=>c.get(`/issues/${e}/model-override`),"getModelOverride"),setModelOverride:a((e,t)=>c.put(`/issues/${e}/model-override`,t),"setModelOverride"),getWatchdog:a(e=>c.get(`/issues/${e}/watchdog`),"getWatchdog"),upsertWatchdog:a((e,t)=>c.put(`/issues/${e}/watchdog`,t),"upsertWatchdog"),deleteWatchdog:a(e=>c.delete(`/issues/${e}/watchdog`),"deleteWatchdog"),markRead:a(e=>c.post(`/issues/${e}/read`,{}),"markRead"),markUnread:a(e=>c.delete(`/issues/${e}/read`),"markUnread"),archiveFromInbox:a(e=>c.post(`/issues/${e}/inbox-archive`,{}),"archiveFromInbox"),unarchiveFromInbox:a(e=>c.delete(`/issues/${e}/inbox-archive`),"unarchiveFromInbox"),setTitle:a((e,t)=>c.put(`/issues/${e}/title`,t),"setTitle"),create:a((e,t)=>c.post(`/companies/${e}/issues`,t),"create"),update:a((e,t)=>{const r=c.patch(`/issues/${e}`,t);return typeof t.comment=="string"?Et(r,n=>St(n?.comment)):r},"update"),decideStalledReview:a((e,t)=>c.post(`/issues/${e}/stalled-review-decision`,t),"decideStalledReview"),retryWorkspaceExport:a((e,t)=>c.post(`/issues/${e}/recovery-actions/retry-workspace-export`,t),"retryWorkspaceExport"),resolveRecoveryAction:a((e,t)=>c.post(`/issues/${e}/recovery-actions/resolve`,t),"resolveRecoveryAction"),previewTreeControl:a((e,t)=>c.post(`/issues/${e}/tree-control/preview`,t),"previewTreeControl"),createTreeHold:a((e,t)=>c.post(`/issues/${e}/tree-holds`,t),"createTreeHold"),getTreeHold:a((e,t)=>c.get(`/issues/${e}/tree-holds/${t}`),"getTreeHold"),listTreeHolds:a((e,t)=>{const r=new URLSearchParams;t?.status&&r.set("status",t.status),t?.mode&&r.set("mode",t.mode),t?.includeMembers&&r.set("includeMembers","true");const n=r.toString();return c.get(`/issues/${e}/tree-holds${n?`?${n}`:""}`)},"listTreeHolds"),getTreeControlState:a(e=>c.get(`/issues/${e}/tree-control/state`),"getTreeControlState"),releaseTreeHold:a((e,t,r)=>c.post(`/issues/${e}/tree-holds/${t}/release`,r),"releaseTreeHold"),checkMonitorNow:a(e=>c.post(`/issues/${e}/monitor/check-now`,{}),"checkMonitorNow"),retryScheduledRetryNow:a(e=>c.post(`/issues/${e}/scheduled-retry/retry-now`,{}),"retryScheduledRetryNow"),remove:a(e=>c.delete(`/issues/${e}`),"remove"),checkout:a((e,t)=>c.post(`/issues/${e}/checkout`,{agentId:t,expectedStatuses:["todo","backlog","blocked","in_review"]}),"checkout"),release:a(e=>c.post(`/issues/${e}/release`,{}),"release"),listComments:a((e,t)=>{const r=new URLSearchParams;t?.after&&r.set("after",t.after),t?.order&&r.set("order",t.order),t?.limit&&r.set("limit",String(t.limit));const n=r.toString();return c.get(`/issues/${e}/comments${n?`?${n}`:""}`)},"listComments"),getQueuedComments:a(e=>c.get(`/issues/${e}/queued-comments`),"getQueuedComments"),editQueuedComment:a((e,t,r)=>c.patch(`/issues/${e}/queued-comments/${t}`,r),"editQueuedComment"),reorderQueuedComments:a((e,t)=>c.put(`/issues/${e}/queued-comments/order`,t),"reorderQueuedComments"),interruptQueuedComments:a((e,t)=>c.post(`/issues/${e}/queued-comments/interrupt`,t),"interruptQueuedComments"),interruptLatestQueuedComments:a(async(e,t)=>{const r=await Z.getQueuedComments(e);if(!r.queueId||r.targetRunId&&r.targetRunId!==t)throw new Error("The queued messages changed. Refresh and try again.");return Z.interruptQueuedComments(e,{queueId:r.queueId,revision:r.revision,targetRunId:r.targetRunId})},"interruptLatestQueuedComments"),steerQueuedComment:a((e,t,r)=>c.post(`/issues/${e}/queued-comments/${t}/steer`,r),"steerQueuedComment"),discardQueuedComment:a((e,t,r)=>c.delete(`/issues/${e}/queued-comments/${t}`,r),"discardQueuedComment"),listInteractions:a(e=>c.get(`/issues/${e}/interactions`),"listInteractions"),listAcceptedPlanDecompositions:a(e=>c.get(`/issues/${e}/accepted-plan-decompositions`),"listAcceptedPlanDecompositions"),createInteraction:a((e,t)=>c.post(`/issues/${e}/interactions`,t),"createInteraction"),acceptInteraction:a((e,t,r)=>{const{note:n,...o}=r??{};return c.post(`/issues/${e}/interactions/${t}/accept`,n?.trim()?{...o,note:n}:o)},"acceptInteraction"),rejectInteraction:a((e,t,r,n)=>c.post(`/issues/${e}/interactions/${t}/reject`,{...r?{reason:r}:{},...n?.trim()?{note:n}:{}}),"rejectInteraction"),cancelInteraction:a((e,t,r)=>c.post(`/issues/${e}/interactions/${t}/cancel`,r?{reason:r}:{}),"cancelInteraction"),skipInteraction:a((e,t,r)=>c.post(`/issues/${e}/interactions/${t}/skip`,r?{reason:r}:{}),"skipInteraction"),respondToInteraction:a((e,t,r)=>c.post(`/issues/${e}/interactions/${t}/respond`,r),"respondToInteraction"),submitInteractionVerdicts:a((e,t,r)=>c.post(`/issues/${e}/interactions/${t}/verdicts`,{verdicts:r}),"submitInteractionVerdicts"),getComment:a((e,t)=>c.get(`/issues/${e}/comments/${t}`),"getComment"),listFeedbackVotes:a(e=>c.get(`/issues/${e}/feedback-votes`),"listFeedbackVotes"),getCostSummary:a((e,t={})=>{const r=t.excludeRoot?"?excludeRoot=true":"";return c.get(`/issues/${e}/cost-summary${r}`)},"getCostSummary"),listFeedbackTraces:a((e,t)=>{const r=new URLSearchParams;for(const[o,s]of Object.entries(t??{}))s!==void 0&&r.set(o,String(s));const n=r.toString();return c.get(`/issues/${e}/feedback-traces${n?`?${n}`:""}`)},"listFeedbackTraces"),upsertFeedbackVote:a((e,t)=>c.post(`/issues/${e}/feedback-votes`,t),"upsertFeedbackVote"),addComment:a((e,t,r,n,o,s,i)=>Et(c.post(`/issues/${e}/comments`,{body:t,...s?{clientRequestId:s}:{},...r===void 0?{}:{reopen:r},...n===void 0?{}:{interrupt:n},...o?.length?{attachmentIds:o}:{},...i===void 0?{}:{deliver:i}}),St),"addComment"),cancelComment:a((e,t)=>c.delete(`/issues/${e}/comments/${t}?mode=cancel`),"cancelComment"),deleteComment:a((e,t)=>c.delete(`/issues/${e}/comments/${t}`),"deleteComment"),listDocuments:a((e,t)=>c.get(`/issues/${e}/documents${t?.includeSystem?"?includeSystem=true":""}`),"listDocuments"),getDocument:a((e,t)=>c.get(`/issues/${e}/documents/${encodeURIComponent(t)}`),"getDocument"),getDocumentPdf:a((e,t)=>c.getBlob(`/issues/${e}/documents/${encodeURIComponent(t)}/pdf`),"getDocumentPdf"),upsertDocument:a((e,t,r)=>c.put(`/issues/${e}/documents/${encodeURIComponent(t)}`,r),"upsertDocument"),lockDocument:a((e,t)=>c.post(`/issues/${e}/documents/${encodeURIComponent(t)}/lock`,{}),"lockDocument"),unlockDocument:a((e,t)=>c.post(`/issues/${e}/documents/${encodeURIComponent(t)}/unlock`,{}),"unlockDocument"),listDocumentRevisions:a((e,t)=>c.get(`/issues/${e}/documents/${encodeURIComponent(t)}/revisions`),"listDocumentRevisions"),restoreDocumentRevision:a((e,t,r)=>c.post(`/issues/${e}/documents/${encodeURIComponent(t)}/revisions/${r}/restore`,{}),"restoreDocumentRevision"),deleteDocument:a((e,t)=>c.delete(`/issues/${e}/documents/${encodeURIComponent(t)}`),"deleteDocument"),listAttachments:a(e=>c.get(`/issues/${e}/attachments`),"listAttachments"),uploadAttachment:a((e,t,r,n)=>{const o=Nn(r);if(o)return Promise.reject(o);const s=new FormData;return s.append("file",r),n&&s.append("issueCommentId",n),c.postForm(`/companies/${e}/issues/${t}/attachments`,s)},"uploadAttachment"),deleteAttachment:a(e=>c.delete(`/attachments/${e}`),"deleteAttachment"),privacyConstraints:a(e=>c.get(`/issues/${e}/privacy-constraints`),"privacyConstraints"),listAccessGrants:a((e,t)=>t?c.get(`/issues/${e}/access-grants`,t):c.get(`/issues/${e}/access-grants`),"listAccessGrants"),createAccessGrant:a((e,t)=>c.post(`/issues/${e}/access-grants`,t),"createAccessGrant"),revokeAccessGrant:a((e,t)=>c.post(`/issues/${e}/access-grants/${t}/revoke`,{}),"revokeAccessGrant"),setVisibility:a((e,t)=>c.patch(`/issues/${e}`,{visibility:t}),"setVisibility"),listApprovals:a(e=>c.get(`/issues/${e}/approvals`),"listApprovals"),linkApproval:a((e,t)=>c.post(`/issues/${e}/approvals`,{approvalId:t}),"linkApproval"),unlinkApproval:a((e,t)=>c.delete(`/issues/${e}/approvals/${t}`),"unlinkApproval"),listWorkProducts:a((e,t)=>{const r=`/issues/${e}/work-products${t?.refreshPullRequests?"?refreshPullRequests=true":""}`;return t?.fresh&&Mn(r),c.get(r,{signal:t?.signal})},"listWorkProducts"),ensureWorkProductReviewDocument:a((e,t)=>c.post(`/issues/${e}/work-products/${t}/review-document`,{}),"ensureWorkProductReviewDocument"),createWorkProduct:a((e,t)=>c.post(`/issues/${e}/work-products`,t),"createWorkProduct"),updateWorkProduct:a((e,t)=>c.patch(`/work-products/${e}`,t),"updateWorkProduct"),deleteWorkProduct:a(e=>c.delete(`/work-products/${e}`),"deleteWorkProduct")};function ee(e){return new Date(e).getTime()}a(ee,"toTimestamp");function as(){const e=globalThis.crypto?.randomUUID?.();return e?`optimistic-${e}`:`optimistic-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}a(as,"createOptimisticCommentId");function tt(e){return[...e].sort((t,r)=>{const n=ee(t.createdAt)-ee(r.createdAt);return n!==0?n:t.id.localeCompare(r.id)})}a(tt,"sortIssueComments");function $t(e){return tt(e).reverse()}a($t,"sortIssueCommentsDesc");function il(e){const t=new Date,r=as();return{id:r,clientId:r,companyId:e.companyId,issueId:e.issueId,authorType:"user",authorAgentId:null,authorUserId:e.authorUserId,body:e.body,presentation:null,metadata:null,clientStatus:e.clientStatus??"pending",queueTargetRunId:e.queueTargetRunId??null,createdAt:t,updatedAt:t}}a(il,"createOptimisticIssueComment");function ll(e){return e.runId||e.interruptedRunId||e.comment.id&&(e.comment.id===e.activeRunWakeCommentId||e.comment.id===e.activeRunCommentId)||e.comment.authorAgentId&&e.activeRunAgentId&&e.comment.authorAgentId===e.activeRunAgentId?!1:e.comment.clientStatus==="queued"?!0:e.activeRunStartedAt?ee(e.comment.createdAt)>=ee(e.activeRunStartedAt):!1}a(ll,"isQueuedIssueComment");function ul(e,t){const r=t.queuedTargetRunId??null;return!r||!t.targetRunIsLive||t.runningRunId&&t.runningRunId!==r?e:{...e,clientStatus:"queued",queueState:"queued",queueTargetRunId:r}}a(ul,"applyLocalQueuedIssueCommentState");function cl(e,t){const r=e??[],n=[...r],o=new Set(n.map(i=>i.id)),s=new Set;for(const i of t){if(o.has(i.id))continue;const u=r.find(d=>!s.has(d.id)&&d.issueId===i.issueId&&d.authorType===i.authorType&&d.authorUserId===i.authorUserId&&d.body===i.body&&Math.abs(ee(d.createdAt)-ee(i.createdAt))<=6e4);if(u){s.add(u.id);const d={...u,clientId:i.clientId};n[n.findIndex(f=>f.id===u.id)]=d;continue}n.push(i)}return tt(n)}a(cl,"mergeIssueComments");function dl(e,t){const r=e.findIndex(n=>n.clientId===t);return r===-1?{comments:e,comment:null}:{comments:e.filter(n=>n.clientId!==t),comment:e[r]??null}}a(dl,"takeOptimisticIssueComment");function fl(e){return tt((e??[]).flatMap(t=>t))}a(fl,"flattenIssueCommentPages");function os(e,t){if(!(!e||e.length<t))return e[e.length-1]?.id}a(os,"getNextIssueCommentPageParam");function _t(e,t){if(!(!e||e.length<t))return e[e.length-1]?.id}a(_t,"getNextPageCursor");async function ml(e){const t=(e.pages??[]).map(i=>[...i]),r=e.pageParams?[...e.pageParams].slice(0,t.length):t.map(()=>null);for(;r.length<t.length;)r.push(null);if(e.pageSize<=0)return{pages:t,pageParams:r};let n=_t(t[t.length-1],e.pageSize);const o=Math.max(0,e.maxPages??Number.POSITIVE_INFINITY),s=new Set;for(;n&&!s.has(n)&&s.size<o;){s.add(n);const i=[...await e.fetchPage(n)];t.push(i),r.push(n),n=_t(i,e.pageSize)}return{pages:t,pageParams:r}}a(ml,"loadRemainingIssueCommentPages");function pl(e){return e.activeDetailTab!=="chat"||!e.hasOlderComments||e.initialPageLoading||e.olderPageLoading||e.loadedCommentCount===0?!1:e.loadedCommentCount<e.autoLoadLimit}a(pl,"shouldAutoloadOlderIssueComments");function hl(e,t){if(!e)return e;const r={...e};return t.reopen===!0&&(e.status==="done"||e.status==="cancelled"||e.status==="blocked")&&(r.status="todo"),t.reassignment&&(r.assigneeAgentId=t.reassignment.assigneeAgentId,r.assigneeUserId=t.reassignment.assigneeUserId),r}a(hl,"applyOptimisticIssueCommentUpdate");function ss(e,t){if(!e)return e;const r={...e,updatedAt:new Date},n=a(s=>Object.prototype.hasOwnProperty.call(t,s),"hasOwn"),o=a(s=>{n(s)&&(r[s]=t[s])},"assign");if(o("status"),o("priority"),o("assigneeAgentId"),o("assigneeUserId"),o("projectId"),o("parentId"),o("projectWorkspaceId"),o("executionWorkspaceId"),o("executionWorkspacePreference"),o("executionWorkspaceSettings"),o("hiddenAt"),n("labelIds")&&Array.isArray(t.labelIds)){const s=t.labelIds.filter(i=>typeof i=="string");r.labelIds=s,e.labels&&(r.labels=e.labels.filter(i=>s.includes(i.id)))}if(n("blockedByIssueIds")&&Array.isArray(t.blockedByIssueIds)&&e.blockedBy){const s=new Set(t.blockedByIssueIds.filter(i=>typeof i=="string"));r.blockedBy=e.blockedBy.filter(i=>s.has(i.id))}return n("projectId")&&(r.project=e.project?.id===r.projectId?e.project:null),n("parentId")&&(r.ancestors=void 0),n("executionWorkspaceId")&&(r.currentExecutionWorkspace=e.currentExecutionWorkspace?.id===r.executionWorkspaceId?e.currentExecutionWorkspace:null),r}a(ss,"applyOptimisticIssueFieldUpdate");function is(e,t){const r=t instanceof Set?t:new Set(t);return r.has(e.id)||!!e.identifier&&r.has(e.identifier)}a(is,"matchesIssueRef$1");function gl(e,t,r){if(!e)return e;let n=!1;const o=e.map(s=>is(s,t)?(n=!0,ss(s,r)??s):s);return n?o:e}a(gl,"applyOptimisticIssueFieldUpdateToCollection");function yl(e,t){if(!e||e.length===0)return[[t]];const r=e.map(n=>[...n]);for(let n=0;n<r.length;n+=1){const o=r[n].findIndex(s=>s.id===t.id);if(o!==-1)return r[n][o]=t,r[n]=$t(r[n]),r}return r[0]=$t([...r[0],t]),r}a(yl,"upsertIssueCommentInPages");function vl(e,t){return!e||e.length===0?[]:e.map(r=>r.filter(n=>n.id!==t)).filter(r=>r.length>0)}a(vl,"removeIssueCommentFromPages");var ls=["issues","detail"],Rr=6e4,us=3e4;function le(e){return typeof e=="string"&&e.length>0}a(le,"isNonEmptyString");function Sr(e,t){const r=new Set;return le(e)&&r.add(e),le(t?.id)&&r.add(t.id),le(t?.identifier)&&r.add(t.identifier),Array.from(r)}a(Sr,"collectIssueRefs");function cs(e,t){const r=t instanceof Set?t:new Set(t);return r.has(e.id)||!!e.identifier&&r.has(e.identifier)}a(cs,"matchesIssueRef");function Re(e){if(typeof e!="object"||e===null)return!1;const t=e;return le(t.id)&&le(t.companyId)&&typeof t.title=="string"&&typeof t.status=="string"&&typeof t.workMode=="string"&&typeof t.priority=="string"&&(t.projectId===null||typeof t.projectId=="string")&&(t.parentId===null||typeof t.parentId=="string")&&(t.identifier===null||typeof t.identifier=="string")&&(t.description===null||typeof t.description=="string")&&(t.assigneeAgentId===null||typeof t.assigneeAgentId=="string")&&(t.assigneeUserId===null||typeof t.assigneeUserId=="string")&&(t.executionRunId===null||typeof t.executionRunId=="string")&&(t.issueNumber===null||typeof t.issueNumber=="number")&&typeof t.requestDepth=="number"&&t.createdAt!=null&&t.updatedAt!=null}a(Re,"isCompleteIssueSnapshot");function At(e,t){return e?{...e,...t}:t}a(At,"mergeIssueSnapshots");function Er(e,t,r){const n=Sr(t,r);for(const o of n){const s=e.getQueryData(de.issues.detail(o));if(Re(s))return s}return e.getQueriesData({queryKey:ls}).map(([,o])=>o).find(o=>Re(o)&&cs(o,n))}a(Er,"getCachedIssueDetail");function Cr(e,t,r){if(!Re(t))return t;const n=Sr(r?.issueRef,t),o=At(Er(e,r?.issueRef,t),t);for(const s of n)e.setQueryData(de.issues.detail(s),i=>At(i,o));return o}a(Cr,"seedIssueDetailCache");async function $r(e,t,r){return Cr(e,r?await Z.get(t,r):await Z.get(t),{issueRef:t})}a($r,"fetchIssueDetail");function ds(e,t,r){return{queryKey:de.issues.detail(t),queryFn:a(({signal:n})=>$r(e,t,{signal:n}),"queryFn"),placeholderData:Er(e,t,r?.placeholderIssue??void 0)}}a(ds,"getIssueDetailQueryOptions");function fs(e,t,r){return Re(r?.issue)&&Cr(e,r.issue,{issueRef:t}),e.prefetchQuery({queryKey:de.issues.detail(t),queryFn:a(()=>$r(e,t),"queryFn"),staleTime:Rr})}a(fs,"prefetchIssueDetail");function ms(e,t){return e.prefetchInfiniteQuery({queryKey:de.issues.comments(t),queryFn:a(({pageParam:r})=>Z.listComments(t,{order:"desc",limit:50,...r?{after:r}:{}}),"queryFn"),initialPageParam:null,getNextPageParam:a(r=>os(r,50),"getNextPageParam"),staleTime:us,pages:1})}a(ms,"prefetchIssueComments");function ps(e,t,r){return Promise.all([fs(e,t,r),ms(e,r?.issue?.id??t)])}a(ps,"prefetchIssueDetailForNavigation");var S=Ut(Un(),1);function hs({...e}){return(0,S.jsx)(zn,{"data-slot":"popover",...e})}a(hs,"Popover");function gs({...e}){return(0,S.jsx)(Hn,{"data-slot":"popover-trigger",...e})}a(gs,"PopoverTrigger");function ys({className:e,align:t="center",sideOffset:r=4,disablePortal:n=!1,...o}){const s=(0,S.jsx)(qn,{"data-slot":"popover-content",align:t,sideOffset:r,className:Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o});return n?s:(0,S.jsx)(Vn,{children:s})}a(ys,"PopoverContent");function kl({...e}){return(0,S.jsx)(Wn,{"data-slot":"popover-anchor",...e})}a(kl,"PopoverAnchor");function bl({className:e,...t}){return(0,S.jsx)("div",{"data-slot":"popover-title",className:Q("font-medium",e),...t})}a(bl,"PopoverTitle");function xl({className:e,...t}){return(0,S.jsx)("p",{"data-slot":"popover-description",className:Q("text-muted-foreground",e),...t})}a(xl,"PopoverDescription");var _r={name:"atom",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]]};_r.node;var vs=I(_r),Ar={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};Ar.node;var ks=I(Ar),Dr={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};Dr.node;var bs=I(Dr),Lr={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};Lr.node;var xs=I(Lr),Mr={name:"briefcase",size:24,node:[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]};Mr.node;var ws=I(Mr),Pr={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};Pr.node;var Is=I(Pr),Tr={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};Tr.node;var Rs=I(Tr),Ur={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};Ur.node;var Or=I(Ur),Nr={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Nr.node;var Ss=I(Nr),jr={name:"circle-minus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],aliases:["minus-circle"]};jr.node;var Dt=I(jr),Br={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};Br.node;var Es=I(Br),Fr={name:"cog",size:24,node:[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]};Fr.node;var Cs=I(Fr),zr={name:"compass",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]};zr.node;var $s=I(zr),qr={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};qr.node;var _s=I(qr),Hr={name:"crown",size:24,node:[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]};Hr.node;var As=I(Hr),Wr={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};Wr.node;var Ds=I(Wr),Vr={name:"file-code",size:24,node:[["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"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};Vr.node;var Ls=I(Vr),Kr={name:"flame",size:24,node:[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]};Kr.node;var Ms=I(Kr),Qr={name:"folder",size:24,node:[["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"}]]};Qr.node;var Ps=I(Qr),Jr={name:"gem",size:24,node:[["path",{d:"M10.5 3 8 9l4 13 4-13-2.5-6",key:"b3dvk1"}],["path",{d:"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z",key:"7w4byz"}],["path",{d:"M2 9h20",key:"16fsjt"}]]};Jr.node;var Ts=I(Jr),Gr={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};Gr.node;var Us=I(Gr),Yr={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};Yr.node;var Os=I(Yr),Zr={name:"hammer",size:24,node:[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]]};Zr.node;var Ns=I(Zr),Xr={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};Xr.node;var js=I(Xr),en={name:"hexagon",size:24,node:[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]]};en.node;var Bs=I(en),tn={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};tn.node;var Fs=I(tn),rn={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};rn.node;var zs=I(rn),nn={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};nn.node;var qs=I(nn),an={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};an.node;var Hs=I(an),on={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};on.node;var Ws=I(on),sn={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};sn.node;var Vs=I(sn),ln={name:"puzzle",size:24,node:[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]};ln.node;var Ks=I(ln),un={name:"radar",size:24,node:[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]};un.node;var Qs=I(un),cn={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};cn.node;var Js=I(cn),dn={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};dn.node;var Gs=I(dn),fn={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};fn.node;var Ys=I(fn),mn={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};mn.node;var Zs=I(mn),pn={name:"target",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};pn.node;var Xs=I(pn),hn={name:"telescope",size:24,node:[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]]};hn.node;var ei=I(hn),gn={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};gn.node;var ti=I(gn),yn={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};yn.node;var ri=I(yn),vn={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};vn.node;var ni=I(vn),wl={backlog:"text-muted-foreground border-muted-foreground",todo:"text-amber-600 border-amber-600 dark:text-amber-400 dark:border-amber-400",in_progress:"text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",in_review:"text-violet-600 border-violet-600 dark:text-violet-400 dark:border-violet-400",done:"text-green-600 border-green-600 dark:text-green-400 dark:border-green-400",cancelled:"text-neutral-500 border-neutral-500",blocked:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400"},Il="text-muted-foreground border-muted-foreground",Rl={backlog:"text-muted-foreground",todo:"text-amber-600 dark:text-amber-400",in_progress:"text-blue-600 dark:text-blue-400",in_review:"text-violet-600 dark:text-violet-400",done:"text-green-600 dark:text-green-400",cancelled:"text-neutral-500",blocked:"text-red-600 dark:text-red-400"},Sl="text-muted-foreground",ve={gray:"bg-[#F5F3F0] text-[#52585D] border-[#A8AEB2] dark:bg-[#6e696024] dark:text-[#9A958A] dark:border-[#9e958a73]",blue:"bg-[#DBEAFE] text-[#1D4ED8] border-[#2563EB] dark:bg-[#2563eb2e] dark:text-[#2563EB] dark:border-[#2563eb73]",amber:"bg-[#FEF3C7] text-[#B45309] border-[#F59E0B] dark:bg-[#f59e0b24] dark:text-[#F59E0B] dark:border-[#f59e0b73]",green:"bg-[#DCFCE7] text-[#188A3C] border-[#22C55E] dark:bg-[#22c55e1f] dark:text-[#22C55E] dark:border-[#22c55e73]",violet:"bg-[#EDE9FE] text-[#5B21B6] border-[#7C3AED] dark:bg-[#7c3aed2e] dark:text-[#7C3AED] dark:border-[#7c3aed73]",red:"bg-[#FEE2E2] text-[#991B1B] border-[#DC2626] dark:bg-[#dc26262e] dark:text-[#DC2626] dark:border-[#dc262673]"},El={active:`border ${ve.green}`,running:`border ${ve.blue}`,scheduled_retry:"bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",paused:`border ${ve.amber}`,idle:`border ${ve.gray}`,archived:"bg-muted text-muted-foreground",planned:"bg-muted text-muted-foreground",achieved:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",completed:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",failed:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",timed_out:"bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",succeeded:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",ok:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",warning:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",error:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",info:"bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",terminated:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",pending:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",queued:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",pending_approval:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",revision_requested:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",approved:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",rejected:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",draft:"bg-muted text-muted-foreground",backlog:"bg-muted text-muted-foreground",todo:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",in_progress:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",in_review:"bg-violet-100 text-violet-700 dark:bg-violet-900/50 dark:text-violet-300",blocked:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",done:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",cancelled:"bg-muted text-muted-foreground",allowed:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",denied:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",block:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300","require-approval":"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",redacted:"bg-violet-100 text-violet-700 dark:bg-violet-900/50 dark:text-violet-300","rate-limit":"bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",deferred:"bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",hidden:"bg-muted text-muted-foreground",quarantined:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300","runtime-error":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",healthy:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",degraded:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",unchecked:"bg-muted text-muted-foreground"},Cl="bg-muted text-muted-foreground",$l="text-[#1D4ED8] dark:text-[#2563EB]",_l="bg-blue-500/10 border-blue-500/30 text-blue-600 dark:text-blue-400",Al={info:"border-[#2563EB]/40 bg-[#DBEAFE]/50 text-[#1D4ED8] dark:border-[#2563eb59] dark:bg-[#2563eb14] dark:text-[#93C5FD]",warning:"border-[#F59E0B]/50 bg-[#FEF3C7]/60 text-[#B45309] dark:border-[#f59e0b59] dark:bg-[#f59e0b12] dark:text-[#F59E0B]",danger:"border-destructive/40 bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300"},Dl={idle:"--status-agent-idle",active:"--status-agent-idle",running:"--status-agent-running",paused:"--status-agent-paused",error:"--status-agent-error"},Ll="--status-agent-idle",Ml={idle:"--status-task-backlog",backlog:"--status-task-backlog",todo:"--status-task-todo",in_progress:"--status-task-in_progress",in_review:"--status-task-in_review",done:"--status-task-done",blocked:"--status-task-blocked",cancelled:"--status-task-cancelled"},Pl="--status-task-backlog",ai={idle:"--status-task-icon-backlog",backlog:"--status-task-icon-backlog",todo:"--status-task-icon-todo",in_progress:"--status-task-icon-in_progress",in_review:"--status-task-icon-in_review",done:"--status-task-icon-done",blocked:"--status-task-icon-blocked",cancelled:"--status-task-icon-cancelled",in_queue:"--status-task-icon-in_queue"};var Tl={running:"bg-blue-400 animate-pulse",active:"bg-green-400",paused:"bg-yellow-400",idle:"bg-yellow-400",pending_approval:"bg-amber-400",error:"bg-red-400",archived:"bg-neutral-400"},Ul="bg-neutral-400",Ol={critical:"text-red-600 dark:text-red-400",high:"text-orange-600 dark:text-orange-400",medium:"text-yellow-600 dark:text-yellow-400",low:"text-blue-600 dark:text-blue-400"},Nl="text-yellow-600 dark:text-yellow-400",jl={unknown:"text-muted-foreground border-muted-foreground",open:"text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",waiting:"text-amber-600 border-amber-600 dark:text-amber-400 dark:border-amber-400",running:"text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",succeeded:"text-green-600 border-green-600 dark:text-green-400 dark:border-green-400",merged:"text-violet-600 border-violet-600 dark:text-violet-400 dark:border-violet-400",failed:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400",blocked:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400",closed:"text-neutral-500 border-neutral-500",archived:"text-neutral-500 border-neutral-500",auth_required:"text-amber-600 border-amber-600 dark:text-amber-400 dark:border-amber-400",unreachable:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400"},Bl="text-muted-foreground border-muted-foreground",Fl={unknown:"bg-muted text-muted-foreground",open:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",waiting:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",running:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",succeeded:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",failed:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",blocked:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",closed:"bg-muted text-muted-foreground",archived:"bg-muted text-muted-foreground",auth_required:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",unreachable:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300"},zl="bg-muted text-muted-foreground",ql={unknown:"",fresh:"",stale:"opacity-70 [border-style:dashed]",auth_required:"[border-style:dashed]",unreachable:"[border-style:dashed]"},oi={sm:14,md:16,lg:20},si=I("TaskProgressSpinner",[["circle",{cx:"12",cy:"12",r:"10",pathLength:"100",strokeDasharray:"80 20",key:"progress"}]]),ii={idle:it,backlog:Or,todo:it,in_progress:si,in_review:Ss,done:Rs,blocked:Dt,cancelled:ks,in_queue:Dt},li=Or;function ui({status:e,size:t="md",className:r,title:n}){const o=oi[t],s=ii[e]??li,i=ai[e]??"--status-task-icon-backlog",u=n?{role:"img","aria-label":n}:{"aria-hidden":!0};return(0,S.jsx)(s,{size:o,className:Q("inline-block shrink-0 align-middle",e==="in_progress"&&"motion-safe:animate-spin",r),style:{color:`var(${i})`},...u,children:n?(0,S.jsx)("title",{children:n}):null})}a(ui,"StatusGlyph");var Lt={folder:Ps,rocket:Js,code:Es,terminal:ti,database:Ds,globe:Os,package:Vs,boxes:Kn,box:bs,layers:Fs,briefcase:ws,compass:$s,target:Xs,flame:Ms,zap:ni,star:Zs,bug:Is,wrench:ri,hammer:Ns,lightbulb:zs,sparkles:Ys,shield:Gs,lock:qs,search:Qn,cog:Cs,brain:xs,cpu:_s,"git-branch":Us,"file-code":Ls,puzzle:Ks,gem:Ts,atom:vs,heart:js,mail:Hs,"message-square":Ws,crown:As,radar:Qs,telescope:ei,hexagon:Bs},ci="folder";function di(e){return e&&On.includes(e)?Lt[e]:Lt[ci]}a(di,"getProjectIcon");var fi={xs:{box:"h-4 w-4 rounded-sm",icon:"h-2.5 w-2.5"},sm:{box:"h-6 w-6 rounded-md",icon:"h-3.5 w-3.5"},md:{box:"h-7 w-7 rounded-lg",icon:"h-4 w-4"},lg:{box:"h-9 w-9 rounded-lg",icon:"h-5 w-5"}};function mi({color:e,icon:t,size:r="md",className:n}){const o=fi[r],s=!!e,i=di(t);return(0,S.jsx)("span",{"aria-hidden":!0,className:Q("inline-flex shrink-0 items-center justify-center",o.box,s?"text-white":"bg-muted text-muted-foreground",n),style:s?{backgroundColor:e??void 0}:void 0,children:(0,S.jsx)(i,{className:o.icon})})}a(mi,"ProjectTile");var ue=null,He=new Set;function kn(){for(const e of He)e()}a(kn,"emitQuicklookChange");function Mt(e){ue!==e&&(ue=e,kn())}a(Mt,"openQuicklookId");function Pt(e){ue===e&&(ue=null,kn())}a(Pt,"closeQuicklookId");function pi(e){return He.add(e),()=>{He.delete(e)}}a(pi,"subscribeQuicklook");function hi(e){return l.useSyncExternalStore(pi,()=>ue===e,()=>!1)}a(hi,"useIsQuicklookOpen");var gi=120,yi=13,vi="w-72 p-3";function ki(e="start"){return e==="start"?-13:e==="end"?yi:0}a(ki,"quicklookAlignOffset");function bi(e){if(!e)return null;const t=e.replace(/!\[[^\]]*]\([^)]+\)/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[#>*_`~-]+/g," ").replace(/\s+/g," ").trim();return t?t.length>180?`${t.slice(0,177).trimEnd()}...`:t:null}a(bi,"summarizeIssueDescription");function xi({className:e}){return(0,S.jsx)("span",{className:Q("text-xs",e),"aria-hidden":!0,children:"·"})}a(xi,"QuicklookSeparator");function wi(e){const t=e.replace(/_/g," ");return t.charAt(0).toUpperCase()+t.slice(1)}a(wi,"statusLabel");function Ii({issue:e,linkTo:t,linkState:r,compact:n=!1}){const o=(0,l.useMemo)(()=>bi(e.description),[e.description]),s=e.project?.name;return(0,S.jsxs)("div",{className:Q("space-y-2",n&&"space-y-1.5"),children:[(0,S.jsxs)("div",{className:"flex items-center gap-1",children:[(0,S.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[(0,S.jsx)(ui,{status:e.status,size:"md",title:wi(e.status)}),(0,S.jsx)("span",{className:"shrink-0 font-mono text-(length:--text-micro) text-muted-foreground",children:e.identifier??e.id.slice(0,8)}),s?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(xi,{className:"shrink-0 text-muted-foreground"}),(0,S.jsxs)("span",{className:"flex min-w-0 max-w-(--sz-12rem) flex-1 items-center gap-1 text-(length:--text-micro) text-muted-foreground",title:s,"data-testid":"quicklook-project",children:[(0,S.jsx)(mi,{size:"xs"}),(0,S.jsx)("span",{className:"truncate",children:s})]})]}):null]}),(0,S.jsx)("span",{className:"shrink-0 text-(length:--text-micro) text-muted-foreground",children:Wo(new Date(e.updatedAt))})]}),(0,S.jsx)(pe,{to:t,state:r??xr(null,e),className:"block text-sm font-medium leading-snug hover:underline line-clamp-2",children:e.title}),o?(0,S.jsx)("p",{className:"text-xs leading-5 text-muted-foreground [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:4] overflow-hidden",children:o}):null]})}a(Ii,"IssueQuicklookCard");var Ri=l.forwardRef(a(function({issuePathId:t,to:r,children:n,className:o,state:s,disableIssueQuicklook:i=!1,issuePrefetch:u=null,issueQuicklookSide:d="top",issueQuicklookAlign:f="start",onClick:p,onClickCapture:m,onMouseEnter:g,onFocus:v,onBlur:k,onTouchStart:y,...h},b){const x=Tn(),w=l.useMemo(()=>Symbol("issue-quicklook"),[]),_=hi(w),E=l.useRef(null),A=l.useRef(null),M=l.useRef(null),N=l.useCallback(C=>{A.current=C,typeof b=="function"?b(C):b&&(b.current=C)},[b]),D=l.useCallback(()=>{E.current&&(clearTimeout(E.current),E.current=null)},[]),B=l.useCallback(()=>{D(),Mt(w)},[D,w]),G=l.useCallback(()=>{D(),E.current=setTimeout(()=>{E.current=null,Mt(w)},gi)},[D,w]),U=l.useCallback(()=>{D(),Pt(w)},[D,w]);l.useEffect(()=>()=>{D(),Pt(w)},[D,w]),l.useEffect(()=>{if(!_)return;const C=12,at=a((V,se,Y)=>{if(!V)return!1;const W=V.getBoundingClientRect();return se>=W.left-C&&se<=W.right+C&&Y>=W.top-C&&Y<=W.bottom+C},"nearBox"),An=a((V,se)=>{const Y=A.current,W=M.current;if(Y?.matches(":hover")||W?.matches(":hover")||at(Y,V,se)||at(W,V,se))return!0;const Le=document.activeElement;return Y===Le||!!W&&!!Le&&W.contains(Le)},"stillEngaged"),ot=a(V=>{An(V.clientX,V.clientY)||U()},"onPointerMove");return document.addEventListener("pointermove",ot,{passive:!0}),()=>document.removeEventListener("pointermove",ot)},[_,U]);const H=u?xr(s,u):s,{data:F,isLoading:z}=Ln({...ds(x,t,{placeholderIssue:u??void 0}),enabled:_,staleTime:Rr}),_n=rs(t),oe=l.useCallback(()=>{ps(x,t,{issue:u})},[t,u,x]),nt=(0,S.jsx)(pe,{ref:N,to:r,state:H,className:o,onMouseEnter:a(C=>{oe(),g?.(C)},"onMouseEnter"),onFocus:a(C=>{oe(),B(),v?.(C)},"onFocus"),onBlur:a(C=>{setTimeout(()=>U(),0),k?.(C)},"onBlur"),onTouchStart:a(C=>{oe(),y?.(C)},"onTouchStart"),onClickCapture:a(C=>{oe(),m?.(C)},"onClickCapture"),onClick:a(C=>{U(),p?.(C)},"onClick"),...h,children:n});return i?nt:(0,S.jsxs)(hs,{open:_,onOpenChange:a(C=>C?B():U(),"onOpenChange"),children:[(0,S.jsx)(gs,{asChild:!0,onMouseEnter:a(()=>{oe(),G()},"onMouseEnter"),onMouseLeave:U,children:nt}),(0,S.jsx)(ys,{ref:M,"data-quicklook":!0,className:vi,side:d,align:f,alignOffset:ki(f),onMouseEnter:B,onMouseLeave:U,onOpenAutoFocus:a(C=>C.preventDefault(),"onOpenAutoFocus"),onCloseAutoFocus:a(C=>C.preventDefault(),"onCloseAutoFocus"),children:F?(0,S.jsx)(Ii,{issue:F,linkTo:_n,linkState:H,compact:!0}):(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)("div",{className:"h-4 w-24 rounded bg-accent/50"}),(0,S.jsx)("div",{className:"h-4 w-full rounded bg-accent/40"}),(0,S.jsx)("div",{className:"h-4 w-3/4 rounded bg-accent/30"}),z?null:(0,S.jsx)("p",{className:"text-xs text-muted-foreground",children:"Unable to load task preview."})]})})]})},"IssueLinkQuicklookImpl")),bn=new Set(["dashboard","companies","company","skills","teams-catalog","org","agents","chats","apps","projects","workspaces","terminal","execution-workspaces","issues","tasks","routines","goals","artifacts","tools","approvals","costs","usage","activity","audit","decisions","inbox","board-chat","artifacts","u","design-guide","search","settings","timeline"]),rt=new Set(["auth","invite","board-claim","cli-auth","mcp-connect","dot-connect","assistant-connections","docs","instance","s"]);function ce(e){return e.trim().toUpperCase()}a(ce,"normalizeCompanyPrefix");function xn(e){const t=e.match(/^([^?#]*)(\?[^#]*)?(#.*)?$/);return{pathname:t?.[1]??e,search:t?.[2]??"",hash:t?.[3]??""}}a(xn,"splitPath");function Si(e){return e.split("/").filter(Boolean)[0]??null}a(Si,"getRootSegment");function Ei(e){if(e==="/")return!0;const t=Si(e);return t?rt.has(t.toLowerCase()):!0}a(Ei,"isGlobalPath");function wn(e){const t=e.split("/").filter(Boolean);if(t.length===0)return null;const r=t[0].toLowerCase();return rt.has(r)||bn.has(r)?null:ce(t[0])}a(wn,"extractCompanyPrefixFromPath");function Tt(e,t){const{pathname:r,search:n,hash:o}=xn(e);if(!r.startsWith("/")||Ei(r)||!t)return e;const s=ce(t);return wn(r)?e:`/${s}${r}${n}${o}`}a(Tt,"applyCompanyPrefix");function Ci(e,...t){const r=["cases",...t].filter(Boolean).join("/");return e?`/${ce(e)}/${r}`:`/${r}`}a(Ci,"caseHref");function Hl(e){const{pathname:t,search:r,hash:n}=xn(e),o=t.split("/").filter(Boolean);if(o.length>=2){const s=o[1].toLowerCase();if(!rt.has(o[0].toLowerCase())&&bn.has(s))return`/${o.slice(1).join("/")}${r}${n}`}return`${t}${r}${n}`}a(Hl,"toCompanyRelativePath");var In=/^[A-Z][A-Z0-9]*-\d+$/i,$i=/^issue:\/\/:?([^?#\s]+)([?#].*)?$/i,_i=/issue:\/\/:?[^\s<>()]+|https?:\/\/[^\s<>()]+|\/(?:[^\s<>()/]+\/)*issues\/[A-Z][A-Z0-9]*-\d+(?=$|[\s<>)\],.;!?:])|\b[A-Z][A-Z0-9]*-\d+\b/gi;function Rn(e){if(!e)return null;const t=e.trim();if(!t||/^https?:\/\//i.test(t))return null;const r=t.split(/[?#]/,1)[0].split("/").filter(Boolean),n=r.findIndex(s=>s==="issues");if(n===-1||n===r.length-1)return null;const o=decodeURIComponent(r[n+1]??"");return!o||o.startsWith(":")?null:In.test(o)?o.toUpperCase():o}a(Rn,"parseIssuePathIdFromPath");function Sn(e,t){if(!e)return null;const r=e.trim(),n=r.match($i);if(n?.[1]){const i=decodeURIComponent(n[1]);return{issuePathId:i,href:`/issues/${encodeURIComponent(i)}${n[2]??""}`}}const o=Rn(e);if(o)return{issuePathId:o,href:`/issues/${encodeURIComponent(o)}${r.match(/[?#].*$/)?.[0]??""}`};if(!In.test(r))return null;const s=r.toUpperCase();if(t&&t.size>0){const i=s.split("-")[0];if(!i||!t.has(i))return null}return{issuePathId:s,href:`/issues/${encodeURIComponent(s)}`}}a(Sn,"parseIssueReferenceFromHref");function Ai(e){let t=e,r="";for(;t.length>0;){const n=t.at(-1);if(!n||!/[),.;!?:\]]/.test(n))break;if(n===")"){const o=(t.match(/\(/g)??[]).length;if((t.match(/\)/g)??[]).length<=o)break}if(n==="]"){const o=(t.match(/\[/g)??[]).length;if((t.match(/\]/g)??[]).length<=o)break}r=`${n}${r}`,t=t.slice(0,-1)}return{core:t,trailing:r}}a(Ai,"splitTrailingPunctuation");function En(e,t,r="text"){return{type:"link",url:t,children:[{type:r,value:e}]}}a(En,"createIssueLinkNode");function Di(e,t){const r=[];let n=0,o=!1;for(const s of e.matchAll(_i)){const i=s[0];if(!i)continue;const u=s.index??0,d=u+i.length,{core:f,trailing:p}=Ai(i),m=Sn(f,t);m&&(o=!0,u>n&&r.push({type:"text",value:e.slice(n,u)}),r.push(En(f,m.href)),p&&r.push({type:"text",value:p}),n=d)}return o?(n<e.length&&r.push({type:"text",value:e.slice(n)}),r):null}a(Di,"linkifyIssueReferencesInText");function Cn(e,t){if(!Array.isArray(e.children)||e.children.length===0||e.type==="link"||e.type==="linkReference"||e.type==="code"||e.type==="definition"||e.type==="html")return;const r=[];for(const n of e.children){if(n.type==="inlineCode"&&typeof n.value=="string"){const o=Sn(n.value,t);if(o){r.push(En(n.value,o.href,"inlineCode"));continue}}if(n.type==="text"&&typeof n.value=="string"){const o=Di(n.value,t);if(o){r.push(...o);continue}}Cn(n,t),r.push(n)}e.children=r}a(Cn,"rewriteMarkdownTree");function Wl(e){const t=e?.knownPrefixes&&e.knownPrefixes.length>0?new Set(e.knownPrefixes.map(r=>r.toUpperCase())):void 0;return r=>{Cn(r,t)}}a(Wl,"remarkLinkIssueReferences");function De(e,t){if(typeof e=="string")return Tt(e,t);if(e.pathname&&e.pathname.startsWith("/")){const r=Tt(e.pathname,t);if(r!==e.pathname)return{...e,pathname:r}}return e}a(De,"resolveTo");function he(){const{selectedCompany:e}=Bn(),t=Na(),r=T();if(t.companyPrefix)return ce(t.companyPrefix);const n=wn(r.pathname);return n||(e?ce(e.issuePrefix):null)}a(he,"useActiveCompanyPrefix");function Vl(){const e=he();return l.useCallback((...t)=>Ci(e,...t),[e])}a(Vl,"useCaseHref");var Kl=l.forwardRef(a(function({to:t,disableIssueQuicklook:r=!1,issuePrefetch:n=null,issueQuicklookSide:o,issueQuicklookAlign:s,...i},u){const d=De(t,he()),f=Rn(typeof d=="string"?d:d.pathname);return f?(0,S.jsx)(Ri,{ref:u,to:d,issuePathId:f,disableIssueQuicklook:r,issuePrefetch:n,issueQuicklookSide:o,issueQuicklookAlign:s,...i}):(0,S.jsx)(pe,{ref:u,to:d,...i})},"CompanyLink")),Ql=l.forwardRef(a(function({to:t,...r},n){const o=he();return(0,S.jsx)(cr,{ref:n,to:De(t,o),...r})},"CompanyNavLink"));function Jl({to:e,...t}){const r=he();return(0,S.jsx)(Xa,{to:De(e,r),...t})}a(Jl,"Navigate");function Gl(){const e=Ee(),t=he();return l.useCallback(((r,n)=>{if(typeof r=="number"){e(r);return}e(De(r,t),n)}),[e,t])}a(Gl,"useNavigate");function $n(e,t){return t?`${e}${e.includes("?")?"&":"?"}companyId=${encodeURIComponent(t)}`:e}a($n,"withCompanyScope");function R(e,t,r=""){return $n(`/agents/${encodeURIComponent(e)}${r}`,t)}a(R,"agentPath");var Yl={setAvatar:a((e,t,r)=>c.put(`/companies/${e}/agents/${t}/avatar`,{imageBase64:r}),"setAvatar"),getIdentity:a((e,t)=>c.get(R(e,t,"/identity")),"getIdentity"),adoptAiConnection:a((e,t,r,n)=>c.post($n(`/agents/${e}/connection-intents/${t}/adopt`,n),{connectionId:r}),"adoptAiConnection"),list:a(e=>c.get(`/companies/${e}/agents`),"list"),org:a(e=>c.get(`/companies/${e}/org`),"org"),listConfigurations:a(e=>c.get(`/companies/${e}/agent-configurations`),"listConfigurations"),get:a(async(e,t)=>{try{return await c.get(R(e,t))}catch(r){if(!(r instanceof Ot)||r.status!==409||!t||jn(e))throw r;const n=st(e);if(!n)throw r;const o=(await c.get(`/companies/${t}/agents`)).filter(s=>s.status!=="terminated"&&st(s.urlKey)===n);if(o.length!==1)throw r;return c.get(R(o[0].id,t))}},"get"),getConfiguration:a((e,t)=>c.get(R(e,t,"/configuration")),"getConfiguration"),listConfigRevisions:a((e,t)=>c.get(R(e,t,"/config-revisions")),"listConfigRevisions"),getConfigRevision:a((e,t,r)=>c.get(R(e,r,`/config-revisions/${t}`)),"getConfigRevision"),rollbackConfigRevision:a((e,t,r)=>c.post(R(e,r,`/config-revisions/${t}/rollback`),{}),"rollbackConfigRevision"),create:a((e,t)=>c.post(`/companies/${e}/agents`,t),"create"),hire:a((e,t)=>c.post(`/companies/${e}/agent-hires`,t),"hire"),update:a((e,t,r)=>c.patch(R(e,r),t),"update"),updatePermissions:a((e,t,r)=>c.patch(R(e,r,"/permissions"),t),"updatePermissions"),batchAdapterConfigPreview:a(e=>c.post("/agents/batch/adapter-config/preview",{agentIds:e}),"batchAdapterConfigPreview"),batchAdapterConfig:a((e,t)=>c.post("/agents/batch/adapter-config",{agentIds:e,values:t}),"batchAdapterConfig"),instructionsBundle:a((e,t)=>c.get(R(e,t,"/instructions-bundle")),"instructionsBundle"),updateInstructionsBundle:a((e,t,r)=>c.patch(R(e,r,"/instructions-bundle"),t),"updateInstructionsBundle"),instructionsFile:a((e,t,r)=>c.get(R(e,r,`/instructions-bundle/file?path=${encodeURIComponent(t)}`)),"instructionsFile"),saveInstructionsFile:a((e,t,r)=>c.put(R(e,r,"/instructions-bundle/file"),t),"saveInstructionsFile"),instructionCandidates:a((e,t)=>c.get(R(e,t,"/instructions-bundle/candidates")),"instructionCandidates"),resolveInstructionCandidate:a((e,t,r,n)=>c.post(R(e,n,`/instructions-bundle/candidates/${t}/resolve`),r),"resolveInstructionCandidate"),instructionHistory:a((e,t,r,n)=>c.get(R(e,r,`/instructions-bundle/history?path=${encodeURIComponent(t)}${n?`&cursor=${encodeURIComponent(n)}`:""}`)),"instructionHistory"),instructionRevision:a((e,t,r,n)=>c.get(R(e,n,`/instructions-bundle/revision/${r}?path=${encodeURIComponent(t)}`)),"instructionRevision"),instructionDiff:a((e,t,r,n,o)=>c.get(R(e,o,`/instructions-bundle/diff?path=${encodeURIComponent(t)}&from=${encodeURIComponent(r)}&to=${encodeURIComponent(n)}`)),"instructionDiff"),restoreInstructions:a((e,t,r)=>c.post(R(e,r,"/instructions-bundle/restore"),t),"restoreInstructions"),downloadInstructionsFile:a((e,t,r)=>`/api${R(e,r,`/instructions-bundle/file?path=${encodeURIComponent(t)}&download=true`)}`,"downloadInstructionsFile"),deleteInstructionsFile:a((e,t,r,n)=>c.delete(R(e,r,`/instructions-bundle/file?path=${encodeURIComponent(t)}${n?`&baseHash=${n}`:""}`)),"deleteInstructionsFile"),retryLifecycle:a((e,t)=>c.post(R(e,t,"/lifecycle/retry"),{}),"retryLifecycle"),pause:a((e,t)=>c.post(R(e,t,"/pause"),{}),"pause"),resume:a((e,t)=>c.post(R(e,t,"/resume"),{}),"resume"),clearError:a((e,t)=>c.post(R(e,t,"/clear-error"),{}),"clearError"),approve:a((e,t)=>c.post(R(e,t,"/approve"),{}),"approve"),terminate:a((e,t)=>c.post(R(e,t,"/terminate"),{}),"terminate"),remove:a((e,t)=>c.delete(R(e,t)),"remove"),listKeys:a((e,t)=>c.get(R(e,t,"/keys")),"listKeys"),skills:a((e,t)=>c.get(R(e,t,"/skills")),"skills"),syncSkills:a((e,t,r,n)=>c.post(R(e,n,"/skills/sync"),{desiredSkills:t,mode:r}),"syncSkills"),createKey:a((e,t,r,n)=>c.post(R(e,r,"/keys"),{name:t,...n?{scope:n}:{}}),"createKey"),revokeKey:a((e,t,r)=>c.delete(R(e,r,`/keys/${encodeURIComponent(t)}`)),"revokeKey"),runtimeState:a((e,t)=>c.get(R(e,t,"/runtime-state")),"runtimeState"),taskSessions:a((e,t)=>c.get(R(e,t,"/task-sessions")),"taskSessions"),resetSession:a((e,t,r)=>c.post(R(e,r,"/runtime-state/reset-session"),{taskKey:t??null}),"resetSession"),adapterModels:a((e,t,r)=>{const n=new URLSearchParams;r?.refresh&&n.set("refresh","1"),r?.provider&&n.set("provider",r.provider),r?.poolId&&n.set("poolId",r.poolId),r?.environmentId&&n.set("environmentId",r.environmentId);const o=n.size>0?`?${n.toString()}`:"";return c.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/models${o}`)},"adapterModels"),detectModel:a((e,t)=>c.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/detect-model`),"detectModel"),testEnvironment:a((e,t,r)=>c.post(`/companies/${e}/adapters/${t}/test-environment`,r),"testEnvironment"),getAdapterAuthSignal:a((e,t,r)=>{const n=r?`?environmentId=${encodeURIComponent(r)}`:"";return c.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/auth-signal${n}`)},"getAdapterAuthSignal"),invoke:a((e,t,r={})=>c.post(R(e,t,"/heartbeat/invoke"),r),"invoke"),wakeup:a((e,t,r)=>c.post(R(e,r,"/wakeup"),t),"wakeup"),retryFailedRun:a(async(e,t,r)=>{const n=await c.post(R(e,r,"/wakeup"),{source:"on_demand",triggerDetail:"manual",reason:"retry_failed_run",failedRunId:t});if("id"in n){if(["failed","timed_out","cancelled","interrupted"].includes(n.status))throw new Error("The previous retry has already stopped. Refresh the task and retry its latest failed run.");return{runId:n.id,issueId:null}}if("actionId"in n){if(n.status==="failed"||n.status==="cancelled")throw new Error("This retry could not start. Open the task to review its current access and recovery state.");return{runId:n.runId,issueId:n.issueId}}throw new Error(n.message??"Retry was skipped.")},"retryFailedRun"),loginWithClaude:a((e,t)=>c.post(R(e,t,"/claude-login"),{}),"loginWithClaude"),startAdapterAuthLogin:a((e,t,r)=>c.post(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions`,r),"startAdapterAuthLogin"),getAdapterAuthLoginStatus:a((e,t,r)=>c.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions/${encodeURIComponent(r)}`,{cache:"no-store"}),"getAdapterAuthLoginStatus"),getActiveAdapterAuthLoginSession:a((e,t)=>c.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions/active`,{cache:"no-store"}),"getActiveAdapterAuthLoginSession"),cancelAdapterAuthLogin:a((e,t,r)=>c.post(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions/${encodeURIComponent(r)}/cancel`,{}),"cancelAdapterAuthLogin"),getClaudeOAuthTokenStatus:a(e=>c.get(`/companies/${encodeURIComponent(e)}/claude-oauth-token-status`),"getClaudeOAuthTokenStatus"),startClaudeSetupTokenLogin:a((e,t)=>c.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions`,{adapterType:"claude_local",...t}),"startClaudeSetupTokenLogin"),getClaudeSetupTokenLoginStatus:a((e,t)=>c.get(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}`),"getClaudeSetupTokenLoginStatus"),getActiveClaudeSetupTokenLoginSession:a(e=>c.get(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/active`,{cache:"no-store"}),"getActiveClaudeSetupTokenLoginSession"),getClaudeSetupTokenLoginPrompt:a((e,t)=>c.get(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/prompt`),"getClaudeSetupTokenLoginPrompt"),submitClaudeSetupTokenBrowserCode:a((e,t,r)=>c.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/code`,{browserCode:r}),"submitClaudeSetupTokenBrowserCode"),completeClaudeSetupTokenLogin:a((e,t)=>c.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/completion`,{}),"completeClaudeSetupTokenLogin"),cancelClaudeSetupTokenLogin:a((e,t)=>c.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/cancel`,{}),"cancelClaudeSetupTokenLogin"),availableSkills:a(()=>c.get("/skills/available"),"availableSkills")};export{Js as $,pl as $t,zl as A,Ee as An,ks as At,$l as B,ps as Bt,Ul as C,Qi as Cn,Dt as Ct,ve as D,Hi as Dn,Is as Dt,Al as E,eo as En,Rs as Et,Rl as F,xl as Ft,ni as G,il as Gt,Cl as H,hl as Ht,Sl as I,bl as It,ei as J,ll as Jt,ri as K,fl as Kt,_l as L,gs as Lt,Bl as M,Na as Mn,hs as Mt,wl as N,Ji as Nn,kl as Nt,ql as O,Gi as On,xs as Ot,Il as P,ys as Pt,Gs as Q,vl as Qt,Ol as R,Er as Rt,Tl as S,Wo as Sn,Es as St,Ll as T,qi as Tn,Or as Tt,Ml as U,ss as Ut,El as V,ul as Vt,Pl as W,gl as Wt,Zs as X,is as Xt,Xs as Y,ml as Yt,Ys as Z,cl as Zt,vi as _,et as _n,Ds as _t,he as a,rl as an,qs as at,Lt as b,pr as bn,$s as bt,Sn as c,sl as cn,Bs as ct,wn as d,al as dn,Os as dt,dl as en,Qs as et,Ei as f,xr as fn,Us as ft,Ii as g,Zi as gn,Ls as gt,Ri as h,Ko as hn,Ms as ht,Jl as i,nl as in,Hs as it,jl as j,Fi as jn,vs as jt,Fl as k,T as kn,bs as kt,Wl as l,Yo as ln,js as lt,Hl as m,Vo as mn,Ps as mt,Kl as n,Z as nn,Vs as nt,Vl as o,rs as on,zs as ot,ce as p,el as pn,Ts as pt,ti as q,os as qt,Ql as r,Rt as rn,Ws as rt,Gl as s,ol as sn,Fs as st,Yl as t,yl as tn,Ks as tt,Tt as u,ns as un,Ns as ut,ki as v,tl as vn,As as vt,Dl as w,pe as wn,Ss as wt,ui as x,Yi as xn,Cs as xt,mi as y,Xi as yn,_s as yt,Nl as z,ds as zt};