@overlordai/server 1.0.133 → 1.0.135

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 (132) hide show
  1. package/database/migrations/007-worker-capability-state.sql +5 -0
  2. package/dist/adapters/help-text.js +1 -1
  3. package/dist/database/repositories/worker.repository.d.ts +12 -0
  4. package/dist/database/repositories/worker.repository.d.ts.map +1 -1
  5. package/dist/database/repositories/worker.repository.js +40 -0
  6. package/dist/database/repositories/worker.repository.js.map +1 -1
  7. package/dist/dispatcher/capability.service.d.ts +20 -7
  8. package/dist/dispatcher/capability.service.d.ts.map +1 -1
  9. package/dist/dispatcher/capability.service.js +171 -42
  10. package/dist/dispatcher/capability.service.js.map +1 -1
  11. package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
  12. package/dist/dispatcher/scheduler.service.js +58 -15
  13. package/dist/dispatcher/scheduler.service.js.map +1 -1
  14. package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
  15. package/dist/dispatcher/task-creation.service.js +3 -1
  16. package/dist/dispatcher/task-creation.service.js.map +1 -1
  17. package/dist/dispatcher/worker-selector.d.ts +4 -0
  18. package/dist/dispatcher/worker-selector.d.ts.map +1 -1
  19. package/dist/dispatcher/worker-selector.js +9 -0
  20. package/dist/dispatcher/worker-selector.js.map +1 -1
  21. package/dist/web/frame-handlers/progress.handler.d.ts +3 -1
  22. package/dist/web/frame-handlers/progress.handler.d.ts.map +1 -1
  23. package/dist/web/frame-handlers/progress.handler.js +41 -5
  24. package/dist/web/frame-handlers/progress.handler.js.map +1 -1
  25. package/dist/web/worker-channel.gateway.d.ts +3 -1
  26. package/dist/web/worker-channel.gateway.d.ts.map +1 -1
  27. package/dist/web/worker-channel.gateway.js +5 -2
  28. package/dist/web/worker-channel.gateway.js.map +1 -1
  29. package/dist/web/worker-web.controller.d.ts +161 -5
  30. package/dist/web/worker-web.controller.d.ts.map +1 -1
  31. package/dist/web/worker-web.controller.js +69 -9
  32. package/dist/web/worker-web.controller.js.map +1 -1
  33. package/package.json +4 -4
  34. package/public/assets/{AccessTokensPage-B_di-j0j.js → AccessTokensPage-B790MOSI.js} +1 -1
  35. package/public/assets/AdminPage-bj1Ceucs.js +1 -0
  36. package/public/assets/{AgentCliPage-CiSE6MOL.js → AgentCliPage-C3m17Vxw.js} +2 -2
  37. package/public/assets/{ApiReferencePage-Cv1THMOi.js → ApiReferencePage-CU5KWW5b.js} +1 -1
  38. package/public/assets/{ArchitecturePage-H1WtP2sH.js → ArchitecturePage-B3NO9ams.js} +1 -1
  39. package/public/assets/{AuditLogPage-Q-izWOoJ.js → AuditLogPage-CSYmdRqM.js} +1 -1
  40. package/public/assets/{BindPlatformPage-S-s2YO1G.js → BindPlatformPage-BhC8I1M6.js} +1 -1
  41. package/public/assets/{BotIntegrationPage-CzgR3bDN.js → BotIntegrationPage-B4NhIhTq.js} +1 -1
  42. package/public/assets/{BotManage-Cmb0u2y7.js → BotManage-BVx8Zpyb.js} +1 -1
  43. package/public/assets/{BotSetupPage-DCuRv9lx.js → BotSetupPage-DVqBgyjG.js} +1 -1
  44. package/public/assets/{ChangelogPage-DGVNwh9w.js → ChangelogPage-DgAkPSte.js} +1 -1
  45. package/public/assets/{CliReferencePage-DKZZacin.js → CliReferencePage-ChEAiOWL.js} +1 -1
  46. package/public/assets/{DeploymentPage-Cd_K6k-C.js → DeploymentPage-DUlfbHwk.js} +1 -1
  47. package/public/assets/{DevWorkflowPage-DY1Kcsg7.js → DevWorkflowPage-CHQifk0Y.js} +1 -1
  48. package/public/assets/{DeveloperManage-BnhZ_Aqp.js → DeveloperManage-BOzhPppl.js} +1 -1
  49. package/public/assets/{DeveloperSetupPage-C3519X2U.js → DeveloperSetupPage-rpsOayJX.js} +1 -1
  50. package/public/assets/{DocsIndexPage-BXNlGsUi.js → DocsIndexPage-BMIn54Zl.js} +6 -11
  51. package/public/assets/DocsLayout-FmrCA5RW.js +1 -0
  52. package/public/assets/{DocsPrimitives-DNdGlGlH.js → DocsPrimitives-ppeWCX0i.js} +1 -1
  53. package/public/assets/EditProjectPage-CLPYjvAQ.js +2 -0
  54. package/public/assets/{EmptyState-9Eqw0iR8.js → EmptyState-Q0YM1iFk.js} +1 -1
  55. package/public/assets/{EnvVariablesPage-Cddaji3m.js → EnvVariablesPage-CLafcR2k.js} +1 -1
  56. package/public/assets/HomePage-B-rfwBdn.js +1 -0
  57. package/public/assets/{InfoRow-C3ZXZz4q.js → InfoRow-D8AsUcSn.js} +1 -1
  58. package/public/assets/{InstallationPage-BTbG8z22.js → InstallationPage-BbXh-Y77.js} +1 -1
  59. package/public/assets/{LandingPage-DpdvNKYz.js → LandingPage-DqLbP1Ry.js} +1 -1
  60. package/public/assets/{LocalDevelopmentPage-CqPNGlUK.js → LocalDevelopmentPage-CY7dB3hK.js} +1 -1
  61. package/public/assets/{LoginPage-CzJDQ0H0.js → LoginPage-BoXUe_Xx.js} +1 -1
  62. package/public/assets/{MetricBar-CixGVqjI.js → MetricBar-D9ZLrw38.js} +1 -1
  63. package/public/assets/{NotFoundPage-DdxosdYc.js → NotFoundPage-4pE6QH1R.js} +1 -1
  64. package/public/assets/{OnboardingGuide-C1-sQUW7.js → OnboardingGuide-Bo4Ljo4i.js} +1 -1
  65. package/public/assets/{PermissionsPage-Db7ynPhr.js → PermissionsPage-DvWGCh32.js} +1 -1
  66. package/public/assets/{PipelineConfigPage-DM_btq4K.js → PipelineConfigPage-CeU0o917.js} +1 -1
  67. package/public/assets/{PipelineEditorPage-CAO4j2sA.js → PipelineEditorPage-CdHuwLmJ.js} +1 -1
  68. package/public/assets/ProfilePage-8kc8fiZV.js +1 -0
  69. package/public/assets/{ProjectDetailPage-B9my9oLw.js → ProjectDetailPage-CaASFvS0.js} +1 -1
  70. package/public/assets/ProjectListPage-r28OozXz.js +6 -0
  71. package/public/assets/{PtyTerminal-C9Bp0uS_.js → PtyTerminal-DzMsSJAu.js} +1 -1
  72. package/public/assets/{QuickAuth-C1XxLYNZ.js → QuickAuth-Cds5x6Z3.js} +1 -1
  73. package/public/assets/{RemoveMemberConfirmDialog-gohLNDc5.js → RemoveMemberConfirmDialog-Do2l0kib.js} +1 -1
  74. package/public/assets/{Select-CkMgU0Lq.js → Select-DRCu2nu0.js} +1 -1
  75. package/public/assets/{SettingsPage-Crc4EZDF.js → SettingsPage-CZywaGc9.js} +1 -1
  76. package/public/assets/{Skeleton-DI-HCY-N.js → Skeleton-BWkXyrSG.js} +1 -1
  77. package/public/assets/{SkillPage-SmsZWW8c.js → SkillPage-Bn53Yjiu.js} +1 -1
  78. package/public/assets/TaskDetailPage-Bgd8Ogvq.js +26 -0
  79. package/public/assets/TaskListPage-Ca0mxJ_o.js +1 -0
  80. package/public/assets/{TaskStatusBadge-B49xL6ug.js → TaskStatusBadge-fDYhxtHY.js} +1 -1
  81. package/public/assets/TerminalHomePage-DE4Fra73.js +11 -0
  82. package/public/assets/TokenManage-CL6Dgoac.js +1 -0
  83. package/public/assets/{Tooltip-DrIj1IXL.js → Tooltip-CZtlcHYf.js} +1 -1
  84. package/public/assets/{TotpSetupPage-B81U1CZB.js → TotpSetupPage-BeStxglO.js} +1 -1
  85. package/public/assets/WorkerDetailPage-B5lirrH3.js +1 -0
  86. package/public/assets/WorkerListPage-DRx_FX1c.js +6 -0
  87. package/public/assets/{WorkerOperationsPage-CcfPJ-Vx.js → WorkerOperationsPage-0fj-txrI.js} +1 -1
  88. package/public/assets/{WorkerSetupGuidePage-C_GA4jv_.js → WorkerSetupGuidePage-CpWSvLWw.js} +1 -1
  89. package/public/assets/{WorkerSetupPage-hV7T8eEi.js → WorkerSetupPage-CX2IKTBz.js} +1 -1
  90. package/public/assets/agent-type-options-BztKEaBi.js +1 -0
  91. package/public/assets/{arrow-left-BwtdfCwD.js → arrow-left-CiH58ODj.js} +1 -1
  92. package/public/assets/{arrow-right-BQPypZRF.js → arrow-right-Dq2t8ts3.js} +1 -1
  93. package/public/assets/{bot-3i2pb58N.js → bot-C1cnPjRw.js} +1 -1
  94. package/public/assets/{chevron-left-6cPJJmnY.js → chevron-left-CM3Ljmsh.js} +1 -1
  95. package/public/assets/{chevron-right-DxtB9dXk.js → chevron-right-OQgRbmpb.js} +1 -1
  96. package/public/assets/{copy-BckVr8cJ.js → copy-DO7PDfZF.js} +1 -1
  97. package/public/assets/{download-DnrLGHSN.js → download-Cd-BBoI7.js} +1 -1
  98. package/public/assets/{external-link-BWs-24k_.js → external-link-COzchqIG.js} +1 -1
  99. package/public/assets/file-text-DTpqny43.js +6 -0
  100. package/public/assets/{git-fork-DxuKN6TL.js → git-fork-BWs-fYTb.js} +1 -1
  101. package/public/assets/{index-D3ZK8e35.js → index-01l9VFB2.js} +28 -28
  102. package/public/assets/index-3ccyrL7z.css +1 -0
  103. package/public/assets/{key-BjxaakEN.js → key-Chc2kr14.js} +1 -1
  104. package/public/assets/{loader-circle-fKTUhuFx.js → loader-circle-D5ClDQ9h.js} +1 -1
  105. package/public/assets/{pencil-BGn762Xd.js → pencil-DBqi31EH.js} +1 -1
  106. package/public/assets/{plus-DfeF35ew.js → plus-ucRIgQZK.js} +1 -1
  107. package/public/assets/{rotate-ccw-DnJi9esb.js → rotate-ccw-CHaUzlWE.js} +1 -1
  108. package/public/assets/{scroll-text-CDAXkr64.js → scroll-text-DBPeZU4l.js} +1 -1
  109. package/public/assets/{settings-BQ40mw10.js → settings-JXcSTf0A.js} +1 -1
  110. package/public/assets/{status-colors-BgploKhY.js → status-colors-kQDPD0wO.js} +1 -1
  111. package/public/assets/task-constants-DXxUAApA.js +1 -0
  112. package/public/assets/{trash-2-B6XaTY-0.js → trash-2-WA_mdBf9.js} +1 -1
  113. package/public/assets/{useFetch-CSoNR_l8.js → useFetch-DWa3GeJN.js} +1 -1
  114. package/public/assets/{users-DI9FgcZa.js → users-CUx2h4Ml.js} +1 -1
  115. package/public/assets/{wifi-D9JcPn5X.js → wifi-DtCZMvdz.js} +1 -1
  116. package/public/assets/{workflow-DRETOaoe.js → workflow-DvpyWOk6.js} +1 -1
  117. package/public/index.html +2 -2
  118. package/public/sw.js +1 -1
  119. package/public/assets/AdminPage-DIyGC-b1.js +0 -1
  120. package/public/assets/DocsLayout-CZh1AEB5.js +0 -1
  121. package/public/assets/EditProjectPage-BMsLYq9D.js +0 -2
  122. package/public/assets/HomePage-CRZSG4wX.js +0 -1
  123. package/public/assets/ProfilePage-5b64UEF7.js +0 -1
  124. package/public/assets/ProjectListPage-D0ArUg7q.js +0 -6
  125. package/public/assets/TaskDetailPage-cjzjPYPW.js +0 -26
  126. package/public/assets/TaskListPage-BCj8HmhB.js +0 -1
  127. package/public/assets/TerminalHomePage-BmShj9-L.js +0 -11
  128. package/public/assets/TokenManage-CXGZwaVK.js +0 -1
  129. package/public/assets/WorkerDetailPage-D3l1CEg-.js +0 -1
  130. package/public/assets/WorkerListPage-CR3ptj-n.js +0 -6
  131. package/public/assets/index-DMWyyiI3.css +0 -1
  132. package/public/assets/task-constants-eOji5WUw.js +0 -1
@@ -1,26 +0,0 @@
1
- import{c as Q,a as Y,r,h as g,j as e,M as ut,z as P,H as ht,t as J,v as Ce,A as ft,f as vt,B as bt,q as gt,s as jt,k as Ve,p as D,l as Je,m as Nt,L as yt,X as ge,E as Qe,n as kt,x as wt,G as _t}from"./index-D3ZK8e35.js";import{u as Ct,T as St,g as rt}from"./task-constants-eOji5WUw.js";import{C as Et,g as Tt,H as Ye,P as Ze}from"./PtyTerminal-C9Bp0uS_.js";import{a as Lt,b as Dt,f as ne}from"./date-RFA7-ZGs.js";import{S as It}from"./Select-CkMgU0Lq.js";import{a as we}from"./status-colors-BgploKhY.js";import{T as $t}from"./Tooltip-DrIj1IXL.js";import{A as Rt}from"./arrow-left-BwtdfCwD.js";import{R as je}from"./rotate-ccw-DnJi9esb.js";import{G as At}from"./git-fork-DxuKN6TL.js";import{E as Pt}from"./external-link-BWs-24k_.js";import{L as Ne}from"./loader-circle-fKTUhuFx.js";/**
2
- * @license lucide-react v0.469.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const et=Q("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
7
- * @license lucide-react v0.469.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Ft=Q("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
12
- * @license lucide-react v0.469.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const Mt=Q("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
17
- * @license lucide-react v0.469.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const Ot=Q("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
22
- * @license lucide-react v0.469.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const qt=Q("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);function tt({isOpen:l,onClose:c,taskId:a,stageName:n,timeoutSeconds:t,onSubmitted:m}){const{t:p}=Y(),[b,u]=r.useState(t),[_,C]=r.useState(!1);r.useEffect(()=>{if(!l)return;u(t);const o=setInterval(()=>{u(j=>j<=1?(clearInterval(o),0):j-1)},1e3);return()=>clearInterval(o)},[l,t]),r.useEffect(()=>{b===0&&l&&c()},[b,l,c]);const $=r.useCallback(async o=>{C(!0);try{await g.post(`web/tasks/${a}/confirm-stage`,{json:{stageName:n,approved:o}}),m==null||m(),c()}catch{}finally{C(!1)}},[a,n,c,m]);return l?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),e.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ut,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// stage: ",n]})]}),e.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--text-muted)]",children:[e.jsx(Et,{className:"h-3.5 w-3.5"}),Lt(b)]})]}),e.jsx("div",{className:"space-y-4 px-5 py-5",children:e.jsx("p",{className:"whitespace-pre-wrap text-xs text-[var(--text-primary)]",children:p("tasks.confirm_stage_message",{name:n})})}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",disabled:_,onClick:()=>$(!1),children:p("tasks.reject")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:_,onClick:()=>$(!0),children:p(_?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})]})]}):null}function Ut(l,c){const a=new Date(l).getTime()-Date.now();if(a<=0)return c("tasks.tunnel_expired");const n=Math.floor(a/36e5),t=Math.floor(a%36e5/6e4);return n>0?c("tasks.tunnel_expires_hm",{h:n,m:t}):c("tasks.tunnel_expires_m",{m:t})}function st(l){switch(l){case"CONNECTED":return"var(--accent)";case"STARTING":return"var(--warning)";case"EXPIRED":return"var(--text-muted)";default:return"var(--text-muted)"}}function at(l,c){switch(l){case"IDLE":case"CLOSED":return c("tasks.tunnel_idle");case"STARTING":return c("tasks.tunnel_starting");case"CONNECTED":return c("tasks.tunnel_connected");case"EXPIRED":return c("tasks.tunnel_expired");case"CLOSING":return c("tasks.tunnel_closing");default:return String(l).toLowerCase()}}function Gt({taskId:l,taskFinished:c,compact:a}){const{t:n}=Y(),[t,m]=r.useState(P.IDLE),[p,b]=r.useState(null),[u,_]=r.useState(null),[C,$]=r.useState(""),[o,j]=r.useState(!1),[ce,F]=r.useState(!1),M=r.useRef(null),R=r.useCallback(async()=>{try{const f=await g.get(`web/workspace-tunnel/${l}/status`).json();m(f.status),b(f.tunnelUrl??null),_(f.expiresAt??null),(f.status==="EXPIRED"||f.status==="IDLE"||f.status==="CLOSED")&&S()}catch{}},[l]);function ie(){S(),M.current=setInterval(R,5e3)}function S(){M.current&&(clearInterval(M.current),M.current=null)}r.useEffect(()=>{c&&(t===P.STARTING||t===P.CONNECTED)&&(m(P.IDLE),b(null),S())},[c,t]),r.useEffect(()=>{if(t!=="CONNECTED"||!u)return;const f=()=>{const E=Ut(u,n);$(E),E===n("tasks.tunnel_expired")&&(m(P.EXPIRED),b(null),S())};f();const I=setInterval(f,3e4);return()=>clearInterval(I)},[t,u]),r.useEffect(()=>()=>S(),[]),r.useEffect(()=>{c||R()},[R,c]);async function K(){j(!0);try{await g.post(`web/workspace-tunnel/${l}/start`),m(P.STARTING),ie()}catch(f){let I=n("tasks.tunnel_start_failed");try{if(f instanceof ht){const E=await f.response.json();E!=null&&E.error&&(I=E.error,/code.*not found|ENOENT.*code|spawn code/i.test(I)&&(I+=". "+n("tasks.tunnel_install_code_hint")))}}catch{}J.error(I)}finally{j(!1)}}async function W(){j(!0);try{await g.post(`web/workspace-tunnel/${l}/stop`),m(P.IDLE),b(null),S()}catch{}finally{j(!1)}}async function oe(){p&&(await navigator.clipboard.writeText(p),F(!0),setTimeout(()=>F(!1),2e3))}return a?e.jsxs("div",{className:"flex items-center gap-2 font-mono lowercase text-xs",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"ide_tunnel:"}),e.jsx("span",{style:{color:st(t)},children:at(t,n)}),(t==="IDLE"||t==="CLOSED"||t==="EXPIRED")&&e.jsx("button",{onClick:K,disabled:o,className:"rounded-[4px] px-2 py-1 text-[var(--info)] disabled:opacity-50",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:n(o?"tasks.tunnel_starting":"tasks.tunnel_start")}),t==="CONNECTED"&&p&&e.jsx("a",{href:p.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] px-2 py-1 text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:n("tasks.tunnel_open_in_cursor")})]}):e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 font-mono lowercase",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:n("tasks.tunnel_header")}),e.jsxs("span",{className:"text-xs",style:{color:st(t)},children:["● ",at(t,n)]})]}),t==="CONNECTED"&&u&&e.jsxs("p",{className:"mb-2 text-xs text-[var(--text-muted)]",children:["// ",C]}),t==="CONNECTED"&&p&&e.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"flex-1 truncate text-xs text-[var(--text-primary)]",children:p}),e.jsxs("button",{onClick:oe,className:"shrink-0 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors","aria-label":n("tasks.tunnel_copy_url"),children:["[",n("common.copy"),"]"]})]}),ce&&e.jsx("p",{className:"mb-2 text-xs text-[var(--accent)]",children:n("tasks.tunnel_copied")}),t==="STARTING"&&e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:n("tasks.tunnel_waiting")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(t==="IDLE"||t==="CLOSED")&&e.jsx("button",{onClick:K,disabled:o,className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:n(o?"tasks.tunnel_starting_button":"tasks.tunnel_start_button")}),t==="STARTING"&&e.jsx("button",{onClick:W,disabled:o,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:n(o?"tasks.tunnel_stopping":"tasks.tunnel_cancel")}),t==="CONNECTED"&&p&&e.jsxs(e.Fragment,{children:[e.jsx("a",{href:p.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:n("tasks.tunnel_open_cursor")}),e.jsx("a",{href:p.replace(/^https?:/,"vscode:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:n("tasks.tunnel_open_vscode")}),e.jsx("button",{onClick:W,disabled:o,className:"rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors disabled:opacity-50",children:n(o?"tasks.tunnel_stopping":"tasks.tunnel_stop")})]}),t==="EXPIRED"&&e.jsx("button",{onClick:K,disabled:o,className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:n(o?"tasks.tunnel_starting_button":"tasks.tunnel_restart")})]})]})}function zt({isOpen:l,onClose:c,onConfirm:a,taskId:n,isLoading:t}){const{t:m}=Y();return e.jsx(Ce,{isOpen:l,onClose:c,onConfirm:a,title:m("tasks.cancel_task_title"),message:m("tasks.cancel_task_message",{id:String(n)}),confirmLabel:m("tasks.cancel_task_confirm_label"),confirmVariant:"danger",isLoading:t})}function Bt({isOpen:l,onClose:c,onConfirm:a,taskId:n,mrUrl:t,isLoading:m,reuseWorkspace:p,onReuseWorkspaceChange:b}){const{t:u}=Y(),_=t?u("tasks.retry_message_with_mr",{id:String(n),url:t}):u("tasks.retry_message_without_mr",{id:String(n)});return e.jsx(Ce,{isOpen:l,onClose:c,onConfirm:a,title:u("tasks.retry_title"),message:_,confirmLabel:u("tasks.retry_confirm_label"),confirmVariant:"accent",isLoading:m,children:e.jsxs("label",{className:"flex items-center gap-2 mt-3 text-[var(--text-muted)] text-xs cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:p,onChange:C=>b(C.target.checked),className:"w-3.5 h-3.5 cursor-pointer accent-[var(--accent)]"}),u("tasks.reuse_workspace_label")]})})}const ye=["implement","test","verify","review","simplify","submit"];function _e(l){if(typeof l=="string")try{return _e(JSON.parse(l))}catch{return null}if(!l||typeof l!="object")return null;const c=l.stages;if(!Array.isArray(c)||c.length===0)return null;const a=c.map(n=>n&&typeof n=="object"?n.name:null).filter(n=>typeof n=="string"&&n.length>0);return a.length===c.length?a:null}function Kt(l){if(!l.configSnapshot)return ye;try{const c=JSON.parse(l.configSnapshot);return _e(c.pipeline)??_e(c)??ye}catch{return ye}}function Wt(l){switch(l){case"stage_change":return"text-[var(--accent)]";case"info":return"text-[var(--text-secondary)]";case"warning":return"text-[var(--warning)]";case"error":return"text-[var(--destructive)]";case"system":return"text-[var(--info)]";default:return"text-[var(--text-muted)]"}}function ke({status:l,agentType:c}){const a=we(l),n=rt(c);return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-0.5 text-xs",style:{color:a},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-[3px]",style:{backgroundColor:a}}),l.toLowerCase()," / ",n]})}function Xt(l){const c=Kt(l),a=l.currentStage?c.indexOf(l.currentStage):-1;return c.map((n,t)=>{let m="pending";return l.status===D.COMPLETED?m="completed":l.status===D.FAILED&&t<=a?m=t===a?"failed":"completed":a>=0&&(t<a?m="completed":t===a&&(m="running")),{name:n,status:m}})}function le(l,c){if(!l||!c)return null;const a=l.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),n=c.split("/").map(encodeURIComponent).join("/");return l.gitPlatform===_t.GITLAB?`${a}/-/tree/${n}`:`${a}/tree/${n}`}function ls(){var Xe,He;const{id:l}=ft(),c=vt(),{t:a}=Y(),n=Ct(s=>s.cancelTask),[t,m]=r.useState(null),[p,b]=r.useState(null),[u,_]=r.useState([]),[C,$]=r.useState(!0),[o,j]=r.useState(null),[ce,F]=r.useState(!1),[M,R]=r.useState(!1),[ie,S]=r.useState(!1),[K,W]=r.useState(!1),[oe,f]=r.useState(!1),[I,E]=r.useState(!1),[Se,Ee]=r.useState(""),[Te,xe]=r.useState(!1),[Le,nt]=bt(),[k,de]=r.useState("terminal"),[De,Ie]=r.useState([]),[Z,$e]=r.useState(0),[X,O]=r.useState(0),[H,Re]=r.useState(""),[ee,lt]=r.useState(""),[ct,me]=r.useState(!1),[it,Ae]=r.useState(!1),[q,pe]=r.useState(null),[T,Pe]=r.useState("disconnected"),[V,Fe]=r.useState("auto"),U=r.useRef(null),Me=r.useRef(null),x=Number(l),v=t?St.includes(t.status):!1;gt(t?jt(t,100):null);const L=r.useCallback(async()=>{try{const s=await g.get(`web/tasks/${x}`).json();m(s)}catch{}},[x]),te=r.useCallback(async()=>{try{const s=await g.get(`web/tasks/${x}/logs`).json();_(s.lines)}catch{}},[x]),G=r.useCallback(async()=>{try{const s=await g.get(`web/tasks/${x}/pending-confirm`).json();j(s.confirm)}catch{j(null)}},[x]),Oe=r.useCallback(async()=>{me(!0);try{const s=new URLSearchParams;s.set("limit","50"),s.set("offset",String(X*50)),H&&s.set("type",H),ee&&s.set("search",ee);const i=await g.get(`web/tasks/${x}/events?${s}`).json();Ie(i.events),$e(i.total)}catch{}finally{me(!1)}},[x,X,H,ee]);r.useEffect(()=>{k==="logs"&&Oe()},[k,Oe]),r.useEffect(()=>{k==="pipeline"&&!v&&g.get(`web/workspaces/${x}`).json().then(pe).catch(()=>pe(null))},[k,x,v]);const z=Ve(s=>s.lastEvent),qe=Ve(s=>s.eventSeq);r.useEffect(()=>{$(!0),m(null),b(null),_([]),j(null),pe(null),Ie([]),$e(0),O(0),me(!1),Promise.all([L(),te(),G()]).finally(()=>$(!1))},[L,te,G]),r.useEffect(()=>{t!=null&&t.projectKey&&g.get(`web/projects/${t.projectKey}`).json().then(b).catch(()=>b(null))},[t==null?void 0:t.projectKey]),r.useEffect(()=>{!z||qe===0||(z.event==="task_status_changed"&&z.taskId===x||z.event==="task_created"&&z.taskId===x)&&(L(),G())},[qe,z,x,L,G]),r.useEffect(()=>{if(v)return;const i=setInterval(()=>{document.visibilityState!=="hidden"&&Promise.all([L(),te(),G()])},15e3);return()=>clearInterval(i)},[v,L,te,G]);const Ue=r.useCallback(()=>j(null),[]),se=r.useCallback(()=>{j(null),L()},[L]),ot=(t==null?void 0:t.status)===D.FAILED||(t==null?void 0:t.status)===D.CANCELLED,ue=(t==null?void 0:t.status)===D.COMPLETED||(t==null?void 0:t.status)===D.FAILED||(t==null?void 0:t.status)===D.CANCELLED;r.useEffect(()=>{Le.get("action")==="fork"&&t&&!C&&(ue&&Ge(),nt(s=>(s.delete("action"),s),{replace:!0}))},[t,C,Le,ue]);async function xt(){W(!0);try{await n(x),F(!1),await L()}finally{W(!1)}}async function dt(){f(!0);try{await g.post(`web/tasks/${x}/retry`,{json:{reuseWorkspace:Te}}),R(!1),xe(!1),await L()}finally{f(!1)}}function Ge(){Ee(""),S(!0)}async function mt(){E(!0);try{const s=await g.post(`web/tasks/${x}/fork`,{json:{description:Se||void 0}}).json();S(!1),J.success(a("tasks.fork_success")),c(`/tasks/${s.task.id}`)}catch{J.error(a("tasks.fork_error"))}finally{E(!1)}}const N=r.useMemo(()=>t?Xt(t):[],[t==null?void 0:t.configSnapshot,t==null?void 0:t.currentStage,t==null?void 0:t.status]),he=N.findIndex(s=>s.status==="running");if(C)return e.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("tasks.loading_task")})});if(!t)return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:a("tasks.task_not_found")}),e.jsxs("button",{onClick:()=>c("/tasks"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",a("tasks.back_to_tasks")]})]});const w=t.status===D.QUEUED&&t.queuePosition!=null&&t.queueTotal!=null?{position:t.queuePosition,total:t.queueTotal}:null,y=Dt(t.startedAt,t.completedAt),fe=Tt(t),ze=rt(t.agentType),ae=`${a("tasks.status_suspended")} / ${ze}`,Be=w?e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"queue"}),e.jsxs("span",{className:"text-[var(--info)]",children:["#",w.position," / ",w.total]})]}):null,Ke=e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>c("/tasks"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(Rt,{className:"h-4 w-4"})}),e.jsxs("span",{className:"line-clamp-2 text-sm font-medium text-[var(--text-primary)]",title:Nt(t),children:["#",t.id," ",Je(t,100)]})]}),ve=e.jsxs("div",{className:"hidden md:flex items-center gap-4 border-b border-[var(--border)] bg-[var(--bg-primary)] px-5 shrink-0",style:{height:44},children:[e.jsx(ke,{status:t.status,agentType:t.agentType}),y&&e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// time cost: ",y]}),w&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsx("span",{className:"text-xs text-[var(--info)]",children:a("tasks.queue_position",{position:String(w.position),total:String(w.total)})})]}),e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs(yt,{to:`/projects/${t.projectKey}`,className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:["project: ",e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),t.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["branch: ",le(p,t.branch)?e.jsx("a",{href:le(p,t.branch),target:"_blank",rel:"noopener noreferrer",className:"text-[var(--text-primary)] hover:text-[var(--info)] hover:underline transition-colors",children:t.branch}):e.jsx("span",{className:"text-[var(--text-primary)]",children:t.branch})]})]}),t.mrUrl&&/^https?:\/\//.test(t.mrUrl)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline",children:["MR: ",((Xe=t.mrUrl.match(/!?\d+$/))==null?void 0:Xe[0])??"view"]})]})]}),We=e.jsxs("div",{className:"flex items-center gap-3 border-t border-[var(--border)] bg-[var(--bg-primary)] px-4 md:px-5 shrink-0",style:{height:48},children:[!v&&e.jsxs("button",{onClick:()=>F(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--destructive)]/10 px-3 h-8 text-[11px] font-medium text-[var(--destructive)]",children:[e.jsx(ge,{className:"h-3 w-3"}),a("tasks.cancel_task")]}),ot&&e.jsxs("button",{onClick:()=>R(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-3 h-8 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors cursor-pointer",children:[e.jsx(je,{className:"h-3 w-3"}),a("tasks.retry_task")]}),ue&&e.jsxs("button",{onClick:Ge,className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-3 h-8 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors cursor-pointer",children:[e.jsx(At,{className:"h-3 w-3"}),a("tasks.fork_task")]}),t.workerId&&!v&&e.jsxs("button",{onClick:()=>{de("pipeline"),setTimeout(()=>{var s,i;(i=(s=Me.current)==null?void 0:s.scrollIntoView)==null||i.call(s,{behavior:"smooth",block:"center"})},50)},className:"hidden lg:flex items-center justify-center gap-1.5 rounded-[4px] px-3 h-8 text-[11px] font-medium text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:[e.jsx(Pt,{className:"h-3 w-3"}),a("tasks.cursor_tunnel")]})]}),pt=e.jsxs("div",{className:"hidden w-[280px] shrink-0 flex-col gap-6 overflow-y-auto border-l border-[var(--border)] bg-[var(--bg-primary)] p-4 lg:flex",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.pipeline_stages")}),N.map(s=>{const i=s.status==="completed",d=s.status==="running",h=s.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 py-1.5 ${d?"bg-[#1a1a1a]":""}`,children:[i&&e.jsx(Qe,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),d&&e.jsx(Ne,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),h&&e.jsx(ge,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),s.status==="pending"&&e.jsx(et,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs",style:{color:i?"var(--accent)":d?"#e5e5e5":h?"var(--destructive)":"#525252",fontWeight:d?500:400},children:d?`> ${s.name}`:s.name})]},s.name)})]}),y&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-[11px] text-[var(--text-secondary)]",children:["// time cost: ",y]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.activity_log")}),u.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:u.slice(0,8).map((s,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:s},i))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]}),be=e.jsxs(e.Fragment,{children:[e.jsx(zt,{isOpen:ce,onClose:()=>F(!1),onConfirm:xt,taskId:x,isLoading:K}),e.jsx(Bt,{isOpen:M,onClose:()=>{R(!1),xe(!1)},onConfirm:dt,taskId:x,mrUrl:t.mrUrl??void 0,isLoading:oe,reuseWorkspace:Te,onReuseWorkspaceChange:xe}),e.jsx(Ce,{isOpen:ie,onClose:()=>S(!1),onConfirm:mt,title:a("tasks.fork_task"),message:a("tasks.fork_task_desc"),confirmLabel:a("tasks.fork_task"),confirmVariant:"accent",isLoading:I,children:e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["fork of #",x]}),e.jsx("textarea",{value:Se,onChange:s=>Ee(s.target.value),placeholder:a("tasks.fork_description_placeholder"),rows:4,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"})]})})]});return it&&k==="terminal"?e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[var(--bg-primary)] font-mono lowercase h-screen",style:{height:"100dvh",paddingTop:"env(safe-area-inset-top, 0px)",paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[ve,e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 shrink-0",style:{height:36,backgroundColor:"#111111"},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.pty_terminal")}),e.jsxs("span",{className:`inline-flex items-center gap-1 text-[11px] ${T==="connected"?"text-[var(--accent)]":T==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${T==="connected"?"bg-[var(--accent)]":T==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),a(`tasks.${T}`)]}),e.jsx("span",{className:"text-[11px]",style:{color:we(t.status)},children:t.status.toLowerCase()}),t.currentStage&&e.jsxs("span",{className:"text-[11px] text-[var(--accent)]",children:[a("tasks.stage"),": ",t.currentStage]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",fe]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!v&&V==="auto"&&e.jsxs("button",{onClick:()=>{var s;return(s=U.current)==null?void 0:s.requestTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-10 md:h-8 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:[e.jsx(Ye,{className:"h-3 w-3"}),a("tasks.take_over")]}),!v&&V==="manual"&&e.jsxs("button",{onClick:()=>{var s;return(s=U.current)==null?void 0:s.releaseTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-10 md:h-8 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(je,{className:"h-3 w-3"}),a("tasks.restore_auto")]}),e.jsx("button",{onClick:()=>Ae(!1),className:"flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1 text-[var(--text-muted)]",children:e.jsx(Ot,{className:"h-3 w-3"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(Ze,{ref:U,taskId:x,sessionId:t.currentSessionId??void 0,taskFinished:v,onStatusChange:Pe,onTakeoverChange:Fe})}),We,be]}):t.status===D.SUSPENDED?e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[Ke,ve,e.jsx("div",{className:"flex items-center gap-2 border-b px-4 md:px-6 py-2 text-xs shrink-0",style:{backgroundColor:"rgba(245,158,11,0.08)",borderColor:"rgba(245,158,11,0.2)",color:"var(--warning)"},children:a("tasks.task_suspended_banner")}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row gap-4 md:gap-6 p-4 md:p-6 overflow-y-auto",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[e.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[e.jsxs("span",{className:"text-xl font-bold text-[var(--text-primary)]",children:["#",t.id]}),e.jsx("span",{className:"text-base text-[var(--text-secondary)] truncate max-w-[60%]",children:e.jsx($t,{content:kt(t),children:Je(t,200)})}),e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:ae})]}),e.jsx("div",{className:"flex items-center gap-2 md:hidden",children:e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:ae})}),o&&e.jsxs("div",{className:"rounded-[4px] border p-4",style:{borderColor:"rgba(245,158,11,0.27)",backgroundColor:"#1a1a1a"},children:[e.jsx("p",{className:"mb-2 text-[11px] font-bold text-[var(--accent)]",children:a("tasks.pending_confirmation")}),e.jsx("p",{className:"mb-3 text-xs text-[var(--text-secondary)]",children:o.prompt??a("tasks.pipeline_requires_confirmation")}),e.jsx("div",{className:"mb-3 flex flex-col gap-1.5 text-[11px]",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"stage"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:o.stageName})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:flex-wrap md:gap-3",children:[e.jsx("button",{onClick:async()=>{try{await g.post(`web/tasks/${x}/confirm-stage`,{json:{stageName:o.stageName,approved:!0}}),se()}catch{J.error(a("tasks.confirm_failed"))}},className:"flex-1 md:flex-none rounded-[4px] bg-[var(--accent)] px-4 py-2.5 md:py-2 text-[11px] font-bold text-[#0c0c0c]",children:a("tasks.confirm_and_proceed")}),e.jsx("button",{onClick:async()=>{try{await g.post(`web/tasks/${x}/confirm-stage`,{json:{stageName:o.stageName,approved:!1}}),se()}catch{J.error(a("tasks.confirm_failed"))}},className:"flex-1 md:flex-none rounded-[4px] bg-[#1a1a1a] px-4 py-2.5 md:py-2 text-[11px] text-[var(--destructive)]",style:{border:"1px solid rgba(239,68,68,0.27)"},children:a("tasks.reject")})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"status"}),e.jsx("span",{className:"font-bold text-[var(--warning)]",children:ae})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"created"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:ne(t.createdAt)})]})]})]}),e.jsx("div",{className:"hidden md:flex flex-wrap items-center gap-2 py-2",children:N.map((s,i)=>{const d=s.status==="failed",h=s.status==="completed",A=s.status==="running"&&t.status===D.SUSPENDED,B=d?"var(--destructive)":h?"var(--accent)":A?"var(--warning)":"#525252",re=d?"rgba(239,68,68,0.12)":h?"rgba(34,197,94,0.12)":A?"rgba(245,158,11,0.12)":"transparent";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px]",style:{color:B,backgroundColor:re,fontWeight:A?700:400,border:A?`1px solid ${B}`:void 0},children:A?"confirm":`${s.name}${h?" ✓":d?" ✗":""}`}),i<N.length-1&&e.jsx("div",{className:"h-px w-6 bg-[var(--border)]"})]},s.name)})}),e.jsxs("div",{className:"hidden md:block min-h-[200px] flex-1 rounded-[4px] border border-[var(--border)] bg-[#0c0c0c] p-4",children:[e.jsx("p",{className:"mb-2 text-[11px] font-bold text-[var(--accent)]",children:a("tasks.pty_output")}),e.jsxs("div",{className:"flex flex-col gap-1",children:[u.slice(-10).map((s,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-secondary)]",children:s},i)),u.length===0&&e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_output")})]})]})]}),e.jsxs("div",{className:"hidden w-[280px] shrink-0 flex-col gap-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:flex",children:[e.jsx("span",{className:"text-[13px] font-bold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"status"}),e.jsx("span",{className:"font-bold text-[var(--warning)]",children:ae})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:a("tasks.stage_timeline")}),e.jsx("div",{className:"flex flex-col gap-2",children:N.map(s=>{const i=s.status==="completed"?"var(--info)":s.status==="failed"?"var(--destructive)":s.status==="running"?"var(--warning)":"#525252",d=s.status==="failed"?"var(--destructive)":s.status==="running"?"var(--warning)":"#a3a3a3",h=s.status==="completed"?"completed":s.status==="running"?"suspended":s.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-[4px]",style:{backgroundColor:i}}),e.jsxs("span",{className:"text-[11px]",style:{color:d,fontWeight:s.status==="running"?700:400},children:[s.name," ",h]})]},s.name)})}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsx("div",{className:"flex flex-col gap-1.5 text-[11px]",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"created"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:ne(t.createdAt)})]})})]})]}),o&&e.jsx(tt,{isOpen:!!o,onClose:Ue,taskId:x,stageName:o.stageName,timeoutSeconds:Math.ceil(o.timeout/1e3),onSubmitted:se}),be]}):e.jsxs("div",{className:"flex h-full flex-col overflow-hidden font-mono lowercase",children:[Ke,e.jsxs("div",{className:"flex flex-wrap items-center gap-3 gap-y-1 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-2 shrink-0 md:hidden",children:[e.jsx(ke,{status:t.status,agentType:t.agentType}),y&&e.jsxs("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:["// time cost: ",y]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:t.projectKey}),t.workerName&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:t.workerName}),t.branch&&(le(p,t.branch)?e.jsx("a",{href:le(p,t.branch),target:"_blank",rel:"noopener noreferrer",className:"shrink-0 text-[11px] text-[var(--text-muted)] hover:text-[var(--info)] hover:underline truncate max-w-[80px] md:max-w-[120px] transition-colors",children:t.branch}):e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)] truncate max-w-[80px] md:max-w-[120px]",children:t.branch}))]}),ve,t.errorMessage&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-6 py-2 text-xs shrink-0 bg-[var(--destructive)]/10 text-[var(--destructive)]",style:{borderColor:"rgba(239,68,68,0.2)"},children:["// error: ",t.errorMessage]}),w&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-4 md:px-6 py-2 text-xs shrink-0 text-[var(--info)]",style:{backgroundColor:"color-mix(in srgb, var(--info) 8%, transparent)",borderColor:"color-mix(in srgb, var(--info) 20%, transparent)"},children:[e.jsx(Ft,{className:"h-3.5 w-3.5 shrink-0"}),e.jsxs("span",{children:[a("tasks.queue_position_banner",{position:String(w.position),total:String(w.total)}),w.position>1?` — ${a("tasks.queue_ahead",{count:String(w.position-1)})}`:` — ${a("tasks.queue_next")}`]})]}),o&&e.jsx(tt,{isOpen:!!o,onClose:Ue,taskId:x,stageName:o.stageName,timeoutSeconds:Math.ceil(o.timeout/1e3),onSubmitted:se}),e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"flex items-center border-b border-[var(--border)] shrink-0 overflow-x-auto no-scrollbar",children:["terminal","pipeline","logs"].map(s=>e.jsx("button",{onClick:()=>de(s),className:`shrink-0 whitespace-nowrap px-4 py-2.5 text-xs transition-colors ${k===s?"border-b-2 border-[var(--accent)] text-[var(--accent)] font-medium":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(s==="terminal"?"tasks.terminal":s==="pipeline"?"tasks.pipeline_tab":"tasks.logs")},s))}),k==="terminal"&&e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-3 md:px-5 shrink-0",style:{height:36,backgroundColor:"#111111"},children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.pty_terminal")}),e.jsxs("span",{className:`inline-flex items-center gap-1 text-[11px] ${T==="connected"?"text-[var(--accent)]":T==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${T==="connected"?"bg-[var(--accent)]":T==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),a(`tasks.${T}`)]}),e.jsx("span",{className:"text-[11px]",style:{color:we(t.status)},children:t.status.toLowerCase()}),t.currentStage&&e.jsxs("span",{className:"text-[11px] text-[var(--accent)]",children:[a("tasks.stage"),": ",t.currentStage]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",fe]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!v&&V==="auto"&&e.jsxs("button",{onClick:()=>{var s;return(s=U.current)==null?void 0:s.requestTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-10 md:h-8 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:[e.jsx(Ye,{className:"h-3 w-3"}),a("tasks.take_over")]}),!v&&V==="manual"&&e.jsxs("button",{onClick:()=>{var s;return(s=U.current)==null?void 0:s.releaseTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-10 md:h-8 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(je,{className:"h-3 w-3"}),a("tasks.restore_auto")]}),!v&&V==="requesting"&&e.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 h-10 md:h-8 text-[11px] text-[var(--warning)]",children:[e.jsx(Ne,{className:"h-3 w-3 animate-spin"}),a("tasks.requesting_takeover")]}),!v&&t.currentStage&&e.jsxs("button",{className:"hidden md:flex items-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-2.5 h-10 md:h-8 text-[11px] text-[var(--text-muted)]",children:[e.jsx(qt,{className:"h-3 w-3"}),a("tasks.skip_stage")]}),e.jsx("button",{onClick:()=>Ae(!0),className:"hidden md:flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 h-10 md:h-8 text-[var(--text-muted)]",children:e.jsx(Mt,{className:"h-3 w-3"})})]})]}),e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-4 py-2 shrink-0 md:hidden",children:[e.jsx(ke,{status:t.status,agentType:t.agentType}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",fe]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.stage_progress")}),e.jsx("div",{className:"mt-2 overflow-x-auto no-scrollbar pr-4",style:{borderRadius:0},children:e.jsx("div",{className:"flex items-center gap-1 py-0.5",children:N.map((s,i)=>{const d=s.status==="completed",h=s.status==="running",B=s.status==="failed"?"var(--destructive)":d||h?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",children:[e.jsxs("span",{className:"shrink-0 text-[11px] leading-normal whitespace-nowrap",style:{color:B,fontWeight:h?600:400},children:[s.name,d?" ✓":h?" ...":""]}),i<N.length-1&&e.jsx("div",{className:"mx-1.5 h-px w-4 shrink-0",style:{backgroundColor:B}})]},s.name)})})})]}),e.jsx("div",{className:"px-4 pt-3 pb-1 shrink-0 md:hidden",children:e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.pty_output")})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(Ze,{ref:U,taskId:x,sessionId:t.currentSessionId??void 0,taskFinished:v,onStatusChange:Pe,onTakeoverChange:Fe})}),We]}),k==="pipeline"&&e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsx("div",{className:"mb-4 md:mb-5 overflow-x-auto no-scrollbar",style:{borderRadius:0},children:e.jsx("div",{className:"flex items-center py-5",children:N.map((s,i)=>{const d=s.status==="completed",h=s.status==="running",re=s.status==="failed"?"var(--destructive)":d||h?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",style:{flex:i<N.length-1?1:void 0},children:[e.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[e.jsxs("div",{className:"flex h-6 w-6 md:h-7 md:w-7 items-center justify-center rounded-full shrink-0",style:{backgroundColor:re},children:[d&&e.jsx("span",{className:"text-[11px] md:text-xs font-semibold text-[#0c0c0c]",children:"✓"}),h&&e.jsx("span",{className:"h-2 w-2 md:h-2.5 md:w-2.5 rounded-full bg-[#0c0c0c]"})]}),e.jsx("span",{className:"text-[11px] leading-normal font-medium whitespace-nowrap",style:{color:re},children:s.name})]}),i<N.length-1&&e.jsx("div",{className:"mx-1 md:mx-2 h-0.5 flex-1 min-w-3 rounded-full",style:{backgroundColor:i<(he>=0?he:0)?"var(--accent)":"#525252"}})]},s.name)})})}),t.currentStage&&e.jsxs("div",{className:"mb-4 md:mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 text-xs leading-relaxed",children:[e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// stage: ",t.currentStage," (",he+1,"/",N.length,")"]}),t.startedAt&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// elapsed: ",ne(t.startedAt).replace(" ago","")]}),y&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// time cost: ",y]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// retries: ",t.retryCount,"/2"]})]}),!t.currentStage&&y&&e.jsx("div",{className:"mb-4 md:mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 text-xs leading-relaxed",children:e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// time cost: ",y]})}),e.jsx("button",{onClick:()=>de("terminal"),className:"flex-1 min-h-[100px] rounded-[4px] border border-dashed border-[var(--border)] flex items-center justify-center gap-2 text-[11px] text-[var(--text-muted)] hover:border-[var(--accent)] hover:text-[var(--accent)] transition-colors",children:e.jsxs("span",{children:["// ",a("tasks.view_terminal")]})}),e.jsxs("div",{className:"mt-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"mt-2 flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"branch"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.branch??"-"})]}),Be]})]}),e.jsxs("div",{className:"flex flex-col gap-6 mt-4 lg:hidden",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.pipeline_stages")}),N.map(s=>{const i=s.status==="completed",d=s.status==="running",h=s.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 py-2 ${d?"bg-[var(--bg-input)]":""}`,children:[i&&e.jsx(Qe,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),d&&e.jsx(Ne,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),h&&e.jsx(ge,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),s.status==="pending"&&e.jsx(et,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs leading-normal",style:{color:i?"var(--accent)":d?"var(--text-primary)":h?"var(--destructive)":"#525252",fontWeight:d?500:400},children:d?`> ${s.name}`:s.name})]},s.name)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.activity_log")}),u.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:u.slice(-12).map((s,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:s},i))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]})]}),k==="logs"&&e.jsxs("div",{className:"flex flex-1 flex-col gap-3 md:gap-5 overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)] md:hidden",children:a("tasks.task_logs")}),e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:gap-3",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar md:hidden",children:["","error","system"].map(s=>e.jsx("button",{onClick:()=>{Re(s),O(0)},className:`shrink-0 rounded-[4px] px-2.5 py-1 text-[11px] ${H===s?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)]"}`,children:s||"all"},s))}),e.jsx("div",{className:"hidden md:block",children:e.jsx(It,{value:H,onChange:s=>{Re(s),O(0)},options:[{value:"",label:"all"},{value:"stage_change",label:"stage_change"},{value:"info",label:"info"},{value:"warning",label:"warning"},{value:"error",label:"error"},{value:"system",label:"system"}],className:"w-36"})}),e.jsxs("div",{className:"flex flex-1 items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:[e.jsx(wt,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("tasks.search_logs"),value:ee,onChange:s=>{lt(s.target.value),O(0)},className:"flex-1 bg-transparent text-xs text-[var(--text-primary)] outline-none placeholder:text-[var(--text-muted)]"})]})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[De.map((s,i)=>e.jsxs("div",{className:`flex items-start md:items-center gap-2 md:gap-4 rounded-[4px] px-2 md:px-3 py-2 text-[11px] md:text-xs ${i%2===0?"bg-[var(--bg-card)]":""}`,children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:new Date(s.timestamp).toLocaleTimeString("en-US",{hour12:!1})}),e.jsx("span",{className:`shrink-0 font-medium ${Wt(s.type)}`,children:s.type}),e.jsx("span",{className:"min-w-0 break-words md:truncate text-[var(--text-primary)]",children:s.message})]},s.id)),De.length===0&&!ct&&e.jsx("p",{className:"py-8 text-center text-xs text-[var(--text-muted)]",children:a("tasks.no_log_entries")})]}),Z>50&&e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[Array.from({length:Math.ceil(Z/50)}).slice(0,5).map((s,i)=>e.jsx("button",{onClick:()=>O(i),className:`rounded-[4px] px-2 py-1 text-xs ${X===i?"bg-[var(--accent)] text-black font-medium":"text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:i+1},i)),Math.ceil(Z/50)>5&&e.jsx("button",{onClick:()=>O(X+1),disabled:X>=Math.ceil(Z/50)-1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] disabled:opacity-30",children:">"})]})]})]}),k==="terminal"&&pt,k==="pipeline"&&e.jsxs("div",{className:"hidden w-[420px] shrink-0 flex-col gap-5 overflow-y-auto border-l border-[var(--border)] bg-[var(--bg-primary)] p-5 lg:flex",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"creator"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.creatorName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:a("common.created_at")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:ne(t.createdAt)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:ze})]}),y&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"time cost"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:y})]}),Be]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.workspace_section")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs",children:[e.jsxs("div",{className:"flex min-w-0 justify-between",children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:"branch"}),e.jsx("span",{className:"ml-4 min-w-0 truncate text-[var(--text-primary)]",children:t.branch??(q==null?void 0:q.branch)??"-"})]}),e.jsxs("div",{className:"flex min-w-0 justify-between",children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:"worktree"}),e.jsx("span",{className:"ml-4 min-w-0 truncate text-[var(--text-primary)]",children:(q==null?void 0:q.path)??"-"})]}),t.mrUrl&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:a("tasks.mr_link")}),e.jsx("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-[var(--info)] hover:underline",children:((He=t.mrUrl.match(/!?\d+$/))==null?void 0:He[0])??"view"})]})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{ref:Me,className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.cursor_tunnel_section")}),t.workerId?e.jsx(Gt,{taskId:x,taskFinished:v,compact:!0}):e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.no_worker_assigned")})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.stage_timeline")}),e.jsx("div",{className:"flex flex-col gap-2 text-xs",children:N.map(s=>{const i=s.status==="completed"?"✓":s.status==="running"?"→":"·",d=s.status==="running"?"var(--accent)":s.status==="completed"?"var(--info)":s.status==="failed"?"var(--destructive)":"#525252",h=s.status==="completed"?"done":s.status==="running"?"running...":s.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-semibold",style:{color:d},children:i}),e.jsx("span",{className:s.status==="running"?"font-medium":"",style:{color:d},children:s.name}),e.jsxs("span",{className:"text-[11px]",style:{color:"#525252"},children:["— ",h]})]},s.name)})})]})]})]}),be]})}export{ls as default};
@@ -1 +0,0 @@
1
- import{R as pe,f as $,a as O,p as m,j as e,l as X,n as me,u as ue,i as be,r,h as E,X as ve,k as he,w as fe,H as ge,t as Q,x as ye,y as U,m as je}from"./index-D3ZK8e35.js";import{a as ke,A as Ne,u as W}from"./task-constants-eOji5WUw.js";import{T as Z}from"./TaskStatusBadge-B49xL6ug.js";import{f as ee}from"./date-RFA7-ZGs.js";import{T as Ce}from"./Tooltip-DrIj1IXL.js";import{G as te}from"./git-fork-DxuKN6TL.js";import{S as P}from"./Select-CkMgU0Lq.js";import{C as we}from"./copy-BckVr8cJ.js";import{E as Y}from"./EmptyState-9Eqw0iR8.js";import{T as V}from"./Skeleton-DI-HCY-N.js";import{P as Se}from"./plus-DfeF35ew.js";import{C as _e}from"./chevron-left-6cPJJmnY.js";import{C as Te}from"./chevron-right-DxtB9dXk.js";import"./status-colors-BgploKhY.js";const Ee=pe.memo(function({task:s}){const d=$(),{t:c}=O(),x=(a,v)=>c(`common.${a}`,{n:v}),i=s.status===m.COMPLETED||s.status===m.FAILED||s.status===m.CANCELLED;return e.jsxs("tr",{onClick:()=>d(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] transition-colors hover:bg-[var(--bg-input)]",children:[e.jsxs("td",{className:"w-16 py-3 pr-4 font-mono text-xs font-medium text-[var(--text-secondary)] text-right tabular-nums",children:["#",s.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:e.jsx(Ce,{content:me(s),children:X(s)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(Z,{status:s.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.developerName??s.creatorName??"-"}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.workerName??"—"}),e.jsx("td",{className:"py-3 font-mono text-xs text-[var(--text-muted)]",children:e.jsxs("span",{className:"flex items-center gap-2",children:[ee(s.createdAt,x),i&&e.jsx("button",{onClick:a=>{a.stopPropagation(),d(`/tasks/${s.id}?action=fork`)},className:"shrink-0 rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] hover:bg-[var(--bg-input)] transition-colors",title:c("tasks.fork_task"),children:e.jsx(te,{className:"h-3 w-3"})})]})})]})});function Pe({isOpen:n,onClose:s,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:a}=O();ue(o=>o.user);const v=be(),[u,A]=r.useState(""),[b,I]=r.useState(""),[p,D]=r.useState("feat"),[k,C]=r.useState(""),[w,S]=r.useState(""),[y,_]=r.useState(""),[h,j]=r.useState(""),[L,R]=r.useState([]),[F,N]=r.useState("");r.useEffect(()=>{if(!n||(A(""),I(""),D("feat"),C(""),S(""),_(""),j(""),N(""),!v))return;const o=new AbortController;return E.get("admin/developers",{signal:o.signal}).json().then(R).catch(()=>{}),()=>o.abort()},[n,v]),r.useEffect(()=>{if(!n)return;function o(f){f.key==="Escape"&&s()}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n,s]);async function z(o){if(o.preventDefault(),N(""),!u||!b.trim()){N(a("tasks.project_and_description_required"));return}try{await x({projectKey:u,description:b.trim(),workerId:y||void 0,developerId:h?Number(h):void 0,taskType:p,branchSlug:w.trim()||void 0,agentType:k||void 0})}catch(f){const B=f instanceof Error?f.message:a("tasks.failed_to_create_task");N(B)}}return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&s()},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-4",children:[e.jsxs("h2",{className:"text-sm text-[var(--text-primary)]",children:["// ",a("tasks.new_task")]}),e.jsx("button",{onClick:s,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(ve,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:z,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.project")}),e.jsx(P,{value:u,onChange:A,options:d.map(o=>({value:o.key,label:o.name})),placeholder:a(c?"common.loading":"tasks.select_project"),disabled:c})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_type")}),e.jsx(P,{value:p,onChange:D,options:ke})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx(P,{value:k,onChange:C,options:Ne})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_description")}),e.jsx("textarea",{value:b,onChange:o=>I(o.target.value),placeholder:a("tasks.describe_task_placeholder"),rows:4,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_worker")}),e.jsx("input",{type:"text",value:y,onChange:o=>_(o.target.value),placeholder:a("tasks.any_able"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.branch_slug")}),e.jsx("input",{type:"text",value:w,onChange:o=>S(o.target.value),placeholder:a("tasks.branch_slug_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),v&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.assign_developer")}),e.jsx(P,{value:h,onChange:j,options:L.map(o=>({value:String(o.id),label:o.name})),placeholder:a("tasks.select_developer")})]}),F&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:F})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:s,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:i||!u||!b.trim(),className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs text-black transition-opacity hover:opacity-90 disabled:opacity-40",children:a(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function De({isOpen:n,onClose:s,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:a}=O();return!x||!n?null:e.jsx("div",{onClick:s,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:v=>v.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(we,{style:{width:"1rem",height:"1rem"}}),a("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:a("tasks.dedup_description")})]}),e.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px",backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"'JetBrains Mono', monospace"},children:["#",x.id," · ",x.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:x.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:s,disabled:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1,transition:"color 0.15s, border-color 0.15s"},children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>c(x.id),style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:a("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:d,disabled:i,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--warning)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1},children:a(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function Fe({task:n}){const s=$(),d=n.status===m.COMPLETED||n.status===m.FAILED||n.status===m.CANCELLED;return e.jsxs("div",{onClick:()=>s(`/tasks/${n.id}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight line-clamp-2",title:je(n),children:["#",n.id," ",X(n)]}),e.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[d&&e.jsx("button",{onClick:c=>{c.stopPropagation(),s(`/tasks/${n.id}?action=fork`)},className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:e.jsx(te,{className:"h-3 w-3"})}),e.jsx(Z,{status:n.status})]})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:ee(n.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:n.workerName})]})]})]})}const Ae=[{key:"all",labelKey:"tasks.tab_all"},{key:m.RUNNING,labelKey:"tasks.tab_running"},{key:m.QUEUED,labelKey:"tasks.tab_queued"},{key:m.COMPLETED,labelKey:"tasks.tab_completed"},{key:m.FAILED,labelKey:"tasks.tab_failed"},{key:m.CANCELLED,labelKey:"tasks.tab_cancelled"}],Ie=20;function We(){const n=$(),{t:s}=O(),{tasks:d,loading:c,fetchTasks:x}=W(),i=he(t=>t.taskSeq),[a,v]=r.useState("all"),[u,A]=r.useState(""),[b,I]=r.useState(""),[p,D]=r.useState(""),[k,C]=r.useState(void 0),[w,S]=r.useState([]),y=W(t=>t.nextCursor),[_,h]=r.useState(!1);fe(r.useMemo(()=>e.jsxs("button",{onClick:()=>h(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(Se,{className:"h-3.5 w-3.5"}),s("tasks.new_task")]}),[s]));const[j,L]=r.useState([]),[R,F]=r.useState(!1),[N,z]=r.useState([]),[o,f]=r.useState(!1),[B,K]=r.useState(!1),[se,re]=r.useState(null),[q,M]=r.useState(null),G=r.useCallback(t=>{const l={limit:String(Ie)};return a!=="all"&&(l.status=a),u&&(l.projectKey=u),b&&(l.developerId=b),t&&(l.cursor=t),l},[a,u,b]);r.useEffect(()=>{x(G(k))},[G,k,x,i]),r.useEffect(()=>{C(void 0),S([])},[a,u,b]),r.useEffect(()=>{let t=!1;return(async()=>{try{const[g,xe]=await Promise.all([E.get("web/projects").json(),E.get("web/projects/-/developers").json()]);if(t)return;L(g),z(xe)}catch{}})(),()=>{t=!0}},[]),r.useEffect(()=>{if(!_||j.length>0)return;F(!0);let t=!1;return(async()=>{try{const g=await E.get("web/projects").json();t||L(g)}catch{}finally{t||F(!1)}})(),()=>{t=!0}},[_,j.length]);const ae=r.useCallback(async t=>{f(!0);try{const l=await E.post("web/tasks",{json:{projectKey:t.projectKey,description:t.description,workerId:t.workerId,developerId:t.developerId,taskType:t.taskType,branchSlug:t.branchSlug,agentType:t.agentType}}).json();h(!1),n(`/tasks/${l.task.id}`)}catch(l){if(l instanceof ge&&l.response.status===409){try{const g=await l.response.json();if(g.confirmRequired){re({id:g.confirmRequired.taskId,description:g.confirmRequired.message,status:"active"}),M(t),h(!1),K(!0);return}}catch{}Q.error(s("tasks.similar_task_exists"))}else{const g=l instanceof Error?l.message:String(l);Q.error(g)}}finally{f(!1)}},[n]),oe=r.useCallback(async()=>{if(q){f(!0);try{const t=await E.post("web/tasks",{json:{...q,force:!0}}).json();K(!1),M(null),n(`/tasks/${t.task.id}`)}finally{f(!1)}}},[q,n]),T=r.useMemo(()=>{if(!p.trim())return d;const t=p.toLowerCase();return d.filter(l=>(l.name??"").toLowerCase().includes(t)||l.description.toLowerCase().includes(t)||String(l.id).includes(p))},[d,p]),ne=r.useCallback(()=>{y&&(S(t=>[...t,k??""]),C(y))},[y,k]),le=r.useCallback(()=>{S(t=>{if(t.length===0)return t;const l=t.slice(0,-1);return C(t.at(-1)||void 0),l})},[]),ce=w.length+1,ie=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...j.map(t=>({value:t.key,label:t.name}))],[j,s]),de=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...N.map(t=>({value:String(t.id),label:t.name}))],[N,s]),H=s(p?"tasks.try_adjusting_search":"tasks.create_first_task"),J=p?void 0:e.jsx("button",{onClick:()=>h(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:s("tasks.create_task")});return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar pr-4 md:pr-0",children:Ae.map(t=>e.jsx("button",{onClick:()=>v(t.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${a===t.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:s(t.labelKey)},t.key))}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsxs("div",{className:"relative md:w-52",children:[e.jsx(ye,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:s("tasks.search_tasks"),value:p,onChange:t=>D(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),p&&e.jsx("button",{onClick:()=>D(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:"x"})]}),e.jsx(P,{value:u,onChange:A,options:ie,className:"md:w-40"}),e.jsx(P,{value:b,onChange:I,options:de,className:"md:w-40"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:s("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.time")})]})}),e.jsxs("tbody",{children:[c&&T.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(V,{rows:5})})}),!c&&T.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Y,{icon:U,title:s("tasks.no_tasks_found"),description:H,action:J})})}),T.map(t=>e.jsx(Ee,{task:t},t.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[c&&T.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(V,{rows:5})}),!c&&T.length===0&&e.jsx(Y,{icon:U,title:s("tasks.no_tasks_found"),description:H,action:J}),T.map(t=>e.jsx(Fe,{task:t},t.id))]}),(w.length>0||y)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",ce]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:le,disabled:w.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(_e,{className:"h-3.5 w-3.5"}),s("tasks.prev")]}),e.jsxs("button",{onClick:ne,disabled:!y,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[s("common.next"),e.jsx(Te,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(Pe,{isOpen:_,onClose:()=>h(!1),projects:j,projectsLoading:R,onSubmit:ae,isSubmitting:o}),e.jsx(De,{isOpen:B,onClose:()=>{K(!1),M(null)},onForceCreate:oe,onViewExisting:t=>{K(!1),M(null),n(`/tasks/${t}`)},similarTask:se,isLoading:o})]})}export{We as default};
@@ -1,11 +0,0 @@
1
- import{c as Z,o as le,h as M,p as y,a as P,r as c,k as q,q as oe,s as de,j as e,X as ee,v as xe,f as me,l as ue,m as pe}from"./index-D3ZK8e35.js";import{g as te,P as he,H as fe,C as ve}from"./PtyTerminal-C9Bp0uS_.js";import{T as H,u as ge,a as z,C as G,g as be}from"./task-constants-eOji5WUw.js";import{i as J,O as se}from"./OnboardingGuide-C1-sQUW7.js";import{S as C,C as je}from"./Select-CkMgU0Lq.js";import{a as ae}from"./status-colors-BgploKhY.js";import{a as ke}from"./date-RFA7-ZGs.js";import{u as ne}from"./useFetch-CSoNR_l8.js";import{P as L}from"./plus-DfeF35ew.js";import{R as Ne}from"./rotate-ccw-DnJi9esb.js";import{W as ye}from"./wifi-D9JcPn5X.js";import"./chevron-right-DxtB9dXk.js";/**
2
- * @license lucide-react v0.469.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Te=Z("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
7
- * @license lucide-react v0.469.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const we=Z("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),re="overlord_home_terminal";function Se(){try{const t=localStorage.getItem(re);if(t)return JSON.parse(t)}catch{}return{pinnedTaskIds:[],activeTaskId:null}}let Y="";function U(t){const a=JSON.stringify(t);a!==Y&&(Y=a,localStorage.setItem(re,a))}const Q=Se(),Ce=new Set([y.QUEUED,y.ASSIGNED,y.RUNNING,y.SUSPENDED]);let $=!1;const _e=le((t,a)=>({pinnedTaskIds:Q.pinnedTaskIds,activeTaskId:Q.activeTaskId,taskMetas:{},stageConfirm:null,loading:!1,setActiveTask:s=>{t({activeTaskId:s}),U({pinnedTaskIds:a().pinnedTaskIds,activeTaskId:s})},pinTask:s=>{const{pinnedTaskIds:n}=a();if(n.includes(s))return;const l=[...n,s];t({pinnedTaskIds:l}),U({pinnedTaskIds:l,activeTaskId:a().activeTaskId})},unpinTask:s=>{const{pinnedTaskIds:n,activeTaskId:l,taskMetas:x}=a(),r=n.filter(h=>h!==s),o=l===s?r[0]??null:l,{[s]:p,...i}=x;t({pinnedTaskIds:r,activeTaskId:o,taskMetas:i}),U({pinnedTaskIds:r,activeTaskId:o})},loadActiveTasks:async()=>{if(!$){$=!0,t({loading:!0});try{const n=(await M.get("web/tasks",{searchParams:{limit:"30"}}).json()).data.filter(i=>Ce.has(i.status)),l={};for(const i of n)l[i.id]={id:i.id,name:i.name,description:i.description,status:i.status,projectKey:i.projectKey,workerName:i.workerName??null,agentType:te(i),currentStage:i.currentStage,currentSessionId:i.currentSessionId,updatedAt:i.updatedAt};const r=[...n].sort((i,h)=>h.updatedAt.localeCompare(i.updatedAt)).map(i=>i.id),{activeTaskId:o}=a(),p=o&&r.includes(o)?o:r[0]??null;t({taskMetas:l,pinnedTaskIds:r,activeTaskId:p}),U({pinnedTaskIds:r,activeTaskId:p})}catch{}finally{$=!1,t({loading:!1})}}},fetchStageConfirm:async s=>{try{const n=await M.get(`web/tasks/${s}/pending-confirm`).json();t({stageConfirm:n.confirm})}catch{t({stageConfirm:null})}},clearStageConfirm:()=>t({stageConfirm:null}),updateTaskMeta:(s,n)=>{const{taskMetas:l}=a(),x=l[s];x&&t({taskMetas:{...l,[s]:{...x,...n}}})}}));function Ie(){const[t,a]=c.useState(()=>J());c.useEffect(()=>{const n=()=>a(!0),l=()=>a(J());return window.addEventListener("onboarding-dismissed",n),window.addEventListener("storage",l),()=>{window.removeEventListener("onboarding-dismissed",n),window.removeEventListener("storage",l)}},[]);const{data:s}=ne(()=>t?Promise.resolve(null):M.get("web/dashboard/stats").json(),[t]);return t||!s?null:{activeTasks:(s.active_tasks??0)+(s.queued_tasks??0),totalWorkers:s.online_workers??0,totalProjects:s.project_count??0,totalDevelopers:s.developer_count??0}}function Ee({taskId:t,confirm:a,onSubmitted:s}){const{t:n}=P(),[l,x]=c.useState(a.timeout),[r,o]=c.useState(!1);c.useEffect(()=>{x(a.timeout);const i=setInterval(()=>{x(h=>h<=1?(clearInterval(i),0):h-1)},1e3);return()=>clearInterval(i)},[a.timeout,a.stageName]);const p=c.useCallback(async i=>{o(!0);try{await M.post(`web/tasks/${t}/confirm-stage`,{json:{stageName:a.stageName,approved:i}}),s()}catch{}finally{o(!1)}},[t,a.stageName,s]);return e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b-2 border-[var(--warning)] bg-[var(--warning)]/10 px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ve,{className:"h-3.5 w-3.5 shrink-0 text-[var(--warning)]"}),e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["// stage: ",a.stageName]}),e.jsx("span",{className:"shrink-0 text-xs text-[var(--warning)]",children:ke(l)})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("button",{onClick:()=>p(!1),disabled:r,className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:n("tasks.reject")}),e.jsx("button",{onClick:()=>p(!0),disabled:r,className:"rounded-[4px] bg-[var(--accent)] px-2 py-1 text-[11px] text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:n(r?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})]})}function Ae({projectKey:t,onProjectChange:a,onCreated:s}){const{t:n}=P(),l=ge(u=>u.createTask),[x,r]=c.useState(""),[o,p]=c.useState("feat"),[i,h]=c.useState(void 0),[f,_]=c.useState(!1),[I,E]=c.useState(!1),[F,D]=c.useState(!1),{data:T}=ne(()=>M.get("web/projects").json(),[]),v=c.useMemo(()=>{const u=(T??[]).map(R=>({value:R.key,label:R.key}));return[{value:"",label:n("terminal_home.all_projects")},...u]},[T,n]),g=c.useMemo(()=>(T??[]).find(u=>u.key===t)??null,[T,t]),b=c.useRef(!1);c.useEffect(()=>{if(!b.current){if(t){b.current=!0;return}v.length>1&&(a(v[1].value),b.current=!0)}},[t,v,a]),c.useEffect(()=>{h(void 0)},[t]);const A=i??(g==null?void 0:g.agentType)??"",m=c.useCallback(u=>{if(!g||u===g.agentType){h(void 0);return}h(u)},[g]),w=!!t&&!!x.trim();function N(){w&&E(!0)}async function k(){if(E(!1),!!w){_(!0);try{const u=await l({projectKey:t,description:x.trim(),taskType:o,agentType:i||void 0});r(""),s(u.id)}catch{}finally{_(!1)}}}const S=n("terminal_home.confirm_create_message").replace("{taskType}",o).replace("{projectKey}",t).replace("{description}",x.trim()),O="flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex items-center gap-2 border-b border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:[e.jsx("div",{className:"w-[140px]",children:e.jsx(C,{value:t,onChange:a,options:v,placeholder:n("terminal_home.select_project")})}),e.jsx("div",{className:"w-[100px]",children:e.jsx(C,{value:o,onChange:p,options:z})}),e.jsx("div",{className:"w-[120px]",children:e.jsx(C,{value:A,onChange:m,options:G,placeholder:n("tasks.form_agent_type"),disabled:f||!t})}),e.jsx("input",{type:"text",value:x,onChange:u=>r(u.target.value),onKeyDown:u=>u.key==="Enter"&&N(),placeholder:n("terminal_home.task_description_placeholder"),className:O,disabled:f}),e.jsxs("button",{onClick:N,disabled:f||!w,className:"flex items-center gap-1 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:[e.jsx(L,{className:"h-3 w-3"}),n(f?"common.creating":"terminal_home.new_task")]})]}),e.jsx("div",{className:"md:hidden border-b border-[var(--border)] bg-[var(--bg-card)]",children:F?e.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(C,{value:t,onChange:a,options:v,placeholder:n("terminal_home.select_project")})}),e.jsx("div",{className:"w-[100px]",children:e.jsx(C,{value:o,onChange:p,options:z})}),e.jsx("div",{className:"w-[120px]",children:e.jsx(C,{value:A,onChange:m,options:G,placeholder:n("tasks.form_agent_type"),disabled:f||!t})}),e.jsx("button",{onClick:()=>D(!1),className:"p-1 text-[var(--text-muted)]",children:e.jsx(ee,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:x,onChange:u=>r(u.target.value),onKeyDown:u=>u.key==="Enter"&&N(),placeholder:n("terminal_home.task_description_placeholder"),className:O,disabled:f}),e.jsx("button",{onClick:N,disabled:f||!w,className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:e.jsx(L,{className:"h-3 w-3"})})]})]}):e.jsxs("button",{onClick:()=>D(!0),className:"flex w-full items-center justify-center gap-1 py-2 text-xs text-[var(--accent)] hover:opacity-80",children:[e.jsx(L,{className:"h-3.5 w-3.5"}),n("terminal_home.new_task")]})}),e.jsx(xe,{isOpen:I,onClose:()=>E(!1),onConfirm:k,title:n("terminal_home.confirm_create_title"),message:S,confirmVariant:"accent",confirmLabel:n("terminal_home.new_task"),isLoading:f})]})}function V({status:t,size:a}){const s=t===y.SUSPENDED,n=ae(t),l=a==="sm"?"h-1.5 w-1.5":"h-2 w-2";return e.jsx("span",{className:`${l} shrink-0 rounded-full ${s?"animate-pulse":""}`,style:{backgroundColor:s?"var(--warning)":n}})}function Me({tasks:t,activeId:a,onSelect:s,onUnpin:n,children:l}){const x=me();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex flex-col border-r border-[var(--border)] bg-[var(--bg-card)] overflow-y-auto",style:{width:200,minWidth:200},children:[e.jsx("div",{className:"border-b border-[var(--border)] px-3 py-2",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"// active tasks"})}),t.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"no active tasks"})}):e.jsx("div",{className:"flex-1",children:t.map(r=>{const o=r.id===a;return e.jsxs("div",{onClick:()=>s(r.id),className:`group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${o?"bg-[var(--accent)]/10 text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.jsx(V,{status:r.status,size:"md"}),e.jsxs("div",{className:"flex-1 min-w-0",title:pe(r),children:[e.jsxs("div",{className:"truncate text-xs",children:["#",r.id," ",ue(r)]}),e.jsx("div",{className:"text-[10px] text-[var(--text-muted)]",children:r.projectKey})]}),e.jsx("button",{onClick:p=>{p.stopPropagation(),n(r.id)},className:"hidden group-hover:flex items-center justify-center shrink-0 w-5 h-5 text-[var(--text-muted)] hover:text-[var(--text-primary)]",title:"unpin",children:e.jsx(ee,{className:"h-3 w-3"})}),e.jsx("button",{onClick:p=>{p.stopPropagation(),x(`/tasks/${r.id}`)},className:"hidden group-hover:flex items-center justify-center shrink-0 w-5 h-5 text-[var(--text-muted)] hover:text-[var(--accent)]",title:"open detail",children:e.jsx("span",{className:"text-[10px] leading-none",children:"→"})})]},r.id)})})]}),e.jsxs("div",{className:"flex flex-col md:hidden",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar border-b border-[var(--border)] bg-[var(--bg-card)] px-2",style:{height:44},children:t.length===0?e.jsx("div",{className:"flex items-center justify-center w-full",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"no active tasks"})}):t.map(r=>{const o=r.id===a;return e.jsxs("button",{onClick:()=>s(r.id),className:`flex shrink-0 items-center gap-1.5 px-3 border-b-2 transition-colors ${o?"border-[var(--accent)] text-[var(--text-primary)]":"border-transparent text-[var(--text-secondary)]"}`,style:{height:44},children:[e.jsx(V,{status:r.status,size:"sm"}),e.jsxs("span",{className:"text-[11px] whitespace-nowrap",children:["#",r.id]})]},r.id)})}),l]})]})}function Pe({task:t,takeoverState:a,onTakeover:s,onRelease:n}){const l=ae(t.status),x=be(t.agentType),r=a==="manual",o=te(t);return e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-3",style:{height:36,minHeight:36},children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:t.projectKey}),e.jsxs("span",{className:"text-[11px]",style:{color:l},children:[t.status.toLowerCase()," / ",x]}),t.currentStage&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["// ",t.currentStage]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",o]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsx("div",{className:"flex items-center gap-1",children:!H.includes(t.status)&&(r?e.jsxs("button",{onClick:n,className:"flex items-center gap-1.5 rounded-[4px] px-2.5 py-0.5 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(Ne,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden md:inline",children:"restore auto"})]}):e.jsxs("button",{onClick:s,disabled:a==="requesting",className:"flex items-center gap-1.5 rounded-[4px] px-2.5 py-0.5 text-[11px] font-medium text-[var(--warning)] disabled:opacity-50",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:[e.jsx(fe,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden md:inline",children:"take over"})]}))})]})}function De({task:t,ptyStatus:a}){const s=a==="connected";return e.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] bg-[var(--bg-card)] px-3",style:{height:28,minHeight:28},children:[e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:t.currentStage?`stage: ${t.currentStage}`:`task #${t.id}`}),e.jsxs("span",{className:`flex items-center gap-1 text-[10px] ${s?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:[s?e.jsx(ye,{className:"h-2.5 w-2.5"}):e.jsx(we,{className:"h-2.5 w-2.5"}),s?"connected":a]})]})}function K({onboardingData:t}){const[a,s]=c.useState(!1),{t:n}=P();return t?a?e.jsxs("div",{className:"border-b border-[var(--accent)]/30",children:[e.jsxs("button",{onClick:()=>s(!1),className:"flex w-full items-center justify-between bg-[var(--bg-card)] px-3 py-1.5 transition-colors hover:bg-[var(--bg-input)]",children:[e.jsx("span",{className:"text-[11px] text-[var(--accent)]",children:n("onboarding.getting_started")}),e.jsx(Te,{className:"h-3 w-3 text-[var(--text-muted)]"})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx(se,{data:t})})]}):e.jsxs("button",{onClick:()=>s(!0),className:"flex w-full items-center justify-between border-b border-[var(--accent)]/30 bg-[var(--bg-card)] px-3 py-1.5 transition-colors hover:bg-[var(--bg-input)]",style:{height:36},children:[e.jsx("span",{className:"text-[11px] text-[var(--accent)]",children:n("onboarding.getting_started")}),e.jsx(je,{className:"h-3 w-3 text-[var(--text-muted)]"})]}):null}function X({onboardingData:t}){const{t:a}=P();return e.jsx("div",{className:`flex flex-1 flex-col items-center p-4 md:p-6 ${t?"overflow-auto":"justify-center"}`,children:t?e.jsx("div",{className:"w-full max-w-lg",children:e.jsx(se,{data:t})}):e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"mb-3 text-3xl text-[var(--border)]",children:[">","_"]}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("terminal_home.no_active_tasks")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("terminal_home.create_task_hint")})]})})}function Je(){const{t}=P(),{pinnedTaskIds:a,activeTaskId:s,taskMetas:n,stageConfirm:l,loading:x,setActiveTask:r,pinTask:o,unpinTask:p,loadActiveTasks:i,fetchStageConfirm:h,clearStageConfirm:f,updateTaskMeta:_}=_e(),I=c.useRef(null),[E,F]=c.useState("disconnected"),[D,T]=c.useState("auto"),[v,g]=c.useState(""),b=q(d=>d.lastEvent),A=q(d=>d.status),m=s?n[s]??null:null,w=m?H.includes(m.status):!1,N=c.useRef(!1);c.useEffect(()=>{!N.current&&m&&(g(m.projectKey),N.current=!0)},[m]);const k=c.useMemo(()=>{const d=a.map(j=>n[j]).filter(Boolean);return v?d.filter(j=>j.projectKey===v):d},[a,n,v]);c.useEffect(()=>{k.length>0&&s&&!k.some(d=>d.id===s)&&r(k[0].id)},[k,s,r]);const S=Ie();oe(m?de(m):null),c.useEffect(()=>{i()},[i]),c.useEffect(()=>{s&&(m==null?void 0:m.status)===y.SUSPENDED?h(s):f()},[s,m==null?void 0:m.status,h,f]),c.useEffect(()=>{if(b){if(b.event==="task_status_changed"){const{taskId:d,status:j,currentStage:B}=b,W={status:j,updatedAt:new Date().toISOString()};B!==void 0&&(W.currentStage=B),_(d,W),j===y.SUSPENDED&&d===s&&h(d),H.includes(j)&&d===s&&f()}b.event==="task_created"&&i()}},[b,s,h,f,_,i]),c.useEffect(()=>{if(A==="connected")return;const j=setInterval(()=>{document.visibilityState!=="hidden"&&i()},15e3);return()=>clearInterval(j)},[A,i]);const O=c.useCallback(d=>{o(d),r(d),i()},[o,r,i]),u=c.useCallback(()=>{f(),i()},[f,i]),R=c.useCallback(()=>{var d;(d=I.current)==null||d.requestTakeover()},[]),ie=c.useCallback(()=>{var d;(d=I.current)==null||d.releaseTakeover()},[]);if(x&&a.length===0)return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t("common.loading")})});const ce=k.length>0;return e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsx(Ae,{projectKey:v,onProjectChange:g,onCreated:O}),e.jsx("div",{className:"flex flex-col md:flex-row flex-1 overflow-hidden",children:ce?e.jsxs(e.Fragment,{children:[e.jsx(Me,{tasks:k,activeId:s,onSelect:r,onUnpin:p,children:e.jsx("div",{className:"md:hidden",children:e.jsx(K,{onboardingData:S})})}),e.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:m?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsx(K,{onboardingData:S})}),e.jsx(Pe,{task:m,takeoverState:D,onTakeover:R,onRelease:ie}),l&&s&&e.jsx(Ee,{taskId:s,confirm:l,onSubmitted:u}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(he,{taskId:s,sessionId:m.currentSessionId??void 0,taskFinished:w,onStatusChange:F,onTakeoverChange:T,ref:I},s)}),e.jsx(De,{task:m,ptyStatus:E})]}):e.jsx(X,{onboardingData:S})})]}):e.jsx(X,{onboardingData:S})})]})}export{Je as default};
@@ -1 +0,0 @@
1
- import{a as C,r as n,j as e,h as w,f as M,E as O,Y as k,U as $,a3 as T,v as V}from"./index-D3ZK8e35.js";import{K as E}from"./key-BjxaakEN.js";import{C as S}from"./copy-BckVr8cJ.js";import{E as K}from"./external-link-BWs-24k_.js";import{E as P}from"./EmptyState-9Eqw0iR8.js";import{T as W}from"./Skeleton-DI-HCY-N.js";import{u as B}from"./useFetch-CSoNR_l8.js";import{e as R}from"./status-colors-BgploKhY.js";import{P as J}from"./plus-DfeF35ew.js";function z({isOpen:a,onClose:y,onCreated:b}){const{t:s}=C(),[r,c]=n.useState(""),[i,d]=n.useState(!1),[l,v]=n.useState("");function h(){c(""),v(""),y()}async function x(){if(v(""),!r.trim()){v(s("admin.pat_label_required"));return}try{d(!0);const o=await w.post("admin/worker-tokens",{json:{label:r.trim()}}).json();c(""),b({token:o.token,id:o.id})}catch(o){const m=o instanceof Error?o.message:s("admin.pat_failed_to_generate");v(m)}finally{d(!1)}}return a?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&h()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{maxWidth:"480px",borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:[e.jsx(E,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:s("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[l&&e.jsx("div",{className:"border border-[var(--destructive)]/30 bg-[var(--destructive)]/10 px-3 py-2 text-xs text-[var(--destructive)]",style:{borderRadius:"4px"},children:l}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("admin.label")}),e.jsx("input",{type:"text",placeholder:s("admin.pat_label_placeholder"),value:r,onChange:o=>c(o.target.value),className:"w-full border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},onKeyDown:o=>{o.key==="Enter"&&x()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("admin.label_identifies_worker")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[e.jsx("button",{onClick:h,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s("common.cancel")}),e.jsx("button",{onClick:x,disabled:i,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80 disabled:opacity-50",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s(i?"admin.generating":"admin.generate")})]})]})}):null}const U=3e3,X=600*1e3;function q({isOpen:a,token:y,tokenId:b,onClose:s}){const{t:r}=C(),[c,i]=n.useState("command"),[d,l]=n.useState(!1),[v,h]=n.useState(!1),[x,o]=n.useState(""),[m,g]=n.useState(null),p=n.useRef(void 0),N=n.useRef(Date.now()),_=M(),j=typeof window<"u"?window.location.origin:"https://overlord.example.com",t=`overlord setup worker --token ${y} --server ${j}`;async function D(){try{await navigator.clipboard.writeText(y),l(!0),setTimeout(()=>l(!1),2e3)}catch{}}async function L(){try{await navigator.clipboard.writeText(t),h(!0),setTimeout(()=>h(!1),2e3)}catch{}}const A=n.useCallback(async()=>{try{const f=await w.get(`admin/worker-tokens/${b}/status`).json();f.status==="used"&&f.worker_name&&(i("success"),o(f.worker_name),g(f.worker_id??null),p.current&&clearInterval(p.current))}catch{}Date.now()-N.current>X&&(i("timeout"),p.current&&clearInterval(p.current))},[b]);function F(){i("waiting"),N.current=Date.now(),p.current=setInterval(A,U)}n.useEffect(()=>()=>{p.current&&clearInterval(p.current)},[]);function I(){s(),m&&_(`/workers/${m}`)}if(!a)return null;const u={fontFamily:"'JetBrains Mono', monospace",borderRadius:"4px"};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:f=>{f.target===f.currentTarget&&s()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...u,maxWidth:"480px"},children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:c==="success"?e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:r("admin.worker_registered")})]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:r("admin.worker_token_generated")})]})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[c!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("admin.run_command_desc")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:"Token"}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsx("code",{className:"block break-all pr-20 text-xs text-[var(--text-primary)]",children:y}),e.jsx("button",{onClick:D,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:d?e.jsx("span",{className:"text-[var(--accent)]",children:r("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"h-3 w-3"})," ",r("common.copy")]})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:r("admin.setup_command")}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsxs("code",{className:"block break-all pr-20 text-xs text-[var(--accent)]",children:["$ ",t]}),e.jsx("button",{onClick:L,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:v?e.jsx("span",{className:"text-[var(--accent)]",children:r("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"h-3 w-3"})," ",r("common.copy")]})})]})]}),e.jsx("div",{className:"border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-400",style:{borderRadius:"4px"},children:r("admin.token_shown_once")})]}),c==="waiting"&&e.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("admin.waiting_for_worker")})]}),c==="timeout"&&e.jsx("div",{className:"border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3 text-xs text-[var(--text-muted)]",style:{borderRadius:"4px"},children:r("admin.token_not_yet_used")}),c==="success"&&e.jsxs("div",{className:"border border-[var(--accent)]/30 bg-[var(--accent)]/10 px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("p",{className:"text-xs text-[var(--accent)]",children:r("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[r("admin.worker"),": ",e.jsx("span",{className:"text-[var(--accent)]",children:x})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[c==="command"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),e.jsx("button",{onClick:F,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80",style:u,children:r("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),e.jsxs("button",{onClick:I,className:"flex items-center gap-1.5 bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80",style:u,children:[e.jsx(K,{className:"h-3 w-3"}),r("admin.view_worker")]})]})]})]})})}function se(){const{t:a}=C(),[y,b]=n.useState(!1),[s,r]=n.useState(null),[c,i]=n.useState(!1),[d,l]=n.useState(null),[v,h]=n.useState(!1),[x,o]=n.useState(!1),{data:m,loading:g,refetch:p}=B(()=>w.get("admin/worker-tokens").json(),[]);async function N(){if(d){h(!0);try{await w.post(`admin/worker-tokens/${d.id}/revoke`),i(!1),l(null),p()}catch{}finally{h(!1)}}}function _(t){b(!1),r(t),p()}const j=n.useMemo(()=>(m??[]).filter(t=>x||t.status!==k.REVOKED),[m,x]);return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.tokens_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>b(!0),children:[e.jsx(J,{className:"h-3.5 w-3.5"}),a("admin.generate_token")]})]}),!g&&(m==null?void 0:m.some(t=>t.status===k.REVOKED))&&e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:()=>o(!x),className:`text-xs transition-colors ${x?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(x?"admin.hide_revoked":"admin.show_revoked")})}),g?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(W,{rows:3})}):j.length===0?e.jsx(P,{icon:$,title:a("admin.no_worker_tokens"),description:a("admin.generate_token_desc"),actionLabel:a("admin.generate_token"),onAction:()=>b(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:a("common.actions")})]})}),e.jsx("tbody",{children:j.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:t.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:R(t.status),children:t.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:t.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(t.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:t.status===k.ACTIVE&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{l(t),i(!0)},children:[e.jsx(T,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},t.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:j.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)] font-medium truncate mr-2",children:t.label}),e.jsx("span",{className:`text-[11px] shrink-0 ${R(t.status)}`,children:t.status})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-secondary)] truncate mb-1",children:t.purpose}),e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:new Date(t.createdAt).toLocaleDateString()}),t.expiresAt&&e.jsx("span",{children:new Date(t.expiresAt).toLocaleDateString()})]}),t.status===k.ACTIVE&&e.jsx("div",{className:"mt-2 pt-2 border-t border-[var(--border)]",children:e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-[11px] text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{l(t),i(!0)},children:[e.jsx(T,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},t.id))})]}),e.jsx(z,{isOpen:y,onClose:()=>b(!1),onCreated:_}),s&&e.jsx(q,{isOpen:!!s,token:s.token,tokenId:s.id,onClose:()=>r(null)}),e.jsx(V,{isOpen:c,onClose:()=>{i(!1),l(null)},onConfirm:N,title:a("admin.revoke_token"),message:a("admin.revoke_token_confirm",{label:(d==null?void 0:d.label)??""}),confirmLabel:a("admin.revoke"),confirmVariant:"danger",isLoading:v})]})}export{se as default};
@@ -1 +0,0 @@
1
- import{a as u,j as e,v as A,A as H,f as P,r as m,u as R,k as D,w as V,W as c,D as S,L as z,I,h,l as B,n as J}from"./index-D3ZK8e35.js";import{t as K,c as E}from"./date-RFA7-ZGs.js";import{w as Q,b as X,t as Y}from"./status-colors-BgploKhY.js";import{I as i}from"./InfoRow-C3ZXZz4q.js";import{M as N}from"./MetricBar-CixGVqjI.js";import{u as Z}from"./useFetch-CSoNR_l8.js";import{T as ee}from"./Tooltip-DrIj1IXL.js";import{T as M}from"./trash-2-B6XaTY-0.js";import{A as re}from"./arrow-left-BwtdfCwD.js";function se({isOpen:t,onClose:a,onConfirm:r,workerName:o,isDraining:l,loading:j}){const{t:d}=u();return e.jsx(A,{isOpen:t,onClose:a,onConfirm:r,title:d(l?"workers.undrain_worker_title":"workers.drain_worker_title"),message:l?d("workers.undrain_confirm",{name:o}):d("workers.drain_confirm",{name:o}),confirmLabel:d(l?"workers.undrain":"workers.drain"),confirmVariant:l?"accent":"warning",isLoading:j})}function ue(){const{id:t}=H(),a=P(),{t:r}=u(),[o,l]=m.useState(!1),[j,d]=m.useState(!1),[T,p]=m.useState(!1),[$,y]=m.useState(!1),w=R(n=>{var v;return(v=n.user)==null?void 0:v.role}),F=D(n=>n.workerSeq),U=D(n=>n.taskSeq),{data:x,loading:W,error:_,refetch:C}=Z(async()=>{if(!t)throw new Error("Missing worker ID");const[n,v]=await Promise.all([h.get(`web/workers/${t}`).json(),h.get(`web/workers/${t}/tasks`).json().catch(()=>[])]);return{worker:n,tasks:v}},[t,F,U]),s=(x==null?void 0:x.worker)??null,g=(x==null?void 0:x.tasks)??[];V(m.useMemo(()=>!s||s.status===c.DECOMMISSIONED?null:e.jsxs("div",{className:"flex items-center gap-2",children:[s.status===c.ONLINE&&e.jsxs("button",{onClick:()=>l(!0),className:"rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",r("workers.drain")]}),w===S.ADMIN&&e.jsxs("button",{onClick:()=>p(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(M,{className:"h-3 w-3"}),r("workers.decommission")]})]}),[s,w,r]));async function q(){if(s){d(!0);try{const n=s.status===c.DRAINING?"undrain":"drain";await h.post(`web/workers/${s.id}/${n}`),await C()}catch{}finally{d(!1),l(!1)}}}async function G(){if(s){y(!0);try{await h.delete(`admin/workers/${s.id}`),a("/workers")}catch{}finally{y(!1),p(!1)}}}if(W)return e.jsx("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("workers.loading_worker")})});if(_)return e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--destructive)]",children:_}),e.jsx("button",{onClick:()=>C(),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("common.retry")})]});if(!s)return e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:r("workers.worker_not_found")}),e.jsxs("button",{onClick:()=>a("/workers"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",r("workers.back_to_workers")]})]});const b=s.status===c.DRAINING,k=s.status!==c.DECOMMISSIONED;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("button",{onClick:()=>a("/workers"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(re,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),!b&&s.status!==c.OFFLINE&&k&&e.jsxs("button",{onClick:()=>l(!0),className:"shrink-0 rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",r("workers.drain")]})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[b?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(z,{to:"/workers",className:"text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:r("workers.title")}),e.jsx("span",{className:"text-[var(--text-muted)]",children:"/"}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[k&&e.jsxs("button",{onClick:()=>l(!0),className:"rounded-[4px] border border-[var(--accent)] px-4 py-1.5 text-xs text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:["> ",r("workers.undrain")]}),w===S.ADMIN&&k&&e.jsxs("button",{onClick:()=>p(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(M,{className:"h-3 w-3"}),r("workers.decommission")]})]})]}),e.jsx("div",{className:"mb-4",children:e.jsx("span",{className:"rounded-[4px] bg-[var(--warning)]/20 px-2.5 py-1 text-xs font-medium text-[var(--warning)]",children:r("workers.draining")})}),e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)]/40 bg-[var(--warning)]/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(I,{className:"h-3.5 w-3.5 text-[var(--warning)]"}),e.jsx("span",{className:"text-xs text-[var(--warning)]",children:r("workers.draining_warning")})]}),e.jsx("p",{className:"text-xs text-[var(--warning)]/70 ml-5.5",children:r("workers.draining_active_tasks")})]}),e.jsxs("div",{className:"mb-6 grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(f,{label:r("workers.cpu"),value:s.cpuUsage,unit:"%"}),e.jsx(f,{label:r("workers.memory"),value:s.memoryUsage,unit:"%"}),e.jsx(f,{label:r("workers.disk"),value:s.diskUsage,unit:"%"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("workers.slots")}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[s.activeSlots,"/",s.maxSlots]})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>a("/workers"),className:"mb-4 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:["< ",r("workers.back_to_workers")]}),e.jsxs("h1",{className:"mb-2 text-lg font-bold text-[var(--text-primary)] flex items-center gap-2",children:[s.name,e.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-normal",style:{color:Q[s.status]},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),s.status.toLowerCase()]})]}),e.jsx("p",{className:"mb-6 text-xs text-[var(--text-muted)]",children:r("workers.last_heartbeat",{time:K(s.lastHeartbeat,"never")})}),s.status===c.DECOMMISSIONED&&e.jsx("div",{className:"mb-6 rounded-[4px] border border-[var(--text-muted)]/40 bg-[var(--text-muted)]/10 p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["this worker has been decommissioned",s.decommissionedAt?` on ${E(s.decommissionedAt)}`:""," and can no longer accept tasks."]})]})}),e.jsxs("div",{className:"mb-6 grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.resource_usage")}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(N,{label:r("workers.cpu"),value:s.cpuUsage}),e.jsx(N,{label:r("workers.mem"),value:s.memoryUsage}),e.jsx(N,{label:r("workers.disk"),value:s.diskUsage})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.connection_info")}),e.jsx(L,{worker:s})]})]})]}),b?e.jsxs(e.Fragment,{children:[e.jsx(O,{title:r("workers.active_tasks"),tasks:g,navigate:a}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:r("workers.capabilities")}),s.capabilities.length>0?e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:s.capabilities.map(n=>e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx("p",{className:"text-xs text-[var(--text-primary)]",children:n})},n))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("workers.no_capabilities_short")})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:r("workers.worker_info")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:e.jsx(L,{worker:s,showExtended:!0})})]})]}):e.jsxs(e.Fragment,{children:[s.capabilities.length>0&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.capabilities")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.capabilities.map(n=>e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)]",children:n},n))})]}),e.jsx(O,{title:`${r("workers.current_tasks")} (${g.length})`,tasks:g,navigate:a})]})]})]}),e.jsx(se,{isOpen:o,onClose:()=>l(!1),onConfirm:q,workerName:s.name,isDraining:b,loading:j}),e.jsx(A,{isOpen:T,onClose:()=>p(!1),onConfirm:G,title:r("workers.decommission_title"),message:r("workers.decommission_confirm",{name:s.name}),confirmLabel:r("workers.decommission"),confirmVariant:"danger",isLoading:$})]})}function L({worker:t,showExtended:a=!1}){const{t:r}=u();return e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(i,{label:r("workers.worker_id"),value:t.id}),e.jsx(i,{label:r("workers.host"),value:t.host}),e.jsx(i,{label:r("workers.port"),value:String(t.port)}),e.jsx(i,{label:r("workers.os"),value:t.os??r("workers.unknown")}),e.jsx(i,{label:r("workers.cpu_model"),value:t.cpuModel??r("workers.n_a")}),e.jsx(i,{label:r("workers.cpu_cores"),value:t.cpuCores!=null?String(t.cpuCores):r("workers.n_a")}),e.jsx(i,{label:r("workers.memory"),value:t.memoryGb!=null?`${t.memoryGb} gb`:r("workers.n_a")}),e.jsx(i,{label:r("workers.last_heartbeat_label"),value:E(t.lastHeartbeat)}),e.jsx(i,{label:r("workers.slots"),value:`${t.activeSlots}/${t.maxSlots}`}),a&&e.jsxs(e.Fragment,{children:[e.jsx(i,{label:r("workers.status_label"),value:t.status.toLowerCase()}),e.jsx(i,{label:r("workers.worker_version"),value:t.workerVersion??r("workers.n_a")})]})]})}function O({title:t,tasks:a,navigate:r}){const{t:o}=u();return e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:t}),a.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:o("workers.no_active_tasks")})]}):e.jsx(te,{tasks:a,navigate:r})]})}function te({tasks:t,navigate:a}){const{t:r}=u();return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.id")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.description")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.status_label")}),e.jsx("th",{className:"py-2 text-left font-normal text-[var(--text-muted)]",children:r("workers.stage")})]})}),e.jsx("tbody",{children:t.map(o=>e.jsxs("tr",{onClick:()=>a(`/tasks/${o.id}`),className:"cursor-pointer border-b border-[var(--border-row)] hover:bg-[var(--bg-input)] transition-colors",children:[e.jsxs("td",{className:"py-2 pr-4 text-[var(--text-primary)]",children:["#",o.id]}),e.jsx("td",{className:"max-w-[120px] md:max-w-xs truncate py-2 pr-4 text-[var(--text-secondary)]",children:e.jsx(ee,{content:J(o),children:B(o)})}),e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("span",{style:{color:Y[o.status]},children:["● ",o.status.toLowerCase()]})}),e.jsx("td",{className:"py-2 text-[var(--text-secondary)]",children:o.currentStage??"-"})]},o.id))})]})})}function f({label:t,value:a,unit:r}){const o=Math.round(a*100);return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[o,r]}),e.jsx("div",{className:"mt-3 h-1.5 w-full rounded-[2px] bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-[2px] transition-all",style:{width:`${o}%`,backgroundColor:X(a)}})})]})}export{ue as default};
@@ -1,6 +0,0 @@
1
- import{c as G,R as U,a as C,j as e,r as o,h as S,X as q,E as K,f as H,u as V,k as X,W as N,w as J,D as Q,S as M}from"./index-D3ZK8e35.js";import{w as W}from"./status-colors-BgploKhY.js";import{M as _}from"./MetricBar-CixGVqjI.js";import Y from"./WorkerSetupGuidePage-C_GA4jv_.js";import{C as z}from"./copy-BckVr8cJ.js";import{L as Z}from"./loader-circle-fKTUhuFx.js";import{S as ee}from"./Select-CkMgU0Lq.js";import{E as te}from"./EmptyState-9Eqw0iR8.js";import{C as re}from"./Skeleton-DI-HCY-N.js";import{u as se}from"./useFetch-CSoNR_l8.js";import{P as ae}from"./plus-DfeF35ew.js";import"./key-BjxaakEN.js";import"./download-DnrLGHSN.js";import"./settings-BQ40mw10.js";import"./wifi-D9JcPn5X.js";/**
2
- * @license lucide-react v0.469.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const oe=G("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]),ne=U.memo(function({worker:r,onClick:l}){const{t}=C();return e.jsxs("div",{onClick:l,className:`rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 font-mono lowercase transition-colors ${l?"cursor-pointer hover:border-[var(--accent)]/40 hover:bg-[var(--bg-input)]":""}`,children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("h3",{className:"truncate text-sm text-[var(--text-primary)]",children:[e.jsx("span",{style:{color:W[r.status],fontSize:"0.6rem"},children:"●"})," ",r.name]}),e.jsx("span",{className:"text-xs",style:{color:W[r.status]},children:r.status})]}),e.jsxs("div",{className:"mb-3 text-xs text-[var(--text-muted)]",children:[r.host,r.os?`:${r.os}`:""]}),e.jsxs("div",{className:"mb-3 flex flex-col gap-2",children:[e.jsx(_,{label:t("workers.cpu"),value:r.cpuUsage,variant:"inline"}),e.jsx(_,{label:t("workers.mem"),value:r.memoryUsage,variant:"inline"}),e.jsx(_,{label:t("workers.disk"),value:r.diskUsage,variant:"inline"})]}),e.jsx("div",{className:"flex items-center justify-between text-xs",children:e.jsx("span",{className:"text-[var(--text-secondary)]",children:t("workers.tasks_slots",{active:String(r.activeSlots),max:String(r.maxSlots)})})}),r.capabilities.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:r.capabilities.map(s=>e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:s},s))})]})});function le({isOpen:d,onClose:r,onRegistered:l}){const{t}=C(),[s,c]=o.useState(1),[v,p]=o.useState(!1),[i,m]=o.useState(""),[u,g]=o.useState(null),[b,h]=o.useState(""),[k,a]=o.useState(""),[j,y]=o.useState(!1),[A,w]=o.useState(!1),[F,T]=o.useState(""),[I,E]=o.useState(""),x=o.useRef(null),O={1:t("workers.reg_step_generate_token"),2:t("workers.reg_step_install_worker"),3:t("workers.reg_step_waiting_activation"),4:t("workers.reg_step_activated")};o.useEffect(()=>(d&&(c(1),m(""),g(null),h(""),a(""),y(!1),w(!1),T(""),E(""),p(!1)),()=>{x.current&&clearInterval(x.current)}),[d]);const $=async()=>{const n=b.trim();if(!n){a(t("admin.pat_label_required"));return}a(""),p(!0);try{const f=await S.post("admin/worker-tokens",{json:{label:n}}).json();m(f.token),g(f.tokenId),c(2)}catch{}finally{p(!1)}},P=typeof window<"u"?window.location.origin:"https://overlord.example.com",L=i?`overlord setup worker --token ${i} --server ${P}`:"",R=()=>{navigator.clipboard.writeText(i),y(!0),setTimeout(()=>y(!1),2e3)},D=()=>{navigator.clipboard.writeText(L),w(!0),setTimeout(()=>w(!1),2e3)},B=o.useCallback(()=>{u&&(c(3),x.current=setInterval(async()=>{try{const n=await S.get(`admin/worker-tokens/${u}/status`).json();n.used&&n.workerName&&(T(n.workerName),E(n.workerId??""),c(4),x.current&&clearInterval(x.current),l==null||l())}catch{}},3e3))},[u,l]);return o.useEffect(()=>()=>{x.current&&clearInterval(x.current)},[]),d?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center font-mono lowercase",children:[e.jsx("div",{className:"absolute inset-0 bg-[var(--bg-primary)]/60 backdrop-blur-sm",onClick:r}),e.jsxs("div",{className:"relative z-10 w-full max-w-[1080px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8",children:[e.jsx("button",{type:"button",onClick:r,className:"absolute right-4 top-4 text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:e.jsx(q,{className:"h-4 w-4"})}),e.jsx("h2",{className:"text-lg font-bold text-[var(--accent)]",children:t("workers.reg_title")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:t("workers.reg_subtitle")}),e.jsx("div",{className:"mt-6 flex items-center justify-center gap-2",children:[1,2,3,4].map((n,f)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:`rounded-[4px] px-3 py-1.5 text-[11px] font-bold ${n===s?"bg-[var(--accent)] text-black":n<s?"bg-[var(--accent)]/20 text-[var(--accent)]":"border border-[var(--border)] bg-[var(--bg-primary)] text-[var(--text-muted)]"}`,children:[n,". ",O[n]]}),f<3&&e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"→"})]},n))}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:`rounded-[4px] border p-4 ${s===1?"border-[var(--accent)] bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--accent)]",children:["> ",t("workers.reg_step_generate_token")]}),s===1&&!i?e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:t("workers.reg_click_to_generate")}),k&&e.jsx("p",{className:"text-[11px] text-red-400",children:k}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-[11px] text-[var(--text-muted)]",children:t("admin.label")}),e.jsx("input",{type:"text",placeholder:t("admin.pat_label_placeholder"),value:b,onChange:n=>h(n.target.value),onKeyDown:n=>{n.key==="Enter"&&$()},className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-[11px] text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none"})]}),e.jsx("button",{type:"button",onClick:$,disabled:v,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black disabled:opacity-50",children:t(v?"admin.generating":"workers.reg_step_generate_token")})]}):i?e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:t("workers.reg_token_generated")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:"Token"}),e.jsxs("div",{className:"relative rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 pr-16",children:[e.jsx("code",{className:"block break-all text-[11px] text-[var(--text-primary)]",children:i}),e.jsx("button",{type:"button",onClick:R,className:"absolute right-2 top-1.5 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:j?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(z,{className:"h-3 w-3"})," ",t("common.copy")]})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:t("admin.setup_command")}),e.jsxs("div",{className:"relative rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 pr-16",children:[e.jsxs("code",{className:"block break-all text-[11px] text-[var(--accent)]",children:["$ ",L]}),e.jsx("button",{type:"button",onClick:D,className:"absolute right-2 top-1.5 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:A?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(z,{className:"h-3 w-3"})," ",t("common.copy")]})})]})]}),e.jsx("div",{className:"rounded-[4px] border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-[11px] text-yellow-400",children:t("admin.token_shown_once")})]}):e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:t("workers.reg_completed")})]}),e.jsxs("div",{className:`rounded-[4px] border p-4 ${s===2?"border-[var(--accent)] bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--text-primary)]",children:["> ",t("workers.reg_step_install_worker")]}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:t("workers.reg_running_installation")}),s>=2&&e.jsxs("div",{className:"mt-3 space-y-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-primary)]",children:"$ overlord setup worker"}),e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:"server url: https://..."}),e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:"worker token: ovw_..."}),e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:"worker name: my-worker"}),e.jsx("p",{className:"text-[11px] text-[var(--accent)]",children:"config written. starting worker..."}),s===2&&e.jsx("p",{className:"text-[11px] text-[var(--accent)] animate-pulse",children:"&block;"})]}),s===2&&e.jsx("button",{type:"button",onClick:B,className:"mt-3 rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black",children:t("workers.reg_installed_wait")})]}),e.jsxs("div",{className:`rounded-[4px] border p-4 ${s===3?"border-amber-500 bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--text-primary)]",children:["> ",t("workers.reg_step_waiting_activation")]}),s>=3?e.jsx("div",{className:"mt-3 flex flex-col items-center justify-center gap-3 py-6",children:s===3?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border-2 border-amber-500",children:e.jsx(Z,{className:"h-5 w-5 animate-spin text-amber-500"})}),e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:t("workers.reg_listening_for_worker")})]}):e.jsx("p",{className:"text-[11px] text-[var(--accent)]",children:t("workers.reg_worker_connected")})}):e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:t("workers.reg_waiting_for_worker")})]}),e.jsxs("div",{className:`rounded-[4px] border p-4 ${s===4?"border-[var(--accent)] bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--text-primary)]",children:["> ",t("workers.reg_step_activated")]}),s===4?e.jsxs("div",{className:"mt-3 flex flex-col items-center justify-center gap-3 py-6",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-[var(--accent)]/20",children:e.jsx(K,{className:"h-6 w-6 text-[var(--accent)]"})}),e.jsx("p",{className:"text-xs font-bold text-[var(--accent)]",children:t("workers.reg_worker_activated",{name:F})}),I&&e.jsxs("p",{className:"text-[11px] text-[var(--text-muted)]",children:["worker_id: ",I]})]}):e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:t("workers.reg_worker_registered")})]})]}),s===4&&e.jsx("div",{className:"mt-6 flex justify-end",children:e.jsx("button",{type:"button",onClick:r,className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-xs font-bold text-black",children:t("workers.reg_done")})})]})]}):null}function we(){const d=H(),{t:r}=C(),[l,t]=o.useState("all"),[s,c]=o.useState("fleet"),[v,p]=o.useState(!1),[i,m]=o.useState(0),u=V(a=>{var j;return(j=a.user)==null?void 0:j.role}),g=X(a=>a.workerSeq),{data:b,loading:h}=se(()=>{const a={};return l!=="all"&&(a.status=l),S.get("web/workers",{searchParams:a}).json()},[l,i,g]),k=o.useMemo(()=>[{value:"all",label:r("workers.all_statuses")},{value:N.ONLINE,label:r("workers.online")},{value:N.OFFLINE,label:r("workers.offline")},{value:N.DRAINING,label:r("workers.draining")}],[r]);return J(o.useMemo(()=>u===Q.ADMIN?e.jsxs("button",{type:"button",onClick:()=>p(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",children:[e.jsx(ae,{size:14}),r("workers.register_worker")]}):null,[u,r])),e.jsxs("div",{className:"mx-auto max-w-6xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between border-b border-[var(--border)]",children:[e.jsxs("div",{className:"flex overflow-x-auto no-scrollbar",children:[e.jsxs("button",{type:"button",onClick:()=>{c("fleet"),m(a=>a+1)},className:`flex shrink-0 whitespace-nowrap items-center gap-2 px-4 py-2.5 text-xs transition-colors ${s==="fleet"?"border-b-2 border-[var(--accent)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:[e.jsx(M,{size:14}),r("workers.fleet")]}),e.jsxs("button",{type:"button",onClick:()=>c("setup_guide"),className:`flex shrink-0 whitespace-nowrap items-center gap-2 px-4 py-2.5 text-xs transition-colors ${s==="setup_guide"?"border-b-2 border-[var(--accent)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:[e.jsx(oe,{size:14}),r("workers.setup_guide")]})]}),s==="fleet"&&e.jsx(ee,{value:l,onChange:t,options:k})]}),s==="fleet"?h?e.jsx(re,{cards:6}):!b||b.length===0?e.jsx(te,{icon:M,title:r("workers.no_workers_found"),description:r(l!=="all"?"workers.try_changing_status_filter":"workers.no_workers_registered"),action:e.jsx("button",{type:"button",onClick:()=>c("setup_guide"),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:r("workers.view_setup_guide")})}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:(b??[]).map(a=>e.jsx(ne,{worker:a,onClick:()=>d(`/workers/${a.id}`)},a.id))}):e.jsx(Y,{}),e.jsx(le,{isOpen:v,onClose:()=>{p(!1),m(a=>a+1)},onRegistered:()=>{m(a=>a+1)}})]})}export{we as default};
@@ -1 +0,0 @@
1
- @import"https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap";/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-blue-400:oklch(70.7% .165 254.624);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.-top-40{top:calc(var(--spacing) * -40)}.top-0{top:calc(var(--spacing) * 0)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-4{top:calc(var(--spacing) * 4)}.top-8{top:calc(var(--spacing) * 8)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-20{bottom:calc(var(--spacing) * 20)}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.z-\[100\]{z-index:100}.z-\[9999\]{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-1\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mt-14{margin-top:calc(var(--spacing) * 14)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-5\.5{margin-left:calc(var(--spacing) * 5.5)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-\[600px\]{height:600px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\[50vh\]{max-height:50vh}.max-h-\[300px\]{max-height:300px}.max-h-\[400px\]{max-height:400px}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-\[44px\]{min-height:44px}.min-h-\[100px\]{min-height:100px}.min-h-\[200px\]{min-height:200px}.min-h-\[300px\]{min-height:300px}.min-h-screen{min-height:100vh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-80{width:calc(var(--spacing) * 80)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[280px\]{width:280px}.w-\[360px\]{width:360px}.w-\[420px\]{width:420px}.w-\[900px\]{width:900px}.w-\[min\(320px\,calc\(100vw-2rem\)\)\]{width:min(320px,100vw - 2rem)}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[60\%\]{max-width:60%}.max-w-\[80px\]{max-width:80px}.max-w-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[340px\]{max-width:340px}.max-w-\[380px\]{max-width:380px}.max-w-\[400px\]{max-width:400px}.max-w-\[480px\]{max-width:480px}.max-w-\[600px\]{max-width:600px}.max-w-\[640px\]{max-width:640px}.max-w-\[1080px\]{max-width:1080px}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-3{min-width:calc(var(--spacing) * 3)}.min-w-\[44px\]{min-width:44px}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[2px\]{--tw-translate-x:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[18px\]{--tw-translate-x:18px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[36px_90px_1fr_120px_60px_80px\]{grid-template-columns:36px 90px 1fr 120px 60px 80px}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-around{justify-content:space-around}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}:where(.-space-x-1\.5>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * -1.5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * -1.5) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-1{row-gap:calc(var(--spacing) * 1)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--border\)\]>:not(:last-child)){border-color:var(--border)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-\[2px\]{border-radius:2px}.rounded-\[3px\]{border-radius:3px}.rounded-\[4px\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[var\(--accent\)\],.border-\[var\(--accent\)\]\/20{border-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--accent\)\]\/20{border-color:color-mix(in oklab,var(--accent) 20%,transparent)}}.border-\[var\(--accent\)\]\/30{border-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--accent\)\]\/30{border-color:color-mix(in oklab,var(--accent) 30%,transparent)}}.border-\[var\(--accent\)\]\/40{border-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--accent\)\]\/40{border-color:color-mix(in oklab,var(--accent) 40%,transparent)}}.border-\[var\(--bg-card\)\]{border-color:var(--bg-card)}.border-\[var\(--border\)\]{border-color:var(--border)}.border-\[var\(--border-row\)\]{border-color:var(--border-row)}.border-\[var\(--destructive\)\],.border-\[var\(--destructive\)\]\/30{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--destructive\)\]\/30{border-color:color-mix(in oklab,var(--destructive) 30%,transparent)}}.border-\[var\(--destructive\)\]\/40{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--destructive\)\]\/40{border-color:color-mix(in oklab,var(--destructive) 40%,transparent)}}.border-\[var\(--text-muted\)\]\/40{border-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--text-muted\)\]\/40{border-color:color-mix(in oklab,var(--text-muted) 40%,transparent)}}.border-\[var\(--warning\)\],.border-\[var\(--warning\)\]\/40{border-color:var(--warning)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--warning\)\]\/40{border-color:color-mix(in oklab,var(--warning) 40%,transparent)}}.border-amber-500{border-color:var(--color-amber-500)}.border-black\/30{border-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.border-black\/30{border-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.border-green-500\/20{border-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.border-green-500\/20{border-color:color-mix(in oklab,var(--color-green-500) 20%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500) 30%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-red-900{border-color:var(--color-red-900)}.border-transparent{border-color:#0000}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500) 30%,transparent)}}.border-t-\[var\(--accent\)\]{border-top-color:var(--accent)}.border-t-black{border-top-color:var(--color-black)}.border-t-transparent{border-top-color:#0000}.bg-\[\#0C0C0C\],.bg-\[\#0c0c0c\]{background-color:#0c0c0c}.bg-\[\#1a1a1a\]{background-color:#1a1a1a}.bg-\[\#2a1515\]{background-color:#2a1515}.bg-\[\#525252\]{background-color:#525252}.bg-\[var\(--accent\)\],.bg-\[var\(--accent\)\]\/5{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent\)\]\/5{background-color:color-mix(in oklab,var(--accent) 5%,transparent)}}.bg-\[var\(--accent\)\]\/10{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent\)\]\/10{background-color:color-mix(in oklab,var(--accent) 10%,transparent)}}.bg-\[var\(--accent\)\]\/15{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent\)\]\/15{background-color:color-mix(in oklab,var(--accent) 15%,transparent)}}.bg-\[var\(--accent\)\]\/20{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent\)\]\/20{background-color:color-mix(in oklab,var(--accent) 20%,transparent)}}.bg-\[var\(--accent\)\]\/\[0\.06\]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent\)\]\/\[0\.06\]{background-color:color-mix(in oklab,var(--accent) 6%,transparent)}}.bg-\[var\(--accent\)\]\/\[0\.08\]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent\)\]\/\[0\.08\]{background-color:color-mix(in oklab,var(--accent) 8%,transparent)}}.bg-\[var\(--bg-card\)\]{background-color:var(--bg-card)}.bg-\[var\(--bg-input\)\]{background-color:var(--bg-input)}.bg-\[var\(--bg-primary\)\],.bg-\[var\(--bg-primary\)\]\/60{background-color:var(--bg-primary)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--bg-primary\)\]\/60{background-color:color-mix(in oklab,var(--bg-primary) 60%,transparent)}}.bg-\[var\(--bg-primary\)\]\/80{background-color:var(--bg-primary)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--bg-primary\)\]\/80{background-color:color-mix(in oklab,var(--bg-primary) 80%,transparent)}}.bg-\[var\(--border\)\]{background-color:var(--border)}.bg-\[var\(--destructive\)\],.bg-\[var\(--destructive\)\]\/5{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--destructive\)\]\/5{background-color:color-mix(in oklab,var(--destructive) 5%,transparent)}}.bg-\[var\(--destructive\)\]\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--destructive\)\]\/10{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.bg-\[var\(--modal-backdrop\)\]{background-color:var(--modal-backdrop)}.bg-\[var\(--text-muted\)\]\/10{background-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--text-muted\)\]\/10{background-color:color-mix(in oklab,var(--text-muted) 10%,transparent)}}.bg-\[var\(--warning\)\],.bg-\[var\(--warning\)\]\/10{background-color:var(--warning)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--warning\)\]\/10{background-color:color-mix(in oklab,var(--warning) 10%,transparent)}}.bg-\[var\(--warning\)\]\/20{background-color:var(--warning)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--warning\)\]\/20{background-color:color-mix(in oklab,var(--warning) 20%,transparent)}}.bg-green-500\/5{background-color:#00c7580d}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/5{background-color:color-mix(in oklab,var(--color-green-500) 5%,transparent)}}.bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/10{background-color:color-mix(in oklab,var(--color-green-500) 10%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-950{background-color:var(--color-red-950)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-500\/10{background-color:#edb2001a}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/10{background-color:color-mix(in oklab,var(--color-yellow-500) 10%,transparent)}}.bg-yellow-600{background-color:var(--color-yellow-600)}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-12{padding-inline:calc(var(--spacing) * 12)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pt-\[calc\(var\(--safe-area-top\,0px\)\+16px\)\]{padding-top:calc(var(--safe-area-top,0px) + 16px)}.pt-\[var\(--safe-area-top\,0px\)\]{padding-top:var(--safe-area-top,0px)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-16{padding-right:calc(var(--spacing) * 16)}.pr-20{padding-right:calc(var(--spacing) * 20)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-20{padding-bottom:calc(var(--spacing) * 20)}.pb-\[calc\(48px\+var\(--safe-area-bottom\,0px\)\)\]{padding-bottom:calc(48px + var(--safe-area-bottom,0px))}.pl-0{padding-left:calc(var(--spacing) * 0)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-7{padding-left:calc(var(--spacing) * 7)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-text-bottom{vertical-align:text-bottom}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-7xl{font-size:var(--text-7xl);line-height:var(--tw-leading,var(--text-7xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#0c0c0c\]{color:#0c0c0c}.text-\[\#555\]{color:#555}.text-\[\#525252\]{color:#525252}.text-\[\#e4e4e4\]{color:#e4e4e4}.text-\[var\(--accent\)\]{color:var(--accent)}.text-\[var\(--border\)\]{color:var(--border)}.text-\[var\(--destructive\)\]{color:var(--destructive)}.text-\[var\(--info\)\]{color:var(--info)}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.text-\[var\(--text-secondary\)\]{color:var(--text-secondary)}.text-\[var\(--warning\)\],.text-\[var\(--warning\)\]\/70{color:var(--warning)}@supports (color:color-mix(in lab,red,red)){.text-\[var\(--warning\)\]\/70{color:color-mix(in oklab,var(--warning) 70%,transparent)}}.text-amber-500{color:var(--color-amber-500)}.text-black{color:var(--color-black)}.text-blue-400{color:var(--color-blue-400)}.text-green-400{color:var(--color-green-400)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-white{color:var(--color-white)}.text-yellow-400{color:var(--color-yellow-400)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-\[var\(--accent\)\]\/25{--tw-shadow-alpha:25%;--tw-shadow:var(--accent);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_32px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 8px 32px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,min-width\]{transition-property:width,min-width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:flex:is(:where(.group):hover *){display:flex}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}.first\:mt-0:first-child{margin-top:calc(var(--spacing) * 0)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[var\(--accent\)\]:hover,.hover\:border-\[var\(--accent\)\]\/40:hover{border-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.hover\:border-\[var\(--accent\)\]\/40:hover{border-color:color-mix(in oklab,var(--accent) 40%,transparent)}}.hover\:border-\[var\(--destructive\)\]:hover{border-color:var(--destructive)}.hover\:border-\[var\(--text-muted\)\]:hover{border-color:var(--text-muted)}.hover\:bg-\[var\(--accent\)\]:hover,.hover\:bg-\[var\(--accent\)\]\/5:hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--accent\)\]\/5:hover{background-color:color-mix(in oklab,var(--accent) 5%,transparent)}}.hover\:bg-\[var\(--accent\)\]\/10:hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--accent\)\]\/10:hover{background-color:color-mix(in oklab,var(--accent) 10%,transparent)}}.hover\:bg-\[var\(--bg-input\)\]:hover{background-color:var(--bg-input)}.hover\:bg-\[var\(--bg-secondary\)\]:hover{background-color:var(--bg-secondary)}.hover\:bg-\[var\(--border\)\]:hover{background-color:var(--border)}.hover\:bg-\[var\(--destructive\)\]:hover,.hover\:bg-\[var\(--destructive\)\]\/10:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--destructive\)\]\/10:hover{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.hover\:bg-\[var\(--warning\)\]:hover,.hover\:bg-\[var\(--warning\)\]\/10:hover{background-color:var(--warning)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--warning\)\]\/10:hover{background-color:color-mix(in oklab,var(--warning) 10%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.hover\:bg-white\/\[0\.02\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.02\]:hover{background-color:color-mix(in oklab,var(--color-white) 2%,transparent)}}.hover\:bg-white\/\[0\.05\]:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.05\]:hover{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.hover\:text-\[var\(--accent\)\]:hover{color:var(--accent)}.hover\:text-\[var\(--destructive\)\]:hover{color:var(--destructive)}.hover\:text-\[var\(--info\)\]:hover{color:var(--info)}.hover\:text-\[var\(--text-primary\)\]:hover{color:var(--text-primary)}.hover\:text-\[var\(--text-secondary\)\]:hover{color:var(--text-secondary)}.hover\:text-black:hover{color:var(--color-black)}.hover\:text-green-300:hover{color:var(--color-green-300)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-70:hover{opacity:.7}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:border-\[var\(--accent\)\]:focus{border-color:var(--accent)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:scale-\[0\.98\]:active{scale:.98}.active\:bg-\[var\(--bg-input\)\]:active{background-color:var(--bg-input)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:mx-4{margin-inline:calc(var(--spacing) * 4)}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:max-h-\[60vh\]{max-height:60vh}.sm\:w-36{width:calc(var(--spacing) * 36)}.sm\:w-56{width:calc(var(--spacing) * 56)}.sm\:flex-shrink-0{flex-shrink:0}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:gap-6{gap:calc(var(--spacing) * 6)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:py-28{padding-block:calc(var(--spacing) * 28)}.sm\:pt-2{padding-top:calc(var(--spacing) * 2)}.sm\:pt-32{padding-top:calc(var(--spacing) * 32)}.sm\:pb-28{padding-bottom:calc(var(--spacing) * 28)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.sm\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.sm\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}}@media(min-width:48rem){.md\:right-4{right:calc(var(--spacing) * 4)}.md\:bottom-4{bottom:calc(var(--spacing) * 4)}.md\:left-auto{left:auto}.md\:mx-0{margin-inline:calc(var(--spacing) * 0)}.md\:mx-2{margin-inline:calc(var(--spacing) * 2)}.md\:mb-5{margin-bottom:calc(var(--spacing) * 5)}.md\:mb-8{margin-bottom:calc(var(--spacing) * 8)}.md\:ml-auto{margin-left:auto}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:inline{display:inline}.md\:table{display:table}.md\:h-2\.5{height:calc(var(--spacing) * 2.5)}.md\:h-7{height:calc(var(--spacing) * 7)}.md\:h-8{height:calc(var(--spacing) * 8)}.md\:max-h-\[400px\]{max-height:400px}.md\:min-h-0{min-height:calc(var(--spacing) * 0)}.md\:w-2\.5{width:calc(var(--spacing) * 2.5)}.md\:w-7{width:calc(var(--spacing) * 7)}.md\:w-16{width:calc(var(--spacing) * 16)}.md\:w-28{width:calc(var(--spacing) * 28)}.md\:w-40{width:calc(var(--spacing) * 40)}.md\:w-52{width:calc(var(--spacing) * 52)}.md\:w-80{width:calc(var(--spacing) * 80)}.md\:max-w-\[120px\]{max-width:120px}.md\:max-w-\[200px\]{max-width:200px}.md\:max-w-xs{max-width:var(--container-xs)}.md\:min-w-0{min-width:calc(var(--spacing) * 0)}.md\:flex-none{flex:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:flex-wrap{flex-wrap:wrap}.md\:items-center{align-items:center}.md\:items-start{align-items:flex-start}.md\:gap-0{gap:calc(var(--spacing) * 0)}.md\:gap-3{gap:calc(var(--spacing) * 3)}.md\:gap-4{gap:calc(var(--spacing) * 4)}.md\:gap-5{gap:calc(var(--spacing) * 5)}.md\:gap-6{gap:calc(var(--spacing) * 6)}.md\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md\:rounded-none{border-radius:0}.md\:border{border-style:var(--tw-border-style);border-width:1px}.md\:border-0{border-style:var(--tw-border-style);border-width:0}.md\:border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.md\:border-\[var\(--border-row\)\]{border-color:var(--border-row)}.md\:p-0{padding:calc(var(--spacing) * 0)}.md\:p-1\.5{padding:calc(var(--spacing) * 1.5)}.md\:p-4{padding:calc(var(--spacing) * 4)}.md\:p-6{padding:calc(var(--spacing) * 6)}.md\:p-8{padding:calc(var(--spacing) * 8)}.md\:px-0{padding-inline:calc(var(--spacing) * 0)}.md\:px-3{padding-inline:calc(var(--spacing) * 3)}.md\:px-4{padding-inline:calc(var(--spacing) * 4)}.md\:px-5{padding-inline:calc(var(--spacing) * 5)}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:px-8{padding-inline:calc(var(--spacing) * 8)}.md\:py-2{padding-block:calc(var(--spacing) * 2)}.md\:py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}.md\:pt-0{padding-top:calc(var(--spacing) * 0)}.md\:pt-\[15vh\]{padding-top:15vh}.md\:pr-0{padding-right:calc(var(--spacing) * 0)}.md\:pb-0{padding-bottom:calc(var(--spacing) * 0)}.md\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.md\:pb-6{padding-bottom:calc(var(--spacing) * 6)}.md\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.md\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.md\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.md\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.md\:leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.last\:md\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}@media(min-width:64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[1fr_340px\]{grid-template-columns:1fr 340px}.lg\:grid-cols-\[1fr_400px\]{grid-template-columns:1fr 400px}.lg\:p-8{padding:calc(var(--spacing) * 8)}}}:root{--bg-primary:#fafafa;--bg-card:#fff;--bg-input:#f5f5f5;--border:#e5e5e5;--border-row:#d4d4d4;--accent:#22c55e;--destructive:#dc2626;--warning:#d97706;--info:#2563eb;--purple:#9333ea;--muted:#6b7280;--text-primary:#171717;--text-secondary:#525252;--text-muted:#737373;--bg-secondary:#f0f0f0;--modal-backdrop:#0c0c0c99;--content-padding-y:32px;--content-padding-x:40px;--section-gap:32px;--card-gap:16px;--radius:4px;--app-height:100vh}.dark{--bg-primary:#0c0c0c;--bg-card:#171717;--bg-input:#1a1a1a;--border:#1f1f1f;--border-row:#252525;--accent:#22c55e;--destructive:#ef4444;--warning:#f59e0b;--info:#3b82f6;--purple:#a855f7;--muted:#6b7280;--text-primary:#e5e5e5;--text-secondary:#a3a3a3;--bg-secondary:#1f1f1f;--text-muted:#737373}*,:before,:after{border-radius:var(--radius)}html{text-transform:lowercase;font-family:JetBrains Mono,monospace}body{background-color:var(--bg-primary);color:var(--text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-family:JetBrains Mono,monospace}#root{height:100%;min-height:var(--app-height,100dvh)}code,pre,kbd,samp,input[type=password]{text-transform:none}button,[role=button],a,select,label[for],summary,[tabindex]:not([tabindex="-1"]){cursor:pointer}button:disabled,[aria-disabled=true]{cursor:not-allowed}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-color:var(--bg-input);border:1px solid var(--border);color:var(--text-primary);border-radius:4px;font-family:JetBrains Mono,monospace;font-size:.75rem;padding-right:1.75rem!important}select:focus{border-color:var(--accent);outline:none}select option{background-color:var(--bg-card);color:var(--text-primary);font-family:JetBrains Mono,monospace}table{border-collapse:collapse}table tr{border-bottom:1px solid var(--border-row)}table tr:last-child{border-bottom:none}[data-status]{background:0 0!important;border:none!important;padding:0!important}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.no-scrollbar::-webkit-scrollbar{display:none}@supports (padding:env(safe-area-inset-top)){:root{--safe-area-top:env(safe-area-inset-top,0px);--safe-area-bottom:env(safe-area-inset-bottom,0px);--safe-area-left:env(safe-area-inset-left,0px);--safe-area-right:env(safe-area-inset-right,0px)}}@media(display-mode:standalone){body{-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;overscroll-behavior-y:contain}main,article,.selectable{-webkit-user-select:text;user-select:text}}.pwa-standalone body{-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;overscroll-behavior-y:contain;background-color:var(--bg-card)}.pwa-standalone main,.pwa-standalone article,.pwa-standalone .selectable{-webkit-user-select:text;user-select:text}@supports (height:100dvh){:root{--app-height:100dvh}#root{min-height:var(--app-height,100dvh)}}.safe-area-bottom-fill{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom,0px)}@media(pointer:coarse){button:not(:disabled):active,[role=button]:not([aria-disabled=true]):active,a:active{opacity:.7;transition:opacity .1s}html{touch-action:manipulation}}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes slide-up{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}@keyframes slide-down{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(100%)}}.animate-slide-up{animation:.2s ease-out slide-up}.animate-slide-down{animation:.2s ease-in forwards slide-down}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
@@ -1 +0,0 @@
1
- import{o as T,h as n,p as c,F as i}from"./index-D3ZK8e35.js";const h=T((t,r)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0,fetchTasks:async a=>{const s=r()._fetchTasksAbort;s&&s.abort();const o=new AbortController,l=r()._fetchTasksRequestId+1;t({loading:!0,error:null,_fetchTasksAbort:o,_fetchTasksRequestId:l});try{const e={};a!=null&&a.status&&(e.status=a.status),a!=null&&a.projectKey&&(e.projectKey=a.projectKey),a!=null&&a.developerId&&(e.developerId=a.developerId),a!=null&&a.cursor&&(e.cursor=a.cursor),a!=null&&a.limit&&(e.limit=String(a.limit));const f=await n.get("web/tasks",{searchParams:e,signal:o.signal}).json();if(r()._fetchTasksRequestId!==l)return;t({tasks:f.data,nextCursor:f.nextCursor??null,_fetchTasksAbort:null})}catch(e){if(e instanceof DOMException&&e.name==="AbortError")return;r()._fetchTasksRequestId===l&&t({error:e instanceof Error?e.message:"Failed to fetch tasks"})}finally{r()._fetchTasksRequestId===l&&t({loading:!1,_fetchTasksAbort:null})}},fetchTask:async a=>{t({loading:!0,error:null});try{const s=await n.get(`web/tasks/${a}`).json();t({currentTask:s})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch task"})}finally{t({loading:!1})}},createTask:async a=>{t({error:null});try{const s=await n.post("web/tasks",{json:a}).json();return t(o=>({tasks:[s,...o.tasks]})),s}catch(s){throw t({error:s instanceof Error?s.message:"Failed to create task"}),s}},cancelTask:async a=>{t({error:null});try{await n.post(`web/tasks/${a}/cancel`);const{currentTask:s}=r();(s==null?void 0:s.id)===a&&await r().fetchTask(a)}catch(s){throw t({error:s instanceof Error?s.message:"Failed to cancel task"}),s}},reset:()=>{t({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0})}})),u=[c.COMPLETED,c.FAILED,c.CANCELLED],b=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],k=Object.values(i).map(t=>({value:t,label:t})),E=[{value:"",label:"default"},...k];function _(t){return(t??i.CLAUDE).toLowerCase()}export{E as A,k as C,u as T,b as a,_ as g,h as u};